summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2007-04-20 05:44:24 +0200
committerJulien Cristau <jcristau@debian.org>2007-04-20 05:44:24 +0200
commit47edc830808318c9a4761b799c70d7891626effd (patch)
tree3390b25c7812658cdc7f066669e2df9f6f5df187
parent33e34f5bf4a50b4c9e6d5fb5f8d98a33dd1b0de5 (diff)
parent856ae782c7a924d7cf91fadb107f1b30461a9137 (diff)
Merge branch 'debian-experimental' into debian-unstable
Conflicts: configs/debian-osmesa16 configs/debian-osmesa16-static configs/debian-osmesa32 configs/debian-osmesa32-static debian/changelog debian/compat debian/control debian/copyright debian/libgl1-mesa-dev.install debian/libgl1-mesa-swx11-dev.install debian/libgl1-mesa-swx11.shlibs debian/libglu1-mesa-dev.install debian/mesa-common-dev.docs debian/mesa-common-dev.install debian/rules src/mesa/x86-64/matypes.h src/mesa/x86/matypes.h
-rw-r--r--Makefile22
-rwxr-xr-xbin/minstall88
-rwxr-xr-xbin/mklib15
-rw-r--r--configs/CVS/Entries92
-rw-r--r--configs/CVS/Repository1
-rw-r--r--configs/CVS/Root1
-rw-r--r--configs/CVS/Root.bak1
-rw-r--r--configs/CVS/Template0
-rw-r--r--configs/aix1
-rw-r--r--configs/debian25
-rw-r--r--configs/debian-debug7
-rw-r--r--configs/debian-debug_i3867
-rw-r--r--configs/debian-default18
-rw-r--r--configs/debian-directfb16
-rw-r--r--configs/debian-dri45
-rw-r--r--configs/debian-dri-amd649
-rw-r--r--configs/debian-dri-any9
-rw-r--r--configs/debian-dri-default36
-rw-r--r--configs/debian-dri-i3869
-rw-r--r--configs/debian-dri-i386-i68614
-rw-r--r--configs/debian-dri-optimized-default13
-rw-r--r--configs/debian-glide7
-rw-r--r--configs/debian-glide_i3867
-rw-r--r--configs/debian-indirect6
-rw-r--r--configs/debian-osmesa9
-rw-r--r--configs/debian-osmesa-default10
-rw-r--r--configs/debian-osmesa-static9
-rw-r--r--configs/debian-osmesa1617
-rw-r--r--configs/debian-osmesa16-static16
-rw-r--r--configs/debian-osmesa3217
-rw-r--r--configs/debian-osmesa32-static16
-rw-r--r--configs/debian-static33
-rw-r--r--configs/debian-static_i3867
-rw-r--r--configs/debian-swx11+glu-alpha-ev512
-rw-r--r--configs/debian-swx11+glu-amd6410
-rw-r--r--configs/debian-swx11+glu-any9
-rw-r--r--configs/debian-swx11+glu-default14
-rw-r--r--configs/debian-swx11+glu-i38610
-rw-r--r--configs/debian-swx11+glu-i386-i68614
-rw-r--r--configs/debian-swx11+glu-powerpc-60313
-rw-r--r--configs/debian-swx11+glu-ppc6411
-rw-r--r--configs/debian-swx11+glu-sparc10
-rw-r--r--configs/debian-swx11+glu-sparc-ultrasparc13
-rw-r--r--configs/debian-swx11+glu-static-amd6410
-rw-r--r--configs/debian-swx11+glu-static-any10
-rw-r--r--configs/debian-swx11+glu-static-i38610
-rw-r--r--configs/debian-swx11+glu-static-ppc6411
-rw-r--r--configs/debian_i3867
-rw-r--r--configs/default5
-rw-r--r--configs/freebsd3
-rw-r--r--configs/freebsd-dri10
-rw-r--r--configs/linux-dri5
-rw-r--r--configs/linux-dri-x86-642
-rw-r--r--configs/linux-dri-xcb5
-rw-r--r--configs/linux-fbdev10
-rw-r--r--configs/linux-indirect1
-rw-r--r--configs/linux-osmesa-static14
-rw-r--r--configs/linux-osmesa32-static28
-rw-r--r--configs/linux-static5
-rw-r--r--debian/README.build45
-rw-r--r--debian/changelog113
-rw-r--r--debian/compat2
-rw-r--r--debian/control221
-rw-r--r--debian/copyright14
-rw-r--r--debian/drivers.map3
-rw-r--r--debian/glxdemo.115
-rw-r--r--debian/glxgears.129
-rw-r--r--debian/glxheads.130
-rw-r--r--debian/glxinfo.141
-rw-r--r--debian/libdir.map16
-rw-r--r--debian/libgl1-mesa-dev.install4
-rw-r--r--debian/libgl1-mesa-dri-i686.install1
-rw-r--r--debian/libgl1-mesa-dri.install1
-rw-r--r--debian/libgl1-mesa-glide3-dev.install1
-rw-r--r--debian/libgl1-mesa-glide3.docs1
-rw-r--r--debian/libgl1-mesa-glx-i686.install1
-rw-r--r--debian/libgl1-mesa-glx.install1
-rw-r--r--debian/libgl1-mesa-glx.shlibs1
-rw-r--r--debian/libgl1-mesa-swx11-dev.install7
-rw-r--r--debian/libgl1-mesa-swx11-i686.install1
-rw-r--r--debian/libgl1-mesa-swx11.install1
-rw-r--r--debian/libgl1-mesa-swx11.shlibs1
-rw-r--r--debian/libglu1-mesa-dev.install6
-rw-r--r--debian/libglu1-mesa.install1
-rw-r--r--debian/libglu1-mesa.shlibs1
-rw-r--r--debian/libglw1-mesa-dev.install3
-rw-r--r--debian/libglw1-mesa.install1
-rw-r--r--debian/libosmesa6-dev.install7
-rw-r--r--debian/libosmesa6.install3
-rw-r--r--debian/libosmesa6.shlibs3
-rw-r--r--debian/mesa-common-dev.docs1
-rw-r--r--debian/mesa-common-dev.install8
-rw-r--r--debian/mesa-swx11-source.dirs4
-rw-r--r--debian/mesa-swx11-source.install1
-rw-r--r--debian/mesa-utils.install4
-rw-r--r--debian/mesa-utils.manpages4
-rw-r--r--debian/patches/00_create-libdir.patch17
-rw-r--r--debian/patches/01_fix-makefile.patch16
-rw-r--r--debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch17
-rw-r--r--debian/patches/03_optional-progs-and-install.patch45
-rw-r--r--debian/patches/04_cleanup-osmesa-configs.patch189
-rw-r--r--debian/patches/05_static-nonpic.patch60
-rw-r--r--debian/patches/series6
-rwxr-xr-xdebian/rules281
-rw-r--r--debian/scripts/choose-configs52
-rwxr-xr-xdebian/scripts/install-source.sh46
-rw-r--r--debian/shadowtree91
-rw-r--r--debian/shlibs.local2
-rw-r--r--debian/watch2
-rw-r--r--descrip.mms2
-rw-r--r--docs/README.directfb2
-rw-r--r--docs/contents.html2
-rw-r--r--docs/devinfo.html14
-rw-r--r--docs/dispatch.html274
-rw-r--r--docs/mangling.html12
-rw-r--r--docs/news.html89
-rw-r--r--docs/relnotes-6.4.1.html68
-rw-r--r--docs/relnotes-6.4.2.html75
-rw-r--r--docs/relnotes-6.4.html90
-rw-r--r--docs/relnotes-6.5.1.html76
-rw-r--r--docs/relnotes-6.5.2.html118
-rw-r--r--docs/relnotes-6.5.html131
-rw-r--r--docs/relnotes.html24
-rw-r--r--docs/sourcedocs.html17
-rw-r--r--docs/versions.html175
-rw-r--r--doxygen/.cvsignore15
-rw-r--r--doxygen/Makefile33
-rw-r--r--doxygen/README10
-rw-r--r--doxygen/array_cache.doxy50
-rw-r--r--doxygen/common.doxy1153
-rw-r--r--doxygen/core_subset.doxy226
-rw-r--r--doxygen/doxy.bat19
-rw-r--r--doxygen/glapi.doxy49
-rw-r--r--doxygen/header.html17
-rw-r--r--doxygen/header_subset.html11
-rw-r--r--doxygen/main.doxy50
-rw-r--r--doxygen/math.doxy49
-rw-r--r--doxygen/math_subset.doxy177
-rw-r--r--doxygen/miniglx.doxy179
-rw-r--r--doxygen/radeon_subset.doxy203
-rw-r--r--doxygen/shader.doxy49
-rw-r--r--doxygen/swrast.doxy48
-rw-r--r--doxygen/swrast_setup.doxy49
-rw-r--r--doxygen/tnl.doxy50
-rw-r--r--doxygen/tnl_dd.doxy49
-rw-r--r--include/GL/gl.h35
-rw-r--r--include/GL/gl_mangle.h18
-rw-r--r--include/GL/glx_mangle.h58
-rw-r--r--include/GL/internal/glcore.h3
-rw-r--r--include/GLES/egl.h324
-rw-r--r--include/GLES/egltypes.h45
-rw-r--r--progs/demos/Makefile2
-rw-r--r--progs/demos/Windows/all.dsp101
-rw-r--r--progs/demos/Windows/bounce.dsp112
-rw-r--r--progs/demos/Windows/clearspd.dsp112
-rw-r--r--progs/demos/Windows/cubemap.dsp112
-rw-r--r--progs/demos/Windows/demos.dsw782
-rw-r--r--progs/demos/Windows/drawpix.dsp112
-rw-r--r--progs/demos/Windows/fire.dsp112
-rw-r--r--progs/demos/Windows/gears.dsp112
-rw-r--r--progs/demos/Windows/geartrain.dsp112
-rw-r--r--progs/demos/Windows/glinfo.dsp112
-rw-r--r--progs/demos/Windows/gloss.dsp112
-rw-r--r--progs/demos/Windows/gltestperf.dsp112
-rw-r--r--progs/demos/Windows/glutfx.dsp112
-rw-r--r--progs/demos/Windows/ipers.dsp112
-rw-r--r--progs/demos/Windows/isosurf.dsp112
-rw-r--r--progs/demos/Windows/loadbias.dsp112
-rw-r--r--progs/demos/Windows/morph3d.dsp112
-rw-r--r--progs/demos/Windows/multiarb.dsp112
-rw-r--r--progs/demos/Windows/occlude.dsp112
-rw-r--r--progs/demos/Windows/osdemo.dsp112
-rw-r--r--progs/demos/Windows/paltex.dsp112
-rw-r--r--progs/demos/Windows/pixeltex.dsp112
-rw-r--r--progs/demos/Windows/pointblast.dsp112
-rw-r--r--progs/demos/Windows/rain.dsp112
-rw-r--r--progs/demos/Windows/ray.dsp112
-rw-r--r--progs/demos/Windows/readpix.dsp112
-rw-r--r--progs/demos/Windows/reflect.dsp112
-rw-r--r--progs/demos/Windows/renormal.dsp112
-rw-r--r--progs/demos/Windows/shadowtex.dsp112
-rw-r--r--progs/demos/Windows/spectex.dsp112
-rw-r--r--progs/demos/Windows/spriteblast.dsp112
-rw-r--r--progs/demos/Windows/stex3d.dsp112
-rw-r--r--progs/demos/Windows/teapot.dsp112
-rw-r--r--progs/demos/Windows/terrain.dsp112
-rw-r--r--progs/demos/Windows/tessdemo.dsp112
-rw-r--r--progs/demos/Windows/texcyl.dsp112
-rw-r--r--progs/demos/Windows/texdown.dsp112
-rw-r--r--progs/demos/Windows/texenv.dsp112
-rw-r--r--progs/demos/Windows/texobj.dsp112
-rw-r--r--progs/demos/Windows/trispd.dsp112
-rw-r--r--progs/demos/Windows/tunnel.dsp112
-rw-r--r--progs/demos/Windows/tunnel2.dsp112
-rw-r--r--progs/demos/Windows/winpos.dsp112
-rw-r--r--progs/demos/cubemap.c1
-rw-r--r--progs/demos/fslight.c334
-rw-r--r--progs/demos/readpix.c31
-rw-r--r--progs/demos/streaming_rect.c322
-rw-r--r--progs/demos/texdown.c133
-rw-r--r--progs/directfb/Makefile36
-rw-r--r--progs/directfb/df_gears.c480
-rw-r--r--progs/directfb/df_morph3d.c1013
-rw-r--r--progs/directfb/df_reflect.c489
-rw-r--r--progs/directfb/multi_window.c240
-rw-r--r--progs/egl/Makefile65
-rw-r--r--progs/egl/demo1.c145
-rw-r--r--progs/egl/demo2.c190
-rw-r--r--progs/egl/demo3.c636
-rw-r--r--progs/egl/eglgears.c475
-rw-r--r--progs/egl/eglinfo.c166
-rw-r--r--progs/fbdev/Makefile53
-rw-r--r--progs/fbdev/glfbdevtest.c524
-rw-r--r--progs/fp/Makefile128
-rw-r--r--progs/fp/point-position.c119
-rw-r--r--progs/fp/tri-abs.c107
-rw-r--r--progs/fp/tri-add.c110
-rw-r--r--progs/fp/tri-cmp.c110
-rw-r--r--progs/fp/tri-cos.c113
-rw-r--r--progs/fp/tri-depth.c111
-rw-r--r--progs/fp/tri-depth2.c116
-rw-r--r--progs/fp/tri-depthwrite.c107
-rw-r--r--progs/fp/tri-depthwrite2.c107
-rw-r--r--progs/fp/tri-dp3.c109
-rw-r--r--progs/fp/tri-dp4.c109
-rw-r--r--progs/fp/tri-dph.c109
-rw-r--r--progs/fp/tri-dst.c109
-rw-r--r--progs/fp/tri-ex2.c110
-rw-r--r--progs/fp/tri-flr.c110
-rw-r--r--progs/fp/tri-fp.c109
-rw-r--r--progs/fp/tri-frc.c111
-rw-r--r--progs/fp/tri-inv.c109
-rw-r--r--progs/fp/tri-kil.c111
-rw-r--r--progs/fp/tri-lg2.c110
-rw-r--r--progs/fp/tri-lit.c111
-rw-r--r--progs/fp/tri-lrp.c109
-rw-r--r--progs/fp/tri-mad.c109
-rw-r--r--progs/fp/tri-max.c109
-rw-r--r--progs/fp/tri-min.c109
-rw-r--r--progs/fp/tri-mov.c102
-rw-r--r--progs/fp/tri-mul.c109
-rw-r--r--progs/fp/tri-param.c114
-rw-r--r--progs/fp/tri-position.c109
-rw-r--r--progs/fp/tri-pow.c109
-rw-r--r--progs/fp/tri-rcp.c110
-rw-r--r--progs/fp/tri-rsq.c110
-rw-r--r--progs/fp/tri-scs.c111
-rw-r--r--progs/fp/tri-sge.c109
-rw-r--r--progs/fp/tri-sge2.c114
-rw-r--r--progs/fp/tri-sin.c114
-rw-r--r--progs/fp/tri-slt.c109
-rw-r--r--progs/fp/tri-sub.c109
-rw-r--r--progs/fp/tri-swz.c109
-rw-r--r--progs/fp/tri-swz2.c109
-rw-r--r--progs/fp/tri-tex.c130
-rw-r--r--progs/fp/tri-xpd.c108
-rw-r--r--progs/miniglx/Makefile58
-rw-r--r--progs/miniglx/glfbdevtest.c478
-rw-r--r--progs/miniglx/manytex.c382
-rw-r--r--progs/miniglx/miniglxsample.c128
-rw-r--r--progs/miniglx/miniglxtest.c195
-rw-r--r--progs/miniglx/sample_server.c112
-rw-r--r--progs/miniglx/sample_server2.c229
-rw-r--r--progs/miniglx/texline.c268
-rw-r--r--progs/osdemos/osdemo.c45
-rw-r--r--progs/redbook/Windows/redbook.dsw29
-rw-r--r--progs/redbook/Windows/teapots.dsp112
-rw-r--r--progs/slang/Makefile55
-rw-r--r--progs/slang/README7
-rw-r--r--progs/slang/cltest.c253
-rw-r--r--progs/slang/cltest.txt1575
-rw-r--r--progs/slang/framework.c145
-rw-r--r--progs/slang/framework.h82
-rw-r--r--progs/slang/sotest.c439
-rw-r--r--progs/slang/vstest.c340
-rw-r--r--progs/slang/vstest.txt68
-rw-r--r--progs/slang/windows/vc60/cltest.dsp94
-rw-r--r--progs/slang/windows/vc60/framework.dsp92
-rw-r--r--progs/slang/windows/vc60/slang.dsw74
-rw-r--r--progs/slang/windows/vc60/sotest.dsp90
-rw-r--r--progs/slang/windows/vc60/vstest.dsp93
-rw-r--r--progs/tests/.cvsignore54
-rw-r--r--progs/tests/Makefile158
-rw-r--r--progs/tests/Makefile.win44
-rw-r--r--progs/tests/afsmultiarb.c469
-rw-r--r--progs/tests/antialias.c229
-rw-r--r--progs/tests/api_speed.c146
-rwxr-xr-xprogs/tests/api_speed.py143
-rw-r--r--progs/tests/arbfpspec.c192
-rw-r--r--progs/tests/arbfptest1.c210
-rw-r--r--progs/tests/arbfptexture.c153
-rw-r--r--progs/tests/arbfptrig.c156
-rw-r--r--progs/tests/arbnpot-mipmap.c184
-rw-r--r--progs/tests/arbnpot.c174
-rw-r--r--progs/tests/arbvptest1.c164
-rw-r--r--progs/tests/arbvptest3.c127
-rw-r--r--progs/tests/arbvptorus.c186
-rw-r--r--progs/tests/arbvpwarpmesh.c246
-rw-r--r--progs/tests/auxbuffer.c499
-rw-r--r--progs/tests/blendminmax.c209
-rw-r--r--progs/tests/blendsquare.c178
-rw-r--r--progs/tests/bufferobj.c371
-rw-r--r--progs/tests/bug_3050.c162
-rw-r--r--progs/tests/bug_3101.c128
-rw-r--r--progs/tests/bug_3195.c275
-rw-r--r--progs/tests/copypixrate.c259
-rw-r--r--progs/tests/crossbar.c235
-rw-r--r--progs/tests/cva.c164
-rw-r--r--progs/tests/debugger.c733
-rw-r--r--progs/tests/descrip.mms84
-rw-r--r--progs/tests/dinoshade.c914
-rw-r--r--progs/tests/ext422square.c258
-rw-r--r--progs/tests/fbotest1.c204
-rw-r--r--progs/tests/fbotest2.c199
-rw-r--r--progs/tests/fbotexture.c404
-rw-r--r--progs/tests/floattex.c169
-rw-r--r--progs/tests/fog.c199
-rw-r--r--progs/tests/fogcoord.c102
-rw-r--r--progs/tests/fptest1.c225
-rw-r--r--progs/tests/fptexture.c151
-rw-r--r--progs/tests/getprocaddress.c452
-rw-r--r--progs/tests/getprocaddress.py93
-rw-r--r--progs/tests/interleave.c406
-rw-r--r--progs/tests/invert.c195
-rw-r--r--progs/tests/jkrahntest.c181
-rw-r--r--progs/tests/manytex.c382
-rw-r--r--progs/tests/mipmap_limits.c252
-rw-r--r--progs/tests/multipal.c377
-rw-r--r--progs/tests/multitexarray.c238
-rw-r--r--progs/tests/multiwindow.c169
-rw-r--r--progs/tests/no_s3tc.c97
-rw-r--r--progs/tests/packedpixels.c342
-rw-r--r--progs/tests/pbo.c296
-rw-r--r--progs/tests/prog_parameter.c285
-rw-r--r--progs/tests/projtex.c1028
-rw-r--r--progs/tests/readrate.c285
-rw-r--r--progs/tests/seccolor.c145
-rw-r--r--progs/tests/sharedtex.c438
-rw-r--r--progs/tests/stencil_wrap.c257
-rw-r--r--progs/tests/stencilwrap.c281
-rw-r--r--progs/tests/subtexrate.c350
-rw-r--r--progs/tests/tex1d.c139
-rw-r--r--progs/tests/texcmp.c414
-rw-r--r--progs/tests/texcompress2.c273
-rw-r--r--progs/tests/texfilt.c398
-rw-r--r--progs/tests/texgenmix.c640
-rw-r--r--progs/tests/texline.c269
-rw-r--r--progs/tests/texobjshare.c219
-rw-r--r--progs/tests/texrect.c360
-rw-r--r--progs/tests/texwrap.c304
-rw-r--r--progs/tests/vao-01.c177
-rw-r--r--progs/tests/vao-02.c205
-rw-r--r--progs/tests/vparray.c294
-rw-r--r--progs/tests/vpeval.c231
-rw-r--r--progs/tests/vptest1.c170
-rw-r--r--progs/tests/vptest2.c151
-rw-r--r--progs/tests/vptest3.c120
-rw-r--r--progs/tests/vptorus.c174
-rw-r--r--progs/tests/vpwarpmesh.c236
-rw-r--r--progs/tests/yuvrect.c193
-rw-r--r--progs/tests/yuvsquare.c232
-rw-r--r--progs/tests/zreaddraw.c116
-rw-r--r--progs/tools/trace/Makefile30
-rw-r--r--progs/tools/trace/README23
-rwxr-xr-xprogs/tools/trace/gltrace82
-rw-r--r--progs/tools/trace/gltrace.py189
-rw-r--r--progs/tools/trace/gltrace_support.cc190
-rw-r--r--progs/trivial/Makefile134
-rw-r--r--progs/trivial/clear.c126
-rw-r--r--progs/trivial/line-clip.c140
-rw-r--r--progs/trivial/line-cull.c136
-rw-r--r--progs/trivial/line-userclip-clip.c142
-rw-r--r--progs/trivial/line-userclip-nop-clip.c142
-rw-r--r--progs/trivial/line-userclip-nop.c142
-rw-r--r--progs/trivial/line-userclip.c142
-rw-r--r--progs/trivial/line.c140
-rw-r--r--progs/trivial/lineloop-clip.c136
-rw-r--r--progs/trivial/lineloop.c136
-rw-r--r--progs/trivial/point-clip.c138
-rw-r--r--progs/trivial/point-param.c145
-rw-r--r--progs/trivial/point-wide.c140
-rw-r--r--progs/trivial/point.c138
-rw-r--r--progs/trivial/poly-flat.c140
-rw-r--r--progs/trivial/poly-unfilled.c139
-rw-r--r--progs/trivial/poly.c138
-rw-r--r--progs/trivial/quad-clip-all-vertices.c138
-rw-r--r--progs/trivial/quad-clip-nearplane.c138
-rw-r--r--progs/trivial/quad-clip.c138
-rw-r--r--progs/trivial/quad-degenerate.c143
-rw-r--r--progs/trivial/quad-flat.c148
-rw-r--r--progs/trivial/quad-offset-factor.c167
-rw-r--r--progs/trivial/quad-offset-unfilled.c167
-rw-r--r--progs/trivial/quad-offset-units.c166
-rw-r--r--progs/trivial/quad-tex-2d.c169
-rw-r--r--progs/trivial/quad-tex-3d.c177
-rw-r--r--progs/trivial/quad-unfilled.c139
-rw-r--r--progs/trivial/quad.c138
-rw-r--r--progs/trivial/quads.c156
-rw-r--r--progs/trivial/quadstrip-flat.c150
-rw-r--r--progs/trivial/quadstrip.c144
-rw-r--r--progs/trivial/tri-blend.c144
-rw-r--r--progs/trivial/tri-clip.c137
-rw-r--r--progs/trivial/tri-cull.c136
-rw-r--r--progs/trivial/tri-dlist.c150
-rw-r--r--progs/trivial/tri-edgeflag.c141
-rw-r--r--progs/trivial/tri-flat-clip.c137
-rw-r--r--progs/trivial/tri-flat.c137
-rw-r--r--progs/trivial/tri-tex-3d.c170
-rw-r--r--progs/trivial/tri-unfilled-clip.c137
-rw-r--r--progs/trivial/tri-unfilled-smooth.c150
-rw-r--r--progs/trivial/tri-unfilled-userclip.c141
-rw-r--r--progs/trivial/tri-unfilled.c138
-rw-r--r--progs/trivial/tri-userclip.c140
-rw-r--r--progs/trivial/tri.c136
-rw-r--r--progs/trivial/tristrip-clip.c138
-rw-r--r--progs/trivial/tristrip.c138
-rw-r--r--progs/trivial/vp-array.c117
-rw-r--r--progs/trivial/vp-clip.c102
-rw-r--r--progs/trivial/vp-line-clip.c116
-rw-r--r--progs/trivial/vp-tri.c104
-rw-r--r--progs/trivial/vp-unfilled.c104
-rw-r--r--progs/vp/Makefile53
-rw-r--r--progs/vp/abs.txt7
-rw-r--r--progs/vp/add.txt6
-rw-r--r--progs/vp/arl.txt9
-rw-r--r--progs/vp/dp3.txt5
-rw-r--r--progs/vp/dp4.txt5
-rw-r--r--progs/vp/dph.txt5
-rw-r--r--progs/vp/dst.txt5
-rw-r--r--progs/vp/ex2.txt6
-rw-r--r--progs/vp/flr.txt6
-rw-r--r--progs/vp/frc.txt6
-rw-r--r--progs/vp/lg2.txt6
-rw-r--r--progs/vp/lit.txt6
-rw-r--r--progs/vp/mad.txt5
-rw-r--r--progs/vp/max.txt5
-rw-r--r--progs/vp/min.txt5
-rw-r--r--progs/vp/mov.txt5
-rw-r--r--progs/vp/mul.txt5
-rw-r--r--progs/vp/pow.txt5
-rw-r--r--progs/vp/rcp.txt7
-rw-r--r--progs/vp/rsq.txt7
-rw-r--r--progs/vp/sge.txt5
-rw-r--r--progs/vp/slt.txt5
-rw-r--r--progs/vp/sub.txt5
-rw-r--r--progs/vp/swz.txt5
-rw-r--r--progs/vp/swz2.txt5
-rw-r--r--progs/vp/vp-tris.c216
-rw-r--r--progs/vp/xpd.txt5
-rw-r--r--progs/xdemos/wincopy.c35
-rw-r--r--src/egl/Makefile24
-rw-r--r--src/egl/docs/EGL_MESA_screen_surface578
-rw-r--r--src/egl/drivers/demo/Makefile31
-rw-r--r--src/egl/drivers/demo/demo.c316
-rw-r--r--src/egl/drivers/dri/Makefile61
-rw-r--r--src/egl/drivers/dri/egldri.c1138
-rw-r--r--src/egl/drivers/dri/egldri.h113
-rw-r--r--src/egl/main/Makefile66
-rw-r--r--src/egl/main/eglapi.c586
-rw-r--r--src/egl/main/eglapi.h119
-rw-r--r--src/egl/main/eglconfig.c638
-rw-r--r--src/egl/main/eglconfig.h67
-rw-r--r--src/egl/main/eglcontext.c276
-rw-r--r--src/egl/main/eglcontext.h71
-rw-r--r--src/egl/main/egldisplay.c71
-rw-r--r--src/egl/main/egldisplay.h44
-rw-r--r--src/egl/main/egldriver.c272
-rw-r--r--src/egl/main/egldriver.h81
-rw-r--r--src/egl/main/eglglobals.c148
-rw-r--r--src/egl/main/eglglobals.h68
-rw-r--r--src/egl/main/eglhash.c347
-rw-r--r--src/egl/main/eglhash.h39
-rw-r--r--src/egl/main/egllog.c57
-rw-r--r--src/egl/main/egllog.h16
-rw-r--r--src/egl/main/eglmode.c431
-rw-r--r--src/egl/main/eglmode.h54
-rw-r--r--src/egl/main/eglscreen.c328
-rw-r--r--src/egl/main/eglscreen.h90
-rw-r--r--src/egl/main/eglsurface.c530
-rw-r--r--src/egl/main/eglsurface.h117
-rw-r--r--src/egl/main/egltypedefs.h34
-rw-r--r--src/glu/Makefile2
-rw-r--r--src/glu/mesa/Makefile56
-rw-r--r--src/glu/mesa/Makefile.DJ100
-rw-r--r--src/glu/mesa/Makefile.m3263
-rw-r--r--src/glu/mesa/Makefile.ugl96
-rw-r--r--src/glu/mesa/MesaGLU.def62
-rw-r--r--src/glu/mesa/README1195
-rw-r--r--src/glu/mesa/README243
-rw-r--r--src/glu/mesa/all.h54
-rw-r--r--src/glu/mesa/descrip.mms61
-rw-r--r--src/glu/mesa/glu.c416
-rw-r--r--src/glu/mesa/gluP.h97
-rw-r--r--src/glu/mesa/mipmap.c824
-rw-r--r--src/glu/mesa/mms_depend15
-rw-r--r--src/glu/mesa/nurbs.c628
-rw-r--r--src/glu/mesa/nurbs.h252
-rw-r--r--src/glu/mesa/nurbscrv.c444
-rw-r--r--src/glu/mesa/nurbssrf.c1317
-rw-r--r--src/glu/mesa/nurbsutl.c1309
-rw-r--r--src/glu/mesa/polytest.c937
-rw-r--r--src/glu/mesa/project.c401
-rw-r--r--src/glu/mesa/quadric.c819
-rw-r--r--src/glu/mesa/tess.c327
-rw-r--r--src/glu/mesa/tess.h107
-rw-r--r--src/glu/mesa/tesselat.c406
-rw-r--r--src/glu/mini/all.h55
-rw-r--r--src/glu/mini/glu.c417
-rw-r--r--src/glu/mini/gluP.h142
-rw-r--r--src/glu/mini/mipmap.c764
-rw-r--r--src/glu/mini/nurbs.c158
-rw-r--r--src/glu/mini/nurbs.h253
-rw-r--r--src/glu/mini/nurbscrv.c133
-rw-r--r--src/glu/mini/polytest.c938
-rw-r--r--src/glu/mini/project.c402
-rw-r--r--src/glu/mini/quadric.c774
-rw-r--r--src/glu/mini/tess.c328
-rw-r--r--src/glu/mini/tess.h108
-rw-r--r--src/glu/mini/tesselat.c407
-rw-r--r--src/glu/sgi/libutil/mipmap.c44
-rw-r--r--src/glut/directfb/Makefile86
-rw-r--r--src/glut/directfb/NOTES9
-rw-r--r--src/glut/directfb/callback.c278
-rw-r--r--src/glut/directfb/color.c39
-rw-r--r--src/glut/directfb/cursor.c175
-rw-r--r--src/glut/directfb/cursors.h306
-rw-r--r--src/glut/directfb/events.c485
-rw-r--r--src/glut/directfb/ext.c195
-rw-r--r--src/glut/directfb/font.c213
-rw-r--r--src/glut/directfb/font.h58
-rw-r--r--src/glut/directfb/game.c153
-rw-r--r--src/glut/directfb/globals.c63
-rw-r--r--src/glut/directfb/init.c128
-rw-r--r--src/glut/directfb/internal.h183
-rw-r--r--src/glut/directfb/menu.c87
-rw-r--r--src/glut/directfb/models.c599
-rw-r--r--src/glut/directfb/overlay.c62
-rw-r--r--src/glut/directfb/state.c219
-rw-r--r--src/glut/directfb/teapot.c212
-rw-r--r--src/glut/directfb/window.c581
-rw-r--r--src/glut/fbdev/Makefile2
-rw-r--r--src/glut/fbdev/callback.c5
-rw-r--r--src/glut/fbdev/colormap.c9
-rw-r--r--src/glut/fbdev/cursor.c22
-rw-r--r--src/glut/fbdev/ext.c2
-rw-r--r--src/glut/fbdev/fbdev.c122
-rw-r--r--src/glut/fbdev/gamemode.c2
-rw-r--r--src/glut/fbdev/input.c409
-rw-r--r--src/glut/fbdev/internal.h12
-rw-r--r--src/glut/fbdev/menu.c4
-rw-r--r--src/glut/fbdev/overlay.c1
-rw-r--r--src/glut/fbdev/state.c1
-rw-r--r--src/glut/glx/Makefile2
-rw-r--r--src/glut/glx/glut_cmap.c24
-rw-r--r--src/glut/glx/glut_win.c17
-rw-r--r--src/glut/mini/models.c16
-rw-r--r--src/glut/os2/Makefile420
-rw-r--r--src/glut/os2/WarpWin.cpp420
-rw-r--r--src/glut/os2/glutOverlay.cpp133
-rw-r--r--src/glut/os2/glut_8x13.cpp2076
-rw-r--r--src/glut/os2/glut_9x15.cpp2077
-rw-r--r--src/glut/os2/glut_bitmap.cpp57
-rw-r--r--src/glut/os2/glut_cindex.cpp259
-rw-r--r--src/glut/os2/glut_cmap.cpp399
-rw-r--r--src/glut/os2/glut_cursor.cpp210
-rw-r--r--src/glut/os2/glut_event.cpp1399
-rw-r--r--src/glut/os2/glut_ext.cpp204
-rw-r--r--src/glut/os2/glut_fullscrn.cpp38
-rw-r--r--src/glut/os2/glut_gamemode.cpp680
-rw-r--r--src/glut/os2/glut_get.cpp232
-rw-r--r--src/glut/os2/glut_hel10.cpp1781
-rw-r--r--src/glut/os2/glut_hel12.cpp1791
-rw-r--r--src/glut/os2/glut_hel18.cpp1900
-rw-r--r--src/glut/os2/glut_init.cpp451
-rw-r--r--src/glut/os2/glut_input.cpp628
-rw-r--r--src/glut/os2/glut_key.cpp29
-rw-r--r--src/glut/os2/glut_keyctrl.cpp29
-rw-r--r--src/glut/os2/glut_keyup.cpp29
-rw-r--r--src/glut/os2/glut_mesa.cpp57
-rw-r--r--src/glut/os2/glut_modifier.cpp31
-rw-r--r--src/glut/os2/glut_roman.cpp2451
-rw-r--r--src/glut/os2/glut_shapes.cpp595
-rw-r--r--src/glut/os2/glut_stroke.cpp42
-rw-r--r--src/glut/os2/glut_swap.cpp67
-rw-r--r--src/glut/os2/glut_teapot.cpp210
-rw-r--r--src/glut/os2/glut_tr24.cpp2063
-rw-r--r--src/glut/os2/glut_util.cpp90
-rw-r--r--src/glut/os2/glut_vidresize.cpp232
-rw-r--r--src/glut/os2/glut_warp.cpp29
-rw-r--r--src/glut/os2/glut_win.cpp1221
-rw-r--r--src/glut/os2/glut_winmisc.cpp127
-rw-r--r--src/glut/os2/glutbitmap.h32
-rw-r--r--src/glut/os2/glutos2.h36
-rw-r--r--src/glut/os2/glutstroke.h42
-rw-r--r--src/glut/os2/layerutil.h59
-rw-r--r--src/glut/os2/libGlut.DEF94
-rw-r--r--src/glut/os2/os2_glx.cpp146
-rw-r--r--src/glut/os2/os2_menu.cpp533
-rw-r--r--src/glut/os2/os2_winproc.cpp1297
-rw-r--r--src/glut/os2/src-glut_os2pm.zipbin141239 -> 0 bytes
-rw-r--r--src/glw/Makefile2
-rw-r--r--src/glx/mini/Makefile82
-rw-r--r--src/glx/mini/NOTES115
-rw-r--r--src/glx/mini/driver.h170
-rw-r--r--src/glx/mini/example.miniglx.conf36
-rw-r--r--src/glx/mini/miniglx.c2567
-rw-r--r--src/glx/mini/miniglxP.h205
-rw-r--r--src/glx/mini/miniglx_events.c984
-rw-r--r--src/glx/x11/XF86dri.c4
-rw-r--r--src/glx/x11/glxext.c262
-rw-r--r--src/glx/x11/indirect.c8234
-rw-r--r--src/glx/x11/indirect.h23
-rw-r--r--src/glx/x11/indirect_init.c406
-rw-r--r--src/glx/x11/indirect_size.c446
-rw-r--r--src/glx/x11/indirect_vertex_array.c6
-rw-r--r--src/glx/x11/singlepix.c87
-rw-r--r--src/mesa/Makefile19
-rw-r--r--src/mesa/array_cache/sources7
-rw-r--r--src/mesa/drivers/allegro/amesa.c404
-rw-r--r--src/mesa/drivers/allegro/direct.h189
-rw-r--r--src/mesa/drivers/allegro/generic.h234
-rw-r--r--src/mesa/drivers/common/driverfuncs.c3
-rw-r--r--src/mesa/drivers/common/sources2
-rw-r--r--src/mesa/drivers/d3d/D3DCAPS.CPP250
-rw-r--r--src/mesa/drivers/d3d/D3DHAL.H68
-rw-r--r--src/mesa/drivers/d3d/D3DInit.cpp891
-rw-r--r--src/mesa/drivers/d3d/D3DMESA.H84
-rw-r--r--src/mesa/drivers/d3d/D3DRaster.cpp213
-rw-r--r--src/mesa/drivers/d3d/D3DShared.h154
-rw-r--r--src/mesa/drivers/d3d/D3DTEXT.CPP576
-rw-r--r--src/mesa/drivers/d3d/D3DTextureMgr.cpp947
-rw-r--r--src/mesa/drivers/d3d/D3DTextureMgr.h62
-rw-r--r--src/mesa/drivers/d3d/D3DUTILS.CPP638
-rw-r--r--src/mesa/drivers/d3d/D3Dvbrender.c2149
-rw-r--r--src/mesa/drivers/d3d/DDrawPROCS.c399
-rw-r--r--src/mesa/drivers/d3d/DEBUG.C143
-rw-r--r--src/mesa/drivers/d3d/DEBUG.H90
-rw-r--r--src/mesa/drivers/d3d/DbgEnv.bat25
-rw-r--r--src/mesa/drivers/d3d/MAKEFILE101
-rw-r--r--src/mesa/drivers/d3d/NULLProcs.h49
-rw-r--r--src/mesa/drivers/d3d/NullProcs.c49
-rw-r--r--src/mesa/drivers/d3d/OPENGL32.DEF442
-rw-r--r--src/mesa/drivers/d3d/WGL.C1262
-rw-r--r--src/mesa/drivers/d3d/d3dText.h53
-rw-r--r--src/mesa/drivers/directfb/idirectfbgl_mesa.c185
-rw-r--r--src/mesa/drivers/dri/Makefile.template9
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr.c493
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr.h99
-rw-r--r--src/mesa/drivers/dri/common/dri_bufpool.h86
-rw-r--r--src/mesa/drivers/dri/common/dri_drmpool.c227
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c21
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h15
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.h7
-rw-r--r--src/mesa/drivers/dri/common/extension_helper.h894
-rw-r--r--src/mesa/drivers/dri/common/utils.c13
-rw-r--r--src/mesa/drivers/dri/common/utils.h2
-rw-r--r--src/mesa/drivers/dri/common/vblank.c129
-rw-r--r--src/mesa/drivers/dri/common/vblank.h9
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/options.h5
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/t_options.h5
-rw-r--r--src/mesa/drivers/dri/fb/fb_dri.c1
-rw-r--r--src/mesa/drivers/dri/fb/fb_egl.c1
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_clear.c44
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_clear.h5
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_xmesa.c3
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_dd.c23
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_state.c5
-rw-r--r--src/mesa/drivers/dri/i810/i810context.c1
-rw-r--r--src/mesa/drivers/dri/i810/i810ioctl.c17
-rw-r--r--src/mesa/drivers/dri/i810/i810state.c15
-rw-r--r--src/mesa/drivers/dri/i915/i830_metaops.c16
-rw-r--r--src/mesa/drivers/dri/i915/i830_state.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_context.c3
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c27
-rw-r--r--src/mesa/drivers/dri/i915/i915_metaops.c22
-rw-r--r--src/mesa/drivers/dri/i915/i915_program.c5
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_texprog.c5
-rw-r--r--src/mesa/drivers/dri/i915/i915_vtbl.c4
-rw-r--r--src/mesa/drivers/dri/i915/intel_batchbuffer.c235
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c78
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.h14
-rw-r--r--src/mesa/drivers/dri/i915/intel_ioctl.c9
-rw-r--r--src/mesa/drivers/dri/i915/intel_ioctl.h3
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel.c9
-rw-r--r--src/mesa/drivers/dri/i915/intel_tris.c221
-rw-r--r--src/mesa/drivers/dri/i915/server/i830_common.h15
-rw-r--r--src/mesa/drivers/dri/i915tex/Makefile66
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_context.c104
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_context.h213
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_metaops.c457
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_reg.h641
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_state.c1114
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_tex.c100
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_texblend.c463
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_texstate.c322
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_vtbl.c659
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_context.c175
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_context.h367
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_debug.c334
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_fragprog.c1083
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_metaops.c509
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_program.c515
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_program.h160
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_reg.h841
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_state.c1019
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_tex.c113
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_tex_layout.c380
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_texstate.c338
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_vtbl.c550
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_batchbuffer.c342
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_batchbuffer.h124
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_batchpool.c418
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_blit.c579
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_blit.h62
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffer_objects.c250
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffer_objects.h86
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffers.c928
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffers.h56
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.c714
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.h502
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_depthstencil.c282
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_depthstencil.h14
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_fbo.c622
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_fbo.h80
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_ioctl.c138
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_ioctl.h40
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c347
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h198
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel.c120
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel.h63
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c350
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_copy.c383
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_draw.c367
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_read.c319
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_reg.h84
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_regions.c471
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_regions.h141
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_render.c242
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_rotate.c237
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_rotate.h39
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_screen.c864
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_screen.h132
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_span.c409
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_span.h (renamed from src/glx/mini/dispatch.c)50
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_state.c363
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_structs.h132
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex.c192
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex.h148
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_copy.c302
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_format.c172
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_image.c686
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_subimage.c183
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_validate.c256
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tris.c1149
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tris.h69
-rw-r--r--src/mesa/drivers/dri/i915tex/server/i830_common.h220
-rw-r--r--src/mesa/drivers/dri/i915tex/server/i830_dri.h63
-rw-r--r--src/mesa/drivers/dri/i915tex/server/intel.h331
-rw-r--r--src/mesa/drivers/dri/i915tex/server/intel_dri.c1333
-rw-r--r--src/mesa/drivers/dri/i965/Makefile2
-rw-r--r--src/mesa/drivers/dri/i965/brw_attrib.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_aub_playback.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h6
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c56
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_exec_api.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fallback.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_metaops.c100
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c15
-rw-r--r--src/mesa/drivers/dri/i965/brw_save_api.c16
-rw-r--r--src/mesa/drivers/dri/i965/brw_save_draw.c26
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex.c81
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex_layout.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_util.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.h3
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_emit.c42
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_tnl.c12
-rw-r--r--src/mesa/drivers/dri/i965/brw_vtbl.c1
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_debug.c62
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_fp.c63
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c18
-rw-r--r--src/mesa/drivers/dri/i965/bufmgr.h2
-rw-r--r--src/mesa/drivers/dri/i965/bufmgr_fake.c16
-rw-r--r--src/mesa/drivers/dri/i965/intel_batchbuffer.c20
-rw-r--r--src/mesa/drivers/dri/i965/intel_batchbuffer.h2
-rw-r--r--src/mesa/drivers/dri/i965/intel_blit.c170
-rw-r--r--src/mesa/drivers/dri/i965/intel_blit.h17
-rw-r--r--src/mesa/drivers/dri/i965/intel_buffers.c46
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.c55
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.h52
-rw-r--r--src/mesa/drivers/dri/i965/intel_ioctl.c33
-rw-r--r--src/mesa/drivers/dri/i965/intel_ioctl.h6
-rw-r--r--src/mesa/drivers/dri/i965/intel_pixel_bitmap.c350
-rw-r--r--src/mesa/drivers/dri/i965/intel_pixel_copy.c343
-rw-r--r--src/mesa/drivers/dri/i965/intel_regions.c3
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c4
-rw-r--r--src/mesa/drivers/dri/i965/intel_span.c11
-rw-r--r--src/mesa/drivers/dri/i965/intel_state.c35
-rw-r--r--src/mesa/drivers/dri/i965/intel_structs.h132
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_validate.c12
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_context.c3
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_dd.c1
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_ioctl.c50
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_ioctl.h2
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c2
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_state.c15
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_texmem.c16
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c4
-rw-r--r--src/mesa/drivers/dri/mga/mgacontext.h7
-rw-r--r--src/mesa/drivers/dri/mga/mgadd.c20
-rw-r--r--src/mesa/drivers/dri/mga/mgaioctl.c16
-rw-r--r--src/mesa/drivers/dri/mga/mgapixel.c9
-rw-r--r--src/mesa/drivers/dri/mga/mgaspan.c4
-rw-r--r--src/mesa/drivers/dri/mga/mgastate.c71
-rw-r--r--src/mesa/drivers/dri/mga/mgatex.c3
-rw-r--r--src/mesa/drivers/dri/r128/r128_context.c3
-rw-r--r--src/mesa/drivers/dri/r128/r128_dd.c1
-rw-r--r--src/mesa/drivers/dri/r128/r128_ioctl.c20
-rw-r--r--src/mesa/drivers/dri/r128/r128_span.c8
-rw-r--r--src/mesa/drivers/dri/r128/r128_state.c15
-rw-r--r--src/mesa/drivers/dri/r200/r200_cmdbuf.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c44
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.h41
-rw-r--r--src/mesa/drivers/dri/r200/r200_fragshader.c43
-rw-r--r--src/mesa/drivers/dri/r200/r200_ioctl.c23
-rw-r--r--src/mesa/drivers/dri/r200/r200_lock.c14
-rw-r--r--src/mesa/drivers/dri/r200/r200_maos_arrays.c195
-rw-r--r--src/mesa/drivers/dri/r200/r200_pixel.c8
-rw-r--r--src/mesa/drivers/dri/r200/r200_reg.h24
-rw-r--r--src/mesa/drivers/dri/r200/r200_sanity.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c149
-rw-r--r--src/mesa/drivers/dri/r200/r200_state_init.c40
-rw-r--r--src/mesa/drivers/dri/r200/r200_swtcl.c20
-rw-r--r--src/mesa/drivers/dri/r200/r200_tcl.c53
-rw-r--r--src/mesa/drivers/dri/r200/r200_tex.c47
-rw-r--r--src/mesa/drivers/dri/r200/r200_texmem.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_texstate.c147
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c384
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.h2
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h26
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c276
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.h3
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c22
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.h1
-rw-r--r--src/mesa/drivers/dri/r300/r300_maos.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h2
-rw-r--r--src/mesa/drivers/dri/r300/r300_shader.c17
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c92
-rw-r--r--src/mesa/drivers/dri/r300/r300_tex.c40
-rw-r--r--src/mesa/drivers/dri/r300/r300_texstate.c67
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertexprog.c482
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.c47
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.h10
-rw-r--r--src/mesa/drivers/dri/r300/radeon_ioctl.c26
-rw-r--r--src/mesa/drivers/dri/r300/radeon_lock.c82
-rw-r--r--src/mesa/drivers/dri/r300/radeon_mm.c2
-rw-r--r--src/mesa/drivers/dri/r300/radeon_state.c62
-rw-r--r--src/mesa/drivers/dri/r300/radeon_state.h2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c33
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.h11
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_ioctl.c19
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_lock.c14
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c3
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_state.c36
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texstate.c41
-rw-r--r--src/mesa/drivers/dri/s3v/s3v_dd.c22
-rw-r--r--src/mesa/drivers/dri/s3v/s3v_state.c13
-rw-r--r--src/mesa/drivers/dri/savage/savage_init.h13
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c63
-rw-r--r--src/mesa/drivers/dri/savage/savagedd.c20
-rw-r--r--src/mesa/drivers/dri/savage/savageioctl.c13
-rw-r--r--src/mesa/drivers/dri/savage/savagespan.c11
-rw-r--r--src/mesa/drivers/dri/savage/savagestate.c26
-rw-r--r--src/mesa/drivers/dri/sis/sis6326_clear.c25
-rw-r--r--src/mesa/drivers/dri/sis/sis6326_state.c18
-rw-r--r--src/mesa/drivers/dri/sis/sis_clear.c33
-rw-r--r--src/mesa/drivers/dri/sis/sis_screen.c2
-rw-r--r--src/mesa/drivers/dri/sis/sis_state.c14
-rw-r--r--src/mesa/drivers/dri/sis/sis_state.h6
-rw-r--r--src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S84
-rw-r--r--src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h314
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.c28
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.h12
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_dd.c135
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_lock.c23
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_pixels.c12
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_render.c9
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_screen.c14
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_span.c29
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_state.c13
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_tex.c15
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_texstate.c5
-rw-r--r--src/mesa/drivers/dri/trident/trident_context.c1
-rw-r--r--src/mesa/drivers/dri/trident/trident_dd.c23
-rw-r--r--src/mesa/drivers/dri/trident/trident_state.c28
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c170
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.h33
-rw-r--r--src/mesa/drivers/dri/unichrome/via_ioctl.c48
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c10
-rw-r--r--src/mesa/drivers/dri/unichrome/via_span.c10
-rw-r--r--src/mesa/drivers/dri/unichrome/via_state.c37
-rw-r--r--src/mesa/drivers/dri/unichrome/via_tex.c8
-rw-r--r--src/mesa/drivers/fbdev/glfbdev.c20
-rw-r--r--src/mesa/drivers/ggi/ggimesa.c22
-rw-r--r--src/mesa/drivers/glide/fxdd.c21
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c213
-rw-r--r--src/mesa/drivers/svga/svgamesa.c14
-rw-r--r--src/mesa/drivers/svga/svgamesa15.c12
-rw-r--r--src/mesa/drivers/svga/svgamesa16.c12
-rw-r--r--src/mesa/drivers/svga/svgamesa24.c12
-rw-r--r--src/mesa/drivers/svga/svgamesa32.c12
-rw-r--r--src/mesa/drivers/svga/svgamesa8.c12
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c17
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c1196
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h292
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h77
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c346
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c77
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c1448
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c2196
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c257
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c423
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c1611
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c1176
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h324
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h77
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c344
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c77
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c1446
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c2046
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c249
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c449
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c1335
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c1206
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h327
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h77
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c344
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c77
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c1446
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c2104
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c263
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c444
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c1345
-rw-r--r--src/mesa/drivers/windows/gldirect/mesasw/colors.h523
-rw-r--r--src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c1719
-rw-r--r--src/mesa/drivers/x11/fakeglx.c11
-rw-r--r--src/mesa/drivers/x11/glxapi.c37
-rw-r--r--src/mesa/drivers/x11/sources8
-rw-r--r--src/mesa/drivers/x11/xm_api.c674
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c216
-rw-r--r--src/mesa/drivers/x11/xm_dd.c364
-rw-r--r--src/mesa/drivers/x11/xm_span.c8
-rw-r--r--src/mesa/drivers/x11/xmesaP.h115
-rw-r--r--src/mesa/glapi/Makefile14
-rw-r--r--src/mesa/glapi/dispatch.h961
-rw-r--r--src/mesa/glapi/glX_XML.py58
-rw-r--r--src/mesa/glapi/glX_proto_recv.py30
-rw-r--r--src/mesa/glapi/glX_proto_send.py314
-rw-r--r--src/mesa/glapi/glX_proto_size.py10
-rw-r--r--src/mesa/glapi/glX_server_table.py11
-rw-r--r--src/mesa/glapi/gl_API.dtd4
-rw-r--r--src/mesa/glapi/gl_API.xml900
-rw-r--r--src/mesa/glapi/gl_SPARC_asm.py17
-rw-r--r--src/mesa/glapi/gl_XML.py167
-rw-r--r--src/mesa/glapi/gl_apitemp.py19
-rw-r--r--src/mesa/glapi/gl_enums.py2
-rw-r--r--src/mesa/glapi/gl_procs.py89
-rw-r--r--src/mesa/glapi/gl_x86-64_asm.py18
-rw-r--r--src/mesa/glapi/gl_x86_asm.py18
-rw-r--r--src/mesa/glapi/glapi.c14
-rw-r--r--src/mesa/glapi/glapioffsets.h766
-rw-r--r--src/mesa/glapi/glapitable.h725
-rw-r--r--src/mesa/glapi/glapitemp.h1065
-rw-r--r--src/mesa/glapi/glprocs.h2262
-rw-r--r--src/mesa/glapi/glthread.h8
-rw-r--r--src/mesa/glapi/sources12
-rw-r--r--src/mesa/main/accum.c6
-rw-r--r--src/mesa/main/api_arrayelt.c113
-rw-r--r--src/mesa/main/api_arrayelt.h5
-rw-r--r--src/mesa/main/api_loopback.c2
-rw-r--r--src/mesa/main/attrib.c13
-rw-r--r--src/mesa/main/blend.c31
-rw-r--r--src/mesa/main/blend.h9
-rw-r--r--src/mesa/main/bufferobj.c9
-rw-r--r--src/mesa/main/buffers.c47
-rw-r--r--src/mesa/main/buffers.h2
-rw-r--r--src/mesa/main/colortab.c330
-rw-r--r--src/mesa/main/colortab.h14
-rw-r--r--src/mesa/main/config.h9
-rw-r--r--src/mesa/main/context.c57
-rw-r--r--src/mesa/main/context.h8
-rw-r--r--src/mesa/main/convolve.c35
-rw-r--r--src/mesa/main/dd.h54
-rw-r--r--src/mesa/main/descrip.mms3
-rw-r--r--src/mesa/main/dlist.c22
-rw-r--r--src/mesa/main/enums.c5939
-rw-r--r--src/mesa/main/extensions.c5
-rw-r--r--src/mesa/main/fbobject.c33
-rw-r--r--src/mesa/main/framebuffer.c9
-rw-r--r--src/mesa/main/get.c39
-rw-r--r--src/mesa/main/get_gen.py13
-rw-r--r--src/mesa/main/getstring.c25
-rw-r--r--src/mesa/main/histogram.c4
-rw-r--r--src/mesa/main/image.c450
-rw-r--r--src/mesa/main/image.h42
-rw-r--r--src/mesa/main/imports.h22
-rw-r--r--src/mesa/main/light.c1
-rw-r--r--src/mesa/main/macros.h24
-rw-r--r--src/mesa/main/mipmap.c1147
-rw-r--r--src/mesa/main/mipmap.h (renamed from progs/tools/trace/gltrace_support.h)61
-rw-r--r--src/mesa/main/mm.c2
-rw-r--r--src/mesa/main/mtypes.h88
-rw-r--r--src/mesa/main/pixel.c790
-rw-r--r--src/mesa/main/pixel.h42
-rw-r--r--src/mesa/main/rastpos.c1
-rw-r--r--src/mesa/main/sources138
-rw-r--r--src/mesa/main/state.c67
-rw-r--r--src/mesa/main/state.h6
-rw-r--r--src/mesa/main/stencil.c19
-rw-r--r--src/mesa/main/texcompress.c1
-rw-r--r--src/mesa/main/texcompress_fxt1.c5
-rw-r--r--src/mesa/main/texcompress_s3tc.c6
-rw-r--r--src/mesa/main/texenvprogram.c57
-rw-r--r--src/mesa/main/texformat_tmp.h119
-rw-r--r--src/mesa/main/teximage.c1088
-rw-r--r--src/mesa/main/teximage.h21
-rw-r--r--src/mesa/main/texobj.c39
-rw-r--r--src/mesa/main/texobj.h4
-rw-r--r--src/mesa/main/texstate.c125
-rw-r--r--src/mesa/main/texstore.c1742
-rw-r--r--src/mesa/main/texstore.h21
-rw-r--r--src/mesa/main/version.h6
-rw-r--r--src/mesa/math/sources25
-rw-r--r--src/mesa/shader/arbprogparse.c27
-rw-r--r--src/mesa/shader/arbprogram.c41
-rw-r--r--src/mesa/shader/arbprogram.h8
-rw-r--r--src/mesa/shader/atifragshader.c2
-rw-r--r--src/mesa/shader/descrip.mms7
-rw-r--r--src/mesa/shader/grammar/grammar.c49
-rw-r--r--[-rwxr-xr-x]src/mesa/shader/grammar/grammar_crt.c0
-rw-r--r--[-rwxr-xr-x]src/mesa/shader/grammar/grammar_crt.h0
-rw-r--r--src/mesa/shader/grammar/sources8
-rw-r--r--src/mesa/shader/nvfragparse.c10
-rw-r--r--src/mesa/shader/nvprogram.c33
-rw-r--r--src/mesa/shader/nvvertexec.c351
-rw-r--r--src/mesa/shader/nvvertexec.h34
-rw-r--r--src/mesa/shader/nvvertparse.c12
-rw-r--r--src/mesa/shader/program.c346
-rw-r--r--src/mesa/shader/program.h30
-rw-r--r--src/mesa/shader/program_instruction.h9
-rw-r--r--src/mesa/shader/programopt.c196
-rw-r--r--src/mesa/shader/programopt.h2
-rw-r--r--src/mesa/shader/shaderobjects.c1723
-rw-r--r--src/mesa/shader/shaderobjects.h75
-rw-r--r--[-rwxr-xr-x]src/mesa/shader/shaderobjects_3dlabs.c2620
-rw-r--r--[-rwxr-xr-x]src/mesa/shader/shaderobjects_3dlabs.h0
-rwxr-xr-xsrc/mesa/shader/slang/Include/BaseTypes.h133
-rwxr-xr-xsrc/mesa/shader/slang/Include/Common.h288
-rwxr-xr-xsrc/mesa/shader/slang/Include/ConstantUnion.h50
-rwxr-xr-xsrc/mesa/shader/slang/Include/InfoSink.h135
-rwxr-xr-xsrc/mesa/shader/slang/Include/InitializeGlobals.h43
-rwxr-xr-xsrc/mesa/shader/slang/Include/InitializeParseContext.h44
-rwxr-xr-xsrc/mesa/shader/slang/Include/PoolAlloc.h346
-rwxr-xr-xsrc/mesa/shader/slang/Include/ResourceLimits.h61
-rwxr-xr-xsrc/mesa/shader/slang/Include/ShHandle.h177
-rwxr-xr-xsrc/mesa/shader/slang/Include/Types.h297
-rwxr-xr-xsrc/mesa/shader/slang/Include/intermediate.h516
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp2942
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp4354
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/InfoSink.cpp107
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/Initialize.cpp948
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/Initialize.h58
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/IntermTraverse.cpp243
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/Intermediate.cpp2110
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/MMap.h84
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/ParseHelper.cpp1452
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/ParseHelper.h143
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp349
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/QualifierAlive.cpp91
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/QualifierAlive.h35
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/RemoveTree.cpp98
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/RemoveTree.h35
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/ShaderLang.cpp607
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/SymbolTable.cpp235
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/SymbolTable.h320
-rw-r--r--src/mesa/shader/slang/MachineIndependent/glslang.l614
-rw-r--r--src/mesa/shader/slang/MachineIndependent/glslang.y2009
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/glslang_tab.h260
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/intermOut.cpp496
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/localintermediate.h91
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/parseConst.cpp344
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/atom.c768
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/atom.h96
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/compile.h132
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/cpp.c1037
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/cpp.h119
-rw-r--r--src/mesa/shader/slang/MachineIndependent/preprocessor/cpp_comment_fix.c76
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/cppstruct.c185
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/memory.c191
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/memory.h89
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/parser.h126
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/preprocess.h84
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/scanner.c789
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/scanner.h118
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/slglobals.h115
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/symbols.c318
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/symbols.h145
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/tokens.c462
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/preprocessor/tokens.h122
-rwxr-xr-xsrc/mesa/shader/slang/MachineIndependent/unistd.h1
-rwxr-xr-xsrc/mesa/shader/slang/OGLCompilersDLL/Initialisation.cpp151
-rwxr-xr-xsrc/mesa/shader/slang/OGLCompilersDLL/Initialisation.h47
-rwxr-xr-xsrc/mesa/shader/slang/OSDependent/Linux/osinclude.h78
-rwxr-xr-xsrc/mesa/shader/slang/OSDependent/Linux/ossource.cpp140
-rwxr-xr-xsrc/mesa/shader/slang/OSDependent/Windows/osinclude.h68
-rwxr-xr-xsrc/mesa/shader/slang/OSDependent/Windows/ossource.cpp119
-rwxr-xr-xsrc/mesa/shader/slang/Public/ShaderLang.h212
-rwxr-xr-xsrc/mesa/shader/slang/Public/ShaderLangExt.h57
-rw-r--r--src/mesa/shader/slang/library/Makefile85
-rw-r--r--[-rwxr-xr-x]src/mesa/shader/slang/library/gc_to_bin.c41
-rwxr-xr-xsrc/mesa/shader/slang/library/slang_builtin_120_common.gc6
-rwxr-xr-xsrc/mesa/shader/slang/library/slang_pp_directives.syn385
-rw-r--r--src/mesa/shader/slang/library/slang_pp_directives_syn.h239
-rwxr-xr-xsrc/mesa/shader/slang/library/slang_pp_expression.syn265
-rw-r--r--src/mesa/shader/slang/library/slang_pp_expression_syn.h179
-rw-r--r--src/mesa/shader/slang/library/slang_pp_version.syn4
-rw-r--r--src/mesa/shader/slang/library/slang_shader_syn.h3
-rw-r--r--[-rwxr-xr-x]src/mesa/shader/slang/library/slang_version_syn.h0
-rw-r--r--src/mesa/shader/slang/slang_analyse.c4
-rw-r--r--src/mesa/shader/slang/slang_assemble.c2473
-rw-r--r--src/mesa/shader/slang/slang_assemble.h288
-rw-r--r--src/mesa/shader/slang/slang_assemble_assignment.c184
-rw-r--r--src/mesa/shader/slang/slang_assemble_assignment.h17
-rw-r--r--src/mesa/shader/slang/slang_assemble_constructor.c628
-rw-r--r--src/mesa/shader/slang/slang_assemble_constructor.h45
-rw-r--r--src/mesa/shader/slang/slang_assemble_typeinfo.c1036
-rw-r--r--src/mesa/shader/slang/slang_assemble_typeinfo.h138
-rw-r--r--src/mesa/shader/slang/slang_compile.c3166
-rw-r--r--src/mesa/shader/slang/slang_compile_function.c252
-rw-r--r--src/mesa/shader/slang/slang_compile_function.h80
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.c125
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.h173
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.c574
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.h119
-rw-r--r--src/mesa/shader/slang/slang_execute.c1032
-rw-r--r--src/mesa/shader/slang/slang_execute.h66
-rw-r--r--src/mesa/shader/slang/slang_execute_x86.c1114
-rw-r--r--src/mesa/shader/slang/slang_link.c1178
-rw-r--r--src/mesa/shader/slang/slang_link.h383
-rw-r--r--src/mesa/shader/slang/slang_preprocess.c1100
-rw-r--r--src/mesa/shader/slang/slang_preprocess.h5
-rw-r--r--src/mesa/shader/slang/slang_utility.c222
-rw-r--r--src/mesa/shader/slang/slang_utility.h38
-rw-r--r--src/mesa/shader/slang/sources44
-rw-r--r--src/mesa/shader/sources28
-rw-r--r--src/mesa/sources3
-rw-r--r--src/mesa/sparc/glapi_sparc.S242
-rw-r--r--src/mesa/sparc/sparc.c2
-rw-r--r--src/mesa/swrast/s_aaline.c2
-rw-r--r--src/mesa/swrast/s_aatritemp.h10
-rw-r--r--src/mesa/swrast/s_accum.c47
-rw-r--r--src/mesa/swrast/s_alpha.c270
-rw-r--r--src/mesa/swrast/s_alpha.h2
-rw-r--r--src/mesa/swrast/s_arbshader.c52
-rw-r--r--src/mesa/swrast/s_arbshader.h2
-rw-r--r--src/mesa/swrast/s_atifragshader.c108
-rw-r--r--src/mesa/swrast/s_atifragshader.h2
-rw-r--r--src/mesa/swrast/s_bitmap.c43
-rw-r--r--src/mesa/swrast/s_blend.c1023
-rw-r--r--src/mesa/swrast/s_blend.h9
-rw-r--r--src/mesa/swrast/s_buffers.c100
-rw-r--r--src/mesa/swrast/s_context.c69
-rw-r--r--src/mesa/swrast/s_context.h78
-rw-r--r--src/mesa/swrast/s_copypix.c331
-rw-r--r--src/mesa/swrast/s_depth.c8
-rw-r--r--src/mesa/swrast/s_depth.h4
-rw-r--r--src/mesa/swrast/s_drawpix.c687
-rw-r--r--src/mesa/swrast/s_fog.c241
-rw-r--r--src/mesa/swrast/s_fog.h4
-rw-r--r--src/mesa/swrast/s_imaging.c8
-rw-r--r--src/mesa/swrast/s_lines.c2
-rw-r--r--src/mesa/swrast/s_linetemp.h2
-rw-r--r--src/mesa/swrast/s_logic.c110
-rw-r--r--src/mesa/swrast/s_logic.h8
-rw-r--r--src/mesa/swrast/s_masking.c158
-rw-r--r--src/mesa/swrast/s_masking.h23
-rw-r--r--src/mesa/swrast/s_nvfragprog.c620
-rw-r--r--src/mesa/swrast/s_nvfragprog.h2
-rw-r--r--src/mesa/swrast/s_pointtemp.h20
-rw-r--r--src/mesa/swrast/s_readpix.c235
-rw-r--r--src/mesa/swrast/s_span.c1088
-rw-r--r--src/mesa/swrast/s_span.h23
-rw-r--r--src/mesa/swrast/s_stencil.c6
-rw-r--r--src/mesa/swrast/s_stencil.h2
-rw-r--r--src/mesa/swrast/s_texcombine.c10
-rw-r--r--src/mesa/swrast/s_texcombine.h2
-rw-r--r--src/mesa/swrast/s_texfilter.c6
-rw-r--r--src/mesa/swrast/s_texstore.c77
-rw-r--r--src/mesa/swrast/s_triangle.c29
-rw-r--r--src/mesa/swrast/s_tritemp.h2
-rw-r--r--src/mesa/swrast/s_zoom.c137
-rw-r--r--src/mesa/swrast/s_zoom.h10
-rw-r--r--src/mesa/swrast/sources65
-rw-r--r--src/mesa/swrast/swrast.h14
-rw-r--r--src/mesa/swrast_setup/sources10
-rw-r--r--src/mesa/tnl/sources46
-rw-r--r--src/mesa/tnl/t_array_api.c20
-rw-r--r--src/mesa/tnl/t_array_import.c5
-rw-r--r--src/mesa/tnl/t_context.c10
-rw-r--r--src/mesa/tnl/t_context.h1
-rw-r--r--src/mesa/tnl/t_save_api.c8
-rw-r--r--src/mesa/tnl/t_save_playback.c1
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c5
-rw-r--r--src/mesa/tnl/t_vb_cliptmp.h17
-rw-r--r--src/mesa/tnl/t_vb_program.c14
-rw-r--r--src/mesa/tnl/t_vp_build.c4
-rw-r--r--src/mesa/tnl/t_vtx_api.c24
-rw-r--r--src/mesa/tnl/t_vtx_exec.c5
-rw-r--r--src/mesa/x86-64/glapi_x86-64.S4659
-rw-r--r--src/mesa/x86-64/matypes.h24
-rw-r--r--src/mesa/x86-64/x86-64.c7
-rw-r--r--src/mesa/x86/glapi_x86.S295
-rw-r--r--src/mesa/x86/matypes.h24
-rw-r--r--src/mesa/x86/mmx.h21
-rw-r--r--windows/VC6/mesa/mesa/mesa.dsp4
-rw-r--r--windows/VC7/mesa/mesa/mesa.vcproj3
1230 files changed, 72818 insertions, 198887 deletions
diff --git a/Makefile b/Makefile
index 2fd8d35af9b..74784888981 100644
--- a/Makefile
+++ b/Makefile
@@ -154,16 +154,17 @@ ultrix-gcc:
# Rules for making release tarballs
-DIRECTORY = Mesa-6.5.1
-LIB_NAME = MesaLib-6.5.1
-DEMO_NAME = MesaDemos-6.5.1
-GLUT_NAME = MesaGLUT-6.5.1
+DIRECTORY = Mesa-6.5.2
+LIB_NAME = MesaLib-6.5.2
+DEMO_NAME = MesaDemos-6.5.2
+GLUT_NAME = MesaGLUT-6.5.2
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/descrip.mms \
$(DIRECTORY)/mms-config. \
$(DIRECTORY)/bin/mklib \
+ $(DIRECTORY)/bin/minstall \
$(DIRECTORY)/configs/[a-z]* \
$(DIRECTORY)/docs/*.html \
$(DIRECTORY)/docs/COPYING \
@@ -173,7 +174,6 @@ MAIN_FILES = \
$(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 \
@@ -204,25 +204,35 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/depend \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/descrip.mms \
+ $(DIRECTORY)/src/mesa/main/sources \
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
+ $(DIRECTORY)/src/mesa/glapi/sources \
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \
+ $(DIRECTORY)/src/mesa/array_cache/sources \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
+ $(DIRECTORY)/src/mesa/math/sources \
$(DIRECTORY)/src/mesa/shader/*.[ch] \
$(DIRECTORY)/src/mesa/shader/descrip.mms \
+ $(DIRECTORY)/src/mesa/shader/sources \
$(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \
$(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \
+ $(DIRECTORY)/src/mesa/shader/grammar/sources \
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
+ $(DIRECTORY)/src/mesa/shader/slang/sources \
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
+ $(DIRECTORY)/src/mesa/swrast/sources \
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
+ $(DIRECTORY)/src/mesa/swrast_setup/sources \
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
+ $(DIRECTORY)/src/mesa/tnl/sources \
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
@@ -230,6 +240,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/common/descrip.mms \
+ $(DIRECTORY)/src/mesa/drivers/common/sources \
$(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/directfb/Makefile \
$(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \
@@ -250,6 +261,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
+ $(DIRECTORY)/src/mesa/drivers/x11/sources \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
diff --git a/bin/minstall b/bin/minstall
new file mode 100755
index 00000000000..9795263f9f1
--- /dev/null
+++ b/bin/minstall
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+
+# A minimal replacement for 'install' that supports installing symbolic links.
+# Only a limited number of options are supported:
+# -d dir Create a directory
+# -m mode Sets a file's mode when installing
+
+
+# If these commands aren't portable, we'll need some "if (arch)" type stuff
+SYMLINK="ln -s"
+MKDIR="mkdir -p"
+RM="rm -f"
+
+MODE=""
+
+if [ "$1" = "-d" ] ; then
+ # make a directory path
+ $MKDIR "$2"
+ exit 0
+fi
+
+if [ "$1" = "-m" ] ; then
+ # set file mode
+ MODE=$2
+ shift 2
+fi
+
+# install file(s) into destination
+if [ $# -ge 2 ] ; then
+
+ # Last cmd line arg is the dest dir
+ for FILE in $@ ; do
+ DEST="$FILE"
+ done
+
+ # Loop over args, moving them to DEST directory
+ I=1
+ for FILE in $@ ; do
+ if [ $I = $# ] ; then
+ # stop, don't want to install $DEST into $DEST
+ exit 0
+ fi
+
+ # determine file's type
+ if [ -h "$FILE" ] ; then
+ #echo $FILE is a symlink
+ # Unfortunately, cp -d isn't universal so we have to
+ # use a work-around.
+
+ # Use ls -l to find the target that the link points to
+ LL=`ls -l "$FILE"`
+ for L in $LL ; do
+ TARGET=$L
+ done
+ #echo $FILE is a symlink pointing to $TARGET
+
+ FILE=`basename "$FILE"`
+ # Go to $DEST and make the link
+ PWDSAVE="$PWD"
+ cd "$DEST" # pushd
+ $RM "$FILE"
+ $SYMLINK "$TARGET" "$FILE"
+ cd "$PWDSAVE" # popd
+
+ elif [ -f "$FILE" ] ; then
+ #echo "$FILE" is a regular file
+ cp "$FILE" "$DEST"
+ if [ $MODE ] ; then
+ FILE=`basename "$FILE"`
+ chmod $MODE "$DEST/$FILE"
+ fi
+ else
+ echo "Unknown type of argument: " "$FILE"
+ exit 1
+ fi
+
+ I=`expr $I + 1`
+ done
+
+ exit 0
+fi
+
+# If we get here, we didn't find anything to do
+echo "Usage:"
+echo " install -d dir Create named directory"
+echo " install [-m mode] file [...] dest Install files in destination"
+
diff --git a/bin/mklib b/bin/mklib
index 0637662ff7c..7d468b12e77 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -283,7 +283,9 @@ case $ARCH in
ar -ruv ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
- LIBNAME="lib${LIBNAME}.so"
+ if [ $NOPREFIX = 0 ] ; then
+ LIBNAME="lib${LIBNAME}.so"
+ fi
echo "mklib: Making SunOS shared library: " ${LIBNAME}
if [ "x$LINK" = "x" ] ; then
@@ -333,9 +335,14 @@ case $ARCH in
# for debug:
#echo "mklib: linker is" ${LINK} ${OPTS}
- rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
- ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
+ if [ $NOPREFIX = 1 ] ; then
+ rm -f ${LIBNAME}
+ ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
+ else
+ rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
+ ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
+ ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
+ fi
FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
fi
;;
diff --git a/configs/CVS/Entries b/configs/CVS/Entries
deleted file mode 100644
index 15b3dddb230..00000000000
--- a/configs/CVS/Entries
+++ /dev/null
@@ -1,92 +0,0 @@
-/linux-osmesa16-static/1.1/Fri Mar 26 15:16:35 2004//
-/linux-ppc/1.3/Fri Jul 15 22:18:52 2005//
-/linux-ppc-static/1.3/Fri Jul 15 22:18:52 2005//
-/linux-static/1.3/Fri Jul 15 22:18:52 2005//
-/linux-x86-32/1.4/Fri Jul 15 22:18:52 2005//
-/linux-solo-ia64/1.8/Thu Aug 11 14:15:58 2005//
-/linux-dri-ppc/1.3/Fri Aug 19 22:03:05 2005//
-/freebsd-dri-amd64/1.3/Mon Sep 12 15:03:11 2005//
-/freebsd-dri-x86/1.2/Mon Sep 12 15:03:11 2005//
-/linux-dri-x86/1.12/Mon Sep 12 15:03:11 2005//
-/linux-solo-x86/1.9/Mon Sep 12 15:03:11 2005//
-/linux-x86-64-debug/1.4/Sat Nov 12 17:56:59 2005//
-/linux-x86-debug/1.4/Sat Nov 12 17:56:59 2005//
-/sunos5-64-gcc/1.1/Mon Apr 3 16:09:53 2006//
-/darwin-static/1.3/Tue Apr 11 20:47:33 2006//
-/darwin-static-x86ppc/1.2/Fri Apr 21 01:03:51 2006//
-/linux-x86/1.7/Sat Apr 22 00:21:52 2006//
-/aix/1.5/Thu Jun 22 22:24:33 2006//
-/aix-64/1.5/Thu Jul 13 02:43:20 2006//
-/aix-64-static/1.3/Thu Jul 13 02:43:20 2006//
-/aix-gcc/1.4/Thu Jul 13 02:43:20 2006//
-/aix-static/1.3/Thu Jul 13 02:43:20 2006//
-/beos/1.7/Thu Jul 13 02:43:20 2006//
-/darwin/1.6/Thu Jul 13 02:43:20 2006//
-/darwin-x86ppc/1.3/Thu Jul 13 02:43:20 2006//
-/hpux10-gcc/1.2/Thu Jul 13 02:43:20 2006//
-/irix6-64/1.6/Thu Jul 13 02:43:20 2006//
-/irix6-64-static/1.6/Thu Jul 13 02:43:20 2006//
-/irix6-n32/1.6/Thu Jul 13 02:43:20 2006//
-/irix6-n32-static/1.6/Thu Jul 13 02:43:20 2006//
-/irix6-o32/1.5/Thu Jul 13 02:43:20 2006//
-/irix6-o32-static/1.6/Thu Jul 13 02:43:20 2006//
-/linux-alpha/1.3/Thu Jul 13 02:43:20 2006//
-/linux-alpha-static/1.3/Thu Jul 13 02:43:20 2006//
-/linux-directfb/1.4/Thu Jul 13 02:43:20 2006//
-/linux-dri-x86-64/1.21/Thu Jul 13 02:43:20 2006//
-/linux-glide/1.4/Thu Jul 13 02:43:20 2006//
-/linux-ia64-icc/1.2/Thu Jul 13 02:43:20 2006//
-/linux-ia64-icc-static/1.2/Thu Jul 13 02:43:20 2006//
-/linux-icc/1.5/Thu Jul 13 02:43:20 2006//
-/linux-icc-static/1.6/Thu Jul 13 02:43:20 2006//
-/linux-osmesa/1.3/Thu Jul 13 02:43:20 2006//
-/linux-osmesa16/1.3/Thu Jul 13 02:43:20 2006//
-/linux-osmesa32/1.3/Thu Jul 13 02:43:20 2006//
-/linux-profile/1.3/Thu Jul 13 02:43:20 2006//
-/linux-x86-64/1.11/Thu Jul 13 02:43:20 2006//
-/linux-x86-64-static/1.8/Thu Jul 13 02:43:20 2006//
-/linux-x86-glide/1.6/Thu Jul 13 02:43:20 2006//
-/linux-x86-static/1.7/Thu Jul 13 02:43:20 2006//
-/netbsd/1.2/Thu Jul 13 02:43:20 2006//
-/openbsd/1.3/Thu Jul 13 02:43:20 2006//
-/osf1/1.5/Thu Jul 13 02:43:20 2006//
-/osf1-static/1.2/Thu Jul 13 02:43:20 2006//
-/solaris-x86/1.3/Thu Jul 13 02:43:20 2006//
-/solaris-x86-gcc/1.6/Thu Jul 13 02:43:20 2006//
-/solaris-x86-gcc-static/1.3/Thu Jul 13 02:43:20 2006//
-/sunos4/1.2/Thu Jul 13 02:43:20 2006//
-/sunos4-gcc/1.2/Thu Jul 13 02:43:20 2006//
-/sunos4-static/1.3/Thu Jul 13 02:43:20 2006//
-/sunos5/1.3/Thu Jul 13 02:43:20 2006//
-/sunos5-gcc/1.6/Thu Jul 13 02:43:20 2006//
-/sunos5-smp/1.3/Thu Jul 13 02:43:20 2006//
-/sunos5-v8/1.2/Thu Jul 13 02:43:20 2006//
-/sunos5-v8-static/1.2/Thu Jul 13 02:43:20 2006//
-/sunos5-v9/1.3/Thu Jul 13 02:43:20 2006//
-/sunos5-v9-static/1.3/Thu Jul 13 02:43:20 2006//
-/ultrix-gcc/1.3/Thu Jul 13 02:43:20 2006//
-/linux-debug/1.9/Thu Jul 13 02:43:26 2006//
-/freebsd/1.8/Thu Aug 17 14:09:02 2006//
-/freebsd-dri/1.21/Thu Aug 17 14:09:02 2006//
-/linux-dri/1.44/Thu Aug 17 14:09:02 2006//
-/linux-dri-xcb/1.4/Thu Aug 17 14:09:02 2006//
-/linux-indirect/1.6/Thu Aug 17 14:09:02 2006//
-/linux-solo/1.25/Thu Aug 17 14:09:02 2006//
-/linux-fbdev/1.5/Mon Aug 21 16:03:34 2006//
-/linux/1.8/Thu Aug 24 23:37:59 2006//
-/linux-sparc/1.6/Thu Aug 24 23:37:59 2006//
-/linux-sparc5/1.5/Thu Aug 24 23:37:59 2006//
-/linux-ultrasparc/1.4/Thu Aug 24 23:37:59 2006//
-/default/1.27/Mon Sep 11 21:35:46 2006//
-/hpux10/1.3/Mon Sep 11 21:35:46 2006//
-/hpux10-static/1.4/Mon Sep 11 21:35:46 2006//
-/hpux11-32/1.4/Mon Sep 11 21:35:46 2006//
-/hpux11-32-static/1.4/Mon Sep 11 21:35:46 2006//
-/hpux11-32-static-nothreads/1.2/Mon Sep 11 21:35:46 2006//
-/hpux11-64/1.4/Mon Sep 11 21:35:46 2006//
-/hpux11-64-static/1.4/Mon Sep 11 21:35:46 2006//
-/hpux11-ia64/1.3/Mon Sep 11 21:35:46 2006//
-/hpux11-ia64-static/1.3/Mon Sep 11 21:35:46 2006//
-/hpux9/1.3/Mon Sep 11 21:35:46 2006//
-/hpux9-gcc/1.3/Mon Sep 11 21:35:46 2006//
-D
diff --git a/configs/CVS/Repository b/configs/CVS/Repository
deleted file mode 100644
index 467347235d9..00000000000
--- a/configs/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-Mesa/configs
diff --git a/configs/CVS/Root b/configs/CVS/Root
deleted file mode 100644
index 231303aae3e..00000000000
--- a/configs/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:ext:brianp@cvs.freedesktop.org:/cvs/mesa
diff --git a/configs/CVS/Root.bak b/configs/CVS/Root.bak
deleted file mode 100644
index eba07540827..00000000000
--- a/configs/CVS/Root.bak
+++ /dev/null
@@ -1 +0,0 @@
-:ext:brianp@pdx.freedesktop.org:/cvs/mesa
diff --git a/configs/CVS/Template b/configs/CVS/Template
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/configs/CVS/Template
+++ /dev/null
diff --git a/configs/aix b/configs/aix
index 313d4c4fdb3..ebbf5837455 100644
--- a/configs/aix
+++ b/configs/aix
@@ -13,7 +13,6 @@ CXXFLAGS = -O -DAIXV3 -DPTHREADS
# Misc tools and flags
MKLIB_OPTIONS =
-COPY_LIBS = cp -f -h
# Library names (actual file names)
GL_LIB_NAME = libGL.a
diff --git a/configs/debian b/configs/debian
deleted file mode 100644
index 2af0d1fc95f..00000000000
--- a/configs/debian
+++ /dev/null
@@ -1,25 +0,0 @@
-include $(TOP)/configs/default
-
-CONFIG_NAME = debian
-
-CC = cc
-CXX = c++
-
-DEBIAN_COMMON_CPPFLAGS = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DUSE_XSHM -DPTHREADS `pkg-config --cflags x11 xext`
-
-DEBIAN_COMMON_CFLAGS = -std=c99 -pedantic -Wall -fPIC -fno-strict-aliasing
-
-DEBIAN_COMMON_CXXFLAGS = -ansi -pedantic -Wall -fPIC -fno-strict-aliasing
-
-DEBIAN_OPT_CFLAGS = -O2
-
-CFLAGS = $(DEBIAN_COMMON_CPPFLAGS) $(DEBIAN_COMMON_CFLAGS) $(DEBIAN_OPT_CFLAGS)
-CXXFLAGS = $(DEBIAN_COMMON_CPPFLAGS) $(DEBIAN_COMMON_CXXFLAGS) $(DEBIAN_OPT_CFLAGS)
-
-GLW_SOURCES += GLwMDrawA.c
-
-GL_LIB_DEPS = `pkg-config --libs x11 xext` -lm -lpthread
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) `pkg-config --libs x11 xt` -lXm
-
-DRI_DRIVER_INSTALL_DIR = /usr/lib/dri
-DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
diff --git a/configs/debian-debug b/configs/debian-debug
deleted file mode 100644
index d199c5d894c..00000000000
--- a/configs/debian-debug
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(TOP)/configs/debian
-
-CONFIG_NAME = debian-debug
-
-DEBIAN_COMMON_CPPFLAGS += -DDEBUG -DMESA_DEBUG
-
-DEBIAN_OPT_CFLAGS =
diff --git a/configs/debian-debug_i386 b/configs/debian-debug_i386
deleted file mode 100644
index 67f19ccf30a..00000000000
--- a/configs/debian-debug_i386
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(TOP)/configs/debian-debug
-
-CONFIG_NAME = debian-debug-i386
-
-DEBIAN_OPT_CFLAGS = -march=i686 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
-
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
diff --git a/configs/debian-default b/configs/debian-default
new file mode 100644
index 00000000000..aa4721a9ee4
--- /dev/null
+++ b/configs/debian-default
@@ -0,0 +1,18 @@
+# Define Debian-specific defaults.
+
+CONFIG_NAME = debian-default
+
+OPT_FLAGS = -O2 -g
+CFLAGS += -fno-strict-aliasing
+
+# override settings in configs/linux-x86-64
+LIB_DIR = lib
+EXTRA_LIB_PATH =
+
+SRC_DIRS = mesa
+PROGRAM_DIRS =
+
+INSTALL_DIR = $(DESTDIR)/usr
+
+# vim: ft=make
+
diff --git a/configs/debian-directfb b/configs/debian-directfb
deleted file mode 100644
index fb8c711da2e..00000000000
--- a/configs/debian-directfb
+++ /dev/null
@@ -1,16 +0,0 @@
-include $(TOP)/configs/debian
-
-CONFIG_NAME = debian-directfb
-
-GL_LIB_DEPS = -lm -lpthread
-
-DRIVER_DIRS = directfb
-
-ifeq ($(DEB_HOST_ARCH),hurd-i386)
-gnudefault:
- @echo "No directfb on hurd, disabling the build by default target
-diversion"
- @echo "Creating an empty and invalid shared object so that the build
-runs OK"
- touch mesa/drivers/directfb/libidirectfbgl_mesa.so
-endif
diff --git a/configs/debian-dri b/configs/debian-dri
deleted file mode 100644
index c024d236e36..00000000000
--- a/configs/debian-dri
+++ /dev/null
@@ -1,45 +0,0 @@
-include $(TOP)/configs/debian
-
-CONFIG_NAME = debian-dri
-
-ifeq ($(DEB_HOST_ARCH_OS),hurd)
-# Switch to debian-indirect target
- include $(TOP)/configs/debian-indirect
-else
-
-DEBIAN_COMMON_CPPFLAGS += -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DDEFAULT_DRIVER_DIR=\"$(DEBIAN_DRIVERS_DIR)\"
-
-LIBDRM_LIB = `pkg-config --libs libdrm`
-DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
-GL_LIB_DEPS = `pkg-config --libs x11 xext xxf86vm` -lm -lpthread -ldl $(LIBDRM_LIB)
-LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
-
-USING_EGL=0
-
-# Directories
-ifeq ($(USING_EGL), 1)
-override SRC_DIRS = egl glx/x11 mesa
-PROGRAM_DIRS = egl
-else
-override SRC_DIRS = glx/x11 mesa
-PROGRAM_DIRS =
-endif
-
-DRIVER_DIRS = dri
-WINDOW_SYSTEM=dri
-
-DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident
-
-ifeq ($(DEB_HOST_ARCH),i386)
-DRI_DIRS += i810 i915 i965 sis unichrome
-endif
-
-ifeq ($(DEB_HOST_ARCH),amd64)
-DRI_DIRS += i915 i965 unichrome
-endif
-
-ifeq ($(DEB_HOST_ARCH),sparc)
-DRI_DIRS += ffb
-endif
-
-endif # DRI or debian-indirect
diff --git a/configs/debian-dri-amd64 b/configs/debian-dri-amd64
new file mode 100644
index 00000000000..ff4232b1200
--- /dev/null
+++ b/configs/debian-dri-amd64
@@ -0,0 +1,9 @@
+# Configuration for building the DRI drivers on i386.
+
+include $(TOP)/configs/linux-dri-x86-64
+include $(TOP)/configs/debian-dri-default
+
+CONFIG_NAME = debian-dri-amd64
+
+# vim: ft=make
+
diff --git a/configs/debian-dri-any b/configs/debian-dri-any
new file mode 100644
index 00000000000..c4b65b0c482
--- /dev/null
+++ b/configs/debian-dri-any
@@ -0,0 +1,9 @@
+# Configuration for building the DRI drivers on the build architecture.
+
+include $(TOP)/configs/linux-dri
+include $(TOP)/configs/debian-dri-default
+
+CONFIG_NAME = debian-dri-any
+
+# vim: ft=make
+
diff --git a/configs/debian-dri-default b/configs/debian-dri-default
new file mode 100644
index 00000000000..f92c7eddd01
--- /dev/null
+++ b/configs/debian-dri-default
@@ -0,0 +1,36 @@
+# Configuration defaults for building the DRI drivers and DRI/GLX-enabled
+# libGL.
+
+include $(TOP)/configs/debian-default
+
+CONFIG_NAME = debian-dri-default
+
+SRC_DIRS = glx/x11 mesa progs
+DRIVER_DIRS = dri
+PROGRAM_DIRS = xdemos
+PROGS = glxdemo \
+ glxgears \
+ glxheads \
+ glxinfo
+
+LIB_DIR = lib/glx
+
+DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri
+DRI_DRIVER_SEARCH_DIR = /usr/lib/dri
+
+DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident
+
+ARCH_X86 = i386 amd64
+
+ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),)
+ DRI_DIRS += i810 i915 i915tex i965 sis unichrome
+endif
+
+ifeq ($(DEB_BUILD_ARCH), sparc)
+ DRI_DIRS += ffb
+endif
+
+APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
+
+# vim: ft=make
+
diff --git a/configs/debian-dri-i386 b/configs/debian-dri-i386
new file mode 100644
index 00000000000..7a0aaa487d2
--- /dev/null
+++ b/configs/debian-dri-i386
@@ -0,0 +1,9 @@
+# Configuration for building the DRI drivers on i386.
+
+include $(TOP)/configs/linux-dri-x86
+include $(TOP)/configs/debian-dri-default
+
+CONFIG_NAME = debian-dri-i386
+
+# vim: ft=make
+
diff --git a/configs/debian-dri-i386-i686 b/configs/debian-dri-i386-i686
new file mode 100644
index 00000000000..b15cd77a03d
--- /dev/null
+++ b/configs/debian-dri-i386-i686
@@ -0,0 +1,14 @@
+# Configuration for building the DRI drivers on i386.
+
+include $(TOP)/configs/linux-dri-x86
+include $(TOP)/configs/debian-dri-optimized-default
+
+CONFIG_NAME = debian-dri-i386-i686
+
+ARCH_FLAGS = -march=i686
+LIB_DIR = lib/glx/i686/cmov
+
+DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri/i686/cmov
+
+# vim: ft=make
+
diff --git a/configs/debian-dri-optimized-default b/configs/debian-dri-optimized-default
new file mode 100644
index 00000000000..9c3f68dde7a
--- /dev/null
+++ b/configs/debian-dri-optimized-default
@@ -0,0 +1,13 @@
+# Configuration defaults for CPU-optimized builds of the DRI drivers and
+# DRI/GLX-enabled libGL.
+
+include $(TOP)/configs/debian-dri-default
+
+CONFIG_NAME = debian-dri-optimized-default
+
+# override so that the utility programs are not rebuilt with CPU-specific
+# optimizations
+SRC_DIRS = glx/x11 mesa
+
+# vim: ft=make
+
diff --git a/configs/debian-glide b/configs/debian-glide
deleted file mode 100644
index 9a7f43b64bd..00000000000
--- a/configs/debian-glide
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(TOP)/configs/debian
-
-CONFIG_NAME = debian-glide
-
-DEBIAN_COMMON_CPPFLAGS += -DFX -I/usr/include/glide3
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lglide3x -lm -lpthread
diff --git a/configs/debian-glide_i386 b/configs/debian-glide_i386
deleted file mode 100644
index eb323c63368..00000000000
--- a/configs/debian-glide_i386
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(TOP)/configs/debian_i386
-
-CONFIG_NAME = debian-glide-i386
-
-DEBIAN_COMMON_CPPFLAGS += -DFX -I/usr/include/glide3
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lglide3x -lm -lpthread
diff --git a/configs/debian-indirect b/configs/debian-indirect
deleted file mode 100644
index 77fdab95924..00000000000
--- a/configs/debian-indirect
+++ /dev/null
@@ -1,6 +0,0 @@
-DEBIAN_COMMON_CPPFLAGS += -DPTHREADS -DHAVE_ALIAS
-
-DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
-GL_LIB_DEPS = `pkg-config --libs x11 xext xxf86vm` -lm -lpthread -ldl
-
-SRC_DIRS = glx/x11 glu glut/glx glw
diff --git a/configs/debian-osmesa b/configs/debian-osmesa
new file mode 100644
index 00000000000..9b7fc7b2afd
--- /dev/null
+++ b/configs/debian-osmesa
@@ -0,0 +1,9 @@
+# Configuration for building only OSMesa on Debian.
+
+include $(TOP)/configs/linux-osmesa
+include $(TOP)/configs/debian-osmesa-default
+
+CONFIG_NAME = debian-osmesa
+
+# vim: ft=make
+
diff --git a/configs/debian-osmesa-default b/configs/debian-osmesa-default
new file mode 100644
index 00000000000..ef5a5ba0c7c
--- /dev/null
+++ b/configs/debian-osmesa-default
@@ -0,0 +1,10 @@
+# Configuration defaults for building OSMesa.
+
+include $(TOP)/configs/debian-default
+
+CONFIG_NAME = debian-osmesa-default
+
+DRIVER_DIRS = osmesa
+
+# vim: ft=make
+
diff --git a/configs/debian-osmesa-static b/configs/debian-osmesa-static
new file mode 100644
index 00000000000..03fe8b5f20e
--- /dev/null
+++ b/configs/debian-osmesa-static
@@ -0,0 +1,9 @@
+# Configuration for building only OSMesa (static version) on Debian.
+
+include $(TOP)/configs/linux-osmesa-static
+include $(TOP)/configs/debian-osmesa-default
+
+CONFIG_NAME = debian-osmesa-static
+
+# vim: ft=make
+
diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16
index 5176a82ce1f..0077930188f 100644
--- a/configs/debian-osmesa16
+++ b/configs/debian-osmesa16
@@ -1,15 +1,10 @@
-include $(TOP)/configs/debian
+# Configuration for building OSMesa with support for 16 bits per color
+# channel.
-CONFIG_NAME = debian-osmesa16
-
-DEBIAN_COMMON_CPPFLAGS += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
+include $(TOP)/configs/linux-osmesa16
+include $(TOP)/configs/debian-osmesa-default
-OSMESA_LIB = OSMesa16
-OSMESA_LIB_NAME = libOSMesa16.so
+CONFIG_NAME = debian-osmesa16
-SRC_DIRS = mesa glu
-DRIVER_DIRS = osmesa
-PROGRAM_DIRS =
+# vim: ft=make
-OSMESA_LIB_DEPS = -lm -lpthread
-APP_LIB_DEPS = -lOSMesa16
diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static
index 7ec23fb9eaf..6ff399e627c 100644
--- a/configs/debian-osmesa16-static
+++ b/configs/debian-osmesa16-static
@@ -1,14 +1,10 @@
-include $(TOP)/configs/debian-static
+# Configuration for building a static version of OSMesa with support for 16
+# bits per color channel.
-CONFIG_NAME = debian-osmesa16-static
-
-DEBIAN_COMMON_CPPFLAGS += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
+include $(TOP)/configs/linux-osmesa16-static
+include $(TOP)/configs/debian-osmesa-default
-OSMESA_LIB = OSMesa16
-OSMESA_LIB_NAME = libOSMesa16.a
+CONFIG_NAME = debian-osmesa16-static
-SRC_DIRS = mesa glu
-DRIVER_DIRS = osmesa
-PROGRAM_DIRS =
+# vim: ft=make
-APP_LIB_DEPS = -lOSMesa16
diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32
index 775cc7986f4..de3b3277c21 100644
--- a/configs/debian-osmesa32
+++ b/configs/debian-osmesa32
@@ -1,15 +1,10 @@
-include $(TOP)/configs/debian
+# Configuration for building OSMesa with support for 32 bits per color
+# channel.
-CONFIG_NAME = debian-osmesa32
-
-DEBIAN_COMMON_CPPFLAGS += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
+include $(TOP)/configs/linux-osmesa32
+include $(TOP)/configs/debian-osmesa-default
-OSMESA_LIB = OSMesa32
-OSMESA_LIB_NAME = libOSMesa32.so
+CONFIG_NAME = debian-osmesa32
-SRC_DIRS = mesa glu
-DRIVER_DIRS = osmesa
-PROGRAM_DIRS =
+# vim: ft=make
-OSMESA_LIB_DEPS = -lm -lpthread
-APP_LIB_DEPS = -lOSMesa32
diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static
index cea7a2b9a98..7fdfcef4013 100644
--- a/configs/debian-osmesa32-static
+++ b/configs/debian-osmesa32-static
@@ -1,14 +1,10 @@
-include $(TOP)/configs/debian-static
+# Configuration for building a static version of OSMesa with support for 32
+# bits per color channel.
-CONFIG_NAME = debian-osmesa32-static
-
-DEBIAN_COMMON_CPPFLAGS += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
+include $(TOP)/configs/linux-osmesa32-static
+include $(TOP)/configs/debian-osmesa-default
-OSMESA_LIB = OSMesa32
-OSMESA_LIB_NAME = libOSMesa32.a
+CONFIG_NAME = debian-osmesa32-static
-SRC_DIRS = mesa glu
-DRIVER_DIRS = osmesa
-PROGRAM_DIRS =
+# vim: ft=make
-APP_LIB_DEPS = -lOSMesa32
diff --git a/configs/debian-static b/configs/debian-static
deleted file mode 100644
index 95e4d69c901..00000000000
--- a/configs/debian-static
+++ /dev/null
@@ -1,33 +0,0 @@
-include $(TOP)/configs/default
-
-CONFIG_NAME = debian-static
-
-CC = cc
-CXX = c++
-
-DEBIAN_COMMON_CPPFLAGS = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
-
-DEBIAN_COMMON_CFLAGS = -std=c99 -pedantic -Wall -fno-strict-aliasing
-
-DEBIAN_COMMON_CXXFLAGS = -ansi -pedantic -Wall -fno-strict-aliasing
-
-DEBIAN_OPT_CFLAGS = -O2
-
-CFLAGS = $(DEBIAN_COMMON_CPPFLAGS) $(DEBIAN_COMMON_CFLAGS) $(DEBIAN_OPT_CFLAGS)
-CXXFLAGS = $(DEBIAN_COMMON_CPPFLAGS) $(DEBIAN_COMMON_CXXFLAGS) $(DEBIAN_OPT_CFLAGS)
-
-GLW_SOURCES += GLwMDrawA.c
-
-MKLIB_OPTIONS = -static
-
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-GL_LIB_DEPS =
-OSMESA_LIB_DEPS =
-GLU_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++
-
diff --git a/configs/debian-static_i386 b/configs/debian-static_i386
deleted file mode 100644
index df86c83cc4d..00000000000
--- a/configs/debian-static_i386
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(TOP)/configs/debian-static
-
-CONFIG_NAME = debian-static-i386
-
-DEBIAN_OPT_CFLAGS = -O3 -march=i686 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
-
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
diff --git a/configs/debian-swx11+glu-alpha-ev5 b/configs/debian-swx11+glu-alpha-ev5
new file mode 100644
index 00000000000..fd16e49e374
--- /dev/null
+++ b/configs/debian-swx11+glu-alpha-ev5
@@ -0,0 +1,12 @@
+# Configuration for building Mesa (swx11 and GLU) on alpha (ev5 optimized).
+
+include $(TOP)/configs/linux-alpha
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-alpha-ev5
+
+SRC_DIRS = mesa
+LIB_DIR = lib/ev5/cmov
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-amd64 b/configs/debian-swx11+glu-amd64
new file mode 100644
index 00000000000..4bd7e51443a
--- /dev/null
+++ b/configs/debian-swx11+glu-amd64
@@ -0,0 +1,10 @@
+# Configuration for building Mesa (swx11 and GLU) with runtime-detected
+# assembler optimizations on amd64.
+
+include $(TOP)/configs/linux-x86-64
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-amd64
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-any b/configs/debian-swx11+glu-any
new file mode 100644
index 00000000000..884c9f9f23e
--- /dev/null
+++ b/configs/debian-swx11+glu-any
@@ -0,0 +1,9 @@
+# Configuration for building Mesa (swx11 and GLU) on the build architecture.
+
+include $(TOP)/configs/linux
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-any
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-default b/configs/debian-swx11+glu-default
new file mode 100644
index 00000000000..ccf827639c6
--- /dev/null
+++ b/configs/debian-swx11+glu-default
@@ -0,0 +1,14 @@
+# Configuration defaults for building Mesa (swx11 and GLU).
+
+include $(TOP)/configs/debian-default
+
+CONFIG_NAME = debian-swx11+glu-default
+
+SRC_DIRS = mesa glu glw
+DRIVER_DIRS = x11
+
+GLW_SOURCES += GLwMDrawA.c
+GLW_LIB_DEPS += -lXm
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-i386 b/configs/debian-swx11+glu-i386
new file mode 100644
index 00000000000..0b800c64bba
--- /dev/null
+++ b/configs/debian-swx11+glu-i386
@@ -0,0 +1,10 @@
+# Configuration for building Mesa (swx11 and GLU) with runtime-detected
+# assembler optimizations on i386.
+
+include $(TOP)/configs/linux-x86
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-i386
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-i386-i686 b/configs/debian-swx11+glu-i386-i686
new file mode 100644
index 00000000000..c6969b3f830
--- /dev/null
+++ b/configs/debian-swx11+glu-i386-i686
@@ -0,0 +1,14 @@
+# Configuration for building Mesa (swx11 and GLU) with runtime-detected
+# assembler optimizations on i386 (i686 optimized).
+
+include $(TOP)/configs/linux-x86
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-i386-i686
+
+ARCH_FLAGS += -march=i686
+SRC_DIRS = mesa
+LIB_DIR = lib/i686/cmov
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-powerpc-603 b/configs/debian-swx11+glu-powerpc-603
new file mode 100644
index 00000000000..86b3580e380
--- /dev/null
+++ b/configs/debian-swx11+glu-powerpc-603
@@ -0,0 +1,13 @@
+# Configuration for building Mesa (swx11 and GLU) with runtime-detected
+# assembler optimizations on powerpc (603 optimized).
+
+include $(TOP)/configs/linux-ppc
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-powerpc-603
+
+SRC_DIRS = mesa
+LIB_DIR = lib/603/cmov
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-ppc64 b/configs/debian-swx11+glu-ppc64
new file mode 100644
index 00000000000..67c59b6eef2
--- /dev/null
+++ b/configs/debian-swx11+glu-ppc64
@@ -0,0 +1,11 @@
+# Configuration for building Mesa (swx11 and GLU) with runtime-detected
+# assembler optimizations on ppc64.
+
+include $(TOP)/configs/debian-swx11+glu-any
+
+CONFIG_NAME = debian-swx11+glu-ppc64
+
+LIB_DIR = lib64
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-sparc b/configs/debian-swx11+glu-sparc
new file mode 100644
index 00000000000..8854b40d4fc
--- /dev/null
+++ b/configs/debian-swx11+glu-sparc
@@ -0,0 +1,10 @@
+# Configuration for building Mesa (swx11 and GLU) with runtime-detected
+# assembler optimizations on sparc.
+
+include $(TOP)/configs/linux-sparc
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-sparc
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-sparc-ultrasparc b/configs/debian-swx11+glu-sparc-ultrasparc
new file mode 100644
index 00000000000..14e38018c46
--- /dev/null
+++ b/configs/debian-swx11+glu-sparc-ultrasparc
@@ -0,0 +1,13 @@
+# Configuration for building Mesa (swx11 and GLU) with runtime-detected
+# assembler optimizations on sparc (ultrasparc-optimized).
+
+include $(TOP)/configs/linux-ultrasparc
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-sparc-ultrasparc
+
+SRC_DIRS = mesa
+LIB_DIR = lib/ultrasparc/cmov
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-static-amd64 b/configs/debian-swx11+glu-static-amd64
new file mode 100644
index 00000000000..2976fbe66f3
--- /dev/null
+++ b/configs/debian-swx11+glu-static-amd64
@@ -0,0 +1,10 @@
+# Configuration for building static versions of the libraries (swx11 and GLU)
+# on amd64.
+
+include $(TOP)/configs/linux-x86-64-static
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-static-amd64
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-static-any b/configs/debian-swx11+glu-static-any
new file mode 100644
index 00000000000..82f794d28df
--- /dev/null
+++ b/configs/debian-swx11+glu-static-any
@@ -0,0 +1,10 @@
+# Configuration for building static versions of the libraries (swx11 and GLU)
+# on the build architecture.
+
+include $(TOP)/configs/linux-static
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-static-any
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-static-i386 b/configs/debian-swx11+glu-static-i386
new file mode 100644
index 00000000000..62859e42548
--- /dev/null
+++ b/configs/debian-swx11+glu-static-i386
@@ -0,0 +1,10 @@
+# Configuration for building static versions of the libraries (swx11 and GLU)
+# on i386.
+
+include $(TOP)/configs/linux-x86-static
+include $(TOP)/configs/debian-swx11+glu-default
+
+CONFIG_NAME = debian-swx11+glu-static-i386
+
+# vim: ft=make
+
diff --git a/configs/debian-swx11+glu-static-ppc64 b/configs/debian-swx11+glu-static-ppc64
new file mode 100644
index 00000000000..a9ea4a95b31
--- /dev/null
+++ b/configs/debian-swx11+glu-static-ppc64
@@ -0,0 +1,11 @@
+# Configuration for building static versions of the libraries (swx11 and GLU)
+# on ppc64.
+
+include $(TOP)/configs/debian-swx11+glu-static-any
+
+CONFIG_NAME = debian-swx11+glu-static-ppc64
+
+LIB_DIR = lib64
+
+# vim: ft=make
+
diff --git a/configs/debian_i386 b/configs/debian_i386
deleted file mode 100644
index 1def21d39f0..00000000000
--- a/configs/debian_i386
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(TOP)/configs/debian
-
-CONFIG_NAME = debian-i386
-
-DEBIAN_OPT_CFLAGS = -O3 -march=i686 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
-
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
diff --git a/configs/default b/configs/default
index 23d7aedfbf5..e805925701a 100644
--- a/configs/default
+++ b/configs/default
@@ -10,7 +10,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=6
MESA_MINOR=5
-MESA_TINY=1
+MESA_TINY=2
# external projects. This should be useless now that we use libdrm.
DRM_SOURCE_PATH=$(TOP)/../drm
@@ -27,8 +27,7 @@ MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
-INSTALL = install
-COPY_LIBS = cp -f -d
+INSTALL = $(TOP)/bin/minstall
# Python and flags (generally only needed by the developers)
PYTHON2 = python
diff --git a/configs/freebsd b/configs/freebsd
index 38806ab946d..db7dd3b78a0 100644
--- a/configs/freebsd
+++ b/configs/freebsd
@@ -9,9 +9,6 @@ CC = cc
CXX = c++
MAKE = gmake
-# cp -d not supported on FreeBSD (see bug 4435)
-COPY_LIBS = cp -f
-
OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
diff --git a/configs/freebsd-dri b/configs/freebsd-dri
index 104e242289c..68877c612e7 100644
--- a/configs/freebsd-dri
+++ b/configs/freebsd-dri
@@ -14,22 +14,24 @@ 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 -DHAVE_POSIX_MEMALIGN
+ -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
+ -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
-CFLAGS = -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math \
+CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \
$(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES)
-CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
+CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES)
ASM_SOURCES =
# Library/program dependencies
+LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11
+GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11
# Directories
diff --git a/configs/linux-dri b/configs/linux-dri
index 1c3b404cf3a..7e822e2eb61 100644
--- a/configs/linux-dri
+++ b/configs/linux-dri
@@ -22,7 +22,8 @@ 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 -DHAVE_POSIX_MEMALIGN
+ -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
+ -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
@@ -64,5 +65,5 @@ WINDOW_SYSTEM=dri
# gamma are missing because they have not been converted to use the new
# interface.
-DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
+DRI_DIRS = i810 i915tex i915 i965 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb
diff --git a/configs/linux-dri-x86-64 b/configs/linux-dri-x86-64
index 4fbd0a0876d..821ab3e3366 100644
--- a/configs/linux-dri-x86-64
+++ b/configs/linux-dri-x86-64
@@ -20,5 +20,5 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib64
# the new interface. i810 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
+DRI_DIRS = i915tex i915 i965 mach64 mga r128 r200 radeon tdfx unichrome savage r300
diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb
index 68acb2f2b16..cb327fa60f9 100644
--- a/configs/linux-dri-xcb
+++ b/configs/linux-dri-xcb
@@ -24,7 +24,7 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
-X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I xcb-glx`
+X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx`
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
@@ -37,10 +37,11 @@ ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=`pkg-config --libs-only-L x11`
+LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
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) `pkg-config --libs xcb` `pkg-config --libs xcb-glx`
+ $(LIBDRM_LIB) `pkg-config --libs xcb` `pkg-config --libs x11-xcb` `pkg-config --libs xcb-glx`
# This is now 0 by default since it seems to confuse the hell out of people
diff --git a/configs/linux-fbdev b/configs/linux-fbdev
index 7a5d1b600f9..e36d20a702c 100644
--- a/configs/linux-fbdev
+++ b/configs/linux-fbdev
@@ -4,17 +4,13 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-fbdev
-DRIVER_DIRS = fbdev
+CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER
SRC_DIRS = mesa glu glut/fbdev
-
-CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER
-
-
-SRC_DIRS = mesa glu glut/fbdev
-DRIVER_DIRS = fbdev
+DRIVER_DIRS = fbdev osmesa
PROGRAM_DIRS = fbdev demos redbook samples
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread
+OSMESA_LIB_DEPS = -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm
diff --git a/configs/linux-indirect b/configs/linux-indirect
index b764515786d..bd33345ed70 100644
--- a/configs/linux-indirect
+++ b/configs/linux-indirect
@@ -23,6 +23,7 @@ ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
+ -DGLX_INDIRECT_RENDERING \
-DPTHREADS -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static
new file mode 100644
index 00000000000..465f83ca058
--- /dev/null
+++ b/configs/linux-osmesa-static
@@ -0,0 +1,14 @@
+# Configuration for building only libOSMesa on Linux, no Xlib driver
+# This doesn't really have any Linux dependencies, so it should be usable
+# on other (gcc-based) systems.
+
+include $(TOP)/configs/linux-osmesa
+
+CONFIG_NAME = linux-osmesa-static
+
+# Compiler and flags
+MKLIB_OPTIONS = -static
+
+# Library names
+OSMESA_LIB_NAME = libOSMesa.a
+
diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static
new file mode 100644
index 00000000000..6db8bc02370
--- /dev/null
+++ b/configs/linux-osmesa32-static
@@ -0,0 +1,28 @@
+# Configuration for 32 bits/channel OSMesa library on Linux
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = linux-osmesa32-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=32 -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 = OSMesa32
+OSMESA_LIB_NAME = libOSMesa32.a
+
+
+# Directories
+SRC_DIRS = mesa glu
+DRIVER_DIRS = osmesa
+PROGRAM_DIRS =
+
+
+# Dependencies
+OSMESA_LIB_DEPS = -lm -lpthread
+APP_LIB_DEPS = -lOSMesa32
diff --git a/configs/linux-static b/configs/linux-static
index 0104d34022b..85141ea643f 100644
--- a/configs/linux-static
+++ b/configs/linux-static
@@ -19,3 +19,8 @@ OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
+
+# Need to specify all libraries we may need
+APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm \
+ -L/usr/X11R6/lib/ -lX11 -lXmu -lXi -lpthread
+
diff --git a/debian/README.build b/debian/README.build
deleted file mode 100644
index b44a4c42ef2..00000000000
--- a/debian/README.build
+++ /dev/null
@@ -1,45 +0,0 @@
-I have added a few new configuration files to the configs directory:
-
- There's a base configuration, debian, which sets things up for
- building in a debian environment.
-
- There's also a debian-static configuration, which is for static
- building.
-
-All the others are derived from one of these two configurations.
-
-The platform-specific optimizations go into a debian-foo_ARCH file, like
-debian_i386 or debian_sparc. You can name this files whatever you want,
-but the last token must be a debian arch name. Note the "_"! These
-will be picked up automatically by the debian/rules.
-
-In order to actually install the new files, you need to edit
-debian/libdir.map, the format is:
-
- target-name libdir package package-dev
-
-The architecture optimized libraries should go under
-/usr/lib/<something>, where <something> matches the optimizations used,
-e.g. "cmov" or "v9".
-
-Only packages listed in the control file *and* libdir.map are actually
-built. That means that even if debian/libdir.map lists
-libgl1-random-stuff, if libgl1-random-stuff is *not* listed in
-debian/control it *won't* be built. The other way around, if
-libgl1-random-stuff is listed in debian/control but there's no entry for
-it in debian/libdir.map it *won't* be built.
-
-Again...
-
-If the libdir.map file doesn't mention your (lib)-(config), e.g.
-gl-debian_i386, THE TARGET WON'T BE BUILT.
-
-If the package listed in libdir.map is not listed in debian/control, THE
-TARGET WON'T BE BUILT.
-
-For architectures where glide3 is available an extra package is built
-(iff this is the mesa-legacy source package). The list of supported
-architectures in found in the control file.
-
-There's an alioth project for this package:
-http://alioth.debian.org/projects/pkg-mesa/
diff --git a/debian/changelog b/debian/changelog
index 72750b0b537..1ece9610261 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,113 @@
-mesa (6.5.1-0.6) unstable; urgency=medium
+mesa (6.5.2-4) UNRELEASED; urgency=low
+
+ [ Julien Cristau ]
+ * debian/control: libgl1-mesa-dri now suggests libglide3, with an
+ explanation in the description (closes: #387339).
+
+ [ Brice Goglin ]
+ * Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both
+ static and shared libraries, creating libglw1-mesa and libglw1-mesa-dev
+ (closes: #374904).
+
+ -- Brice Goglin <Brice.Goglin@ens-lyon.org> Fri, 30 Mar 2007 19:44:53 +0200
+
+mesa (6.5.2-3) experimental; urgency=low
+
+ * Set LIB_DIR and EXTRA_LIB_PATH in configs/debian-default to override
+ settings in configs/linux-x86-64. This fixes a FTBFS on amd64, thanks to
+ Marc 'HE' Brockschmidt for the report (closes: #410118).
+
+ -- Julien Cristau <jcristau@debian.org> Wed, 7 Feb 2007 23:04:28 +0100
+
+mesa (6.5.2-2) experimental; urgency=low
+
+ * Sync Section/Priority for all packages with the override.
+ * Build the arch:all debs in binary-indep, and use the debhelper -s option
+ for commands in binary-arch, to fix FTBFS on non-i386 archs, thanks to
+ Marc 'HE' Brockschmidt (closes: #409638).
+ * Add myself to Uploaders.
+
+ -- Julien Cristau <jcristau@debian.org> Sun, 4 Feb 2007 21:14:02 +0100
+
+mesa (6.5.2-1) experimental; urgency=low
+
+ [ Thierry Reding ]
+ * New upstream release.
+ * Set the Debian X Strike Force as maintainer.
+ * Add myself to uploaders.
+ * Build the i915tex DRI module on the i386 and amd64 architectures.
+ * Add patch 04_cleanup-osmesa-configs that makes the OSMesa configurations
+ behave as expected.
+ * Add patch 05_static-nonpic to build static libraries without -fPIC.
+ * Make debugging symbol packages depend on the corresponding binary package
+ and put them into the libdevel section.
+ * Bump shlibs file for the libosmesa6 package to account for added symbols.
+ Thanks Julien Cristau.
+ * Build the DRI modules with the default optimization flags. Thanks Julien
+ Cristau.
+ * mesa-common-dev now ships the GLX header files so it needs to replace
+ libgl1-mesa-swx11-dev and libgl1-mesa-dev. Thanks Julien Cristau.
+ * All OSMesa libraries were moved to the libosmesa6 and libosmesa6-dev
+ package, so have them replace libgl1-mesa-swx11, libgl1-mesa-swx11-dev and
+ mesa-common-dev respectively. Thanks Julien Cristau.
+
+ [ Julien Cristau ]
+ * Drop obsolete depends on xlibs.
+
+ -- Thierry Reding <thierry@gilfi.de> Thu, 11 Jan 2007 15:06:52 +0100
+
+mesa (6.5.2~rc3-0.1) experimental; urgency=low
* Non-maintainer upload.
- * Backport a fix from mesa 6.5.2 to mesa 6.5.1 which:
- - fixes braces around the ASSERT macro;
- - fixes a clipping problem, which leads to systematic segfaults of the
- X server (Closes: #405803).
+ * Update to latest upstream release candidate.
- -- Cyril Brulebois <cyril.brulebois@enst-bretagne.fr> Thu, 22 Feb 2007 21:08:56 +0100
+ -- Thierry Reding <thierry@gilfi.de> Fri, 1 Dec 2006 01:06:28 +0100
+
+mesa (6.5.2~rc2-0.1) experimental; urgency=low
+
+ * Non-maintainer upload.
+ * New upstream release candidate:
+ + Refresh 02_use-ieee-fp-on-s390-and-m68k.patch.
+ * Add manual pages for the glxdemo, glxgears, glxheads and glxinfo
+ utilities (Closes: #385463).
+
+ -- Thierry Reding <thierry@gilfi.de> Wed, 22 Nov 2006 20:49:06 +0100
+
+mesa (6.5.2~rc1-0.1) experimental; urgency=low
+
+ * Non-maintainer upload.
+ * New upstream release candidate.
+ * Update patches:
+ + Drop hunk #2 of 01_fix-makefile.patch, applied upstream.
+ + Drop 03_handle-sync-and-dont-unlock-display.patch, applied upstream.
+ * Bump build-dependency on libdrm-dev (>= 2.2.0).
+ * Use the new upstream minstall utility to install files and directories.
+ Using /usr/bin/install would result in a symlink's target being copied
+ instead of the symlink.
+
+ -- Thierry Reding <thierry@gilfi.de> Sat, 18 Nov 2006 22:23:04 +0100
+
+mesa (6.5.1-0.6) experimental; urgency=low
+
+ * Non-maintainer upload.
+ * Rewrote the debian/rules file to make it easier to understand.
+ * Provide i686 optimized versions in libgl1-mesa-swx11-i686 instead of in
+ libgl1-mesa-swx11.
+ * Statically link libOSMesa with the software rasterization code from libGL
+ so that it works independently of the installed libGL. (Closes: #387706)
+ * Make libosmesa6-dev depend on mesa-common-dev because it only needs the
+ gl.h header file and no libGL anymore.
+ * Move glx*.h headers from libgl1-mesa(-swx11)-dev into mesa-common-dev
+ because both packages provide identical files.
+ * Add debugging symbol packages for libgl1-mesa-swx11, libgl1-mesa-glx and
+ libgl1-mesa-dri.
+ * Repack the contents of the three Mesa tarballs (MesaDemos, MesaGLUT and
+ MesaLib) as the original source tarball. (Closes: #392715)
+ * Make mesa-common-dev depend on libx11-dev.
+ * Provide a new package: mesa-utils. These utilities are shipped in the
+ MesaDemos package so mesa is the right package to provide them.
+
+ -- Thierry Reding <thierry@gilfi.de> Sat, 18 Nov 2006 18:50:07 +0100
mesa (6.5.1-0.5) unstable; urgency=low
diff --git a/debian/compat b/debian/compat
index b8626c4cff2..7ed6ff82de6 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-4
+5
diff --git a/debian/control b/debian/control
index 8217fb89cb4..8400b0414ae 100644
--- a/debian/control
+++ b/debian/control
@@ -1,10 +1,10 @@
Source: mesa
Section: graphics
Priority: optional
-Maintainer: Mesa package maintainers <pkg-mesa-devel@lists.alioth.debian.org>
-Uploaders: Marcelo E. Magallon <mmagallo@debian.org>
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: Thierry Reding <thierry@gilfi.de>, Julien Cristau <jcristau@debian.org>
Standards-Version: 3.7.2
-Build-Depends: lesstif2-dev, grep-dctrl, debhelper (>> 4), build-essential (>= 11), libdrm-dev (>= 2.0.2) [!hurd-i386], libdirectfb-dev [!hurd-i386], xutils, libexpat-dev, libxxf86vm-dev, libx11-dev, libxext-dev, pkg-config, x11proto-gl-dev (>= 1.4.8) , dpkg-dev (>= 1.13.19)
+Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19)
Package: libgl1-mesa-swx11
Section: libs
@@ -27,11 +27,60 @@ Description: A free implementation of the OpenGL API -- runtime
.
On Linux, this library is also known as libGL or libGL.so.1.
+Package: libgl1-mesa-swx11-dbg
+Section: libs
+Priority: extra
+Architecture: any
+Depends: libgl1-mesa-swx11 (= ${binary:Version})
+Conflicts: libgl1-mesa-swrast-dbg
+Provides: libgl1-mesa-swrast-dbg
+Replaces: libgl1-mesa-swrast-dbg
+Description: A free implementation of the OpenGL API -- debugging symbols
+ Mesa is a 3-D graphics library with an API which is very similar to
+ that of OpenGL. To the extent that Mesa utilizes the OpenGL command
+ syntax or state machine, it is being used with authorization from
+ Silicon Graphics, Inc. However, the author makes no claim that Mesa
+ is in any way a compatible replacement for OpenGL or associated with
+ Silicon Graphics, Inc.
+ .
+ This library provides a pure software rasteriser; it does not provide
+ a direct rendering-capable library, or one which uses GLX. For that,
+ please see libgl1-mesa-glx.
+ .
+ On Linux, this library is also known as libGL or libGL.so.1.
+ .
+ This package contains debugging symbols for the software rasterization GL
+ library.
+
+Package: libgl1-mesa-swx11-i686
+Section: libs
+Priority: extra
+Architecture: i386
+Pre-Depends: libgl1-mesa-swx11
+Description: A free implementation of the OpenGL API -- runtime [i686 optimized]
+ Mesa is a 3-D graphics library with an API which is very similar to
+ that of OpenGL. To the extent that Mesa utilizes the OpenGL command
+ syntax or state machine, it is being used with authorization from
+ Silicon Graphics, Inc. However, the author makes no claim that Mesa
+ is in any way a compatible replacement for OpenGL or associated with
+ Silicon Graphics, Inc.
+ .
+ This library provides a pure software rasteriser; it does not provide
+ a direct rendering-capable library, or one which uses GLX. For that,
+ please see libgl1-mesa-glx.
+ .
+ On Linux, this library is also known as libGL or libGL.so.1.
+ .
+ This set of libraries is optimized for i686 machines and will only be used if
+ you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro,
+ Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones
+ such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla).
+
Package: libgl1-mesa-swx11-dev
Section: libdevel
Architecture: any
-Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev | xlibs-dev (>> 4.1.0), libxext6 | xlibs (>> 4.1.0), mesa-common-dev (= ${source:Version}), lesstif2-dev
-Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-dev, mesag-dev, libgl1-mesa-swrast-dev
+Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version})
+Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
Conflicts: mesa-dev, libgl-dev, mesag3 (<< 3.1-1), nvidia-glx-dev, mesag-dev, libgl1-mesa-swrast-dev
Replaces: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
Description: A free implementation of the OpenGL API -- development support files
@@ -39,28 +88,10 @@ Description: A free implementation of the OpenGL API -- development support file
compiling programs with Mesa. For a complete description of Mesa,
please look at the libgl1-mesa-swx11 package.
.
- This package also provides a simple widgets library, libGLw, which
- allows Motif-based applications to embed an OpenGL drawing context.
- The headers and static libraries for compiling programs that use this
- library are included.
- .
This library provides a pure software rasteriser; it does not provide
a direct rendering-capable library, or one which uses GLX. For that,
please see libgl1-mesa-dev.
-Package: libgl1-mesa-swx11-dbg
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}
-Conflicts: libgl1-mesa-swrast-dbg
-Replaces: libgl1-mesa-swrast-dbg
-Provides: libgl1-mesa-swrast-dbg
-Description: A free implementation of the OpenGL API -- debugging package
- This package provides a debug-enabled version of the Mesa libraries.
- .
- For a complete description of Mesa, please look at the libgl1-mesa-swx11
- package.
-
Package: libgl1-mesa-glx
Section: libs
Architecture: any
@@ -79,10 +110,52 @@ Description: A free implementation of the OpenGL API -- GLX runtime
For a complete description of Mesa, please look at the
libgl1-mesa-swx11 package.
+Package: libgl1-mesa-glx-dbg
+Section: libdevel
+Priority: extra
+Architecture: any
+Depends: libgl1-mesa-glx (= ${binary:Version})
+Description: A free implementation of the OpenGL API -- GLX runtime -- debugging symbols
+ This version of Mesa provides GLX and DRI capabilities: it is capable of
+ both direct and indirect rendering. For direct rendering, it can use DRI
+ modules from the libgl1-mesa-dri package to accelerate drawing.
+ .
+ This package does not include the modules themselves: these can be found
+ in the libgl1-mesa-dri package.
+ .
+ For a complete description of Mesa, please look at the
+ libgl1-mesa-swx11 package.
+ .
+ This package contains debugging symbols for the GL library with GLX and DRI
+ capabilities.
+
+#Package: libgl1-mesa-glx-i686
+#Section: libs
+#Priority: extra
+#Architecture: i386
+#Pre-Depends: libgl1-mesa-glx
+#Description: A free implementation of the OpenGL API -- GLX runtime [i686 optimized]
+# This version of Mesa provides GLX and DRI capabilities: it is capable of
+# both direct and indirect rendering. For direct rendering, it can use DRI
+# modules from the libgl1-mesa-dri package to accelerate drawing.
+# .
+# This package does not include the modules themselves: these can be found
+# in the libgl1-mesa-dri package.
+# .
+# For a complete description of Mesa, please look at the
+# libgl1-mesa-swx11 package.
+# .
+# This set of libraries is optimized for i686 machines and will only be used if
+# you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro,
+# Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones
+# such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla).
+
Package: libgl1-mesa-dri
Section: libs
+Priority: optional
Architecture: any
Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version})
+Suggests: libglide3
Conflicts: xlibmesa-dri (<< 1:7.0.0)
Replaces: xlibmesa-dri (<< 1:7.0.0)
Description: A free implementation of the OpenGL API -- DRI modules
@@ -95,11 +168,52 @@ Description: A free implementation of the OpenGL API -- DRI modules
.
For a complete description of Mesa, please look at the
libgl1-mesa-swx11 package.
+ .
+ The tdfx DRI module needs libglide3 to enable direct rendering.
-Package: libgl1-mesa-dev
-Section: libs
+Package: libgl1-mesa-dri-dbg
+Section: libdevel
+Priority: extra
Architecture: any
-Depends: ${shlibs:Depends}, libx11-dev, libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (=${binary:Version}), libgl1-mesa-dri (= ${binary:Version})
+Depends: libgl1-mesa-dri (= ${binary:Version})
+Description: A free implementation of the OpenGL API -- DRI modules -- debugging symbols
+ This version of Mesa provides GLX and DRI capabilities: it is capable of
+ both direct and indirect rendering. For direct rendering, it can use DRI
+ modules from the libgl1-mesa-dri package to accelerate drawing.
+ .
+ This package does not include the OpenGL library itself, only the DRI
+ modules for accelerating direct rendering.
+ .
+ For a complete description of Mesa, please look at the
+ libgl1-mesa-swx11 package.
+ .
+ This package contains debugging symbols for the DRI modules.
+
+#Package: libgl1-mesa-dri-i686
+#Section: libs
+#Priority: extra
+#Architecture: i386
+#Pre-Depends: libgl1-mesa-dri
+#Description: A free implementation of the OpenGL API -- DRI modules [i686 optimized]
+# This version of Mesa provides GLX and DRI capabilities: it is capable of
+# both direct and indirect rendering. For direct rendering, it can use DRI
+# modules from the libgl1-mesa-dri package to accelerate drawing.
+# .
+# This package does not include the OpenGL library itself, only the DRI
+# modules for accelerating direct rendering.
+# .
+# For a complete description of Mesa, please look at the
+# libgl1-mesa-swx11 package.
+# .
+# This set of libraries is optimized for i686 machines and will only be used if
+# you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro,
+# Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones
+# such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla).
+
+Package: libgl1-mesa-dev
+Section: libdevel
+Architecture: all
+Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${Source-Version}), libgl1-mesa-dri (>= ${Source-Version})
Conflicts: libgl-dev, libgl1-mesa-dri-dev
Replaces: libgl-dev, libgl1-mesa-dri-dev
Provides: libgl-dev, libgl1-mesa-dri-dev
@@ -117,7 +231,8 @@ Description: A free implementation of the OpenGL API -- GLX development support
Package: mesa-common-dev
Section: devel
Architecture: all
-Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev
+Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 6.5.2)
+Depends: libx11-dev
Description: Developer documentation for Mesa
This package includes the specifications for the Mesa-specific OpenGL
extensions, the complete set of release release notes and the
@@ -127,6 +242,7 @@ Package: libosmesa6
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
+Replaces: libgl1-mesa-swx11 (<< 6.5.2)
Description: Mesa Off-screen rendering extension
OSmesa is a Mesa extension that allows programs to render to an
off-screen buffer using the OpenGL API without having to create a
@@ -138,9 +254,9 @@ Description: Mesa Off-screen rendering extension
Package: libosmesa6-dev
Section: devel
Architecture: any
-Depends: libosmesa6 (= ${binary:Version}), libgl1-mesa-swx11-dev (= ${binary:Version})
+Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) | libgl-dev
Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev
-Replaces: xlibosmesa-dev, libosmesa-dev
+Replaces: xlibosmesa-dev, libosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), mesa-common-dev (<< 6.5.2)
Provides: xlibosmesa-dev, libosmesa-dev
Description: Mesa Off-screen rendering extension -- development support files
This package provides the required environment for developing programs
@@ -172,7 +288,7 @@ Description: The OpenGL utility library (GLU)
Package: libglu1-mesa-dev
Section: libdevel
Architecture: any
-Depends: ${shlibs:Depends}, libglu1-mesa (= ${binary:Version}), libgl1-mesa-dev | libgl-dev
+Depends: libglu1-mesa (= ${binary:Version}), libgl1-mesa-dev | libgl-dev
Provides: libglu-dev, xlibmesa-glu-dev
Conflicts: mesag-dev (<< 5.0.0-1), mesa-glide2-dev (<< 5.0.0-1), mesag3+ggi-dev (<< 5.0.0-1), xlibmesa-dev
Replaces: libglu-dev
@@ -182,6 +298,39 @@ Description: The OpenGL utility library -- development support files
For a complete description of GLU, please look at the libglu1-mesa
package.
+Package: libglw1-mesa
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}
+Conflicts: libgl1-mesa-swx11 (<< 6.5.2-4)
+Provides: libglw1
+Description: A free implementation of the OpenGL API -- runtime
+ Mesa is a 3-D graphics library with an API which is very similar to
+ that of OpenGL. To the extent that Mesa utilizes the OpenGL command
+ syntax or state machine, it is being used with authorization from
+ Silicon Graphics, Inc. However, the author makes no claim that Mesa
+ is in any way a compatible replacement for OpenGL or associated with
+ Silicon Graphics, Inc.
+ .
+ This package provides a simple widgets library, libGLw, which
+ allows Motif-based applications to embed an OpenGL drawing context.
+ .
+ On Linux, this library is also known as libGLw or libGLw.so.1.
+
+Package: libglw1-mesa-dev
+Section: libdevel
+Architecture: any
+Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version})
+Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev
+Conflicts: libgl1-mesa-swx11-dev (<< 6.5.2-4)
+Replaces: libglw-dev
+Description: A free implementation of the OpenGL API -- development support files
+ This package provides the development environment required for
+ compiling programs with the Mesa widgets library, libGLw, which
+ allows Motif-based applications to embed an OpenGL drawing context.
+ The headers and static libraries for compiling programs that use this
+ library are included.
+
Package: mesa-swx11-source
Section: libdevel
Architecture: all
@@ -192,3 +341,15 @@ Description: Mesa software rasteriser source -- development support files
provided mainly for modular X servers which support GL, and need the
software rasteriser source to build the GLcore module for unaccelerated
indirect rendering.
+
+Package: mesa-utils
+Section: x11
+Priority: optional
+Architecture: any
+Depends: ${shlibs:Depends}
+Replaces: xbase-clients (<< 6.8.2-38)
+Description: Miscellaneous Mesa GL utilities
+ This package provides several basic GL utilities built by Mesa, including
+ glxinfo and glxgears.
+
+# vim: tw=0
diff --git a/debian/copyright b/debian/copyright
index 8a0af603099..03ac1d5b8c6 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,8 @@
This package was debianized by James A. Treacy treacy@debian.org on Thu,
6 Jan 2000 01:11:34 -0500. It was newly debianized by Marcelo E.
-Magallon <mmagallo@debian.org> on Sat, 25 Dec 2004 14:50:02 -0600.
+Magallon <mmagallo@debian.org> on Sat, 25 Dec 2004 14:50:02 -0600. It was
+again debianized by Thierry Reding <thierry@gilfi.de> on Sat, 14 Oct 2006
+02:01:12 +0200.
It was downloaded from http://www.mesa3d.org/download.html
@@ -432,5 +434,11 @@ Inc. under a more liberal, MIT-style license, as follows:
RedBook demos progs/redbook/* SGI SGI MIT-style
- On Debian systems the full text of the GNU LGPL license is found in
- /usr/share/common-licenses/LGPL.
+On Debian systems the full text of the GNU LGPL license is found in
+/usr/share/common-licenses/LGPL.
+
+------------------------------------------------------------------------------
+
+The Debian packaging is (C) 2006, Thierry Reding <thierry@gilfi.de> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
diff --git a/debian/drivers.map b/debian/drivers.map
deleted file mode 100644
index 8920eaf6294..00000000000
--- a/debian/drivers.map
+++ /dev/null
@@ -1,3 +0,0 @@
-gl-debian-dri lib/*_dri.so usr/lib/dri libgl1-mesa-dri
-gl-debian-dri_i386 lib/*_dri.so usr/lib/i686/cmov/dri libgl1-mesa-dri
-gl-debian-directfb src/mesa/drivers/directfb/libidirectfbgl_mesa.so usr/lib/directfb-0.9.22/interfaces/IDirectFBGL libgl1-mesa-directfb
diff --git a/debian/glxdemo.1 b/debian/glxdemo.1
new file mode 100644
index 00000000000..fdfed7133e5
--- /dev/null
+++ b/debian/glxdemo.1
@@ -0,0 +1,15 @@
+.TH glxdemo 1 "2006-11-29"
+.SH NAME
+glxdemo \- a demonstration of the GLX functions
+.SH SYNOPSIS
+.B glxdemo
+.SH DESCRIPTION
+The \fIglxdemo\fP program shows how to use the GLX functions in order to
+create an OpenGL program running on top of an X server. This program is most
+useful when studied in its source code form.
+.SH AUTHOR
+glxdemo was written by Brian Paul <brian.paul@tungstengraphics.com>.
+.PP
+This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
+Debian project (but may be used by others).
+
diff --git a/debian/glxgears.1 b/debian/glxgears.1
new file mode 100644
index 00000000000..92c4f7a432c
--- /dev/null
+++ b/debian/glxgears.1
@@ -0,0 +1,29 @@
+.TH glxgears 1 "2006-11-29"
+.SH NAME
+glxgears \- ``gears'' demo for GLX
+.SH SYNOPSIS
+.B glxgears
+.RI [ options ]
+.SH DESCRIPTION
+The \fIglxgears\fP program is a port of the ``gears'' demo to GLX. It displays
+a set of rotating gears and prints out the frame rate at regular intervals. It
+has become quite popular as basic benchmarking tool.
+.SH OPTIONS
+.TP 8
+.B \-display \fIdisplay\fP
+Specify which X display to run on.
+.TP 8
+.B \-info
+Display OpenGL renderer information.
+.TP 8
+.B \-stereo
+Use a stereo enabled GLX visual.
+.TP 8
+.B \-fullscreen
+Run in fullscreen mode.
+.SH AUTHOR
+glxgears was written by Brian Paul <brian.paul@tungstengraphics.com>.
+.PP
+This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
+Debian project (but may be used by others).
+
diff --git a/debian/glxheads.1 b/debian/glxheads.1
new file mode 100644
index 00000000000..95025569019
--- /dev/null
+++ b/debian/glxheads.1
@@ -0,0 +1,30 @@
+.TH glxheads 1 "2006-11-29"
+.SH NAME
+glxheads \- exercise multiple GLX connections
+.SH SYNOPSIS
+.B glxheads
+[\fIdisplay\fP ...]
+.SH DESCRIPTION
+The \fIglxheads\fP program will try to open GLX connections on multiple X
+displays as specified on the command-line. If a connection can be made it will
+try to create a direct GLX context (and fallback to using indirect contexts if
+that fails) and open a window displaying a spinning green triangle.
+.PP
+If no display names are specified, \fIglxheads\fP will default to opening a
+single local connection on display 0.
+.SH EXAMPLE
+To open a local connection on display 0 and two remote connections to the
+hosts \fImars\fP (display 0) and \fIvenus\fP (display 1), run glxheads with
+the following command-line:
+.PP
+.RS 3n
+.nf
+$ glxheads :0 mars:0 venus:1
+.fi
+.RE
+.SH AUTHOR
+glxheads was written by Brian Paul <brian.paul@tungstengraphics.com>.
+.PP
+This manual page was written by Thierry Reding <thierry@gilfi.de> for the
+Debian project (but may be used by others).
+
diff --git a/debian/glxinfo.1 b/debian/glxinfo.1
new file mode 100644
index 00000000000..9cce83dd74a
--- /dev/null
+++ b/debian/glxinfo.1
@@ -0,0 +1,41 @@
+.TH glxinfo 1 "2006-11-29"
+.SH NAME
+glxinfo \- show information about the GLX implementation
+.SH SYNOPSIS
+.B glxinfo
+.RI [ options ]
+.SH DESCRIPTION
+The \fIglxinfo\fP program shows information about the OpenGL and GLX
+implementations running on a given X display.
+.PP
+The information includes details about the server- and client-side GLX
+implementation, the OpenGL and GLU implementations as well as a list
+of available GLX visuals.
+.SH OPTIONS
+.TP 8
+.B \-v
+Print visuals info in verbose form.
+.TP 8
+.B \-t
+Print verbose table.
+.TP 8
+.B \-display \fIdisplay\fP
+Specify the X display to interrogate.
+.TP 8
+.B \-h
+Print usage information.
+.TP 8
+.B \-i
+Force an indirect rendering context.
+.TP 8
+.B \-b
+Find the ``best'' visual and print it's number.
+.TP 8
+.B \-l
+Print interesting OpenGL limits.
+.SH AUTHOR
+glxinfo was written by Brian Paul <brian.paul@tungstengraphics.com>.
+.PP
+This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
+Debian project (but may be used by others).
+
diff --git a/debian/libdir.map b/debian/libdir.map
deleted file mode 100644
index 17728419e92..00000000000
--- a/debian/libdir.map
+++ /dev/null
@@ -1,16 +0,0 @@
-gl-debian usr/lib libgl1-mesa-swx11 libgl1-mesa-swx11-dev
-gl-debian-static usr/lib libgl1-mesa-swx11 libgl1-mesa-swx11-dev
-gl-debian-debug usr/lib/debug libgl1-mesa-swx11-dbg libgl1-mesa-swx11-dbg
-gl-debian_i386 usr/lib/i686/cmov libgl1-mesa-swx11 libgl1-mesa-swx11-dev
-gl-debian-static_i386 usr/lib/i686/cmov libgl1-mesa-swx11 libgl1-mesa-swx11-dev
-gl-debian-debug_i386 usr/lib/debug/i686/cmov libgl1-mesa-swx11-dbg libgl1-mesa-swx11-dbg
-gl-debian-dri usr/lib libgl1-mesa-glx libgl1-mesa-dev
-gl-debian-dri_i386 usr/lib/i686/cmov libgl1-mesa-glx libgl1-mesa-dev
-gl-debian-directfb usr/lib libgl1-mesa-directfb libgl1-mesa-directfb-dev
-gl-debian-osmesa16 usr/lib libosmesa6 libosmesa6-dev
-gl-debian-osmesa16-static usr/lib libosmesa6 libosmesa6-dev
-gl-debian-osmesa32 usr/lib libosmesa6 libosmesa6-dev
-gl-debian-osmesa32-static usr/lib libosmesa6 libosmesa6-dev
-glu-debian usr/lib libglu1-mesa libglu1-mesa-dev
-glu-debian-static usr/lib libglu1-mesa libglu1-mesa-dev
-glw-debian-static usr/lib libgl1-mesa-swx11 libgl1-mesa-swx11-dev
diff --git a/debian/libgl1-mesa-dev.install b/debian/libgl1-mesa-dev.install
index add5bef54d6..e1d3bffe3d7 100644
--- a/debian/libgl1-mesa-dev.install
+++ b/debian/libgl1-mesa-dev.install
@@ -1,3 +1 @@
-include/GL/glx.h usr/include/GL
-include/GL/glxext.h usr/include/GL
-include/GL/glx_mangle.h usr/include/GL
+usr/lib/libGL.so
diff --git a/debian/libgl1-mesa-dri-i686.install b/debian/libgl1-mesa-dri-i686.install
new file mode 100644
index 00000000000..44b5c55214d
--- /dev/null
+++ b/debian/libgl1-mesa-dri-i686.install
@@ -0,0 +1 @@
+usr/lib/dri/i686/cmov/*.so
diff --git a/debian/libgl1-mesa-dri.install b/debian/libgl1-mesa-dri.install
new file mode 100644
index 00000000000..55500c81209
--- /dev/null
+++ b/debian/libgl1-mesa-dri.install
@@ -0,0 +1 @@
+usr/lib/dri/*.so
diff --git a/debian/libgl1-mesa-glide3-dev.install b/debian/libgl1-mesa-glide3-dev.install
deleted file mode 100644
index ff19d29a1a6..00000000000
--- a/debian/libgl1-mesa-glide3-dev.install
+++ /dev/null
@@ -1 +0,0 @@
-include/GL/fxmesa.h usr/include/GL
diff --git a/debian/libgl1-mesa-glide3.docs b/debian/libgl1-mesa-glide3.docs
deleted file mode 100644
index 51210741920..00000000000
--- a/debian/libgl1-mesa-glide3.docs
+++ /dev/null
@@ -1 +0,0 @@
-docs/README.3DFX
diff --git a/debian/libgl1-mesa-glx-i686.install b/debian/libgl1-mesa-glx-i686.install
new file mode 100644
index 00000000000..4c8ef3b34b6
--- /dev/null
+++ b/debian/libgl1-mesa-glx-i686.install
@@ -0,0 +1 @@
+usr/lib/glx/i686/cmov/libGL.so.* usr/lib/i686/cmov
diff --git a/debian/libgl1-mesa-glx.install b/debian/libgl1-mesa-glx.install
new file mode 100644
index 00000000000..1a30ecd7cbd
--- /dev/null
+++ b/debian/libgl1-mesa-glx.install
@@ -0,0 +1 @@
+usr/lib/glx/libGL.so.* usr/lib
diff --git a/debian/libgl1-mesa-glx.shlibs b/debian/libgl1-mesa-glx.shlibs
new file mode 100644
index 00000000000..b8e0fbaaaa5
--- /dev/null
+++ b/debian/libgl1-mesa-glx.shlibs
@@ -0,0 +1 @@
+libGL 1 libgl1-mesa-glx | libgl1
diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install
index da4b3b1a6ca..f353c5923d6 100644
--- a/debian/libgl1-mesa-swx11-dev.install
+++ b/debian/libgl1-mesa-swx11-dev.install
@@ -1,5 +1,2 @@
-include/GL/glx.h usr/include/GL
-include/GL/glxext.h usr/include/GL
-include/GL/glx_mangle.h usr/include/GL
-src/glw/GLwDrawA.h usr/include/GL
-src/glw/GLwMDrawA.h usr/include/GL
+usr/lib/libGL.a
+usr/lib/libGL.so
diff --git a/debian/libgl1-mesa-swx11-i686.install b/debian/libgl1-mesa-swx11-i686.install
new file mode 100644
index 00000000000..2177b0cf15d
--- /dev/null
+++ b/debian/libgl1-mesa-swx11-i686.install
@@ -0,0 +1 @@
+usr/lib/i686/cmov/libGL.so.*
diff --git a/debian/libgl1-mesa-swx11.install b/debian/libgl1-mesa-swx11.install
new file mode 100644
index 00000000000..6d70d0f9f9a
--- /dev/null
+++ b/debian/libgl1-mesa-swx11.install
@@ -0,0 +1 @@
+usr/lib/libGL.so.*
diff --git a/debian/libgl1-mesa-swx11.shlibs b/debian/libgl1-mesa-swx11.shlibs
index f4b6356179c..b8e0fbaaaa5 100644
--- a/debian/libgl1-mesa-swx11.shlibs
+++ b/debian/libgl1-mesa-swx11.shlibs
@@ -1,2 +1 @@
libGL 1 libgl1-mesa-glx | libgl1
-libOSMesa 6 libgl1-mesa-swx11 | libgl1-mesa-glide3
diff --git a/debian/libglu1-mesa-dev.install b/debian/libglu1-mesa-dev.install
index a707e392ad0..78ac2b01eda 100644
--- a/debian/libglu1-mesa-dev.install
+++ b/debian/libglu1-mesa-dev.install
@@ -1,2 +1,4 @@
-include/GL/glu.h usr/include/GL
-include/GL/glu_mangle.h usr/include/GL
+usr/include/GL/glu.h
+usr/include/GL/glu_mangle.h
+usr/lib/libGLU.a
+usr/lib/libGLU.so
diff --git a/debian/libglu1-mesa.install b/debian/libglu1-mesa.install
new file mode 100644
index 00000000000..9ad0953c1ca
--- /dev/null
+++ b/debian/libglu1-mesa.install
@@ -0,0 +1 @@
+usr/lib/libGLU.so.*
diff --git a/debian/libglu1-mesa.shlibs b/debian/libglu1-mesa.shlibs
new file mode 100644
index 00000000000..647fc5be38a
--- /dev/null
+++ b/debian/libglu1-mesa.shlibs
@@ -0,0 +1 @@
+libGLU 1 libglu1-mesa | libglu1
diff --git a/debian/libglw1-mesa-dev.install b/debian/libglw1-mesa-dev.install
new file mode 100644
index 00000000000..7c03280c337
--- /dev/null
+++ b/debian/libglw1-mesa-dev.install
@@ -0,0 +1,3 @@
+usr/include/GL/GLw*A.h
+usr/lib/libGLw.a
+usr/lib/libGLw.so
diff --git a/debian/libglw1-mesa.install b/debian/libglw1-mesa.install
new file mode 100644
index 00000000000..9d299c81a51
--- /dev/null
+++ b/debian/libglw1-mesa.install
@@ -0,0 +1 @@
+usr/lib/libGLw.so.*
diff --git a/debian/libosmesa6-dev.install b/debian/libosmesa6-dev.install
new file mode 100644
index 00000000000..149a1bd7891
--- /dev/null
+++ b/debian/libosmesa6-dev.install
@@ -0,0 +1,7 @@
+usr/include/GL/osmesa.h
+usr/lib/libOSMesa.a
+usr/lib/libOSMesa.so
+usr/lib/libOSMesa16.a
+usr/lib/libOSMesa16.so
+usr/lib/libOSMesa32.a
+usr/lib/libOSMesa32.so
diff --git a/debian/libosmesa6.install b/debian/libosmesa6.install
new file mode 100644
index 00000000000..d1e25b2ffeb
--- /dev/null
+++ b/debian/libosmesa6.install
@@ -0,0 +1,3 @@
+usr/lib/libOSMesa.so.*
+usr/lib/libOSMesa16.so.*
+usr/lib/libOSMesa32.so.*
diff --git a/debian/libosmesa6.shlibs b/debian/libosmesa6.shlibs
new file mode 100644
index 00000000000..3c9ae1a14bc
--- /dev/null
+++ b/debian/libosmesa6.shlibs
@@ -0,0 +1,3 @@
+libOSMesa 6 libosmesa6 (>= 6.5.2-1) | libgl1-mesa-glide3
+libOSMesa16 6 libosmesa6 (>= 6.5.2-1)
+libOSMesa32 6 libosmesa6 (>= 6.5.2-1)
diff --git a/debian/mesa-common-dev.docs b/debian/mesa-common-dev.docs
index 457acbf84c4..834e887e4fa 100644
--- a/debian/mesa-common-dev.docs
+++ b/debian/mesa-common-dev.docs
@@ -4,4 +4,5 @@ docs/envvars.html
docs/faq.html
docs/osmesa.html
docs/RELNOTES-*
+docs/relnotes*
docs/*.spec
diff --git a/debian/mesa-common-dev.install b/debian/mesa-common-dev.install
index 48ab3d4859b..487825f8eb6 100644
--- a/debian/mesa-common-dev.install
+++ b/debian/mesa-common-dev.install
@@ -1,4 +1,4 @@
-include/GL/gl.h usr/include/GL
-include/GL/glext.h usr/include/GL
-include/GL/gl_mangle.h usr/include/GL
-include/GL/osmesa.h usr/include/GL
+usr/include/GL/gl.h
+usr/include/GL/glext.h
+usr/include/GL/gl_mangle.h
+usr/include/GL/glx*.h
diff --git a/debian/mesa-swx11-source.dirs b/debian/mesa-swx11-source.dirs
deleted file mode 100644
index 8256e60ad87..00000000000
--- a/debian/mesa-swx11-source.dirs
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/share/mesa-source/src/mesa/ppc
-usr/share/mesa-source/src/mesa/sparc
-usr/share/mesa-source/src/mesa/x86
-usr/share/mesa-source/src/mesa/x86-64
diff --git a/debian/mesa-swx11-source.install b/debian/mesa-swx11-source.install
new file mode 100644
index 00000000000..e96b76cde29
--- /dev/null
+++ b/debian/mesa-swx11-source.install
@@ -0,0 +1 @@
+usr/share/mesa-source/*
diff --git a/debian/mesa-utils.install b/debian/mesa-utils.install
new file mode 100644
index 00000000000..4d4d07e3f00
--- /dev/null
+++ b/debian/mesa-utils.install
@@ -0,0 +1,4 @@
+usr/bin/glxdemo
+usr/bin/glxgears
+usr/bin/glxheads
+usr/bin/glxinfo
diff --git a/debian/mesa-utils.manpages b/debian/mesa-utils.manpages
new file mode 100644
index 00000000000..a3cb2dbb5d0
--- /dev/null
+++ b/debian/mesa-utils.manpages
@@ -0,0 +1,4 @@
+debian/glxdemo.1
+debian/glxgears.1
+debian/glxheads.1
+debian/glxinfo.1
diff --git a/debian/patches/00_create-libdir.patch b/debian/patches/00_create-libdir.patch
new file mode 100644
index 00000000000..cc59325ac74
--- /dev/null
+++ b/debian/patches/00_create-libdir.patch
@@ -0,0 +1,17 @@
+Patch that allows the Mesa makefile to create a LIB_DIR that is more than one
+level below TOP.
+
+This patch by Thierry Reding.
+Not submitted to Mesa.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -29,7 +29,7 @@
+ done
+
+ $(TOP)/$(LIB_DIR):
+- -mkdir $(TOP)/$(LIB_DIR)
++ mkdir -p $(TOP)/$(LIB_DIR)
+
+
+ clean:
diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch
new file mode 100644
index 00000000000..6711d2fe5cd
--- /dev/null
+++ b/debian/patches/01_fix-makefile.patch
@@ -0,0 +1,16 @@
+Do not build OSMesa for a standalone configuration, since Debian only ships
+OSMesa in a separate package.
+
+This patch by Thierry Reding.
+
+--- a/src/mesa/Makefile
++++ b/src/mesa/Makefile
+@@ -107,7 +107,7 @@
+ $(OSMESA_DRIVER_OBJECTS)
+
+
+-stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
++stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
+
+ osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
+
diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch
new file mode 100644
index 00000000000..f54457521c5
--- /dev/null
+++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch
@@ -0,0 +1,17 @@
+Patch that fixes Debian bug #349437.
+
+This patch by David Nusinow.
+
+--- a/src/mesa/main/imports.h
++++ b/src/mesa/main/imports.h
+@@ -155,8 +155,9 @@
+ *** USE_IEEE: Determine if we're using IEEE floating point
+ ***/
+ #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
+- defined(__s390x__) || defined(__powerpc__) || \
++ defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \
+ defined(__amd64__) || \
++ defined(__m68k__) || \
+ defined(ia64) || defined(__ia64__) || \
+ defined(__hppa__) || defined(hpux) || \
+ defined(__mips) || defined(_MIPS_ARCH) || \
diff --git a/debian/patches/03_optional-progs-and-install.patch b/debian/patches/03_optional-progs-and-install.patch
new file mode 100644
index 00000000000..66a4771003b
--- /dev/null
+++ b/debian/patches/03_optional-progs-and-install.patch
@@ -0,0 +1,45 @@
+Allow the programs that are to be built to be defined in the build
+configuration.
+
+Provide an install target for installing the programs in $(INSTALL_DIR)/bin.
+
+This patch by Thierry Reding.
+Not submitted to Mesa.
+
+--- a/progs/xdemos/Makefile
++++ b/progs/xdemos/Makefile
+@@ -8,7 +8,7 @@
+
+ LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME)
+
+-PROGS = glthreads \
++PROGS ?= glthreads \
+ glxdemo \
+ glxgears \
+ glxgears_fbconfig \
+@@ -44,6 +44,9 @@
+
+ default: $(PROGS)
+
++install: $(PROGS)
++ $(INSTALL) -d $(INSTALL_DIR)/bin
++ $(INSTALL) -m 755 $(PROGS) $(INSTALL_DIR)/bin
+
+ clean:
+ -rm -f $(PROGS)
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -21,8 +21,12 @@
+ fi \
+ done
+
+-# Dummy install target
+ install:
++ @for dir in $(SUBDIRS) ; do \
++ if [ -d $$dir ] ; then \
++ (cd $$dir ; $(MAKE) install) ; \
++ fi \
++ done
+
+ clean:
+ @for dir in $(SUBDIRS) tests ; do \
diff --git a/debian/patches/04_cleanup-osmesa-configs.patch b/debian/patches/04_cleanup-osmesa-configs.patch
new file mode 100644
index 00000000000..ffc4de91fc5
--- /dev/null
+++ b/debian/patches/04_cleanup-osmesa-configs.patch
@@ -0,0 +1,189 @@
+diff --git a/configs/linux-osmesa b/configs/linux-osmesa
+index cc1fbbd..aabab59 100644
+--- a/configs/linux-osmesa
++++ b/configs/linux-osmesa
+@@ -9,8 +9,17 @@ CONFIG_NAME = linux-osmesa
+ # 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 -DPTHREADS
+-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
++
++PIC_FLAGS = -fPIC
++
++DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
++ -D_BSD_SOURCE -D_GNU_SOURCE \
++ -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN
++
++CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
++ $(ASM_FLAGS) -ffast-math
++
++CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
+
+
+ # Directories
+@@ -23,3 +33,4 @@ PROGRAM_DIRS = osdemos
+ OSMESA_LIB_DEPS = -lm -lpthread
+ GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
+ APP_LIB_DEPS = -lOSMesa -lGLU
++
+diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static
+index 465f83c..eb3575f 100644
+--- a/configs/linux-osmesa-static
++++ b/configs/linux-osmesa-static
+@@ -8,7 +8,8 @@ CONFIG_NAME = linux-osmesa-static
+
+ # Compiler and flags
+ MKLIB_OPTIONS = -static
++PIC_FLAGS =
+
+ # Library names
+-OSMESA_LIB_NAME = libOSMesa.a
++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a
+
+diff --git a/configs/linux-osmesa16 b/configs/linux-osmesa16
+index 1fb0186..2a06254 100644
+--- a/configs/linux-osmesa16
++++ b/configs/linux-osmesa16
+@@ -1,28 +1,17 @@
+ # Configuration for 16 bits/channel OSMesa library on Linux
+
+-include $(TOP)/configs/default
++include $(TOP)/configs/linux-osmesa
+
+ 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
+-
++DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32
+
+ # 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
+-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
+-APP_LIB_DEPS = -lOSMesa16
++APP_LIB_DEPS = -l$(OSMESA_LIB)
++
+diff --git a/configs/linux-osmesa16-static b/configs/linux-osmesa16-static
+index 6645504..894cf82 100644
+--- a/configs/linux-osmesa16-static
++++ b/configs/linux-osmesa16-static
+@@ -1,28 +1,13 @@
+ # Configuration for 16 bits/channel OSMesa library on Linux
+
+-include $(TOP)/configs/default
++include $(TOP)/configs/linux-osmesa16
+
+ 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
+-
++PIC_FLAGS =
+
+ # Library names
+-OSMESA_LIB = OSMesa16
+-OSMESA_LIB_NAME = libOSMesa16.a
+-
+-
+-# Directories
+-SRC_DIRS = mesa glu
+-DRIVER_DIRS = osmesa
+-PROGRAM_DIRS =
+-
++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a
+
+-# Dependencies
+-OSMESA_LIB_DEPS = -lm -lpthread
+-APP_LIB_DEPS = -lOSMesa16
+diff --git a/configs/linux-osmesa32 b/configs/linux-osmesa32
+index a1e5a35..5a703f6 100644
+--- a/configs/linux-osmesa32
++++ b/configs/linux-osmesa32
+@@ -1,28 +1,18 @@
+ # Configuration for 32 bits/channel OSMesa library on Linux
+
+-include $(TOP)/configs/default
++include $(TOP)/configs/linux-osmesa
+
+ 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
+-
++DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
+
+ # 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
+-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
+-APP_LIB_DEPS = -lOSMesa32
++APP_LIB_DEPS = -l$(OSMESA_LIB)
++
+diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static
+index 6db8bc0..ecbb72e 100644
+--- a/configs/linux-osmesa32-static
++++ b/configs/linux-osmesa32-static
+@@ -1,28 +1,13 @@
+ # Configuration for 32 bits/channel OSMesa library on Linux
+
+-include $(TOP)/configs/default
++include $(TOP)/configs/linux-osmesa32
+
+ CONFIG_NAME = linux-osmesa32-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=32 -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
+-
++PIC_FLAGS =
+
+ # Library names
+-OSMESA_LIB = OSMesa32
+-OSMESA_LIB_NAME = libOSMesa32.a
+-
+-
+-# Directories
+-SRC_DIRS = mesa glu
+-DRIVER_DIRS = osmesa
+-PROGRAM_DIRS =
+-
++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a
+
+-# Dependencies
+-OSMESA_LIB_DEPS = -lm -lpthread
+-APP_LIB_DEPS = -lOSMesa32
diff --git a/debian/patches/05_static-nonpic.patch b/debian/patches/05_static-nonpic.patch
new file mode 100644
index 00000000000..a6b7f4054ee
--- /dev/null
+++ b/debian/patches/05_static-nonpic.patch
@@ -0,0 +1,60 @@
+diff --git a/configs/linux-alpha-static b/configs/linux-alpha-static
+index 2a30af9..eb6a08a 100644
+--- a/configs/linux-alpha-static
++++ b/configs/linux-alpha-static
+@@ -11,6 +11,7 @@ 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
++PIC_FLAGS =
+
+
+ # Library names (actual file names)
+diff --git a/configs/linux-ppc-static b/configs/linux-ppc-static
+index d0e1688..3f3dc55 100644
+--- a/configs/linux-ppc-static
++++ b/configs/linux-ppc-static
+@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-ppc
+ CONFIG_NAME = linux-ppc-static
+
+ MKLIB_OPTIONS = -static
++PIC_FLAGS =
+
+ # Library names (actual file names)
+ GL_LIB_NAME = libGL.a
+diff --git a/configs/linux-static b/configs/linux-static
+index 85141ea..1592668 100644
+--- a/configs/linux-static
++++ b/configs/linux-static
+@@ -5,6 +5,7 @@ include $(TOP)/configs/linux
+ CONFIG_NAME = linux-static
+
+ MKLIB_OPTIONS = -static
++PIC_FLAGS =
+
+ # Library names (actual file names)
+ GL_LIB_NAME = libGL.a
+diff --git a/configs/linux-x86-64-static b/configs/linux-x86-64-static
+index 0257430..2d0b664 100644
+--- a/configs/linux-x86-64-static
++++ b/configs/linux-x86-64-static
+@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-x86-64
+ CONFIG_NAME = linux-x86-64-static
+
+ MKLIB_OPTIONS = -static
++PIC_FLAGS =
+
+ # Library names (actual file names)
+ GL_LIB_NAME = libGL.a
+diff --git a/configs/linux-x86-static b/configs/linux-x86-static
+index 9915987..e6a3696 100644
+--- a/configs/linux-x86-static
++++ b/configs/linux-x86-static
+@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-x86
+ CONFIG_NAME = linux-x86-static
+
+ MKLIB_OPTIONS = -static
++PIC_FLAGS =
+
+ # Library names (actual file names)
+ GL_LIB_NAME = libGL.a
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 00000000000..280a2f3548e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,6 @@
+00_create-libdir.patch
+01_fix-makefile.patch
+02_use-ieee-fp-on-s390-and-m68k.patch
+03_optional-progs-and-install.patch
+04_cleanup-osmesa-configs.patch
+05_static-nonpic.patch
diff --git a/debian/rules b/debian/rules
index 484e7c615d7..7a7025f1f0c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,10 +1,16 @@
#!/usr/bin/make -f
+# debian/rules for the Debian mesa package
+# Copyright © 2006 Thierry Reding <thierry@gilfi.de>
-export DH_OPTIONS
-export DEB_HOST_ARCH
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
-CFLAGS = -Wall -g
+STAMP_DIR = debian/stamp
+
+QUILT_STAMPFN = $(STAMP_DIR)/patch
+include /usr/share/quilt/quilt.make
+CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
@@ -14,219 +20,120 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
-DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
-STAMPDIR := debian/stamp
+export DEB_BUILD_ARCH
-select_target_any = $(shell dh_listpackages -s | grep -v '^$$' | while read p ; do cut -d ' ' -f 1,3 debian/libdir.map | grep -w $$p ; done | grep -v _ | cut -d ' ' -f 1 | sort -u | grep ^$(1)- | cut -d - -f 2-)
-select_target_arch = $(filter $(shell dh_listpackages -s | grep -v '^$$' | while read p ; do cut -d ' ' -f 1,3 debian/libdir.map | grep -w $$p ; done | grep _ | cut -d ' ' -f 1 | sort -u | grep ^$(1)- | cut -d - -f 2-), $(patsubst configs/%, %, $(wildcard configs/*_$(DEB_HOST_ARCH))))
-select_target = $(sort $(BUILD_$(1)_TARGETS_any) $(BUILD_$(1)_TARGETS_arch))
+# choose which configurations to build
+SWX11_GLU_CONFIGS =
+DRI_CONFIGS =
-BUILD_GL_TARGETS_any := $(call select_target_any,gl)
-BUILD_GL_TARGETS_arch := $(call select_target_arch,gl)
-BUILD_GL_TARGETS := $(call select_target,GL)
+include debian/scripts/choose-configs
-BUILD_GLU_TARGETS_any := $(call select_target_any,glu)
-#BUILD_GLU_TARGETS_arch := $(call select_target_arch,glu)
-BUILD_GLU_TARGETS := $(call select_target,GLU)
+# build the following configurations by default
+CONFIGS = $(SWX11_GLU_CONFIGS) \
+ $(DRI_CONFIGS) \
+ debian-osmesa \
+ debian-osmesa-static \
+ debian-osmesa16 \
+ debian-osmesa16-static \
+ debian-osmesa32 \
+ debian-osmesa32-static
-BUILD_GLW_TARGETS_any := $(call select_target_any,glw)
-#BUILD_GLW_TARGETS_arch := $(call select_target_arch,glw)
-BUILD_GLW_TARGETS := $(call select_target,GLW)
+STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE)
+BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS))
+INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) \
+ $(STAMP_DIR)/install-source
-BUILD_TARGETS := \
- $(foreach t, $(BUILD_GL_TARGETS), $(STAMPDIR)/target-gl-$(t)) \
- $(foreach t, $(BUILD_GLU_TARGETS), $(STAMPDIR)/target-glu-$(t)) \
- $(foreach t, $(BUILD_GLW_TARGETS), $(STAMPDIR)/target-glw-$(t))
+# list the configurations that will built
+configs:
+ @echo Building the following configurations: $(CONFIGS)
-ifneq ($(strip $(shell grep-dctrl -n -s Package -PX libgl1-mesa-directfb debian/control)),)
-DFB_MODULE_DIR := $(shell pkg-config --variable=moduledir directfb-internal)
-endif
-
-build: $(STAMPDIR)/build
-$(STAMPDIR)/build: $(BUILD_TARGETS)
+$(STAMP_DIR):
dh_testdir
- mkdir -p $(dir $@) && touch $@
+ mkdir -p $@
+
+$(QUILT_STAMPFN): $(STAMP_DIR)
-# Parameters:
-# 1: library (gl, glu, glw)
-# 2: target (debian, debian-i386, ...)
-# 3: subdir to build (mesa, glw, glu/sgi)
-driver_map = $(word $(2),$(shell grep '^$(1) ' debian/drivers.map))
-libdir_map = $(word $(2),$(shell grep '^$(1) ' debian/libdir.map))
+build: $(BUILD_STAMPS)
-define build_target_actions
+$(STAMP)-build-%: patch
dh_testdir
- chmod +x debian/shadowtree
- $(RM) -rf build/$(1)-$(2)
- debian/shadowtree build/$(1)-$(2)
- ln -sf $(2) build/$(1)-$(2)/configs/current
- if test $(1) != gl ; then \
- mkdir -p build/$(1)-$(2)/lib/ ; \
- ln -sf ../../gl-$(2)/lib/libGL.so build/$(1)-$(2)/lib/ ; \
- fi
- make -C build/$(1)-$(2)/src SRC_DIRS=$(3) DEBIAN_DRIVERS_DIR=$(if $(call driver_map,$(1)-$(2),1),/$(call driver_map,$(1)-$(2),3))
- if test $(1) != gl ; then \
- rm build/$(1)-$(2)/lib/libGL.so ; \
- fi
- mkdir -p $(dir $@) && touch $@
-endef
-
-$(STAMPDIR)/target-gl-%:
- $(call build_target_actions,gl,$*,mesa)
-
-$(STAMPDIR)/target-glu-%: $(STAMPDIR)/target-gl-%
- $(call build_target_actions,glu,$*,glu/sgi)
-
-$(STAMPDIR)/target-glw-%: $(STAMPDIR)/target-gl-%
- $(call build_target_actions,glw,$*,glw)
-
-# Parameters:
-# 1: target (gl-debian, gl-debian-i386, ...)
-# 2: installation directory (usr/lib, usr/lib/dbg, ...)
-# 3: library package name
-# 4: development package name
-
-define install_target_lib_actions
- dh_installdirs -p$(3) $(2)
- dh_installdirs -p$(4) $(2)
- dh_install -p$(3) build/$(1)/lib/lib*.so.* $(2)
- dh_install -p$(4) build/$(1)/lib/lib*.so $(2)
- dh_install -p$(4) build/$(1)/lib/lib*.a $(2)
-endef
-
-install_target_libs = $(call install_target_lib_actions,$(1),$(call libdir_map,$(1),2),$(call libdir_map,$(1),3),$(call libdir_map,$(1),4))
-
-# Parameters:
-# 1: target (gl-debian, gl-debian-i386, ...)
-# 2: source directory (usr/lib, usr/lib/dbg, ...)
-# 3: installation directory (usr/lib, usr/lib/dbg, ...)
-# 4: package name
-
-define install_target_driver_actions
- dh_installdirs -p$(4) $(3)
- dh_install -p$(4) build/$(1)/$(2) $(3)
-endef
-
-install_target_drivers = $(if $(call driver_map,$(1),1),$(call install_target_driver_actions,$(1),$(call driver_map,$(1),2),$(call driver_map,$(1),3),$(call driver_map,$(1),4)))
-
-# Parameters:
-# 1: target (gl-debian, gl-debian-i386, ...)
-
-define install_target
- $(call install_target_libs,$(1))
- $(call install_target_drivers,$(1))
-endef
-
-install-target-%: $(STAMPDIR)/target-%
- @echo Target $@.
- $(call install_target,$*)
- @echo Target $@: done.
-
-install-pre:
- @echo Target $@.
+ mkdir -p $(DEB_BUILD_DIR)/$*
+ find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \
+ xargs cp -rlf -t $(DEB_BUILD_DIR)/$*
+ ln -sf $* $(DEB_BUILD_DIR)/$*/configs/current
+ cd $(DEB_BUILD_DIR)/$* && $(MAKE)
+ touch $@
+
+pre-install:
dh_testdir
dh_testroot
- dh_clean -k
- dh_installdirs
- @echo Target $@: done.
-
-install-all: install-pre \
- $(addprefix install-target-gl-,$(BUILD_GL_TARGETS)) \
- $(addprefix install-target-glu-,$(BUILD_GLU_TARGETS)) \
- $(addprefix install-target-glw-,$(BUILD_GLW_TARGETS))
- @echo Target $@.
- @echo Target $@: done.
-
-clean:
+ dh_clean -k --exclude ./Makefile.orig --exclude configs/CVS/Root.bak
+ rm -rf $(INSTALL_STAMPS)
+
+install: pre-install $(INSTALL_STAMPS)
+
+$(STAMP)-install-%: $(STAMP)-build-%
+ # Add here commands to install the package into debian/tmp
+ cd $(DEB_BUILD_DIR)/$* && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+ touch $@
+
+$(STAMP_DIR)/install-source:
+ # install Mesa source for mesa-swx11-source package
+ chmod a+x debian/scripts/install-source.sh
+ debian/scripts/install-source.sh
+ touch $@
+
+clean: unpatch
dh_testdir
dh_testroot
- $(RM) -rf debian/stamp
- $(RM) -rf build
- dh_clean debian/mesa-swx11-source.install
-
-install: build install-all
- @echo Target $@.
- @echo Target $@: done.
+ dh_clean --exclude ./Makefile.orig
+ rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR)
-binary-indep: DH_OPTIONS := -i
-binary-indep: debian/mesa-swx11-source.install build
- @echo Target $@
+# Build architecture-independent files here.
+binary-indep: build install
dh_testdir
dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installdirs
-# dh_installexamples
- dh_install
-# dh_installman
-# dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
- @echo Target $@: done.
-
-# binary-arch: DH_OPTIONS := -s
+ dh_installchangelogs -i
+ dh_installdocs -i
+ dh_installexamples -i
+ dh_install --sourcedir=debian/tmp --list-missing -i
+ dh_installman -i
+ dh_link -i
+ dh_compress -i
+ dh_fixperms -i
+ dh_installdeb -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i
+
+# Build architecture-dependent files here.
binary-arch: build install
- @echo Target $@
- dh_testdir -s
- dh_testroot -s
+ dh_testdir
+ dh_testroot
dh_installchangelogs -s
dh_installdocs -s
-# dh_installexamples -s
- dh_install -s
-# dh_installman -s
-# dh_link -s
+ dh_installexamples -s
+ dh_install --sourcedir=debian/tmp --list-missing -s
+ dh_installman -s
+ dh_link -s
+ dh_strip -plibgl1-mesa-swx11 --dbg-package=libgl1-mesa-swx11-dbg
+ dh_strip -plibgl1-mesa-glx --dbg-package=libgl1-mesa-glx-dbg
+ dh_strip -plibgl1-mesa-dri --dbg-package=libgl1-mesa-dri-dbg
dh_strip -s
dh_compress -s
dh_fixperms -s
-# dh_makeshlibs -s -Nlibglu1-mesa -Nmesag3
-ifneq ($(strip $(shell dh_listpackages -s | grep -w libgl1-mesa-glide3)),)
- dh_makeshlibs -plibgl1-mesa-glide3 -V 'libgl1-mesa-glide3'
-endif
-ifneq ($(strip $(shell dh_listpackages -s | grep -w libglu1-mesa)),)
- dh_makeshlibs -plibglu1-mesa -V 'libglu1-mesa | libglu1'
-endif
-ifneq ($(strip $(shell dh_listpackages -s | grep -w libosmesa6)),)
- dh_makeshlibs -plibosmesa6
-endif
-ifneq ($(strip $(shell dh_listpackages -s | grep -w libgl1-mesa-swx11)),)
- dh_makeshlibs -plibgl1-mesa-swx11
-endif
-ifneq ($(strip $(shell dh_listpackages -s | grep -w libgl1-mesa-glx)),)
- dh_makeshlibs -plibgl1-mesa-glx -V 'libgl1-mesa-glx | libgl1'
-endif
-ifneq ($(strip $(shell dh_listpackages -s | grep -w libgl1-mesa-directfb)),)
- dh_makeshlibs -plibgl1-mesa-directfb -V 'libgl1-mesa-directfb | libgl1'
-endif
-# Make sure nothing has been left behind.
- find debian -mindepth 2 -name shlibs | cut -d / -f 2 | sort -u > \
- debian/shlibs.actual
- find debian -mindepth 2 -name lib\*.so.\* | grep -v dbg | cut -d / -f 2 | sort -u > \
- debian/shlibs.should
- cmp debian/shlibs.actual debian/shlibs.should
- rm debian/shlibs.actual debian/shlibs.should
+ dh_makeshlibs -s
dh_installdeb -s
dh_shlibdeps -s
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
- @echo Target $@: done.
-
-list-targets:
- @for t in $(BUILD_GL_TARGETS_arch) ; do echo $$t ; done
-
-debian/mesa-swx11-source.install:
- ( find src/mesa src/glx/x11 include/GL/internal -name '*.[ch]' ; \
- find include/GL -name 'xmesa*' ) | \
- egrep -v 'drivers/(dri/(fb|ffb|gamma|i[a-z0-9]+|mach64|mga|r[0-9]+|radeon|s3v|savage|sis|tdfx|trident|unichrome)|directfb|dos|fbdev|ggi|glide|osmesa|svga|windows)/' | \
- while read x; do echo $$x usr/share/mesa-source/`dirname $$x`; done \
- > $@
binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure debian/mesa-swx11-source.install
+.PHONY: configs build clean binary-indep binary-arch binary install configure
+
diff --git a/debian/scripts/choose-configs b/debian/scripts/choose-configs
new file mode 100644
index 00000000000..3f5f9868e51
--- /dev/null
+++ b/debian/scripts/choose-configs
@@ -0,0 +1,52 @@
+# Script to choose which configurations are to be built depending on the value
+# of the DEB_BUILD_ARCH variable.
+#
+# Copyright © 2006 Thierry Reding <thierry@gilfi.de>
+
+##############################################################################
+## architecture-specific configurations ######################################
+
+# choose an architecture-specific build of swx11 and GLU if a matching
+# configuration exists
+ifneq ($(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)),)
+ SWX11_GLU_CONFIGS := debian-swx11+glu-$(DEB_BUILD_ARCH)
+else
+ SWX11_GLU_CONFIGS := debian-swx11+glu-any
+endif
+
+# same for static builds
+ifneq ($(wildcard configs/debian-swx11+glu-static-$(DEB_BUILD_ARCH)),)
+ SWX11_GLU_CONFIGS += debian-swx11+glu-static-$(DEB_BUILD_ARCH)
+else
+ SWX11_GLU_CONFIGS += debian-swx11+glu-static-any
+endif
+
+# and for the GLX/DRI-enabled libGL
+ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),)
+ DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH)
+else
+ DRI_CONFIGS := debian-dri-any
+endif
+
+##############################################################################
+## CPU-optimized configurations ##############################################
+
+ifeq ($(DEB_BUILD_ARCH), i386)
+ SWX11_GLU_CONFIGS += debian-swx11+glu-i386-i686
+# DRI_CONFIGS += debian-dri-i386-i686
+endif
+
+#ifeq ($(DEB_BUILD_ARCH), alpha)
+# SWX11_GLU_CONFIGS += debian-swx11+glu-alpha-ev5
+#endif
+
+#ifeq ($(DEB_BUILD_ARCH), powerpc)
+# SWX11_GLU_CONFIGS += debian-swx11+glu-powerpc-603
+#endif
+
+#ifeq ($(DEB_BUILD_ARCH), sparc)
+# SWX11_GLU_CONFIGS += debian-swx11+glu-sparc-ultrasparc
+#endif
+
+# vim: ft=make
+
diff --git a/debian/scripts/install-source.sh b/debian/scripts/install-source.sh
new file mode 100755
index 00000000000..bc0bcd5e34d
--- /dev/null
+++ b/debian/scripts/install-source.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+if [ -n "$1" ]; then
+ TOP="$1"
+else
+ TOP=`pwd`
+fi
+
+SOURCE_DIRS='
+ include/GL/internal
+ src/glx/x11
+ src/mesa/array_cache
+ src/mesa/drivers/common
+ src/mesa/drivers/dri/common
+ src/mesa/drivers/dri/glcore
+ src/mesa/drivers/x11
+ src/mesa/glapi
+ src/mesa/main
+ src/mesa/math
+ src/mesa/ppc
+ src/mesa/shader
+ src/mesa/sparc
+ src/mesa/swrast_setup
+ src/mesa/swrast
+ src/mesa/tnl_dd
+ src/mesa/tnl
+ src/mesa/x86-64
+ src/mesa/x86
+'
+
+FILTER="-not -path '*/.svn*'"
+TARGET=${TOP}/debian/tmp/usr/share/mesa-source
+
+(
+ find $SOURCE_DIRS $FILTER -name '*.[ch]';
+ find include/GL $FILTER -name 'xmesa*.h';
+) | \
+ while read x; do
+ DIRNAME=`dirname "$x"`
+ mkdir -p "$TARGET/$DIRNAME"
+ cp -lf "$x" "$TARGET/$DIRNAME"
+ done
+
+# fix permissions
+find "$TARGET" -type f | xargs chmod 0644
+
diff --git a/debian/shadowtree b/debian/shadowtree
deleted file mode 100644
index 3e2a89afdfc..00000000000
--- a/debian/shadowtree
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use File::Find;
-use File::Spec;
-use Cwd;
-
-sub usage()
-{
- my $name = (File::Spec->splitpath($0))[2];
- print <<EOT
-Usage:
-
- $name destination
-EOT
- ;
- exit 0;
-}
-
-sub get_first_subdir($$)
-{
- my @path = File::Spec->splitdir(File::Spec->rel2abs(shift));
- my @base = File::Spec->splitdir(File::Spec->rel2abs(shift));
-
- while (@path and @base and $path[0] eq $base[0])
- {
- shift @path;
- shift @base;
- }
-
- @base ? '' : $path[0];
-}
-
-my $dst = shift;
-
-if (not defined $dst or $dst eq '')
-{
- usage();
-}
-
-my $src = File::Spec->rel2abs(cwd());
-
-$dst = File::Spec->rel2abs($dst);
-
-if (! -d $dst)
-{
- my $path = '';
- foreach my $d (File::Spec->splitdir($dst))
- {
- $path = File::Spec->catdir($path, $d);
- if (! -d $path)
- {
- mkdir $path or die "Can't create directory $path: $!";
- }
- }
-}
-
-my $subdir = File::Spec->rel2abs(get_first_subdir($dst, $src), $src);
-my @path = File::Spec->splitdir($dst);
-my $curdir = File::Spec->catdir(@path);
-
-find {
- wanted => sub {
- if ($File::Find::name eq $subdir or /^(CVS(?:\.adm)?|RCS|SCCS)$/)
- {
- $File::Find::prune = 1;
- return;
- }
- elsif ($_ eq File::Spec->curdir)
- {
- return;
- }
- elsif (-d)
- {
- push @path, $_;
- $curdir = File::Spec->catdir(@path);
- mkdir $curdir unless -d $curdir;
- }
- else
- {
- my $basename = (File::Spec->splitpath($File::Find::name))[2];
- my $filename = File::Spec->catfile($curdir, $basename);
- unlink $filename;
- symlink File::Spec->abs2rel($File::Find::name, $curdir), $filename;
- }
- },
- postprocess => sub {
- pop @path;
- }
-}, $src;
diff --git a/debian/shlibs.local b/debian/shlibs.local
deleted file mode 100644
index a29cea0ef71..00000000000
--- a/debian/shlibs.local
+++ /dev/null
@@ -1,2 +0,0 @@
-libGL 1
-libGLU 1 libglu1-mesa | libglu1
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 00000000000..75441ad9de1
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/mesa3d/MesaLib-(.*)\.tar\.gz
diff --git a/descrip.mms b/descrip.mms
index 11d94988916..f2f84349130 100644
--- a/descrip.mms
+++ b/descrip.mms
@@ -19,4 +19,4 @@ all :
$(MMS)$(MMSQUALIFIERS)
set default [-.xdemos]
$(MMS)$(MMSQUALIFIERS)
- if f$search("[-]test.DIR") .nes. "" then pipe set default [-.test] ; $(MMS)$(MMSQUALIFIERS)
+ if f$search("[-]tests.DIR") .nes. "" then pipe set default [-.tests] ; $(MMS)$(MMSQUALIFIERS)
diff --git a/docs/README.directfb b/docs/README.directfb
index 169ebe486ee..e3bada4888b 100644
--- a/docs/README.directfb
+++ b/docs/README.directfb
@@ -6,7 +6,7 @@ Requirements
============
To build Mesa with DirectFB (DirectFBGL) support you need:
- - DirectFB at least 0.9.21 (http://directfb.org)
+ - DirectFB at least 1.0.0 (http://directfb.org)
- pkg-config at least 0.9 (http://pkgconfig.sf.net)
diff --git a/docs/contents.html b/docs/contents.html
index 40cefa26e7a..9f09df97374 100644
--- a/docs/contents.html
+++ b/docs/contents.html
@@ -28,7 +28,6 @@ a:visited {
<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.html" 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>
@@ -74,6 +73,7 @@ a:visited {
<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>
+<LI><A HREF="dispatch.html" target="MainFrame">GL Dispatch</A>
</ul>
<b>Links</b>
diff --git a/docs/devinfo.html b/docs/devinfo.html
index 4d4730be757..cce14d73a36 100644
--- a/docs/devinfo.html
+++ b/docs/devinfo.html
@@ -34,11 +34,15 @@ To add a new GL extension to Mesa you have to do at least the following.
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.
+ Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
+</li>
+<li>
+ Update the <code>extensions.c</code> file.
+</li>
+<li>
+ From this point, the best way to proceed is to find another extension,
+ similar to the new one, that's already implemented in Mesa and use it
+ as an example.
</li>
<li>
If the new extension adds new GL state, the functions in get.c, enable.c
diff --git a/docs/dispatch.html b/docs/dispatch.html
new file mode 100644
index 00000000000..b9ea8822e60
--- /dev/null
+++ b/docs/dispatch.html
@@ -0,0 +1,274 @@
+<HTML>
+<HEAD>
+<TITLE>GL Dispatch in Mesa</TITLE>
+<LINK REL="stylesheet" TYPE="text/css" HREF="mesa.css">
+</HEAD>
+
+<BODY>
+<H1>GL Dispatch in Mesa</H1>
+
+<p>Several factors combine to make efficient dispatch of OpenGL functions
+fairly complicated. This document attempts to explain some of the issues
+and introduce the reader to Mesa's implementation. Readers already familiar
+with the issues around GL dispatch can safely skip ahead to the <A
+HREF="#overview">overview of Mesa's implementation</A>.</p>
+
+<H2>1. Complexity of GL Dispatch</H2>
+
+<p>Every GL application has at least one object called a GL <em>context</em>.
+This object, which is an implicit parameter to ever GL function, stores all
+of the GL related state for the application. Every texture, every buffer
+object, every enable, and much, much more is stored in the context. Since
+an application can have more than one context, the context to be used is
+selected by a window-system dependent function such as
+<tt>glXMakeContextCurrent</tt>.</p>
+
+<p>In environments that implement OpenGL with X-Windows using GLX, every GL
+function, including the pointers returned by <tt>glXGetProcAddress</tt>, are
+<em>context independent</em>. This means that no matter what context is
+currently active, the same <tt>glVertex3fv</tt> function is used.</p>
+
+<p>This creates the first bit of dispatch complexity. An application can
+have two GL contexts. One context is a direct rendering context where
+function calls are routed directly to a driver loaded within the
+application's address space. The other context is an indirect rendering
+context where function calls are converted to GLX protocol and sent to a
+server. The same <tt>glVertex3fv</tt> has to do the right thing depending
+on which context is current.</p>
+
+<p>Highly optimized drivers or GLX protocol implementations may want to
+change the behavior of GL functions depending on current state. For
+example, <tt>glFogCoordf</tt> may operate differently depending on whether
+or not fog is enabled.</p>
+
+<p>In multi-threaded environments, it is possible for each thread to have a
+differnt GL context current. This means that poor old <tt>glVertex3fv</tt>
+has to know which GL context is current in the thread where it is being
+called.</p>
+
+<A NAME="overview"/>
+<H2>2. Overview of Mesa's Implementation</H2>
+
+<p>Mesa uses two per-thread pointers. The first pointer stores the address
+of the context current in the thread, and the second pointer stores the
+address of the <em>dispatch table</em> associated with that context. The
+dispatch table stores pointers to functions that actually implement
+specific GL functions. Each time a new context is made current in a thread,
+these pointers a updated.</p>
+
+<p>The implementation of functions such as <tt>glVertex3fv</tt> becomes
+conceptually simple:</p>
+
+<ul>
+<li>Fetch the current dispatch table pointer.</li>
+<li>Fetch the pointer to the real <tt>glVertex3fv</tt> function from the
+table.</li>
+<li>Call the real function.</li>
+</ul>
+
+<p>This can be implemented in just a few lines of C code. The file
+<tt>src/mesa/glapi/glapitemp.h</tt> contains code very similar to this.</p>
+
+<blockquote>
+<table border="1">
+<tr><td><pre>
+void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct _glapi_table * const dispatch = GET_DISPATCH();
+
+ (*dispatch-&gt;Vertex3f)(x, y, z);
+}</pre></td></tr>
+<tr><td>Sample dispatch function</td></tr></table>
+</blockquote>
+
+<p>The problem with this simple implementation is the large amount of
+overhead that it adds to every GL function call.</p>
+
+<p>In a multithreaded environment, a niave implementation of
+<tt>GET_DISPATCH</tt> involves a call to <tt>pthread_getspecific</tt> or a
+similar function. Mesa provides a wrapper function called
+<tt>_glapi_get_dispatch</tt> that is used by default.</p>
+
+<H2>3. Optimizations</H2>
+
+<p>A number of optimizations have been made over the years to diminish the
+performance hit imposed by GL dispatch. This section describes these
+optimizations. The benefits of each optimization and the situations where
+each can or cannot be used are listed.</p>
+
+<H3>3.1. Dual dispatch table pointers</H3>
+
+<p>The vast majority of OpenGL applications use the API in a single threaded
+manner. That is, the application has only one thread that makes calls into
+the GL. In these cases, not only do the calls to
+<tt>pthread_getspecific</tt> hurt performance, but they are completely
+unnecessary! It is possible to detect this common case and avoid these
+calls.</p>
+
+<p>Each time a new dispatch table is set, Mesa examines and records the ID
+of the executing thread. If the same thread ID is always seen, Mesa knows
+that the application is, from OpenGL's point of view, single threaded.</p>
+
+<p>As long as an application is single threaded, Mesa stores a pointer to
+the dispatch table in a global variable called <tt>_glapi_Dispatch</tt>.
+The pointer is also stored in a per-thread location via
+<tt>pthread_setspecific</tt>. When Mesa detects that an application has
+become multithreaded, <tt>NULL</tt> is stored in <tt>_glapi_Dispatch</tt>.</p>
+
+<p>Using this simple mechanism the dispatch functions can detect the
+multithreaded case by comparing <tt>_glapi_Dispatch</tt> to <tt>NULL</tt>.
+The resulting implementation of <tt>GET_DISPATCH</tt> is slightly more
+complex, but it avoids the expensive <tt>pthread_getspecific</tt> call in
+the common case.</p>
+
+<blockquote>
+<table border="1">
+<tr><td><pre>
+#define GET_DISPATCH() \
+ (_glapi_Dispatch != NULL) \
+ ? _glapi_Dispatch : pthread_getspecific(&_glapi_Dispatch_key)
+</pre></td></tr>
+<tr><td>Improved <tt>GET_DISPATCH</tt> Implementation</td></tr></table>
+</blockquote>
+
+<H3>3.2. ELF TLS</H3>
+
+<p>Starting with the 2.4.20 Linux kernel, each thread is allocated an area
+of per-thread, global storage. Variables can be put in this area using some
+extensions to GCC. By storing the dispatch table pointer in this area, the
+expensive call to <tt>pthread_getspecific</tt> and the test of
+<tt>_glapi_Dispatch</tt> can be avoided.</p>
+
+<p>The dispatch table pointer is stored in a new variable called
+<tt>_glapi_tls_Dispatch</tt>. A new variable name is used so that a single
+libGL can implement both interfaces. This allows the libGL to operate with
+direct rendering drivers that use either interface. Once the pointer is
+properly declared, <tt>GET_DISPACH</tt> becomes a simple variable
+reference.</p>
+
+<blockquote>
+<table border="1">
+<tr><td><pre>
+extern __thread struct _glapi_table *_glapi_tls_Dispatch
+ __attribute__((tls_model("initial-exec")));
+
+#define GET_DISPATCH() _glapi_tls_Dispatch
+</pre></td></tr>
+<tr><td>TLS <tt>GET_DISPATCH</tt> Implementation</td></tr></table>
+</blockquote>
+
+<p>Use of this path is controlled by the preprocessor define
+<tt>GLX_USE_TLS</tt>. Any platform capable of using TLS should use this as
+the default dispatch method.</p>
+
+<H3>3.3. Assembly Language Dispatch Stubs</H3>
+
+<p>Many platforms has difficulty properly optimizing the tail-call in the
+dispatch stubs. Platforms like x86 that pass parameters on the stack seem
+to have even more difficulty optimizing these routines. All of the dispatch
+routines are very short, and it is trivial to create optimal assembly
+language versions. The amount of optimization provided by using assembly
+stubs varies from platform to platform and application to application.
+However, by using the assembly stubs, many platforms can use an additional
+space optimization (see <A HREF="#fixedsize">below</A>).</p>
+
+<p>The biggest hurdle to creating assembly stubs is handling the various
+ways that the dispatch table pointer can be accessed. There are four
+different methods that can be used:</p>
+
+<ol>
+<li>Using <tt>_glapi_Dispatch</tt> directly in builds for non-multithreaded
+environments.</li>
+<li>Using <tt>_glapi_Dispatch</tt> and <tt>_glapi_get_dispatch</tt> in
+multithreaded environments.</li>
+<li>Using <tt>_glapi_Dispatch</tt> and <tt>pthread_getspecific</tt> in
+multithreaded environments.</li>
+<li>Using <tt>_glapi_tls_Dispatch</tt> directly in TLS enabled
+multithreaded environments.</li>
+</ol>
+
+<p>People wishing to implement assembly stubs for new platforms should focus
+on #4 if the new platform supports TLS. Otherwise, implement #2 followed by
+#3. Environments that do not support multithreading are uncommon and not
+terribly relevant.</p>
+
+<p>Selection of the dispatch table pointer access method is controlled by a
+few preprocessor defines.</p>
+
+<ul>
+<li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
+<li>If <tt>PTHREADS</tt> is defined, method #3 is used.</li>
+<li>If any of <tt>PTHREADS</tt>, <tt>USE_XTHREADS</tt>,
+<tt>SOLARIS_THREADS</tt>, <tt>WIN32_THREADS</tt>, or <tt>BEOS_THREADS</tt>
+is defined, method #2 is used.</li>
+<li>If none of the preceeding are defined, method #1 is used.</li>
+</ul>
+
+<p>Two different techniques are used to handle the various different cases.
+On x86 and SPARC, a macro called <tt>GL_STUB</tt> is used. In the preamble
+of the assembly source file different implementations of the macro are
+selected based on the defined preprocessor variables. The assmebly code
+then consists of a series of invocations of the macros such as:
+
+<blockquote>
+<table border="1">
+<tr><td><pre>
+GL_STUB(Color3fv, _gloffset_Color3fv)
+</pre></td></tr>
+<tr><td>SPARC Assembly Implementation of <tt>glColor3fv</tt></td></tr></table>
+</blockquote>
+
+<p>The benefit of this technique is that changes to the calling pattern
+(i.e., addition of a new dispatch table pointer access method) require fewer
+changed lines in the assembly code.</p>
+
+<p>However, this technique can only be used on platforms where the function
+implementation does not change based on the parameters passed to the
+function. For example, since x86 passes all parameters on the stack, no
+additional code is needed to save and restore function parameters around a
+call to <tt>pthread_getspecific</tt>. Since x86-64 passes parameters in
+registers, varying amounts of code needs to be inserted around the call to
+<tt>pthread_getspecific</tt> to save and restore the GL function's
+parameters.</p>
+
+<p>The other technique, used by platforms like x86-64 that cannot use the
+first technique, is to insert <tt>#ifdef</tt> within the assembly
+implementation of each function. This makes the assembly file considerably
+larger (e.g., 29,332 lines for <tt>glapi_x86-64.S</tt> versus 1,155 lines for
+<tt>glapi_x86.S</tt>) and causes simple changes to the function
+implementation to generate many lines of diffs. Since the assmebly files
+are typically generated by scripts (see <A HREF="#autogen">below</A>), this
+isn't a significant problem.</p>
+
+<p>Once a new assembly file is created, it must be inserted in the build
+system. There are two steps to this. The file must first be added to
+<tt>src/mesa/sources</tt>. That gets the file built and linked. The second
+step is to add the correct <tt>#ifdef</tt> magic to
+<tt>src/mesa/main/dispatch.c</tt> to prevent the C version of the dispatch
+functions from being built.</p>
+
+<A NAME="fixedsize"/>
+<H3>3.4. Fixed-Length Dispatch Stubs</H3>
+
+<p>To implement <tt>glXGetProcAddress</tt>, Mesa stores a table that
+associates function names with pointers to those functions. This table is
+stored in <tt>src/mesa/glapi/glprocs.h</tt>. For different reasons on
+different platforms, storing all of those pointers is inefficient. On most
+platforms, including all known platforms that support TLS, we can avoid this
+added overhead.</p>
+
+<p>If the assembly stubs are all the same size, the pointer need not be
+stored for every function. The location of the function can instead be
+calculated by multiplying the size of the dispatch stub by the offset of the
+function in the table. This value is then added to the address of the first
+dispatch stub.</p>
+
+<p>This path is activated by adding the correct <tt>#ifdef</tt> magic to
+<tt>src/mesa/glapi/glapi.c</tt> just before <tt>glprocs.h</tt> is
+included.</p>
+
+<A NAME="autogen"/>
+<H2>4. Automatic Generation of Dispatch Stubs</H2>
+
+</BODY>
+</HTML>
diff --git a/docs/mangling.html b/docs/mangling.html
index cb19e7568a5..55071544fa6 100644
--- a/docs/mangling.html
+++ b/docs/mangling.html
@@ -9,8 +9,8 @@
<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
+If you want to use both Mesa and another OpenGL library 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>.
@@ -18,9 +18,11 @@ This results in all the Mesa functions being prefixed with
<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.
+Add the flag to CFLAGS in the configuration file which you want to use.
+For example:
+<pre>
+CFLAGS += -DUSE_MGL_NAMESPACE
+</pre>
</p>
diff --git a/docs/news.html b/docs/news.html
index 0c77ad5d30f..c5f68a6e231 100644
--- a/docs/news.html
+++ b/docs/news.html
@@ -11,102 +11,45 @@
<H1>News</H1>
-<h2>September 15, 2006</h2>
+<h2>December 2, 2006</h2>
<p>
-Mesa 6.5.1 has been released. This is a new development release.
+<a href="relnotes-6.5.2.html">Mesa 6.5.2</a> has been released.
+This is a new development release.
</p>
-<a href="versions.html#6.5.1">Changes in version 6.5.1</a>
+
+<h2>September 15, 2006</h2>
<p>
-The MD5 checksums are:
+<a href="relnotes-6.5.1.html">Mesa 6.5.1</a> has been released.
+This is a new development release.
</p>
-<pre>
-TBD
-</pre>
<h2>March 31, 2006</h2>
<p>
-Mesa 6.5 has been released. This is a new development release.
-</p>
-<a href="versions.html#6.5">Changes in version 6.5</a>
-<p>
-The MD5 checksums are:
+<a href="relnotes-6.5.html">Mesa 6.5</a> has been released.
+This is a new development release.
</p>
-<pre>
-657be3b92f6dabc78a67ed9cb8d67813 MesaLib-6.5.tar.gz
-61beda590bfc5b4a12e979d5f2d70d7a MesaLib-6.5.tar.bz2
-19d48b872d579d4f91466060804a59ac MesaLib-6.5.zip
-694ad3a7007010c7418a9c72d1cba5b7 MesaDemos-6.5.tar.gz
-ab95b590dcd640726a2d89e62068c66e MesaDemos-6.5.tar.bz2
-b792c303fefd87294488e2b7eab976e5 MesaDemos-6.5.zip
-ac1d585483617db0c91e5c15cb5ec3a3 MesaGLUT-6.5.tar.gz
-59f0bf2b2ffb67fe23ee479f9b044f31 MesaGLUT-6.5.tar.bz2
-005decb2136718e22222ac1c4805cd15 MesaGLUT-6.5.zip
-</pre>
<h2>February 2, 2006</h2>
<p>
-Mesa 6.4.2 has been released. This is primarily a bug-fix release.
-</p>
-<a href="versions.html#6.4.2">Changes in version 6.4.2</a>
-<p>
-The MD5 checksums are:
+<a href="relnotes-6.4.2.html">Mesa 6.4.2</a> has been released.
+This is stable, bug-fix release.
</p>
-<pre>
-cb0d745d520fa7c2bb9178058b763544 MesaLib-6.4.2.tar.gz
-7674d2c603b5834259e4e5a820cefd5b MesaLib-6.4.2.tar.bz2
-d224e1325b33ff71a0f3893fc6b4d594 MesaLib-6.4.2.zip
-d4b345d4588fc750cd3d34f3ac26673e MesaDemos-6.4.2.tar.gz
-9cae1ab874af533ce356bd7dfe2e0bb0 MesaDemos-6.4.2.tar.bz2
-2da6e1d1245e441d27813595c6ba50de MesaDemos-6.4.2.zip
-84427d18c3453f0ea52388eeba7169b5 MesaGLUT-6.4.2.tar.gz
-b157ba8ad1ea63260cf5339132e7aac6 MesaGLUT-6.4.2.tar.bz2
-fe1523744fc05edc3811dfc6a1bf4181 MesaGLUT-6.4.2.zip
-</pre>
<h2>November 29, 2005</h2>
<p>
-Mesa 6.4.1 has been released. This is a stable, bug-fix release.
+<a href="relnotes-6.4.1.html">Mesa 6.4.1</a> has been released.
+This is stable, bug-fix release.
</p>
-<a href="versions.html#6.4.1">Changes in version 6.4.1</a>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-698ceb574cf882b0226761f5913c0da9 MesaLib-6.4.1.tar.gz
-ea148c828ec6f645526451db1b8556f1 MesaLib-6.4.1.tar.bz2
-42e93279468975ed2bf3111b8721e5d9 MesaLib-6.4.1.zip
-e3b0d50807fd2bdcd1a95aaddd786f13 MesaDemos-6.4.1.tar.gz
-99df1fdcb98d391666b476ca6f1dda8a MesaDemos-6.4.1.tar.bz2
-b999d2c6d92fb4b7740a3dbd889348e3 MesaDemos-6.4.1.zip
-eadfe01fe5ddfb1eb8227dd567b31635 MesaGLUT-6.4.1.tar.gz
-bd003bb4f981a4f91dee4c38644d4f3f MesaGLUT-6.4.1.tar.bz2
-71c401c037088bf688a88afdaeb3420f MesaGLUT-6.4.1.zip
-</pre>
-
<h2>October 24, 2005</h2>
<p>
-Mesa 6.4 has been released. This is a stable, bug-fix release.
-</p>
-<a href="versions.html#6.4">Changes in version 6.4</a>
-<p>
-The MD5 checksums are:
+<a href="relnotes-6.4.html">Mesa 6.4</a> has been released.
+This is stable, bug-fix release.
</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>
@@ -1133,6 +1076,6 @@ source code</a>.</p>
<hr>
-$Id: news.html,v 3.30 2006/09/16 04:13:20 brianp Exp $
+$Id: news.html,v 3.33 2006/12/02 18:18:41 brianp Exp $
</body>
</html>
diff --git a/docs/relnotes-6.4.1.html b/docs/relnotes-6.4.1.html
new file mode 100644
index 00000000000..3d6ff1c4fe4
--- /dev/null
+++ b/docs/relnotes-6.4.1.html
@@ -0,0 +1,68 @@
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 6.4.1 / November 29, 2006</H1>
+
+<p>
+Mesa 6.4.1 is a stable, bug-fix release.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+698ceb574cf882b0226761f5913c0da9 MesaLib-6.4.1.tar.gz
+ea148c828ec6f645526451db1b8556f1 MesaLib-6.4.1.tar.bz2
+42e93279468975ed2bf3111b8721e5d9 MesaLib-6.4.1.zip
+e3b0d50807fd2bdcd1a95aaddd786f13 MesaDemos-6.4.1.tar.gz
+99df1fdcb98d391666b476ca6f1dda8a MesaDemos-6.4.1.tar.bz2
+b999d2c6d92fb4b7740a3dbd889348e3 MesaDemos-6.4.1.zip
+eadfe01fe5ddfb1eb8227dd567b31635 MesaGLUT-6.4.1.tar.gz
+bd003bb4f981a4f91dee4c38644d4f3f MesaGLUT-6.4.1.tar.bz2
+71c401c037088bf688a88afdaeb3420f MesaGLUT-6.4.1.zip
+</pre>
+
+
+<h2>Bug fixes</h2>
+<ul>
+<li>redefining a vertex program string didn't take effect in TNL module
+<li>fixed occasional segfault upon vertex/fragment parsing error
+<li>vertex program LIT instruction didn't handle 0^0=1 correctly
+<li>fragment program fog option didn't work with glDrawPixels, glBitmap
+<li>USE_MGL_NAMESPACE didn't work for x86-64
+<li>OSMesa demos were missing from previous release tarballs
+<li>fixed problem with float->ushort conversion in glClear (bug 4992)
+<li>popping of GL_EYE_PLANE texgen state was broken (bug 4996)
+<li>popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
+<li>fixed occasional triangle color interpolation problem on VMS
+<li>work around invalid free() call (bug 5131)
+<li>fixed BSD X server compilation problem by including stdint.h
+</ul>
+
+
+<h2>Driver Status</h2>
+
+<pre>
+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
+</pre>
+
+</body>
+</html>
diff --git a/docs/relnotes-6.4.2.html b/docs/relnotes-6.4.2.html
new file mode 100644
index 00000000000..f5a658f99b5
--- /dev/null
+++ b/docs/relnotes-6.4.2.html
@@ -0,0 +1,75 @@
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 6.4.2 / February 2, 2006</H1>
+
+<p>
+Mesa 6.4.2 is a stable, bug-fix release.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+cb0d745d520fa7c2bb9178058b763544 MesaLib-6.4.2.tar.gz
+7674d2c603b5834259e4e5a820cefd5b MesaLib-6.4.2.tar.bz2
+d224e1325b33ff71a0f3893fc6b4d594 MesaLib-6.4.2.zip
+d4b345d4588fc750cd3d34f3ac26673e MesaDemos-6.4.2.tar.gz
+9cae1ab874af533ce356bd7dfe2e0bb0 MesaDemos-6.4.2.tar.bz2
+2da6e1d1245e441d27813595c6ba50de MesaDemos-6.4.2.zip
+84427d18c3453f0ea52388eeba7169b5 MesaGLUT-6.4.2.tar.gz
+b157ba8ad1ea63260cf5339132e7aac6 MesaGLUT-6.4.2.tar.bz2
+fe1523744fc05edc3811dfc6a1bf4181 MesaGLUT-6.4.2.zip
+</pre>
+
+
+<h2>New features</h2>
+<ul>
+<li>added OSMesaColorClamp() function/feature
+<li>added wglGetExtensionStringARB() function
+</ul>
+
+<h2>Changes</h2>
+<ul>
+<li>GLUT tarball
+<br>
+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.
+</ul>
+
+<h2>Bug fixes</h2>
+<ul>
+<li>fixed some problems when building on Windows
+<li>GLw header files weren't installed by installmesa script (bug 5396)
+<li>GL/glfbdev.h file was missing from tarballs
+<li>fixed TNL initialization bug which could lead to crash (bug 5791)
+</ul>
+
+
+<h2>Driver Status</h2>
+
+<pre>
+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
+</pre>
+
+</body>
+</html>
diff --git a/docs/relnotes-6.4.html b/docs/relnotes-6.4.html
new file mode 100644
index 00000000000..1fffa27f6f8
--- /dev/null
+++ b/docs/relnotes-6.4.html
@@ -0,0 +1,90 @@
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 6.4 / October 24, 2005</H1>
+
+<p>
+Mesa 6.4 is a stable, bug-fix release.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<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>New</h2>
+<ul>
+<li>Added a fast XOR line drawing function in Xlib driver
+<li>Added support for GL_ARB_texture_mirrored_repeat to savage driver (supported only on Savage4 hardware).
+</ul>
+
+<h2>Changes</h2>
+<ul>
+<li>Mesa now packaged in three parts: Library, Demos and GLUT
+</ul>
+
+<h2>Bug fixes</h2>
+<ul>
+<li>GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig
+<li>Some files were present multiple times in the 6.3.2 tarballs
+<li>r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207)
+<li>glxgears_fbconfig demo didn't work (bug 4237)
+<li>fixed bug when bilinear sampling 2d textures with borders
+<li>glXCreatePbuffer() could segfault instead of returning 0 (bug 4235)
+<li>fixed undefined frexp and rand in X.org libGLcore.a (bug 4242)
+<li>fixed a few problems with proxy color tables (bug 4270)
+<li>fixed precision problem in Z clearing (bug 4395)
+<li>glBitmap, glDraw/CopyPixels mistakenly generated selection hits
+<li>fixed potential segfault caused by reading pixels outside
+ of renderbuffer bounds
+<li>glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB
+<li>fixed memory corruption bug involving software alpha buffers
+<li>glReadPixels clipped by window bounds was sometimes broken
+<li>glDraw/CopyPixels of stencil data ignored the stencil write mask
+<li>glReadPixels from a texture bound to a framebuffer object didn't work
+<li>glIsRender/FramebufferEXT weren't totally correct
+<li>fixed a number of point size attenuation/fade bugs
+<li>fixed glFogCoord bug 4729
+<li>GLX encoding for transpose matrix functions was broken
+<li>fixed broken fragment program KIL and SWZ instructions
+<li>fragment programs that wrote result.depth.z didn't work
+</ul>
+
+
+<h2>Driver Status</h2>
+
+<pre>
+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
+</pre>
+
+</body>
+</html>
diff --git a/docs/relnotes-6.5.1.html b/docs/relnotes-6.5.1.html
index 0640e992bba..0f03f931e02 100644
--- a/docs/relnotes-6.5.1.html
+++ b/docs/relnotes-6.5.1.html
@@ -8,26 +8,29 @@
<body bgcolor="#eeeeee">
-<H1>Mesa 6.5.1 Release Notes</H1>
-
-
-
-<H2>Introduction</H2>
-
-<p>
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.5) designate new developmental releases.
-Even numbered versions (such as 6.4) designate stable releases.
-</p>
+<H1>Mesa 6.5.1 Release Notes / September 15, 2006</H1>
<p>
Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of
-<a href="versions.html#6.5.1">bug fixes</a>.
+bug fixes.
</p>
-<h2>New Features</h2>
+<h2>MD5 checksums</h2>
+<pre>
+d9a555297319bb932a3192952d53d073 MesaLib-6.5.1.tar.gz
+c46f2c6646a270911b791dd8e1c2d977 MesaLib-6.5.1.tar.bz2
+939eaaff33322bfeafac784402b45f4f MesaLib-6.5.1.zip
+9e4bbe83c007bfbaa67449a81cc3d36a MesaDemos-6.5.1.tar.gz
+0f2794baf7a9d98b22caea9f78c6942d MesaDemos-6.5.1.tar.bz2
+14c77eab9cc7a265c331abf239927c1c MesaDemos-6.5.1.zip
+c5f87c23aaf4eaf1bda0d007ea98366c MesaGLUT-6.5.1.tar.gz
+2525642fe7f454e3e1a1aad01359b406 MesaGLUT-6.5.1.tar.bz2
+e33b165c22551e23b58ede8767378543 MesaGLUT-6.5.1.zip
+</pre>
+
+<h2>New Features</h2>
<ul>
<li>Intel i965 "broadwater" DRI driver
@@ -38,6 +41,53 @@ Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of
<li>GL_EXT_gpu_program_parameters - addes a few new functions for setting
multiple vertex/fragment program parameters with one call.
+<li>"engine" demo
+<li>updated fbdev driver and GLUT for fbdev (Sean D'Epagnier)
+<li>many updates to the DRI drivers
+</ul>
+
+<h2>Changes</h2>
+<ul>
+<li>The glVertexAttribARB functions no longer alias the conventional
+ vertex attributes.
+<li>glxinfo program prints more info with -l option
+<li>GL_FRAGMENT_PROGRAM_NV and GL_FRAGMENT_PROGRAM_ARB are now
+ compatible, in terms of glBindProgramARB()
+<li>The GL_ARB_vertex_program attribute <code>vertex.weight</code> is now
+ accepted by the parser, even though the GL_ARB_vertex_blend and
+ GL_EXT_vertex_weighting extensions aren't supported.
+ Allows Warcraft to run.
+</ul>
+
+<h2>Bug fixes</h2>
+<ul>
+<li>fixed broken texture border handling for depth textures (bug 6498)
+<li>removed the test for duplicated framebuffer attachments, per
+ version 117 of the GL_EXT_framebuffer_object specification
+<li>fixed a few render-to-texture bugs, including render to depth texture
+<li>clipping of lines against user-defined clip planes was broken (6512)
+<li>assembly language dispatch for SPARC was broken (bug 6484)
+<li>assorted compilation fixes on various Unix platforms (Dan Schikore)
+<li>glPopAttrib could restore an invalid value for GL_DRAW_BUFFER
+<li>assorted minor fixes for 16 and 32 bit/channel modes
+<li>fixed assorted bugs in texture compression paths
+<li>fixed indirect rendering vertex array crashes (bug 6863)
+<li>glDrawPixels GL_INDEX_OFFSET didn't always work
+<li>fixed convolution memory leak (bug 7077)
+<li>rectangular depth textures didn't work
+<li>invalid mode to glBegin didn't generate an error (bug 7142)
+<li>'normalized' parameter to glVertexAttribPointerARB didn't work
+<li>disable bogus GLX_SGI_video_sync extension in xlib driver
+<li>fixed R128 driver locking bug (Martijn van Oosterhout)
+<li>using evaluators with vertex programs caused crashes (bug 7564)
+<li>fragment.position wasn't set correctly for point/line primitives
+<li>fixed parser bug for scalar sources for GL_NV_fragment_program
+<li>max fragment program length was incorrectly 128, now 1024
+<li>writes to result.depth in fragment programs weren't clamped to [0,1]
+<li>fixed potential dangling pointer bug in glBindProgram()
+<li>fixed some memory leaks (and potential crashes) in Xlib driver
+<li>fixed a number of build issues on HP-UX (Christopher Bell)
+<li>accum buffer didn't work with OSMesa interface
</ul>
diff --git a/docs/relnotes-6.5.2.html b/docs/relnotes-6.5.2.html
new file mode 100644
index 00000000000..c4597c9d1a1
--- /dev/null
+++ b/docs/relnotes-6.5.2.html
@@ -0,0 +1,118 @@
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 6.5.2 Release Notes / December 2, 2006</H1>
+
+<p>
+Mesa 6.5.2 is a 6.5 follow-on development release with a few new features
+but mostly consisting of bug fixes.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+TBD
+</pre>
+
+
+<h2>New features</h2>
+<ul>
+<li>New DRI memory manager system. Currently used by the i915tex driver.
+Other DRI drivers will be updated to use the new memory manager in coming
+months.
+<br>
+To use the new driver you'll need the most recent DRM library and drivers
+(version 2.2 or later) and a recent xf86-video-intel driver module from X.org.
+<br>
+New features resulting from this work include:
+<ul>
+<li>EXT_framebuffer_objects, render to texture
+<li>ARB_pixel_buffer_objects
+<li>Accelerated CopyTexSubimage, DrawPixels, ReadPixels, CopyPixels
+<li>Accelerated texture uploads from pixel buffer objects
+<li>Potentially texturing directly from the pixel buffer object (zero
+copy texturing).
+</ul>
+<li>New Intel i965 DRI driver
+<li>New <code>minstall</code> script to replace normal install program
+<li>Faster fragment program execution in software
+<li>Added (or fixed) support for <a href="http://www.opengl.org/registry/specs/SGI/make_current_read.txt">
+ GLX_SGI_make_current_read</a> to the following drivers:</li>
+ <ul>
+ <li>radeon</li>
+ <li>savage</li>
+ <li>mga</li>
+ <li>tdfx</li>
+ </ul>
+<li>Added support for ARB_occlusion_query to the tdfx driver (Ian
+Romanick).</li>
+</ul>
+
+<h2>Bug fixes</h2>
+<ul>
+<li>fixed invalid memory read while rendering textured points (bug 8320)
+<li>fixed problems with freebsd-dri configuration (bug 8344)
+<li>Mesa's fake glxGetCurrentContext() wasn't thread-aware
+<li>OPTION NV_position_invariant didn't work in NV vertex programs
+<li>glDrawPixels into a user-created framebuffer object could crash Xlib driver
+<li>Line clipping was broken in some circumstances
+<li>fragment.fogcoord register didn't always contain the correct value
+<li>RGBA logicops didn't work reliably in some DRI drivers
+<li>Fixed broken RGBA LogicOps in Intel DRI drivers
+<li>Fixed some fragment program bugs in Intel i915 DRI driver
+<li>Fixed glGetVertexAttribfvARB bug 8883
+<li>Implemented glGetUniform[fi]vARB() functions
+<li>Fixed glDrawPixels(GL_COLOR_INDEX, GL_BITMAP) segfault (bug 9044)
+<li>Fixed some gluBuild2DMipmaps() bugs (Greg McGarragh)
+<li>Fixed broken "mgl" name mangling
+<li>Indirect rending was broken for glMap* functions (bug 8899)
+</ul>
+
+
+<h2>Internal code changes</h2>
+
+<ul>
+<li>The device driver functions ResizeBuffers and GetBufferSize have been
+decprecated.
+<li>OpenGL 2.0 and 2.1 support is nearly done. We need to do quite a bit
+more testing of the shading language functions.
+</ul>
+
+
+<h2>To Do (someday) items</h2>
+<ul>
+<li>Switch to freeglut
+<li>Increase MAX_DRAWBUFFERS
+<li>Fix linux-glide target/driver.
+<li>Improved lambda and derivative calculation for frag progs.
+</ul>
+
+
+<h2>Driver Status</h2>
+
+<pre>
+Driver Status
+---------------------- ----------------------
+DRI drivers varies with the driver
+XMesa/GLX (on 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
+</pre>
+
+</body>
+</html>
diff --git a/docs/relnotes-6.5.html b/docs/relnotes-6.5.html
new file mode 100644
index 00000000000..9d1d6691e9d
--- /dev/null
+++ b/docs/relnotes-6.5.html
@@ -0,0 +1,131 @@
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 6.5 Release Notes / March 31, 2006</H1>
+
+<p>
+Mesa 6.5 is a new development release.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+657be3b92f6dabc78a67ed9cb8d67813 MesaLib-6.5.tar.gz
+61beda590bfc5b4a12e979d5f2d70d7a MesaLib-6.5.tar.bz2
+19d48b872d579d4f91466060804a59ac MesaLib-6.5.zip
+694ad3a7007010c7418a9c72d1cba5b7 MesaDemos-6.5.tar.gz
+ab95b590dcd640726a2d89e62068c66e MesaDemos-6.5.tar.bz2
+b792c303fefd87294488e2b7eab976e5 MesaDemos-6.5.zip
+ac1d585483617db0c91e5c15cb5ec3a3 MesaGLUT-6.5.tar.gz
+59f0bf2b2ffb67fe23ee479f9b044f31 MesaGLUT-6.5.tar.bz2
+005decb2136718e22222ac1c4805cd15 MesaGLUT-6.5.zip
+</pre>
+
+
+
+<h2>New Features</h2>
+<ul>
+<li>OpenGL Shading language support
+<br>
+ This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100,
+ GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions. Most of
+ the work was done by Michal Krol.
+ There's probably a fair number of bugs since this is a pretty large,
+ complicated body of code.
+<br>
+ The OpenGL 2.0 interface to these features will be implemented in a
+ future version of Mesa,
+
+<li>GL_EXT_timer_query
+<br>
+ Used to measure the time of OpenGL operations at high precision.
+ Only supported in the software/Xlib driver at this time.
+
+<li>GL_EXT_packed_depth_stencil
+<br>
+ Defines a new GL_DEPTH_STENCIL_EXT pixel format.
+
+<li>GL_EXT_framebuffer_blit
+<br>
+ A simplified glCopyPixels-like feature for copying pixel rectangles.
+
+<li>GL_ARB_half_float_pixel
+<br>
+ Adds a new half-precision floating point format for image transfers,
+ such as for glDrawPixels, glReadPixels, glTexImage, etc.
+</ul>
+
+<h2>Changes</h2>
+<ul>
+<li>removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
+<li>removed GL_SGIX/SGIS_pixel_texture extensions
+</ul>
+<h2>Bug fixes</h2>
+<ul>
+<li>fixed glxcontextmodes.c datatype problem (bug 5835)
+<li>fixed aix-gcc build/install bugs (bug 5874)
+<li>fixed some bugs in texture env program generation
+<li>glXCopyContext() didn't handle texture object bindings properly
+<li>glXCopyContext() didn't copy all lighting state
+<li>fixed FreeBSD config (Pedro Giffuni)
+<li>fixed some minor framebuffer object bugs
+<li>replaced dprintf() with _glu_printf() in GLU (bug 6244)
+<li>fixed a number of thread safety bugs/regressions
+<li>fixed a number of GLU tesselator bugs (John Shell, bug 6339)
+<li>paletted texturing was broken w/ floating point palettes (K. Schultz)
+<li>lots of assorted framebuffer object bug fixes
+</ul>
+
+
+<h2>Known Issues</h2>
+<ul>
+<li>Rendering to depth textures will not work. Rendering to GL_DEPTH_STENCIL
+textures should work.
+</ul>
+
+
+<h2>Driver Interface Changes</h2>
+<ul>
+<li>Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
+the two-sided versions: Driver.Stencil*Separate().
+<li>Render-to-texture: The functions for rendering to textures have changed.
+</ul>
+
+
+<h2>To Do (someday) items</h2>
+<ul>
+<li>Switch to freeglut
+<li>Increase MAX_DRAWBUFFERS
+<li>Fix linux-glide target/driver.
+<li>Fix lambda calculation for frag progs.
+</ul>
+
+
+<h2>Driver Status</h2>
+
+<pre>
+Driver Status
+---------------------- ----------------------
+DRI drivers varies with the driver
+XMesa/GLX (on 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
+</pre>
+
+</body>
+</html>
diff --git a/docs/relnotes.html b/docs/relnotes.html
index 7383f02098f..9165c9f1492 100644
--- a/docs/relnotes.html
+++ b/docs/relnotes.html
@@ -9,15 +9,31 @@
<H1>Release Notes</H1>
<p>
+Mesa uses an even/odd version number scheme like the Linux kernel.
+Odd numbered versions (such as 6.5) designate new developmental releases.
+Even numbered versions (such as 6.4) designate stable releases.
+</p>
+
+
+<p>
The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
+<LI><A HREF="relnotes-6.5.2.html">6.5.2 release notes</A>
<LI><A HREF="relnotes-6.5.1.html">6.5.1 release notes</A>
-<LI><A HREF="RELNOTES-6.5">RELNOTES-6.5</A>
-<LI><A HREF="RELNOTES-6.4.2">RELNOTES-6.4.2</A>
-<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.5.html">6.5 release notes</A>
+<LI><A HREF="relnotes-6.4.2.html">6.4.2 release notes</A>
+<LI><A HREF="relnotes-6.4.1.html">6.4.1 release notes</A>
+<LI><A HREF="relnotes-6.4.html">6.4 release notes</A>
+</UL
+
+<p>
+Versions of Mesa prior to 6.4 are summarized in the
+<a href="versions.html">versions file</a> and the following release notes.
+</p>
+
+<UL>
<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
diff --git a/docs/sourcedocs.html b/docs/sourcedocs.html
index a5248d988d7..90538af5cf0 100644
--- a/docs/sourcedocs.html
+++ b/docs/sourcedocs.html
@@ -11,11 +11,22 @@
<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.
+produce cross-referenced documentation from the Mesa source code.
+</p>
+
+<p>
+The Doxygen configuration files and generated files are not included
+in the normal Mesa distribution (they're very large).
+To generate Doxygen documentation, download Mesa from CVS, change to
+the <code>doxygen</code> directory and run <code>make</code>.
</P>
+<p>
+For an example of Doxygen usage in Mesa, see a recent source file
+such as <a href="http://webcvs.freedesktop.org/mesa/Mesa/src/mesa/main/bufferobj.c?view=markup" target="_parent">bufferobj.c</a>.
+</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
diff --git a/docs/versions.html b/docs/versions.html
index ad31a548dd3..84b40fd2158 100644
--- a/docs/versions.html
+++ b/docs/versions.html
@@ -8,6 +8,11 @@
<body bgcolor="#eeeeee">
+<B>
+NOTE: Changes for Mesa 6.4 and later are documented in the corresponding
+<a href="relnotes.html">release notes</a> file.
+</B>
+
<H1>Mesa Version History</H1>
@@ -1641,172 +1646,10 @@ Bug fixes:
</ul>
-<h2><a name="6.4">6.4 October 24, 2005</h2>
-New:
-<ul>
-<li>Added a fast XOR line drawing function in Xlib driver
-<li>Added support for GL_ARB_texture_mirrored_repeat to savage driver (supported only on Savage4 hardware).
-</ul>
-Changes:
-<ul>
-<li>Mesa now packaged in three parts: Library, Demos and GLUT
-</ul>
-Bug fixes:
-<ul>
-<li>GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig
-<li>Some files were present multiple times in the 6.3.2 tarballs
-<li>r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207)
-<li>glxgears_fbconfig demo didn't work (bug 4237)
-<li>fixed bug when bilinear sampling 2d textures with borders
-<li>glXCreatePbuffer() could segfault instead of returning 0 (bug 4235)
-<li>fixed undefined frexp and rand in X.org libGLcore.a (bug 4242)
-<li>fixed a few problems with proxy color tables (bug 4270)
-<li>fixed precision problem in Z clearing (bug 4395)
-<li>glBitmap, glDraw/CopyPixels mistakenly generated selection hits
-<li>fixed potential segfault caused by reading pixels outside
- of renderbuffer bounds
-<li>glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB
-<li>fixed memory corruption bug involving software alpha buffers
-<li>glReadPixels clipped by window bounds was sometimes broken
-<li>glDraw/CopyPixels of stencil data ignored the stencil write mask
-<li>glReadPixels from a texture bound to a framebuffer object didn't work
-<li>glIsRender/FramebufferEXT weren't totally correct
-<li>fixed a number of point size attenuation/fade bugs
-<li>fixed glFogCoord bug 4729
-<li>GLX encoding for transpose matrix functions was broken
-<li>fixed broken fragment program KIL and SWZ instructions
-<li>fragment programs that wrote result.depth.z didn't work
-</ul>
-
-
-<h2><a name="6.4.1">6.4.1 November 30, 2005</h2>
-Bug fixes:
-<ul>
-<li>redefining a vertex program string didn't take effect in TNL module
-<li>fixed occasional segfault upon vertex/fragment parsing error
-<li>vertex program LIT instruction didn't handle 0^0=1 correctly
-<li>fragment program fog option didn't work with glDrawPixels, glBitmap
-<li>USE_MGL_NAMESPACE didn't work for x86-64
-<li>OSMesa demos were missing from previous release tarballs
-<li>fixed problem with float->ushort conversion in glClear (bug 4992)
-<li>popping of GL_EYE_PLANE texgen state was broken (bug 4996)
-<li>popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
-<li>fixed occasional triangle color interpolation problem on VMS
-<li>work around invalid free() call (bug 5131)
-<li>fixed BSD X server compilation problem by including stdint.h
-</ul>
-
-
-<h2><a name="6.4.2">6.4.2 February 2, 2006</h2>
-New:
-<ul>
-<li>added OSMesaColorClamp() function/feature
-<li>added wglGetExtensionStringARB() function
-</ul>
-Bug fixes:
-<ul>
-<li>fixed some problems when building on Windows
-<li>GLw header files weren't installed by installmesa script (bug 5396)
-<li>GL/glfbdev.h file was missing from tarballs
-<li>fixed TNL initialization bug which could lead to crash (bug 5791)
-</ul>
-
-
-<h2><a name="6.5">6.5 March 31, 2006</h2>
-New:
-<ul>
-<li>OpenGL Shading Language support through GL_ARB_shader_objects,
- GL_ARB_shading_language_100, GL_ARB_vertex_shader and
- GL_ARB_fragment_shader (done by Michal Krol)
-<li>GL_EXT_packed_depth_stencil extension
-<li>GL_EXT_timer_query extension
-<li>GL_EXT_framebuffer_blit extension
-<li>GL_ARB_half_float_pixel
-<li>reflect demo improved to support multiple windows
-<li>singlebuffer demo (shows no/little-flicker single-buffered rendering)
-<li>r200: enable GL_ARB_texture_env_crossbar, separate the texture
- sampling unit bits from the texture env combine enable bits
-<li>r200: add support for GL_ATI_fragment_shader
-<li>added fast XOR-mode line drawing optimization
-<li>radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
- and GL_EXT_fog_coord
-<li>MESA_GLX_ALPHA_BITS env var for xlib driver
-<li>many DRI driver updates (including screen rotation support
- for the Intel DRI driver)
-</ul>
-Changes:
-<ul>
-<li>removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
-<li>removed GL_SGIX/SGIS_pixel_texture extensions
-</ul>
-Bug fixes:
-<ul>
-<li>fixed glxcontextmodes.c datatype problem (bug 5835)
-<li>fixed aix-gcc build/install bugs (bug 5874)
-<li>fixed some bugs in texture env program generation
-<li>glXCopyContext() didn't handle texture object bindings properly
-<li>glXCopyContext() didn't copy all lighting state
-<li>fixed FreeBSD config (Pedro Giffuni)
-<li>fixed some minor framebuffer object bugs
-<li>replaced dprintf() with _glu_printf() in GLU (bug 6244)
-<li>fixed a number of thread safety bugs/regressions
-<li>fixed a number of GLU tesselator bugs (John Shell, bug 6339)
-<li>paletted texturing was broken w/ floating point palettes (K. Schultz)
-<li>lots of assorted framebuffer object bug fixes
-</ul>
-
-
-<h2><a name="6.5.1">6.5.1 September 15, 2006</h2>
-New:
-<ul>
-<li>Intel i965 DRI driver
-<li>GL_APPLE_vertex_array_object extension (Ian Romanick)
-<li>GL_EXT_texture_sRGB extension
-<li>GL_EXT_gpu_program_parameters (Ian Romanick)
-<li>"engine" demo
-<li>updated fbdev driver and GLUT for fbdev (Sean D'Epagnier)
-<li>many updates to the DRI drivers
-</ul>
-Changes:
-<ul>
-<li>The glVertexAttribARB functions no longer alias the conventional
- vertex attributes.
-<li>glxinfo program prints more info with -l option
-<li>GL_FRAGMENT_PROGRAM_NV and GL_FRAGMENT_PROGRAM_ARB are now
- compatible, in terms of glBindProgramARB()
-<li>The GL_ARB_vertex_program attribute <code>vertex.weight</code> is now
- accepted by the parser, even though the GL_ARB_vertex_blend and
- GL_EXT_vertex_weighting extensions aren't supported.
- Allows Warcraft to run.
-</ul>
-Bug fixes:
-<ul>
-<li>fixed broken texture border handling for depth textures (bug 6498)
-<li>removed the test for duplicated framebuffer attachments, per
- version 117 of the GL_EXT_framebuffer_object specification
-<li>fixed a few render-to-texture bugs, including render to depth texture
-<li>clipping of lines against user-defined clip planes was broken (6512)
-<li>assembly language dispatch for SPARC was broken (bug 6484)
-<li>assorted compilation fixes on various Unix platforms (Dan Schikore)
-<li>glPopAttrib could restore an invalid value for GL_DRAW_BUFFER
-<li>assorted minor fixes for 16 and 32 bit/channel modes
-<li>fixed assorted bugs in texture compression paths
-<li>fixed indirect rendering vertex array crashes (bug 6863)
-<li>glDrawPixels GL_INDEX_OFFSET didn't always work
-<li>fixed convolution memory leak (bug 7077)
-<li>rectangular depth textures didn't work
-<li>invalid mode to glBegin didn't generate an error (bug 7142)
-<li>'normalized' parameter to glVertexAttribPointerARB didn't work
-<li>disable bogus GLX_SGI_video_sync extension in xlib driver
-<li>fixed R128 driver locking bug (Martijn van Oosterhout)
-<li>using evaluators with vertex programs caused crashes (bug 7564)
-<li>fragment.position wasn't set correctly for point/line primitives
-<li>fixed parser bug for scalar sources for GL_NV_fragment_program
-<li>max fragment program length was incorrectly 128, now 1024
-<li>writes to result.depth in fragment programs weren't clamped to [0,1]
-<li>fixed potential dangling pointer bug in glBindProgram()
-<li>fixed some memory leaks (and potential crashes) in Xlib driver
-</ul>
+<B>
+NOTE: Changes for Mesa 6.4 and later are documented in the corresponding
+<a href="relnotes.html">release notes</a> file.
+</B>
</body>
diff --git a/doxygen/.cvsignore b/doxygen/.cvsignore
deleted file mode 100644
index 1b0edf90a6d..00000000000
--- a/doxygen/.cvsignore
+++ /dev/null
@@ -1,15 +0,0 @@
-*.tag
-agpgart
-array_cache
-core
-core_subset
-math
-math_subset
-miniglx
-radeon_subset
-radeondrm
-radeonfb
-swrast
-swrast_setup
-tnl
-tnl_dd
diff --git a/doxygen/Makefile b/doxygen/Makefile
deleted file mode 100644
index 055b17386df..00000000000
--- a/doxygen/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-
-default: full
-
-all: full subset
-
-%.tag: %.doxy
- doxygen $<
-
-FULL = \
- main.doxy \
- math.doxy \
- array_cache.doxy \
- glapi.doxy \
- shader.doxy \
- swrast.doxy \
- swrast_setup.doxy \
- tnl.doxy \
- tnl_dd.doxy
-
-full: $(FULL:.doxy=.tag)
- $(foreach FILE,$(FULL),doxygen $(FILE);)
-
-SUBSET = \
- main.doxy \
- math.doxy \
- miniglx.doxy
-
-subset: $(SUBSET:.doxy=.tag)
- $(foreach FILE,$(SUBSET),doxygen $(FILE);)
-
-clean:
- rm -rf $(FULL:.doxy=) $(SUBSET:.doxy=)
- rm -rf *.tag
diff --git a/doxygen/README b/doxygen/README
deleted file mode 100644
index 9b820041d1b..00000000000
--- a/doxygen/README
+++ /dev/null
@@ -1,10 +0,0 @@
-
-This directory is for doxygen (a source code documentation system).
-
-See http://www.doxygen.org/ for more info.
-
-Either run 'make' (Unix) or 'doxy.bat' (Windows) to run doxygen
-and generate souce code documentation.
-
-Then, load either doxygen/main/index.html or doxygen/core_subset/index.html into
-your web browser.
diff --git a/doxygen/array_cache.doxy b/doxygen/array_cache.doxy
deleted file mode 100644
index ae0b1fa1391..00000000000
--- a/doxygen/array_cache.doxy
+++ /dev/null
@@ -1,50 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa array_cache"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/array_cache/
-FILE_PATTERNS = *.c \
- *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = array_cache
-#---------------------------------------------------------------------------
-# 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 = main.tag=../core \
- math.tag=../math \
- shader.tag=../shader \
- swrast.tag=../swrast \
- swrast_setup.tag=../swrast_setup \
- tnl.tag=../tnl \
- tnl_dd.tag=../tnl_dd
-GENERATE_TAGFILE = array_cache.tag
diff --git a/doxygen/common.doxy b/doxygen/common.doxy
deleted file mode 100644
index 1b5e5fece60..00000000000
--- a/doxygen/common.doxy
+++ /dev/null
@@ -1,1153 +0,0 @@
-# Doxyfile 1.3.8
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = Mesa
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = 6.2
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY =
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of source
-# files, where putting all generated files in the same directory would otherwise
-# cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
-# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
-# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
-# Swedish, and Ukrainian.
-
-OUTPUT_LANGUAGE = English
-
-# This tag can be used to specify the encoding used in the generated output.
-# The encoding is not always determined by the language that is chosen,
-# but also whether or not the output is meant for Windows or non-Windows users.
-# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
-# forces the Windows encoding (this is the default for the Windows binary),
-# whereas setting the tag to NO uses a Unix-style encoding (the default for
-# all platforms other than Windows).
-
-USE_WINDOWS_ENCODING = NO
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is used
-# as the annotated text. Otherwise, the brief description is used as-is. If left
-# blank, the following values are used ("$name" is automatically replaced with the
-# name of the entity): "The $name class" "The $name widget" "The $name file"
-# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
-# members of a class in the documentation of that class as if those members were
-# ordinary class members. Constructors, destructors and assignment operators of
-# the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like the Qt-style comments (thus requiring an
-# explicit @brief command for a brief description.
-
-JAVADOC_AUTOBRIEF = YES
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP = YES
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
-# only. Doxygen will then generate output that is more tailored for Java.
-# For instance, namespaces will be presented as packages, qualified scopes
-# will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text.
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT =
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
-# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
-
-FILE_PATTERNS =
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
-# that are symbolic links (a Unix filesystem feature) are excluded from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-
-EXCLUDE_PATTERNS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES (the default)
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES (the default)
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER = header.html
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_PREDEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH = ../include
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse the
-# parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = NO
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or
-# super classes. Setting the tag to NO turns the diagrams off. Note that this
-# option is superseded by the HAVE_DOT option below. This is only a fallback. It is
-# recommended to install and use dot, since it yields more powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
-# generate a call dependency graph for every global function or class method.
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found on the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_WIDTH = 1024
-
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_HEIGHT = 1024
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes that
-# lay further from the root node will be omitted. Note that setting this option to
-# 1 or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that a graph may be further truncated if the graph's image dimensions are
-# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT).
-# If 0 is used for the depth value (the default), the graph is not depth-constrained.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
diff --git a/doxygen/core_subset.doxy b/doxygen/core_subset.doxy
deleted file mode 100644
index 35faf565dc4..00000000000
--- a/doxygen/core_subset.doxy
+++ /dev/null
@@ -1,226 +0,0 @@
-# Doxyfile 0.1
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa Main"
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY =
-OUTPUT_LANGUAGE = English
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = 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 = YES
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-VERBATIM_HEADERS = YES
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = NO
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = NO
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-ALIASES =
-ENABLED_SECTIONS = subset
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = NO
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = NO
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/main/
-FILE_PATTERNS = \
- accum.h \
- attrib.h \
- blend.[ch] \
- buffers.[ch] \
- dd.h \
- debug.h \
- depth.h \
- dlist.h \
- context.[ch] \
- config.h \
- colormac.h \
- colortab.h \
- enable.h \
- enums.h \
- eval.h \
- extensions.h \
- feedback.[ch] \
- fog.h \
- get.h \
- glheader.h \
- glthread.h \
- hash.[ch] \
- hint.h \
- histogram.h \
- image.[ch] \
- imports.[ch] \
- lines.[ch] \
- light.h \
- matrix.[ch] \
- macros.h \
- mmath.h \
- mtypes.h \
- pixel.h \
- points.[ch] \
- polygon.[ch] \
- rastpos.[ch] \
- simple_list.h \
- state.[ch] \
- stencil.[ch] \
- subset_*.c \
- texformat.h \
- teximage.h \
- texstate.h \
- texstore.h \
- texobj.[ch] \
- texutil_tmp.h \
- varray.h
-RECURSIVE = NO
-EXCLUDE =
-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 = YES
-INLINE_SOURCES = NO
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = 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 = core_subset
-HTML_HEADER = header_subset.html
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-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 = NO
-LATEX_OUTPUT =
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-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_EXTENSION =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../include/
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES = \
- math_subset.tag=../math_subset \
- miniglx.tag=../miniglx
-GENERATE_TAGFILE = core_subset.tag
-ALLEXTERNALS = NO
-PERL_PATH =
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = NO
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-TEMPLATE_RELATIONS = YES
-HIDE_UNDOC_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-GRAPHICAL_HIERARCHY = YES
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME =
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH =
-EXT_DOC_PATHS =
diff --git a/doxygen/doxy.bat b/doxygen/doxy.bat
deleted file mode 100644
index 2d8b567ce3a..00000000000
--- a/doxygen/doxy.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-doxygen tnl_dd.doxy
-doxygen array_cache.doxy
-doxygen math.doxy
-doxygen swrast.doxy
-doxygen swrast_setup.doxy
-doxygen tnl.doxy
-doxygen core.doxy
-doxygen glapi.doxy
-doxygen shader.doxy
-
-echo Building again, to resolve tags
-doxygen tnl_dd.doxy
-doxygen array_cache.doxy
-doxygen math.doxy
-doxygen swrast.doxy
-doxygen swrast_setup.doxy
-doxygen tnl.doxy
-doxygen glapi.doxy
-doxygen shader.doxy
diff --git a/doxygen/glapi.doxy b/doxygen/glapi.doxy
deleted file mode 100644
index eafc2a109ad..00000000000
--- a/doxygen/glapi.doxy
+++ /dev/null
@@ -1,49 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa GL API dispatcher"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/glapi/
-FILE_PATTERNS = *.c *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = glapi
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../include/
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES = main.tag=../core \
- math.tag=../math \
- tnl_dd.tag=../tnl_dd \
- swrast.tag=../swrast \
- swrast_setup.tag=../swrast_setup \
- tnl.tag=../tnl \
- array_cache.tag=array_cache
-GENERATE_TAGFILE = swrast.tag
diff --git a/doxygen/header.html b/doxygen/header.html
deleted file mode 100644
index 5ca2763e0df..00000000000
--- a/doxygen/header.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<html>
-<head>
-<title>Mesa Source Code Documentation</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-<div class="qindex">
-<a class="qindex" href="../main/index.html">core</a> |
-<a class="qindex" href="../glapi/index.html">glapi</a> |
-<a class="qindex" href="../array_cache/index.html">array_cache</a> |
-<a class="qindex" href="../math/index.html">math</a> |
-<a class="qindex" href="../shader/index.html">shader</a> |
-<a class="qindex" href="../swrast/index.html">swrast</a> |
-<a class="qindex" href="../swrast_setup/index.html">swrast_setup</a> |
-<a class="qindex" href="../tnl/index.html">tnl</a> |
-<a class="qindex" href="../tnl_dd/index.html">tnl_dd</a>
-</div>
diff --git a/doxygen/header_subset.html b/doxygen/header_subset.html
deleted file mode 100644
index e7f001060ea..00000000000
--- a/doxygen/header_subset.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head><title>Mesa Source Code Documentation</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-<div class="qindex">
-<a class="qindex" href="../core_subset/index.html">Mesa Core</a> |
-<a class="qindex" href="../math_subset/index.html">math</a> |
-<a class="qindex" href="../miniglx/index.html">MiniGLX</a> |
-<a class="qindex" href="../radeon_subset/index.html">radeon_subset</a>
-</div>
diff --git a/doxygen/main.doxy b/doxygen/main.doxy
deleted file mode 100644
index 3cb05967aa2..00000000000
--- a/doxygen/main.doxy
+++ /dev/null
@@ -1,50 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa Main"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/main/
-FILE_PATTERNS = *.c *.h
-RECURSIVE = NO
-EXCLUDE = ../src/glapitemp.h ../src/glapioffsets.h
-EXCLUDE_PATTERNS = subset_*
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = main
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../include/
-INCLUDE_FILE_PATTERNS =
-PREDEFINED = _HAVE_FULL_GL=1
-EXPAND_AS_DEFINED = _glthread_DECLARE_STATIC_MUTEX
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES = tnl_dd.tag=../tnl_dd \
- array_cache.tag=../array_cache \
- glapi.tag=../glapi \
- math.tag=../math \
- shader.tag=../shader \
- swrast.tag=../swrast \
- swrast_setup.tag=../swrast_setup \
- tnl.tag=../tnl
-GENERATE_TAGFILE = main.tag
diff --git a/doxygen/math.doxy b/doxygen/math.doxy
deleted file mode 100644
index 72ec2e3cd26..00000000000
--- a/doxygen/math.doxy
+++ /dev/null
@@ -1,49 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa math module"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/math/
-FILE_PATTERNS = *.c \
- *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = math
-#---------------------------------------------------------------------------
-# 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 = tnl_dd.tag=../tnl_dd \
- main.tag=../core \
- swrast.tag=../swrast \
- swrast_setup.tag=../swrast_setup \
- tnl.tag=../tnl \
- array_cache.tag=../array_cache
-GENERATE_TAGFILE = math.tag
diff --git a/doxygen/math_subset.doxy b/doxygen/math_subset.doxy
deleted file mode 100644
index 9f6e95ff62b..00000000000
--- a/doxygen/math_subset.doxy
+++ /dev/null
@@ -1,177 +0,0 @@
-# Doxyfile 0.1
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa math module"
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY = .
-OUTPUT_LANGUAGE = English
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = 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
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-VERBATIM_HEADERS = YES
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = NO
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = NO
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = YES
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = NO
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/math/
-FILE_PATTERNS = m_matrix.[ch]
-RECURSIVE = NO
-EXCLUDE =
-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
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = 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 = math_subset
-HTML_HEADER = header_subset.html
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-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 = NO
-LATEX_OUTPUT =
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-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_EXTENSION =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# 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 = core_subset.tag=../core_subset
-GENERATE_TAGFILE = math_subset.tag
-ALLEXTERNALS = NO
-PERL_PATH =
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-TEMPLATE_RELATIONS = YES
-HIDE_UNDOC_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-GRAPHICAL_HIERARCHY = YES
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME =
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH =
-EXT_DOC_PATHS =
diff --git a/doxygen/miniglx.doxy b/doxygen/miniglx.doxy
deleted file mode 100644
index 61c376caf20..00000000000
--- a/doxygen/miniglx.doxy
+++ /dev/null
@@ -1,179 +0,0 @@
-# Doxyfile 0.1
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "MiniGLX"
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY =
-OUTPUT_LANGUAGE = English
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = 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 = YES
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-VERBATIM_HEADERS = NO
-SHOW_INCLUDE_FILES = NO
-JAVADOC_AUTOBRIEF = NO
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = NO
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = NO
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = NO
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/glx/mini/ ../include/GL/miniglx.h
-FILE_PATTERNS = *.h *.c
-RECURSIVE = NO
-EXCLUDE = ../src/glx/mini/glapi.c
-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
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = 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 = miniglx
-HTML_HEADER = header_subset.html
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-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 = NO
-LATEX_OUTPUT =
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-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_EXTENSION =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../include/
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES = \
- core_subset.tag=../core_subset \
- math_subset.tag=../math_subset
-GENERATE_TAGFILE = miniglx.tag
-ALLEXTERNALS = NO
-PERL_PATH =
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = NO
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-TEMPLATE_RELATIONS = YES
-HIDE_UNDOC_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-GRAPHICAL_HIERARCHY = YES
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME =
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH =
-EXT_DOC_PATHS =
diff --git a/doxygen/radeon_subset.doxy b/doxygen/radeon_subset.doxy
deleted file mode 100644
index fb9d0e9535a..00000000000
--- a/doxygen/radeon_subset.doxy
+++ /dev/null
@@ -1,203 +0,0 @@
-# Doxyfile 0.1
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Radeon Subset Driver"
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY =
-OUTPUT_LANGUAGE = English
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = 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 = YES
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-VERBATIM_HEADERS = NO
-SHOW_INCLUDE_FILES = NO
-JAVADOC_AUTOBRIEF = NO
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = NO
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = NO
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = NO
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = \
- ../src/mesa/drivers/dri/common/mm.c \
- ../src/mesa/drivers/dri/common/mm.h \
- ../src/mesa/drivers/dri/radeon/radeon_context.c \
- ../src/mesa/drivers/dri/radeon/radeon_context.h \
- ../src/mesa/drivers/dri/radeon/radeon_ioctl.c \
- ../src/mesa/drivers/dri/radeon/radeon_ioctl.h \
- ../src/mesa/drivers/dri/radeon/radeon_lock.c \
- ../src/mesa/drivers/dri/radeon/radeon_lock.h \
- ../src/mesa/drivers/dri/radeon/radeon_screen.c \
- ../src/mesa/drivers/dri/radeon/radeon_screen.h \
- ../src/mesa/drivers/dri/radeon/radeon_state.c \
- ../src/mesa/drivers/dri/radeon/radeon_state.h \
- ../src/mesa/drivers/dri/radeon/radeon_state_init.c \
- ../src/mesa/drivers/dri/radeon/radeon_subset.h \
- ../src/mesa/drivers/dri/radeon/radeon_subset_bitmap.c \
- ../src/mesa/drivers/dri/radeon/radeon_subset_readpix.c \
- ../src/mesa/drivers/dri/radeon/radeon_subset_select.c \
- ../src/mesa/drivers/dri/radeon/radeon_subset_tex.c \
- ../src/mesa/drivers/dri/radeon/radeon_subset_vtx.c \
- ../src/mesa/drivers/dri/radeon/radeon_tcl.h \
- ../src/mesa/drivers/dri/radeon/radeon_tex.h \
- ../src/mesa/drivers/dri/radeon/radeon_vtxfmt.h \
- ../src/mesa/drivers/dri/radeon/server
-FILE_PATTERNS = *.h *.c
-RECURSIVE = NO
-EXCLUDE =
-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
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = 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 = radeon_subset
-HTML_HEADER = header_subset.html
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-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 = NO
-LATEX_OUTPUT =
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-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_EXTENSION =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../include/
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES = \
- core_subset.tag=../core_subset \
- math_subset.tag=../math_subset \
- miniglx.tag=../miniglx
-GENERATE_TAGFILE = radeon_subset.tag
-ALLEXTERNALS = NO
-PERL_PATH =
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = NO
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-TEMPLATE_RELATIONS = YES
-HIDE_UNDOC_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-GRAPHICAL_HIERARCHY = YES
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME =
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH =
-EXT_DOC_PATHS =
diff --git a/doxygen/shader.doxy b/doxygen/shader.doxy
deleted file mode 100644
index 44fc7c4cfed..00000000000
--- a/doxygen/shader.doxy
+++ /dev/null
@@ -1,49 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa Vertex and Fragment Program code"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/shader/
-FILE_PATTERNS = *.c *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = shader
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../include/
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES = main.tag=../core \
- math.tag=../math \
- tnl_dd.tag=../tnl_dd \
- swrast.tag=../swrast \
- swrast_setup.tag=../swrast_setup \
- tnl.tag=../tnl \
- array_cache.tag=array_cache
-GENERATE_TAGFILE = swrast.tag
diff --git a/doxygen/swrast.doxy b/doxygen/swrast.doxy
deleted file mode 100644
index b0ba953676b..00000000000
--- a/doxygen/swrast.doxy
+++ /dev/null
@@ -1,48 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa Software Rasterization (swrast)"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/swrast/
-FILE_PATTERNS = *.c *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = swrast
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../include/
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES = main.tag=../core \
- math.tag=../math \
- tnl_dd.tag=../tnl_dd \
- swrast_setup.tag=../swrast_setup \
- tnl.tag=../tnl \
- array_cache.tag=array_cache
-GENERATE_TAGFILE = swrast.tag
diff --git a/doxygen/swrast_setup.doxy b/doxygen/swrast_setup.doxy
deleted file mode 100644
index 9e2d72e36e7..00000000000
--- a/doxygen/swrast_setup.doxy
+++ /dev/null
@@ -1,49 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa swrast_setup"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/swrast_setup/
-FILE_PATTERNS = *.c \
- *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = swrast_setup
-#---------------------------------------------------------------------------
-# 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 = tnl_dd.tag=../tnl_dd \
- main.tag=../core \
- math.tag=../math \
- swrast.tag=../swrast \
- tnl.tag=../tnl \
- array_cache.tag=../array_cache
-GENERATE_TAGFILE = swrast_setup.tag
diff --git a/doxygen/tnl.doxy b/doxygen/tnl.doxy
deleted file mode 100644
index 67f992f11e8..00000000000
--- a/doxygen/tnl.doxy
+++ /dev/null
@@ -1,50 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa Transform and Lighting (tnl)"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/tnl/
-FILE_PATTERNS = *.c \
- *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = tnl
-#---------------------------------------------------------------------------
-# 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 = tnl_dd.tag=../tnl \
- main.tag=../core \
- math.tag=../math \
- shader.tag=../shader \
- swrast.tag=../swrast \
- swrast_setup.tag=swrast_setup \
- array_cache.tag=array_cache
-GENERATE_TAGFILE = tnl.tag
diff --git a/doxygen/tnl_dd.doxy b/doxygen/tnl_dd.doxy
deleted file mode 100644
index b7bd6e97440..00000000000
--- a/doxygen/tnl_dd.doxy
+++ /dev/null
@@ -1,49 +0,0 @@
-# Doxyfile 0.1
-
-@INCLUDE = common.doxy
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesa tnl_dd"
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../src/mesa/tnl_dd/
-FILE_PATTERNS = *.c *.h
-RECURSIVE = YES
-EXCLUDE =
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-HTML_OUTPUT = tnl_dd
-#---------------------------------------------------------------------------
-# 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 = main.tag=../core \
- math.tag=../math \
- shader.tag=../shader \
- swrast.tag=../swrast \
- swrast_setup.tag=../swrast_setup \
- tnl.tag=../tnl \
- array_cache.tag=array_cache
-GENERATE_TAGFILE = tnl_dd.tag
diff --git a/include/GL/gl.h b/include/GL/gl.h
index 6d706d67298..78a00aeb8b3 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -2162,8 +2162,8 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
#define GL_DEBUG_ASSERT_MESA 0x875B
GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void);
-GLAPI GLvoid APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
-GLAPI GLvoid APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+GLAPI void APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
GLsizei *length, GLcharARB *debugLog);
GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
@@ -2173,37 +2173,6 @@ GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType,
/*
- * ???. GL_MESA_trace
- * XXX obsolete
- */
-#ifndef GL_MESA_trace
-#define GL_MESA_trace 1
-
-#define GL_TRACE_ALL_BITS_MESA 0xFFFF
-#define GL_TRACE_OPERATIONS_BIT_MESA 0x0001
-#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0002
-#define GL_TRACE_ARRAYS_BIT_MESA 0x0004
-#define GL_TRACE_TEXTURES_BIT_MESA 0x0008
-#define GL_TRACE_PIXELS_BIT_MESA 0x0010
-#define GL_TRACE_ERRORS_BIT_MESA 0x0020
-#define GL_TRACE_MASK_MESA 0x8755
-#define GL_TRACE_NAME_MESA 0x8756
-
-GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask );
-GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask );
-GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName );
-GLAPI void GLAPIENTRY glEndTraceMESA( void );
-GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask );
-GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment );
-GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment );
-
-#endif /* GL_MESA_trace */
-
-
-/*
* ???. GL_MESA_packed_depth_stencil
* XXX obsolete
*/
diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h
index 2e6558def1a..7416d5372cd 100644
--- a/include/GL/gl_mangle.h
+++ b/include/GL/gl_mangle.h
@@ -274,7 +274,6 @@
#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)
@@ -302,7 +301,6 @@
#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)
@@ -312,7 +310,6 @@
#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)
@@ -781,7 +778,6 @@
#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)
@@ -923,6 +919,7 @@
#define glRectsv MANGLE(Rectsv)
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
+#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT)
#define glRenderMode MANGLE(RenderMode)
#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
@@ -1022,6 +1019,7 @@
#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX)
#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX)
#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX)
+#define glStencilClearTagEXT MANGLE(StencilClearTagEXT)
#define glStencilFunc MANGLE(StencilFunc)
#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI)
#define glStencilFuncSeparate MANGLE(StencilFuncSeparate)
@@ -1140,12 +1138,6 @@
#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)
@@ -1183,10 +1175,16 @@
#define glUniform4iv MANGLE(Uniform4iv)
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
+#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
+#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
+#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
+#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
+#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
+#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
#define glUnmapBufferARB MANGLE(UnmapBufferARB)
#define glUnmapBuffer MANGLE(UnmapBuffer)
diff --git a/include/GL/glx_mangle.h b/include/GL/glx_mangle.h
index d0b47d94e73..4439a96b5d2 100644
--- a/include/GL/glx_mangle.h
+++ b/include/GL/glx_mangle.h
@@ -1,21 +1,25 @@
/*
* 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.
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@@ -48,6 +52,28 @@
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
+/* GLX 1.2 */
+#define glXGetCurrentDisplay mglXGetCurrentDisplay
+
+/* GLX 1.3 */
+#define glXChooseFBConfig mglXChooseFBConfig
+#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
+#define glXGetFBConfigs mglXGetFBConfigs
+#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
+#define glXCreateWindow mglXCreateWindow
+#define glXDestroyWindow mglXDestroyWindow
+#define glXCreatePixmap mglXCreatePixmap
+#define glXDestroyPixmap mglXDestroyPixmap
+#define glXCreatePbuffer mglXCreatePbuffer
+#define glXDestroyPbuffer mglXDestroyPbuffer
+#define glXQueryDrawable mglXQueryDrawable
+#define glXCreateNewContext mglXCreateNewContext
+#define glXMakeContextCurrent mglXMakeContextCurrent
+#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
+#define glXQueryContext mglXQueryContext
+#define glXSelectEvent mglXSelectEvent
+#define glXGetSelectedEvent mglXGetSelectedEvent
+
/* GLX 1.4 */
#define glXGetProcAddress mglXGetProcAddress
diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h
index d5cbd3b2a5c..ca3cf5be572 100644
--- a/include/GL/internal/glcore.h
+++ b/include/GL/internal/glcore.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */
#ifndef __gl_core_h_
#define __gl_core_h_
@@ -37,9 +36,7 @@
**
*/
-#ifndef XFree86LOADER
#include <sys/types.h>
-#endif
#ifdef CAPI
#undef CAPI
diff --git a/include/GLES/egl.h b/include/GLES/egl.h
deleted file mode 100644
index f18c86ca62d..00000000000
--- a/include/GLES/egl.h
+++ /dev/null
@@ -1,324 +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
-#define EGL_VERSION_1_1 1
-
-/*
-** 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_SCREEN_POSITION_GRANULARITY_MESA 0x4004
-#define EGL_MODE_ID_MESA 0x4005
-#define EGL_REFRESH_RATE_MESA 0x4006
-#define EGL_OPTIMAL_MESA 0x4007
-#define EGL_INTERLACED_MESA 0x4008
-#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 eglShowScreenSurfaceMESA(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 */
-
-
-/* XXX this is preliminary! */
-#ifndef EGL_VERSION_1_2
-#define EGL_VERSION_1_2 1
-
-typedef int EGLenum;
-typedef int EGLClientBuffer;
-
-#define EGL_DISPLAY_SCALING 10000
-#define EGL_UNKNOWN ((EGLint)-1)
-
-#define EGL_OPENGL_ES_BIT 0x1
-#define EGL_OPENVG_BIT 0x2
-
-#define EGL_OPENGL_ES_API 0x30A0
-#define EGL_OPENVG_API 0x30A1
-
-#define EGL_LUMINANCE_SIZE 0x303D
-#define EGL_ALPHA_MASK_SIZE 0x303E
-#define EGL_COLOR_BUFFER_TYPE 0x303F
-#define EGL_RENDERABLE_TYPE 0x3040
-
-#define EGL_SINGLE_BUFFER 0x3085
-#define EGL_RENDER_BUFFER 0x3086
-#define EGL_COLORSPACE 0x3087
-#define EGL_ALPHA_FORMAT 0x3088
-#define EGL_COLORSPACE_sRGB 0x3089
-#define EGL_COLORSPACE_LINEAR 0x308A
-#define EGL_ALPHA_FORMAT_NONPRE 0x308B
-#define EGL_ALPHA_FORMAT_PRE 0x308C
-#define EGL_CLIENT_APIS 0x308D
-#define EGL_RGB_BUFFER 0x308E
-#define EGL_LUMINANCE_BUFFER 0x308F
-#define EGL_HORIZONTAL_RESOLUTION 0x3090
-#define EGL_VERTICAL_RESOLUTION 0x3091
-#define EGL_PIXEL_ASPECT_RATIO 0x3092
-#define EGL_SWAP_BEHAVIOR 0x3093
-#define EGL_BUFFER_PRESERVED 0x3094
-#define EGL_BUFFER_DESTROYED 0x3095
-#define EGL_OPENVG_IMAGE 0x3096
-#define EGL_CONTEXT_CLIENT_TYPE 0x3097
-
-GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api);
-GLAPI EGLenum APIENTRY eglQueryAPI(void);
-GLAPI EGLBoolean APIENTRY eglWaitClient(void);
-GLAPI EGLBoolean APIENTRY eglReleaseThread(void);
-GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
-
-#endif /* EGL_VERSION_1_2 */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _EGL_H */
diff --git a/include/GLES/egltypes.h b/include/GLES/egltypes.h
deleted file mode 100644
index 65cba8d5793..00000000000
--- a/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/progs/demos/Makefile b/progs/demos/Makefile
index 43d0f17c85f..4623d6c8d91 100644
--- a/progs/demos/Makefile
+++ b/progs/demos/Makefile
@@ -25,6 +25,7 @@ PROGS = \
fire \
fogcoord \
fplight \
+ fslight \
gamma \
gearbox \
gears \
@@ -47,6 +48,7 @@ PROGS = \
renormal \
shadowtex \
singlebuffer \
+ streaming_rect \
spectex \
spriteblast \
stex3d \
diff --git a/progs/demos/Windows/all.dsp b/progs/demos/Windows/all.dsp
deleted file mode 100644
index b47283c5882..00000000000
--- a/progs/demos/Windows/all.dsp
+++ /dev/null
@@ -1,101 +0,0 @@
-# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=all - 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 "all.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 "all.mak" CFG="all - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "all - 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 "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# 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 /subsystem:windows /machine:I386
-# ADD 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 /subsystem:windows /machine:I386
-
-!ELSEIF "$(CFG)" == "all - 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 "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# 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 /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD 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 /subsystem:windows /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "all - Win32 Release"
-# Name "all - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# 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/progs/demos/Windows/bounce.dsp b/progs/demos/Windows/bounce.dsp
deleted file mode 100644
index 0510e77d994..00000000000
--- a/progs/demos/Windows/bounce.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="bounce" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=bounce - 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 "bounce.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 "bounce.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "bounce - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "bounce - 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)" == "bounce - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../bounce.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "bounce - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../bounce.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "bounce - Win32 Release"
-# Name "bounce - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\bounce.c
-# 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/progs/demos/Windows/clearspd.dsp b/progs/demos/Windows/clearspd.dsp
deleted file mode 100644
index 440c7ae64e9..00000000000
--- a/progs/demos/Windows/clearspd.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="clearspd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=clearspd - 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 "clearspd.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 "clearspd.mak" CFG="clearspd - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "clearspd - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "clearspd - 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)" == "clearspd - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../clearspd.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "clearspd - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../clearspd.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "clearspd - Win32 Release"
-# Name "clearspd - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\clearspd.c
-# 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/progs/demos/Windows/cubemap.dsp b/progs/demos/Windows/cubemap.dsp
deleted file mode 100644
index 220a3a0df61..00000000000
--- a/progs/demos/Windows/cubemap.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="cubemap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=cubemap - 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 "cubemap.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 "cubemap.mak" CFG="cubemap - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cubemap - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "cubemap - 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)" == "cubemap - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../cubemap.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "cubemap - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../cubemap.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "cubemap - Win32 Release"
-# Name "cubemap - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\cubemap.c
-# 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/progs/demos/Windows/demos.dsw b/progs/demos/Windows/demos.dsw
deleted file mode 100644
index 2d6f629e07a..00000000000
--- a/progs/demos/Windows/demos.dsw
+++ /dev/null
@@ -1,782 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "all"=".\all.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name bounce
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name clearspd
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name cubemap
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name drawpix
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name fire
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gears
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name geartrain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glinfo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gloss
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gltestperf
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glutfx
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name ipers
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name isosurf
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name lodbias
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name morph3d
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name multiarb
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name occlude
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name osdemo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name paltex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name pixeltex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name pointblast
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name rain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name ray
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name readpix
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name reflect
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name renormal
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name shadowtex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name spectex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name stex3d
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name teapot
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name terrain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tessdemo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texcyl
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texdown
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texenv
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texobj
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name trispd
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tunnel
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tunnel2
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name winpos
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name spriteblast
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "bounce"=".\bounce.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "clearspd"=".\clearspd.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "cubemap"=".\cubemap.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "drawpix"=".\drawpix.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "fire"=".\fire.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gears"=".\gears.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "geartrain"=".\geartrain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "glinfo"=".\glinfo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gloss"=".\gloss.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gltestperf"=".\gltestperf.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "glut"="..\..\..\src\glut\glx\glut.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "glutfx"=".\glutfx.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "ipers"=".\ipers.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "isosurf"=".\isosurf.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "lodbias"=".\loadbias.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "morph3d"=".\morph3d.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "multiarb"=".\multiarb.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "occlude"=".\occlude.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "osdemo"=".\osdemo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "paltex"=".\paltex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "pixeltex"=".\pixeltex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "pointblast"=".\pointblast.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "rain"=".\rain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "ray"=".\ray.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "readpix"=".\readpix.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "reflect"=".\reflect.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "renormal"=".\renormal.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "shadowtex"=".\shadowtex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "spectex"=".\spectex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "spriteblast"=".\spriteblast.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "stex3d"=".\stex3d.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "teapot"=".\teapot.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terrain"=".\terrain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tessdemo"=".\tessdemo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texcyl"=".\texcyl.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texdown"=".\texdown.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texenv"=".\texenv.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texobj"=".\texobj.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "trispd"=".\trispd.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tunnel"=".\tunnel.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tunnel2"=".\tunnel2.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "winpos"=".\winpos.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/progs/demos/Windows/drawpix.dsp b/progs/demos/Windows/drawpix.dsp
deleted file mode 100644
index 57003e616b4..00000000000
--- a/progs/demos/Windows/drawpix.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="drawpix" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=drawpix - 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 "drawpix.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 "drawpix.mak" CFG="drawpix - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "drawpix - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "drawpix - 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)" == "drawpix - 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 "../" /I "../../../include" /I "../../util" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../drawpix.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "drawpix - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../drawpix.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "drawpix - Win32 Release"
-# Name "drawpix - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\drawpix.c
-# 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/progs/demos/Windows/fire.dsp b/progs/demos/Windows/fire.dsp
deleted file mode 100644
index f8a536d3349..00000000000
--- a/progs/demos/Windows/fire.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="fire" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=fire - 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 "fire.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 "fire.mak" CFG="fire - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "fire - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "fire - 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)" == "fire - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../fire.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "fire - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../fire.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "fire - Win32 Release"
-# Name "fire - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\fire.c
-# 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/progs/demos/Windows/gears.dsp b/progs/demos/Windows/gears.dsp
deleted file mode 100644
index 43a588dc68d..00000000000
--- a/progs/demos/Windows/gears.dsp
+++ /dev/null
@@ -1,112 +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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gears.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gears.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# 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=..\gears.c
-# 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/progs/demos/Windows/geartrain.dsp b/progs/demos/Windows/geartrain.dsp
deleted file mode 100644
index 8dee77de4d5..00000000000
--- a/progs/demos/Windows/geartrain.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="geartrain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=geartrain - 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 "geartrain.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 "geartrain.mak" CFG="geartrain - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "geartrain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "geartrain - 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)" == "geartrain - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../geartrain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "geartrain - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../geartrain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "geartrain - Win32 Release"
-# Name "geartrain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\geartrain.c
-# 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/progs/demos/Windows/glinfo.dsp b/progs/demos/Windows/glinfo.dsp
deleted file mode 100644
index d9d61eb424d..00000000000
--- a/progs/demos/Windows/glinfo.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="glinfo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glinfo - 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 "glinfo.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 "glinfo.mak" CFG="glinfo - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glinfo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glinfo - 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)" == "glinfo - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glinfo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glinfo - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glinfo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glinfo - Win32 Release"
-# Name "glinfo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\glinfo.c
-# 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/progs/demos/Windows/gloss.dsp b/progs/demos/Windows/gloss.dsp
deleted file mode 100644
index 402d291f4dc..00000000000
--- a/progs/demos/Windows/gloss.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="gloss" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gloss - 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 "gloss.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 "gloss.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gloss - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gloss - 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)" == "gloss - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gloss.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gloss - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gloss.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gloss - Win32 Release"
-# Name "gloss - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gloss.c
-# 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/progs/demos/Windows/gltestperf.dsp b/progs/demos/Windows/gltestperf.dsp
deleted file mode 100644
index e5066201522..00000000000
--- a/progs/demos/Windows/gltestperf.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="gltestperf" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gltestperf - 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 "gltestperf.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 "gltestperf.mak" CFG="gltestperf - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gltestperf - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gltestperf - 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)" == "gltestperf - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gltestperf.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gltestperf - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gltestperf.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gltestperf - Win32 Release"
-# Name "gltestperf - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gltestperf.c
-# 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/progs/demos/Windows/glutfx.dsp b/progs/demos/Windows/glutfx.dsp
deleted file mode 100644
index 90eca930d22..00000000000
--- a/progs/demos/Windows/glutfx.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="glutfx" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glutfx - 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 "glutfx.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 "glutfx.mak" CFG="glutfx - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glutfx - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glutfx - 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)" == "glutfx - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glutfx.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glutfx - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glutfx.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glutfx - Win32 Release"
-# Name "glutfx - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\glutfx.c
-# 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/progs/demos/Windows/ipers.dsp b/progs/demos/Windows/ipers.dsp
deleted file mode 100644
index 430f1b6258d..00000000000
--- a/progs/demos/Windows/ipers.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="ipers" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ipers - 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 "ipers.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 "ipers.mak" CFG="ipers - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ipers - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ipers - 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)" == "ipers - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ipers.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "ipers - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ipers.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "ipers - Win32 Release"
-# Name "ipers - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\ipers.c
-# 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/progs/demos/Windows/isosurf.dsp b/progs/demos/Windows/isosurf.dsp
deleted file mode 100644
index 1c59d40081e..00000000000
--- a/progs/demos/Windows/isosurf.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="isosurf" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=isosurf - 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 "isosurf.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 "isosurf.mak" CFG="isosurf - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "isosurf - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "isosurf - 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)" == "isosurf - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../isosurf.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "isosurf - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../isosurf.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "isosurf - Win32 Release"
-# Name "isosurf - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\isosurf.c
-# 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/progs/demos/Windows/loadbias.dsp b/progs/demos/Windows/loadbias.dsp
deleted file mode 100644
index ed51960e493..00000000000
--- a/progs/demos/Windows/loadbias.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="lodbias" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=lodbias - 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 "lodbias.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 "lodbias.mak" CFG="lodbias - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "lodbias - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "lodbias - 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)" == "lodbias - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../lodbias.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "lodbias - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../lodbias.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "lodbias - Win32 Release"
-# Name "lodbias - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\lodbias.c
-# 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/progs/demos/Windows/morph3d.dsp b/progs/demos/Windows/morph3d.dsp
deleted file mode 100644
index 247dbf03d7a..00000000000
--- a/progs/demos/Windows/morph3d.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="morph3d" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=morph3d - 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 "morph3d.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 "morph3d.mak" CFG="morph3d - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "morph3d - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "morph3d - 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)" == "morph3d - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../morph3d.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "morph3d - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../morph3d.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "morph3d - Win32 Release"
-# Name "morph3d - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\morph3d.c
-# 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/progs/demos/Windows/multiarb.dsp b/progs/demos/Windows/multiarb.dsp
deleted file mode 100644
index 57c32deb294..00000000000
--- a/progs/demos/Windows/multiarb.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="multiarb" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=multiarb - 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 "multiarb.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 "multiarb.mak" CFG="multiarb - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "multiarb - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "multiarb - 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)" == "multiarb - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../multiarb.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "multiarb - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../multiarb.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "multiarb - Win32 Release"
-# Name "multiarb - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\multiarb.c
-# 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/progs/demos/Windows/occlude.dsp b/progs/demos/Windows/occlude.dsp
deleted file mode 100644
index ca4afa579e1..00000000000
--- a/progs/demos/Windows/occlude.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="occlude" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=occlude - 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 "occlude.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 "occlude.mak" CFG="occlude - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "occlude - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "occlude - 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)" == "occlude - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../occlude.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "occlude - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../occlude.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "occlude - Win32 Release"
-# Name "occlude - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\occlude.c
-# 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/progs/demos/Windows/osdemo.dsp b/progs/demos/Windows/osdemo.dsp
deleted file mode 100644
index ccaa6d2b42a..00000000000
--- a/progs/demos/Windows/osdemo.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="osdemo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=osdemo - 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 "osdemo.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 "osdemo.mak" CFG="osdemo - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "osdemo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "osdemo - 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)" == "osdemo - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /machine:I386 /out:"../osdemo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "osdemo - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../osdemo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "osdemo - Win32 Release"
-# Name "osdemo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\osdemo.c
-# 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/progs/demos/Windows/paltex.dsp b/progs/demos/Windows/paltex.dsp
deleted file mode 100644
index efc63842115..00000000000
--- a/progs/demos/Windows/paltex.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="paltex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=paltex - 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 "paltex.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 "paltex.mak" CFG="paltex - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "paltex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "paltex - 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)" == "paltex - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../paltex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "paltex - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../paltex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "paltex - Win32 Release"
-# Name "paltex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\paltex.c
-# 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/progs/demos/Windows/pixeltex.dsp b/progs/demos/Windows/pixeltex.dsp
deleted file mode 100644
index d09f9f312cb..00000000000
--- a/progs/demos/Windows/pixeltex.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pixeltex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pixeltex - 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 "pixeltex.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 "pixeltex.mak" CFG="pixeltex - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pixeltex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pixeltex - 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)" == "pixeltex - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pixeltex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "pixeltex - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pixeltex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "pixeltex - Win32 Release"
-# Name "pixeltex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\pixeltex.c
-# 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/progs/demos/Windows/pointblast.dsp b/progs/demos/Windows/pointblast.dsp
deleted file mode 100644
index 7be695839fa..00000000000
--- a/progs/demos/Windows/pointblast.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pointblast" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pointblast - 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 "pointblast.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 "pointblast.mak" CFG="pointblast - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pointblast - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pointblast - 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)" == "pointblast - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pointblast.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "pointblast - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pointblast.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "pointblast - Win32 Release"
-# Name "pointblast - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\pointblast.c
-# 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/progs/demos/Windows/rain.dsp b/progs/demos/Windows/rain.dsp
deleted file mode 100644
index 7e380e66aaf..00000000000
--- a/progs/demos/Windows/rain.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="rain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=rain - 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 "rain.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 "rain.mak" CFG="rain - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "rain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "rain - 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)" == "rain - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../rain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "rain - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../rain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "rain - Win32 Release"
-# Name "rain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\rain.cxx
-# 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/progs/demos/Windows/ray.dsp b/progs/demos/Windows/ray.dsp
deleted file mode 100644
index dfa26e7755c..00000000000
--- a/progs/demos/Windows/ray.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="ray" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ray - 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 "ray.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 "ray.mak" CFG="ray - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ray - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ray - 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)" == "ray - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ray.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "ray - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ray.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "ray - Win32 Release"
-# Name "ray - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\ray.c
-# 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/progs/demos/Windows/readpix.dsp b/progs/demos/Windows/readpix.dsp
deleted file mode 100644
index 8097d10625b..00000000000
--- a/progs/demos/Windows/readpix.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="readpix" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=readpix - 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 "readpix.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 "readpix.mak" CFG="readpix - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "readpix - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "readpix - 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)" == "readpix - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../readpix.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "readpix - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../readpix.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "readpix - Win32 Release"
-# Name "readpix - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\readpix.c
-# 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/progs/demos/Windows/reflect.dsp b/progs/demos/Windows/reflect.dsp
deleted file mode 100644
index fa09700afe2..00000000000
--- a/progs/demos/Windows/reflect.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="reflect" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=reflect - 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 "reflect.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 "reflect.mak" CFG="reflect - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "reflect - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "reflect - 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)" == "reflect - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../reflect.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "reflect - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../reflect.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "reflect - Win32 Release"
-# Name "reflect - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\reflect.c
-# 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/progs/demos/Windows/renormal.dsp b/progs/demos/Windows/renormal.dsp
deleted file mode 100644
index 4d72e88d8ed..00000000000
--- a/progs/demos/Windows/renormal.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="renormal" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=renormal - 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 "renormal.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 "renormal.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "renormal - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "renormal - 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)" == "renormal - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../renormal.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "renormal - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../renormal.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "renormal - Win32 Release"
-# Name "renormal - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\renormal.c
-# 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/progs/demos/Windows/shadowtex.dsp b/progs/demos/Windows/shadowtex.dsp
deleted file mode 100644
index 419ec241386..00000000000
--- a/progs/demos/Windows/shadowtex.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="shadowtex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=shadowtex - 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 "shadowtex.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 "shadowtex.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "shadowtex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "shadowtex - 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)" == "shadowtex - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../shadowtex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "shadowtex - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../shadowtex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "shadowtex - Win32 Release"
-# Name "shadowtex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\shadowtex.c
-# 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/progs/demos/Windows/spectex.dsp b/progs/demos/Windows/spectex.dsp
deleted file mode 100644
index d1960b3d139..00000000000
--- a/progs/demos/Windows/spectex.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="spectex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spectex - 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 "spectex.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 "spectex.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "spectex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spectex - 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)" == "spectex - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spectex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "spectex - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spectex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "spectex - Win32 Release"
-# Name "spectex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\spectex.c
-# 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/progs/demos/Windows/spriteblast.dsp b/progs/demos/Windows/spriteblast.dsp
deleted file mode 100644
index 8a02ed50d30..00000000000
--- a/progs/demos/Windows/spriteblast.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="spriteblast" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spriteblast - 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 "spriteblast.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 "spriteblast.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "spriteblast - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spriteblast - 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)" == "spriteblast - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spriteblast.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "spriteblast - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spriteblast.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "spriteblast - Win32 Release"
-# Name "spriteblast - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\spriteblast.c
-# 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/progs/demos/Windows/stex3d.dsp b/progs/demos/Windows/stex3d.dsp
deleted file mode 100644
index 7c112d62ca8..00000000000
--- a/progs/demos/Windows/stex3d.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="stex3d" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=stex3d - 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 "stex3d.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 "stex3d.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "stex3d - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "stex3d - 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)" == "stex3d - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../stex3d.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "stex3d - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../stex3d.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "stex3d - Win32 Release"
-# Name "stex3d - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\stex3d.c
-# 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/progs/demos/Windows/teapot.dsp b/progs/demos/Windows/teapot.dsp
deleted file mode 100644
index 3260e635a4b..00000000000
--- a/progs/demos/Windows/teapot.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="teapot" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=teapot - 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 "teapot.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 "teapot.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "teapot - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "teapot - 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)" == "teapot - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapot.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "teapot - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapot.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "teapot - Win32 Release"
-# Name "teapot - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\teapot.c
-# 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/progs/demos/Windows/terrain.dsp b/progs/demos/Windows/terrain.dsp
deleted file mode 100644
index 9fe490db81e..00000000000
--- a/progs/demos/Windows/terrain.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="terrain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=terrain - 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 "terrain.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 "terrain.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "terrain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "terrain - 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)" == "terrain - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../terrain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "terrain - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../terrain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "terrain - Win32 Release"
-# Name "terrain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\terrain.c
-# 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/progs/demos/Windows/tessdemo.dsp b/progs/demos/Windows/tessdemo.dsp
deleted file mode 100644
index 61345c79e6a..00000000000
--- a/progs/demos/Windows/tessdemo.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="tessdemo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tessdemo - 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 "tessdemo.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 "tessdemo.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tessdemo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tessdemo - 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)" == "tessdemo - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tessdemo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tessdemo - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tessdemo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tessdemo - Win32 Release"
-# Name "tessdemo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tessdemo.c
-# 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/progs/demos/Windows/texcyl.dsp b/progs/demos/Windows/texcyl.dsp
deleted file mode 100644
index b227e02c297..00000000000
--- a/progs/demos/Windows/texcyl.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="texcyl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texcyl - 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 "texcyl.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 "texcyl.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texcyl - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texcyl - 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)" == "texcyl - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texcyl.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texcyl - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texcyl.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texcyl - Win32 Release"
-# Name "texcyl - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texcyl.c
-# 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/progs/demos/Windows/texdown.dsp b/progs/demos/Windows/texdown.dsp
deleted file mode 100644
index acea7666afc..00000000000
--- a/progs/demos/Windows/texdown.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="texdown" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texdown - 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 "texdown.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 "texdown.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texdown - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texdown - 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)" == "texdown - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texdown.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texdown - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texdown.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texdown - Win32 Release"
-# Name "texdown - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texdown.c
-# 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/progs/demos/Windows/texenv.dsp b/progs/demos/Windows/texenv.dsp
deleted file mode 100644
index 3eb7eecdb71..00000000000
--- a/progs/demos/Windows/texenv.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="texenv" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texenv - 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 "texenv.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 "texenv.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texenv - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texenv - 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)" == "texenv - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texenv.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texenv - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texenv.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texenv - Win32 Release"
-# Name "texenv - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texenv.c
-# 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/progs/demos/Windows/texobj.dsp b/progs/demos/Windows/texobj.dsp
deleted file mode 100644
index 5db5f2ee798..00000000000
--- a/progs/demos/Windows/texobj.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="texobj" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texobj - 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 "texobj.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 "texobj.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texobj - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texobj - 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)" == "texobj - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texobj.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texobj - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texobj.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texobj - Win32 Release"
-# Name "texobj - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texobj.c
-# 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/progs/demos/Windows/trispd.dsp b/progs/demos/Windows/trispd.dsp
deleted file mode 100644
index 7e27cf3d04b..00000000000
--- a/progs/demos/Windows/trispd.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="trispd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=trispd - 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 "trispd.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 "trispd.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "trispd - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "trispd - 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)" == "trispd - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../trispd.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "trispd - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../trispd.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "trispd - Win32 Release"
-# Name "trispd - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\trispd.c
-# 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/progs/demos/Windows/tunnel.dsp b/progs/demos/Windows/tunnel.dsp
deleted file mode 100644
index 965f109c33e..00000000000
--- a/progs/demos/Windows/tunnel.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="tunnel" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tunnel - 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 "tunnel.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 "tunnel.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tunnel - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tunnel - 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)" == "tunnel - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tunnel - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tunnel - Win32 Release"
-# Name "tunnel - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tunnel.c
-# 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/progs/demos/Windows/tunnel2.dsp b/progs/demos/Windows/tunnel2.dsp
deleted file mode 100644
index 3ae2800a04d..00000000000
--- a/progs/demos/Windows/tunnel2.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="tunnel2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tunnel2 - 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 "tunnel2.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 "tunnel2.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tunnel2 - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tunnel2 - 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)" == "tunnel2 - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel2.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tunnel2 - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel2.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tunnel2 - Win32 Release"
-# Name "tunnel2 - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tunnel2.c
-# 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/progs/demos/Windows/winpos.dsp b/progs/demos/Windows/winpos.dsp
deleted file mode 100644
index b7b569e6402..00000000000
--- a/progs/demos/Windows/winpos.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="winpos" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=winpos - 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 "winpos.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 "winpos.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "winpos - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "winpos - 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)" == "winpos - 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 "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../winpos.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "winpos - 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 "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../winpos.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "winpos - Win32 Release"
-# Name "winpos - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\winpos.c
-# 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/progs/demos/cubemap.c b/progs/demos/cubemap.c
index 0a59b989835..ef5d2355509 100644
--- a/progs/demos/cubemap.c
+++ b/progs/demos/cubemap.c
@@ -454,6 +454,7 @@ static void usage(void)
int main( int argc, char *argv[] )
{
+ glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(600, 500);
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c
new file mode 100644
index 00000000000..1c016cc75e9
--- /dev/null
+++ b/progs/demos/fslight.c
@@ -0,0 +1,334 @@
+/**
+ * Test OpenGL 2.0 vertex/fragment shaders.
+ * Brian Paul
+ * 1 November 2006
+ *
+ * Based on ARB version by:
+ * Michal Krol
+ * 20 February 2006
+ *
+ * Based on the original demo by:
+ * Brian Paul
+ * 17 April 2003
+ */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/gl.h>
+#include <GL/glut.h>
+#include <GL/glext.h>
+
+static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f };
+static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f };
+static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f };
+static GLfloat delta = 1.0f;
+
+static GLuint fragShader;
+static GLuint vertShader;
+static GLuint program;
+
+static GLint uLightPos;
+static GLint uDiffuse;
+static GLint uSpecular;
+
+static GLint win = 0;
+static GLboolean anim = GL_TRUE;
+static GLboolean wire = GL_FALSE;
+static GLboolean pixelLight = GL_TRUE;
+
+static GLint t0 = 0;
+static GLint frames = 0;
+
+static GLfloat xRot = 0.0f, yRot = 0.0f;
+
+static PFNGLCREATESHADERPROC glCreateShader_func = NULL;
+static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL;
+static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL;
+static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL;
+static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL;
+static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL;
+static PFNGLDELETESHADERPROC glDeleteShader_func = NULL;
+static PFNGLATTACHSHADERPROC glAttachShader_func = NULL;
+static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL;
+static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL;
+static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL;
+static PFNGLISPROGRAMPROC glIsProgram_func = NULL;
+static PFNGLISSHADERPROC glIsShader_func = NULL;
+static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL;
+static PFNGLUNIFORM3FVPROC glUniform4fv_func = NULL;
+
+
+
+static void
+normalize(GLfloat *dst, const GLfloat *src)
+{
+ GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
+ dst[0] = src[0] / len;
+ dst[1] = src[1] / len;
+ dst[2] = src[2] / len;
+}
+
+
+static void
+Redisplay(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (pixelLight) {
+ GLfloat vec[3];
+ glUseProgram_func(program);
+ normalize(vec, lightPos);
+ glUniform3fv_func(uLightPos, 1, vec);
+ glDisable(GL_LIGHTING);
+ }
+ else {
+ glUseProgram_func(0);
+ glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
+ glEnable(GL_LIGHTING);
+ }
+
+ glPushMatrix();
+ glRotatef(xRot, 1.0f, 0.0f, 0.0f);
+ glRotatef(yRot, 0.0f, 1.0f, 0.0f);
+ glutSolidSphere(2.0, 10, 5);
+ glPopMatrix();
+
+ glutSwapBuffers();
+ frames++;
+
+ if (anim) {
+ GLint t = glutGet(GLUT_ELAPSED_TIME);
+ if (t - t0 >= 5000) {
+ GLfloat seconds =(GLfloat)(t - t0) / 1000.0f;
+ GLfloat fps = frames / seconds;
+ printf("%d frames in %6.3f seconds = %6.3f FPS\n",
+ frames, seconds, fps);
+ t0 = t;
+ frames = 0;
+ }
+ }
+}
+
+
+static void
+Idle(void)
+{
+ lightPos[0] += delta;
+ if (lightPos[0] > 25.0f || lightPos[0] < -25.0f)
+ delta = -delta;
+ glutPostRedisplay();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0f, 0.0f, -15.0f);
+}
+
+
+static void
+CleanUp(void)
+{
+ glDeleteShader_func(fragShader);
+ glDeleteShader_func(vertShader);
+ glDeleteProgram_func(program);
+ glutDestroyWindow(win);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+
+ switch(key) {
+ case ' ':
+ case 'a':
+ anim = !anim;
+ if (anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 'x':
+ lightPos[0] -= 1.0f;
+ break;
+ case 'X':
+ lightPos[0] += 1.0f;
+ break;
+ case 'w':
+ wire = !wire;
+ if (wire)
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ else
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ break;
+ case 'p':
+ pixelLight = !pixelLight;
+ if (pixelLight)
+ printf("Per-pixel lighting\n");
+ else
+ printf("Conventional lighting\n");
+ break;
+ case 27:
+ CleanUp();
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 3.0f;
+
+ (void) x;
+ (void) y;
+
+ switch(key) {
+ case GLUT_KEY_UP:
+ xRot -= step;
+ break;
+ case GLUT_KEY_DOWN:
+ xRot += step;
+ break;
+ case GLUT_KEY_LEFT:
+ yRot -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ yRot += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ static const char *fragShaderText =
+ "uniform vec3 lightPos;\n"
+ "uniform vec4 diffuse;\n"
+ "uniform vec4 specular;\n"
+ "varying vec3 normal;\n"
+ "void main() {\n"
+ " // Compute dot product of light direction and normal vector\n"
+ " float dotProd = max(dot(lightPos, normalize(normal)), 0.0);\n"
+ " // Compute diffuse and specular contributions\n"
+ " gl_FragColor = diffuse * dotProd + specular * pow(dotProd, 20.0);\n"
+ "}\n";
+ static const char *vertShaderText =
+ "varying vec3 normal;\n"
+ "void main() {\n"
+ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
+ " normal = gl_NormalMatrix * gl_Normal;\n"
+ "}\n";
+
+
+ const char *version;
+
+ version = (const char *) glGetString(GL_VERSION);
+ if (version[0] != '2' || version[1] != '.') {
+ printf("Warning: this program expects OpenGL 2.0\n");
+ /*exit(1);*/
+ }
+
+
+ glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader");
+ glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader");
+ glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram");
+ glShaderSource_func = (PFNGLSHADERSOURCEPROC) glutGetProcAddress("glShaderSource");
+ glGetShaderSource_func = (PFNGLGETSHADERSOURCEPROC) glutGetProcAddress("glGetShaderSource");
+ glCompileShader_func = (PFNGLCOMPILESHADERPROC) glutGetProcAddress("glCompileShader");
+ glCreateProgram_func = (PFNGLCREATEPROGRAMPROC) glutGetProcAddress("glCreateProgram");
+ glAttachShader_func = (PFNGLATTACHSHADERPROC) glutGetProcAddress("glAttachShader");
+ glLinkProgram_func = (PFNGLLINKPROGRAMPROC) glutGetProcAddress("glLinkProgram");
+ glUseProgram_func = (PFNGLUSEPROGRAMPROC) glutGetProcAddress("glUseProgram");
+ glGetUniformLocation_func = (PFNGLGETUNIFORMLOCATIONPROC) glutGetProcAddress("glGetUniformLocation");
+ glIsProgram_func = (PFNGLISPROGRAMPROC) glutGetProcAddress("glIsProgram");
+ glIsShader_func = (PFNGLISSHADERPROC) glutGetProcAddress("glIsShader");
+ glUniform3fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform3fv");
+ glUniform4fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform4fv");
+
+ fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
+ glShaderSource_func(fragShader, 1, &fragShaderText, NULL);
+ glCompileShader_func(fragShader);
+
+ vertShader = glCreateShader_func(GL_VERTEX_SHADER);
+ glShaderSource_func(vertShader, 1, &vertShaderText, NULL);
+ glCompileShader_func(vertShader);
+
+ program = glCreateProgram_func();
+ glAttachShader_func(program, fragShader);
+ glAttachShader_func(program, vertShader);
+ glLinkProgram_func(program);
+ glUseProgram_func(program);
+
+ uLightPos = glGetUniformLocation_func(program, "lightPos");
+ uDiffuse = glGetUniformLocation_func(program, "diffuse");
+ uSpecular = glGetUniformLocation_func(program, "specular");
+
+ glUniform4fv_func(uDiffuse, 1, diffuse);
+ glUniform4fv_func(uSpecular, 1, specular);
+
+ glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_LIGHT0);
+ glEnable(GL_LIGHTING);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular);
+ glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 20.0f);
+
+ printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
+ printf("Press p to toggle between per-pixel and per-vertex lighting\n");
+
+ /* test glGetShaderSource() */
+ {
+ GLsizei len = strlen(fragShaderText) + 1;
+ GLsizei lenOut;
+ GLchar *src =(GLchar *) malloc(len * sizeof(GLchar));
+ glGetShaderSource_func(fragShader, 0, NULL, src);
+ glGetShaderSource_func(fragShader, len, &lenOut, src);
+ assert(len == lenOut + 1);
+ assert(strcmp(src, fragShaderText) == 0);
+ free(src);
+ }
+
+ assert(glIsProgram_func(program));
+ assert(glIsShader_func(fragShader));
+ assert(glIsShader_func(vertShader));
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition( 0, 0);
+ glutInitWindowSize(200, 200);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Redisplay);
+ if (anim)
+ glutIdleFunc(Idle);
+ Init();
+ glutMainLoop();
+ return 0;
+}
+
diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c
index 75ba45c1e5f..c0aac2272f7 100644
--- a/progs/demos/readpix.c
+++ b/progs/demos/readpix.c
@@ -29,33 +29,32 @@ static GLboolean ScaleAndBias = GL_FALSE;
static GLboolean Benchmark = GL_FALSE;
static GLubyte *TempImage = NULL;
-#if 0
+#define COMBO 1
+#if COMBO == 0
#define ReadFormat ImgFormat
#define ReadType GL_UNSIGNED_BYTE
-#endif
-#if 1
+#elif COMBO == 1
static GLenum ReadFormat = GL_RGBA;
static GLenum ReadType = GL_UNSIGNED_BYTE;
-#endif
-#if 0
+#elif COMBO == 2
static GLenum ReadFormat = GL_RGB;
static GLenum ReadType = GL_UNSIGNED_BYTE;
-#endif
-#if 0
+#elif COMBO == 3
static GLenum ReadFormat = GL_RGB;
static GLenum ReadType = GL_UNSIGNED_SHORT_5_6_5;
-#endif
-#if 0
+#elif COMBO == 4
static GLenum ReadFormat = GL_RGBA;
static GLenum ReadType = GL_UNSIGNED_SHORT_1_5_5_5_REV;
-#endif
-#if 0
+#elif COMBO == 5
static GLenum ReadFormat = GL_BGRA;
static GLenum ReadType = GL_UNSIGNED_SHORT_5_5_5_1;
-#endif
-#if 0
+#elif COMBO == 6
static GLenum ReadFormat = GL_BGRA;
static GLenum ReadType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
+#elif COMBO == 7
+static GLenum ReadFormat = GL_RGBA;
+static GLenum ReadType = GL_HALF_FLOAT_ARB;
+#undef GL_OES_read_format
#endif
@@ -313,8 +312,10 @@ Init( GLboolean ciMode )
Reset();
- /* allocate an extra 1KB in case we're tinkering with pack alignment */
- TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * sizeof(GLubyte)
+ /* allocate large TempImage to store and image data type, plus an
+ * extra 1KB in case we're tinkering with pack alignment.
+ */
+ TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * 4
+ 1000);
assert(TempImage);
}
diff --git a/progs/demos/streaming_rect.c b/progs/demos/streaming_rect.c
new file mode 100644
index 00000000000..86e00803c01
--- /dev/null
+++ b/progs/demos/streaming_rect.c
@@ -0,0 +1,322 @@
+
+/*
+ * GL_ARB_multitexture demo
+ *
+ * Command line options:
+ * -info print GL implementation information
+ *
+ *
+ * Brian Paul November 1998 This program is in the public domain.
+ * Modified on 12 Feb 2002 for > 2 texture units.
+ */
+
+#define GL_GLEXT_PROTOTYPES
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <GL/glut.h>
+
+#include "readtex.h"
+
+
+#define ANIMATE 10
+#define PBO 11
+#define QUIT 100
+
+static GLboolean Animate = GL_TRUE;
+static GLboolean use_pbo = 1;
+static GLboolean whole_rect = 1;
+
+static GLfloat Drift = 0.0;
+static GLfloat drift_increment = 1/255.0;
+static GLfloat Xrot = 20.0, Yrot = 30.0;
+
+static GLuint Width = 1024;
+static GLuint Height = 512;
+
+
+static void Idle( void )
+{
+ if (Animate) {
+
+ Drift += drift_increment;
+ if (Drift >= 1.0)
+ Drift = 0.0;
+
+ glutPostRedisplay();
+ }
+}
+
+static int max( int a, int b ) { return a > b ? a : b; }
+static int min( int a, int b ) { return a < b ? a : b; }
+
+static void DrawObject()
+{
+ GLint size = Width * Height * 4;
+
+ if (use_pbo) {
+ /* XXX: This is extremely important - semantically makes the buffer
+ * contents undefined, but in practice means that the driver can
+ * release the old copy of the texture and allocate a new one
+ * without waiting for outstanding rendering to complete.
+ */
+ glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, size, NULL, GL_STREAM_DRAW_ARB);
+
+ {
+ char *image = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY_ARB);
+
+ printf("char %d\n", (unsigned char)(Drift * 255));
+
+ memset(image, size, (unsigned char)(Drift * 255));
+
+ glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT);
+ }
+
+
+ /* BGRA is required for most hardware paths:
+ */
+ glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, Width, Height, 0,
+ GL_BGRA, GL_UNSIGNED_BYTE, NULL);
+ }
+ else {
+ static char *image = NULL;
+
+ if (image == NULL)
+ image = malloc(size);
+
+ memset(image, size, (unsigned char)(Drift * 255));
+
+ /* BGRA should be the fast path for regular uploads as well.
+ */
+ glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, Width, Height, 0,
+ GL_BGRA, GL_UNSIGNED_BYTE, image);
+ }
+
+ {
+ int x,y,w,h;
+
+ if (whole_rect) {
+ x = y = 0;
+ w = Width;
+ h = Height;
+ }
+ else {
+ x = y = 0;
+ w = min(10, Width);
+ h = min(10, Height);
+ }
+
+ glBegin(GL_QUADS);
+
+ glTexCoord2f( x, y);
+ glVertex2f( x, y );
+
+ glTexCoord2f( x, y + h);
+ glVertex2f( x, y + h);
+
+ glTexCoord2f( x + w + .5, y + h);
+ glVertex2f( x + w, y + h );
+
+ glTexCoord2f( x + w, y + .5);
+ glVertex2f( x + w, y );
+
+ glEnd();
+ }
+}
+
+
+
+static void Display( void )
+{
+ static GLint T0 = 0;
+ static GLint Frames = 0;
+ GLint t;
+
+ glClear( GL_COLOR_BUFFER_BIT );
+
+ glPushMatrix();
+ DrawObject();
+ glPopMatrix();
+
+ glutSwapBuffers();
+
+ Frames++;
+
+ t = glutGet(GLUT_ELAPSED_TIME);
+ if (t - T0 >= 1000) {
+ GLfloat seconds = (t - T0) / 1000.0;
+
+ GLfloat fps = Frames / seconds;
+ printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
+
+ drift_increment = 2.2 * seconds / Frames;
+ T0 = t;
+ Frames = 0;
+ }
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+/* glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); */
+ gluOrtho2D( 0, width, height, 0 );
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ glTranslatef(0.375, 0.375, 0);
+}
+
+
+static void ModeMenu(int entry)
+{
+ if (entry==ANIMATE) {
+ Animate = !Animate;
+ }
+ else if (entry==PBO) {
+ use_pbo = !use_pbo;
+ }
+ else if (entry==QUIT) {
+ exit(0);
+ }
+
+ glutPostRedisplay();
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void SpecialKey( int key, int x, int y )
+{
+ float step = 3.0;
+ (void) x;
+ (void) y;
+
+ switch (key) {
+ case GLUT_KEY_UP:
+ Xrot += step;
+ break;
+ case GLUT_KEY_DOWN:
+ Xrot -= step;
+ break;
+ case GLUT_KEY_LEFT:
+ Yrot += step;
+ break;
+ case GLUT_KEY_RIGHT:
+ Yrot -= step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void Init( int argc, char *argv[] )
+{
+ const char *exten = (const char *) glGetString(GL_EXTENSIONS);
+ GLuint texObj, DrawPBO;
+ GLint size;
+
+
+ if (!strstr(exten, "GL_ARB_multitexture")) {
+ printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n");
+ exit(1);
+ }
+
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
+ printf("%d x %d max texture size\n", size, size);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ /* allocate two texture objects */
+ glGenTextures(1, &texObj);
+
+ /* setup the texture objects */
+ glActiveTextureARB(GL_TEXTURE0_ARB);
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texObj);
+
+ glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glGenBuffersARB(1, &DrawPBO);
+
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
+ glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT,
+ Width * Height * 4, NULL, GL_STREAM_DRAW);
+
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+
+ glEnable(GL_TEXTURE_RECTANGLE_ARB);
+
+ glShadeModel(GL_SMOOTH);
+ glClearColor(0.3, 0.3, 0.4, 1.0);
+
+ if (argc > 1 && strcmp(argv[1], "-info")==0) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+}
+
+
+int main( int argc, char *argv[] )
+{
+ GLint i;
+
+ glutInit( &argc, argv );
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-w") == 0) {
+ Width = atoi(argv[i+1]);
+ if (Width <= 0) {
+ printf("Error, bad width\n");
+ exit(1);
+ }
+ i++;
+ }
+ else if (strcmp(argv[i], "-h") == 0) {
+ Height = atoi(argv[i+1]);
+ if (Height <= 0) {
+ printf("Error, bad height\n");
+ exit(1);
+ }
+ i++;
+ }
+ }
+
+ glutInitWindowSize( Width, Height );
+ glutInitWindowPosition( 0, 0 );
+ glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
+ glutCreateWindow(argv[0] );
+
+ Init( argc, argv );
+
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutSpecialFunc( SpecialKey );
+ glutDisplayFunc( Display );
+ glutIdleFunc( Idle );
+
+ glutCreateMenu(ModeMenu);
+ glutAddMenuEntry("Toggle Animation", ANIMATE);
+ glutAddMenuEntry("Toggle PBO", PBO);
+ glutAddMenuEntry("Quit", QUIT);
+ glutAttachMenu(GLUT_RIGHT_BUTTON);
+
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/demos/texdown.c b/progs/demos/texdown.c
index 79525a0395e..fc98fddb310 100644
--- a/progs/demos/texdown.c
+++ b/progs/demos/texdown.c
@@ -38,8 +38,8 @@
#include <GL/glut.h>
-static GLsizei MaxSize = 1024;
-static GLsizei TexWidth = 256, TexHeight = 256, TexBorder = 0;
+static GLsizei MaxSize = 2048;
+static GLsizei TexWidth = 1024, TexHeight = 1024, TexBorder = 0;
static GLboolean ScaleAndBias = GL_FALSE;
static GLboolean SubImage = GL_FALSE;
static GLdouble DownloadRate = 0.0; /* texels/sec */
@@ -47,6 +47,32 @@ static GLdouble DownloadRate = 0.0; /* texels/sec */
static GLuint Mode = 0;
+/* Try and avoid L2 cache effects by cycling through a small number of
+ * textures.
+ *
+ * At the initial size of 1024x1024x4 == 4mbyte, say 8 textures will
+ * keep us out of most caches at 32mb total.
+ *
+ * This turns into a fairly interesting question of what exactly you
+ * expect to be in cache in normal usage, and what you think should be
+ * outside. There's no rules for this, no reason to favour one usage
+ * over another except what the application you care about happens to
+ * resemble most closely.
+ *
+ * - Should the client texture image be in L2 cache? Has it just been
+ * generated or read from disk?
+ * - Does the application really use >1 texture, or is it constantly
+ * updating one image in-place?
+ *
+ * Different answers will favour different texture upload mechanisms.
+ * To upload an image that is purely outside of cache, a DMA-based
+ * upload will probably win, whereas for small, in-cache textures,
+ * copying looks good.
+ */
+#define NR_TEXOBJ 4
+static GLuint TexObj[NR_TEXOBJ];
+
+
struct FormatRec {
GLenum Format;
GLenum Type;
@@ -116,25 +142,57 @@ TypeStr(GLenum type)
}
}
+/* On x86, there is a performance cliff for memcpy to texture memory
+ * for sources below 64 byte alignment. We do our best with this in
+ * the driver, but it is better if the images are correctly aligned to
+ * start with:
+ */
+#define ALIGN (1<<12)
+
+static unsigned align(unsigned value, unsigned a)
+{
+ return (value + a - 1) & ~(a-1);
+}
+
+static int MIN2(int a, int b)
+{
+ return a < b ? a : b;
+}
static void
MeasureDownloadRate(void)
{
const int w = TexWidth + 2 * TexBorder;
const int h = TexHeight + 2 * TexBorder;
- const int bytes = w * h * BytesPerTexel(Format);
+ const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN);
+ const int bytes = image_bytes * NR_TEXOBJ;
+ GLubyte *orig_texImage, *orig_getImage;
GLubyte *texImage, *getImage;
GLdouble t0, t1, time;
int count;
int i;
+ int offset = 0;
+ GLdouble total = 0; /* ints will tend to overflow */
+
+ printf("allocating %d bytes for %d %dx%d images\n",
+ bytes, NR_TEXOBJ, w, h);
- texImage = (GLubyte *) malloc(bytes);
- getImage = (GLubyte *) malloc(bytes);
- if (!texImage || !getImage) {
+ orig_texImage = (GLubyte *) malloc(bytes + ALIGN);
+ orig_getImage = (GLubyte *) malloc(image_bytes + ALIGN);
+ if (!orig_texImage || !orig_getImage) {
DownloadRate = 0.0;
return;
}
+ printf("alloc %p %p\n", orig_texImage, orig_getImage);
+
+ texImage = (GLubyte *)align((unsigned)orig_texImage, ALIGN);
+ getImage = (GLubyte *)align((unsigned)orig_getImage, ALIGN);
+
+ for (i = 1; !(((unsigned)texImage) & i); i<<=1)
+ ;
+ printf("texture image alignment: %d bytes (%p)\n", i, texImage);
+
for (i = 0; i < bytes; i++) {
texImage[i] = i & 0xff;
}
@@ -166,16 +224,50 @@ MeasureDownloadRate(void)
count = 0;
t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
do {
+ int img = count%NR_TEXOBJ;
+ GLubyte *img_ptr = texImage + img * image_bytes;
+
+ glBindTexture(GL_TEXTURE_2D, TexObj[img]);
+
if (SubImage && count > 0) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, -TexBorder, -TexBorder, w, h,
+ /* Only update a portion of the image each iteration. This
+ * is presumably why you'd want to use texsubimage, otherwise
+ * you may as well just call teximage again.
+ *
+ * A bigger question is whether to use a pointer that moves
+ * with each call, ie does the incoming data come from L2
+ * cache under normal circumstances, or is it pulled from
+ * uncached memory?
+ *
+ * There's a good argument to say L2 cache, ie you'd expect
+ * the data to have been recently generated. It's possible
+ * that it could have come from a file read, which may or may
+ * not have gone through the cpu.
+ */
+ glTexSubImage2D(GL_TEXTURE_2D, 0,
+ -TexBorder,
+ -TexBorder + offset * h/8,
+ w,
+ h/8,
FormatTable[Format].Format,
- FormatTable[Format].Type, texImage);
+ FormatTable[Format].Type,
+#if 1
+ texImage /* likely in L2$ */
+#else
+ img_ptr + offset * bytes/8 /* unlikely in L2$ */
+#endif
+ );
+ offset += 1;
+ offset %= 8;
+ total += w * h / 8;
}
else {
glTexImage2D(GL_TEXTURE_2D, 0,
FormatTable[Format].IntFormat, w, h, TexBorder,
FormatTable[Format].Format,
- FormatTable[Format].Type, texImage);
+ FormatTable[Format].Type,
+ img_ptr);
+ total += w*h;
}
/* draw a tiny polygon to force texture into texram */
@@ -192,25 +284,12 @@ MeasureDownloadRate(void)
glDisable(GL_TEXTURE_2D);
- printf("w*h=%d count=%d time=%f\n", w*h, count, time);
- DownloadRate = w * h * count / time;
-
-#if 0
- if (!ScaleAndBias) {
- /* verify texture readback */
- glGetTexImage(GL_TEXTURE_2D, 0,
- FormatTable[Format].Format,
- FormatTable[Format].Type, getImage);
- for (i = 0; i < w * h; i++) {
- if (texImage[i] != getImage[i]) {
- printf("[%d] %d != %d\n", i, texImage[i], getImage[i]);
- }
- }
- }
-#endif
+ printf("total texels=%f time=%f\n", total, time);
+ DownloadRate = total / time;
+
- free(texImage);
- free(getImage);
+ free(orig_texImage);
+ free(orig_getImage);
{
GLint err = glGetError();
diff --git a/progs/directfb/Makefile b/progs/directfb/Makefile
deleted file mode 100644
index 53b100a18d9..00000000000
--- a/progs/directfb/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# progs/directfb/Makefile
-
-TOP = ../..
-include $(TOP)/configs/current
-
-
-INCDIR = $(TOP)/include -I$(TOP)/progs
-
-LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME)
-
-CFLAGS += $(shell pkg-config --cflags directfb)
-APP_LIB_DEPS += $(shell pkg-config --libs directfb)
-
-PROGS = df_gears \
- df_reflect \
- df_morph3d \
- multi_window
-
-##### RULES #####
-
-.SUFFIXES:
-.SUFFIXES: .c
-
-.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
-
-
-##### TARGETS #####
-
-default: $(PROGS)
-
-
-clean:
- -rm -f $(PROGS)
- -rm -f *.o *~
-
diff --git a/progs/directfb/df_gears.c b/progs/directfb/df_gears.c
deleted file mode 100644
index 27df900115f..00000000000
--- a/progs/directfb/df_gears.c
+++ /dev/null
@@ -1,480 +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.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include <directfb.h>
-
-#include <GL/gl.h>
-#include <GL/directfbgl.h>
-
-
-/* the super interface */
-IDirectFB *dfb;
-
-/* the primary surface (surface of primary layer) */
-IDirectFBSurface *primary;
-
-/* the GL context */
-IDirectFBGL *primary_gl;
-
-/* our font */
-IDirectFBFont *font;
-
-/* event buffer */
-IDirectFBEventBuffer *events;
-
-/* macro for a safe call to DirectFB functions */
-#define DFBCHECK(x...) \
- { \
- err = x; \
- if (err != DFB_OK) { \
- fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
- DirectFBErrorFatal( #x, err ); \
- } \
- }
-
-static int screen_width, screen_height;
-
-static unsigned long T0 = 0;
-static GLint Frames = 0;
-static GLfloat fps = 0;
-
-static inline unsigned long get_millis()
-{
- struct timeval tv;
-
- gettimeofday (&tv, NULL);
- return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
-}
-
-
-#ifndef M_PI
-#define M_PI 3.14159265
-#endif
-
-/**
-
- Draw a gear wheel. You'll probably want to call this function when
- building a display list since we do a lot of trig here.
-
- Input: inner_radius - radius of hole at center
- outer_radius - radius at center of teeth
- width - width of gear
- teeth - number of teeth
- tooth_depth - depth of tooth
-
- **/
-
-static void
-gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
- GLint teeth, GLfloat tooth_depth)
-{
- GLint i;
- GLfloat r0, r1, r2;
- GLfloat angle, da;
- GLfloat u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0;
- r2 = outer_radius + tooth_depth / 2.0;
-
- da = 2.0 * M_PI / teeth / 4.0;
-
- glShadeModel(GL_FLAT);
-
- glNormal3f(0.0, 0.0, 1.0);
-
- /* draw front face */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- if (i < teeth) {
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
- }
- }
- glEnd();
-
- /* draw front sides of teeth */
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
- }
- glEnd();
-
- glNormal3f(0.0, 0.0, -1.0);
-
- /* draw back face */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- if (i < teeth) {
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- }
- }
- glEnd();
-
- /* draw back sides of teeth */
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- }
- glEnd();
-
- /* draw outward faces of teeth */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- u = r2 * cos(angle + da) - r1 * cos(angle);
- v = r2 * sin(angle + da) - r1 * sin(angle);
- len = sqrt(u * u + v * v);
- u /= len;
- v /= len;
- glNormal3f(v, -u, 0.0);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
- u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
- v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
- glNormal3f(v, -u, 0.0);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- }
-
- glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
- glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
-
- glEnd();
-
- glShadeModel(GL_SMOOTH);
-
- /* draw inside radius cylinder */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glNormal3f(-cos(angle), -sin(angle), 0.0);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- }
- glEnd();
-
-}
-
-static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
-static GLfloat inc_rotx = 0, inc_roty = 0, inc_rotz = 0;
-static GLint gear1, gear2, gear3;
-static GLfloat angle = 0.0;
-
-static void
-draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glPushMatrix();
- glRotatef(view_rotx, 1.0, 0.0, 0.0);
- glRotatef(view_roty, 0.0, 1.0, 0.0);
- glRotatef(view_rotz, 0.0, 0.0, 1.0);
-
- glPushMatrix();
- glTranslatef(-3.0, -2.0, 0.0);
- glRotatef(angle, 0.0, 0.0, 1.0);
- glCallList(gear1);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(3.1, -2.0, 0.0);
- glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
- glCallList(gear2);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(-3.1, 4.2, 0.0);
- glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
- glCallList(gear3);
- glPopMatrix();
-
- glPopMatrix();
-}
-
-/* new window size or exposure */
-static void
-reshape(int width, int height)
-{
- GLfloat h = (GLfloat) height / (GLfloat) width;
-
- glViewport(0, 0, (GLint) width, (GLint) height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -40.0);
-}
-
-static void
-init(int argc, char *argv[])
-{
- static GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0};
- static GLfloat red[4] = {0.8, 0.1, 0.0, 1.0};
- static GLfloat green[4] = {0.0, 0.8, 0.2, 1.0};
- static GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0};
- GLint i;
-
- glLightfv(GL_LIGHT0, GL_POSITION, pos);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = glGenLists(1);
- glNewList(gear1, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0, 4.0, 1.0, 20, 0.7);
- glEndList();
-
- gear2 = glGenLists(1);
- glNewList(gear2, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5, 2.0, 2.0, 10, 0.7);
- glEndList();
-
- gear3 = glGenLists(1);
- glNewList(gear3, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3, 2.0, 0.5, 10, 0.7);
- glEndList();
-
- glEnable(GL_NORMALIZE);
-
- for ( i=1; i<argc; i++ ) {
- if (strcmp(argv[i], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
- }
-}
-
-int main( int argc, char *argv[] )
-{
- int quit = 0;
- DFBResult err;
- DFBSurfaceDescription dsc;
-
- DFBCHECK(DirectFBInit( &argc, &argv ));
-
- /* create the super interface */
- DFBCHECK(DirectFBCreate( &dfb ));
-
- /* create an event buffer for all devices with these caps */
- DFBCHECK(dfb->CreateInputEventBuffer( dfb, DICAPS_KEYS | DICAPS_AXES,
- DFB_FALSE, &events ));
-
- /* set our cooperative level to DFSCL_FULLSCREEN
- for exclusive access to the primary layer */
- dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );
-
- /* get the primary surface, i.e. the surface of the
- primary layer we have exclusive access to */
- dsc.flags = DSDESC_CAPS;
- dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE;
-
- DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary ));
-
- /* get the size of the surface and fill it */
- DFBCHECK(primary->GetSize( primary, &screen_width, &screen_height ));
- DFBCHECK(primary->FillRectangle( primary, 0, 0,
- screen_width, screen_height ));
- primary->Flip( primary, NULL, 0 );
-
- /* create the default font and set it */
- DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font ));
- DFBCHECK(primary->SetFont( primary, font ));
-
- /* get the GL context */
- DFBCHECK(primary->GetGL( primary, &primary_gl ));
-
- DFBCHECK(primary_gl->Lock( primary_gl ));
-
- init(argc, argv);
- reshape(screen_width, screen_height);
-
- DFBCHECK(primary_gl->Unlock( primary_gl ));
-
- T0 = get_millis();
-
- while (!quit) {
- DFBInputEvent evt;
- unsigned long t;
-
- DFBCHECK(primary_gl->Lock( primary_gl ));
-
- draw();
-
- DFBCHECK(primary_gl->Unlock( primary_gl ));
-
- if (fps) {
- char buf[64];
-
- snprintf(buf, 64, "%4.1f FPS\n", fps);
-
- primary->SetColor( primary, 0xff, 0, 0, 0xff );
- primary->DrawString( primary, buf, -1, screen_width - 5, 5, DSTF_TOPRIGHT );
- }
-
- primary->Flip( primary, NULL, 0 );
- Frames++;
-
-
- t = get_millis();
- if (t - T0 >= 2000) {
- GLfloat seconds = (t - T0) / 1000.0;
-
- fps = Frames / seconds;
-
- T0 = t;
- Frames = 0;
- }
-
-
- while (events->GetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) {
- switch (evt.type) {
- case DIET_KEYPRESS:
- switch (evt.key_symbol) {
- case DIKS_ESCAPE:
- quit = 1;
- break;
- case DIKS_CURSOR_UP:
- inc_rotx = 5.0;
- break;
- case DIKS_CURSOR_DOWN:
- inc_rotx = -5.0;
- break;
- case DIKS_CURSOR_LEFT:
- inc_roty = 5.0;
- break;
- case DIKS_CURSOR_RIGHT:
- inc_roty = -5.0;
- break;
- case DIKS_PAGE_UP:
- inc_rotz = 5.0;
- break;
- case DIKS_PAGE_DOWN:
- inc_rotz = -5.0;
- break;
- default:
- ;
- }
- break;
- case DIET_KEYRELEASE:
- switch (evt.key_symbol) {
- case DIKS_CURSOR_UP:
- inc_rotx = 0;
- break;
- case DIKS_CURSOR_DOWN:
- inc_rotx = 0;
- break;
- case DIKS_CURSOR_LEFT:
- inc_roty = 0;
- break;
- case DIKS_CURSOR_RIGHT:
- inc_roty = 0;
- break;
- case DIKS_PAGE_UP:
- inc_rotz = 0;
- break;
- case DIKS_PAGE_DOWN:
- inc_rotz = 0;
- break;
- default:
- ;
- }
- break;
- case DIET_AXISMOTION:
- if (evt.flags & DIEF_AXISREL) {
- switch (evt.axis) {
- case DIAI_X:
- view_roty += evt.axisrel / 2.0;
- break;
- case DIAI_Y:
- view_rotx += evt.axisrel / 2.0;
- break;
- case DIAI_Z:
- view_rotz += evt.axisrel / 2.0;
- break;
- default:
- ;
- }
- }
- break;
- default:
- ;
- }
- }
-
- angle += 2.0;
-
- view_rotx += inc_rotx;
- view_roty += inc_roty;
- view_rotz += inc_rotz;
- }
-
- /* release our interfaces to shutdown DirectFB */
- primary_gl->Release( primary_gl );
- primary->Release( primary );
- font->Release( font );
- events->Release( events );
- dfb->Release( dfb );
-
- return 0;
-}
-
diff --git a/progs/directfb/df_morph3d.c b/progs/directfb/df_morph3d.c
deleted file mode 100644
index f7f143447f4..00000000000
--- a/progs/directfb/df_morph3d.c
+++ /dev/null
@@ -1,1013 +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.
-*/
-
-/*-
- * morph3d.c - Shows 3D morphing objects
- *
- * Converted to GLUT by brianp on 1/1/98
- *
- * This program was inspired on a WindowsNT(R)'s screen saver. It was written
- * from scratch and it was not based on any other source code.
- *
- * Porting it to xlock (the final objective of this code since the moment I
- * decided to create it) was possible by comparing the original Mesa's gear
- * demo with it's ported version, so thanks for Danny Sung for his indirect
- * help (look at gear.c in xlock source tree). NOTE: At the moment this code
- * was sent to Brian Paul for package inclusion, the XLock Version was not
- * available. In fact, I'll wait it to appear on the next Mesa release (If you
- * are reading this, it means THIS release) to send it for xlock package
- * inclusion). It will probably there be a GLUT version too.
- *
- * Thanks goes also to Brian Paul for making it possible and inexpensive
- * to use OpenGL at home.
- *
- * Since I'm not a native english speaker, my apologies for any gramatical
- * mistake.
- *
- * My e-mail addresses are
- *
- * vianna@cat.cbpf.br
- * and
- * marcelo@venus.rdc.puc-rio.br
- *
- * Marcelo F. Vianna (Feb-13-1997)
- */
-
-/*
-This document is VERY incomplete, but tries to describe the mathematics used
-in the program. At this moment it just describes how the polyhedra are
-generated. On futhurer versions, this document will be probabbly improved.
-
-Since I'm not a native english speaker, my apologies for any gramatical
-mistake.
-
-Marcelo Fernandes Vianna
-- Undergraduate in Computer Engeneering at Catholic Pontifical University
-- of Rio de Janeiro (PUC-Rio) Brasil.
-- e-mail: vianna@cat.cbpf.br or marcelo@venus.rdc.puc-rio.br
-- Feb-13-1997
-
-POLYHEDRA GENERATION
-
-For the purpose of this program it's not sufficient to know the polyhedra
-vertexes coordinates. Since the morphing algorithm applies a nonlinear
-transformation over the surfaces (faces) of the polyhedron, each face has
-to be divided into smaller ones. The morphing algorithm needs to transform
-each vertex of these smaller faces individually. It's a very time consoming
-task.
-
-In order to reduce calculation overload, and since all the macro faces of
-the polyhedron are transformed by the same way, the generation is made by
-creating only one face of the polyhedron, morphing it and then rotating it
-around the polyhedron center.
-
-What we need to know is the face radius of the polyhedron (the radius of
-the inscribed sphere) and the angle between the center of two adjacent
-faces using the center of the sphere as the angle's vertex.
-
-The face radius of the regular polyhedra are known values which I decided
-to not waste my time calculating. Following is a table of face radius for
-the regular polyhedra with edge length = 1:
-
- TETRAHEDRON : 1/(2*sqrt(2))/sqrt(3)
- CUBE : 1/2
- OCTAHEDRON : 1/sqrt(6)
- DODECAHEDRON : T^2 * sqrt((T+2)/5) / 2 -> where T=(sqrt(5)+1)/2
- ICOSAHEDRON : (3*sqrt(3)+sqrt(15))/12
-
-I've not found any reference about the mentioned angles, so I needed to
-calculate them, not a trivial task until I figured out how :)
-Curiously these angles are the same for the tetrahedron and octahedron.
-A way to obtain this value is inscribing the tetrahedron inside the cube
-by matching their vertexes. So you'll notice that the remaining unmatched
-vertexes are in the same straight line starting in the cube/tetrahedron
-center and crossing the center of each tetrahedron's face. At this point
-it's easy to obtain the bigger angle of the isosceles triangle formed by
-the center of the cube and two opposite vertexes on the same cube face.
-The edges of this triangle have the following lenghts: sqrt(2) for the base
-and sqrt(3)/2 for the other two other edges. So the angle we want is:
- +-----------------------------------------------------------+
- | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees |
- +-----------------------------------------------------------+
-For the cube this angle is obvious, but just for formality it can be
-easily obtained because we also know it's isosceles edge lenghts:
-sqrt(2)/2 for the base and 1/2 for the other two edges. So the angle we
-want is:
- +-----------------------------------------------------------+
- | 2*ARCSIN((sqrt(2)/2)/1) = 90.000000000000000000 degrees |
- +-----------------------------------------------------------+
-For the octahedron we use the same idea used for the tetrahedron, but now
-we inscribe the cube inside the octahedron so that all cubes's vertexes
-matches excatly the center of each octahedron's face. It's now clear that
-this angle is the same of the thetrahedron one:
- +-----------------------------------------------------------+
- | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees |
- +-----------------------------------------------------------+
-For the dodecahedron it's a little bit harder because it's only relationship
-with the cube is useless to us. So we need to solve the problem by another
-way. The concept of Face radius also exists on 2D polygons with the name
-Edge radius:
- Edge Radius For Pentagon (ERp)
- ERp = (1/2)/TAN(36 degrees) * VRp = 0.6881909602355867905
- (VRp is the pentagon's vertex radio).
- Face Radius For Dodecahedron
- FRd = T^2 * sqrt((T+2)/5) / 2 = 1.1135163644116068404
-Why we need ERp? Well, ERp and FRd segments forms a 90 degrees angle,
-completing this triangle, the lesser angle is a half of the angle we are
-looking for, so this angle is:
- +-----------------------------------------------------------+
- | 2*ARCTAN(ERp/FRd) = 63.434948822922009981 degrees |
- +-----------------------------------------------------------+
-For the icosahedron we can use the same method used for dodecahedron (well
-the method used for dodecahedron may be used for all regular polyhedra)
- Edge Radius For Triangle (this one is well known: 1/3 of the triangle height)
- ERt = sin(60)/3 = sqrt(3)/6 = 0.2886751345948128655
- Face Radius For Icosahedron
- FRi= (3*sqrt(3)+sqrt(15))/12 = 0.7557613140761707538
-So the angle is:
- +-----------------------------------------------------------+
- | 2*ARCTAN(ERt/FRi) = 41.810314895778596167 degrees |
- +-----------------------------------------------------------+
-
-*/
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <unistd.h>
-
-#include <directfb.h>
-
-#include <GL/gl.h>
-#include <GL/directfbgl.h>
-
-
-/* the super interface */
-IDirectFB *dfb;
-
-/* the primary surface (surface of primary layer) */
-IDirectFBSurface *primary;
-
-/* the GL context */
-IDirectFBGL *primary_gl;
-
-/* our font */
-IDirectFBFont *font;
-
-/* event buffer */
-IDirectFBEventBuffer *events;
-
-/* macro for a safe call to DirectFB functions */
-#define DFBCHECK(x...) \
- { \
- err = x; \
- if (err != DFB_OK) { \
- fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
- DirectFBErrorFatal( #x, err ); \
- } \
- }
-
-static int screen_width, screen_height;
-
-static unsigned long T0 = 0;
-static GLint Frames = 0;
-static GLfloat fps = 0;
-
-static inline unsigned long get_millis()
-{
- struct timeval tv;
-
- gettimeofday (&tv, NULL);
- return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
-}
-
-
-
-#define Scale 0.3
-
-#define VectMul(X1,Y1,Z1,X2,Y2,Z2) (Y1)*(Z2)-(Z1)*(Y2),(Z1)*(X2)-(X1)*(Z2),(X1)*(Y2)-(Y1)*(X2)
-#define sqr(A) ((A)*(A))
-
-/* Increasing this values produces better image quality, the price is speed. */
-/* Very low values produces erroneous/incorrect plotting */
-#define tetradivisions 23
-#define cubedivisions 20
-#define octadivisions 21
-#define dodecadivisions 10
-#define icodivisions 15
-
-#define tetraangle 109.47122063449069174
-#define cubeangle 90.000000000000000000
-#define octaangle 109.47122063449069174
-#define dodecaangle 63.434948822922009981
-#define icoangle 41.810314895778596167
-
-#ifndef Pi
-#define Pi 3.1415926535897932385
-#endif
-#define SQRT2 1.4142135623730951455
-#define SQRT3 1.7320508075688771932
-#define SQRT5 2.2360679774997898051
-#define SQRT6 2.4494897427831778813
-#define SQRT15 3.8729833462074170214
-#define cossec36_2 0.8506508083520399322
-#define cos72 0.3090169943749474241
-#define sin72 0.9510565162951535721
-#define cos36 0.8090169943749474241
-#define sin36 0.5877852522924731292
-
-/*************************************************************************/
-
-static int mono=0;
-static int smooth=1;
-static GLint WindH, WindW;
-static GLfloat step=0;
-static GLfloat seno;
-static int object;
-static int edgedivisions;
-static void (*draw_object)( void );
-static float Magnitude;
-static float *MaterialColor[20];
-
-static float front_shininess[] = {60.0};
-static float front_specular[] = { 0.7, 0.7, 0.7, 1.0 };
-static float ambient[] = { 0.0, 0.0, 0.0, 1.0 };
-static float diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
-static float position0[] = { 1.0, 1.0, 1.0, 0.0 };
-static float position1[] = {-1.0,-1.0, 1.0, 0.0 };
-static float lmodel_ambient[] = { 0.5, 0.5, 0.5, 1.0 };
-static float lmodel_twoside[] = {GL_TRUE};
-
-static float MaterialRed[] = { 0.7, 0.0, 0.0, 1.0 };
-static float MaterialGreen[] = { 0.1, 0.5, 0.2, 1.0 };
-static float MaterialBlue[] = { 0.0, 0.0, 0.7, 1.0 };
-static float MaterialCyan[] = { 0.2, 0.5, 0.7, 1.0 };
-static float MaterialYellow[] = { 0.7, 0.7, 0.0, 1.0 };
-static float MaterialMagenta[] = { 0.6, 0.2, 0.5, 1.0 };
-static float MaterialWhite[] = { 0.7, 0.7, 0.7, 1.0 };
-static float MaterialGray[] = { 0.2, 0.2, 0.2, 1.0 };
-
-#define TRIANGLE(Edge, Amp, Divisions, Z) \
-{ \
- GLfloat Xf,Yf,Xa,Yb,Xf2,Yf2; \
- GLfloat Factor,Factor1,Factor2; \
- GLfloat VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ; \
- GLfloat Ax,Ay,Bx; \
- int Ri,Ti; \
- GLfloat Vr=(Edge)*SQRT3/3; \
- GLfloat AmpVr2=(Amp)/sqr(Vr); \
- GLfloat Zf=(Edge)*(Z); \
- \
- Ax=(Edge)*(+0.5/(Divisions)), Ay=(Edge)*(-SQRT3/(2*Divisions)); \
- Bx=(Edge)*(-0.5/(Divisions)); \
- \
- for (Ri=1; Ri<=(Divisions); Ri++) { \
- glBegin(GL_TRIANGLE_STRIP); \
- for (Ti=0; Ti<Ri; Ti++) { \
- Xf=(float)(Ri-Ti)*Ax + (float)Ti*Bx; \
- Yf=Vr+(float)(Ri-Ti)*Ay + (float)Ti*Ay; \
- Xa=Xf+0.001; Yb=Yf+0.001; \
- Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2); \
- Factor1=1-((sqr(Xa)+Yf2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Yf; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- \
- Xf=(float)(Ri-Ti-1)*Ax + (float)Ti*Bx; \
- Yf=Vr+(float)(Ri-Ti-1)*Ay + (float)Ti*Ay; \
- Xa=Xf+0.001; Yb=Yf+0.001; \
- Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2); \
- Factor1=1-((sqr(Xa)+Yf2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Yf; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- \
- } \
- Xf=(float)Ri*Bx; \
- Yf=Vr+(float)Ri*Ay; \
- Xa=Xf+0.001; Yb=Yf+0.001; \
- Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2); \
- Factor1=1-((sqr(Xa)+Yf2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Yf; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- glEnd(); \
- } \
-}
-
-#define SQUARE(Edge, Amp, Divisions, Z) \
-{ \
- int Xi,Yi; \
- GLfloat Xf,Yf,Y,Xf2,Yf2,Y2,Xa,Yb; \
- GLfloat Factor,Factor1,Factor2; \
- GLfloat VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ; \
- GLfloat Zf=(Edge)*(Z); \
- GLfloat AmpVr2=(Amp)/sqr((Edge)*SQRT2/2); \
- \
- for (Yi=0; Yi<(Divisions); Yi++) { \
- Yf=-((Edge)/2.0) + ((float)Yi)/(Divisions)*(Edge); \
- Yf2=sqr(Yf); \
- Y=Yf+1.0/(Divisions)*(Edge); \
- Y2=sqr(Y); \
- glBegin(GL_QUAD_STRIP); \
- for (Xi=0; Xi<=(Divisions); Xi++) { \
- Xf=-((Edge)/2.0) + ((float)Xi)/(Divisions)*(Edge); \
- Xf2=sqr(Xf); \
- \
- Xa=Xf+0.001; Yb=Y+0.001; \
- Factor=1-((Xf2+Y2)*AmpVr2); \
- Factor1=1-((sqr(Xa)+Y2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Y; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Y-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- \
- Xa=Xf+0.001; Yb=Yf+0.001; \
- Factor=1-((Xf2+Yf2)*AmpVr2); \
- Factor1=1-((sqr(Xa)+Yf2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Yf; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- } \
- glEnd(); \
- } \
-}
-
-#define PENTAGON(Edge, Amp, Divisions, Z) \
-{ \
- int Ri,Ti,Fi; \
- GLfloat Xf,Yf,Xa,Yb,Xf2,Yf2; \
- GLfloat x[6],y[6]; \
- GLfloat Factor,Factor1,Factor2; \
- GLfloat VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ; \
- GLfloat Zf=(Edge)*(Z); \
- GLfloat AmpVr2=(Amp)/sqr((Edge)*cossec36_2); \
- \
- for(Fi=0;Fi<6;Fi++) { \
- x[Fi]=-cos( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge); \
- y[Fi]=sin( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge); \
- } \
- \
- for (Ri=1; Ri<=(Divisions); Ri++) { \
- for (Fi=0; Fi<5; Fi++) { \
- glBegin(GL_TRIANGLE_STRIP); \
- for (Ti=0; Ti<Ri; Ti++) { \
- Xf=(float)(Ri-Ti)*x[Fi] + (float)Ti*x[Fi+1]; \
- Yf=(float)(Ri-Ti)*y[Fi] + (float)Ti*y[Fi+1]; \
- Xa=Xf+0.001; Yb=Yf+0.001; \
- Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2); \
- Factor1=1-((sqr(Xa)+Yf2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Yf; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- \
- Xf=(float)(Ri-Ti-1)*x[Fi] + (float)Ti*x[Fi+1]; \
- Yf=(float)(Ri-Ti-1)*y[Fi] + (float)Ti*y[Fi+1]; \
- Xa=Xf+0.001; Yb=Yf+0.001; \
- Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2); \
- Factor1=1-((sqr(Xa)+Yf2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Yf; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- \
- } \
- Xf=(float)Ri*x[Fi+1]; \
- Yf=(float)Ri*y[Fi+1]; \
- Xa=Xf+0.001; Yb=Yf+0.001; \
- Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2); \
- Factor1=1-((sqr(Xa)+Yf2)*AmpVr2); \
- Factor2=1-((Xf2+sqr(Yb))*AmpVr2); \
- VertX=Factor*Xf; VertY=Factor*Yf; VertZ=Factor*Zf; \
- NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ; \
- NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ; \
- glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ)); \
- glVertex3f(VertX, VertY, VertZ); \
- glEnd(); \
- } \
- } \
-}
-
-static void draw_tetra( void )
-{
- GLuint list;
-
- list = glGenLists( 1 );
- glNewList( list, GL_COMPILE );
- TRIANGLE(2,seno,edgedivisions,0.5/SQRT6);
- glEndList();
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-tetraangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+tetraangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+tetraangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
- glCallList(list);
-
- glDeleteLists(list,1);
-}
-
-static void draw_cube( void )
-{
- GLuint list;
-
- list = glGenLists( 1 );
- glNewList( list, GL_COMPILE );
- SQUARE(2, seno, edgedivisions, 0.5)
- glEndList();
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
- glCallList(list);
- glRotatef(cubeangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
- glCallList(list);
- glRotatef(cubeangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
- glCallList(list);
- glRotatef(cubeangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
- glCallList(list);
- glRotatef(cubeangle,0,1,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
- glCallList(list);
- glRotatef(2*cubeangle,0,1,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
- glCallList(list);
-
- glDeleteLists(list,1);
-}
-
-static void draw_octa( void )
-{
- GLuint list;
-
- list = glGenLists( 1 );
- glNewList( list, GL_COMPILE );
- TRIANGLE(2,seno,edgedivisions,1/SQRT6);
- glEndList();
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-180+octaangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-octaangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-octaangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-180+octaangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-octaangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-octaangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]);
- glCallList(list);
-
- glDeleteLists(list,1);
-}
-
-static void draw_dodeca( void )
-{
- GLuint list;
-
-#define TAU ((SQRT5+1)/2)
-
- list = glGenLists( 1 );
- glNewList( list, GL_COMPILE );
- PENTAGON(1,seno,edgedivisions,sqr(TAU) * sqrt((TAU+2)/5) / 2);
- glEndList();
-
- glPushMatrix();
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
- glCallList(list);
- glRotatef(180,0,0,1);
- glPushMatrix();
- glRotatef(-dodecaangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(-dodecaangle,cos72,sin72,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(-dodecaangle,cos72,-sin72,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(dodecaangle,cos36,-sin36,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
- glCallList(list);
- glPopMatrix();
- glRotatef(dodecaangle,cos36,sin36,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]);
- glCallList(list);
- glRotatef(180,0,0,1);
- glPushMatrix();
- glRotatef(-dodecaangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(-dodecaangle,cos72,sin72,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[8]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(-dodecaangle,cos72,-sin72,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[9]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(dodecaangle,cos36,-sin36,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[10]);
- glCallList(list);
- glPopMatrix();
- glRotatef(dodecaangle,cos36,sin36,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[11]);
- glCallList(list);
-
- glDeleteLists(list,1);
-}
-
-static void draw_ico( void )
-{
- GLuint list;
-
- list = glGenLists( 1 );
- glNewList( list, GL_COMPILE );
- TRIANGLE(1.5,seno,edgedivisions,(3*SQRT3+SQRT15)/12);
- glEndList();
-
- glPushMatrix();
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-icoangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-icoangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[8]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-icoangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[9]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[10]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-icoangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[11]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[12]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[13]);
- glCallList(list);
- glPopMatrix();
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[14]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[15]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-icoangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[16]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[17]);
- glCallList(list);
- glPushMatrix();
- glRotatef(180,0,1,0);
- glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[18]);
- glCallList(list);
- glPopMatrix();
- glRotatef(180,0,0,1);
- glRotatef(-icoangle,1,0,0);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[19]);
- glCallList(list);
-
- glDeleteLists(list,1);
-}
-
-static void draw ( void ) {
- glClear( /*GL_COLOR_BUFFER_BIT |*/ GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
-
- glTranslatef( 0.0, 0.0, -10.0 );
- glScalef( Scale*WindH/WindW, Scale, Scale );
- glTranslatef(2.5*WindW/WindH*sin(step*1.11),2.5*cos(step*1.25*1.11),0);
- glRotatef(step*100,1,0,0);
- glRotatef(step*95,0,1,0);
- glRotatef(step*90,0,0,1);
-
- seno=(sin(step)+1.0/3.0)*(4.0/5.0)*Magnitude;
-
- draw_object();
-
- glPopMatrix();
-
- glFlush();
-
- step+=0.05;
-}
-
-static void reshape( int width, int height )
-{
- glViewport(0, 0, WindW=(GLint)width, WindH=(GLint)height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void pinit(void)
-{
- switch(object) {
- case 1:
- draw_object=draw_tetra;
- MaterialColor[0]=MaterialRed;
- MaterialColor[1]=MaterialGreen;
- MaterialColor[2]=MaterialBlue;
- MaterialColor[3]=MaterialWhite;
- edgedivisions=tetradivisions;
- Magnitude=2.5;
- break;
- case 2:
- draw_object=draw_cube;
- MaterialColor[0]=MaterialRed;
- MaterialColor[1]=MaterialGreen;
- MaterialColor[2]=MaterialCyan;
- MaterialColor[3]=MaterialMagenta;
- MaterialColor[4]=MaterialYellow;
- MaterialColor[5]=MaterialBlue;
- edgedivisions=cubedivisions;
- Magnitude=2.0;
- break;
- case 3:
- draw_object=draw_octa;
- MaterialColor[0]=MaterialRed;
- MaterialColor[1]=MaterialGreen;
- MaterialColor[2]=MaterialBlue;
- MaterialColor[3]=MaterialWhite;
- MaterialColor[4]=MaterialCyan;
- MaterialColor[5]=MaterialMagenta;
- MaterialColor[6]=MaterialGray;
- MaterialColor[7]=MaterialYellow;
- edgedivisions=octadivisions;
- Magnitude=2.5;
- break;
- case 4:
- draw_object=draw_dodeca;
- MaterialColor[ 0]=MaterialRed;
- MaterialColor[ 1]=MaterialGreen;
- MaterialColor[ 2]=MaterialCyan;
- MaterialColor[ 3]=MaterialBlue;
- MaterialColor[ 4]=MaterialMagenta;
- MaterialColor[ 5]=MaterialYellow;
- MaterialColor[ 6]=MaterialGreen;
- MaterialColor[ 7]=MaterialCyan;
- MaterialColor[ 8]=MaterialRed;
- MaterialColor[ 9]=MaterialMagenta;
- MaterialColor[10]=MaterialBlue;
- MaterialColor[11]=MaterialYellow;
- edgedivisions=dodecadivisions;
- Magnitude=2.0;
- break;
- case 5:
- draw_object=draw_ico;
- MaterialColor[ 0]=MaterialRed;
- MaterialColor[ 1]=MaterialGreen;
- MaterialColor[ 2]=MaterialBlue;
- MaterialColor[ 3]=MaterialCyan;
- MaterialColor[ 4]=MaterialYellow;
- MaterialColor[ 5]=MaterialMagenta;
- MaterialColor[ 6]=MaterialRed;
- MaterialColor[ 7]=MaterialGreen;
- MaterialColor[ 8]=MaterialBlue;
- MaterialColor[ 9]=MaterialWhite;
- MaterialColor[10]=MaterialCyan;
- MaterialColor[11]=MaterialYellow;
- MaterialColor[12]=MaterialMagenta;
- MaterialColor[13]=MaterialRed;
- MaterialColor[14]=MaterialGreen;
- MaterialColor[15]=MaterialBlue;
- MaterialColor[16]=MaterialCyan;
- MaterialColor[17]=MaterialYellow;
- MaterialColor[18]=MaterialMagenta;
- MaterialColor[19]=MaterialGray;
- edgedivisions=icodivisions;
- Magnitude=2.5;
- break;
- }
- if (mono) {
- int loop;
- for (loop=0; loop<20; loop++) MaterialColor[loop]=MaterialGray;
- }
- if (smooth) {
- glShadeModel( GL_SMOOTH );
- } else {
- glShadeModel( GL_FLAT );
- }
-
-}
-
-static void init(void)
-{
- printf("Morph 3D - Shows morphing platonic polyhedra\n");
- printf("Author: Marcelo Fernandes Vianna (vianna@cat.cbpf.br)\n\n");
- printf(" [1] - Tetrahedron\n");
- printf(" [2] - Hexahedron (Cube)\n");
- printf(" [3] - Octahedron\n");
- printf(" [4] - Dodecahedron\n");
- printf(" [5] - Icosahedron\n");
- printf("[SPACE] - Toggle colored faces\n");
- printf("[RETURN] - Toggle smooth/flat shading\n");
- printf(" [ESC] - Quit\n");
-
- object=1;
-
- glClearDepth(1.0);
- glClearColor( 0.0, 0.0, 0.0, 0.0 );
- glColor3f( 1.0, 1.0, 1.0 );
-
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
- glFlush();
- primary->Flip( primary, NULL, 0 );
-
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT0, GL_POSITION, position0);
- glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT1, GL_POSITION, position1);
- glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
- glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_LIGHT1);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_NORMALIZE);
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
-
- glHint(GL_FOG_HINT, GL_FASTEST);
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
- glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST);
-
- pinit();
-}
-
-int main( int argc, char *argv[] )
-{
- int quit = 0;
- DFBResult err;
- DFBSurfaceDescription dsc;
-
- DFBCHECK(DirectFBInit( &argc, &argv ));
-
- /* create the super interface */
- DFBCHECK(DirectFBCreate( &dfb ));
-
- /* create an event buffer for all devices with these caps */
- DFBCHECK(dfb->CreateInputEventBuffer( dfb, DICAPS_KEYS, DFB_FALSE, &events ));
-
- /* set our cooperative level to DFSCL_FULLSCREEN
- for exclusive access to the primary layer */
- dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );
-
- /* get the primary surface, i.e. the surface of the
- primary layer we have exclusive access to */
- dsc.flags = DSDESC_CAPS;
- dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE;
-
- DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary ));
-
- /* get the size of the surface and fill it */
- DFBCHECK(primary->GetSize( primary, &screen_width, &screen_height ));
- DFBCHECK(primary->FillRectangle( primary, 0, 0,
- screen_width, screen_height ));
-
- /* create the default font and set it */
- DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font ));
- DFBCHECK(primary->SetFont( primary, font ));
-
- /* get the GL context */
- DFBCHECK(primary->GetGL( primary, &primary_gl ));
-
- DFBCHECK(primary_gl->Lock( primary_gl ));
-
- init();
- reshape(screen_width, screen_height);
-
- DFBCHECK(primary_gl->Unlock( primary_gl ));
-
- T0 = get_millis();
-
- while (!quit) {
- DFBInputEvent evt;
- unsigned long t;
-
- primary->Clear( primary, 0, 0, 0, 0 );
-
- DFBCHECK(primary_gl->Lock( primary_gl ));
-
- draw();
-
- DFBCHECK(primary_gl->Unlock( primary_gl ));
-
- if (fps) {
- char buf[64];
-
- sprintf(buf, "%4.1f FPS\n", fps);
- primary->SetColor( primary, 0xff, 0, 0, 0xff );
- primary->DrawString( primary, buf, -1, screen_width - 5, 5, DSTF_TOPRIGHT );
- }
-
- primary->Flip( primary, NULL, 0 );
- Frames++;
-
-
- t = get_millis();
- if (t - T0 >= 1000) {
- GLfloat seconds = (t - T0) / 1000.0;
-
- fps = Frames / seconds;
-
- T0 = t;
- Frames = 0;
- }
-
-
- while (events->GetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) {
- switch (evt.type) {
- case DIET_KEYPRESS:
- switch (evt.key_symbol) {
- case DIKS_ESCAPE:
- quit = 1;
- break;
- case DIKS_1: object=1; break;
- case DIKS_2: object=2; break;
- case DIKS_3: object=3; break;
- case DIKS_4: object=4; break;
- case DIKS_5: object=5; break;
- case DIKS_SPACE: mono^=1; break;
- case DIKS_ENTER: smooth^=1; break;
- default:
- ;
- }
- pinit();
- break;
- default:
- ;
- }
- }
- }
-
- /* release our interfaces to shutdown DirectFB */
- primary_gl->Release( primary_gl );
- primary->Release( primary );
- font->Release( font );
- events->Release( events );
- dfb->Release( dfb );
-
- return 0;
-}
-
diff --git a/progs/directfb/df_reflect.c b/progs/directfb/df_reflect.c
deleted file mode 100644
index ce4d12f749f..00000000000
--- a/progs/directfb/df_reflect.c
+++ /dev/null
@@ -1,489 +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.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include <directfb.h>
-
-#include <GL/glu.h>
-#include <GL/directfbgl.h>
-
-#include "util/showbuffer.c"
-#include "util/readtex.c"
-
-
-/* the super interface */
-IDirectFB *dfb;
-
-/* the primary surface (surface of primary layer) */
-IDirectFBSurface *primary;
-
-/* the GL context */
-IDirectFBGL *primary_gl;
-
-/* our font */
-IDirectFBFont *font;
-
-/* event buffer */
-IDirectFBEventBuffer *events;
-
-/* macro for a safe call to DirectFB functions */
-#define DFBCHECK(x...) \
- { \
- err = x; \
- if (err != DFB_OK) { \
- fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
- DirectFBErrorFatal( #x, err ); \
- } \
- }
-
-static int screen_width, screen_height;
-
-static unsigned long T0 = 0;
-static GLint Frames = 0;
-static GLfloat fps = 0;
-
-static inline unsigned long get_millis()
-{
- struct timeval tv;
-
- gettimeofday (&tv, NULL);
- return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
-}
-
-/*******************************/
-
-#define DEG2RAD (3.14159/180.0)
-
-#define TABLE_TEXTURE "../images/tile.rgb"
-
-static GLint ImgWidth, ImgHeight;
-static GLenum ImgFormat;
-static GLubyte *Image = NULL;
-
-#define MAX_OBJECTS 2
-static GLint table_list;
-static GLint objects_list[MAX_OBJECTS];
-
-static GLfloat xrot, yrot;
-static GLfloat spin;
-
-static GLint Width = 400, Height = 300;
-static GLenum ShowBuffer = GL_NONE;
-
-
-static void make_table( void )
-{
- static GLfloat table_mat[] = { 1.0, 1.0, 1.0, 0.6 };
- static GLfloat gray[] = { 0.4, 0.4, 0.4, 1.0 };
-
- table_list = glGenLists(1);
- glNewList( table_list, GL_COMPILE );
-
- /* load table's texture */
- glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, table_mat );
-/* glMaterialfv( GL_FRONT, GL_EMISSION, gray );*/
- glMaterialfv( GL_FRONT, GL_DIFFUSE, table_mat );
- glMaterialfv( GL_FRONT, GL_AMBIENT, gray );
-
- /* draw textured square for the table */
- glPushMatrix();
- glScalef( 4.0, 4.0, 4.0 );
- glBegin( GL_POLYGON );
- glNormal3f( 0.0, 1.0, 0.0 );
- glTexCoord2f( 0.0, 0.0 ); glVertex3f( -1.0, 0.0, 1.0 );
- glTexCoord2f( 1.0, 0.0 ); glVertex3f( 1.0, 0.0, 1.0 );
- glTexCoord2f( 1.0, 1.0 ); glVertex3f( 1.0, 0.0, -1.0 );
- glTexCoord2f( 0.0, 1.0 ); glVertex3f( -1.0, 0.0, -1.0 );
- glEnd();
- glPopMatrix();
-
- glDisable( GL_TEXTURE_2D );
-
- glEndList();
-}
-
-
-static void make_objects( void )
-{
- GLUquadricObj *q;
-
- static GLfloat cyan[] = { 0.0, 1.0, 1.0, 1.0 };
- static GLfloat green[] = { 0.2, 1.0, 0.2, 1.0 };
- static GLfloat black[] = { 0.0, 0.0, 0.0, 0.0 };
-
- q = gluNewQuadric();
- gluQuadricDrawStyle( q, GLU_FILL );
- gluQuadricNormals( q, GLU_SMOOTH );
-
- objects_list[0] = glGenLists(1);
- glNewList( objects_list[0], GL_COMPILE );
- glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, cyan );
- glMaterialfv( GL_FRONT, GL_EMISSION, black );
- gluCylinder( q, 0.5, 0.5, 1.0, 15, 1 );
- glEndList();
-
- objects_list[1] = glGenLists(1);
- glNewList( objects_list[1], GL_COMPILE );
- glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green );
- glMaterialfv( GL_FRONT, GL_EMISSION, black );
- gluCylinder( q, 1.5, 0.0, 2.5, 15, 1 );
- glEndList();
-}
-
-
-static void init( void )
-{
- make_table();
- make_objects();
-
- Image = LoadRGBImage( TABLE_TEXTURE, &ImgWidth, &ImgHeight, &ImgFormat );
- if (!Image) {
- printf("Couldn't read %s\n", TABLE_TEXTURE);
- exit(0);
- }
-
- gluBuild2DMipmaps(GL_TEXTURE_2D, 3, ImgWidth, ImgHeight,
- ImgFormat, GL_UNSIGNED_BYTE, Image);
-
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
-
- xrot = 30.0;
- yrot = 50.0;
- spin = 0.0;
-
- glShadeModel( GL_FLAT );
-
- glEnable( GL_LIGHT0 );
- glEnable( GL_LIGHTING );
-
- glClearColor( 0.5, 0.5, 0.9, 0.0 );
-
- glEnable( GL_NORMALIZE );
-}
-
-
-
-static void reshape(int w, int h)
-{
- GLfloat yAspect = 2.5;
- GLfloat xAspect = yAspect * (float) w / (float) h;
- Width = w;
- Height = h;
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum( -xAspect, xAspect, -yAspect, yAspect, 10.0, 30.0 );
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-
-
-static void draw_objects( GLfloat eyex, GLfloat eyey, GLfloat eyez )
-{
- (void) eyex;
- (void) eyey;
- (void) eyez;
-#ifndef USE_ZBUFFER
- if (eyex<0.5) {
-#endif
- glPushMatrix();
- glTranslatef( 1.0, 1.5, 0.0 );
- glRotatef( spin, 1.0, 0.5, 0.0 );
- glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
- glCallList( objects_list[0] );
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*spin) ), 0.0 );
- glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
- glRotatef( spin, 1.0, 0.5, 0.0 );
- glScalef( 0.5, 0.5, 0.5 );
- glCallList( objects_list[1] );
- glPopMatrix();
-#ifndef USE_ZBUFFER
- }
- else {
- glPushMatrix();
- glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*spin) ), 0.0 );
- glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
- glRotatef( spin, 1.0, 0.5, 0.0 );
- glScalef( 0.5, 0.5, 0.5 );
- glCallList( objects_list[1] );
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef( 1.0, 1.5, 0.0 );
- glRotatef( spin, 1.0, 0.5, 0.0 );
- glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
- glCallList( objects_list[0] );
- glPopMatrix();
- }
-#endif
-}
-
-
-
-static void draw_table( void )
-{
- glCallList( table_list );
-}
-
-
-
-static void draw( void )
-{
- static GLfloat light_pos[] = { 0.0, 20.0, 0.0, 1.0 };
- GLfloat dist = 20.0;
- GLfloat eyex, eyey, eyez;
-
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
-
-
- eyex = dist * cos(yrot*DEG2RAD) * cos(xrot*DEG2RAD);
- eyez = dist * sin(yrot*DEG2RAD) * cos(xrot*DEG2RAD);
- eyey = dist * sin(xrot*DEG2RAD);
-
- /* view from top */
- glPushMatrix();
- gluLookAt( eyex, eyey, eyez, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 );
-
- glLightfv( GL_LIGHT0, GL_POSITION, light_pos );
-
- /* draw table into stencil planes */
- glDisable( GL_DEPTH_TEST );
- glEnable( GL_STENCIL_TEST );
- glStencilFunc( GL_ALWAYS, 1, 0xffffffff );
- glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE );
- glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE );
- draw_table();
- glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
-
- glEnable( GL_DEPTH_TEST );
-
- /* render view from below (reflected viewport) */
- /* only draw where stencil==1 */
- if (eyey>0.0) {
- glPushMatrix();
-
- glStencilFunc( GL_EQUAL, 1, 0xffffffff ); /* draw if ==1 */
- glStencilOp( GL_KEEP, GL_KEEP, GL_KEEP );
- glScalef( 1.0, -1.0, 1.0 );
-
- /* Reposition light in reflected space. */
- glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
-
- draw_objects(eyex, eyey, eyez);
- glPopMatrix();
-
- /* Restore light's original unreflected position. */
- glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
- }
-
- glDisable( GL_STENCIL_TEST );
-
- glEnable( GL_BLEND );
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-
- glEnable( GL_TEXTURE_2D );
- draw_table();
- glDisable( GL_TEXTURE_2D );
- glDisable( GL_BLEND );
-
- /* view from top */
- glPushMatrix();
-
- draw_objects(eyex, eyey, eyez);
-
- glPopMatrix();
-
- glPopMatrix();
-
- if (ShowBuffer == GL_DEPTH) {
- ShowDepthBuffer(Width, Height, 1.0, 0.0);
- }
- else if (ShowBuffer == GL_STENCIL) {
- ShowStencilBuffer(Width, Height, 255.0, 0.0);
- }
- else if (ShowBuffer == GL_ALPHA) {
- ShowAlphaBuffer(Width, Height);
- }
-}
-
-/*******************************/
-
-int main( int argc, char *argv[] )
-{
- int quit = 0;
- DFBResult err;
- DFBSurfaceDescription dsc;
-
- DFBCHECK(DirectFBInit( &argc, &argv ));
-
- /* create the super interface */
- DFBCHECK(DirectFBCreate( &dfb ));
-
- /* create an event buffer for all devices with these caps */
- DFBCHECK(dfb->CreateInputEventBuffer( dfb, DICAPS_ALL, DFB_FALSE, &events ));
-
- /* set our cooperative level to DFSCL_FULLSCREEN
- for exclusive access to the primary layer */
- dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );
-
- /* get the primary surface, i.e. the surface of the
- primary layer we have exclusive access to */
- dsc.flags = DSDESC_CAPS;
- dsc.caps = (DFBSurfaceCapabilities)(DSCAPS_PRIMARY | DSCAPS_DOUBLE);
-
- DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary ));
-
- /* get the size of the surface and fill it */
- DFBCHECK(primary->GetSize( primary, &screen_width, &screen_height ));
- DFBCHECK(primary->FillRectangle( primary, 0, 0,
- screen_width, screen_height ));
-
- /* create the default font and set it */
- DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font ));
- DFBCHECK(primary->SetFont( primary, font ));
-
- /* get the GL context */
- DFBCHECK(primary->GetGL( primary, &primary_gl ));
-
- DFBCHECK(primary_gl->Lock( primary_gl ));
-
- init();
- reshape(screen_width, screen_height);
-
- DFBCHECK(primary_gl->Unlock( primary_gl ));
-
- T0 = get_millis();
-
- while (!quit) {
- DFBInputEvent evt;
- unsigned long t;
-
- DFBCHECK(primary_gl->Lock( primary_gl ));
-
- draw();
-
- DFBCHECK(primary_gl->Unlock( primary_gl ));
-
- if (fps) {
- char buf[64];
-
- sprintf(buf, "%4.1f FPS\n", fps);
- primary->SetColor( primary, 0xff, 0, 0, 0xff );
- primary->DrawString( primary, buf, -1, screen_width - 5, 5, DSTF_TOPRIGHT );
- }
-
- primary->Flip( primary, NULL, (DFBSurfaceFlipFlags)0 );
- Frames++;
-
-
- t = get_millis();
- if (t - T0 >= 1000) {
- GLfloat seconds = (t - T0) / 1000.0;
-
- fps = Frames / seconds;
-
- T0 = t;
- Frames = 0;
- }
-
-
- while (events->GetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) {
- switch (evt.type) {
- case DIET_KEYPRESS:
- switch (DFB_LOWER_CASE(evt.key_symbol)) {
- case DIKS_ESCAPE:
- quit = 1;
- break;
- case DIKS_CURSOR_UP:
- xrot += 3.0;
- if ( xrot > 85 )
- xrot = 85;
- break;
- case DIKS_CURSOR_DOWN:
- xrot -= 3.0;
- if ( xrot < 5 )
- xrot = 5;
- break;
- case DIKS_CURSOR_LEFT:
- yrot += 3.0;
- break;
- case DIKS_CURSOR_RIGHT:
- yrot -= 3.0;
- break;
- case DIKS_SMALL_D:
- ShowBuffer = GL_DEPTH;
- break;
- case DIKS_SMALL_S:
- ShowBuffer = GL_STENCIL;
- break;
- case DIKS_SMALL_A:
- ShowBuffer = GL_ALPHA;
- break;
- default:
- ShowBuffer = GL_NONE;
- }
- break;
- case DIET_AXISMOTION:
- if (evt.flags & DIEF_AXISREL) {
- switch (evt.axis) {
- case DIAI_X:
- yrot += evt.axisrel / 2.0;
- break;
- case DIAI_Y:
- xrot += evt.axisrel / 2.0;
- break;
- default:
- ;
- }
- }
- break;
- default:
- ;
- }
- }
-
- spin += 2.0;
- yrot += 3.0;
- }
-
- /* release our interfaces to shutdown DirectFB */
- primary_gl->Release( primary_gl );
- primary->Release( primary );
- font->Release( font );
- events->Release( events );
- dfb->Release( dfb );
-
- return 0;
-}
-
diff --git a/progs/directfb/multi_window.c b/progs/directfb/multi_window.c
deleted file mode 100644
index 9bb0e4be8ef..00000000000
--- a/progs/directfb/multi_window.c
+++ /dev/null
@@ -1,240 +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.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-#include <directfb.h>
-#include <directfbgl.h>
-
-
-typedef struct {
- IDirectFBWindow *window;
- IDirectFBSurface *surface;
- IDirectFBGL *gl;
-
- int width;
- int height;
-
- unsigned long last_time;
- int frames;
- float fps;
-} Context;
-
-static const GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0};
-
-static IDirectFB *dfb;
-static IDirectFBDisplayLayer *layer;
-static IDirectFBFont *font;
-static IDirectFBEventBuffer *events = NULL;
-
-/* macro for a safe call to DirectFB functions */
-#define DFBCHECK(x...) \
- do { \
- ret = x; \
- if (ret != DFB_OK) { \
- fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
- DirectFBErrorFatal( #x, ret ); \
- } \
- } while (0)
-
-
-static inline unsigned long get_millis()
-{
- struct timeval tv;
-
- gettimeofday (&tv, NULL);
- return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
-}
-
-
-static void
-setup( Context *context )
-{
- GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0};
-
- context->surface->GetSize( context->surface,
- &context->width, &context->height );
-
- context->gl->Lock( context->gl );
-
- glLightfv(GL_LIGHT0, GL_POSITION, pos);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- glViewport(0, 0, context->width, context->height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(70.0, context->width / (float) context->height, 1.0, 80.0);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -40.0);
-
- context->gl->Unlock( context->gl );
-}
-
-static void
-update( Context *context )
-{
- unsigned long t;
- IDirectFBSurface *surface = context->surface;
- static __u8 r = 0, g = 0, b = 0;
-
-
- context->gl->Lock( context->gl );
-
- glClearColor( r++/255.0, g++/255.0, b++/255.0, 1.0 );
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- context->gl->Unlock( context->gl );
-
- if (context->fps) {
- char buf[16];
-
- snprintf(buf, sizeof(buf), "%.1f FPS\n", context->fps);
-
- surface->SetColor( surface, 0xff, 0x00, 0x00, 0xff );
- surface->DrawString( surface, buf, -1,
- context->width - 5, 5, DSTF_TOPRIGHT );
- }
-
- surface->Flip( surface, NULL, 0 );
-
- context->frames++;
-
- t = get_millis();
- if (t - context->last_time >= 2000) {
- float seconds = (t - context->last_time) / 1000.0f;
-
- context->fps = context->frames / seconds;
-
- context->last_time = t;
- context->frames = 0;
- }
-}
-
-int
-main( int argc, char *argv[] )
-{
- DFBResult ret;
- int i;
- int quit = 0;
- const int num = 2;
- Context contexts[num];
-
- DFBCHECK(DirectFBInit( &argc, &argv ));
-
- /* create the super interface */
- DFBCHECK(DirectFBCreate( &dfb ));
-
- DFBCHECK(dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer ));
-
- /* create the default font */
- DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font ));
-
- for (i=0; i<num; i++) {
- IDirectFBWindow *window;
- IDirectFBSurface *surface;
- IDirectFBGL *gl;
- DFBWindowDescription desc;
-
- desc.flags = DWDESC_POSX | DWDESC_POSY |
- DWDESC_WIDTH | DWDESC_HEIGHT;
- desc.posx = (i%3) * 200 + 10;
- desc.posy = (i/3) * 200 + 10;
- desc.width = 180;
- desc.height = 180;
-
- DFBCHECK(layer->CreateWindow( layer, &desc, &window ));
- DFBCHECK(window->GetSurface( window, &surface ));
- DFBCHECK(surface->GetGL( surface, &gl ));
-
- contexts[i].window = window;
- contexts[i].surface = surface;
- contexts[i].gl = gl;
-
- contexts[i].last_time = get_millis();
- contexts[i].frames = 0;
- contexts[i].fps = 0;
-
- setup( &contexts[i] );
-
- if (events)
- DFBCHECK(window->AttachEventBuffer( window, events ));
- else
- DFBCHECK(window->CreateEventBuffer( window, &events ));
-
- DFBCHECK(surface->SetFont( surface, font ));
-
- window->SetOpacity( window, 0xff );
- }
-
- while (!quit) {
- DFBWindowEvent evt;
-
- for (i=0; i<num; i++)
- update( &contexts[i] );
-
- while (events->GetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) {
- switch (evt.type) {
- case DWET_KEYDOWN:
- switch (evt.key_symbol) {
- case DIKS_ESCAPE:
- quit = 1;
- break;
-
- default:
- break;
- }
- break;
-
- default:
- break;
- }
- }
- }
-
- events->Release( events );
-
- for (i=0; i<num; i++) {
- contexts[i].gl->Release( contexts[i].gl );
- contexts[i].surface->Release( contexts[i].surface );
- contexts[i].window->Release( contexts[i].window );
- }
-
- font->Release( font );
- layer->Release( layer );
- dfb->Release( dfb );
-
- return 0;
-}
-
diff --git a/progs/egl/Makefile b/progs/egl/Makefile
deleted file mode 100644
index 33447a9d575..00000000000
--- a/progs/egl/Makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-# progs/egl/Makefile
-
-TOP = ../..
-include $(TOP)/configs/current
-
-
-INCLUDE_DIRS = -I$(TOP)/include
-
-HEADERS = $(TOP)/include/GLES/egl.h
-
-PROGRAMS = \
- demo1 \
- demo2 \
- demo3 \
- eglinfo \
- eglgears
-
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-
-
-default: $(PROGRAMS)
-
-
-demo1: demo1.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) demo1.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@
-
-demo1.o: demo1.c $(HEADERS)
- $(CC) -c $(CFLAGS) -I$(TOP)/include demo1.c
-
-
-demo2: demo2.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) demo2.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
-
-demo2.o: demo2.c $(HEADERS)
- $(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c
-
-
-demo3: demo3.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) demo3.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
-
-demo3.o: demo3.c $(HEADERS)
- $(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c
-
-
-eglinfo: eglinfo.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@
-
-eglinfo.o: eglinfo.c $(HEADERS)
- $(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
-
-
-eglgears: eglgears.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) eglgears.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
-
-eglgears.o: eglgears.c $(HEADERS)
- $(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c
-
-
-clean:
- rm -f *.o *~
- rm -f *.so
- rm -f $(PROGRAMS)
diff --git a/progs/egl/demo1.c b/progs/egl/demo1.c
deleted file mode 100644
index 9ef17e38b7d..00000000000
--- a/progs/egl/demo1.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Exercise EGL API functions
- */
-
-#include <GLES/egl.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/**
- * Test EGL_MESA_screen_surface functions
- */
-static void
-TestScreens(EGLDisplay dpy)
-{
-#define MAX 8
- EGLScreenMESA screens[MAX];
- EGLint numScreens;
- EGLint i;
-
- eglGetScreensMESA(dpy, screens, MAX, &numScreens);
- printf("Found %d screens\n", numScreens);
- for (i = 0; i < numScreens; i++) {
- printf(" Screen %d handle: %d\n", i, (int) screens[i]);
- }
-}
-
-/**
- * Print table of all available configurations.
- */
-static void
-PrintConfigs(EGLDisplay d)
-{
- EGLConfig *configs;
- EGLint numConfigs, i;
-
- eglGetConfigs(d, NULL, 0, &numConfigs);
- configs = malloc(sizeof(*configs) *numConfigs);
- eglGetConfigs(d, configs, numConfigs, &numConfigs);
-
- printf("Configurations:\n");
- printf(" bf lv d st colorbuffer dp st supported \n");
- printf(" id sz l b ro r g b a th cl surfaces \n");
- printf("----------------------------------------------\n");
- for (i = 0; i < numConfigs; i++) {
- EGLint id, size, level;
- EGLint red, green, blue, alpha;
- EGLint depth, stencil;
- EGLint surfaces;
- EGLint doubleBuf = 1, stereo = 0;
- char surfString[100] = "";
-
- eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
- eglGetConfigAttrib(d, configs[i], EGL_BUFFER_SIZE, &size);
- eglGetConfigAttrib(d, configs[i], EGL_LEVEL, &level);
-
- eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
- eglGetConfigAttrib(d, configs[i], EGL_GREEN_SIZE, &green);
- eglGetConfigAttrib(d, configs[i], EGL_BLUE_SIZE, &blue);
- eglGetConfigAttrib(d, configs[i], EGL_ALPHA_SIZE, &alpha);
- eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
- eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil);
- eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces);
-
- if (surfaces & EGL_WINDOW_BIT)
- strcat(surfString, "win,");
- if (surfaces & EGL_PBUFFER_BIT)
- strcat(surfString, "pb,");
- if (surfaces & EGL_PIXMAP_BIT)
- strcat(surfString, "pix,");
- if (strlen(surfString) > 0)
- surfString[strlen(surfString) - 1] = 0;
-
- printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %-12s\n",
- id, size, level,
- doubleBuf ? 'y' : '.',
- stereo ? 'y' : '.',
- red, green, blue, alpha,
- depth, stencil, surfString);
- }
- free(configs);
-}
-
-
-
-int
-main(int argc, char *argv[])
-{
- int maj, min;
- EGLContext ctx;
- EGLSurface pbuffer;
- EGLConfig configs[10];
- EGLBoolean b;
- const EGLint pbufAttribs[] = {
- EGL_WIDTH, 500,
- EGL_HEIGHT, 500,
- EGL_NONE
- };
-
- /*
- EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- */
- EGLDisplay d = eglGetDisplay("!fb_dri");
- assert(d);
-
- if (!eglInitialize(d, &maj, &min)) {
- printf("demo: eglInitialize failed\n");
- exit(1);
- }
-
- printf("EGL version = %d.%d\n", maj, min);
- printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
-
- PrintConfigs(d);
-
- ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
- if (ctx == EGL_NO_CONTEXT) {
- printf("failed to create context\n");
- return 0;
- }
-
- pbuffer = eglCreatePbufferSurface(d, configs[0], pbufAttribs);
- if (pbuffer == EGL_NO_SURFACE) {
- printf("failed to create pbuffer\n");
- return 0;
- }
-
- b = eglMakeCurrent(d, pbuffer, pbuffer, ctx);
- if (!b) {
- printf("make current failed\n");
- return 0;
- }
-
- b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-
- TestScreens(d);
-
- eglDestroySurface(d, pbuffer);
- eglDestroyContext(d, ctx);
- eglTerminate(d);
-
- return 0;
-}
diff --git a/progs/egl/demo2.c b/progs/egl/demo2.c
deleted file mode 100644
index 17bbca61587..00000000000
--- a/progs/egl/demo2.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Exercise EGL API functions
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <GLES/egl.h>
-
-/*#define FRONTBUFFER*/
-
-static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
-{
- glBegin( GL_QUADS );
- glVertex2f( x1, y1 );
- glVertex2f( x2, y1 );
- glVertex2f( x2, y2 );
- glVertex2f( x1, y2 );
- glEnd();
-}
-
-
-static void redraw(EGLDisplay dpy, EGLSurface surf, int rot)
-{
- printf("Redraw event\n");
-
-#ifdef FRONTBUFFER
- glDrawBuffer( GL_FRONT );
-#else
- glDrawBuffer( GL_BACK );
-#endif
-
- glClearColor( rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX,
- 1);
-
- glClear( GL_COLOR_BUFFER_BIT );
-
- glColor3f( rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX );
- glPushMatrix();
- glRotatef(rot, 0, 0, 1);
- glScalef(.5, .5, .5);
- _subset_Rectf( -1, -1, 1, 1 );
- glPopMatrix();
-
-#ifdef FRONTBUFFER
- glFlush();
-#else
- eglSwapBuffers( dpy, surf );
-#endif
- glFinish();
-}
-
-
-/**
- * Test EGL_MESA_screen_surface functions
- */
-static void
-TestScreens(EGLDisplay dpy)
-{
-#define MAX 8
- EGLScreenMESA screens[MAX];
- EGLint numScreens;
- EGLint i;
-
- eglGetScreensMESA(dpy, screens, MAX, &numScreens);
- printf("Found %d screens\n", numScreens);
- for (i = 0; i < numScreens; i++) {
- printf(" Screen %d handle: %d\n", i, (int) screens[i]);
- }
-}
-
-
-int
-main(int argc, char *argv[])
-{
- int maj, min;
- EGLContext ctx;
- EGLSurface pbuffer, screen_surf;
- EGLConfig configs[10];
- EGLint numConfigs, i;
- EGLBoolean b;
- const EGLint pbufAttribs[] = {
- EGL_WIDTH, 500,
- EGL_HEIGHT, 500,
- EGL_NONE
- };
- const EGLint screenAttribs[] = {
- EGL_WIDTH, 1024,
- EGL_HEIGHT, 768,
- EGL_NONE
- };
- EGLModeMESA mode;
- EGLScreenMESA screen;
- EGLint count;
-
- /*
- EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- */
- EGLDisplay d = eglGetDisplay("!fb_dri");
- assert(d);
-
- if (!eglInitialize(d, &maj, &min)) {
- printf("demo: eglInitialize failed\n");
- exit(1);
- }
-
- printf("EGL version = %d.%d\n", maj, min);
- printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
-
- eglGetConfigs(d, configs, 10, &numConfigs);
- printf("Got %d EGL configs:\n", numConfigs);
- for (i = 0; i < numConfigs; i++) {
- EGLint id, red, depth;
- eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
- eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
- eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
- printf("%2d: Red Size = %d Depth Size = %d\n", id, red, depth);
- }
-
- eglGetScreensMESA(d, &screen, 1, &count);
- eglGetModesMESA(d, screen, &mode, 1, &count);
-
- ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
- if (ctx == EGL_NO_CONTEXT) {
- printf("failed to create context\n");
- return 0;
- }
-
- pbuffer = eglCreatePbufferSurface(d, configs[0], pbufAttribs);
- if (pbuffer == EGL_NO_SURFACE) {
- printf("failed to create pbuffer\n");
- return 0;
- }
-
- b = eglMakeCurrent(d, pbuffer, pbuffer, ctx);
- if (!b) {
- printf("make current failed\n");
- return 0;
- }
-
- b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-
- screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
- if (screen_surf == EGL_NO_SURFACE) {
- printf("failed to create screen surface\n");
- return 0;
- }
-
- eglShowScreenSurfaceMESA(d, screen, screen_surf, mode);
-
- b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
- if (!b) {
- printf("make current failed\n");
- return 0;
- }
-
- glViewport(0, 0, 1024, 768);
- glDrawBuffer( GL_FRONT );
-
- glClearColor( 0,
- 1.0,
- 0,
- 1);
-
- glClear( GL_COLOR_BUFFER_BIT );
-
-
- TestScreens(d);
-
- glShadeModel( GL_FLAT );
-
- for (i = 0; i < 6; i++) {
- redraw(d, screen_surf, i*10 );
-
- printf("sleep(1)\n");
- sleep(1);
- }
-
- eglDestroySurface(d, pbuffer);
- eglDestroyContext(d, ctx);
- eglTerminate(d);
-
- return 0;
-}
diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c
deleted file mode 100644
index 9edf7c952b3..00000000000
--- a/progs/egl/demo3.c
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * Exercise EGL API functions
- */
-
-#include <GLES/egl.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-
-#define PIXEL_CENTER(x) ((long)(x) + 0.5)
-
-#define GAP 10
-#define ROWS 3
-#define COLS 4
-
-#define OPENGL_WIDTH 48
-#define OPENGL_HEIGHT 13
-
-
-GLenum rgb, doubleBuffer, windType;
-GLint windW, windH;
-
-GLenum mode1, mode2;
-GLint boxW, boxH;
-GLubyte OpenGL_bits[] = {
- 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
- 0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01,
- 0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01,
- 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
- 0x3e, 0x8f, 0xb7, 0xf9, 0xfc, 0x01,
- 0x63, 0xdb, 0xb0, 0x8d, 0x0d, 0x00,
- 0x63, 0xdb, 0xb7, 0x8d, 0x0d, 0x00,
- 0x63, 0xdb, 0xb6, 0x8d, 0x0d, 0x00,
- 0x63, 0x8f, 0xf3, 0xcc, 0x0d, 0x00,
- 0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0a,
- 0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0e,
- 0x63, 0x00, 0x00, 0x8c, 0xed, 0x0e,
- 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
-};
-
-
-static void Init(void)
-{
-
- mode1 = GL_TRUE;
- mode2 = GL_TRUE;
-}
-
-static void Reshape(int width, int height)
-{
-
- windW = (GLint)width;
- windH = (GLint)height;
-}
-
-#if 0
-static void RotateColorMask(void)
-{
- static GLint rotation = 0;
-
- rotation = (rotation + 1) & 0x3;
- switch (rotation) {
- case 0:
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- glIndexMask( 0xff );
- break;
- case 1:
- glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE);
- glIndexMask(0xFE);
- break;
- case 2:
- glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE);
- glIndexMask(0xFD);
- break;
- case 3:
- glColorMask(GL_TRUE, GL_TRUE, GL_FALSE, GL_TRUE);
- glIndexMask(0xFB);
- break;
- }
-}
-#endif
-
-static void Viewport(GLint row, GLint column)
-{
- GLint x, y;
-
- boxW = (windW - (COLS + 1) * GAP) / COLS;
- boxH = (windH - (ROWS + 1) * GAP) / ROWS;
-
- x = GAP + column * (boxW + GAP);
- y = GAP + row * (boxH + GAP);
-
- glViewport(x, y, boxW, boxH);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-boxW/2, boxW/2, -boxH/2, boxH/2, 0.0, 1.0);
- glMatrixMode(GL_MODELVIEW);
-
- glEnable(GL_SCISSOR_TEST);
- glScissor(x, y, boxW, boxH);
-}
-
-enum {
- COLOR_BLACK = 0,
- COLOR_RED,
- COLOR_GREEN,
- COLOR_YELLOW,
- COLOR_BLUE,
- COLOR_MAGENTA,
- COLOR_CYAN,
- COLOR_WHITE
-};
-
-static float RGBMap[9][3] = {
- {0, 0, 0},
- {1, 0, 0},
- {0, 1, 0},
- {1, 1, 0},
- {0, 0, 1},
- {1, 0, 1},
- {0, 1, 1},
- {1, 1, 1},
- {0.5, 0.5, 0.5}
-};
-
-static void SetColor(int c)
-{
- glColor3fv(RGBMap[c]);
-}
-
-static void Point(void)
-{
- GLint i;
-
- glBegin(GL_POINTS);
- SetColor(COLOR_WHITE);
- glVertex2i(0, 0);
- for (i = 1; i < 8; i++) {
- GLint j = i * 2;
- SetColor(COLOR_BLACK+i);
- glVertex2i(-j, -j);
- glVertex2i(-j, 0);
- glVertex2i(-j, j);
- glVertex2i(0, j);
- glVertex2i(j, j);
- glVertex2i(j, 0);
- glVertex2i(j, -j);
- glVertex2i(0, -j);
- }
- glEnd();
-}
-
-static void Lines(void)
-{
- GLint i;
-
- glPushMatrix();
-
- glTranslatef(-12, 0, 0);
- for (i = 1; i < 8; i++) {
- SetColor(COLOR_BLACK+i);
- glBegin(GL_LINES);
- glVertex2i(-boxW/4, -boxH/4);
- glVertex2i(boxW/4, boxH/4);
- glEnd();
- glTranslatef(4, 0, 0);
- }
-
- glPopMatrix();
-
- glBegin(GL_LINES);
- glVertex2i(0, 0);
- glEnd();
-}
-
-static void LineStrip(void)
-{
-
- glBegin(GL_LINE_STRIP);
- SetColor(COLOR_RED);
- glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(-boxH/4));
- SetColor(COLOR_GREEN);
- glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(boxH/4));
- SetColor(COLOR_BLUE);
- glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(boxH/4));
- SetColor(COLOR_WHITE);
- glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(-boxH/4));
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex2i(0, 0);
- glEnd();
-}
-
-static void LineLoop(void)
-{
-
- glBegin(GL_LINE_LOOP);
- SetColor(COLOR_RED);
- glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(-boxH/4));
- SetColor(COLOR_GREEN);
- glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(boxH/4));
- SetColor(COLOR_BLUE);
- glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(boxH/4));
- SetColor(COLOR_WHITE);
- glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(-boxH/4));
- glEnd();
-
- glEnable(GL_LOGIC_OP);
- glLogicOp(GL_XOR);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
-
- SetColor(COLOR_MAGENTA);
- glBegin(GL_LINE_LOOP);
- glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(-boxH/8));
- glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(boxH/8));
- glEnd();
- glBegin(GL_LINE_LOOP);
- glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(boxH/8+5));
- glVertex2f(PIXEL_CENTER(boxW/8), PIXEL_CENTER(boxH/8+5));
- glEnd();
- glDisable(GL_LOGIC_OP);
- glDisable(GL_BLEND);
-
- SetColor(COLOR_GREEN);
- glBegin(GL_POINTS);
- glVertex2i(0, 0);
- glEnd();
-
- glBegin(GL_LINE_LOOP);
- glVertex2i(0, 0);
- glEnd();
-}
-
-static void Bitmap(void)
-{
-
- glBegin(GL_LINES);
- SetColor(COLOR_GREEN);
- glVertex2i(-boxW/2, 0);
- glVertex2i(boxW/2, 0);
- glVertex2i(0, -boxH/2);
- glVertex2i(0, boxH/2);
- SetColor(COLOR_RED);
- glVertex2i(0, -3);
- glVertex2i(0, -3+OPENGL_HEIGHT);
- SetColor(COLOR_BLUE);
- glVertex2i(0, -3);
- glVertex2i(OPENGL_WIDTH, -3);
- glEnd();
-
- SetColor(COLOR_GREEN);
-
- glPixelStorei(GL_UNPACK_LSB_FIRST, GL_TRUE);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- glRasterPos2i(0, 0);
- glBitmap(OPENGL_WIDTH, OPENGL_HEIGHT, 0, 3, 0.0, 0.0, OpenGL_bits);
-}
-
-static void Triangles(void)
-{
-
- glBegin(GL_TRIANGLES);
- SetColor(COLOR_GREEN);
- glVertex2i(-boxW/4, -boxH/4);
- SetColor(COLOR_RED);
- glVertex2i(-boxW/8, -boxH/16);
- SetColor(COLOR_BLUE);
- glVertex2i(boxW/8, -boxH/16);
-
- SetColor(COLOR_GREEN);
- glVertex2i(-boxW/4, boxH/4);
- SetColor(COLOR_RED);
- glVertex2i(-boxW/8, boxH/16);
- SetColor(COLOR_BLUE);
- glVertex2i(boxW/8, boxH/16);
- glEnd();
-
- glBegin(GL_TRIANGLES);
- glVertex2i(0, 0);
- glVertex2i(-100, 100);
- glEnd();
-}
-
-static void TriangleStrip(void)
-{
-
- glBegin(GL_TRIANGLE_STRIP);
- SetColor(COLOR_GREEN);
- glVertex2i(-boxW/4, -boxH/4);
- SetColor(COLOR_RED);
- glVertex2i(-boxW/4, boxH/4);
- SetColor(COLOR_BLUE);
- glVertex2i(0, -boxH/4);
- SetColor(COLOR_WHITE);
- glVertex2i(0, boxH/4);
- SetColor(COLOR_CYAN);
- glVertex2i(boxW/4, -boxH/4);
- SetColor(COLOR_YELLOW);
- glVertex2i(boxW/4, boxH/4);
- glEnd();
-
- glBegin(GL_TRIANGLE_STRIP);
- glVertex2i(0, 0);
- glVertex2i(-100, 100);
- glEnd();
-}
-
-static void TriangleFan(void)
-{
- GLint vx[8][2];
- GLint x0, y0, x1, y1, x2, y2, x3, y3;
- GLint i;
-
- y0 = -boxH/4;
- y1 = y0 + boxH/2/3;
- y2 = y1 + boxH/2/3;
- y3 = boxH/4;
- x0 = -boxW/4;
- x1 = x0 + boxW/2/3;
- x2 = x1 + boxW/2/3;
- x3 = boxW/4;
-
- vx[0][0] = x0; vx[0][1] = y1;
- vx[1][0] = x0; vx[1][1] = y2;
- vx[2][0] = x1; vx[2][1] = y3;
- vx[3][0] = x2; vx[3][1] = y3;
- vx[4][0] = x3; vx[4][1] = y2;
- vx[5][0] = x3; vx[5][1] = y1;
- vx[6][0] = x2; vx[6][1] = y0;
- vx[7][0] = x1; vx[7][1] = y0;
-
- glBegin(GL_TRIANGLE_FAN);
- SetColor(COLOR_WHITE);
- glVertex2i(0, 0);
- for (i = 0; i < 8; i++) {
- SetColor(COLOR_WHITE-i);
- glVertex2iv(vx[i]);
- }
- glEnd();
-
- glBegin(GL_TRIANGLE_FAN);
- glVertex2i(0, 0);
- glVertex2i(-100, 100);
- glEnd();
-}
-
-static void Rect(void)
-{
-
- SetColor(COLOR_GREEN);
- glRecti(-boxW/4, -boxH/4, boxW/4, boxH/4);
-}
-
-static void PolygonFunc(void)
-{
- GLint vx[8][2];
- GLint x0, y0, x1, y1, x2, y2, x3, y3;
- GLint i;
-
- y0 = -boxH/4;
- y1 = y0 + boxH/2/3;
- y2 = y1 + boxH/2/3;
- y3 = boxH/4;
- x0 = -boxW/4;
- x1 = x0 + boxW/2/3;
- x2 = x1 + boxW/2/3;
- x3 = boxW/4;
-
- vx[0][0] = x0; vx[0][1] = y1;
- vx[1][0] = x0; vx[1][1] = y2;
- vx[2][0] = x1; vx[2][1] = y3;
- vx[3][0] = x2; vx[3][1] = y3;
- vx[4][0] = x3; vx[4][1] = y2;
- vx[5][0] = x3; vx[5][1] = y1;
- vx[6][0] = x2; vx[6][1] = y0;
- vx[7][0] = x1; vx[7][1] = y0;
-
- glBegin(GL_POLYGON);
- for (i = 0; i < 8; i++) {
- SetColor(COLOR_WHITE-i);
- glVertex2iv(vx[i]);
- }
- glEnd();
-
- glBegin(GL_POLYGON);
- glVertex2i(0, 0);
- glVertex2i(100, 100);
- glEnd();
-}
-
-static void Quads(void)
-{
-
- glBegin(GL_QUADS);
- SetColor(COLOR_GREEN);
- glVertex2i(-boxW/4, -boxH/4);
- SetColor(COLOR_RED);
- glVertex2i(-boxW/8, -boxH/16);
- SetColor(COLOR_BLUE);
- glVertex2i(boxW/8, -boxH/16);
- SetColor(COLOR_WHITE);
- glVertex2i(boxW/4, -boxH/4);
-
- SetColor(COLOR_GREEN);
- glVertex2i(-boxW/4, boxH/4);
- SetColor(COLOR_RED);
- glVertex2i(-boxW/8, boxH/16);
- SetColor(COLOR_BLUE);
- glVertex2i(boxW/8, boxH/16);
- SetColor(COLOR_WHITE);
- glVertex2i(boxW/4, boxH/4);
- glEnd();
-
- glBegin(GL_QUADS);
- glVertex2i(0, 0);
- glVertex2i(100, 100);
- glVertex2i(-100, 100);
- glEnd();
-}
-
-static void QuadStrip(void)
-{
-
- glBegin(GL_QUAD_STRIP);
- SetColor(COLOR_GREEN);
- glVertex2i(-boxW/4, -boxH/4);
- SetColor(COLOR_RED);
- glVertex2i(-boxW/4, boxH/4);
- SetColor(COLOR_BLUE);
- glVertex2i(0, -boxH/4);
- SetColor(COLOR_WHITE);
- glVertex2i(0, boxH/4);
- SetColor(COLOR_CYAN);
- glVertex2i(boxW/4, -boxH/4);
- SetColor(COLOR_YELLOW);
- glVertex2i(boxW/4, boxH/4);
- glEnd();
-
- glBegin(GL_QUAD_STRIP);
- glVertex2i(0, 0);
- glVertex2i(100, 100);
- glVertex2i(-100, 100);
- glEnd();
-}
-
-static void Draw(EGLDisplay dpy, EGLSurface surf)
-{
-
- glViewport(0, 0, windW, windH);
- glDisable(GL_SCISSOR_TEST);
-
- glPushAttrib(GL_COLOR_BUFFER_BIT);
-
- glColorMask(1, 1, 1, 1);
- glIndexMask(~0);
-
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glPopAttrib();
-
- if (mode1) {
- glShadeModel(GL_SMOOTH);
- } else {
- glShadeModel(GL_FLAT);
- }
-
- if (mode2) {
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- } else {
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- }
-
- Viewport(0, 0); Point();
- Viewport(0, 1); Lines();
- Viewport(0, 2); LineStrip();
- Viewport(0, 3); LineLoop();
-
- Viewport(1, 0); Bitmap();
-
- Viewport(1, 1); TriangleFan();
- Viewport(1, 2); Triangles();
- Viewport(1, 3); TriangleStrip();
-
- Viewport(2, 0); Rect();
- Viewport(2, 1); PolygonFunc();
- Viewport(2, 2); Quads();
- Viewport(2, 3); QuadStrip();
-
- glFlush();
-
- if (doubleBuffer) {
- eglSwapBuffers(dpy, surf);
- }
-}
-
-static void
-write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
-{
- const int binary = 0;
- FILE *f = fopen( filename, "w" );
- if (f) {
- int i, x, y;
- const GLubyte *ptr = buffer;
- if (binary) {
- fprintf(f,"P6\n");
- fprintf(f,"# ppm-file created by osdemo.c\n");
- fprintf(f,"%i %i\n", width,height);
- fprintf(f,"255\n");
- fclose(f);
- f = fopen( filename, "ab" ); /* reopen in binary append mode */
- for (y=height-1; y>=0; y--) {
- for (x=0; x<width; x++) {
- i = (y*width + x) * 4;
- fputc(ptr[i], f); /* write red */
- fputc(ptr[i+1], f); /* write green */
- fputc(ptr[i+2], f); /* write blue */
- }
- }
- }
- else {
- /*ASCII*/
- int counter = 0;
- fprintf(f,"P3\n");
- fprintf(f,"# ascii ppm file created by osdemo.c\n");
- fprintf(f,"%i %i\n", width, height);
- fprintf(f,"255\n");
- for (y=height-1; y>=0; y--) {
- for (x=0; x<width; x++) {
- i = (y*width + x) * 4;
- fprintf(f, " %3d %3d %3d", ptr[i], ptr[i+1], ptr[i+2]);
- counter++;
- if (counter % 5 == 0)
- fprintf(f, "\n");
- }
- }
- }
- fclose(f);
- }
-}
-
-#include "../src/egl/main/egldisplay.h"
-
-typedef struct fb_display
-{
- _EGLDisplay Base; /* base class/object */
- void *pFB;
-} fbDisplay;
-
-
-int
-main(int argc, char *argv[])
-{
- int maj, min;
- EGLContext ctx;
- EGLSurface screen_surf;
- EGLConfig configs[10];
- EGLScreenMESA screen;
- EGLModeMESA mode;
- EGLint numConfigs, count;
- EGLBoolean b;
- const EGLint screenAttribs[] = {
- EGL_WIDTH, 1024,
- EGL_HEIGHT, 768,
- EGL_NONE
- };
-
- /*
- EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- */
- EGLDisplay d = eglGetDisplay(":0");
- assert(d);
-
- if (!eglInitialize(d, &maj, &min)) {
- printf("demo: eglInitialize failed\n");
- exit(1);
- }
-
- printf("EGL version = %d.%d\n", maj, min);
- printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
-
- eglGetConfigs(d, configs, 10, &numConfigs);
- eglGetScreensMESA(d, &screen, 1, &count);
- eglGetModesMESA(d, screen, &mode, 1, &count);
-
- ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
- if (ctx == EGL_NO_CONTEXT) {
- printf("failed to create context\n");
- return 0;
- }
-
- screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
- if (screen_surf == EGL_NO_SURFACE) {
- printf("failed to create screen surface\n");
- return 0;
- }
-
- eglShowScreenSurfaceMESA(d, screen, screen_surf, mode);
-
- b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
- if (!b) {
- printf("make current failed\n");
- return 0;
- }
- glViewport(0, 0, 1024, 768);
-
-
- Init();
- Reshape(1024, 768);
-
- glDrawBuffer( GL_FRONT );
- glClearColor( 0, 1.0, 0, 1);
-
- glClear( GL_COLOR_BUFFER_BIT );
-
- doubleBuffer = 1;
- glDrawBuffer( GL_BACK );
-
- Draw(d, screen_surf);
-
- write_ppm("dump.ppm", ((struct fb_display *)_eglLookupDisplay(d))->pFB, 1024, 768);
-
- eglDestroySurface(d, screen_surf);
- eglDestroyContext(d, ctx);
- eglTerminate(d);
-
- return 0;
-}
diff --git a/progs/egl/eglgears.c b/progs/egl/eglgears.c
deleted file mode 100644
index 9feee20d889..00000000000
--- a/progs/egl/eglgears.c
+++ /dev/null
@@ -1,475 +0,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.
- */
-
-/*
- * This is a port of the infamous "glxgears" demo to straight EGL
- * Port by Dane Rushton 10 July 2005
- *
- * No command line options.
- * Program runs for 5 seconds then exits, outputing framerate to console
- */
-
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/gl.h>
-#include <GLES/egl.h>
-#include <assert.h>
-
-#define MAX_CONFIGS 10
-#define MAX_MODES 100
-
-#define BENCHMARK
-
-#ifdef BENCHMARK
-
-/* XXX this probably isn't very portable */
-
-#include <sys/time.h>
-#include <unistd.h>
-
-/* return current time (in seconds) */
-static double
-current_time(void)
-{
- struct timeval tv;
-#ifdef __VMS
- (void) gettimeofday(&tv, NULL );
-#else
- struct timezone tz;
- (void) gettimeofday(&tv, &tz);
-#endif
- return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
-}
-
-#else /*BENCHMARK*/
-
-/* dummy */
-static double
-current_time(void)
-{
- /* update this function for other platforms! */
- static double t = 0.0;
- static int warn = 1;
- if (warn) {
- fprintf(stderr, "Warning: current_time() not implemented!!\n");
- warn = 0;
- }
- return t += 1.0;
-}
-
-#endif /*BENCHMARK*/
-
-
-#ifndef M_PI
-#define M_PI 3.14159265
-#endif
-
-
-static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
-static GLint gear1, gear2, gear3;
-static GLfloat angle = 0.0;
-
-#if 0
-static GLfloat eyesep = 5.0; /* Eye separation. */
-static GLfloat fix_point = 40.0; /* Fixation point distance. */
-static GLfloat left, right, asp; /* Stereo frustum params. */
-#endif
-
-
-/*
- *
- * Draw a gear wheel. You'll probably want to call this function when
- * building a display list since we do a lot of trig here.
- *
- * Input: inner_radius - radius of hole at center
- * outer_radius - radius at center of teeth
- * width - width of gear
- * teeth - number of teeth
- * tooth_depth - depth of tooth
- */
-static void
-gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
- GLint teeth, GLfloat tooth_depth)
-{
- GLint i;
- GLfloat r0, r1, r2;
- GLfloat angle, da;
- GLfloat u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0;
- r2 = outer_radius + tooth_depth / 2.0;
-
- da = 2.0 * M_PI / teeth / 4.0;
-
- glShadeModel(GL_FLAT);
-
- glNormal3f(0.0, 0.0, 1.0);
-
- /* draw front face */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- if (i < teeth) {
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- width * 0.5);
- }
- }
- glEnd();
-
- /* draw front sides of teeth */
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- width * 0.5);
- }
- glEnd();
-
- glNormal3f(0.0, 0.0, -1.0);
-
- /* draw back face */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- if (i < teeth) {
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- }
- }
- glEnd();
-
- /* draw back sides of teeth */
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- -width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- -width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- }
- glEnd();
-
- /* draw outward faces of teeth */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- u = r2 * cos(angle + da) - r1 * cos(angle);
- v = r2 * sin(angle + da) - r1 * sin(angle);
- len = sqrt(u * u + v * v);
- u /= len;
- v /= len;
- glNormal3f(v, -u, 0.0);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- -width * 0.5);
- u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
- v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
- glNormal3f(v, -u, 0.0);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- }
-
- glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
- glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
-
- glEnd();
-
- glShadeModel(GL_SMOOTH);
-
- /* draw inside radius cylinder */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glNormal3f(-cos(angle), -sin(angle), 0.0);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- }
- glEnd();
-}
-
-
-static void
-draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glPushMatrix();
- glRotatef(view_rotx, 1.0, 0.0, 0.0);
- glRotatef(view_roty, 0.0, 1.0, 0.0);
- glRotatef(view_rotz, 0.0, 0.0, 1.0);
-
- glPushMatrix();
- glTranslatef(-3.0, -2.0, 0.0);
- glRotatef(angle, 0.0, 0.0, 1.0);
- glCallList(gear1);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(3.1, -2.0, 0.0);
- glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
- glCallList(gear2);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(-3.1, 4.2, 0.0);
- glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
- glCallList(gear3);
- glPopMatrix();
-
- glPopMatrix();
-}
-
-
-/* new window size or exposure */
-static void
-reshape(int width, int height)
-{
- glViewport(0, 0, (GLint) width, (GLint) height);
-
- GLfloat h = (GLfloat) height / (GLfloat) width;
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -40.0);
-}
-
-
-
-static void
-init(void)
-{
- static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
- static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
- static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
- static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
-
- glLightfv(GL_LIGHT0, GL_POSITION, pos);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = glGenLists(1);
- glNewList(gear1, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0, 4.0, 1.0, 20, 0.7);
- glEndList();
-
- gear2 = glGenLists(1);
- glNewList(gear2, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5, 2.0, 2.0, 10, 0.7);
- glEndList();
-
- gear3 = glGenLists(1);
- glNewList(gear3, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3, 2.0, 0.5, 10, 0.7);
- glEndList();
-
- glEnable(GL_NORMALIZE);
-}
-
-
-
-
-static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
-{
- double st = current_time();
- double ct = st;
- int frames = 0;
- while (ct - st < ttr)
- {
- double tt = current_time();
- double dt = tt - ct;
- ct = tt;
-
- /* advance rotation for next frame */
- angle += 70.0 * dt; /* 70 degrees per second */
- if (angle > 3600.0)
- angle -= 3600.0;
-
- draw();
-
- eglSwapBuffers(dpy, surf);
-
-
- frames++;
- }
-
- GLfloat seconds = ct - st;
- GLfloat fps = frames / seconds;
- printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
-
-}
-
-
-int
-main(int argc, char *argv[])
-{
- int maj, min;
- EGLContext ctx;
- EGLSurface screen_surf;
- EGLConfig configs[MAX_CONFIGS];
- EGLint numConfigs, i;
- EGLBoolean b;
- EGLDisplay d;
- EGLint screenAttribs[10];
- EGLModeMESA mode[MAX_MODES];
- EGLScreenMESA screen;
- EGLint count, chosenMode;
- GLboolean printInfo = GL_FALSE;
- EGLint width = 0, height = 0;
-
- /* parse cmd line args */
- for (i = 1; i < argc; i++)
- {
- if (strcmp(argv[i], "-info") == 0)
- {
- printInfo = GL_TRUE;
- }
- else
- printf("Warning: unknown parameter: %s\n", argv[i]);
- }
-
- /* DBR : Create EGL context/surface etc */
- d = eglGetDisplay(":0");
- assert(d);
-
- if (!eglInitialize(d, &maj, &min)) {
- printf("eglgears: eglInitialize failed\n");
- exit(1);
- }
-
- printf("eglgears: EGL version = %d.%d\n", maj, min);
- printf("eglgears: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
-
- /* XXX use ChooseConfig */
- eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
- eglGetScreensMESA(d, &screen, 1, &count);
-
- if (!eglGetModesMESA(d, screen, mode, MAX_MODES, &count) || count == 0) {
- printf("eglgears: eglGetModesMESA failed!\n");
- return 0;
- }
-
- /* Print list of modes, and find the one to use */
- printf("eglgears: Found %d modes:\n", count);
- for (i = 0; i < count; i++) {
- EGLint w, h;
- eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
- eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
- printf("%3d: %d x %d\n", i, w, h);
- if (w > width && h > height && w <= 1280 && h <= 1024) {
- width = w;
- height = h;
- chosenMode = i;
- }
- }
- printf("eglgears: Using screen mode/size %d: %d x %d\n", chosenMode, width, height);
-
- ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
- if (ctx == EGL_NO_CONTEXT) {
- printf("eglgears: failed to create context\n");
- return 0;
- }
-
- /* build up screenAttribs array */
- i = 0;
- screenAttribs[i++] = EGL_WIDTH;
- screenAttribs[i++] = width;
- screenAttribs[i++] = EGL_HEIGHT;
- screenAttribs[i++] = height;
- screenAttribs[i++] = EGL_NONE;
-
- screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
- if (screen_surf == EGL_NO_SURFACE) {
- printf("eglgears: failed to create screen surface\n");
- return 0;
- }
-
- b = eglShowScreenSurfaceMESA(d, screen, screen_surf, mode[chosenMode]);
- if (!b) {
- printf("eglgears: show surface failed\n");
- return 0;
- }
-
- b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
- if (!b) {
- printf("eglgears: make current failed\n");
- return 0;
- }
-
- if (printInfo)
- {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-
- init();
- reshape(width, height);
-
- glDrawBuffer( GL_BACK );
-
- run_gears(d, screen_surf, 5.0);
-
- eglDestroySurface(d, screen_surf);
- eglDestroyContext(d, ctx);
- eglTerminate(d);
-
- return 0;
-}
diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c
deleted file mode 100644
index f9c24754457..00000000000
--- a/progs/egl/eglinfo.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * eglinfo - like glxinfo but for EGL
- *
- * Brian Paul
- * 11 March 2005
- *
- * 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 <GLES/egl.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define MAX_CONFIGS 1000
-#define MAX_MODES 1000
-#define MAX_SCREENS 10
-
-
-/**
- * Print table of all available configurations.
- */
-static void
-PrintConfigs(EGLDisplay d)
-{
- EGLConfig configs[MAX_CONFIGS];
- EGLint numConfigs, i;
-
- eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
-
- printf("Configurations:\n");
- printf(" bf lv d st colorbuffer dp st supported\n");
- printf(" id sz l b ro r g b a th cl surfaces \n");
- printf("---------------------------------------------------\n");
- for (i = 0; i < numConfigs; i++) {
- EGLint id, size, level;
- EGLint red, green, blue, alpha;
- EGLint depth, stencil;
- EGLint surfaces;
- EGLint doubleBuf = 1, stereo = 0;
- char surfString[100] = "";
-
- eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
- eglGetConfigAttrib(d, configs[i], EGL_BUFFER_SIZE, &size);
- eglGetConfigAttrib(d, configs[i], EGL_LEVEL, &level);
-
- eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
- eglGetConfigAttrib(d, configs[i], EGL_GREEN_SIZE, &green);
- eglGetConfigAttrib(d, configs[i], EGL_BLUE_SIZE, &blue);
- eglGetConfigAttrib(d, configs[i], EGL_ALPHA_SIZE, &alpha);
- eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
- eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil);
- eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces);
-
- if (surfaces & EGL_WINDOW_BIT)
- strcat(surfString, "win,");
- if (surfaces & EGL_PBUFFER_BIT)
- strcat(surfString, "pb,");
- if (surfaces & EGL_PIXMAP_BIT)
- strcat(surfString, "pix,");
-#ifdef EGL_MESA_screen_surface
- if (surfaces & EGL_SCREEN_BIT_MESA)
- strcat(surfString, "scrn,");
-#endif
- if (strlen(surfString) > 0)
- surfString[strlen(surfString) - 1] = 0;
-
- printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %-12s\n",
- id, size, level,
- doubleBuf ? 'y' : '.',
- stereo ? 'y' : '.',
- red, green, blue, alpha,
- depth, stencil, surfString);
- }
-}
-
-
-/**
- * Print table of all available configurations.
- */
-static void
-PrintModes(EGLDisplay d)
-{
-#ifdef EGL_MESA_screen_surface
- const char *extensions = eglQueryString(d, EGL_EXTENSIONS);
- if (strstr(extensions, "EGL_MESA_screen_surface")) {
- EGLScreenMESA screens[MAX_SCREENS];
- EGLint numScreens = 1, scrn;
- EGLModeMESA modes[MAX_MODES];
-
- eglGetScreensMESA(d, screens, MAX_SCREENS, &numScreens);
- printf("Number of Screens: %d\n\n", numScreens);
-
- for (scrn = 0; scrn < numScreens; scrn++) {
- EGLint numModes, i;
-
- eglGetModesMESA(d, screens[scrn], modes, MAX_MODES, &numModes);
-
- printf("Screen %d Modes:\n", scrn);
- printf(" id width height refresh name\n");
- printf("-----------------------------------------\n");
- for (i = 0; i < numModes; i++) {
- EGLint id, w, h, r;
- const char *str;
- eglGetModeAttribMESA(d, modes[i], EGL_MODE_ID_MESA, &id);
- eglGetModeAttribMESA(d, modes[i], EGL_WIDTH, &w);
- eglGetModeAttribMESA(d, modes[i], EGL_HEIGHT, &h);
- eglGetModeAttribMESA(d, modes[i], EGL_REFRESH_RATE_MESA, &r);
- str = eglQueryModeStringMESA(d, modes[i]);
- printf("0x%02x %5d %5d %.3f %s\n", id, w, h, r / 1000.0, str);
- }
- }
- }
-#endif
-}
-
-
-
-int
-main(int argc, char *argv[])
-{
- int maj, min;
- /*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
- EGLDisplay d = eglGetDisplay(":0");
-
- if (!eglInitialize(d, &maj, &min)) {
- printf("eglinfo: eglInitialize failed\n");
- exit(1);
- }
-
- printf("EGL API version: %d.%d\n", maj, min);
- printf("EGL vendor string: %s\n", eglQueryString(d, EGL_VENDOR));
- printf("EGL version string: %s\n", eglQueryString(d, EGL_VERSION));
- printf("EGL extensions string:\n");
- printf(" %s\n", eglQueryString(d, EGL_EXTENSIONS));
- printf("\n");
-
- PrintConfigs(d);
-
- printf("\n");
-
- PrintModes(d);
-
- eglTerminate(d);
-
- return 0;
-}
diff --git a/progs/fbdev/Makefile b/progs/fbdev/Makefile
deleted file mode 100644
index 0a0c77906f7..00000000000
--- a/progs/fbdev/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Makefile for miniglx demo programs
-
-TOP = ../..
-
-include $(TOP)/configs/current
-
-
-SOURCES = glfbdevtest.c
-
-OBJECTS = $(SOURCES:.c=.o)
-
-PROGS = $(SOURCES:%.c=%)
-
-INCLUDES = \
- -I. \
- -I$(TOP)/include
-
-
-##### RULES #####
-
-.SUFFIXES:
-.SUFFIXES: .c
-
-.c:
- $(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend $(PROGS)
-
-clean:
- rm -f $(PROGS)
- rm -f *.o
-
-
-depend: $(SOURCES)
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-include depend
diff --git a/progs/fbdev/glfbdevtest.c b/progs/fbdev/glfbdevtest.c
deleted file mode 100644
index a461c55e2f8..00000000000
--- a/progs/fbdev/glfbdevtest.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Test the GLFBDev interface. Only tested with radeonfb driver!!!!
- *
- * Written by Brian Paul
- */
-
-
-#include <assert.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <linux/fb.h>
-#include <linux/kd.h>
-#include <linux/vt.h>
-#include <GL/gl.h>
-#include <GL/glfbdev.h>
-#include <math.h>
-
-#define DEFAULT_DEPTH 8
-
-static struct fb_fix_screeninfo FixedInfo;
-static struct fb_var_screeninfo VarInfo, OrigVarInfo;
-static int DesiredDepth = 0;
-static int OriginalVT = -1;
-static int ConsoleFD = -1;
-static int FrameBufferFD = -1;
-static caddr_t FrameBuffer = (caddr_t) -1;
-static caddr_t MMIOAddress = (caddr_t) -1;
-
-
-static void
-print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s)
-{
- static const char *visuals[] = {
- "MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR",
- "DIRECTCOLOR", "STATIC_PSEUDOCOLOR"
- };
-
- printf("%s info -----------------------\n", s);
- printf("id = %16s\n", fixed->id);
- printf("smem_start = 0x%lx\n", fixed->smem_start);
- printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len);
- printf("type = 0x%x\n", fixed->type);
- printf("type_aux = 0x%x\n", fixed->type_aux);
- printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]);
- printf("xpanstep = %d\n", fixed->xpanstep);
- printf("ypanstep = %d\n", fixed->ypanstep);
- printf("ywrapstep = %d\n", fixed->ywrapstep);
- printf("line_length = %d\n", fixed->line_length);
- printf("mmio_start = 0x%lx\n", fixed->mmio_start);
- printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len);
- printf("accel = 0x%x\n", fixed->accel);
-}
-
-
-static void
-print_var_info(const struct fb_var_screeninfo *var, const char *s)
-{
- printf("%s info -----------------------\n", s);
- printf("xres = %d\n", var->xres);
- printf("yres = %d\n", var->yres);
- printf("xres_virtual = %d\n", var->xres_virtual);
- printf("yres_virtual = %d\n", var->yres_virtual);
- printf("xoffset = %d\n", var->xoffset);
- printf("yoffset = %d\n", var->yoffset);
- printf("bits_per_pixel = %d\n", var->bits_per_pixel);
- printf("grayscale = %d\n", var->grayscale);
-
- printf("red.offset = %d length = %d msb_right = %d\n",
- var->red.offset, var->red.length, var->red.msb_right);
- printf("green.offset = %d length = %d msb_right = %d\n",
- var->green.offset, var->green.length, var->green.msb_right);
- printf("blue.offset = %d length = %d msb_right = %d\n",
- var->blue.offset, var->blue.length, var->blue.msb_right);
- printf("transp.offset = %d length = %d msb_right = %d\n",
- var->transp.offset, var->transp.length, var->transp.msb_right);
-
- printf("nonstd = %d\n", var->nonstd);
- printf("activate = %d\n", var->activate);
- printf("height = %d mm\n", var->height);
- printf("width = %d mm\n", var->width);
- printf("accel_flags = 0x%x\n", var->accel_flags);
- printf("pixclock = %d\n", var->pixclock);
- printf("left_margin = %d\n", var->left_margin);
- printf("right_margin = %d\n", var->right_margin);
- printf("upper_margin = %d\n", var->upper_margin);
- printf("lower_margin = %d\n", var->lower_margin);
- printf("hsync_len = %d\n", var->hsync_len);
- printf("vsync_len = %d\n", var->vsync_len);
- printf("sync = %d\n", var->sync);
- printf("vmode = %d\n", var->vmode);
-}
-
-
-static void
-signal_handler(int signumber)
-{
- signal(signumber, SIG_IGN); /* prevent recursion! */
- fprintf(stderr, "error: got signal %d (exiting)\n", signumber);
- exit(1);
-}
-
-
-static void
-initialize_fbdev( void )
-{
- char ttystr[1000];
- int fd, vtnumber, ttyfd;
- int sz;
-
- (void) sz;
-
- if (geteuid()) {
- fprintf(stderr, "error: you need to be root\n");
- exit(1);
- }
-
-#if 1
- /* open the framebuffer device */
- FrameBufferFD = open("/dev/fb0", O_RDWR);
- if (FrameBufferFD < 0) {
- fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
- exit(1);
- }
-#endif
-
- /* open /dev/tty0 and get the vt number */
- if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) {
- fprintf(stderr, "error opening /dev/tty0\n");
- exit(1);
- }
- if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) {
- fprintf(stderr, "error: couldn't get a free vt\n");
- exit(1);
- }
- close(fd);
-
- /* open the console tty */
- sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */
- ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0);
- if (ConsoleFD < 0) {
- fprintf(stderr, "error couldn't open console fd\n");
- exit(1);
- }
-
- /* save current vt number */
- {
- struct vt_stat vts;
- if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0)
- 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;
- if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0)
- printf("ioctl VT_ACTIVATE: %s\n", strerror(errno));
- if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0)
- printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno));
-
- if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) {
- fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno));
- exit(1);
- }
-
- vt.mode = VT_PROCESS;
- vt.relsig = SIGUSR1;
- vt.acqsig = SIGUSR1;
- if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) {
- fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n",
- strerror(errno));
- exit(1);
- }
- }
-
- /* go into graphics mode */
- if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) {
- fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n",
- strerror(errno));
- exit(1);
- }
-
-
-#if 0
- /* open the framebuffer device */
- FrameBufferFD = open("/dev/fb0", O_RDWR);
- if (FrameBufferFD < 0) {
- fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
- exit(1);
- }
-#endif
-
- /* Get the fixed screen info */
- if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
- strerror(errno));
- exit(1);
- }
-
- print_fixed_info(&FixedInfo, "Fixed");
-
-
- /* get the variable screen info */
- if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
- strerror(errno));
- exit(1);
- }
-
- print_var_info(&OrigVarInfo, "Orig Var");
-
- /* operate on a copy */
- VarInfo = OrigVarInfo;
-
- /* set the depth, resolution, etc */
- DesiredDepth = 32;
- if (DesiredDepth)
- VarInfo.bits_per_pixel = DesiredDepth;
-
- if (VarInfo.bits_per_pixel == 16) {
- VarInfo.red.offset = 11;
- VarInfo.green.offset = 5;
- VarInfo.blue.offset = 0;
- VarInfo.red.length = 5;
- VarInfo.green.length = 6;
- VarInfo.blue.length = 5;
- VarInfo.transp.offset = 0;
- VarInfo.transp.length = 0;
- }
- else if (VarInfo.bits_per_pixel == 32) {
- VarInfo.red.offset = 16;
- VarInfo.green.offset = 8;
- VarInfo.blue.offset = 0;
- VarInfo.transp.offset = 24;
- VarInfo.red.length = 8;
- VarInfo.green.length = 8;
- VarInfo.blue.length = 8;
- VarInfo.transp.length = 8;
- }
- /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */
- VarInfo.xres_virtual = VarInfo.xres = 1280;
- VarInfo.yres_virtual = VarInfo.yres = 1024;
- VarInfo.pixclock = 7408;
- VarInfo.left_margin = 248;
- VarInfo.right_margin = 16;
- VarInfo.upper_margin = 38;
- VarInfo.lower_margin = 1;
- VarInfo.hsync_len = 144;
- VarInfo.vsync_len = 3;
-
- VarInfo.xoffset = 0;
- VarInfo.yoffset = 0;
- VarInfo.nonstd = 0;
- VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */
-
- /* set new variable screen info */
- if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) {
- fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
- strerror(errno));
- exit(1);
- }
-
- print_var_info(&VarInfo, "New Var");
-
- if (FixedInfo.visual != FB_VISUAL_TRUECOLOR &&
- FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) {
- fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual);
- exit(1);
- }
-
- /* initialize colormap */
- if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) {
- struct fb_cmap cmap;
- unsigned short red[256], green[256], blue[256];
- int i;
-
- /* we're assuming 256 entries here */
- printf("initializing directcolor colormap\n");
- cmap.start = 0;
- cmap.len = 256;
- cmap.red = red;
- cmap.green = green;
- cmap.blue = blue;
- cmap.transp = NULL;
- for (i = 0; i < cmap.len; i++) {
- red[i] = green[i] = blue[i] = (i << 8) | i;
- }
- if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) {
- fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i);
- }
- }
-
- /*
- * fbdev says the frame buffer is at offset zero, and the mmio region
- * is immediately after.
- */
-
- /* mmap the framebuffer into our address space */
- FrameBuffer = (caddr_t) mmap(0, /* start */
- FixedInfo.smem_len, /* bytes */
- PROT_READ | PROT_WRITE, /* prot */
- MAP_SHARED, /* flags */
- FrameBufferFD, /* fd */
- 0 /* offset */);
- if (FrameBuffer == (caddr_t) - 1) {
- fprintf(stderr, "error: unable to mmap framebuffer: %s\n",
- strerror(errno));
- exit(1);
- }
- printf("FrameBuffer = %p\n", FrameBuffer);
-
-#if 1
- /* mmap the MMIO region into our address space */
- MMIOAddress = (caddr_t) mmap(0, /* start */
- FixedInfo.mmio_len, /* bytes */
- PROT_READ | PROT_WRITE, /* prot */
- MAP_SHARED, /* flags */
- FrameBufferFD, /* fd */
- FixedInfo.smem_len /* offset */);
- if (MMIOAddress == (caddr_t) - 1) {
- fprintf(stderr, "error: unable to mmap mmio region: %s\n",
- strerror(errno));
- }
- printf("MMIOAddress = %p\n", MMIOAddress);
-
- /* try out some simple MMIO register reads */
- if (1)
- {
- typedef unsigned int CARD32;
- typedef unsigned char CARD8;
-#define RADEON_CONFIG_MEMSIZE 0x00f8
-#define RADEON_MEM_SDRAM_MODE_REG 0x0158
-#define MMIO_IN32(base, offset) \
- *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset))
-#define INREG(addr) MMIO_IN32(MMIOAddress, addr)
- int sz, type;
- const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"};
- sz = INREG(RADEON_CONFIG_MEMSIZE);
- type = INREG(RADEON_MEM_SDRAM_MODE_REG);
- printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024);
- printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n",
- type >> 30, typeStr[type>>30]);
- }
-#endif
-
-}
-
-
-static void
-shutdown_fbdev( void )
-{
- struct vt_mode VT;
-
- printf("cleaning up...\n");
- /* restore original variable screen info */
- if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) {
- fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
- strerror(errno));
- exit(1);
- }
-
- munmap(MMIOAddress, FixedInfo.mmio_len);
- munmap(FrameBuffer, FixedInfo.smem_len);
- close(FrameBufferFD);
-
- /* restore text mode */
- ioctl(ConsoleFD, KDSETMODE, KD_TEXT);
-
- /* set vt */
- if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) {
- VT.mode = VT_AUTO;
- ioctl(ConsoleFD, VT_SETMODE, &VT);
- }
-
- /* restore original vt */
- if (OriginalVT >= 0) {
- ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT);
- OriginalVT = -1;
- }
-
- close(ConsoleFD);
-}
-
-
-/* Borrowed from GLUT */
-static void
-doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
-{
- int i, j;
- GLfloat theta, phi, theta1;
- GLfloat cosTheta, sinTheta;
- GLfloat cosTheta1, sinTheta1;
- GLfloat ringDelta, sideDelta;
-
- ringDelta = 2.0 * M_PI / rings;
- sideDelta = 2.0 * M_PI / nsides;
-
- theta = 0.0;
- cosTheta = 1.0;
- sinTheta = 0.0;
- for (i = rings - 1; i >= 0; i--) {
- theta1 = theta + ringDelta;
- cosTheta1 = cos(theta1);
- sinTheta1 = sin(theta1);
- glBegin(GL_QUAD_STRIP);
- phi = 0.0;
- for (j = nsides; j >= 0; j--) {
- GLfloat cosPhi, sinPhi, dist;
-
- phi += sideDelta;
- cosPhi = cos(phi);
- sinPhi = sin(phi);
- dist = R + r * cosPhi;
-
- glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
- glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
- glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
- glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
- }
- glEnd();
- theta = theta1;
- cosTheta = cosTheta1;
- sinTheta = sinTheta1;
- }
-}
-
-
-static void
-gltest( void )
-{
- static const int attribs[] = {
- GLFBDEV_DOUBLE_BUFFER,
- GLFBDEV_DEPTH_SIZE, 16,
- GLFBDEV_NONE
- };
- GLFBDevContextPtr ctx;
- GLFBDevBufferPtr buf;
- GLFBDevVisualPtr vis;
- int bytes, r, g, b, a;
- float ang;
-
- printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR));
- printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION));
-
- /* framebuffer size */
- bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8;
-
- vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs );
- assert(vis);
-
- buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes );
- assert(buf);
-
- ctx = glFBDevCreateContext( vis, NULL );
- assert(buf);
-
- b = glFBDevMakeCurrent( ctx, buf, buf );
- assert(b);
-
- /*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/
- glGetIntegerv(GL_RED_BITS, &r);
- glGetIntegerv(GL_GREEN_BITS, &g);
- glGetIntegerv(GL_BLUE_BITS, &b);
- glGetIntegerv(GL_ALPHA_BITS, &a);
- printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n",
- r, g, b, a);
-
- glClearColor(0.5, 0.5, 1.0, 0);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1, 1, -1, 1, 2, 30);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0, 0, -15);
- glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- for (ang = 0; ang <= 180; ang += 15) {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glPushMatrix();
- glRotatef(ang, 1, 0, 0);
- doughnut(1, 3, 40, 20);
- glPopMatrix();
- glFBDevSwapBuffers(buf);
- }
-
- /* clean up */
- b = glFBDevMakeCurrent( NULL, NULL, NULL);
- assert(b);
-
- glFBDevDestroyContext(ctx);
- glFBDevDestroyBuffer(buf);
- glFBDevDestroyVisual(vis);
-}
-
-
-int
-main( int argc, char *argv[] )
-{
- signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */
- signal(SIGSEGV, signal_handler); /* catch segfaults */
-
- initialize_fbdev();
- gltest();
- shutdown_fbdev();
-
- return 0;
-}
diff --git a/progs/fp/Makefile b/progs/fp/Makefile
deleted file mode 100644
index d979be83d34..00000000000
--- a/progs/fp/Makefile
+++ /dev/null
@@ -1,128 +0,0 @@
-# progs/tests/Makefile
-
-
-# These programs aren't intended to be included with the normal distro.
-# They're not too interesting but they're good for testing.
-
-TOP = ../..
-include $(TOP)/configs/current
-
-
-LIBS = $(APP_LIB_DEPS)
-
-SOURCES = \
- tri-abs.c \
- tri-add.c \
- tri-cmp.c \
- tri-cos.c \
- tri-dp3.c \
- tri-dp4.c \
- tri-dph.c \
- tri-dst.c \
- tri-ex2.c \
- tri-flr.c \
- tri-frc.c \
- tri-kil.c \
- tri-lg2.c \
- tri-lit.c \
- tri-lrp.c \
- tri-mad.c \
- tri-max.c \
- tri-min.c \
- tri-mov.c \
- tri-mul.c \
- tri-pow.c \
- tri-param.c \
- tri-rcp.c \
- tri-rsq.c \
- tri-scs.c \
- tri-sge.c \
- tri-sge2.c \
- tri-sin.c \
- tri-slt.c \
- tri-sub.c \
- tri-swz.c \
- tri-swz2.c \
- tri-tex.c \
- tri-xpd.c \
- tri-position.c \
- point-position.c \
- tri-depth.c \
- tri-depth2.c \
- tri-depthwrite.c \
- tri-depthwrite2.c \
-
-NOTDONE=\
- tri-txb.c \
- tri-txp.c \
- tri-depthwrite.c \
- tri-fogoption.c
-
-
-PROGS = $(SOURCES:%.c=%)
-
-INCLUDES = -I. -I$(TOP)/include -I../samples
-
-UTIL_FILES = readtex.h readtex.c
-
-
-##### RULES #####
-
-.SUFFIXES:
-.SUFFIXES: .c
-
-.c:
- $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: $(UTIL_FILES) $(PROGS)
-
-clean:
- rm -f $(PROGS)
- rm -f *.o
- rm -f getproclist.h
-
-
-# auto code generation
-getprocaddress: getprocaddress.c getproclist.h
-
-getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
- python getprocaddress.py > getproclist.h
-
-
-texrect: texrect.o readtex.o
- $(CC) texrect.o readtex.o $(LIBS) -o $@
-
-texrect.o: texrect.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-invert: invert.o readtex.o
- $(CC) invert.o readtex.o $(LIBS) -o $@
-
-invert.o: invert.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-readtex.o: readtex.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-readtex.h: $(TOP)/progs/util/readtex.h
- ln -s $(TOP)/progs/util/readtex.h .
-
-readtex.c: $(TOP)/progs/util/readtex.c
- ln -s $(TOP)/progs/util/readtex.c .
-
-
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
diff --git a/progs/fp/point-position.c b/progs/fp/point-position.c
deleted file mode 100644
index c352a939cb1..00000000000
--- a/progs/fp/point-position.c
+++ /dev/null
@@ -1,119 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.color, fragment.position, {.005}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
-#if 0
- glBegin(GL_QUADS);
- glTexCoord2f(1,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glTexCoord2f(1,1);
- glVertex3f( 0.9, 0.9, -30.0);
- glTexCoord2f(0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glTexCoord2f(0,0);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-#else
- glPointSize(100);
- glBegin(GL_POINTS);
- glColor3f(0,0,1);
- glVertex3f( 0, 0, -30.0);
- glEnd();
-#endif
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-abs.c b/progs/fp/tri-abs.c
deleted file mode 100644
index 44aa2cfa3ad..00000000000
--- a/progs/fp/tri-abs.c
+++ /dev/null
@@ -1,107 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, {0.5}.x, fragment.color; \n"
- "ABS result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-add.c b/progs/fp/tri-add.c
deleted file mode 100644
index b086126c867..00000000000
--- a/progs/fp/tri-add.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "ADD R0, fragment.color, fragment.color; \n"
- "ADD result.color, R0, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-cmp.c b/progs/fp/tri-cmp.c
deleted file mode 100644
index 968b67f3d91..00000000000
--- a/progs/fp/tri-cmp.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, {0.5}.x, fragment.color; \n"
- "CMP result.color, R0, fragment.color, {0.0}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-cos.c b/progs/fp/tri-cos.c
deleted file mode 100644
index 7ea24532189..00000000000
--- a/progs/fp/tri-cos.c
+++ /dev/null
@@ -1,113 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.14}.x; \n"
- "COS result.color.x, R0.x; \n"
- "COS result.color.y, R0.y; \n"
- "COS result.color.z, R0.z; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-depth.c b/progs/fp/tri-depth.c
deleted file mode 100644
index a1f0579c8e1..00000000000
--- a/progs/fp/tri-depth.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- /* scale of 10.0 gives me a visible result on nv hardware.
- */
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.color, fragment.position.z, {10.0}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -40.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -40.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -25.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-depth2.c b/progs/fp/tri-depth2.c
deleted file mode 100644
index f3096282833..00000000000
--- a/progs/fp/tri-depth2.c
+++ /dev/null
@@ -1,116 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- /* scale of 10.0 gives me a visible result on nv hardware.
- */
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "MUL R0, fragment.position.z, {10.0}.x;\n"
- "MOV result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glVertex3f( 0.9, 0.9, -30.0);
- glVertex3f(-0.9, 0.0, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, -0.9, -40.0);
- glVertex3f(-0.9, 0.9, -40.0);
- glVertex3f( 0.9, 0.0, -25.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB | GLUT_DEPTH;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-depthwrite.c b/progs/fp/tri-depthwrite.c
deleted file mode 100644
index fedeec4577d..00000000000
--- a/progs/fp/tri-depthwrite.c
+++ /dev/null
@@ -1,107 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-static void Init(void)
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.depth.z, fragment.color.z, {.1}.x; \n"
- "MOV result.color.xy, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
-
-
- glBegin(GL_TRIANGLES);
- glColor4f(.8,0,.5,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glVertex3f( 0.9, 0.9, -30.0);
- glVertex3f(-0.9, 0.0, -30.0);
-
- glColor4f(0,.8,.7,0);
- glVertex3f(-0.9, -0.9, -40.0);
- glColor4f(0,.8,.7,0);
- glVertex3f(-0.9, 0.9, -40.0);
- glColor4f(0,.8,.3,0);
- glVertex3f( 0.9, 0.0, -40.0);
- glEnd();
-
- glFlush();
-}
-
-
-int main(int argc, char **argv)
-{
- glutInit(&argc, argv);
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300);
-
- glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE);
-
- if (glutCreateWindow("Depth Test") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-depthwrite2.c b/progs/fp/tri-depthwrite2.c
deleted file mode 100644
index 5547092ec9b..00000000000
--- a/progs/fp/tri-depthwrite2.c
+++ /dev/null
@@ -1,107 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-static void Init(void)
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.depth.z, fragment.color.z, {.1}.x; \n"
- "MOV result.color, fragment.color.z; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
-
-
- glBegin(GL_TRIANGLES);
- glColor4f(.8,0,.5,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glVertex3f( 0.9, 0.9, -30.0);
- glVertex3f(-0.9, 0.0, -30.0);
-
- glColor4f(0,.8,.7,0);
- glVertex3f(-0.9, -0.9, -40.0);
- glColor4f(0,.8,.7,0);
- glVertex3f(-0.9, 0.9, -40.0);
- glColor4f(0,.8,.3,0);
- glVertex3f( 0.9, 0.0, -40.0);
- glEnd();
-
- glFlush();
-}
-
-
-int main(int argc, char **argv)
-{
- glutInit(&argc, argv);
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300);
-
- glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE);
-
- if (glutCreateWindow("Depth Test") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dp3.c b/progs/fp/tri-dp3.c
deleted file mode 100644
index 0e18de2dc46..00000000000
--- a/progs/fp/tri-dp3.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "DP3 result.color, fragment.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dp4.c b/progs/fp/tri-dp4.c
deleted file mode 100644
index 400bbf4da2d..00000000000
--- a/progs/fp/tri-dp4.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "DP4 result.color, fragment.color.xxxx, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dph.c b/progs/fp/tri-dph.c
deleted file mode 100644
index 958073c4131..00000000000
--- a/progs/fp/tri-dph.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "DPH result.color, fragment.color, fragment.color.xyzx; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dst.c b/progs/fp/tri-dst.c
deleted file mode 100644
index 3d85e85643c..00000000000
--- a/progs/fp/tri-dst.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "DST result.color, fragment.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-ex2.c b/progs/fp/tri-ex2.c
deleted file mode 100644
index f09b1d78469..00000000000
--- a/progs/fp/tri-ex2.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "EX2 R0, fragment.color.x; \n"
- "SUB result.color, R0, {1.0}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-flr.c b/progs/fp/tri-flr.c
deleted file mode 100644
index 059f6b67541..00000000000
--- a/progs/fp/tri-flr.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "ADD R0, fragment.color, {0.5}.x; \n"
- "FLR result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-fp.c b/progs/fp/tri-fp.c
deleted file mode 100644
index 4148a8def34..00000000000
--- a/progs/fp/tri-fp.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SLT result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-frc.c b/progs/fp/tri-frc.c
deleted file mode 100644
index 8d60c9dc201..00000000000
--- a/progs/fp/tri-frc.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.0}.x; \n"
- "FRC result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-inv.c b/progs/fp/tri-inv.c
deleted file mode 100644
index e9023323862..00000000000
--- a/progs/fp/tri-inv.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "INV result.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-kil.c b/progs/fp/tri-kil.c
deleted file mode 100644
index 47dbd049644..00000000000
--- a/progs/fp/tri-kil.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, fragment.color, {0.5,0,0,0}; \n"
- "KIL R0;"
- "MOV result.color, R0;"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-lg2.c b/progs/fp/tri-lg2.c
deleted file mode 100644
index c7eec469741..00000000000
--- a/progs/fp/tri-lg2.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "MUL R0, fragment.color, {4.0}.x; \n"
- "LG2 result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-lit.c b/progs/fp/tri-lit.c
deleted file mode 100644
index 21e3b6f2169..00000000000
--- a/progs/fp/tri-lit.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, {0.5}.x, fragment.color; \n"
- "LIT result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-lrp.c b/progs/fp/tri-lrp.c
deleted file mode 100644
index a5659eed60d..00000000000
--- a/progs/fp/tri-lrp.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "LRP result.color, fragment.color.z, {1,0,0,1}, {0,1,0,1}; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-mad.c b/progs/fp/tri-mad.c
deleted file mode 100644
index b46d139fb3c..00000000000
--- a/progs/fp/tri-mad.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "MAD result.color, fragment.color.z, {1,0,0,1}, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-max.c b/progs/fp/tri-max.c
deleted file mode 100644
index 481a0679165..00000000000
--- a/progs/fp/tri-max.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MAX result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-min.c b/progs/fp/tri-min.c
deleted file mode 100644
index 7bb722f85ff..00000000000
--- a/progs/fp/tri-min.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MIN result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-mov.c b/progs/fp/tri-mov.c
deleted file mode 100644
index 40b5b66f5cc..00000000000
--- a/progs/fp/tri-mov.c
+++ /dev/null
@@ -1,102 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MOV result.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB | GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-mul.c b/progs/fp/tri-mul.c
deleted file mode 100644
index 61dd3e0458c..00000000000
--- a/progs/fp/tri-mul.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.color, fragment.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-param.c b/progs/fp/tri-param.c
deleted file mode 100644
index f3e55af3f1b..00000000000
--- a/progs/fp/tri-param.c
+++ /dev/null
@@ -1,114 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MOV result.color, program.local[32]; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 32, 0.25, .5, 0.25, 1);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.0, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 32, 0.25, 0, 0.25, 1);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, 0.0, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB | GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-position.c b/progs/fp/tri-position.c
deleted file mode 100644
index 18e8182a684..00000000000
--- a/progs/fp/tri-position.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.color, fragment.position, {.005}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-pow.c b/progs/fp/tri-pow.c
deleted file mode 100644
index ef91e43e997..00000000000
--- a/progs/fp/tri-pow.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "POW result.color, fragment.color.x, fragment.color.y; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-rcp.c b/progs/fp/tri-rcp.c
deleted file mode 100644
index e2a27049343..00000000000
--- a/progs/fp/tri-rcp.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "ADD R0, fragment.color.x, fragment.color.x; \n"
- "RCP result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-rsq.c b/progs/fp/tri-rsq.c
deleted file mode 100644
index c5b2c1b32e8..00000000000
--- a/progs/fp/tri-rsq.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "MUL R0, fragment.color, {3.0}.x; \n"
- "RSQ result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-scs.c b/progs/fp/tri-scs.c
deleted file mode 100644
index ce7c0062c33..00000000000
--- a/progs/fp/tri-scs.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.14}.x; \n"
- "SCS result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sge.c b/progs/fp/tri-sge.c
deleted file mode 100644
index 6a360ca9328..00000000000
--- a/progs/fp/tri-sge.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SGE result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sge2.c b/progs/fp/tri-sge2.c
deleted file mode 100644
index c4330098ed4..00000000000
--- a/progs/fp/tri-sge2.c
+++ /dev/null
@@ -1,114 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "TEMP R1;\n"
- "SGE R0, fragment.color, fragment.color.yzxw; \n"
- "SGE R1, fragment.color, fragment.color.zxyw; \n"
- "MUL R0, R0, R1; \n"
- "MUL result.color, R0, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sin.c b/progs/fp/tri-sin.c
deleted file mode 100644
index 772903e4b23..00000000000
--- a/progs/fp/tri-sin.c
+++ /dev/null
@@ -1,114 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.14}.x; \n"
- "MOV result.color, {0.0}.x; \n"
- "SIN result.color.x, R0.x; \n"
- "SIN result.color.y, R0.y; \n"
- "SIN result.color.z, R0.z; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-slt.c b/progs/fp/tri-slt.c
deleted file mode 100644
index 4148a8def34..00000000000
--- a/progs/fp/tri-slt.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SLT result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sub.c b/progs/fp/tri-sub.c
deleted file mode 100644
index 6faa4145501..00000000000
--- a/progs/fp/tri-sub.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SUB result.color, fragment.color.yzxw, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-swz.c b/progs/fp/tri-swz.c
deleted file mode 100644
index 5f34f7a3222..00000000000
--- a/progs/fp/tri-swz.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SWZ result.color, fragment.color, 1,x,y,z; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-swz2.c b/progs/fp/tri-swz2.c
deleted file mode 100644
index fd76b58f539..00000000000
--- a/progs/fp/tri-swz2.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "SWZ result.color, fragment.color, 1, 0, 0, 1; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-tex.c b/progs/fp/tri-tex.c
deleted file mode 100644
index 87f63894ce9..00000000000
--- a/progs/fp/tri-tex.c
+++ /dev/null
@@ -1,130 +0,0 @@
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-#include "readtex.c"
-
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEX result.color, fragment.color, texture[0], 2D; \n"
- "END"
- ;
- GLuint modulateProg;
- GLuint Texture;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- assert(glIsProgramARB(modulateProg));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- /* Load texture */
- glGenTextures(1, &Texture);
- glBindTexture(GL_TEXTURE_2D, Texture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE);
- exit(1);
- }
- /* XXX this enable shouldn't really be needed!!! */
- glEnable(GL_TEXTURE_2D);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
-/* glTexCoord2f(1, 0); */
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
-/* glTexCoord2f(1, 1); */
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
-/* glTexCoord2f(0, .5); */
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-xpd.c b/progs/fp/tri-xpd.c
deleted file mode 100644
index 9aca46b2faa..00000000000
--- a/progs/fp/tri-xpd.c
+++ /dev/null
@@ -1,108 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "XPD result.color, fragment.color, {2,2,2,0}; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/miniglx/Makefile b/progs/miniglx/Makefile
deleted file mode 100644
index 7f1e162186f..00000000000
--- a/progs/miniglx/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-# Makefile for miniglx demo programs
-
-TOP = ../..
-
-include $(TOP)/configs/current
-
-
-SOURCES = miniglxtest.c \
- miniglxsample.c \
- sample_server.c \
- sample_server2.c \
- manytex.c \
- texline.c
-
-OBJECTS = $(SOURCES:.c=.o)
-
-PROGS = $(SOURCES:%.c=%)
-
-INCLUDES = \
- -I. \
- -I$(TOP)/include
-
-
-##### RULES #####
-
-.SUFFIXES:
-.SUFFIXES: .c
-
-.c:
- $(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend $(PROGS)
-
-clean:
- rm -f $(PROGS)
- rm -f *.o
-
-
-depend: $(SOURCES)
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-include depend
diff --git a/progs/miniglx/glfbdevtest.c b/progs/miniglx/glfbdevtest.c
deleted file mode 100644
index c82ca6e5f63..00000000000
--- a/progs/miniglx/glfbdevtest.c
+++ /dev/null
@@ -1,478 +0,0 @@
-/* $Id: glfbdevtest.c,v 1.1 2003/08/06 17:47:15 keithw Exp $ */
-
-/*
- * Test the GLFBDev interface. Only tested with radeonfb driver!!!!
- */
-
-
-#include <assert.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <linux/fb.h>
-#include <linux/kd.h>
-#include <linux/vt.h>
-#include <GL/glut.h>
-#include "GL/glfbdev.h"
-
-#define DEFAULT_DEPTH 8
-
-static struct fb_fix_screeninfo FixedInfo;
-static struct fb_var_screeninfo VarInfo, OrigVarInfo;
-static int DesiredDepth = 0;
-static int OriginalVT = -1;
-static int ConsoleFD = -1;
-static int FrameBufferFD = -1;
-static caddr_t FrameBuffer = (caddr_t) -1;
-static caddr_t MMIOAddress = (caddr_t) -1;
-
-
-static void
-print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s)
-{
- static const char *visuals[] = {
- "MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR",
- "DIRECTCOLOR", "STATIC_PSEUDOCOLOR"
- };
-
- printf("%s info -----------------------\n", s);
- printf("id = %16s\n", fixed->id);
- printf("smem_start = 0x%x\n", fixed->smem_start);
- printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len);
- printf("type = 0x%x\n", fixed->type);
- printf("type_aux = 0x%x\n", fixed->type_aux);
- printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]);
- printf("xpanstep = %d\n", fixed->xpanstep);
- printf("ypanstep = %d\n", fixed->ypanstep);
- printf("ywrapstep = %d\n", fixed->ywrapstep);
- printf("line_length = %d\n", fixed->line_length);
- printf("mmio_start = 0x%x\n", fixed->mmio_start);
- printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len);
- printf("accel = 0x%x\n", fixed->accel);
-}
-
-
-static void
-print_var_info(const struct fb_var_screeninfo *var, const char *s)
-{
- printf("%s info -----------------------\n", s);
- printf("xres = %d\n", var->xres);
- printf("yres = %d\n", var->yres);
- printf("xres_virtual = %d\n", var->xres_virtual);
- printf("yres_virtual = %d\n", var->yres_virtual);
- printf("xoffset = %d\n", var->xoffset);
- printf("yoffset = %d\n", var->yoffset);
- printf("bits_per_pixel = %d\n", var->bits_per_pixel);
- printf("grayscale = %d\n", var->grayscale);
-
- printf("red.offset = %d length = %d msb_right = %d\n",
- var->red.offset, var->red.length, var->red.msb_right);
- printf("green.offset = %d length = %d msb_right = %d\n",
- var->green.offset, var->green.length, var->green.msb_right);
- printf("blue.offset = %d length = %d msb_right = %d\n",
- var->blue.offset, var->blue.length, var->blue.msb_right);
- printf("transp.offset = %d length = %d msb_right = %d\n",
- var->transp.offset, var->transp.length, var->transp.msb_right);
-
- printf("nonstd = %d\n", var->nonstd);
- printf("activate = %d\n", var->activate);
- printf("height = %d mm\n", var->height);
- printf("width = %d mm\n", var->width);
- printf("accel_flags = 0x%x\n", var->accel_flags);
- printf("pixclock = %d\n", var->pixclock);
- printf("left_margin = %d\n", var->left_margin);
- printf("right_margin = %d\n", var->right_margin);
- printf("upper_margin = %d\n", var->upper_margin);
- printf("lower_margin = %d\n", var->lower_margin);
- printf("hsync_len = %d\n", var->hsync_len);
- printf("vsync_len = %d\n", var->vsync_len);
- printf("sync = %d\n", var->sync);
- printf("vmode = %d\n", var->vmode);
-}
-
-
-static void
-signal_handler(int signumber)
-{
- signal(signumber, SIG_IGN); /* prevent recursion! */
- fprintf(stderr, "error: got signal %d (exiting)\n", signumber);
- exit(1);
-}
-
-
-static void
-initialize_fbdev( void )
-{
- char ttystr[1000];
- int fd, vtnumber, ttyfd;
- int sz;
-
- if (geteuid()) {
- fprintf(stderr, "error: you need to be root\n");
- exit(1);
- }
-
-#if 1
- /* open the framebuffer device */
- FrameBufferFD = open("/dev/fb0", O_RDWR);
- if (FrameBufferFD < 0) {
- fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
- exit(1);
- }
-#endif
-
- /* open /dev/tty0 and get the vt number */
- if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) {
- fprintf(stderr, "error opening /dev/tty0\n");
- exit(1);
- }
- if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) {
- fprintf(stderr, "error: couldn't get a free vt\n");
- exit(1);
- }
- close(fd);
-
- /* open the console tty */
- sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */
- ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0);
- if (ConsoleFD < 0) {
- fprintf(stderr, "error couldn't open console fd\n");
- exit(1);
- }
-
- /* save current vt number */
- {
- struct vt_stat vts;
- if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0)
- 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;
- if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0)
- printf("ioctl VT_ACTIVATE: %s\n", strerror(errno));
- if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0)
- printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno));
-
- if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) {
- fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno));
- exit(1);
- }
-
- vt.mode = VT_PROCESS;
- vt.relsig = SIGUSR1;
- vt.acqsig = SIGUSR1;
- if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) {
- fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n",
- strerror(errno));
- exit(1);
- }
- }
-
- /* go into graphics mode */
- if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) {
- fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n",
- strerror(errno));
- exit(1);
- }
-
-
-#if 0
- /* open the framebuffer device */
- FrameBufferFD = open("/dev/fb0", O_RDWR);
- if (FrameBufferFD < 0) {
- fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
- exit(1);
- }
-#endif
-
- /* Get the fixed screen info */
- if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
- strerror(errno));
- exit(1);
- }
-
- print_fixed_info(&FixedInfo, "Fixed");
-
-
- /* get the variable screen info */
- if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
- strerror(errno));
- exit(1);
- }
-
- print_var_info(&OrigVarInfo, "Orig Var");
-
- /* operate on a copy */
- VarInfo = OrigVarInfo;
-
- /* set the depth, resolution, etc */
- DesiredDepth = 32;
- if (DesiredDepth)
- VarInfo.bits_per_pixel = DesiredDepth;
-
- if (VarInfo.bits_per_pixel == 16) {
- VarInfo.red.offset = 11;
- VarInfo.green.offset = 5;
- VarInfo.blue.offset = 0;
- VarInfo.red.length = 5;
- VarInfo.green.length = 6;
- VarInfo.blue.length = 5;
- VarInfo.transp.offset = 0;
- VarInfo.transp.length = 0;
- }
- else if (VarInfo.bits_per_pixel == 32) {
- VarInfo.red.offset = 16;
- VarInfo.green.offset = 8;
- VarInfo.blue.offset = 0;
- VarInfo.transp.offset = 24;
- VarInfo.red.length = 8;
- VarInfo.green.length = 8;
- VarInfo.blue.length = 8;
- VarInfo.transp.length = 8;
- }
- /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */
- VarInfo.xres_virtual = VarInfo.xres = 1280;
- VarInfo.yres_virtual = VarInfo.yres = 1024;
- VarInfo.pixclock = 7408;
- VarInfo.left_margin = 248;
- VarInfo.right_margin = 16;
- VarInfo.upper_margin = 38;
- VarInfo.lower_margin = 1;
- VarInfo.hsync_len = 144;
- VarInfo.vsync_len = 3;
-
- VarInfo.xoffset = 0;
- VarInfo.yoffset = 0;
- VarInfo.nonstd = 0;
- VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */
-
- /* set new variable screen info */
- if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) {
- fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
- strerror(errno));
- exit(1);
- }
-
- print_var_info(&VarInfo, "New Var");
-
- if (FixedInfo.visual != FB_VISUAL_TRUECOLOR &&
- FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) {
- fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual);
- exit(1);
- }
-
- /* initialize colormap */
- if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) {
- struct fb_cmap cmap;
- unsigned short red[256], green[256], blue[256];
- int i;
-
- /* we're assuming 256 entries here */
- printf("initializing directcolor colormap\n");
- cmap.start = 0;
- cmap.len = 256;
- cmap.red = red;
- cmap.green = green;
- cmap.blue = blue;
- cmap.transp = NULL;
- for (i = 0; i < cmap.len; i++) {
- red[i] = green[i] = blue[i] = (i << 8) | i;
- }
- if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) {
- fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i);
- }
- }
-
- /*
- * fbdev says the frame buffer is at offset zero, and the mmio region
- * is immediately after.
- */
-
- /* mmap the framebuffer into our address space */
- FrameBuffer = (caddr_t) mmap(0, /* start */
- FixedInfo.smem_len, /* bytes */
- PROT_READ | PROT_WRITE, /* prot */
- MAP_SHARED, /* flags */
- FrameBufferFD, /* fd */
- 0 /* offset */);
- if (FrameBuffer == (caddr_t) - 1) {
- fprintf(stderr, "error: unable to mmap framebuffer: %s\n",
- strerror(errno));
- exit(1);
- }
- printf("FrameBuffer = %p\n", FrameBuffer);
-
-#if 1
- /* mmap the MMIO region into our address space */
- MMIOAddress = (caddr_t) mmap(0, /* start */
- FixedInfo.mmio_len, /* bytes */
- PROT_READ | PROT_WRITE, /* prot */
- MAP_SHARED, /* flags */
- FrameBufferFD, /* fd */
- FixedInfo.smem_len /* offset */);
- if (MMIOAddress == (caddr_t) - 1) {
- fprintf(stderr, "error: unable to mmap mmio region: %s\n",
- strerror(errno));
- }
- printf("MMIOAddress = %p\n", MMIOAddress);
-
- /* try out some simple MMIO register reads */
- if (1)
- {
- typedef unsigned int CARD32;
- typedef unsigned char CARD8;
-#define RADEON_CONFIG_MEMSIZE 0x00f8
-#define RADEON_MEM_SDRAM_MODE_REG 0x0158
-#define MMIO_IN32(base, offset) \
- *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset))
-#define INREG(addr) MMIO_IN32(MMIOAddress, addr)
- int sz, type;
- const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"};
- sz = INREG(RADEON_CONFIG_MEMSIZE);
- type = INREG(RADEON_MEM_SDRAM_MODE_REG);
- printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024);
- printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n",
- type >> 30, typeStr[type>>30]);
- }
-#endif
-
-}
-
-
-static void
-shutdown_fbdev( void )
-{
- struct vt_mode VT;
-
- printf("cleaning up...\n");
- /* restore original variable screen info */
- if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) {
- fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
- strerror(errno));
- exit(1);
- }
-
- munmap(MMIOAddress, FixedInfo.mmio_len);
- munmap(FrameBuffer, FixedInfo.smem_len);
- close(FrameBufferFD);
-
- /* restore text mode */
- ioctl(ConsoleFD, KDSETMODE, KD_TEXT);
-
- /* set vt */
- if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) {
- VT.mode = VT_AUTO;
- ioctl(ConsoleFD, VT_SETMODE, &VT);
- }
-
- /* restore original vt */
- if (OriginalVT >= 0) {
- ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT);
- OriginalVT = -1;
- }
-
- close(ConsoleFD);
-}
-
-
-static void
-gltest( void )
-{
- static const int attribs[] = {
- GLFBDEV_DOUBLE_BUFFER,
- GLFBDEV_DEPTH_SIZE, 16,
- GLFBDEV_NONE
- };
- GLFBDevContextPtr ctx;
- GLFBDevBufferPtr buf;
- GLFBDevVisualPtr vis;
- int bytes, r, g, b, a;
- float ang;
-
- printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR));
- printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION));
-
- /* framebuffer size */
- bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8;
-
- vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs );
- assert(vis);
-
- buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes );
- assert(buf);
-
- ctx = glFBDevCreateContext( vis, NULL );
- assert(buf);
-
- b = glFBDevMakeCurrent( ctx, buf, buf );
- assert(b);
-
- /*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/
- glGetIntegerv(GL_RED_BITS, &r);
- glGetIntegerv(GL_GREEN_BITS, &g);
- glGetIntegerv(GL_BLUE_BITS, &b);
- glGetIntegerv(GL_ALPHA_BITS, &a);
- printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n",
- r, g, b, a);
-
- glClearColor(0.5, 0.5, 1.0, 0);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1, 1, -1, 1, 2, 30);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0, 0, -15);
- glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- for (ang = 0; ang <= 180; ang += 15) {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glPushMatrix();
- glRotatef(ang, 1, 0, 0);
- glutSolidTorus(1, 3, 40, 20);
- glPopMatrix();
- glFBDevSwapBuffers(buf);
- }
-
- /* clean up */
- b = glFBDevMakeCurrent( NULL, NULL, NULL);
- assert(b);
-
- glFBDevDestroyContext(ctx);
- glFBDevDestroyBuffer(buf);
- glFBDevDestroyVisual(vis);
-}
-
-
-int
-main( int argc, char *argv[] )
-{
- signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */
- signal(SIGSEGV, signal_handler); /* catch segfaults */
-
- initialize_fbdev();
- gltest();
- shutdown_fbdev();
-
- return 0;
-}
diff --git a/progs/miniglx/manytex.c b/progs/miniglx/manytex.c
deleted file mode 100644
index 36fa10d222b..00000000000
--- a/progs/miniglx/manytex.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/* $Id: manytex.c,v 1.2 2003/08/23 01:28:59 jonsmirl Exp $ */
-
-/*
- * test handling of many texture maps
- * Also tests texture priority and residency.
- *
- * Brian Paul
- * August 2, 2000
- */
-
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <GL/glut.h>
-
-
-static GLint NumTextures = 20;
-static GLuint *TextureID = NULL;
-static GLint *TextureWidth = NULL, *TextureHeight = NULL;
-static GLboolean *TextureResidency = NULL;
-static GLint TexWidth = 128, TexHeight = 128;
-static GLfloat Zrot = 0;
-static GLboolean Anim = GL_TRUE;
-static GLint WinWidth = 500, WinHeight = 400;
-static GLboolean MipMap = GL_FALSE;
-static GLboolean LinearFilter = GL_FALSE;
-static GLboolean RandomSize = GL_FALSE;
-static GLint Rows, Columns;
-static GLint LowPriorityCount = 0;
-
-
-static void Idle( void )
-{
- Zrot += 1.0;
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- GLfloat spacing = WinWidth / Columns;
- GLfloat size = spacing * 0.4;
- GLint i;
-
- /* test residency */
- if (0)
- {
- GLboolean b;
- GLint i, resident;
- b = glAreTexturesResident(NumTextures, TextureID, TextureResidency);
- if (b) {
- printf("all resident\n");
- }
- else {
- resident = 0;
- for (i = 0; i < NumTextures; i++) {
- if (TextureResidency[i]) {
- resident++;
- }
- }
- printf("%d of %d texture resident\n", resident, NumTextures);
- }
- }
-
- /* render the textured quads */
- glClear( GL_COLOR_BUFFER_BIT );
- for (i = 0; i < NumTextures; i++) {
- GLint row = i / Columns;
- GLint col = i % Columns;
- GLfloat x = col * spacing + spacing * 0.5;
- GLfloat y = row * spacing + spacing * 0.5;
-
- GLfloat maxDim = (TextureWidth[i] > TextureHeight[i])
- ? TextureWidth[i] : TextureHeight[i];
- GLfloat w = TextureWidth[i] / maxDim;
- GLfloat h = TextureHeight[i] / maxDim;
-
- glPushMatrix();
- glTranslatef(x, y, 0.0);
- glRotatef(Zrot, 0, 0, 1);
- glScalef(size, size, 1);
-
- glBindTexture(GL_TEXTURE_2D, TextureID[i]);
- glBegin(GL_POLYGON);
-#if 0
- glTexCoord2f(0, 0); glVertex2f(-1, -1);
- glTexCoord2f(1, 0); glVertex2f( 1, -1);
- glTexCoord2f(1, 1); glVertex2f( 1, 1);
- glTexCoord2f(0, 1); glVertex2f(-1, 1);
-#else
- glTexCoord2f(0, 0); glVertex2f(-w, -h);
- glTexCoord2f(1, 0); glVertex2f( w, -h);
- glTexCoord2f(1, 1); glVertex2f( w, h);
- glTexCoord2f(0, 1); glVertex2f(-w, h);
-#endif
- glEnd();
- glPopMatrix();
- }
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- WinWidth = width;
- WinHeight = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(0, width, 0, height, -1, 1);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-/*
- * Return a random int in [min, max].
- */
-static int RandomInt(int min, int max)
-{
- int i = rand();
- int j = i % (max - min + 1);
- return min + j;
-}
-
-
-
-static void Init( void )
-{
- GLint i;
-
- if (RandomSize) {
- printf("Creating %d %s random-size textures, ", NumTextures,
- MipMap ? "Mipmapped" : "non-Mipmapped");
- }
- else {
- printf("Creating %d %s %d x %d textures, ", NumTextures,
- MipMap ? "Mipmapped" : "non-Mipmapped",
- TexWidth, TexHeight);
- }
-
- if (LinearFilter) {
- printf("bilinear filtering\n");
- }
- else {
- printf("nearest filtering\n");
- }
-
-
- /* compute number of rows and columns of rects */
- {
- GLfloat area = (GLfloat) (WinWidth * WinHeight) / (GLfloat) NumTextures;
- GLfloat edgeLen = sqrt(area);
-
- Columns = WinWidth / edgeLen;
- Rows = (NumTextures + Columns - 1) / Columns;
- printf("Rows: %d Cols: %d\n", Rows, Columns);
- }
-
-
- if (!TextureID) {
- TextureID = (GLuint *) malloc(sizeof(GLuint) * NumTextures);
- assert(TextureID);
- glGenTextures(NumTextures, TextureID);
- }
-
- if (!TextureResidency) {
- TextureResidency = (GLboolean *) malloc(sizeof(GLboolean) * NumTextures);
- assert(TextureResidency);
- }
-
- if (!TextureWidth) {
- TextureWidth = (GLint *) malloc(sizeof(GLint) * NumTextures);
- assert(TextureWidth);
- }
- if (!TextureHeight) {
- TextureHeight = (GLint *) malloc(sizeof(GLint) * NumTextures);
- assert(TextureHeight);
- }
-
- for (i = 0; i < NumTextures; i++) {
- GLubyte color[4];
- GLubyte *texImage;
- GLint j, row, col;
-
- row = i / Columns;
- col = i % Columns;
-
- glBindTexture(GL_TEXTURE_2D, TextureID[i]);
-
- if (i < LowPriorityCount)
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5F);
-
- if (RandomSize) {
-#if 0
- int k = (glutGet(GLUT_ELAPSED_TIME) % 7) + 2;
- TexWidth = 1 << k;
- TexHeight = 1 << k;
-#else
- TexWidth = 1 << RandomInt(2, 7);
- TexHeight = 1 << RandomInt(2, 7);
- printf("Random size of %3d: %d x %d\n", i, TexWidth, TexHeight);
-#endif
- }
-
- TextureWidth[i] = TexWidth;
- TextureHeight[i] = TexHeight;
-
- texImage = (GLubyte*) malloc(4 * TexWidth * TexHeight * sizeof(GLubyte));
- assert(texImage);
-
- /* determine texture color */
- color[0] = (GLint) (255.0 * ((float) col / (Columns - 1)));
- color[1] = 127;
- color[2] = (GLint) (255.0 * ((float) row / (Rows - 1)));
- color[3] = 255;
-
- /* fill in solid-colored teximage */
- for (j = 0; j < TexWidth * TexHeight; j++) {
- texImage[j*4+0] = color[0];
- texImage[j*4+1] = color[1];
- texImage[j*4+2] = color[2];
- texImage[j*4+3] = color[3];
- }
-
- if (MipMap) {
- GLint level = 0;
- GLint w = TexWidth, h = TexHeight;
- while (1) {
- glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w, h, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, texImage);
- if (w == 1 && h == 1)
- break;
- if (w > 1)
- w /= 2;
- if (h > 1)
- h /= 2;
- level++;
- /*printf("%d: %d x %d\n", level, w, h);*/
- }
- if (LinearFilter) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR_MIPMAP_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_NEAREST_MIPMAP_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
- }
- else {
- /* Set corners to white */
- int k = 0;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
- k = (TexWidth - 1) * 4;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
- k = (TexWidth * TexHeight - TexWidth) * 4;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
- k = (TexWidth * TexHeight - 1) * 4;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, texImage);
- if (LinearFilter) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
- }
-
- free(texImage);
- }
-
- glEnable(GL_TEXTURE_2D);
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 's':
- Idle();
- break;
- case 'z':
- Zrot -= step;
- break;
- case 'Z':
- Zrot += step;
- break;
- case ' ':
- Init();
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-int main( int argc, char *argv[] )
-{
- GLint i;
-
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( WinWidth, WinHeight );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-n") == 0) {
- NumTextures = atoi(argv[i+1]);
- if (NumTextures <= 0) {
- printf("Error, bad number of textures\n");
- return 1;
- }
- i++;
- }
- else if (strcmp(argv[i], "-mipmap") == 0) {
- MipMap = GL_TRUE;
- }
- else if (strcmp(argv[i], "-linear") == 0) {
- LinearFilter = GL_TRUE;
- }
- else if (strcmp(argv[i], "-size") == 0) {
- TexWidth = atoi(argv[i+1]);
- TexHeight = atoi(argv[i+2]);
- assert(TexWidth >= 1);
- assert(TexHeight >= 1);
- i += 2;
- }
- else if (strcmp(argv[i], "-randomsize") == 0) {
- RandomSize = GL_TRUE;
- }
- else if (strcmp(argv[i], "-lowpri") == 0) {
- LowPriorityCount = atoi(argv[i+1]);
- i++;
- }
- else {
- printf("Usage:\n");
- printf(" manytex [options]\n");
- printf("Options:\n");
- printf(" -n <number of texture objects>\n");
- printf(" -size <width> <height> - specify texture size\n");
- printf(" -randomsize - use random size textures\n");
- printf(" -mipmap - generate mipmaps\n");
- printf(" -linear - use linear filtering instead of nearest\n");
- printf(" -lowpri <n> - Set lower priority on <n> textures\n");
- return 0;
- }
- }
-
- Init();
-
- glutMainLoop();
-
- return 0;
-}
diff --git a/progs/miniglx/miniglxsample.c b/progs/miniglx/miniglxsample.c
deleted file mode 100644
index d4d6729f932..00000000000
--- a/progs/miniglx/miniglxsample.c
+++ /dev/null
@@ -1,128 +0,0 @@
-
-#define USE_MINIGLX 1 /* 1 = use Mini GLX, 0 = use Xlib/GLX */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <GL/gl.h>
-
-#if USE_MINIGLX
-#include <GL/miniglx.h>
-#else
-#include <GL/glx.h>
-#include <X11/Xlib.h>
-#endif
-
-static void _subset_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- glBegin( GL_QUADS );
- glVertex2f( x1, y1 );
- glVertex2f( x2, y1 );
- glVertex2f( x2, y2 );
- glVertex2f( x1, y2 );
- glEnd();
-}
-
-
-/*
- * Create a simple double-buffered RGBA window.
- */
-static Window
-MakeWindow(Display * dpy, unsigned int width, unsigned int height)
-{
- int visAttributes[] = {
- GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_DOUBLEBUFFER,
- None
- };
- XSetWindowAttributes attr;
- unsigned long attrMask;
- Window root;
- Window win;
- GLXContext ctx;
- XVisualInfo *visinfo;
-
- root = RootWindow(dpy, 0);
-
- /* Choose GLX visual / pixel format */
- visinfo = glXChooseVisual(dpy, 0, visAttributes);
- if (!visinfo) {
- printf("Error: couldn't get an RGB, Double-buffered visual\n");
- exit(1);
- }
-
- /* Create the window */
- attr.background_pixel = 0;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
- attrMask = CWBackPixel | CWBorderPixel | CWColormap;
- win = XCreateWindow(dpy, root, 0, 0, width, height,
- 0, visinfo->depth, InputOutput,
- visinfo->visual, attrMask, &attr);
- if (!win) {
- printf("Error: XCreateWindow failed\n");
- exit(1);
- }
-
- /* Display the window */
- XMapWindow(dpy, win);
-
- /* Create GLX rendering context */
- ctx = glXCreateContext(dpy, visinfo, NULL, True);
- if (!ctx) {
- printf("Error: glXCreateContext failed\n");
- exit(1);
- }
-
- /* Bind the rendering context and window */
- glXMakeCurrent(dpy, win, ctx);
-
- glViewport(0, 0, width, height);
-
- return win;
-}
-
-
-/*
- * Draw a few frames of a rotating square.
- */
-static void
-DrawFrames(Display * dpy, Window win)
-{
- int angle;
- glShadeModel(GL_FLAT);
- glClearColor(0.5, 0.5, 0.5, 1.0);
- for (angle = 0; angle < 360; angle += 10) {
- glClear(GL_COLOR_BUFFER_BIT);
- glColor3f(1.0, 1.0, 0.0);
- glPushMatrix();
- glRotatef(angle, 0, 0, 1);
- _subset_Rectf(-0.8, -0.8, 0.8, 0.8);
- glPopMatrix();
- glXSwapBuffers(dpy, win);
- sleep(1);
- }
-}
-
-
-int
-main(int argc, char *argv[])
-{
- Display *dpy;
- Window win;
-
- dpy = XOpenDisplay(NULL);
- if (!dpy) {
- printf("Error: XOpenDisplay failed\n");
- return 1;
- }
-
- win = MakeWindow(dpy, 300, 300);
-
- DrawFrames(dpy, win);
-
- return 0;
-}
diff --git a/progs/miniglx/miniglxtest.c b/progs/miniglx/miniglxtest.c
deleted file mode 100644
index ecc5786b73a..00000000000
--- a/progs/miniglx/miniglxtest.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* $Id: miniglxtest.c,v 1.3 2004/03/25 14:58:39 brianp Exp $ */
-
-/*
- * Test the mini GLX interface.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <GL/gl.h>
-#define USE_MINI_GLX 1
-#if USE_MINI_GLX
-#include <GL/miniglx.h>
-#else
-#include <GL/glx.h>
-#endif
-
-#define FRONTBUFFER 1
-#define NR 6
-#define DO_SLEEPS 1
-#define NR_DISPLAYS 2
-
-GLXContext ctx;
-
-
-static void _subset_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- glBegin( GL_QUADS );
- glVertex2f( x1, y1 );
- glVertex2f( x2, y1 );
- glVertex2f( x2, y2 );
- glVertex2f( x1, y2 );
- glEnd();
-}
-
-
-
-static void redraw( Display *dpy, Window w, int rot )
-{
- printf("Redraw event\n");
-
-#if FRONTBUFFER
- glDrawBuffer( GL_FRONT );
-#else
-/* glDrawBuffer( GL_BACK ); */
-#endif
-
- glClearColor( rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX,
- 1);
-
- glClear( GL_COLOR_BUFFER_BIT );
-
-#if 1
- glColor3f( rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX );
- glPushMatrix();
- glRotatef(rot, 0, 0, 1);
- glScalef(.5, .5, .5);
- _subset_Rectf( -1, -1, 1, 1 );
- glPopMatrix();
-#endif
-
-#if FRONTBUFFER
- glFlush();
-#else
- glXSwapBuffers( dpy, w );
-#endif
- glFinish();
-}
-
-
-static Window make_rgb_db_window( Display *dpy,
- unsigned int width, unsigned int height )
-{
- int attrib[] = { GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
-#if !FRONTBUFFER
- GLX_DOUBLEBUFFER,
-#endif
- None };
- int scrnum;
- XSetWindowAttributes attr;
- unsigned long mask;
- Window root;
- Window win;
- XVisualInfo *visinfo;
-
- scrnum = 0;
- root = RootWindow( dpy, scrnum );
-
- if (!(visinfo = glXChooseVisual( dpy, scrnum, attrib ))) {
- printf("Error: couldn't get an RGB, Double-buffered visual\n");
- exit(1);
- }
-
- if(!(ctx = glXCreateContext( dpy, visinfo, NULL, True ))) {
- printf("Error: glXCreateContext failed\n");
- exit(1);
- }
-
- /* window attributes */
- attr.background_pixel = 0;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
- attr.event_mask = StructureNotifyMask | ExposureMask;
- mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
-
- win = XCreateWindow( dpy, root, 0, 0, width, height,
- 0, visinfo->depth, InputOutput,
- visinfo->visual, mask, &attr );
- if (!win) {
- printf("Error: XCreateWindow failed\n");
- exit(1);
- }
-
- glXMakeCurrent( dpy, win, ctx );
-
- glViewport(0, 0, width, height);
-
- return win;
-}
-
-
-static void event_loop( Display *dpy, Window win )
-{
- int i;
-
- printf("Hang on... drawing %d frames\n", NR);
- for (i = 0; i < NR; i++) {
- redraw( dpy, win, i*10 );
- if (DO_SLEEPS) {
- printf("sleep(1)\n");
- sleep(1);
- }
- }
-}
-
-
-static int foo( void )
-{
- Display *dpy;
- Window win;
-
- dpy = XOpenDisplay(NULL);
- if (!dpy) {
- printf("Error: XOpenDisplay failed\n");
- return 1;
- }
-
- win = make_rgb_db_window( dpy, 800, 600);
-
- srand(getpid());
-
- glShadeModel( GL_FLAT );
- glClearColor( 0.5, 0.5, 0.5, 1.0 );
-
- XMapWindow( dpy, win );
-
- {
- XEvent e;
- while (1) {
- XNextEvent( dpy, &e );
- if (e.type == MapNotify && e.xmap.window == win) {
- break;
- }
- }
- }
-
- event_loop( dpy, win );
-
- glXDestroyContext( dpy, ctx );
- XDestroyWindow( dpy, win );
-
- XCloseDisplay( dpy );
-
- return 0;
-}
-
-
-int main()
-{
- int i;
- for (i = 0 ; i < NR_DISPLAYS ; i++) {
- if (foo() != 0)
- break;
- }
-
- return 0;
-}
diff --git a/progs/miniglx/sample_server.c b/progs/miniglx/sample_server.c
deleted file mode 100644
index 039c04fa40a..00000000000
--- a/progs/miniglx/sample_server.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* $Id: sample_server.c,v 1.1 2003/08/06 17:47:15 keithw Exp $ */
-
-/*
- * Sample server that just keeps first available window mapped.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/gl.h>
-#include <GL/miniglx.h>
-
-struct client {
- struct client *next;
- Window windowid;
- int mappable;
-};
-
-struct client *clients = 0, *mapped_client = 0;
-
-
-static struct client *find_client( Window id )
-{
- struct client *c;
-
- for (c = clients ; c ; c = c->next)
- if (c->windowid == id)
- return c;
-
- return 0;
-}
-
-int main( int argc, char *argv[] )
-{
- Display *dpy;
- XEvent ev;
-
- dpy = __miniglx_StartServer(NULL);
- if (!dpy) {
- fprintf(stderr, "Error: __miniglx_StartServer failed\n");
- return 1;
- }
-
- while (XNextEvent( dpy, &ev )) {
- struct client *c;
-
- switch (ev.type) {
- case MapRequest:
- fprintf(stderr, "MapRequest\n");
- c = find_client(ev.xmaprequest.window);
- if (!c) break;
- c->mappable = True;
- break;
-
- case UnmapNotify:
- fprintf(stderr, "UnmapNotify\n");
- c = find_client(ev.xunmap.window);
- if (!c) break;
- c->mappable = False;
- if (c == mapped_client)
- mapped_client = 0;
- break;
-
- case CreateNotify:
- fprintf(stderr, "CreateNotify\n");
- c = malloc(sizeof(*c));
- c->next = clients;
- c->windowid = ev.xcreatewindow.window;
- c->mappable = False;
- clients = c;
- break;
-
- case DestroyNotify:
- fprintf(stderr, "DestroyNotify\n");
- c = find_client(ev.xdestroywindow.window);
- if (!c) break;
- if (c == clients)
- clients = c->next;
- else {
- struct client *t;
- for (t = clients ; t->next != c ; t = t->next)
- ;
- t->next = c->next;
- }
-
- if (c == mapped_client)
- mapped_client = 0;
-
- free(c);
- break;
-
- default:
- break;
- }
-
- /* Search for first mappable client if none already mapped.
- */
- if (!mapped_client) {
- for (c = clients ; c ; c = c->next) {
- if (c->mappable) {
- XMapWindow( dpy, c->windowid );
- mapped_client = c;
- break;
- }
- }
- }
- }
-
- XCloseDisplay( dpy );
-
- return 0;
-}
diff --git a/progs/miniglx/sample_server2.c b/progs/miniglx/sample_server2.c
deleted file mode 100644
index 58effcf484d..00000000000
--- a/progs/miniglx/sample_server2.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* $Id: sample_server2.c,v 1.2 2003/08/23 01:28:59 jonsmirl Exp $ */
-
-/*
- * Sample server that just keeps first available window mapped.
- *
- * It also reads and echos anything that happens on stdin as an
- * example of tracking events from sources other than miniglx clients.
- *
- * It reads & writes without blocking, so that eg. piping a lot of
- * text to stdin and then hitting 'ctrl-S' on the output stream won't
- * cause it to stop handling miniglx events.
- *
- * See select_tut in the linux manual pages for a good overview of the
- * select(2) system call.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <GL/gl.h>
-#include <GL/miniglx.h>
-#include <errno.h>
-#include <assert.h>
-
-struct client {
- struct client *next;
- Window windowid;
- int mappable;
-};
-
-struct client *clients = 0, *mapped_client = 0;
-
-#define BUFSZ 4096
-char rbuf[BUFSZ];
-int rbuf_count;
-
-
-static struct client *find_client( Window id )
-{
- struct client *c;
-
- for (c = clients ; c ; c = c->next)
- if (c->windowid == id)
- return c;
-
- return 0;
-}
-
-int main( int argc, char *argv[] )
-{
- Display *dpy;
- XEvent ev;
- int autostart = 0;
-
- if (argc == 2 && strcmp(argv[1], "-autostart") == 0)
- autostart = 1;
-
- dpy = __miniglx_StartServer(NULL);
- if (!dpy) {
- fprintf(stderr, "Error: __miniglx_StartServer failed\n");
- return 1;
- }
-
- /* How is vt switching communicated through the XNextEvent interface?
- */
- while (1) {
- int r, n;
- struct timeval tv;
- fd_set rfds, wfds;
- int bored = 0;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- tv.tv_sec = 1;
- tv.tv_usec = 0;
-
- if (rbuf_count) {
- FD_SET( 1, &wfds ); /* notify when we can write out buffer */
- n = 1;
- }
- else {
- FD_SET( 0, &rfds ); /* else notify when new data to read */
- n = 0;
- }
-
- /* __miniglx_Select waits until any of these file groups becomes
- * readable/writable/etc (like regular select), until timeout
- * expires (like regular select), until a signal is received
- * (like regular select) or until an event is available for
- * XCheckMaskEvent().
- */
- r = __miniglx_Select( dpy, n+1, &rfds, &wfds, 0, &tv );
-
- /* This can happen if select() is interrupted by a signal:
- */
- if (r < 0 && errno != EINTR && errno != EAGAIN) {
- perror ("select()");
- exit (1);
- }
-
- if (tv.tv_sec == 0 && tv.tv_usec == 0)
- bored = 1;
-
- /* Check and handle events on our local file descriptors
- */
- if (FD_ISSET( 0, &rfds )) {
- /* Something on stdin */
- assert(rbuf_count == 0);
- r = read(0, rbuf, BUFSZ);
- if (r < 1) {
- perror("read");
- abort();
- }
- rbuf_count = r;
- }
-
- if (FD_ISSET( 1, &wfds )) {
- /* Can write to stdout */
- assert(rbuf_count > 0);
- r = write(1, rbuf, rbuf_count);
- if (r < 1) {
- perror("write");
- abort();
- }
- rbuf_count -= r;
- if (rbuf_count)
- memmove(rbuf + r, rbuf, rbuf_count);
- }
-
-
- /* Check and handle events generated by miniglx:
- */
- while (XCheckMaskEvent( dpy, ~0, &ev )) {
- struct client *c;
- bored = 0;
-
- fprintf(stderr, "Received event %d\n", ev.type);
-
- switch (ev.type) {
- case CreateNotify:
- fprintf(stderr, "CreateNotify -- new client\n");
- c = malloc(sizeof(*c));
- c->next = clients;
- c->windowid = ev.xcreatewindow.window;
- c->mappable = False;
- clients = c;
- break;
-
- case DestroyNotify:
- fprintf(stderr, "DestroyNotify\n");
- c = find_client(ev.xdestroywindow.window);
- if (!c) break;
- if (c == clients)
- clients = c->next;
- else {
- struct client *t;
- for (t = clients ; t->next != c ; t = t->next)
- ;
- t->next = c->next;
- }
-
- if (c == mapped_client)
- mapped_client = 0;
-
- free(c);
- break;
-
- case MapRequest:
- fprintf(stderr, "MapRequest\n");
- c = find_client(ev.xmaprequest.window);
- if (!c) break;
- c->mappable = True;
- break;
-
- case UnmapNotify:
- fprintf(stderr, "UnmapNotify\n");
- c = find_client(ev.xunmap.window);
- if (!c) break;
- c->mappable = False;
- if (c == mapped_client)
- mapped_client = 0;
- break;
-
- default:
- break;
- }
- }
-
-
- /* Search for first mappable client if none already mapped.
- */
- if (!mapped_client) {
- struct client *c;
- for (c = clients ; c ; c = c->next) {
- if (c->mappable) {
- XMapWindow( dpy, c->windowid );
- mapped_client = c;
- break;
- }
- }
- if (!clients && autostart) {
- system("nohup ./texline &");
- system("nohup ./manytex &");
- }
- }
- else if (bored) {
- struct client *c;
- /* bored of mapped client now, let's try & find another one */
- for (c = mapped_client->next ; c && !c->mappable ; c = c->next)
- ;
- if (!c)
- for (c = clients ; c && !c->mappable ; c = c->next)
- ;
- if (c && c != mapped_client) {
- XUnmapWindow( dpy, mapped_client->windowid );
- XMapWindow( dpy, c->windowid );
- mapped_client = c;
- }
- else
- fprintf(stderr, "I'm bored!\n");
- }
- }
-
- XCloseDisplay( dpy );
-
- return 0;
-}
diff --git a/progs/miniglx/texline.c b/progs/miniglx/texline.c
deleted file mode 100644
index d2a97d2876e..00000000000
--- a/progs/miniglx/texline.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/* $Id: texline.c,v 1.1 2003/08/06 17:47:15 keithw Exp $ */
-
-/*
- * Test textured lines.
- *
- * Brian Paul
- * September 2000
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-#include "../util/readtex.c" /* I know, this is a hack. */
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-static GLboolean Antialias = GL_FALSE;
-static GLboolean Animate = GL_FALSE;
-static GLint Texture = 1;
-static GLboolean Stipple = GL_FALSE;
-static GLfloat LineWidth = 1.0;
-
-static GLfloat Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
-static GLfloat DYrot = 1.0;
-static GLboolean Points = GL_FALSE;
-static GLfloat Scale = 1.0;
-
-static void Idle( void )
-{
- if (Animate) {
- Zrot += DYrot;
- glutPostRedisplay();
- }
-}
-
-
-static void Display( void )
-{
- GLfloat x, y, s, t;
-
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glScalef(Scale, Scale, Scale);
-
- if (Texture)
- glColor3f(1, 1, 1);
-
- if (Points) {
- glBegin(GL_POINTS);
- for (t = 0.0; t <= 1.0; t += 0.025) {
- for (s = 0.0; s <= 1.0; s += 0.025) {
- x = s * 2.0 - 1.0;
- y = t * 2.0 - 1.0;
- if (!Texture)
- glColor3f(1, 0, 1);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, t, s);
- glTexCoord2f(s, t);
- glVertex2f(x, y);
- }
- }
- glEnd();
- }
- else {
- glBegin(GL_LINES);
- for (t = 0.0; t <= 1.0; t += 0.025) {
- x = t * 2.0 - 1.0;
- if (!Texture)
- glColor3f(1, 0, 1);
- glTexCoord2f(t, 0.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, t);
- glVertex2f(x, -1.0);
- if (!Texture)
- glColor3f(0, 1, 0);
- glTexCoord2f(t, 1.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, t);
- glVertex2f(x, 1.0);
- }
- glEnd();
- }
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, 10.0, 100.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -12.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Antialias = !Antialias;
- if (Antialias) {
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_POINT_SMOOTH);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
- else {
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_POINT_SMOOTH);
- glDisable(GL_BLEND);
- }
- break;
- case 't':
- Texture++;
- if (Texture > 2)
- Texture = 0;
- if (Texture == 0) {
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glDisable(GL_TEXTURE_2D);
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glDisable(GL_TEXTURE_2D);
- }
- else if (Texture == 1) {
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glEnable(GL_TEXTURE_2D);
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glDisable(GL_TEXTURE_2D);
- }
- else {
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glEnable(GL_TEXTURE_2D);
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glEnable(GL_TEXTURE_2D);
- }
- break;
- case 'w':
- LineWidth -= 0.25;
- if (LineWidth < 0.25)
- LineWidth = 0.25;
- glLineWidth(LineWidth);
- glPointSize(LineWidth);
- break;
- case 'W':
- LineWidth += 0.25;
- if (LineWidth > 8.0)
- LineWidth = 8.0;
- glLineWidth(LineWidth);
- glPointSize(LineWidth);
- break;
- case 'p':
- Points = !Points;
- break;
- case 's':
- Stipple = !Stipple;
- if (Stipple)
- glEnable(GL_LINE_STIPPLE);
- else
- glDisable(GL_LINE_STIPPLE);
- break;
- case ' ':
- Animate = !Animate;
- if (Animate)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 27:
- exit(0);
- break;
- }
- printf("LineWidth, PointSize = %f\n", LineWidth);
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( int argc, char *argv[] )
-{
- GLuint u;
- for (u = 0; u < 2; u++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + u);
- glBindTexture(GL_TEXTURE_2D, 10+u);
- if (u == 0)
- glEnable(GL_TEXTURE_2D);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- if (u == 0)
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- else
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
- }
-
- glLineStipple(1, 0xff);
-
- if (argc > 1 && strcmp(argv[1], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowSize( 400, 300 );
-
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-
- glutCreateWindow(argv[0] );
-
- Init(argc, argv);
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Animate)
- glutIdleFunc( Idle );
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/osdemos/osdemo.c b/progs/osdemos/osdemo.c
index f7ce121f702..bc0168fb97b 100644
--- a/progs/osdemos/osdemo.c
+++ b/progs/osdemos/osdemo.c
@@ -4,7 +4,7 @@
* See Mesa/include/GL/osmesa.h for documentation of the OSMesa functions.
*
* If you want to render BIG images you'll probably have to increase
- * MAX_WIDTH and MAX_HEIGHT in src/config.h.
+ * MAX_WIDTH and MAX_Height in src/config.h.
*
* This program is in the public domain.
*
@@ -27,8 +27,8 @@
#define SAVE_TARGA
-#define WIDTH 400
-#define HEIGHT 400
+static int Width = 400;
+static int Height = 400;
static void
@@ -175,10 +175,10 @@ write_targa(const char *filename, const GLubyte *buffer, int width, int height)
fputc (0x00, f);
fputc (0x00, f); /* Y-origin of Image */
fputc (0x00, f);
- fputc (WIDTH & 0xff, f); /* Image Width */
- fputc ((WIDTH>>8) & 0xff, f);
- fputc (HEIGHT & 0xff, f); /* Image Height */
- fputc ((HEIGHT>>8) & 0xff, f);
+ fputc (Width & 0xff, f); /* Image Width */
+ fputc ((Width>>8) & 0xff, f);
+ fputc (Height & 0xff, f); /* Image Height */
+ fputc ((Height>>8) & 0xff, f);
fputc (0x18, f); /* Pixel Depth, 0x18 => 24 Bits */
fputc (0x20, f); /* Image Descriptor */
fclose(f);
@@ -248,36 +248,43 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
int
main(int argc, char *argv[])
{
+ OSMesaContext ctx;
void *buffer;
- int i;
char *filename = NULL;
+ if (argc < 2) {
+ fprintf(stderr, "Usage:\n");
+ fprintf(stderr, " osdemo filename [width height]\n");
+ return 0;
+ }
+
+ filename = argv[1];
+ if (argc == 4) {
+ Width = atoi(argv[2]);
+ Height = atoi(argv[3]);
+ }
+
/* Create an RGBA-mode context */
#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305
/* specify Z, stencil, accum sizes */
- OSMesaContext ctx = OSMesaCreateContextExt( OSMESA_RGBA, 16, 0, 0, NULL );
+ ctx = OSMesaCreateContextExt( OSMESA_RGBA, 16, 0, 0, NULL );
#else
- OSMesaContext ctx = OSMesaCreateContext( OSMESA_RGBA, NULL );
+ ctx = OSMesaCreateContext( OSMESA_RGBA, NULL );
#endif
if (!ctx) {
printf("OSMesaCreateContext failed!\n");
return 0;
}
- for (i = 1; i < argc; i++) {
- if (argv[i][0] != '-')
- filename = argv[i];
- }
-
/* Allocate the image buffer */
- buffer = malloc( WIDTH * HEIGHT * 4 * sizeof(GLubyte) );
+ buffer = malloc( Width * Height * 4 * sizeof(GLubyte) );
if (!buffer) {
printf("Alloc image buffer failed!\n");
return 0;
}
/* Bind the buffer to the context and make it current */
- if (!OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT )) {
+ if (!OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, Width, Height )) {
printf("OSMesaMakeCurrent failed!\n");
return 0;
}
@@ -295,9 +302,9 @@ main(int argc, char *argv[])
if (filename != NULL) {
#ifdef SAVE_TARGA
- write_targa(filename, buffer, WIDTH, HEIGHT);
+ write_targa(filename, buffer, Width, Height);
#else
- write_ppm(filename, buffer, WIDTH, HEIGHT);
+ write_ppm(filename, buffer, Width, Height);
#endif
}
else {
diff --git a/progs/redbook/Windows/redbook.dsw b/progs/redbook/Windows/redbook.dsw
deleted file mode 100644
index 71ba7e89e3e..00000000000
--- a/progs/redbook/Windows/redbook.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "teapots"=".\teapots.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/progs/redbook/Windows/teapots.dsp b/progs/redbook/Windows/teapots.dsp
deleted file mode 100644
index 4d39865810c..00000000000
--- a/progs/redbook/Windows/teapots.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="teapots" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=teapots - 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 "teapots.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 "teapots.mak" CFG="teapots - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "teapots - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "teapots - 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)" == "teapots - 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" /YX /FD /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapots.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "teapots - 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" /YX /FD /GZ /c
-# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapots.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "teapots - Win32 Release"
-# Name "teapots - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\teapots.c
-# 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/progs/slang/Makefile b/progs/slang/Makefile
deleted file mode 100644
index 1c602ce49c5..00000000000
--- a/progs/slang/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-# progs/slang/Makefile
-
-TOP = ../..
-
-include $(TOP)/configs/current
-
-INCDIR = $(TOP)/include
-
-LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
-
-#
-# targets
-#
-
-.PHONY: default tests clean
-
-default: cltest sotest vstest
-
-tests: default
- ! ./sotest 2> /dev/null | (grep -e ^[*][*][*])
- ! ./vstest 2> /dev/null | (grep -e ^[*][*][*])
- ! ./cltest 2> /dev/null | (grep -e ^[*][*][*])
-
-clean:
- rm -f cltest.o sotest.o vstest.o framework.o cltest sotest vstest
-
-#
-# executables
-#
-
-cltest: cltest.o framework.o $(LIB_DEP)
- $(CC) cltest.o framework.o $(APP_LIB_DEPS) -o cltest
-
-sotest: sotest.o framework.o $(LIB_DEP)
- $(CC) sotest.o framework.o $(APP_LIB_DEPS) -o sotest
-
-vstest: vstest.o framework.o $(LIB_DEP)
- $(CC) vstest.o framework.o $(APP_LIB_DEPS) -o vstest
-
-#
-# objects
-#
-
-framework.o: framework.c framework.h
- $(CC) -c -I$(INCDIR) framework.c -o framework.o
-
-cltest.o: cltest.c framework.h
- $(CC) -c -I$(INCDIR) cltest.c -o cltest.o
-
-sotest.o: sotest.c framework.h
- $(CC) -c -I$(INCDIR) sotest.c -o sotest.o
-
-vstest.o: vstest.c framework.h
- $(CC) -c -I$(INCDIR) vstest.c -o vstest.o
-
diff --git a/progs/slang/README b/progs/slang/README
deleted file mode 100644
index 13a6aaad348..00000000000
--- a/progs/slang/README
+++ /dev/null
@@ -1,7 +0,0 @@
-GLSL regression tests.
-
-Type "make" to build all test apps.
-
-Type "make tests" to build and run all test apps. If any
-error is detected, a line starting with *** is output.
-
diff --git a/progs/slang/cltest.c b/progs/slang/cltest.c
deleted file mode 100644
index 2753f59f85b..00000000000
--- a/progs/slang/cltest.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * GL_ARB_shading_language_100 test application.
- *
- * Tests correctness of emited code. Runs multiple well-formed shaders and checks if
- * they produce valid results.
- *
- * Requires specific support on the GL implementation side. A special function printMESA()
- * must be supported in the language that prints current values of generic type
- * to the appropriate shader's info log, and optionally to the screen.
- *
- * Author: Michal Krol
- */
-
-#include "framework.h"
-
-#define EPSILON 0.0001f
-
-static GLhandleARB vert = 0;
-static GLhandleARB prog = 0;
-
-static int get_line (FILE *f, char *line, int size)
-{
- if (fgets (line, size, f) == NULL)
- return 0;
- if (line[strlen (line) - 1] == '\n')
- line[strlen (line) - 1] = '\0';
- return 1;
-}
-
-struct ATTRIB
-{
- char name[32];
- GLfloat value[64][4];
- GLuint count;
-};
-
-struct ATTRIBS
-{
- struct ATTRIB attrib[32];
- GLuint count;
-};
-
-struct SHADER
-{
- char code[16000];
- GLfloat output[1000];
- GLuint count;
-};
-
-enum SHADER_LOAD_STATE
-{
- SLS_NONE,
- SLS_CODE,
- SLS_OUTPUT
-};
-
-struct PROGRAM
-{
- struct PROGRAM *next;
- char name[256];
- struct ATTRIBS attribs;
- struct SHADER vertex;
-};
-
-enum PROGRAM_LOAD_STATE
-{
- PLS_NONE,
- PLS_ATTRIB,
- PLS_VERTEX
-};
-
-static struct PROGRAM *program = NULL;
-
-static void load_test_file (const char *filename, struct PROGRAM **program)
-{
- struct PROGRAM **currprog = program;
- FILE *f;
- char line[256];
- enum PROGRAM_LOAD_STATE pls = PLS_NONE;
- enum SHADER_LOAD_STATE sls = SLS_NONE;
-
- f = fopen (filename, "r");
- if (f == NULL)
- return;
-
- while (get_line (f, line, sizeof (line))) {
- if (line[0] == '$') {
- if (strncmp (line + 1, "program", 7) == 0) {
- if (*currprog != NULL)
- currprog = &(**currprog).next;
- *currprog = (struct PROGRAM *) (malloc (sizeof (struct PROGRAM)));
- if (*currprog == NULL)
- break;
- (**currprog).next = NULL;
- strcpy ((**currprog).name, line + 9);
- (**currprog).attribs.count = 0;
- (**currprog).vertex.code[0] = '\0';
- (**currprog).vertex.count = 0;
- pls = PLS_NONE;
- }
- else if (strncmp (line + 1, "attrib", 6) == 0) {
- if (*currprog == NULL)
- break;
- strcpy ((**currprog).attribs.attrib[(**currprog).attribs.count].name, line + 8);
- (**currprog).attribs.attrib[(**currprog).attribs.count].count = 0;
- (**currprog).attribs.count++;
- pls = PLS_ATTRIB;
- }
- else if (strcmp (line + 1, "vertex") == 0) {
- if (*currprog == NULL)
- break;
- pls = PLS_VERTEX;
- sls = SLS_NONE;
- }
- else if (strcmp (line + 1, "code") == 0) {
- if (*currprog == NULL || pls != PLS_VERTEX)
- break;
- sls = SLS_CODE;
- }
- else if (strcmp (line + 1, "output") == 0) {
- if (*currprog == NULL || pls != PLS_VERTEX)
- break;
- sls = SLS_OUTPUT;
- }
- }
- else {
- if ((*currprog == NULL || pls == PLS_NONE || sls == SLS_NONE) && line[0] != '\0')
- break;
- if (*currprog != NULL && pls == PLS_VERTEX) {
- if (sls == SLS_CODE) {
- strcat ((**currprog).vertex.code, line);
- strcat ((**currprog).vertex.code, "\n");
- }
- else if (sls == SLS_OUTPUT && line[0] != '\0') {
- if (strcmp (line, "true") == 0)
- (**currprog).vertex.output[(**currprog).vertex.count] = 1.0f;
- else if (strcmp (line, "false") == 0)
- (**currprog).vertex.output[(**currprog).vertex.count] = 0.0f;
- else
- sscanf (line, "%f", &(**currprog).vertex.output[(**currprog).vertex.count]);
- (**currprog).vertex.count++;
- }
- }
- else if (*currprog != NULL && pls == PLS_ATTRIB && line[0] != '\0') {
- struct ATTRIB *att = &(**currprog).attribs.attrib[(**currprog).attribs.count - 1];
- GLfloat *vec = att->value[att->count];
- sscanf (line, "%f %f %f %f", &vec[0], &vec[1], &vec[2], &vec[3]);
- att->count++;
- }
- }
- }
-
- fclose (f);
-}
-
-void InitScene (void)
-{
- prog = glCreateProgramObjectARB ();
- vert = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
- glAttachObjectARB (prog, vert);
- glDeleteObjectARB (vert);
- load_test_file ("cltest.txt", &program);
-}
-
-void RenderScene (void)
-{
- struct PROGRAM *nextprogram;
- char *code;
- GLint info_length, length;
- char output[65000], *p;
- GLuint i;
-
- if (program == NULL)
- exit (0);
-
- code = program->vertex.code;
- glShaderSourceARB (vert, 1, (const GLcharARB **) (&code), NULL);
- glCompileShaderARB (vert);
- CheckObjectStatus (vert);
-
- for (i = 0; i < program->attribs.count; i++) {
- const char *name = program->attribs.attrib[i].name;
- if (strcmp (name, "gl_Vertex") != 0)
- glBindAttribLocationARB (prog, i, name);
- }
-
- glLinkProgramARB (prog);
- CheckObjectStatus (prog);
- glUseProgramObjectARB (prog);
-
- printf ("\n--- %s\n", program->name);
-
- glGetObjectParameterivARB (vert, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_length);
-
- glBegin (GL_POINTS);
- if (program->attribs.count == 0) {
- glVertex2f (0.0f, 0.0f);
- }
- else {
- for (i = 0; i < program->attribs.attrib[0].count; i++) {
- GLuint j;
- for (j = 0; j < program->attribs.count; j++) {
- GLuint n = (j + 1) % program->attribs.count;
- GLfloat *vec = program->attribs.attrib[n].value[i];
- const char *name = program->attribs.attrib[n].name;
- if (strcmp (name, "gl_Vertex") == 0)
- glVertex4fv (vec);
- else
- glVertexAttrib4fvARB (n, vec);
- }
- }
- }
- glEnd ();
- glFlush ();
-
- glGetInfoLogARB (vert, sizeof (output), &length, output);
- p = output + info_length - 1;
- for (i = 0; i < program->vertex.count; i++) {
- GLfloat value;
- if (p == NULL) {
- printf ("*** %s\n", "I/O error");
- break;
- }
- if (strncmp (p, "true", 4) == 0)
- value = 1.0f;
- else if (strncmp (p, "false", 5) == 0)
- value = 0.0f;
- else if (sscanf (p, "%f", &value) != 1) {
- printf ("*** %s\n", "I/O error");
- break;
- }
- if (fabs (value - program->vertex.output[i]) > EPSILON) {
- printf ("*** Values are different, is %f, should be %f\n", value,
- program->vertex.output[i]);
- }
- p = strchr (p, '\n');
- if (p != NULL)
- p++;
- }
- if (*p != '\0')
- printf ("*** %s\n", "I/O error");
-
- nextprogram = program->next;
- free (program);
- program = nextprogram;
-}
-
-int main (int argc, char *argv[])
-{
- InitFramework (&argc, argv);
- return 0;
-}
-
diff --git a/progs/slang/cltest.txt b/progs/slang/cltest.txt
deleted file mode 100644
index e7d47c2cb62..00000000000
--- a/progs/slang/cltest.txt
+++ /dev/null
@@ -1,1575 +0,0 @@
-$ /*
-$ Shader test script.
-$
-$ Author: Michal Krol
-$
-$ Comment line starts with dollar sign and white space.
-$
-$ $program <name> starts a new test program section called <name>. Contains all other sections.
-$
-$ $attrib <name> starts vertex data input section for attrib called <name>. Each line consists of
-$ four values that form single vertex attrib.
-$
-$ $vertex starts vertex shader section. Contains $code and &output sections.
-$
-$ $code starts source code section. All text in this section gets compiled into appropriate
-$ shader object.
-$
-$ $output starts shader execution results section. These are compared, value-by-value,
-$ with results of executing printMESA() functions within a shader.
-$ */
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test printMESA() function.
-$ */
-
-$program PRINT TEST
-
-$vertex
-
-$code
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (11.1);
- printMESA (111);
- printMESA (true);
-
- printMESA (vec2 (22.1, 22.2));
- printMESA (vec3 (33.1, 33.2, 33.3));
- printMESA (vec4 (44.1, 44.2, 44.3, 44.4));
-
- printMESA (ivec2 (221, 222));
- printMESA (ivec3 (331, 332, 333));
- printMESA (ivec4 (441, 442, 443, 444));
-
- printMESA (bvec2 (false, true));
- printMESA (bvec3 (true, true, false));
- printMESA (bvec4 (true, false, true, false));
-
- printMESA (mat2 (55.11, 55.12, 55.21, 55.22));
- printMESA (mat3 (66.11, 66.12, 66.13,
- 66.21, 66.22, 66.23,
- 66.31, 66.32, 66.33));
- printMESA (mat4 (77.11, 77.12, 77.13, 77.14,
- 77.21, 77.22, 77.23, 77.24,
- 77.31, 77.32, 77.33, 77.34,
- 77.41, 77.42, 77.43, 77.44));
-}
-
-$output
-
-11.1
-111
-true
-
-22.1
-22.2
-33.1
-33.2
-33.3
-44.1
-44.2
-44.3
-44.4
-
-221
-222
-331
-332
-333
-441
-442
-443
-444
-
-false
-true
-true
-true
-false
-true
-false
-true
-false
-
-55.11
-55.12
-55.21
-55.22
-
-66.11
-66.12
-66.13
-66.21
-66.22
-66.23
-66.31
-66.32
-66.33
-
-77.11
-77.12
-77.13
-77.14
-77.21
-77.22
-77.23
-77.24
-77.31
-77.32
-77.33
-77.34
-77.41
-77.42
-77.43
-77.44
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test type casting.
-$ */
-
-$program TYPE CAST TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _Zero
-0.0 0.0 0.0 0.0
-
-$attrib _One
-1.1 0.0 0.0 0.0
-
-$attrib _Two
-2.2 0.0 0.0 0.0
-
-$attrib _MinusThree
--3.3 0.0 0.0 0.0
-
-$vertex
-
-$code
-
-attribute float _Zero;
-attribute float _One;
-attribute float _Two;
-attribute float _MinusThree;
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_Zero);
- printMESA (_One);
- printMESA (_Two);
- printMESA (_MinusThree);
-
- printMESA (float (_Zero));
- printMESA (float (_One));
- printMESA (float (_Two));
- printMESA (float (_MinusThree));
- printMESA (float (45.99));
- printMESA (float (-6.17));
-
- printMESA (bool (_Zero));
- printMESA (bool (_One));
- printMESA (bool (_Two));
- printMESA (bool (_MinusThree));
- printMESA (bool (45.99));
- printMESA (bool (-6.17));
- printMESA (bool (0.0001));
- printMESA (bool (0.0));
-
- printMESA (int (_Zero));
- printMESA (int (_One));
- printMESA (int (_Two));
- printMESA (int (_MinusThree));
- printMESA (int (45.99));
- printMESA (int (45.22));
- printMESA (int (-6.17));
- printMESA (int (-6.87));
-}
-
-$output
-
-0.0
-1.1
-2.2
--3.3
-
-0.0
-1.1
-2.2
--3.3
-45.99
--6.17
-
-false
-true
-true
-true
-true
-true
-true
-false
-
-0
-1
-2
--3
-45
-45
--6
--6
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test vector swizzles.
-$ */
-
-$program SWIZZLE TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _One
-1.1 1.2 1.3 1.4
-
-$attrib _Two
-2.1 2.2 2.3 2.4
-
-$vertex
-
-$code
-
-attribute vec4 _One;
-attribute vec4 _Two;
-
-void assign5678 (out vec4 v)
-{
- v.x = 5.5;
- v.y = 6.6;
- v.z = 7.7;
- v.w = 8.8;
-}
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_One);
- printMESA (_Two);
-
- printMESA (_One.x);
- printMESA (_One.y);
- printMESA (_One.z);
- printMESA (_One.w);
-
- printMESA (_Two.xy);
- printMESA (_Two.yx);
- printMESA (_Two.xw);
- printMESA (_Two.wx);
- printMESA (_Two.yz);
- printMESA (_Two.zy);
- printMESA (_Two.xz);
- printMESA (_Two.zx);
- printMESA (_Two.zw);
- printMESA (_Two.wz);
-
- printMESA (_One.xyz);
- printMESA (_One.yzx);
- printMESA (_One.zxy);
- printMESA (_One.xzy);
- printMESA (_One.yzw);
- printMESA (_One.zwx);
-
- printMESA (_Two.xyzw);
- printMESA (_Two.yzwx);
- printMESA (_Two.wzyx);
- printMESA (_Two.zwyx);
-
- printMESA (_One.xx);
- printMESA (_One.zz);
- printMESA (_One.ww);
-
- printMESA (_Two.xxx);
- printMESA (_Two.yyy);
- printMESA (_Two.www);
-
- printMESA (_One.xxxx);
- printMESA (_One.zzzz);
-
- printMESA (_Two.xxyy);
- printMESA (_Two.wwxx);
- printMESA (_Two.zxxw);
-
- vec4 v;
-
- v.zxwy = vec4 (5.5, 6.6, 7.7, 8.8);
- printMESA (v);
-
- assign5678 (v.ywxz);
- printMESA (v);
-}
-
-$output
-
-1.1
-1.2
-1.3
-1.4
-2.1
-2.2
-2.3
-2.4
-
-1.1
-1.2
-1.3
-1.4
-
-2.1
-2.2
-2.2
-2.1
-2.1
-2.4
-2.4
-2.1
-2.2
-2.3
-2.3
-2.2
-2.1
-2.3
-2.3
-2.1
-2.3
-2.4
-2.4
-2.3
-
-1.1
-1.2
-1.3
-1.2
-1.3
-1.1
-1.3
-1.1
-1.2
-1.1
-1.3
-1.2
-1.2
-1.3
-1.4
-1.3
-1.4
-1.1
-
-2.1
-2.2
-2.3
-2.4
-2.2
-2.3
-2.4
-2.1
-2.4
-2.3
-2.2
-2.1
-2.3
-2.4
-2.2
-2.1
-
-1.1
-1.1
-1.3
-1.3
-1.4
-1.4
-
-2.1
-2.1
-2.1
-2.2
-2.2
-2.2
-2.4
-2.4
-2.4
-
-1.1
-1.1
-1.1
-1.1
-1.3
-1.3
-1.3
-1.3
-
-2.1
-2.1
-2.2
-2.2
-2.4
-2.4
-2.1
-2.1
-2.3
-2.1
-2.1
-2.4
-
-6.6
-8.8
-5.5
-7.7
-
-7.7
-5.5
-8.8
-6.6
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test relational operators.
-$ */
-
-$program RELATIONAL OPERATOR TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _Two
-2.0 0.0 0.0 0.0
-
-$attrib _Two2
-2.0 0.0 0.0 0.0
-
-$attrib _MinusThree
--3.0 0.0 0.0 0.0
-
-$vertex
-
-$code
-
-attribute float _Two;
-attribute float _Two2;
-attribute float _MinusThree;
-
-struct foo
-{
- float f;
- vec4 v4;
- vec3 v3;
- mat4 m4;
- int i;
- bool b;
-};
-
-void printMESA (const in foo bar)
-{
- printMESA (bar.f);
- printMESA (bar.v4);
- printMESA (bar.v3);
- printMESA (bar.m4);
- printMESA (bar.i);
- printMESA (bar.b);
-}
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- int iTwo = int (_Two);
- int iTwo2 = int (_Two2);
- int iMinusThree = int (_MinusThree);
-
- printMESA (_Two <= _Two);
- printMESA (_Two <= _Two2);
- printMESA (_Two <= _MinusThree);
- printMESA (_MinusThree <= _Two);
- printMESA (iTwo <= iTwo);
- printMESA (iTwo <= iTwo2);
- printMESA (iTwo <= iMinusThree);
- printMESA (iMinusThree <= iTwo);
-
- printMESA (_Two >= _Two);
- printMESA (_Two >= _Two2);
- printMESA (_Two >= _MinusThree);
- printMESA (_MinusThree >= _Two);
- printMESA (iTwo >= iTwo);
- printMESA (iTwo >= iTwo2);
- printMESA (iTwo >= iMinusThree);
- printMESA (iMinusThree >= iTwo);
-
- printMESA (_Two < _Two);
- printMESA (_Two < _Two2);
- printMESA (_Two < _MinusThree);
- printMESA (_MinusThree < _Two);
- printMESA (iTwo < iTwo);
- printMESA (iTwo < iTwo2);
- printMESA (iTwo < iMinusThree);
- printMESA (iMinusThree < iTwo);
-
- printMESA (_Two > _Two);
- printMESA (_Two > _Two2);
- printMESA (_Two > _MinusThree);
- printMESA (_MinusThree > _Two);
- printMESA (iTwo > iTwo);
- printMESA (iTwo > iTwo2);
- printMESA (iTwo > iMinusThree);
- printMESA (iMinusThree > iTwo);
-
- printMESA (_Two == _Two);
- printMESA (_Two == _Two2);
- printMESA (_Two == _MinusThree);
- printMESA (_MinusThree == _MinusThree);
- printMESA (iTwo == iTwo);
- printMESA (iTwo == iTwo2);
- printMESA (iTwo == iMinusThree);
- printMESA (iMinusThree == iMinusThree);
-
- printMESA (_Two != _Two);
- printMESA (_Two != _Two2);
- printMESA (_Two != _MinusThree);
- printMESA (_MinusThree != _MinusThree);
- printMESA (iTwo != iTwo);
- printMESA (iTwo != iTwo2);
- printMESA (iTwo != iMinusThree);
- printMESA (iMinusThree != iMinusThree);
-
- foo foo1;
- foo1.f = 13.31;
- foo1.v4 = vec4 (44.11, 44.22, 44.33, 44.44);
- foo1.v3 = vec3 (33.11, 33.22, 33.33);
- foo1.m4 = mat4 (17.88);
- foo1.i = 666;
- foo1.b = true;
- printMESA (foo1);
-
- // make foo2 the same as foo1
- foo foo2;
- foo2.f = 13.31;
- foo2.v4 = vec4 (44.11, 44.22, 44.33, 44.44);
- foo2.v3 = vec3 (33.11, 33.22, 33.33);
- foo2.m4 = mat4 (17.88);
- foo2.i = 666;
- foo2.b = true;
-
- printMESA (foo1 == foo2);
- printMESA (foo1 != foo2);
-
- // make them a little bit different
- foo2.m4[2].y = 333.333;
- printMESA (foo2);
-
- printMESA (foo1 == foo2);
- printMESA (foo1 != foo2);
-}
-
-$output
-
-true
-true
-false
-true
-true
-true
-false
-true
-
-true
-true
-true
-false
-true
-true
-true
-false
-
-false
-false
-false
-true
-false
-false
-false
-true
-
-false
-false
-true
-false
-false
-false
-true
-false
-
-true
-true
-false
-true
-true
-true
-false
-true
-
-false
-false
-true
-false
-false
-false
-true
-false
-
-13.31
-44.11
-44.22
-44.33
-44.44
-33.11
-33.22
-33.33
-17.88
-0.0
-0.0
-0.0
-0.0
-17.88
-0.0
-0.0
-0.0
-0.0
-17.88
-0.0
-0.0
-0.0
-0.0
-17.88
-666
-true
-
-true
-false
-
-13.31
-44.11
-44.22
-44.33
-44.44
-33.11
-33.22
-33.33
-17.88
-0.0
-0.0
-0.0
-0.0
-17.88
-0.0
-0.0
-0.0
-333.333
-17.88
-0.0
-0.0
-0.0
-0.0
-17.88
-666
-true
-
-false
-true
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test logical operators.
-$ */
-
-$program LOGICAL OPERATOR TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _False
-0.0 0.0 0.0 0.0
-
-$attrib _True
-1.0 0.0 0.0 0.0
-
-$attrib _False2
-0.0 0.0 0.0 0.0
-
-$attrib _True2
-1.0 0.0 0.0 0.0
-
-$vertex
-
-$code
-
-attribute float _False;
-attribute float _True;
-attribute float _False2;
-attribute float _True2;
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_False);
- printMESA (_True);
- printMESA (_False2);
- printMESA (_True2);
-
- bool False = bool (_False);
- bool True = bool (_True);
- bool False2 = bool (_False2);
- bool True2 = bool (_True2);
-
- //
- // It is important to test each operator with the following argument types:
- // * Both arguments are different variables, even if they have the same values.
- // False and False2 are distinct attributes, but are the same in value.
- // * Both arguments may be the same variables. This case tests possible
- // optimizations, e.g. X && X --> X.
- // * Both arguments are constant. This tests constant folding.
- //
-
- printMESA (!False);
- printMESA (!True);
- printMESA (!false);
- printMESA (!true);
-
- printMESA (False ^^ False2);
- printMESA (False ^^ True2);
- printMESA (True ^^ False2);
- printMESA (True ^^ True2);
- printMESA (False ^^ False);
- printMESA (False ^^ True);
- printMESA (True ^^ False);
- printMESA (True ^^ True);
- printMESA (false ^^ false);
- printMESA (false ^^ true);
- printMESA (true ^^ false);
- printMESA (true ^^ true);
-
- printMESA (False && False2);
- printMESA (False && True2);
- printMESA (True && False2);
- printMESA (True && True2);
- printMESA (False && False);
- printMESA (False && True);
- printMESA (True && False);
- printMESA (True && True);
- printMESA (false && false);
- printMESA (false && true);
- printMESA (true && false);
- printMESA (true && true);
-
- printMESA (False || False2);
- printMESA (False || True2);
- printMESA (True || False2);
- printMESA (True || True2);
- printMESA (False || False);
- printMESA (False || True);
- printMESA (True || False);
- printMESA (True || True);
- printMESA (false || false);
- printMESA (false || true);
- printMESA (true || false);
- printMESA (true || true);
-
- //
- // Test short-circuit evaluation of && and ||. The right expression evaluation depends
- // on the value of the left expression. If the right expression has side effects, we
- // can easily test if it happened.
- //
-
- bool x;
-
- x = false;
- printMESA (x);
- printMESA (False && (x = true));
- printMESA (x);
-
- x = false;
- printMESA (x);
- printMESA (false && (x = true));
- printMESA (x);
-
- x = true;
- printMESA (x);
- printMESA (True || (x = false));
- printMESA (x);
-
- x = true;
- printMESA (x);
- printMESA (true || (x = false));
- printMESA (x);
-}
-
-$output
-
-0.0
-1.0
-0.0
-1.0
-
-true
-false
-true
-false
-
-false
-true
-true
-false
-false
-true
-true
-false
-false
-true
-true
-false
-
-false
-false
-false
-true
-false
-false
-false
-true
-false
-false
-false
-true
-
-false
-true
-true
-true
-false
-true
-true
-true
-false
-true
-true
-true
-
-false
-false
-false
-
-false
-false
-false
-
-true
-true
-true
-
-true
-true
-true
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test subscript operator/array access.
-$ */
-
-$program ARRAY ACCESS TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _Zero
-0.0 0.0 0.0 0.0
-
-$attrib _One
-1.1 0.0 0.0 0.0
-
-$attrib _Two
-2.9 0.0 0.0 0.0
-
-$attrib _Vec
-11.11 22.22 33.33 44.44
-
-$vertex
-
-$code
-
-attribute float _Zero;
-attribute float _One;
-attribute float _Two;
-attribute vec4 _Vec;
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_Zero);
- printMESA (_One);
- printMESA (_Two);
- printMESA (_Vec);
-
- printMESA (_Vec[0]);
- printMESA (_Vec[1]);
- printMESA (_Vec[2]);
- printMESA (_Vec[3]);
-
- printMESA (_Vec[int (_Zero)]);
- printMESA (_Vec[int (_One)]);
- printMESA (_Vec[int (_Two)]);
-}
-
-$output
-
-0.0
-1.1
-2.9
-11.11
-22.22
-33.33
-44.44
-
-11.11
-22.22
-33.33
-44.44
-
-11.11
-22.22
-33.33
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test pre/post-increment/decrement operators.
-$ Note: assumes relational operators being correct.
-$ */
-
-$program PRE/POST-INC/DEC OPERATOR TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _Zero
-0.0 0.0 0.0 0.0
-
-$attrib _One
-1.1 0.0 0.0 0.0
-
-$attrib _Two4
-2.1 2.2 2.3 2.4
-
-$vertex
-
-$code
-
-attribute float _Zero;
-attribute float _One;
-attribute vec4 _Two4;
-
-float fZero, fOne;
-vec4 fTwo4;
-int iZero, iOne;
-ivec4 iTwo4;
-
-void reset () {
- fZero = _Zero;
- fOne = _One;
- fTwo4 = _Two4;
- iZero = int (_Zero);
- iOne = int (_One);
- iTwo4 = ivec4 (_Two4);
-}
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_Zero);
- printMESA (_One);
- printMESA (_Two4);
-
- // pre-increment
- reset ();
- printMESA (++fZero);
- printMESA (++fOne);
- printMESA (++iZero);
- printMESA (++iOne);
- printMESA (fZero);
- printMESA (fOne);
- printMESA (iZero);
- printMESA (iOne);
- printMESA (++fTwo4 == _Two4 + 1.0);
- printMESA (++iTwo4 == ivec4 (_Two4) + 1);
-
- // pre-decrement
- reset ();
- printMESA (--fZero);
- printMESA (--fOne);
- printMESA (--iZero);
- printMESA (--iOne);
- printMESA (fZero);
- printMESA (fOne);
- printMESA (iZero);
- printMESA (iOne);
- printMESA (--fTwo4 == _Two4 - 1.0);
- printMESA (--iTwo4 == ivec4 (_Two4) - 1);
-
- // post-increment
- reset ();
- printMESA (fZero++);
- printMESA (fOne++);
- printMESA (iZero++);
- printMESA (iOne++);
- printMESA (fZero);
- printMESA (fOne);
- printMESA (iZero);
- printMESA (iOne);
- printMESA (fTwo4++ == _Two4);
- printMESA (iTwo4++ == ivec4 (_Two4));
-
- // post-decrement
- reset ();
- printMESA (fZero--);
- printMESA (fOne--);
- printMESA (iZero--);
- printMESA (iOne--);
- printMESA (fZero);
- printMESA (fOne);
- printMESA (iZero);
- printMESA (iOne);
- printMESA (fTwo4-- == _Two4);
- printMESA (iTwo4-- == ivec4 (_Two4));
-}
-
-$output
-
-0.0
-1.1
-2.1
-2.2
-2.3
-2.4
-
-1.0
-2.1
-1
-2
-1.0
-2.1
-1
-2
-true
-true
-
--1.0
-0.1
--1
-0
--1.0
-0.1
--1
-0
-true
-true
-
-0.0
-1.1
-0
-1
-1.0
-2.1
-1
-2
-true
-true
-
-0.0
-1.1
-0
-1
--1.0
-0.1
--1
-0
-true
-true
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test arithmetical operators.
-$ */
-
-$program ARITHMETICAL OPERATOR TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _Zero
-0.0 0.0 0.0 0.0
-
-$attrib _One
-1.1 0.0 0.0 0.0
-
-$attrib _Two4
-2.1 2.2 2.3 2.4
-
-$vertex
-
-$code
-
-attribute float _Zero;
-attribute float _One;
-attribute vec4 _Two4;
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_Zero);
- printMESA (_One);
- printMESA (_Two4);
-
- int iZero = int (_Zero);
- int iOne = int (_One);
- ivec4 iTwo4 = ivec4 (_Two4);
-
- printMESA (-_Zero);
- printMESA (-_One);
- printMESA (-_Two4);
- printMESA (-_Two4.z);
-
- printMESA (_Zero + 0.0);
- printMESA (_One + 0.0);
- printMESA (_Two4 + 0.0);
- printMESA (_Two4.y + 0.0);
-
- printMESA (_Zero + _Zero);
- printMESA (_Zero + _One);
- printMESA (_Zero + _Two4);
- printMESA (_One + _Zero);
- printMESA (_One + _Two4);
- printMESA (_Two4 + _Two4);
-
- printMESA (_Zero - 0.0);
- printMESA (_One - 0.0);
- printMESA (_Two4 - 0.0);
- printMESA (_Two4.y - 0.0);
-
- printMESA (_Zero - _Zero);
- printMESA (_Zero - _One);
- printMESA (_Zero - _Two4);
- printMESA (_One - _Zero);
- printMESA (_One - _Two4);
- printMESA (_Two4 - _Two4);
-
- printMESA (_Zero * 1.0);
- printMESA (_One * 1.0);
- printMESA (_Two4 * 1.0);
- printMESA (_Two4.x * 1.0);
-
- printMESA (_Zero * _Zero);
- printMESA (_Zero * _One);
- printMESA (_Zero * _Two4);
- printMESA (_One * _Zero);
- printMESA (_One * _One);
- printMESA (_One * _Two4);
- printMESA (_Two4 * _Two4);
-
- printMESA (_Zero / 1.0);
- printMESA (_One / 1.0);
- printMESA (_Two4 / 1.0);
- printMESA (_Two4.x / 1.0);
-
- printMESA (_Zero / _One);
- printMESA (_Zero / _Two4);
- printMESA (_One / _One);
- printMESA (_One / _Two4);
- printMESA (_Two4 / _Two4);
-}
-
-$output
-
-0.0
-1.1
-2.1
-2.2
-2.3
-2.4
-
-0.0
--1.1
--2.1
--2.2
--2.3
--2.4
--2.3
-
-0.0
-1.1
-2.1
-2.2
-2.3
-2.4
-2.2
-
-0.0
-1.1
-2.1
-2.2
-2.3
-2.4
-1.1
-3.2
-3.3
-3.4
-3.5
-4.2
-4.4
-4.6
-4.8
-
-0.0
-1.1
-2.1
-2.2
-2.3
-2.4
-2.2
-
-0.0
--1.1
--2.1
--2.2
--2.3
--2.4
-1.1
--1.0
--1.1
--1.2
--1.3
-0.0
-0.0
-0.0
-0.0
-
-0.0
-1.1
-2.1
-2.2
-2.3
-2.4
-2.1
-
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-1.21
-2.31
-2.42
-2.53
-2.64
-4.41
-4.84
-5.29
-5.76
-
-0.0
-1.1
-2.1
-2.2
-2.3
-2.4
-2.1
-
-0.0
-0.0
-0.0
-0.0
-0.0
-1.0
-0.52381
-0.5
-0.47826
-0.45833
-1.0
-1.0
-1.0
-1.0
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test matrix operations.
-$ Note: assumes relational operators being correct.
-$ */
-
-$program MATRIX TEST
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _Zero
-0.0 0.0 0.0 0.0
-
-$attrib _One
-1.0 1.0 1.0 1.0
-
-$attrib _Two
-2.0 2.0 2.0 2.0
-
-$vertex
-
-$code
-
-attribute vec4 _Zero;
-attribute vec4 _One;
-attribute vec4 _Two;
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_Zero);
- printMESA (_One);
- printMESA (_Two);
-
- mat4 Identity = mat4 (_One.x);
-
- printMESA (Identity == mat4 (1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0));
- printMESA (Identity * _Two == _Two);
-
- mat4 Matrix = mat4 (1.1, 1.2, 1.3, 1.4,
- 2.1, 2.2, 2.3, 2.4,
- 3.1, 3.2, 3.3, 3.4,
- 4.1, 4.2, 4.3, 4.4);
-
- printMESA (Matrix[2].y);
- printMESA (Matrix[1]);
-}
-
-$output
-
-0.0
-0.0
-0.0
-0.0
-1.0
-1.0
-1.0
-1.0
-2.0
-2.0
-2.0
-2.0
-true
-true
-3.2
-2.1
-2.2
-2.3
-2.4
-
-
-$ /*
-$ --------------------------------------------------------------------------------------------------
-$ Test vec4 extension operations.
-$ */
-
-$program VEC4 EXTENSION OPERATIONS
-
-$attrib gl_Vertex
-0.0 0.0 0.0 1.0
-
-$attrib _One
-1.1 0.0 0.0 0.0
-
-$attrib _Two4
-2.1 2.2 2.3 2.4
-
-$attrib _Three4
-3.1 3.2 3.3 3.4
-
-$vertex
-
-$code
-
-attribute float _One;
-attribute vec4 _Two4;
-attribute vec4 _Three4;
-
-void main () {
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- printMESA (_One);
- printMESA (_Two4);
- printMESA (_Three4);
-
- printMESA (vec4 (_One));
-
- printMESA (_Two4 + _Three4);
- printMESA (_Two4 - _Three4);
- printMESA (_Two4 * _Three4);
- printMESA (_Two4 / _Three4);
-
- printMESA (_Two4 + _One);
- printMESA (_Two4 - _One);
- printMESA (_Two4 * _One);
- printMESA (_Two4 / _One);
-
- printMESA (_One + _Two4);
- printMESA (_One - _Two4);
- printMESA (_One * _Two4);
- printMESA (_One / _Two4);
-
- printMESA (-_Three4);
-
- printMESA (dot (_Two4.xyz, _Three4.xyz));
- printMESA (dot (_Two4, _Three4));
-
- printMESA (length (_Two4.xyz));
- printMESA (length (_Three4));
-
- printMESA (normalize (_Two4.xyz));
- printMESA (normalize (_Three4));
-
- vec4 tmp = _Two4;
- printMESA (tmp);
-
- printMESA (_Two4 == _Three4);
- printMESA (_Two4 != _Three4);
- printMESA (_Two4 == _Two4);
- printMESA (_Three4 != _Three4);
- printMESA (_Two4 != vec4 (_Two4.xyz, 999.0));
- printMESA (_Two4 != vec4 (999.0, _Two4.yzw));
-}
-
-$output
-
-1.1
-2.1
-2.2
-2.3
-2.4
-3.1
-3.2
-3.3
-3.4
-
-1.1
-1.1
-1.1
-1.1
-
-5.2
-5.4
-5.6
-5.8
--1.0
--1.0
--1.0
--1.0
-6.51
-7.04
-7.59
-8.16
-0.677419
-0.6875
-0.69697
-0.705882
-
-3.2
-3.3
-3.4
-3.5
-1.0
-1.1
-1.2
-1.3
-2.31
-2.42
-2.53
-2.64
-1.909091
-2.0
-2.090909
-2.181818
-
-3.2
-3.3
-3.4
-3.5
--1.0
--1.1
--1.2
--1.3
-2.31
-2.42
-2.53
-2.64
-0.52381
-0.5
-0.478261
-0.458333
-
--3.1
--3.2
--3.3
--3.4
-
-21.14
-29.3
-
-3.813135
-6.503845
-
-0.550728
-0.576953
-0.603178
-0.476641
-0.492017
-0.507392
-0.522768
-
-2.1
-2.2
-2.3
-2.4
-
-false
-true
-true
-false
-true
-true
diff --git a/progs/slang/framework.c b/progs/slang/framework.c
deleted file mode 100644
index 692cef9c8cb..00000000000
--- a/progs/slang/framework.c
+++ /dev/null
@@ -1,145 +0,0 @@
-#include "framework.h"
-
-/*
- * GL_ARB_multitexture
- */
-#ifndef GL_ARB_multitexture
-PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
-PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
-#endif
-
-/*
- * GL_ARB_shader_objects
- */
-PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
-PFNGLGETHANDLEARBPROC glGetHandleARB;
-PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
-PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
-PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
-PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
-PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
-PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
-PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
-PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
-PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
-PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
-PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
-
-/*
- * GL_ARB_vertex_shader
- */
-PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
-PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
-PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
-PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
-PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
-PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
-
-/*
- * GL_EXT_fog_coord
- */
-PFNGLFOGCOORDFVEXTPROC glFogCoordfvEXT;
-PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointerEXT;
-
-/*
- * GL_EXT_secondary_color
- */
-PFNGLSECONDARYCOLOR3FVEXTPROC glSecondaryColor3fvEXT;
-PFNGLSECONDARYCOLORPOINTEREXTPROC glSecondaryColorPointerEXT;
-
-static void Display (void)
-{
- glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- RenderScene ();
- glutSwapBuffers ();
-}
-
-static void Idle (void)
-{
- glutPostRedisplay ();
-}
-
-void InitFramework (int *argc, char *argv[])
-{
- glutInit (argc, argv);
- glutInitWindowPosition (0, 0);
- glutInitWindowSize (200, 200);
- glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
- glutCreateWindow (argv[0]);
-
-#ifndef GL_ARB_multitexture
- GETPROCADDR(glClientActiveTextureARB, PFNGLCLIENTACTIVETEXTUREARBPROC);
- GETPROCADDR(glMultiTexCoord4fvARB, PFNGLMULTITEXCOORD4FVARBPROC);
-#endif
-
- GETPROCADDR(glDeleteObjectARB, PFNGLDELETEOBJECTARBPROC);
- GETPROCADDR(glGetHandleARB, PFNGLGETHANDLEARBPROC);
- GETPROCADDR(glDetachObjectARB, PFNGLDETACHOBJECTARBPROC);
- GETPROCADDR(glCreateShaderObjectARB, PFNGLCREATESHADEROBJECTARBPROC);
- GETPROCADDR(glShaderSourceARB, PFNGLSHADERSOURCEARBPROC);
- GETPROCADDR(glCompileShaderARB, PFNGLCOMPILESHADERARBPROC);
- GETPROCADDR(glCreateProgramObjectARB, PFNGLCREATEPROGRAMOBJECTARBPROC);
- GETPROCADDR(glAttachObjectARB, PFNGLATTACHOBJECTARBPROC);
- GETPROCADDR(glLinkProgramARB, PFNGLLINKPROGRAMARBPROC);
- GETPROCADDR(glUseProgramObjectARB, PFNGLUSEPROGRAMOBJECTARBPROC);
- GETPROCADDR(glGetObjectParameterivARB, PFNGLGETOBJECTPARAMETERIVARBPROC);
- GETPROCADDR(glGetInfoLogARB, PFNGLGETINFOLOGARBPROC);
- GETPROCADDR(glGetUniformLocationARB, PFNGLGETUNIFORMLOCATIONARBPROC);
-
- GETPROCADDR(glVertexAttrib4fvARB, PFNGLVERTEXATTRIB4FVARBPROC);
- GETPROCADDR(glVertexAttribPointerARB, PFNGLVERTEXATTRIBPOINTERARBPROC);
- GETPROCADDR(glEnableVertexAttribArrayARB, PFNGLENABLEVERTEXATTRIBARRAYARBPROC);
- GETPROCADDR(glDisableVertexAttribArrayARB, PFNGLDISABLEVERTEXATTRIBARRAYARBPROC);
- GETPROCADDR(glBindAttribLocationARB, PFNGLBINDATTRIBLOCATIONARBPROC);
- GETPROCADDR(glGetAttribLocationARB, PFNGLGETATTRIBLOCATIONARBPROC);
-
- GETPROCADDR(glFogCoordfvEXT, PFNGLFOGCOORDFVEXTPROC);
- GETPROCADDR(glFogCoordPointerEXT, PFNGLFOGCOORDPOINTEREXTPROC);
-
- GETPROCADDR(glSecondaryColor3fvEXT, PFNGLSECONDARYCOLOR3FVEXTPROC);
- GETPROCADDR(glSecondaryColorPointerEXT, PFNGLSECONDARYCOLORPOINTEREXTPROC);
-
- printf ("VENDOR: %s\n", glGetString (GL_VENDOR));
- printf ("RENDERER: %s\n", glGetString (GL_RENDERER));
-
- InitScene ();
-
- glutDisplayFunc (Display);
- glutIdleFunc (Idle);
- glutMainLoop ();
-}
-
-GLboolean CheckObjectStatus (GLhandleARB handle)
-{
- GLint type, status, length;
- GLcharARB *infolog;
-
- glGetObjectParameterivARB (handle, GL_OBJECT_TYPE_ARB, &type);
- if (type == GL_SHADER_OBJECT_ARB)
- glGetObjectParameterivARB (handle, GL_OBJECT_COMPILE_STATUS_ARB, &status);
- else if (type == GL_PROGRAM_OBJECT_ARB)
- glGetObjectParameterivARB (handle, GL_OBJECT_LINK_STATUS_ARB, &status);
- else {
- assert (0);
- return GL_FALSE;
- }
-
- if (status)
- return GL_TRUE;
-
- printf ("\n%s FAILED. INFO LOG FOLLOWS:\n",
- type == GL_SHADER_OBJECT_ARB ? "SHADER COMPILE" : "PROGRAM LINK");
-
- glGetObjectParameterivARB (handle, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
- infolog = (GLcharARB *) (malloc (length));
- if (infolog != NULL) {
- glGetInfoLogARB (handle, length, NULL, infolog);
- printf ("%s", infolog);
- free (infolog);
- }
-
- printf ("\n");
-
- return GL_FALSE;
-}
-
diff --git a/progs/slang/framework.h b/progs/slang/framework.h
deleted file mode 100644
index e023f7da8a6..00000000000
--- a/progs/slang/framework.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef _FRAMEWORK_H_
-#define _FRAMEWORK_H_
-
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <math.h>
-#include <GL/gl.h>
-#include <GL/glut.h>
-#include <GL/glext.h>
-
-#ifdef WIN32
-#define GETPROCADDRESS(x) wglGetProcAddress (x)
-#else
-#define GETPROCADDRESS(x) glutGetProcAddress (x)
-#endif
-
-#define GETPROCADDR(x,T) do { x = (T) (GETPROCADDRESS(#x)); assert (x != NULL); } while (0)
-
-/*
- * GL_ARB_multitexture
- */
-#ifndef GL_ARB_multitexture
-extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
-extern PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
-#endif
-
-/*
- * GL_ARB_shader_objects
- */
-extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
-extern PFNGLGETHANDLEARBPROC glGetHandleARB;
-extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
-extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
-extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
-extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
-extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
-extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
-extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
-extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
-extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
-extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
-extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
-/*static PFNGLUNIFORM4FVARBPROC glUniform4fvARB = NULL;*/
-
-/*
- * GL_ARB_vertex_shader
- */
-extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
-extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
-extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
-extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
-extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
-extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
-
-/*
- * GL_EXT_fog_coord
- */
-extern PFNGLFOGCOORDFVEXTPROC glFogCoordfvEXT;
-extern PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointerEXT;
-
-/*
- * GL_EXT_secondary_color
- */
-extern PFNGLSECONDARYCOLOR3FVEXTPROC glSecondaryColor3fvEXT;
-extern PFNGLSECONDARYCOLORPOINTEREXTPROC glSecondaryColorPointerEXT;
-
-extern void InitFramework (int *argc, char *argv[]);
-
-extern void InitScene (void);
-extern void RenderScene (void);
-
-extern GLboolean CheckObjectStatus (GLhandleARB);
-
-#endif
-
diff --git a/progs/slang/sotest.c b/progs/slang/sotest.c
deleted file mode 100644
index 4bd3bc23c92..00000000000
--- a/progs/slang/sotest.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * GL_ARB_shader_objects & GL_ARB_vertex_shader interface test application.
- * Neither compiler nor executor is being tested here, although some simple shader
- * compilation tests are performed.
- *
- * Perfectly valid behaviour produces output that does not have a line
- * beginning with three stars (***).
- *
- * Author: Michal Krol
- */
-
-#include "framework.h"
-
-enum TEST_TYPE
-{
- TT_GETERROR_NOERROR,
- TT_GETERROR_INVALIDVALUE,
- TT_GETERROR_INVALIDOPERATION,
- TT_PARAM1_ZERO,
- TT_PARAM1_NONZERO
-};
-
-static enum TEST_TYPE current_test;
-
-static void begintest (enum TEST_TYPE type, const char *name)
-{
- current_test = type;
- printf ("\n BEGIN TEST: %s\n", name);
- while (glGetError () != GL_NO_ERROR)
- ;
-}
-
-static void endtest1 (GLuint param1)
-{
- const char *msg = NULL;
-
- switch (current_test)
- {
- case TT_GETERROR_NOERROR:
- if (glGetError () != GL_NO_ERROR)
- msg = "glGetError () does not return GL_NO_ERROR";
- break;
- case TT_GETERROR_INVALIDVALUE:
- if (glGetError () != GL_INVALID_VALUE)
- msg = "glGetError () does not return GL_INVALID_VALUE";
- break;
- case TT_GETERROR_INVALIDOPERATION:
- if (glGetError () != GL_INVALID_OPERATION)
- msg = "glGetError () does not return GL_INVALID_OPERATION";
- break;
- case TT_PARAM1_ZERO:
- if (param1)
- msg = "The parameter is not zero";
- break;
- case TT_PARAM1_NONZERO:
- if (!param1)
- msg = "The parameter is not non-zero";
- break;
- default:
- assert (0);
- }
-
- if (msg == NULL)
- printf (" OK\n");
- else
- printf ("*** %s\n", msg);
-
- while (glGetError () != GL_NO_ERROR)
- ;
-}
-
-static void endtest ()
-{
- endtest1 (0);
-}
-
-static GLhandleARB vert = 0;
-static GLhandleARB frag = 0;
-static GLhandleARB prog = 0;
-
-static GLhandleARB find_invalid_handle ()
-{
- GLhandleARB handle;
-
- for (handle = 1; handle < 16; handle++)
- if (handle != vert && handle != frag && handle != prog)
- return handle;
- assert (0);
- return 0;
-}
-
-static const char *invsynvertsrc =
- "void main () {\n"
- " gl_Position = gl_ModelViewMatrix ! gl_Vertex;\n" /* unexpected token */
- "}\n"
-;
-
-static const char *invsemvertsrc =
- "void main () {\n"
- " gl_Position = gl_ModelviewMatrix * gl_Vertex;\n" /* undeclared identifier */
- "}\n"
-;
-
-static const char *uniforms =
- "uniform vec4 CommonUniform;\n"
-;
-
-static const char *validvertsrc =
- "uniform vec4 VertexUniform;\n"
- "attribute vec4 FirstAttrib;\n"
- "attribute vec4 SecondAttrib;\n"
- "void main () {\n"
- " gl_Position = gl_ModelViewMatrix * gl_Vertex + CommonUniform + VertexUniform\n"
- " + FirstAttrib + SecondAttrib;\n"
- "}\n"
-;
-
-static const char *invsynfragsrc =
- "void main () {\n"
- " gl_FragColor = gl_Color\n" /* missing ; */
- "}\n"
-;
-
-static const char *invsemfragsrc =
- "void main () {\n"
- " gl_FragColor = gl_FrontColor;\n" /* gl_FrontColor only in vertex shader */
- "}\n"
-;
-
-static const char *validfragsrc =
- "uniform vec4 FragmentUniform;\n"
- "void main () {\n"
- " gl_FragColor = gl_Color + CommonUniform + FragmentUniform;\n"
- "}\n"
-;
-
-void InitScene (void)
-{
- GLint params[1];
- const char *tab[2];
-
- /*
- * GL should silently ignore calls that delete object 0.
- */
- begintest (TT_GETERROR_NOERROR, "glDeleteObject(0)");
- glDeleteObjectARB (0);
- endtest ();
-
- /*
- * GL generates an error on invalid object handle.
- */
- begintest (TT_GETERROR_INVALIDVALUE, "Pass invalid non-zero object handle");
- glDeleteObjectARB (find_invalid_handle ());
- endtest ();
- glUseProgramObjectARB (find_invalid_handle ());
- endtest ();
-
- /*
- * Create object. GL should return unique non-zero values.
- */
- begintest (TT_PARAM1_NONZERO, "Create object");
- vert = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
- endtest1 (vert);
- frag = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
- endtest1 (frag);
- prog = glCreateProgramObjectARB ();
- endtest1 (prog);
- endtest1 (vert != frag && frag != prog && prog != vert);
-
- /*
- * Link empty program.
- */
- begintest (TT_PARAM1_NONZERO, "Link empty program");
- glLinkProgramARB (prog);
- endtest1 (CheckObjectStatus (prog));
-
- /*
- * Use empty program object. Empty program objects are valid.
- */
- begintest (TT_GETERROR_NOERROR, "Use empty program object");
- glUseProgramObjectARB (prog);
- endtest ();
-
- /*
- * Attach invalid object handles. Program object 0 should not be accepted.
- */
- begintest (TT_GETERROR_INVALIDVALUE, "Attach invalid object handle");
- glAttachObjectARB (0, find_invalid_handle ());
- endtest ();
- glAttachObjectARB (0, frag);
- endtest ();
- glAttachObjectARB (find_invalid_handle (), find_invalid_handle ());
- endtest ();
- glAttachObjectARB (find_invalid_handle (), frag);
- endtest ();
- glAttachObjectARB (prog, find_invalid_handle ());
- endtest ();
-
- /*
- * Attach valid object handles with wrong semantics.
- */
- begintest (TT_GETERROR_INVALIDOPERATION, "Attach object badly");
- glAttachObjectARB (vert, frag);
- endtest ();
- glAttachObjectARB (vert, prog);
- endtest ();
- glAttachObjectARB (prog, prog);
- endtest ();
-
- /*
- * Detach non-attached object.
- */
- begintest (TT_GETERROR_INVALIDOPERATION, "Detach non-attached object");
- glDetachObjectARB (prog, vert);
- endtest ();
- glDetachObjectARB (prog, frag);
- endtest ();
-
- /*
- * Attach shader.
- */
- begintest (TT_GETERROR_NOERROR, "Attach shader to program object");
- glAttachObjectARB (prog, vert);
- endtest ();
- glAttachObjectARB (prog, frag);
- endtest ();
-
- /*
- * Attach object twice.
- */
- begintest (TT_GETERROR_INVALIDOPERATION, "Attach object twice");
- glAttachObjectARB (prog, vert);
- endtest ();
- glAttachObjectARB (prog, frag);
- endtest ();
-
- /*
- * Detach attached object.
- */
- begintest (TT_GETERROR_NOERROR, "Detach attached object");
- glDetachObjectARB (prog, vert);
- endtest ();
- glDetachObjectARB (prog, frag);
- endtest ();
-
- /*
- * Attach shader again.
- */
- begintest (TT_GETERROR_NOERROR, "Attach shader again");
- glAttachObjectARB (prog, vert);
- endtest ();
- glAttachObjectARB (prog, frag);
- endtest ();
-
- /*
- * Delete attached object.
- */
- begintest (TT_GETERROR_NOERROR, "Delete attached object");
- glDeleteObjectARB (vert);
- endtest ();
- glDeleteObjectARB (frag);
- endtest ();
-
- /*
- * Query delete status. It should return TRUE. Object handles are still valid
- * as they are referenced by program object container.
- */
- begintest (TT_PARAM1_NONZERO, "Query delete status");
- glGetObjectParameterivARB (vert, GL_OBJECT_DELETE_STATUS_ARB, params);
- endtest1 (params[0]);
- glGetObjectParameterivARB (frag, GL_OBJECT_DELETE_STATUS_ARB, params);
- endtest1 (params[0]);
-
- /*
- * Delete already deleted attached object. The behaviour is undefined, but we
- * check for no errors. The object still exists, so the handle value is okay.
- * In other words, these calls should be silently ignored by GL.
- */
- begintest (TT_GETERROR_NOERROR, "Delete already deleted attached object");
- glDeleteObjectARB (vert);
- endtest ();
- glDeleteObjectARB (frag);
- endtest ();
-
- /*
- * Compile shader source with syntax error.
- */
- begintest (TT_PARAM1_ZERO, "Compile shader source with syntax error");
- glShaderSourceARB (vert, 1, &invsynvertsrc, NULL);
- glCompileShaderARB (vert);
- endtest1 (CheckObjectStatus (vert));
- glShaderSourceARB (frag, 1, &invsynfragsrc, NULL);
- glCompileShaderARB (frag);
- endtest1 (CheckObjectStatus (frag));
-
- /*
- * Compile shader source with semantic error.
- */
- begintest (TT_PARAM1_ZERO, "Compile shader source with semantic error");
- glShaderSourceARB (vert, 1, &invsemvertsrc, NULL);
- glCompileShaderARB (vert);
- endtest1 (CheckObjectStatus (vert));
- glShaderSourceARB (frag, 1, &invsemfragsrc, NULL);
- glCompileShaderARB (frag);
- endtest1 (CheckObjectStatus (frag));
-
- /*
- * Link ill-formed vertex-fragment program.
- */
- begintest (TT_PARAM1_ZERO, "Link ill-formed vertex-fragment program");
- glLinkProgramARB (prog);
- endtest1 (CheckObjectStatus (prog));
-
- /*
- * Use badly linked program object.
- */
- begintest (TT_GETERROR_INVALIDOPERATION, "Use badly linked program object");
- glUseProgramObjectARB (prog);
- endtest ();
-
- /*
- * Compile well-formed shader source. Check if multi-string sources can be handled.
- */
- begintest (TT_PARAM1_NONZERO, "Compile well-formed shader source");
- tab[0] = uniforms;
- tab[1] = validvertsrc;
- glShaderSourceARB (vert, 2, tab, NULL);
- glCompileShaderARB (vert);
- endtest1 (CheckObjectStatus (vert));
- tab[0] = uniforms;
- tab[1] = validfragsrc;
- glShaderSourceARB (frag, 2, tab, NULL);
- glCompileShaderARB (frag);
- endtest1 (CheckObjectStatus (frag));
-
- /*
- * Link vertex-fragment program.
- */
- begintest (TT_PARAM1_NONZERO, "Link vertex-fragment program");
- glLinkProgramARB (prog);
- endtest1 (CheckObjectStatus (prog));
-
- /*
- * Use valid linked program object.
- */
- begintest (TT_GETERROR_NOERROR, "Use linked program object");
- glUseProgramObjectARB (prog);
- endtest ();
-
- /*
- * Get current program.
- */
- begintest (TT_PARAM1_NONZERO, "Get current program");
- endtest1 (glGetHandleARB (GL_PROGRAM_OBJECT_ARB) == prog);
-
- /*
- * Use 0 program object.
- */
- begintest (TT_GETERROR_NOERROR, "Use 0 program object");
- glUseProgramObjectARB (0);
- endtest ();
-
- /*
- * Query uniform location. Uniforms with gl_ prefix cannot be queried.
- */
- begintest (TT_PARAM1_NONZERO, "Query uniform location");
- endtest1 (glGetUniformLocationARB (prog, "gl_ModelViewMatrix") == -1);
- endtest1 (glGetUniformLocationARB (prog, "UniformThatDoesNotExist") == -1);
- endtest1 (glGetUniformLocationARB (prog, "") == -1);
- endtest1 (glGetUniformLocationARB (prog, "CommonUniform") != -1);
- endtest1 (glGetUniformLocationARB (prog, "VertexUniform") != -1);
- endtest1 (glGetUniformLocationARB (prog, "FragmentUniform") != -1);
-
- /*
- * Query attrib location. Attribs with gl_ prefix cannot be queried.
- * When gl_Vertex is used, none of the generic attribs can have index 0.
- */
- begintest (TT_PARAM1_NONZERO, "Query attrib location");
- endtest1 (glGetAttribLocationARB (prog, "gl_Vertex") == -1);
- endtest1 (glGetAttribLocationARB (prog, "AttribThatDoesNotExist") == -1);
- endtest1 (glGetAttribLocationARB (prog, "") == -1);
- endtest1 (glGetAttribLocationARB (prog, "FirstAttrib") > 0);
- endtest1 (glGetAttribLocationARB (prog, "SecondAttrib") > 0);
-
- /*
- * Bind attrib locations, link and check if locations are correct.
- */
- begintest (TT_PARAM1_NONZERO, "Bind attrib location #1");
- glBindAttribLocationARB (prog, 1, "FirstAttrib");
- glBindAttribLocationARB (prog, 2, "SecondAttrib");
- glLinkProgramARB (prog);
- endtest1 (CheckObjectStatus (prog));
- endtest1 (glGetAttribLocationARB (prog, "FirstAttrib") == 1);
- endtest1 (glGetAttribLocationARB (prog, "SecondAttrib") == 2);
-
- /*
- * Bind attrib locations in different order. Link and check if locations are correct.
- */
- begintest (TT_PARAM1_NONZERO, "Bind attrib location #2");
- glBindAttribLocationARB (prog, 1, "SecondAttrib");
- glBindAttribLocationARB (prog, 2, "FirstAttrib");
- glLinkProgramARB (prog);
- endtest1 (CheckObjectStatus (prog));
- endtest1 (glGetAttribLocationARB (prog, "SecondAttrib") == 1);
- endtest1 (glGetAttribLocationARB (prog, "FirstAttrib") == 2);
-
- /*
- * Detach deleted object.
- */
- begintest (TT_GETERROR_NOERROR, "Detach deleted object");
- glDetachObjectARB (prog, vert);
- endtest ();
- glDetachObjectARB (prog, frag);
- endtest ();
-
- /*
- * Delete deleted detached object.
- */
- begintest (TT_GETERROR_INVALIDVALUE, "Delete deleted detached object");
- glDeleteObjectARB (vert);
- endtest ();
- glDeleteObjectARB (frag);
- endtest ();
-
- exit (0);
-}
-
-void RenderScene (void)
-{
- /* never reached */
- assert (0);
-}
-
-int main (int argc, char *argv[])
-{
- InitFramework (&argc, argv);
- return 0;
-}
-
diff --git a/progs/slang/vstest.c b/progs/slang/vstest.c
deleted file mode 100644
index 5108d157428..00000000000
--- a/progs/slang/vstest.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * GL_ARB_vertex_shader test application. Feeds a vertex shader with attributes that
- * that have magic values and check if the values received by the shader are the same.
- *
- * Requires specific support on the GL implementation side. A special function printMESA()
- * must be supported in the language that prints variable's current value of generic type
- * to the appropriate shader's info log, and optionally to the screen.
- *
- * Perfectly valid behaviour produces output that does not have a line
- * beginning with three stars (***).
- *
- * Author: Michal Krol
- */
-
-#include "framework.h"
-
-#define EPSILON 0.0001f
-
-static GLhandleARB vert = 0;
-static GLhandleARB prog = 0;
-
-enum SUBMIT_MODE
-{
- SM_IM,
- SM_VA,
- SM_IM_DL,
- SM_VA_DL,
- SM_MAX
-};
-
-static enum SUBMIT_MODE submit_method = SM_IM;
-
-#define C 0
-#define S 1
-#define N 2
-#define V 3
-#define T 4
-#define F 5
-#define A 6
-
-struct ATTRIB_DATA
-{
- const char *name;
- GLuint dispatch;
- GLint index;
- GLint bind;
- GLuint size;
- GLfloat data[4];
-};
-
-static struct ATTRIB_DATA attribs[] = {
- { "gl_Color", C, -1, -1, 4, { 4.2f, 0.56f, -2.1f, 0.29f } },
- { "gl_SecondaryColor", S, -1, -1, 4, { 0.38f, 2.0f, 0.99f, 1.0f } },
- { "gl_Normal", N, -1, -1, 3, { 54.0f, 77.0f, 1.15f, 0.0f } },
- { "gl_MultiTexCoord0", T, 0, -1, 4, { 11.1f, 11.2f, 11.3f, 11.4f } },
- { "gl_MultiTexCoord1", T, 1, -1, 4, { 22.1f, 22.2f, 22.3f, 22.4f } },
- { "gl_MultiTexCoord2", T, 2, -1, 4, { 33.1f, 33.2f, 33.3f, 33.4f } },
- { "gl_MultiTexCoord3", T, 3, -1, 4, { 44.1f, 44.2f, 44.3f, 44.4f } },
- { "gl_MultiTexCoord4", T, 4, -1, 4, { 55.1f, 55.2f, 55.3f, 55.4f } },
- { "gl_MultiTexCoord5", T, 5, -1, 4, { 66.1f, 66.2f, 66.3f, 66.4f } },
- { "gl_MultiTexCoord6", T, 6, -1, 4, { 77.1f, 77.2f, 77.3f, 77.4f } },
- { "gl_MultiTexCoord7", T, 7, -1, 4, { 88.1f, 88.2f, 88.3f, 88.4f } },
- { "gl_FogCoord", F, -1, -1, 1, { 0.63f, 0.0f, 0.0f, 0.0f } },
- { "Attribute1", A, 1, 1, 4, { 1.11f, 1.22f, 1.33f, 1.44f } },
- { "Attribute2", A, 2, 2, 4, { 2.11f, 2.22f, 2.33f, 2.44f } },
- { "Attribute3", A, 3, 3, 4, { 3.11f, 3.22f, 3.33f, 3.44f } },
- { "Attribute4", A, 4, 4, 1, { 4.11f, 0.0f, 0.0f, 0.0f } },
- { "Attribute5", A, 5, 5, 2, { 5.11f, 5.22f, 0.0f, 0.0f } },
- { "Attribute6", A, 6, 6, 3, { 6.11f, 6.22f, 6.33f, 0.0f } },
- { "Attribute7", A, 7, 7, 2, { 7.11f, 7.22f, 0.0f, 0.0f } },
- { "Attribute7", A, 8, -1, 2, { 8.11f, 8.22f, 0.0f, 0.0f } },
- { "Attribute9", A, 9, 9, 3, { 9.11f, 9.22f, 9.33f, 0.0f } },
- { "Attribute9", A, 10, -1, 3, { 10.11f, 10.22f, 10.33f, 0.0f } },
- { "Attribute9", A, 11, -1, 3, { 11.11f, 11.22f, 11.33f, 0.0f } },
- { "Attribute12", A, 12, 12, 4, { 12.11f, 12.22f, 12.33f, 12.44f } },
- { "Attribute12", A, 13, -1, 4, { 13.11f, 13.22f, 13.33f, 13.44f } },
- { "Attribute12", A, 14, -1, 4, { 14.11f, 14.22f, 14.33f, 14.44f } },
- { "Attribute12", A, 15, -1, 4, { 15.11f, 15.22f, 15.33f, 15.44f } },
- { "gl_Vertex", V, 16, -1, 4, { 0.25f, -0.14f, 0.01f, 1.0f } }
-};
-
-static void im_render ()
-{
- GLint i;
-
- glBegin (GL_POINTS);
- for (i = 0; i < sizeof (attribs) / sizeof (*attribs); i++) {
- struct ATTRIB_DATA *att = &attribs[i];
- switch (att->dispatch)
- {
- case C:
- glColor4fv (att->data);
- break;
- case S:
- glSecondaryColor3fvEXT (att->data);
- break;
- case N:
- glNormal3fv (att->data);
- break;
- case V:
- glVertex4fv (att->data);
- break;
- case T:
- assert (att->index >= 0 && att->index < 8);
- glMultiTexCoord4fvARB (GL_TEXTURE0_ARB + att->index, att->data);
- break;
- case F:
- glFogCoordfvEXT (att->data);
- break;
- case A:
- assert (att->index > 0 && att->index < 16);
- glVertexAttrib4fvARB (att->index, att->data);
- break;
- default:
- assert (0);
- }
- }
- glEnd ();
-}
-
-static void va_render ()
-{
- GLint i;
-
- for (i = 0; i < sizeof (attribs) / sizeof (*attribs); i++) {
- struct ATTRIB_DATA *att = &attribs[i];
- switch (att->dispatch)
- {
- case C:
- glColorPointer (4, GL_FLOAT, 0, att->data);
- glEnable (GL_COLOR_ARRAY);
- break;
- case S:
- glSecondaryColorPointerEXT (4, GL_FLOAT, 0, att->data);
- glEnable (GL_SECONDARY_COLOR_ARRAY_EXT);
- break;
- case N:
- glNormalPointer (GL_FLOAT, 0, att->data);
- glEnable (GL_NORMAL_ARRAY);
- break;
- case V:
- glVertexPointer (4, GL_FLOAT, 0, att->data);
- glEnable (GL_VERTEX_ARRAY);
- break;
- case T:
- assert (att->index >= 0 && att->index < 8);
- glClientActiveTextureARB (GL_TEXTURE0_ARB + att->index);
- glTexCoordPointer (4, GL_FLOAT, 0, att->data);
- glEnable (GL_TEXTURE_COORD_ARRAY);
- break;
- case F:
- glFogCoordPointerEXT (GL_FLOAT, 0, att->data);
- glEnable (GL_FOG_COORDINATE_ARRAY_EXT);
- break;
- case A:
- assert (att->index > 0 && att->index < 16);
- glVertexAttribPointerARB (att->index, 4, GL_FLOAT, GL_FALSE, 0, att->data);
- glEnableVertexAttribArrayARB (att->index);
- break;
- default:
- assert (0);
- }
- }
-
- glDrawArrays (GL_POINTS, 0, 1);
-
- for (i = 0; i < sizeof (attribs) / sizeof (*attribs); i++) {
- struct ATTRIB_DATA *att = &attribs[i];
- switch (att->dispatch)
- {
- case C:
- glDisable (GL_COLOR_ARRAY);
- break;
- case S:
- glDisable (GL_SECONDARY_COLOR_ARRAY_EXT);
- break;
- case N:
- glDisable (GL_NORMAL_ARRAY);
- break;
- case V:
- glDisable (GL_VERTEX_ARRAY);
- break;
- case T:
- glClientActiveTextureARB (GL_TEXTURE0_ARB + att->index);
- glDisable (GL_TEXTURE_COORD_ARRAY);
- break;
- case F:
- glDisable (GL_FOG_COORDINATE_ARRAY_EXT);
- break;
- case A:
- glDisableVertexAttribArrayARB (att->index);
- break;
- default:
- assert (0);
- }
- }
-}
-
-static void dl_start ()
-{
- glNewList (GL_COMPILE, 1);
-}
-
-static void dl_end ()
-{
- glEndList ();
- glCallList (1);
-}
-
-static void load_test_file (const char *filename)
-{
- FILE *f;
- GLint size;
- char *code;
- GLint i;
-
- f = fopen (filename, "r");
- if (f == NULL)
- return;
-
- fseek (f, 0, SEEK_END);
- size = ftell (f);
- fseek (f, 0, SEEK_SET);
-
- code = (char *) (malloc (size));
- if (code == NULL) {
- fclose (f);
- return;
- }
- size = fread (code, 1, size, f);
- fclose (f);
-
- glShaderSourceARB (vert, 1, (const GLcharARB **) (&code), &size);
- glCompileShaderARB (vert);
- if (!CheckObjectStatus (vert))
- exit (0);
-
- for (i = 0; i < sizeof (attribs) / sizeof (*attribs); i++)
- if (attribs[i].dispatch == A && attribs[i].bind != -1)
- glBindAttribLocationARB (prog, attribs[i].bind, attribs[i].name);
-}
-
-void InitScene (void)
-{
- prog = glCreateProgramObjectARB ();
- vert = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
- glAttachObjectARB (prog, vert);
- glDeleteObjectARB (vert);
- load_test_file ("vstest.txt");
- glLinkProgramARB (prog);
- if (!CheckObjectStatus (prog))
- exit (0);
- glUseProgramObjectARB (prog);
-}
-
-void RenderScene (void)
-{
- GLint info_length, length;
- char output[65000], *p;
- GLint i;
-
- if (submit_method == SM_MAX)
- exit (0);
-
- /*
- * Get the current size of the info log. Any text output produced by executed
- * shader will be appended to the end of log.
- */
- glGetObjectParameterivARB (vert, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_length);
-
- switch (submit_method)
- {
- case SM_IM:
- printf ("\n--- TESTING IMMEDIATE MODE\n");
- im_render ();
- break;
- case SM_VA:
- printf ("\n--- TESTING VERTEX ARRAY MODE\n");
- va_render ();
- break;
- case SM_IM_DL:
- printf ("\n--- TESTING IMMEDIATE + DISPLAY LIST MODE\n");
- dl_start ();
- im_render ();
- dl_end ();
- break;
- case SM_VA_DL:
- printf ("\n--- TESTING VERTEX ARRAY + DISPLAY LIST MODE\n");
- dl_start ();
- va_render ();
- dl_end ();
- break;
- default:
- assert (0);
- }
-
- glFlush ();
-
- /*
- * Get the info log and set the pointer to the beginning of the output.
- */
- glGetInfoLogARB (vert, sizeof (output), &length, output);
- p = output + info_length - 1;
-
- for (i = 0; i < sizeof (attribs) / sizeof (*attribs); i++) {
- GLuint j;
- for (j = 0; j < attribs[i].size; j++) {
- GLfloat value;
- if (p == NULL) {
- printf ("*** %s\n", "I/O error");
- break;
- }
- if (strncmp (p, "true", 4) == 0)
- value = 1.0f;
- else if (strncmp (p, "false", 5) == 0)
- value = 0.0f;
- else if (sscanf (p, "%f", &value) != 1) {
- printf ("*** %s\n", "I/O error");
- p = NULL;
- break;
- }
- if (fabs (value - attribs[i].data[j]) > EPSILON)
- printf ("*** %s, is %f, should be %f\n", "Values are different", value, attribs[i].data[j]);
- p = strchr (p, '\n');
- if (p != NULL)
- p++;
- }
- if (p == NULL)
- break;
- }
-
- submit_method++;
-}
-
-int main (int argc, char *argv[])
-{
- InitFramework (&argc, argv);
- return 0;
-}
-
diff --git a/progs/slang/vstest.txt b/progs/slang/vstest.txt
deleted file mode 100644
index b049f4206f5..00000000000
--- a/progs/slang/vstest.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Vertex shader test.
- * Uses all conventional attributes and 15 generic attributes to print
- * their values, using printMESA() extension function, to the debugger
- * to compare them with the actual passed-in values.
- * Use different types for generic attributes to check matrix handling.
- *
- * Author: Michal Krol
- */
-
-#version 110
-
-//#extension MESA_shader_debug: require
-
-attribute vec4 Attribute1;
-attribute vec4 Attribute2;
-attribute vec4 Attribute3;
-attribute float Attribute4;
-attribute vec2 Attribute5;
-attribute vec3 Attribute6;
-attribute mat2 Attribute7;
-attribute mat3 Attribute9;
-attribute mat4 Attribute12;
-
-void main ()
-{
- //
- // Do some legal stuff.
- //
- gl_Position = gl_ModelViewMatrix * gl_Vertex;
- gl_FrontColor = vec4 (1.0);
-
- //
- // Conventional attributes - except for gl_Vertex.
- //
- printMESA (gl_Color);
- printMESA (gl_SecondaryColor);
- printMESA (gl_Normal);
- printMESA (gl_MultiTexCoord0);
- printMESA (gl_MultiTexCoord1);
- printMESA (gl_MultiTexCoord2);
- printMESA (gl_MultiTexCoord3);
- printMESA (gl_MultiTexCoord4);
- printMESA (gl_MultiTexCoord5);
- printMESA (gl_MultiTexCoord6);
- printMESA (gl_MultiTexCoord7);
- printMESA (gl_FogCoord);
-
- //
- // Generic attributes - attrib with index 0 is not used because it would
- // alias with gl_Vertex, which is not allowed.
- //
- printMESA (Attribute1);
- printMESA (Attribute2);
- printMESA (Attribute3);
- printMESA (Attribute4);
- printMESA (Attribute5);
- printMESA (Attribute6);
- printMESA (Attribute7);
- printMESA (Attribute9);
- printMESA (Attribute12);
-
- //
- // Vertex position goes last.
- //
- printMESA (gl_Vertex);
-}
-
diff --git a/progs/slang/windows/vc60/cltest.dsp b/progs/slang/windows/vc60/cltest.dsp
deleted file mode 100644
index 4c0c2e26b46..00000000000
--- a/progs/slang/windows/vc60/cltest.dsp
+++ /dev/null
@@ -1,94 +0,0 @@
-# Microsoft Developer Studio Project File - Name="cltest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=cltest - 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 "cltest.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 "cltest.mak" CFG="cltest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cltest - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "cltest - 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)" == "cltest - 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 "cltest_release"
-# PROP Intermediate_Dir "cltest_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 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /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 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
-
-!ELSEIF "$(CFG)" == "cltest - 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 "cltest_debug"
-# PROP Intermediate_Dir "cltest_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 /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /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 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
-
-!ENDIF
-
-# Begin Target
-
-# Name "cltest - Win32 Release"
-# Name "cltest - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\cltest.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\cltest.txt
-# End Source File
-# End Target
-# End Project
diff --git a/progs/slang/windows/vc60/framework.dsp b/progs/slang/windows/vc60/framework.dsp
deleted file mode 100644
index 76ed7d388c1..00000000000
--- a/progs/slang/windows/vc60/framework.dsp
+++ /dev/null
@@ -1,92 +0,0 @@
-# Microsoft Developer Studio Project File - Name="framework" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=framework - 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 "framework.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 "framework.mak" CFG="framework - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "framework - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "framework - 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)" == "framework - 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 "framework_release"
-# PROP Intermediate_Dir "framework_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 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /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)" == "framework - 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 "framework_debug"
-# PROP Intermediate_Dir "framework_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 /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /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 "framework - Win32 Release"
-# Name "framework - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\framework.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\framework.h
-# End Source File
-# End Target
-# End Project
diff --git a/progs/slang/windows/vc60/slang.dsw b/progs/slang/windows/vc60/slang.dsw
deleted file mode 100644
index 60536c1b0d9..00000000000
--- a/progs/slang/windows/vc60/slang.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: "cltest"=".\cltest.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name framework
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "framework"=".\framework.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "sotest"=".\sotest.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name framework
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "vstest"=".\vstest.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name framework
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/progs/slang/windows/vc60/sotest.dsp b/progs/slang/windows/vc60/sotest.dsp
deleted file mode 100644
index 105924943b7..00000000000
--- a/progs/slang/windows/vc60/sotest.dsp
+++ /dev/null
@@ -1,90 +0,0 @@
-# Microsoft Developer Studio Project File - Name="sotest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=sotest - 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 "sotest.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 "sotest.mak" CFG="sotest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "sotest - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "sotest - 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)" == "sotest - 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 "sotest_release"
-# PROP Intermediate_Dir "sotest_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 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /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 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
-
-!ELSEIF "$(CFG)" == "sotest - 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 "sotest_debug"
-# PROP Intermediate_Dir "sotest_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 /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /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 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
-
-!ENDIF
-
-# Begin Target
-
-# Name "sotest - Win32 Release"
-# Name "sotest - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\sotest.c
-# End Source File
-# End Target
-# End Project
diff --git a/progs/slang/windows/vc60/vstest.dsp b/progs/slang/windows/vc60/vstest.dsp
deleted file mode 100644
index a3a2c707f0c..00000000000
--- a/progs/slang/windows/vc60/vstest.dsp
+++ /dev/null
@@ -1,93 +0,0 @@
-# Microsoft Developer Studio Project File - Name="vstest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=vstest - 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 "vstest.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 "vstest.mak" CFG="vstest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "vstest - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "vstest - 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)" == "vstest - 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 "vstest_release"
-# PROP Intermediate_Dir "vstest_release"
-# 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 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /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 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
-
-!ELSEIF "$(CFG)" == "vstest - 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 "vstest_debug"
-# PROP Intermediate_Dir "vstest_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 /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /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 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
-
-!ENDIF
-
-# Begin Target
-
-# Name "vstest - Win32 Release"
-# Name "vstest - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\vstest.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\vstest.txt
-# End Source File
-# End Target
-# End Project
diff --git a/progs/tests/.cvsignore b/progs/tests/.cvsignore
deleted file mode 100644
index 2c0e16c35ec..00000000000
--- a/progs/tests/.cvsignore
+++ /dev/null
@@ -1,54 +0,0 @@
-.cvsignore
-getproclist.h
-antialias
-arbfpspec
-arbfptest1
-arbfptexture
-arbfptrig
-arbvptest1
-arbvptest3
-arbvptorus
-arbvpwarpmesh
-blendminmax
-blendsquare
-bufferobj
-bug_3101
-bug_3195
-crossbar
-cva
-dinoshade
-fbotest1
-fbotexture
-floattex
-fog
-fogcoord
-fptest1
-fptexture
-getprocaddress
-invert
-manytex
-multipal
-no_s3tc
-packedpixels
-pbo
-projtex
-seccolor
-sharedtex
-stencil_wrap
-stencilwrap
-tex1d
-texcmp
-texgenmix
-texline
-texobjshare
-texrect
-texwrap
-vparray
-vptest1
-vptest2
-vptest3
-vptorus
-vpwarpmesh
-yuvrect
-yuvsquare
-zreaddraw
diff --git a/progs/tests/Makefile b/progs/tests/Makefile
deleted file mode 100644
index 3a22285250c..00000000000
--- a/progs/tests/Makefile
+++ /dev/null
@@ -1,158 +0,0 @@
-# progs/tests/Makefile
-
-
-# These programs aren't intended to be included with the normal distro.
-# They're not too interesting but they're good for testing.
-
-TOP = ../..
-include $(TOP)/configs/current
-
-
-LIBS = $(APP_LIB_DEPS)
-
-SOURCES = \
- afsmultiarb.c \
- antialias.c \
- arbfpspec.c \
- arbfptest1.c \
- arbfptexture.c \
- arbfptrig.c \
- arbnpot.c \
- arbnpot-mipmap.c \
- arbvptest1.c \
- arbvptest3.c \
- arbvptorus.c \
- arbvpwarpmesh.c \
- blendminmax.c \
- blendsquare.c \
- bufferobj.c \
- bug_3050.c \
- bug_3101.c \
- bug_3195.c \
- copypixrate.c \
- crossbar.c \
- cva.c \
- dinoshade.c \
- floattex.c \
- fbotest1.c \
- fbotest2.c \
- fbotexture.c \
- fog.c \
- fogcoord.c \
- fptest1.c \
- fptexture.c \
- getprocaddress.c \
- interleave.c \
- invert.c \
- jkrahntest.c \
- manytex.c \
- mipmap_limits.c \
- multipal.c \
- no_s3tc.c \
- packedpixels.c \
- pbo.c \
- prog_parameter.c \
- projtex.c \
- readrate.c \
- seccolor.c \
- sharedtex.c \
- stencilwrap.c \
- stencil_wrap.c \
- subtexrate.c \
- tex1d.c \
- texcompress2.c \
- texfilt.c \
- texline.c \
- texobjshare.c \
- texrect.c \
- texwrap.c \
- vao-01.c \
- vao-02.c \
- vparray.c \
- vptest1.c \
- vptest2.c \
- vptest3.c \
- vptorus.c \
- vpwarpmesh.c \
- yuvrect.c \
- yuvsquare.c \
- zreaddraw.c
-
-PROGS = $(SOURCES:%.c=%)
-
-INCLUDES = -I. -I$(TOP)/include
-
-UTIL_FILES = readtex.h readtex.c
-
-
-##### RULES #####
-
-.SUFFIXES:
-.SUFFIXES: .c
-
-.c:
- $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: $(UTIL_FILES) $(PROGS)
-
-clean:
- rm -f $(PROGS)
- rm -f *.o
- rm -f getproclist.h
-
-
-# auto code generation
-getprocaddress: getprocaddress.c getproclist.h
-
-getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
- python getprocaddress.py > getproclist.h
-
-afsmultiarb: afsmultiarb.o readtex.o
- $(CC) $(CFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
-
-afsmultiarb.o: afsmultiarb.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-texrect: texrect.o readtex.o
- $(CC) $(CFLAGS) texrect.o readtex.o $(LIBS) -o $@
-
-texrect.o: texrect.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-bug_3195: bug_3195.o readtex.o
- $(CC) $(CFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
-
-bug_3195.o: bug_3195.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-invert: invert.o readtex.o
- $(CC) $(CFLAGS) invert.o readtex.o $(LIBS) -o $@
-
-invert.o: invert.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-readtex.o: readtex.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-readtex.h: $(TOP)/progs/util/readtex.h
- ln -s $(TOP)/progs/util/readtex.h .
-
-readtex.c: $(TOP)/progs/util/readtex.c
- ln -s $(TOP)/progs/util/readtex.c .
-
-
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
diff --git a/progs/tests/Makefile.win b/progs/tests/Makefile.win
deleted file mode 100644
index 0de6c42e398..00000000000
--- a/progs/tests/Makefile.win
+++ /dev/null
@@ -1,44 +0,0 @@
-# $Id: Makefile.win,v 1.1 2002/01/16 01:03:25 kschultz Exp $
-
-# Mesa 3-D graphics library
-# Version: 3.5
-# Copyright (C) 1995-2001 Brian Paul
-
-# Makefile for GLUT-based demo programs for Windows
-
-!include <win32.mak>
-
-##### MACROS #####
-
-TOP = ..
-INCDIR = ..\include
-LIBDIR = ..\lib
-
-SRCS = cva.c \
- dinoshade.c \
- fogcoord.c \
- manytex.c \
- multipal.c \
- projtex.c \
- seccolor.c \
-# sharedtex.c \
- texline.c \
- texwrap.c \
- vptest1.c \
- vptest2.c \
- vptest3.c \
- vptorus.c \
- vpwarpmesh.c
-
-!include "../mesawin32.mak"
-
-##### TARGETS #####
-
-clean::
-
-clobber::
- @del readtex.c readtex.h
-
-$(EXES) :$*.obj
- @echo $@
- $(link) -out:$@ $* /LIBPATH:$(LIBDIR) $(LIBS)
diff --git a/progs/tests/afsmultiarb.c b/progs/tests/afsmultiarb.c
deleted file mode 100644
index c026ecd4ce2..00000000000
--- a/progs/tests/afsmultiarb.c
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * GL_ATI_fragment_shader test
- * Roland Scheidegger
- *
- * Command line options:
- * -info print GL implementation information
- */
-
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-#include "readtex.h"
-
-#define TEXTURE_1_FILE "../images/girl.rgb"
-#define TEXTURE_2_FILE "../images/reflect.rgb"
-
-#define TEX0 1
-#define TEX7 8
-#define ANIMATE 10
-#define SHADER 20
-#define QUIT 100
-
-static GLboolean Animate = GL_TRUE;
-static GLint NumUnits = 6;
-static GLboolean TexEnabled[8];
-static GLuint boringshaderID = 0;
-static GLuint boring2passID = 0;
-static GLboolean Shader = GL_FALSE;
-
-static GLfloat Drift = 0.0;
-static GLfloat drift_increment = 0.005;
-static GLfloat Xrot = 20.0, Yrot = 30.0, Zrot = 0.0;
-static GLfloat shaderconstant[4] = {0.5, 0.0, 0.0, 0.0};
-
-static void Idle( void )
-{
- if (Animate) {
- GLint i;
-
- Drift += drift_increment;
- if (Drift >= 1.0)
- Drift = 0.0;
-
- for (i = 0; i < NumUnits; i++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- if (i == 0) {
- glTranslatef(Drift, 0.0, 0.0);
- glScalef(2, 2, 1);
- }
- else if (i == 1) {
- glTranslatef(0.0, Drift, 0.0);
- }
- else {
- glTranslatef(0.5, 0.5, 0.0);
- glRotatef(180.0 * Drift, 0, 0, 1);
- glScalef(1.0/i, 1.0/i, 1.0/i);
- glTranslatef(-0.5, -0.5, 0.0);
- }
- }
- glMatrixMode(GL_MODELVIEW);
-
- glutPostRedisplay();
- }
-}
-
-
-static void DrawObject(void)
-{
- GLint i;
- GLint j;
- static const GLfloat tex_coords[] = { 0.0, 0.0, 1.0, 1.0, 0.0 };
- static const GLfloat vtx_coords[] = { -1.0, -1.0, 1.0, 1.0, -1.0 };
-
- if (!TexEnabled[0] && !TexEnabled[1])
- glColor3f(0.1, 0.1, 0.1); /* add onto this */
- else
- glColor3f(1, 1, 1); /* modulate this */
-
- glBegin(GL_QUADS);
-
- /* Toggle between the vector and scalar entry points. This is done purely
- * to hit multiple paths in the driver.
- */
- if ( Drift > 0.49 ) {
- for (j = 0; j < 4; j++ ) {
- for (i = 0; i < NumUnits; i++)
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i,
- tex_coords[j], tex_coords[j+1]);
- glVertex2f( vtx_coords[j], vtx_coords[j+1] );
- }
- }
- else {
- for (j = 0; j < 4; j++ ) {
- for (i = 0; i < NumUnits; i++)
- glMultiTexCoord2fvARB(GL_TEXTURE0_ARB + i, & tex_coords[j]);
- glVertex2fv( & vtx_coords[j] );
- }
- }
-
- glEnd();
-}
-
-
-
-static void Display( void )
-{
- static GLint T0 = 0;
- static GLint Frames = 0;
- GLint t;
-
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glScalef(5.0, 5.0, 5.0);
- DrawObject();
- glPopMatrix();
-
- glutSwapBuffers();
-
- Frames++;
-
- t = glutGet(GLUT_ELAPSED_TIME);
- if (t - T0 >= 2500) {
- GLfloat seconds = (t - T0) / 1000.0;
- GLfloat fps = Frames / seconds;
- drift_increment = 2.2 * seconds / Frames;
- printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
- T0 = t;
- Frames = 0;
- }
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 );
- /*glOrtho( -6.0, 6.0, -6.0, 6.0, 10.0, 100.0 );*/
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -70.0 );
-}
-
-
-static void ModeMenu(int entry)
-{
- if (entry >= TEX0 && entry <= TEX7) {
- /* toggle */
- GLint i = entry - TEX0;
- TexEnabled[i] = !TexEnabled[i];
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- if (TexEnabled[i])
- glEnable(GL_TEXTURE_2D);
- else
- glDisable(GL_TEXTURE_2D);
- printf("Enabled: ");
- for (i = 0; i < NumUnits; i++)
- printf("%d ", (int) TexEnabled[i]);
- printf("\n");
- }
- else if (entry==ANIMATE) {
- Animate = !Animate;
- }
- else if (entry==SHADER) {
- Shader = !Shader;
- if (Shader) {
- fprintf(stderr, "using 2-pass shader\n");
- glBindFragmentShaderATI(boring2passID);
- }
- else {
- fprintf(stderr, "using 1-pass shader\n");
- glBindFragmentShaderATI(boringshaderID);
- }
- }
- else if (entry==QUIT) {
- exit(0);
- }
-
- glutPostRedisplay();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( int argc, char *argv[] )
-{
- GLuint texObj[8];
- GLint size, i;
-
- const char *exten = (const char *) glGetString(GL_EXTENSIONS);
- if (!strstr(exten, "GL_ATI_fragment_shader")) {
- printf("Sorry, GL_ATI_fragment_shader not supported by this renderer.\n");
- exit(1);
- }
-
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
- printf("%d x %d max texture size\n", size, size);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- for (i = 0; i < NumUnits; i++) {
- if (i < 6)
- TexEnabled[i] = GL_TRUE;
- else
- TexEnabled[i] = GL_FALSE;
- }
-
- /* allocate two texture objects */
- glGenTextures(NumUnits, texObj);
-
- /* setup the texture objects */
- for (i = 0; i < NumUnits; i++) {
-
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- glBindTexture(GL_TEXTURE_2D, texObj[i]);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- if (i == 0) {
- if (!LoadRGBMipmaps(TEXTURE_1_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
- }
- else if (i == 1) {
- if (!LoadRGBMipmaps(TEXTURE_2_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
- }
- else {
- /* checker */
- GLubyte image[8][8][3];
- GLint i, j;
- for (i = 0; i < 8; i++) {
- for (j = 0; j < 8; j++) {
- if ((i + j) & 1) {
- image[i][j][0] = 50;
- image[i][j][1] = 50;
- image[i][j][2] = 50;
- }
- else {
- image[i][j][0] = 25;
- image[i][j][1] = 25;
- image[i][j][2] = 25;
- }
- }
- }
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0,
- GL_RGB, GL_UNSIGNED_BYTE, (GLvoid *) image);
- }
-
- /* Bind texObj[i] to ith texture unit */
-/* if (i < 2)
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- else
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);*/
-
- if (TexEnabled[i])
- glEnable(GL_TEXTURE_2D);
- }
-
- boringshaderID = glGenFragmentShadersATI(1);
- boring2passID = glGenFragmentShadersATI(1);
- if (boring2passID == 0)
- {
- fprintf(stderr, "couldn't get frag shader id\n");
- exit(1);
- }
- glBindFragmentShaderATI(boringshaderID);
-/* maybe not the most creative shader but at least I know how it should look like! */
- glBeginFragmentShaderATI();
- glSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_2_ATI, GL_TEXTURE2_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_3_ATI, GL_TEXTURE3_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_4_ATI, GL_TEXTURE4_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_5_ATI, GL_TEXTURE5_ARB, GL_SWIZZLE_STR_ATI);
- glColorFragmentOp2ATI(GL_MUL_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_PRIMARY_COLOR, GL_NONE, GL_NONE);
- glAlphaFragmentOp1ATI(GL_MOV_ATI,
- GL_REG_0_ATI, GL_NONE,
- GL_PRIMARY_COLOR, GL_NONE, GL_NONE);
- glColorFragmentOp3ATI(GL_MAD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_1_ATI, GL_NONE, GL_NONE,
- GL_REG_2_ATI, GL_NONE, GL_NONE);
- glColorFragmentOp2ATI(GL_ADD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_3_ATI, GL_NONE, GL_NONE);
- glColorFragmentOp2ATI(GL_ADD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_4_ATI, GL_NONE, GL_NONE);
- glColorFragmentOp2ATI(GL_ADD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_5_ATI, GL_NONE, GL_NONE);
- glEndFragmentShaderATI();
-
-/* mathematically equivalent to first shader but using 2 passes together with
- some tex coord rerouting */
- glBindFragmentShaderATI(boring2passID);
- glBeginFragmentShaderATI();
- glPassTexCoordATI(GL_REG_1_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_2_ATI, GL_TEXTURE2_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_3_ATI, GL_TEXTURE3_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_4_ATI, GL_TEXTURE4_ARB, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_5_ATI, GL_TEXTURE5_ARB, GL_SWIZZLE_STR_ATI);
- glColorFragmentOp2ATI(GL_ADD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_2_ATI, GL_NONE, GL_NONE,
- GL_REG_3_ATI, GL_NONE, GL_NONE);
- glColorFragmentOp2ATI(GL_ADD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_4_ATI, GL_NONE, GL_NONE);
- glColorFragmentOp2ATI(GL_ADD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_5_ATI, GL_NONE, GL_NONE);
- /* not really a dependant read */
- glSampleMapATI(GL_REG_0_ATI, GL_REG_1_ATI, GL_SWIZZLE_STR_ATI);
- glSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI);
- glPassTexCoordATI(GL_REG_5_ATI, GL_REG_0_ATI, GL_SWIZZLE_STR_ATI);
- glColorFragmentOp2ATI(GL_MUL_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_PRIMARY_COLOR, GL_NONE, GL_NONE);
- glAlphaFragmentOp1ATI(GL_MOV_ATI,
- GL_REG_0_ATI, GL_NONE,
- GL_PRIMARY_COLOR, GL_NONE, GL_NONE);
- glColorFragmentOp3ATI(GL_MAD_ATI,
- GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_1_ATI, GL_NONE, GL_NONE,
- GL_REG_5_ATI, GL_NONE, GL_NONE);
- /* in principle we're finished here, but to test a bit more
- we do some fun with dot ops, replication et al. */
- glSetFragmentShaderConstantATI(GL_CON_3_ATI, shaderconstant);
- glColorFragmentOp2ATI(GL_DOT4_ATI,
- GL_REG_3_ATI, GL_GREEN_BIT_ATI, GL_EIGHTH_BIT_ATI,
- GL_ZERO, GL_NONE, GL_COMP_BIT_ATI | GL_NEGATE_BIT_ATI,
- GL_CON_3_ATI, GL_RED, GL_2X_BIT_ATI);
- /* those args must get ignored, except dstReg */
- glAlphaFragmentOp2ATI(GL_DOT4_ATI,
- GL_REG_4_ATI, GL_NONE,
- GL_ZERO, GL_NONE, GL_NONE,
- GL_ZERO, GL_NONE, GL_NONE);
- /* -> reg3 g = reg4 alpha = -0.5 */
- glAlphaFragmentOp2ATI(GL_ADD_ATI,
- GL_REG_5_ATI, GL_NONE,
- GL_REG_3_ATI, GL_GREEN, GL_NONE,
- GL_REG_4_ATI, GL_NONE, GL_NONE);
- /* -> reg5 a = -1 */
- glColorFragmentOp3ATI(GL_DOT2_ADD_ATI,
- GL_REG_4_ATI, GL_BLUE_BIT_ATI, GL_HALF_BIT_ATI,
- GL_REG_5_ATI, GL_ALPHA, GL_NEGATE_BIT_ATI,
- GL_ONE, GL_NONE, GL_BIAS_BIT_ATI,
- GL_ONE, GL_ALPHA, GL_2X_BIT_ATI | GL_NEGATE_BIT_ATI);
- /* -> reg 4 b = -0.5 */
- glColorFragmentOp2ATI(GL_MUL_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_4_ATI, GL_BLUE, GL_NEGATE_BIT_ATI | GL_2X_BIT_ATI,
- GL_REG_0_ATI, GL_NONE, GL_NONE);
- glEndFragmentShaderATI();
-
- glBindFragmentShaderATI(boringshaderID);
- glEnable(GL_FRAGMENT_SHADER_ATI);
-
- glShadeModel(GL_FLAT);
- glClearColor(0.3, 0.3, 0.4, 1.0);
-
- if (argc > 1 && strcmp(argv[1], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
- printf("output should be identical with both shaders to multiarb demo when 6 textures are enabled\n");
-}
-
-
-int main( int argc, char *argv[] )
-{
-/* GLint i;*/
-
- glutInit( &argc, argv );
- glutInitWindowSize( 300, 300 );
- glutInitWindowPosition( 0, 0 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0] );
-
- Init( argc, argv );
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- glutIdleFunc( Idle );
-
- glutCreateMenu(ModeMenu);
-
-/* for (i = 0; i < NumUnits; i++) {
- char s[100];
- sprintf(s, "Toggle Texture %d", i);
- glutAddMenuEntry(s, TEX0 + i);
- }*/
- glutAddMenuEntry("Toggle 1/2 Pass Shader", SHADER);
- glutAddMenuEntry("Toggle Animation", ANIMATE);
- glutAddMenuEntry("Quit", QUIT);
- glutAttachMenu(GLUT_RIGHT_BUTTON);
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/antialias.c b/progs/tests/antialias.c
deleted file mode 100644
index 79b5ab75c57..00000000000
--- a/progs/tests/antialias.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* $Id: antialias.c,v 1.2 2003/03/29 16:42:57 brianp Exp $ */
-
-/*
- * Test multisampling and polygon smoothing.
- *
- * Brian Paul
- * 4 November 2002
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-
-static GLfloat Zrot = 0;
-static GLboolean Anim = GL_TRUE;
-static GLboolean HaveMultisample = GL_TRUE;
-
-
-static void
-PrintString(const char *s)
-{
- while (*s) {
- glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
- s++;
- }
-}
-
-
-static void
-Polygon( GLint verts, GLfloat radius, GLfloat z )
-{
- int i;
- for (i = 0; i < verts; i++) {
- float a = (i * 2.0 * 3.14159) / verts;
- float x = radius * cos(a);
- float y = radius * sin(a);
- glVertex3f(x, y, z);
- }
-}
-
-
-static void
-DrawObject( void )
-{
- glLineWidth(3.0);
- glColor3f(1, 1, 1);
- glBegin(GL_LINE_LOOP);
- Polygon(12, 1.2, 0);
- glEnd();
-
- glLineWidth(1.0);
- glColor3f(1, 1, 1);
- glBegin(GL_LINE_LOOP);
- Polygon(12, 1.1, 0);
- glEnd();
-
- glColor3f(1, 0, 0);
- glBegin(GL_POLYGON);
- Polygon(12, 0.4, 0.3);
- glEnd();
-
- glColor3f(0, 1, 0);
- glBegin(GL_POLYGON);
- Polygon(12, 0.6, 0.2);
- glEnd();
-
- glColor3f(0, 0, 1);
- glBegin(GL_POLYGON);
- Polygon(12, 0.8, 0.1);
- glEnd();
-
- glColor3f(1, 1, 1);
- glBegin(GL_POLYGON);
- Polygon(12, 1.0, 0);
- glEnd();
-}
-
-
-static void
-Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glColor3f(1, 1, 1);
- if (HaveMultisample) {
- glRasterPos2f(-3.1, -1.6);
- PrintString("MULTISAMPLE");
- }
- glRasterPos2f(-0.8, -1.6);
- PrintString("No antialiasing");
- glRasterPos2f(1.6, -1.6);
- PrintString("GL_POLYGON_SMOOTH");
-
- /* multisample */
- if (HaveMultisample) {
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_MULTISAMPLE_ARB);
- glPushMatrix();
- glTranslatef(-2.5, 0, 0);
- glPushMatrix();
- glRotatef(Zrot, 0, 0, 1);
- DrawObject();
- glPopMatrix();
- glPopMatrix();
- glDisable(GL_MULTISAMPLE_ARB);
- glDisable(GL_DEPTH_TEST);
- }
-
- /* non-aa */
- glEnable(GL_DEPTH_TEST);
- glPushMatrix();
- glTranslatef(0, 0, 0);
- glPushMatrix();
- glRotatef(Zrot, 0, 0, 1);
- DrawObject();
- glPopMatrix();
- glPopMatrix();
- glDisable(GL_DEPTH_TEST);
-
- /* polygon smooth */
- glEnable(GL_POLYGON_SMOOTH);
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_BLEND);
- glPushMatrix();
- glTranslatef(2.5, 0, 0);
- glPushMatrix();
- glRotatef(Zrot, 0, 0, 1);
- DrawObject();
- glPopMatrix();
- glPopMatrix();
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_POLYGON_SMOOTH);
- glDisable(GL_BLEND);
-
- glutSwapBuffers();
-}
-
-
-static void
-Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-2.0*ar, 2.0*ar, -2.0, 2.0, -1.0, 1.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-static void
-Idle( void )
-{
- Zrot = 0.01 * glutGet(GLUT_ELAPSED_TIME);
- glutPostRedisplay();
-}
-
-
-static void
-Key( unsigned char key, int x, int y )
-{
- const GLfloat step = 1.0;
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'z':
- Zrot = (int) (Zrot - step);
- break;
- case 'Z':
- Zrot = (int) (Zrot + step);
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init( void )
-{
- /* GLUT imposes the four samples/pixel requirement */
- int s;
- glGetIntegerv(GL_SAMPLES_ARB, &s);
- if (!glutExtensionSupported("GL_ARB_multisample") || s < 1) {
- printf("Warning: multisample antialiasing not supported.\n");
- HaveMultisample = GL_FALSE;
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_SAMPLES_ARB = %d\n", s);
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);
-
- glGetIntegerv(GL_MULTISAMPLE_ARB, &s);
- printf("GL_MULTISAMPLE_ARB = %d\n", s);
-}
-
-
-int
-main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 600, 300 );
- glutInitDisplayMode( GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE |
- GLUT_DEPTH | GLUT_MULTISAMPLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc( Idle );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/api_speed.c b/progs/tests/api_speed.c
deleted file mode 100644
index aed65b35fe3..00000000000
--- a/progs/tests/api_speed.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * (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.
- */
-
-/**
- * \file api_speed.c
- * Simple test to measure the overhead of making GL calls.
- *
- * The main purpose of this test is to measure the difference in calling
- * overhead of different dispatch methods. Since it uses asm/timex.h to
- * access the Pentium's cycle counters, it will probably only compile on
- * Linux (though most architectures have a get_cycles function in timex.h).
- * That is why it isn't in the default Makefile.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include <GL/glut.h>
-
-#define inline __inline__
-#include <asm/timex.h>
-
-static float Width = 400;
-static float Height = 400;
-static unsigned count = 1000000;
-
-
-static void Idle( void )
-{
- glutPostRedisplay();
-}
-
-#define DO_FUNC(f,p) \
- do { \
- t0 = get_cycles(); \
- for ( i = 0 ; i < count ; i++ ) { \
- f p ; \
- } \
- t1 = get_cycles(); \
- printf("%u calls to % 20s required %llu cycles.\n", count, # f, t1 - t0); \
- } while( 0 )
-
-/**
- * Main display function. This is the place to add more API calls.
- */
-static void Display( void )
-{
- int i;
- const float v[3] = { 1.0, 0.0, 0.0 };
- cycles_t t0;
- cycles_t t1;
-
- glBegin(GL_TRIANGLE_STRIP);
-
- DO_FUNC( glColor3fv, (v) );
- DO_FUNC( glNormal3fv, (v) );
- DO_FUNC( glTexCoord2fv, (v) );
- DO_FUNC( glTexCoord3fv, (v) );
- DO_FUNC( glMultiTexCoord2fv, (GL_TEXTURE0, v) );
- DO_FUNC( glMultiTexCoord2f, (GL_TEXTURE0, 0.0, 0.0) );
- DO_FUNC( glFogCoordfvEXT, (v) );
- DO_FUNC( glFogCoordfEXT, (0.5) );
-
- glEnd();
-
- exit(0);
-}
-
-
-static void Reshape( int width, int height )
-{
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(0.0, width, 0.0, height, -1.0, 1.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowSize( (int) Width, (int) Height );
- glutInitWindowPosition( 0, 0 );
-
- glutInitDisplayMode( GLUT_RGB );
-
- glutCreateWindow( argv[0] );
-
- if ( argc > 1 ) {
- count = strtoul( argv[1], NULL, 0 );
- if ( count == 0 ) {
- fprintf( stderr, "Usage: %s [iterations]\n", argv[0] );
- exit(1);
- }
- }
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- glutIdleFunc( Idle );
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/api_speed.py b/progs/tests/api_speed.py
deleted file mode 100755
index 0ddaf5836c9..00000000000
--- a/progs/tests/api_speed.py
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/env 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>
-
-
-# This script is used to run api_speed against several different libGL
-# libraries and compare the results. See the show_usage function for more
-# details on how to use it.
-
-
-import re, os, sys, getopt
-
-class results:
- def process_file(self, f):
- self.cycles = {}
- self.iterations = -1
-
- for line in f.readlines():
- m = re.match("(\d+) calls to (.{20}) required (\d+) cycles.", line)
-
- if self.iterations != -1 and int(m.group(1)) != self.iterations:
- raise
-
- # This could be done with lstrip, but the version of
- # the Python library on my system doesn't have it.
- # The installed version of Python is quite old. :(
-
- temp = m.group(2)
- function_name = None
- for i in range(len(temp)):
- if temp[i] != ' ':
- function_name = temp[i:]
- break
-
- if function_name == None:
- raise
-
- self.cycles[ function_name ] = int(m.group(3))
- self.iterations = int(m.group(1))
-
-
- def show_results(self):
- for name in self.cycles:
- print "%s -> %f" % (name, float(self.cycles[name]) / self.iterations)
-
-
- def compare_results(self, other):
- for name in self.cycles:
- if other.cycles.has_key(name):
- a = float(self.cycles[name]) / float(self.iterations)
- b = float(other.cycles[name]) / float(other.iterations)
- if abs( a ) < 0.000001:
- print "a = %f, b = %f" % (a, b)
- else:
- p = (100.0 * b / a) - 100.0
- print "%- 20s %7.2f - %7.2f = % -6.2f (%+.1f%%)" % (name, a, b, a - b, p)
- return
-
-
-def make_execution_string(lib, iterations):
- if lib == None:
- return "./api_speed %u" % (iterations)
- else:
- return "LD_PRELOAD=%s ./api_speed %u" % (lib, iterations)
-
-
-def show_usage():
- print """Usage: %s [-i iterations] {library ...}
-
-The full path to one or more libGL libraries (including the full name of the
-library) can be included on the command-line. Each library will be tested,
-and the results compared. The first library listed will be used as the
-"base line" for all comparisons.""" % (sys.argv[0])
- sys.exit(1)
-
-
-if __name__ == '__main__':
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "i:")
- except Exception,e:
- show_usage()
-
- iterations = 1000000
- try:
- for (arg,val) in args:
- if arg == "-i":
- iterations = int(val)
- except Exception,e:
- show_usage()
-
-
- # If no libraries were specifically named, just run the test against
- # the default system libGL.
-
- if len(trail) == 0:
- trail.append(None)
-
-
- result_array = []
- names = []
-
- for lib in trail:
- s = make_execution_string( lib, iterations )
- r = results()
- r.process_file( os.popen(s) )
- names.append(lib)
- result_array.append(r)
-
-
- # If the test was only run against one library, just show the results
- # of the test run. Otherwise, compare each successive run against
- # the first run.
-
- if len( result_array ) == 1:
- result_array[0].show_results()
- else:
- for i in range(1, len( result_array )):
- print "%s vs. %s" % (names[0], names[i])
- result_array[0].compare_results( result_array[i] )
- print ""
diff --git a/progs/tests/arbfpspec.c b/progs/tests/arbfpspec.c
deleted file mode 100644
index eac2a9100f5..00000000000
--- a/progs/tests/arbfpspec.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * To demo that specular color gets lost someplace after vertex
- * program completion and fragment program startup
- */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
-static GLboolean Anim = GL_TRUE;
-
-
-static void Idle( void )
-{
- Xrot += .3;
- Yrot += .4;
- Zrot += .2;
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
- glutSolidTorus(0.75, 2.0, 10, 20);
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -12.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case ' ':
- Xrot = Yrot = Zrot = 0;
- break;
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'z':
- Zrot -= 5.0;
- break;
- case 'Z':
- Zrot += 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum, fprognum;
-
- static const char prog[] =
- "!!ARBvp1.0\n"
- "DP4 result.position.x, state.matrix.mvp.row[0], vertex.position ;\n"
- "DP4 result.position.y, state.matrix.mvp.row[1], vertex.position ;\n"
- "DP4 result.position.z, state.matrix.mvp.row[2], vertex.position ;\n"
- "DP4 result.position.w, state.matrix.mvp.row[3], vertex.position ;\n"
- "MOV result.color.front.primary, {.5, .5, .5, 1};\n"
- "MOV result.color.front.secondary, {1, 1, 1, 1};\n"
- "END";
-
- static const char fprog[] =
- "!!ARBfp1.0\n"
- "MOV result.color, fragment.color.secondary;\n"
- "END";
-
- if (!glutExtensionSupported("GL_ARB_vertex_program")) {
- printf("Sorry, this program requires GL_ARB_vertex_program");
- exit(1);
- }
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Sorry, this program requires GL_ARB_fragment_program");
- exit(1);
- }
-
- glGenProgramsARB(1, &prognum);
- glGenProgramsARB(1, &fprognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog), (const GLubyte *) prog);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, fprognum);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(fprog), (const GLubyte *) fprog);
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-
- glEnable(GL_VERTEX_PROGRAM_ARB);
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
- glEnable(GL_DEPTH_TEST);
- glClearColor(0.3, 0.3, 0.3, 1);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbfptest1.c b/progs/tests/arbfptest1.c
deleted file mode 100644
index 7949f87eddb..00000000000
--- a/progs/tests/arbfptest1.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Test GL_ARB_fragment_program */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
-
- glColor4f(0, 0.5, 0, 1);
- glColor4f(0, 1, 0, 1);
- glBegin(GL_POLYGON);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 0, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-static void load_program(const char *prog, GLuint prognum)
-{
- int a;
- GLint errorpos, errno;
-
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog), (const GLubyte *) prog);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- for (a=-10; a<10; a++)
- {
- if ((errorpos+a < 0) || (errorpos+a >= strlen(prog))) continue;
- printf("%c", prog[errorpos+a]);
- }
- printf("\n");
- exit(1);
- }
-}
-
-static void Init( void )
-{
- static const char *prog0 =
- "!!ARBfp1.0\n"
- "TEMP R0, RC, HC, H0, H1, H2, H3, H30 ;\n"
- "MUL result.color, R0, fragment.position; \n"
- "ADD result.color, H3, fragment.texcoord; \n"
- "ADD_SAT result.color, H3, fragment.texcoord; \n"
- "MUL result.color.xy, R0.wzyx, fragment.position; \n"
- "MUL result.color, H0, fragment.position; \n"
- "MUL result.color, -H0, fragment.position; \n"
- "MOV RC, H1; \n"
- "MOV HC, H2; \n"
- "END \n"
- ;
- /* masked updates, defines, declarations */
- static const char *prog1 =
- "!!ARBfp1.0\n"
- "PARAM foo = {1., 2., 3., 4.}; \n"
- "PARAM foo2 = 5.; \n"
- "PARAM foo3 = {5., 6., 7., 8.}; \n"
- "PARAM bar = 3.; \n"
- "TEMP R0, R1, RC, EQ, NE, bar2; \n"
- "ALIAS bar3 = bar; \n"
- "MOV result.color.xy, R0; \n"
- "MOV result.color, R0; \n"
- "MOV result.color.xyzw, R0; \n"
- "MOV result.color.xy, R0; \n"
- "MOV RC.x, R1.x; \n"
- "KIL NE; \n"
- "KIL EQ.xyxy; \n"
- "END \n"
- ;
-
- /* texture instructions */
- static const char *prog2 =
- "!!ARBfp1.0\n"
- "TEMP R0, R1, R2, R3;\n"
- "TEX R0, fragment.texcoord, texture[0], 2D; \n"
- "TEX R1, fragment.texcoord[1], texture[1], CUBE; \n"
- "TEX R2, fragment.texcoord[2], texture[2], 3D; \n"
- "TXP R3, fragment.texcoord[3], texture[3], RECT; \n"
- "MUL result.color, R0, fragment.color; \n"
- "END \n"
- ;
-
- /* test negation, absolute value */
- static const char *prog3 =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "MOV R0, R1; \n"
- "MOV R0, -R1; \n"
- "MOV result.color, R0; \n"
- "END \n"
- ;
-
- /* literal constant sources */
- static const char *prog4 =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "PARAM Pi = 3.14159; \n"
- "MOV R0, {1., -2., +3., 4.}; \n"
- "MOV R0, 5.; \n"
- "MOV R0, -5.; \n"
- "MOV R0, 5.; \n"
- "MOV R0, Pi; \n"
- "MOV result.color, R0; \n"
- "END \n"
- ;
-
- /* change the fragment color in a simple way */
- static const char *prog10 =
- "!!ARBfp1.0\n"
- "PARAM blue = {0., 0., 1., 0.};\n"
- "PARAM color = {1., 0., 0., 1.};\n"
- "TEMP R0; \n"
- "MOV R0, fragment.color; \n"
- "#ADD result.color, R0, fragment.color; \n"
- "#ADD result.color, blue, fragment.color; \n"
- "#ADD result.color, {1., 0., 0., 0.}, fragment.color; \n"
- "ADD result.color, color, fragment.color; \n"
- "END \n"
- ;
-
- GLuint progs[20];
-
- glGenProgramsARB(20, progs);
- assert(progs[0]);
- assert(progs[1]);
- assert(progs[0] != progs[1]);
-
-
- printf("program 0:\n");
- load_program(prog0, progs[0]);
- printf("program 1:\n");
- load_program(prog1, progs[1]);
- printf("program 2:\n");
- load_program(prog2, progs[2]);
- printf("program 3:\n");
- load_program(prog3, progs[3]);
- printf("program 4:\n");
- load_program(prog4, progs[4]);
- printf("program 10:\n");
- load_program(prog10, progs[5]);
-
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_ALWAYS, 0.0);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbfptexture.c b/progs/tests/arbfptexture.c
deleted file mode 100644
index a854908c311..00000000000
--- a/progs/tests/arbfptexture.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* GL_ARB_fragment_program texture test */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-#include "readtex.c"
-
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
-
- glBegin(GL_POLYGON);
-#define Q 2
- glColor4f(1.0, 1.0, 1.0, 1); glTexCoord4f(0, 0, 0, Q); glVertex2f(-1, -1);
- glColor4f(0.2, 0.2, 1.0, 1); glTexCoord4f(1, 0, 0, Q); glVertex2f( 1, -1);
- glColor4f(0.2, 1.0, 0.2, 1); glTexCoord4f(1, 1, 0, Q); glVertex2f( 1, 1);
- glColor4f(1.0, 0.2, 0.2, 1); glTexCoord4f(0, 1, 0, Q); glVertex2f(-1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -8.0 );
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "TEX R0, fragment.texcoord[0], texture[0], 2D; \n"
- "MUL result.color, R0, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
- GLuint Texture;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- assert(glIsProgramARB(modulateProg));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- /* Load texture */
- glGenTextures(1, &Texture);
- glBindTexture(GL_TEXTURE_2D, Texture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE);
- exit(1);
- }
- /* XXX this enable shouldn't really be needed!!! */
- glEnable(GL_TEXTURE_2D);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbfptrig.c b/progs/tests/arbfptrig.c
deleted file mode 100644
index 26b68c6b412..00000000000
--- a/progs/tests/arbfptrig.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* GL_ARB_fragment_program texture test */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-#include "readtex.c"
-
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
-
-#define PI 3.141592
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
-
- glBegin(GL_POLYGON);
- glTexCoord2f(-PI, 0); glVertex2f(-1, -1);
- glTexCoord2f(PI, 0); glVertex2f( 1, -1);
- glTexCoord2f(PI, 1); glVertex2f( 1, 1);
- glTexCoord2f(-PI, 1); glVertex2f(-1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -8.0 );
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "MOV R0, {0,0,0,1};\n"
- "SCS R0, fragment.texcoord[0].x; \n"
- "ADD R0, R0, {1.0}.x;\n"
- "MUL R0, R0, {0.5}.x;\n"
- "MOV result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
- GLuint Texture;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- assert(glIsProgramARB(modulateProg));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- /* Load texture */
- glGenTextures(1, &Texture);
- glBindTexture(GL_TEXTURE_2D, Texture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE);
- exit(1);
- }
- /* XXX this enable shouldn't really be needed!!! */
- glEnable(GL_TEXTURE_2D);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbnpot-mipmap.c b/progs/tests/arbnpot-mipmap.c
deleted file mode 100644
index 4ed84e7acee..00000000000
--- a/progs/tests/arbnpot-mipmap.c
+++ /dev/null
@@ -1,184 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/*
- * (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.
- */
-/* mipmap.c
- * This program demonstrates using mipmaps for texture maps.
- * To overtly show the effect of mipmaps, each mipmap reduction
- * level has a solidly colored, contrasting texture image.
- * Thus, the quadrilateral which is drawn is drawn with several
- * different colors.
- */
-#include <stdlib.h>
-#include <stdio.h>
-#include <GL/glut.h>
-
-GLubyte mipmapImage32[40][46][3];
-GLubyte mipmapImage16[20][23][3];
-GLubyte mipmapImage8[10][11][3];
-GLubyte mipmapImage4[5][5][3];
-GLubyte mipmapImage2[2][2][3];
-GLubyte mipmapImage1[1][1][3];
-
-static void makeImages(void)
-{
- int i, j;
-
- for (i = 0; i < 40; i++) {
- for (j = 0; j < 46; j++) {
- mipmapImage32[i][j][0] = 255;
- mipmapImage32[i][j][1] = 255;
- mipmapImage32[i][j][2] = 0;
- }
- }
- for (i = 0; i < 20; i++) {
- for (j = 0; j < 23; j++) {
- mipmapImage16[i][j][0] = 255;
- mipmapImage16[i][j][1] = 0;
- mipmapImage16[i][j][2] = 255;
- }
- }
- for (i = 0; i < 10; i++) {
- for (j = 0; j < 11; j++) {
- mipmapImage8[i][j][0] = 255;
- mipmapImage8[i][j][1] = 0;
- mipmapImage8[i][j][2] = 0;
- }
- }
- for (i = 0; i < 5; i++) {
- for (j = 0; j < 5; j++) {
- mipmapImage4[i][j][0] = 0;
- mipmapImage4[i][j][1] = 255;
- mipmapImage4[i][j][2] = 0;
- }
- }
- for (i = 0; i < 2; i++) {
- for (j = 0; j < 2; j++) {
- mipmapImage2[i][j][0] = 0;
- mipmapImage2[i][j][1] = 0;
- mipmapImage2[i][j][2] = 255;
- }
- }
- mipmapImage1[0][0][0] = 255;
- mipmapImage1[0][0][1] = 255;
- mipmapImage1[0][0][2] = 255;
-}
-
-static void myinit(void)
-{
- if (!glutExtensionSupported("GL_ARB_texture_non_power_of_two")) {
- printf("Sorry, this program requires GL_ARB_texture_non_power_of_two\n");
- exit(1);
- }
-
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glShadeModel(GL_FLAT);
-
- glTranslatef(0.0, 0.0, -3.6);
- makeImages();
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, 3, 40, 46, 0,
- GL_RGB, GL_UNSIGNED_BYTE, &mipmapImage32[0][0][0]);
- glTexImage2D(GL_TEXTURE_2D, 1, 3, 20, 23, 0,
- GL_RGB, GL_UNSIGNED_BYTE, &mipmapImage16[0][0][0]);
- glTexImage2D(GL_TEXTURE_2D, 2, 3, 10, 11, 0,
- GL_RGB, GL_UNSIGNED_BYTE, &mipmapImage8[0][0][0]);
- glTexImage2D(GL_TEXTURE_2D, 3, 3, 5, 5, 0,
- GL_RGB, GL_UNSIGNED_BYTE, &mipmapImage4[0][0][0]);
- glTexImage2D(GL_TEXTURE_2D, 4, 3, 2, 2, 0,
- GL_RGB, GL_UNSIGNED_BYTE, &mipmapImage2[0][0][0]);
- glTexImage2D(GL_TEXTURE_2D, 5, 3, 1, 1, 0,
- GL_RGB, GL_UNSIGNED_BYTE, &mipmapImage1[0][0][0]);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_NEAREST_MIPMAP_NEAREST);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- glEnable(GL_TEXTURE_2D);
-}
-
-static void display(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
- glTexCoord2f(0.0, 8.0); glVertex3f(-2.0, 1.0, 0.0);
- glTexCoord2f(8.0, 8.0); glVertex3f(2000.0, 1.0, -6000.0);
- glTexCoord2f(8.0, 0.0); glVertex3f(2000.0, -1.0, -6000.0);
- glEnd();
- glFlush();
-}
-
-static void myReshape(int w, int h)
-{
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-static void
-key(unsigned char k, int x, int y)
-{
- switch (k) {
- case 27: /* Escape */
- exit(0);
- break;
- default:
- return;
- }
- glutPostRedisplay();
-}
-
-int main(int argc, char** argv)
-{
- glutInit(&argc, argv);
- glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
- glutInitWindowSize (500, 500);
- glutCreateWindow (argv[0]);
- myinit();
- glutReshapeFunc (myReshape);
- glutDisplayFunc(display);
- glutKeyboardFunc(key);
- glutMainLoop();
- return 0; /* ANSI C requires main to return int. */
-}
diff --git a/progs/tests/arbnpot.c b/progs/tests/arbnpot.c
deleted file mode 100644
index 8107717e271..00000000000
--- a/progs/tests/arbnpot.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Test NPOT textures with the GL_ARB_texture_non_power_of_two extension.
- * Brian Paul
- * 2 July 2003
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-#include "../util/readtex.c"
-
-#define IMAGE_FILE "../images/girl.rgb"
-
-static GLfloat Zrot = 0;
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Zrot, 0, 0, 1);
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0);
- glVertex2f(-1, -1);
- glTexCoord2f(1, 0);
- glVertex2f(1, -1);
- glTexCoord2f(1, 1);
- glVertex2f(1, 1);
- glTexCoord2f(0, 1);
- glVertex2f(-1, 1);
- glEnd();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -7.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'z':
- Zrot -= 1.0;
- break;
- case 'Z':
- Zrot += 1.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- GLubyte *image;
- int imgWidth, imgHeight, minDim, w;
- GLenum imgFormat;
-
- if (!glutExtensionSupported("GL_ARB_texture_non_power_of_two")) {
- printf("Sorry, this program requires GL_ARB_texture_non_power_of_two\n");
- exit(1);
- }
-
-#if 1
- image = LoadRGBImage( IMAGE_FILE, &imgWidth, &imgHeight, &imgFormat );
- if (!image) {
- printf("Couldn't read %s\n", IMAGE_FILE);
- exit(0);
- }
-#else
- int i, j;
- imgFormat = GL_RGB;
- imgWidth = 3;
- imgHeight = 3;
- image = malloc(imgWidth * imgHeight * 3);
- for (i = 0; i < imgHeight; i++) {
- for (j = 0; j < imgWidth; j++) {
- int k = (i * imgWidth + j) * 3;
- if ((i + j) & 1) {
- image[k+0] = 255;
- image[k+1] = 0;
- image[k+2] = 0;
- }
- else {
- image[k+0] = 0;
- image[k+1] = 255;
- image[k+2] = 0;
- }
- }
- }
-#endif
-
- printf("Read %d x %d\n", imgWidth, imgHeight);
-
- minDim = imgWidth < imgHeight ? imgWidth : imgHeight;
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage1D(GL_TEXTURE_1D, 0, GL_RGB, imgWidth, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- assert(glGetError() == GL_NO_ERROR);
-
- glTexImage1D(GL_PROXY_TEXTURE_1D, 0, GL_RGB, imgWidth, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- glGetTexLevelParameteriv(GL_PROXY_TEXTURE_1D, 0, GL_TEXTURE_WIDTH, &w);
- assert(w == imgWidth);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, imgWidth, imgHeight, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- assert(glGetError() == GL_NO_ERROR);
-
- glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGB, imgWidth, imgHeight, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
- assert(w == imgWidth);
-
- glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB, imgWidth, imgHeight, 1, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- assert(glGetError() == GL_NO_ERROR);
-
- glTexImage3D(GL_PROXY_TEXTURE_3D, 0, GL_RGB, imgWidth, imgHeight, 1, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- glGetTexLevelParameteriv(GL_PROXY_TEXTURE_3D, 0, GL_TEXTURE_WIDTH, &w);
- assert(w == imgWidth);
-
- glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB,
- minDim, minDim, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- assert(glGetError() == GL_NO_ERROR);
-
- glTexImage2D(GL_PROXY_TEXTURE_CUBE_MAP, 0, GL_RGB,
- minDim, minDim, 0,
- imgFormat, GL_UNSIGNED_BYTE, image);
- glGetTexLevelParameteriv(GL_PROXY_TEXTURE_CUBE_MAP, 0, GL_TEXTURE_WIDTH, &w);
- assert(w == minDim);
-
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glEnable(GL_TEXTURE_2D);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 400, 400 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbvptest1.c b/progs/tests/arbvptest1.c
deleted file mode 100644
index 0ebd3987f58..00000000000
--- a/progs/tests/arbvptest1.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Test glGenProgramsARB(), glIsProgramARB(), glLoadProgramARB() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
-
- glBegin(GL_POLYGON);
- glVertexAttrib2fARB(0, -1, -1);
- glVertexAttrib2fARB(0, 1, -1);
- glVertexAttrib2fARB(0, 0, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-static void load_program(const char *prog, GLuint prognum)
-{
- int a;
- GLint errorpos, errno;
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog), (const GLubyte *) prog);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- for (a=-10; a<10; a++)
- {
- if ((errorpos+a < 0) || (errorpos+a >= strlen(prog))) continue;
- printf("%c", prog[errorpos+a]);
- }
- printf("\n");
- exit(1);
- }
-}
-
-static void Init( void )
-{
- GLuint prognum[4];
-
- static const char *prog1 =
- "!!ARBvp1.0\n"
- "TEMP R0;\n"
- "MUL result.color.primary.xyz, R0, program.local[35]; \n"
- "END\n";
- static const char *prog2 =
- "!!ARBvp1.0\n"
- "#\n"
- "# c[0-3] = modelview projection (composite) matrix\n"
- "# c[32] = normalized light direction in object-space\n"
- "# c[35] = yellow diffuse material, (1.0, 1.0, 0.0, 1.0)\n"
- "# c[64].x = 0.0\n"
- "# c[64].z = 0.125, a scaling factor\n"
- "TEMP R0, R1;\n"
- "#\n"
- "# outputs diffuse illumination for color and perturbed position\n"
- "#\n"
- "DP3 R0, program.local[32], vertex.normal; # light direction DOT normal\n"
- "MUL result.color.primary.xyz, R0, program.local[35]; \n"
- "MAX R0, program.local[64].x, R0; \n"
- "MUL R0, R0, vertex.normal; \n"
- "MUL R0, R0, program.local[64].z; \n"
- "ADD R1, vertex.position, -R0; # perturb object space position\n"
- "DP4 result.position.x, state.matrix.mvp.row[3], R1; \n"
- "DP4 result.position.y, state.matrix.mvp.row[1], R1; \n"
- "DP4 result.position.z, state.matrix.mvp.row[2], R1; \n"
- "DP4 result.position.w, state.matrix.mvp.row[3], R1; \n"
- "END\n";
- static const char *prog3 =
- "!!ARBvp1.0\n"
- "TEMP R0, R1, R2, R3;\n"
- "DP4 result.position.x, state.matrix.mvp.row[0], vertex.position;\n"
- "DP4 result.position.y, state.matrix.mvp.row[1], vertex.position;\n"
- "DP4 result.position.z, state.matrix.mvp.row[2], vertex.position;\n"
- "DP4 result.position.w, state.matrix.mvp.row[3], vertex.position;\n"
- "DP3 R0.x, state.matrix.modelview.inverse.row[0], vertex.normal;\n"
- "DP3 R0.y, state.matrix.modelview.inverse.row[1], vertex.normal;\n"
- "DP3 R0.z, state.matrix.modelview.inverse.row[2], vertex.normal;\n"
- "DP3 R1.x, program.env[32], R0; # R1.x = Lpos DOT n'\n"
- "DP3 R1.y, program.env[33], R0; # R1.y = hHat DOT n'\n"
- "MOV R1.w, program.local[38].x; # R1.w = specular power\n"
- "LIT R2, R1; # Compute lighting values\n"
- "MAD R3, program.env[35].x, R2.y, program.env[35].y; # diffuse + emissive\n"
- "MAD result.color.primary.xyz, program.env[36], R2.z, R3; # + specular\n"
- "END\n";
- static const char *prog4 =
- "!!ARBvp1.0\n"
- "TEMP R2, R3;\n"
- "PARAM foo = {0., 0., 0., 1.};\n"
- "PARAM blah[] = { program.local[0..8] };\n"
- "ADDRESS A0;\n"
- "ARL A0.x, foo.x;\n"
- "DP4 R2, R3, blah[A0.x].x;\n"
- "DP4 R2, R3, blah[A0.x + 5];\n"
- "DP4 result.position, R3, blah[A0.x - 4];\n"
- "END\n";
-
- glGenProgramsARB(4, prognum);
-
- load_program(prog1, prognum[0]);
- load_program(prog2, prognum[1]);
- load_program(prog3, prognum[2]);
- load_program(prog4, prognum[3]);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbvptest3.c b/progs/tests/arbvptest3.c
deleted file mode 100644
index 6437062900e..00000000000
--- a/progs/tests/arbvptest3.c
+++ /dev/null
@@ -1,127 +0,0 @@
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static float Zrot = 0.0;
-
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_VERTEX_PROGRAM_ARB);
-
- glLoadIdentity();
- glRotatef(Zrot, 0, 0, 1);
-
- glPushMatrix();
-
- glVertexAttrib3fARB(3, 1, 0.5, 0.25);
- glBegin(GL_TRIANGLES);
-#if 1
- glVertexAttrib3fARB(3, 1.0, 0.0, 0.0);
- glVertexAttrib2fARB(0, -0.5, -0.5);
- glVertexAttrib3fARB(3, 0.0, 1.0, 0.0);
- glVertexAttrib2fARB(0, 0.5, -0.5);
- glVertexAttrib3fARB(3, 0.0, 0.0, 1.0);
- glVertexAttrib2fARB(0, 0, 0.5);
-#else
- glVertex2f( -1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 0, 1);
-#endif
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- /* glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );*/
- glOrtho(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'z':
- Zrot -= 5.0;
- break;
- case 'Z':
- Zrot += 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
-
- static const char *prog1 =
- "!!ARBvp1.0\n"
- "MOV result.color, vertex.attrib[3];\n"
-
- "DP4 result.position.x, vertex.position, state.matrix.modelview.row[0];\n"
- "DP4 result.position.y, vertex.position, state.matrix.modelview.row[1];\n"
- "DP4 result.position.z, vertex.position, state.matrix.modelview.row[2];\n"
- "DP4 result.position.w, vertex.position, state.matrix.modelview.row[3];\n"
- "END\n";
-
- glGenProgramsARB(1, &prognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog1), (const GLubyte *) prog1);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbvptorus.c b/progs/tests/arbvptorus.c
deleted file mode 100644
index 9d19ef90da5..00000000000
--- a/progs/tests/arbvptorus.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * A lit, rotating torus via vertex program
- */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
-static GLboolean Anim = GL_TRUE;
-
-
-static void Idle( void )
-{
- Xrot += .3;
- Yrot += .4;
- Zrot += .2;
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
- glutSolidTorus(0.75, 2.0, 10, 20);
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -12.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case ' ':
- Xrot = Yrot = Zrot = 0;
- break;
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'z':
- Zrot -= 5.0;
- break;
- case 'Z':
- Zrot += 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
-
- /* borrowed from an nvidia demo:
- * c[0..3] = modelview matrix
- * c[4..7] = invtrans modelview matrix
- * c[32] = light pos
- * c[35] = diffuse color
- */
- static const char prog[] =
- "!!ARBvp1.0\n"
- "OPTION ARB_position_invariant ;"
- "TEMP R0, R1; \n"
-
- "# normal x MV-1T -> lighting normal\n"
- "DP3 R1.x, state.matrix.modelview.invtrans.row[0], vertex.normal ;\n"
- "DP3 R1.y, state.matrix.modelview.invtrans.row[1], vertex.normal;\n"
- "DP3 R1.z, state.matrix.modelview.invtrans.row[2], vertex.normal;\n"
-
- "DP3 R0, program.local[32], R1; # L.N\n"
-#if 0
- "MUL result.color.xyz, R0, program.local[35] ; # col = L.N * diffuse\n"
-#else
- "MUL result.color.primary.xyz, R0, program.local[35] ; # col = L.N * diffuse\n"
-#endif
- "MOV result.texcoord, vertex.texcoord;\n"
- "END";
-
- if (!glutExtensionSupported("GL_ARB_vertex_program")) {
- printf("Sorry, this program requires GL_ARB_vertex_program");
- exit(1);
- }
-
-
- glGenProgramsARB(1, &prognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog), (const GLubyte *) prog);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-
- /* Light position */
- glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 32, 2, 2, 4, 1);
- /* Diffuse material color */
- glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 35, 0.25, 0, 0.25, 1);
-
- glEnable(GL_VERTEX_PROGRAM_ARB);
- glEnable(GL_DEPTH_TEST);
- glClearColor(0.3, 0.3, 0.3, 1);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/arbvpwarpmesh.c b/progs/tests/arbvpwarpmesh.c
deleted file mode 100644
index 3dfe94f7596..00000000000
--- a/progs/tests/arbvpwarpmesh.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Warp a triangle mesh with a vertex program.
- */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
-static GLboolean Anim = GL_TRUE;
-static GLfloat Phi = 0.0;
-
-
-static void Idle( void )
-{
- Phi += 0.01;
- glutPostRedisplay();
-}
-
-
-static void DrawMesh( int rows, int cols )
-{
- static const GLfloat colorA[3] = { 0, 1, 0 };
- static const GLfloat colorB[3] = { 0, 0, 1 };
- const float dx = 2.0 / (cols - 1);
- const float dy = 2.0 / (rows - 1);
- float x, y;
- int i, j;
-
-#if 1
-#define COLOR3FV(c) glVertexAttrib3fvARB(3, c)
-#define VERTEX2F(x, y) glVertexAttrib2fARB(0, x, y)
-#else
-#define COLOR3FV(c) glColor3fv(c)
-#define VERTEX2F(x, y) glVertex2f(x, y)
-#endif
-
- y = -1.0;
- for (i = 0; i < rows - 1; i++) {
- glBegin(GL_QUAD_STRIP);
- x = -1.0;
- for (j = 0; j < cols; j++) {
- if ((i + j) & 1)
- COLOR3FV(colorA);
- else
- COLOR3FV(colorB);
- VERTEX2F(x, y);
- VERTEX2F(x, y + dy);
- x += dx;
- }
- glEnd();
- y += dy;
- }
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
-
- /* Position the gravity source */
- {
- GLfloat x, y, z, r = 0.5;
- x = r * cos(Phi);
- y = r * sin(Phi);
- z = 1.0;
- glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 30, x, y, z, 1);
- glDisable(GL_VERTEX_PROGRAM_ARB);
- glBegin(GL_POINTS);
- glColor3f(1,1,1);
- glVertex3f(x, y, z);
- glEnd();
- }
-
- glEnable(GL_VERTEX_PROGRAM_ARB);
- DrawMesh(8, 8);
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- float ar = (float) width / (float) height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0 * ar, 1.0 * ar, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -12.0 );
- glScalef(2, 2, 2);
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'p':
- Phi += 0.2;
- break;
- case 'z':
- Zrot -= 5.0;
- break;
- case 'Z':
- Zrot += 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- GLuint prognum;
- GLint errno;
-
- /*
- * c[0..3] = modelview matrix
- * c[4..7] = inverse modelview matrix
- * c[30] = gravity source location
- * c[31] = gravity source strength
- * c[32] = light pos
- * c[35] = diffuse color
- */
- static const char prog[] =
- "!!ARBvp1.0\n"
- "TEMP R1, R2, R3; "
-
- "# Compute distance from vertex to gravity source\n"
- "ADD R1, program.local[30], -vertex.position; # vector from vertex to gravity\n"
- "DP3 R2, R1, R1; # dot product\n"
- "RSQ R2, R2.x; # square root = distance\n"
- "MUL R2, R2, program.local[31].xxxx; # scale by the gravity factor\n"
-
- "# Displace vertex by gravity factor along R1 vector\n"
- "MAD R3, R1, R2, vertex.position;\n"
-
- "# Continue with typical modelview/projection\n"
- "DP4 result.position.x, state.matrix.mvp.row[0], R3 ; # object x MVP -> clip\n"
- "DP4 result.position.y, state.matrix.mvp.row[1], R3 ;\n"
- "DP4 result.position.z, state.matrix.mvp.row[2], R3 ;\n"
- "DP4 result.position.w, state.matrix.mvp.row[3], R3 ;\n"
-
- "MOV result.color, vertex.attrib[3];\n # copy input color to output color\n"
-
- "END";
-
- if (!glutExtensionSupported("GL_ARB_vertex_program")) {
- printf("Sorry, this program requires GL_ARB_vertex_program\n");
- exit(1);
- }
-
- glGenProgramsARB(1, &prognum);
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog), (const GLubyte *)prog);
- errno = glGetError();
- printf("glGetError = %d\n", errno);
-
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-
- /* Light position */
- glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 32, 2, 2, 4, 1);
- /* Diffuse material color */
- glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 35, 0.25, 0, 0.25, 1);
-
- /* Gravity strength */
- glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 31, .5, 0, 0, 0);
-
- glEnable(GL_DEPTH_TEST);
- glClearColor(0.3, 0.3, 0.3, 1);
- glShadeModel(GL_FLAT);
- glPointSize(3);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/auxbuffer.c b/progs/tests/auxbuffer.c
deleted file mode 100644
index 70f0b73910d..00000000000
--- a/progs/tests/auxbuffer.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * Test AUX buffer rendering
- * Use GLX since GLUT doesn't support AUX buffers
- */
-
-
-/*
- * 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.
- */
-
-/*
- * This is a port of the infamous "gears" demo to straight GLX (i.e. no GLUT)
- * Port by Brian Paul 23 March 2001
- *
- * Command line options:
- * -info print GL implementation information
- *
- */
-
-
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <X11/Xlib.h>
-#include <X11/keysym.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
-
-
-static int
-current_time(void)
-{
- return 0;
-}
-
-
-
-
-#ifndef M_PI
-#define M_PI 3.14159265
-#endif
-
-static int WinWidth = 300, WinHeight = 300;
-static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
-static GLint gear1, gear2, gear3;
-static GLfloat angle = 0.0;
-
-
-/*
- *
- * Draw a gear wheel. You'll probably want to call this function when
- * building a display list since we do a lot of trig here.
- *
- * Input: inner_radius - radius of hole at center
- * outer_radius - radius at center of teeth
- * width - width of gear
- * teeth - number of teeth
- * tooth_depth - depth of tooth
- */
-static void
-gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
- GLint teeth, GLfloat tooth_depth)
-{
- GLint i;
- GLfloat r0, r1, r2;
- GLfloat angle, da;
- GLfloat u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0;
- r2 = outer_radius + tooth_depth / 2.0;
-
- da = 2.0 * M_PI / teeth / 4.0;
-
- glShadeModel(GL_FLAT);
-
- glNormal3f(0.0, 0.0, 1.0);
-
- /* draw front face */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- if (i < teeth) {
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- width * 0.5);
- }
- }
- glEnd();
-
- /* draw front sides of teeth */
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- width * 0.5);
- }
- glEnd();
-
- glNormal3f(0.0, 0.0, -1.0);
-
- /* draw back face */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- if (i < teeth) {
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- }
- }
- glEnd();
-
- /* draw back sides of teeth */
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- -width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- -width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- }
- glEnd();
-
- /* draw outward faces of teeth */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- u = r2 * cos(angle + da) - r1 * cos(angle);
- v = r2 * sin(angle + da) - r1 * sin(angle);
- len = sqrt(u * u + v * v);
- u /= len;
- v /= len;
- glNormal3f(v, -u, 0.0);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
- -width * 0.5);
- u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
- v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
- glNormal3f(v, -u, 0.0);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
- -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- }
-
- glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
- glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
-
- glEnd();
-
- glShadeModel(GL_SMOOTH);
-
- /* draw inside radius cylinder */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glNormal3f(-cos(angle), -sin(angle), 0.0);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- }
- glEnd();
-}
-
-
-static void
-draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glPushMatrix();
- glRotatef(view_rotx, 1.0, 0.0, 0.0);
- glRotatef(view_roty, 0.0, 1.0, 0.0);
- glRotatef(view_rotz, 0.0, 0.0, 1.0);
-
- glPushMatrix();
- glTranslatef(-3.0, -2.0, 0.0);
- glRotatef(angle, 0.0, 0.0, 1.0);
- glCallList(gear1);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(3.1, -2.0, 0.0);
- glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
- glCallList(gear2);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(-3.1, 4.2, 0.0);
- glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
- glCallList(gear3);
- glPopMatrix();
-
- glPopMatrix();
-}
-
-
-/* new window size or exposure */
-static void
-reshape(int width, int height)
-{
- GLfloat h = (GLfloat) height / (GLfloat) width;
-
- WinWidth = width;
- WinHeight = height;
- glViewport(0, 0, (GLint) width, (GLint) height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -40.0);
-}
-
-
-static void
-init(void)
-{
- static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
- static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
- static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
- static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
- int i;
-
- glGetIntegerv(GL_AUX_BUFFERS, &i);
- printf("AUX BUFFERS: %d\n", i);
-
- glLightfv(GL_LIGHT0, GL_POSITION, pos);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = glGenLists(1);
- glNewList(gear1, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0, 4.0, 1.0, 20, 0.7);
- glEndList();
-
- gear2 = glGenLists(1);
- glNewList(gear2, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5, 2.0, 2.0, 10, 0.7);
- glEndList();
-
- gear3 = glGenLists(1);
- glNewList(gear3, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3, 2.0, 0.5, 10, 0.7);
- glEndList();
-
- glEnable(GL_NORMALIZE);
-}
-
-
-/*
- * Create an RGB, double-buffered window.
- * Return the window and context handles.
- */
-static void
-make_window( Display *dpy, const char *name,
- int x, int y, int width, int height,
- Window *winRet, GLXContext *ctxRet)
-{
- int attrib[] = { GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_DOUBLEBUFFER,
- GLX_DEPTH_SIZE, 1,
- GLX_AUX_BUFFERS, 1,
- None };
- int scrnum;
- XSetWindowAttributes attr;
- unsigned long mask;
- Window root;
- Window win;
- GLXContext ctx;
- XVisualInfo *visinfo;
-
- scrnum = DefaultScreen( dpy );
- root = RootWindow( dpy, scrnum );
-
- visinfo = glXChooseVisual( dpy, scrnum, attrib );
- if (!visinfo) {
- printf("Error: couldn't get an RGB, Double-buffered visual\n");
- exit(1);
- }
-
- /* window attributes */
- attr.background_pixel = 0;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
- attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
- mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
-
- win = XCreateWindow( dpy, root, 0, 0, width, height,
- 0, visinfo->depth, InputOutput,
- visinfo->visual, mask, &attr );
-
- /* set hints and properties */
- {
- XSizeHints sizehints;
- sizehints.x = x;
- sizehints.y = y;
- sizehints.width = width;
- sizehints.height = height;
- sizehints.flags = USSize | USPosition;
- XSetNormalHints(dpy, win, &sizehints);
- XSetStandardProperties(dpy, win, name, name,
- None, (char **)NULL, 0, &sizehints);
- }
-
- ctx = glXCreateContext( dpy, visinfo, NULL, True );
- if (!ctx) {
- printf("Error: glXCreateContext failed\n");
- exit(1);
- }
-
- XFree(visinfo);
-
- *winRet = win;
- *ctxRet = ctx;
-}
-
-
-static void
-event_loop(Display *dpy, Window win)
-{
- while (1) {
- while (XPending(dpy) > 0) {
- XEvent event;
- XNextEvent(dpy, &event);
- switch (event.type) {
- case Expose:
- /* we'll redraw below */
- break;
- case ConfigureNotify:
- reshape(event.xconfigure.width, event.xconfigure.height);
- break;
- case KeyPress:
- {
- char buffer[10];
- int r, code;
- code = XLookupKeysym(&event.xkey, 0);
- if (code == XK_Left) {
- view_roty += 5.0;
- }
- else if (code == XK_Right) {
- view_roty -= 5.0;
- }
- else if (code == XK_Up) {
- view_rotx += 5.0;
- }
- else if (code == XK_Down) {
- view_rotx -= 5.0;
- }
- else {
- r = XLookupString(&event.xkey, buffer, sizeof(buffer),
- NULL, NULL);
- if (buffer[0] == 27) {
- /* escape */
- return;
- }
- }
- }
- }
- }
-
- /* next frame */
- angle += 2.0;
-
- /* draw to aux buffer */
- glDrawBuffer(GL_AUX0);
-
- draw();
-
- /* Copy aux buffer image to back color buffer */
- glReadBuffer(GL_AUX0);
- glDrawBuffer(GL_BACK);
- glWindowPos2iARB(0, 0);
- glDisable(GL_DEPTH_TEST);
- glCopyPixels(0, 0, WinWidth, WinHeight, GL_COLOR);
- glEnable(GL_DEPTH_TEST);
-
- glXSwapBuffers(dpy, win);
-
- /* calc framerate */
- {
- static int t0 = -1;
- static int frames = 0;
- int t = current_time();
-
- if (t0 < 0)
- t0 = t;
-
- frames++;
-
- if (t - t0 >= 5.0) {
- GLfloat seconds = t - t0;
- GLfloat fps = frames / seconds;
- printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds,
- fps);
- t0 = t;
- frames = 0;
- }
- }
- }
-}
-
-
-int
-main(int argc, char *argv[])
-{
- Display *dpy;
- Window win;
- GLXContext ctx;
- char *dpyName = ":0";
- GLboolean printInfo = GL_FALSE;
- int i;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-display") == 0) {
- dpyName = argv[i+1];
- i++;
- }
- else if (strcmp(argv[i], "-info") == 0) {
- printInfo = GL_TRUE;
- }
- }
-
- dpy = XOpenDisplay(dpyName);
- if (!dpy) {
- printf("Error: couldn't open display %s\n", dpyName);
- return -1;
- }
-
- make_window(dpy, "glxgears", 0, 0, WinWidth, WinHeight, &win, &ctx);
- XMapWindow(dpy, win);
- glXMakeCurrent(dpy, win, ctx);
-
- if (printInfo) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-
- init();
-
- event_loop(dpy, win);
-
- glXDestroyContext(dpy, ctx);
- XDestroyWindow(dpy, win);
- XCloseDisplay(dpy);
-
- return 0;
-}
diff --git a/progs/tests/blendminmax.c b/progs/tests/blendminmax.c
deleted file mode 100644
index 2aab1a39d29..00000000000
--- a/progs/tests/blendminmax.c
+++ /dev/null
@@ -1,209 +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
- * 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 blendminmax.c
- *
- * Simple test of GL_EXT_blend_minmax functionality. Four squares are drawn
- * with different blending modes, but all should be rendered with the same
- * final color.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-static int Width = 400;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
-
- /* This is the "reference" square.
- */
-
- glTranslatef(-4.5, 0, 0);
- glBlendEquation( GL_FUNC_ADD );
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- /* GL_MIN and GL_MAX are supposed to ignore the blend function setting.
- * To test that, we set the blend function to GL_ZERO for both color and
- * alpha each time GL_MIN or GL_MAX is used.
- *
- * Apple ships an extension called GL_ATI_blend_weighted_minmax (supported
- * on Mac OS X 10.2 and later). I believe the difference with that
- * extension is that it uses the blend function. However, I have no idea
- * what the enums are for it. The extension is listed at Apple's developer
- * site, but there is no documentation.
- *
- * http://developer.apple.com/opengl/extensions.html
- */
-
- glTranslatef(3.0, 0, 0);
- glBlendEquation( GL_FUNC_ADD );
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glBlendEquation( GL_MAX );
- glBlendFunc( GL_ZERO, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.2, 0.2, 0.2 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- glTranslatef(3.0, 0, 0);
- glBlendEquation( GL_FUNC_ADD );
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glBlendEquation( GL_MIN );
- glBlendFunc( GL_ZERO, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.8, 0.8, 0.8 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- glTranslatef(3.0, 0, 0);
- glBlendEquation( GL_FUNC_ADD );
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.8, 0.8, 0.8 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glBlendEquation( GL_MIN );
- glBlendFunc( GL_ZERO, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- if ( !glutExtensionSupported("GL_ARB_imaging") && !glutExtensionSupported("GL_EXT_blend_minmax")) {
- printf("Sorry, this program requires either GL_ARB_imaging or GL_EXT_blend_minmax.\n");
- exit(1);
- }
-
- printf("\nAll 4 squares should be the same color.\n");
- glEnable( GL_BLEND );
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "GL_EXT_blend_minmax test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/blendsquare.c b/progs/tests/blendsquare.c
deleted file mode 100644
index 1694866a557..00000000000
--- a/progs/tests/blendsquare.c
+++ /dev/null
@@ -1,178 +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
- * 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 blendsquare.c
- *
- * Simple test of GL_NV_blend_square functionality. Four squares are drawn
- * with different blending modes, but all should be rendered with the same
- * final color.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-static int Width = 400;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
-
- glTranslatef(-4.5, 0, 0);
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.5 * 0.5, 0.5 * 0.5, 0.5 * 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- glTranslatef(3.0, 0, 0);
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glBlendFunc( GL_DST_COLOR, GL_ZERO );
- glBegin(GL_QUADS);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- glTranslatef(3.0, 0, 0);
- glBlendFunc( GL_SRC_COLOR, GL_ZERO );
- glBegin(GL_QUADS);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- glTranslatef(3.0, 0, 0);
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glBlendFunc( GL_ZERO, GL_DST_COLOR );
- glBegin(GL_QUADS);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
- const double version = strtod( ver_string, NULL );
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- if ( (version < 1.4) && !glutExtensionSupported("GL_NV_blend_square")) {
- printf("Sorry, this program requires either OpenGL 1.4 or GL_NV_blend_square\n");
- exit(1);
- }
-
- printf("\nAll 4 squares should be the same color. The two on the left are drawn\n"
- "without NV_blend_square functionality, and the two on the right are drawn\n"
- "with NV_blend_square functionality. If the two on the left are dark, but\n"
- "the two on the right are not, then NV_blend_square is broken.\n");
- glEnable( GL_BLEND );
- glBlendEquation( GL_FUNC_ADD );
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "GL_NV_blend_square test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/bufferobj.c b/progs/tests/bufferobj.c
deleted file mode 100644
index 50ab5cdfa89..00000000000
--- a/progs/tests/bufferobj.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Test GL_ARB_vertex_buffer_object
- *
- * Brian Paul
- * 16 Sep 2003
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-#define NUM_OBJECTS 10
-
-struct object
-{
- GLuint BufferID;
- GLuint ElementsBufferID;
- GLuint NumVerts;
- GLuint VertexOffset;
- GLuint ColorOffset;
- GLuint NumElements;
-};
-
-static struct object Objects[NUM_OBJECTS];
-static GLuint NumObjects;
-
-static GLuint Win;
-
-static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
-static GLboolean Anim = GL_TRUE;
-
-
-static void CheckError(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("GL Error 0x%x at line %d\n", (int) err, line);
- }
-}
-
-
-static void DrawObject( const struct object *obj )
-{
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
- glVertexPointer(3, GL_FLOAT, 0, (void *) obj->VertexOffset);
- glEnable(GL_VERTEX_ARRAY);
-
- /* test push/pop attrib */
- /* XXX this leads to a segfault with NVIDIA's 53.36 driver */
-#if 0
- if (1)
- {
- glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
- /*glVertexPointer(3, GL_FLOAT, 0, (void *) (obj->VertexOffset + 10000));*/
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, 999999);
- glPopClientAttrib();
- }
-#endif
- glColorPointer(3, GL_FLOAT, 0, (void *) obj->ColorOffset);
- glEnable(GL_COLOR_ARRAY);
-
- if (obj->NumElements > 0) {
- /* indexed arrays */
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, obj->ElementsBufferID);
- glDrawElements(GL_LINE_LOOP, obj->NumElements, GL_UNSIGNED_INT, NULL);
- }
- else {
- /* non-indexed arrays */
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
- glDrawArrays(GL_LINE_LOOP, 0, obj->NumVerts);
- }
-}
-
-
-static void Idle( void )
-{
- Zrot = 0.05 * glutGet(GLUT_ELAPSED_TIME);
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- int i;
-
- glClear( GL_COLOR_BUFFER_BIT );
-
- for (i = 0; i < NumObjects; i++) {
- float x = 5.0 * ((float) i / (NumObjects-1) - 0.5);
- glPushMatrix();
- glTranslatef(x, 0, 0);
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
-
- DrawObject(Objects + i);
-
- glPopMatrix();
- }
-
- CheckError(__LINE__);
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- float ar = (float) width / (float) height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void FreeBuffers(void)
-{
- int i;
- for (i = 0; i < NUM_OBJECTS; i++)
- glDeleteBuffersARB(1, &Objects[i].BufferID);
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'z':
- Zrot -= step;
- break;
- case 'Z':
- Zrot += step;
- break;
- case 27:
- FreeBuffers();
- glutDestroyWindow(Win);
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-static void MakeObject1(struct object *obj)
-{
- GLfloat *v, *c;
- void *p;
- int i;
- GLubyte buffer[500];
-
- for (i = 0; i < 500; i++)
- buffer[i] = i & 0xff;
-
- obj->BufferID = 0;
- glGenBuffersARB(1, &obj->BufferID);
- assert(obj->BufferID != 0);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, 500, buffer, GL_STATIC_DRAW_ARB);
-
- for (i = 0; i < 500; i++)
- buffer[i] = 0;
-
- glGetBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, 500, buffer);
-
- for (i = 0; i < 500; i++)
- assert(buffer[i] == (i & 0xff));
-
- glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i);
- assert(!i);
-
- glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_USAGE_ARB, &i);
-
- v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
-
- /* do some sanity tests */
- glGetBufferPointervARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAP_POINTER_ARB, &p);
- assert(p == v);
-
- glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &i);
- assert(i == 500);
-
- glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_USAGE_ARB, &i);
- assert(i == GL_STATIC_DRAW_ARB);
-
- glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_ACCESS_ARB, &i);
- assert(i == GL_WRITE_ONLY_ARB);
-
- glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i);
- assert(i);
-
- /* Make rectangle */
- v[0] = -1; v[1] = -1; v[2] = 0;
- v[3] = 1; v[4] = -1; v[5] = 0;
- v[6] = 1; v[7] = 1; v[8] = 0;
- v[9] = -1; v[10] = 1; v[11] = 0;
- c = v + 12;
- c[0] = 1; c[1] = 0; c[2] = 0;
- c[3] = 1; c[4] = 0; c[5] = 0;
- c[6] = 1; c[7] = 0; c[8] = 1;
- c[9] = 1; c[10] = 0; c[11] = 1;
- obj->NumVerts = 4;
- obj->VertexOffset = 0;
- obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts;
- obj->NumElements = 0;
-
- glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
-
- glGetBufferPointervARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAP_POINTER_ARB, &p);
- assert(!p);
-
- glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i);
- assert(!i);
-}
-
-
-static void MakeObject2(struct object *obj)
-{
- GLfloat *v, *c;
-
- glGenBuffersARB(1, &obj->BufferID);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, NULL, GL_STATIC_DRAW_ARB);
- v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
-
- /* Make triangle */
- v[0] = -1; v[1] = -1; v[2] = 0;
- v[3] = 1; v[4] = -1; v[5] = 0;
- v[6] = 0; v[7] = 1; v[8] = 0;
- c = v + 9;
- c[0] = 0; c[1] = 1; c[2] = 0;
- c[3] = 0; c[4] = 1; c[5] = 0;
- c[6] = 1; c[7] = 1; c[8] = 0;
- obj->NumVerts = 3;
- obj->VertexOffset = 0;
- obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts;
- obj->NumElements = 0;
-
- glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
-}
-
-
-static void MakeObject3(struct object *obj)
-{
- GLfloat vertexData[1000];
- GLfloat *v, *c;
- GLuint *i;
- int bytes;
-
- /* Make rectangle */
- v = vertexData;
- v[0] = -1; v[1] = -0.5; v[2] = 0;
- v[3] = 1; v[4] = -0.5; v[5] = 0;
- v[6] = 1; v[7] = 0.5; v[8] = 0;
- v[9] = -1; v[10] = 0.5; v[11] = 0;
- c = vertexData + 12;
- c[0] = 0; c[1] = 0; c[2] = 1;
- c[3] = 0; c[4] = 0; c[5] = 1;
- c[6] = 0; c[7] = 1; c[8] = 1;
- c[9] = 0; c[10] = 1; c[11] = 1;
- obj->NumVerts = 4;
- obj->VertexOffset = 0;
- obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts;
-
- bytes = obj->NumVerts * (3 + 3) * sizeof(GLfloat);
-
- /* Don't use glMap/UnmapBuffer for this object */
- glGenBuffersARB(1, &obj->BufferID);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, bytes, vertexData, GL_STATIC_DRAW_ARB);
-
- /* Setup a buffer of indices to test the ELEMENTS path */
- glGenBuffersARB(1, &obj->ElementsBufferID);
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, obj->ElementsBufferID);
- glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 100, NULL, GL_STATIC_DRAW_ARB);
- i = (GLuint *) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_READ_WRITE_ARB);
- i[0] = 0;
- i[1] = 1;
- i[2] = 2;
- i[3] = 3;
- glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB);
- obj->NumElements = 4;
-}
-
-
-
-static void Init( void )
-{
- if (!glutExtensionSupported("GL_ARB_vertex_buffer_object")) {
- printf("GL_ARB_vertex_buffer_object not found!\n");
- exit(0);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Test buffer object deletion */
- if (1) {
- static GLubyte data[1000];
- GLuint id = 999;
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, id);
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, data, GL_STATIC_DRAW_ARB);
- glVertexPointer(3, GL_FLOAT, 0, (void *) 0);
- glDeleteBuffersARB(1, &id);
- assert(!glIsBufferARB(id));
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
- glVertexPointer(3, GL_FLOAT, 0, (void *) 0);
- assert(!glIsBufferARB(id));
- }
-
- MakeObject1(Objects + 0);
- MakeObject2(Objects + 1);
- MakeObject3(Objects + 2);
- NumObjects = 3;
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 600, 300 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- Win = glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/bug_3050.c b/progs/tests/bug_3050.c
deleted file mode 100644
index 4ea7b80f231..00000000000
--- a/progs/tests/bug_3050.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2006
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * 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 bug_3050.c
- *
- * Simple regression test for bug #3050. Create a texture and make a few
- * calls to \c glGetTexLevelParameteriv. If the bug still exists, trying
- * to get \c GL_TEXTURE_WITDH will cause a protocol error.
- *
- * This test \b only applies to indirect-rendering. This may mean that the
- * test needs to be run with the environment variable \c LIBGL_ALWAYS_INDIRECT
- * set to a non-zero value.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <GL/glut.h>
-
-static int Width = 400;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
-}
-
-
-static void Reshape( int width, int height )
-{
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- unsigned i;
- static const GLenum pnames[] = {
- GL_TEXTURE_RED_SIZE,
- GL_TEXTURE_GREEN_SIZE,
- GL_TEXTURE_BLUE_SIZE,
- GL_TEXTURE_ALPHA_SIZE,
- GL_TEXTURE_LUMINANCE_SIZE,
- GL_TEXTURE_INTENSITY_SIZE,
- GL_TEXTURE_BORDER,
- GL_TEXTURE_INTERNAL_FORMAT,
- GL_TEXTURE_WIDTH,
- GL_TEXTURE_HEIGHT,
- GL_TEXTURE_DEPTH,
- ~0
- };
-
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
-
- printf("\nThis program should log some data about a texture and exit.\n");
- printf("This is a regression test for bug #3050. If the bug still\n");
- printf("exists, a GLX protocol error will be generated.\n");
- printf("https://bugs.freedesktop.org/show_bug.cgi?id=3050\n\n");
-
-
- if ( ! glutExtensionSupported( "GL_NV_texture_rectangle" )
- && ! glutExtensionSupported( "GL_EXT_texture_rectangle" )
- && ! glutExtensionSupported( "GL_ARB_texture_rectangle" ) ) {
- printf( "This test requires one of GL_ARB_texture_rectangle, GL_EXT_texture_rectangle,\n"
- "or GL_NV_texture_rectangle be supported\n." );
- exit( 1 );
- }
-
-
- glBindTexture( GL_TEXTURE_RECTANGLE_NV, 1 );
- glTexImage2D( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, GL_RGBA, 8, 8, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL );
-
- for ( i = 0 ; pnames[i] != ~0 ; i++ ) {
- GLint param_i;
- GLfloat param_f;
- GLenum err;
-
- glGetTexLevelParameteriv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_i );
- err = glGetError();
-
- if ( err ) {
- printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
- "error of 0x%04x!",
- pnames[i], err );
- exit( 1 );
- }
- else {
- printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = 0x%04x\n",
- pnames[i], param_i );
- }
-
-
- glGetTexLevelParameterfv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_f );
- err = glGetError();
-
- if ( err ) {
- printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
- "error of 0x%04x!\n",
- pnames[i], err );
- exit( 1 );
- }
- else {
- printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = %.1f (0x%04x)\n",
- pnames[i], param_f, (GLint) param_f );
- }
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "Bug #3050 Test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- return 0;
-}
diff --git a/progs/tests/bug_3101.c b/progs/tests/bug_3101.c
deleted file mode 100644
index 761dcbb9513..00000000000
--- a/progs/tests/bug_3101.c
+++ /dev/null
@@ -1,128 +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
- * 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 bug_3101.c
- *
- * Simple regression test for bug #3101. Attempt to draw a single square.
- * After emiting the first vertex, call \c glEdgeFlag to change the vertex
- * format. If the bug still exists, this will cause a segfault.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-static int Width = 400;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
-
- /* This is the "reference" square.
- */
-
- glTranslatef(-4.5, 0, 0);
- glBlendEquation( GL_FUNC_ADD );
- glBlendFunc( GL_ONE, GL_ZERO );
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glEdgeFlag(GL_TRUE);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- printf("\nThis program should draw a single square, but not crash.\n");
- printf("This is a regression test for bug #3101.\n");
- printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n");
- glEnable( GL_BLEND );
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "Bug #3101 Test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/bug_3195.c b/progs/tests/bug_3195.c
deleted file mode 100644
index 4aceae04abe..00000000000
--- a/progs/tests/bug_3195.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 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.
- */
-
-/**
- * \file bug_3195.c
- *
- * Simple regression test for bug #3195. A bug in the i180 driver caused
- * a segfault (inside the driver) when the LOD bias is adjusted and no texture
- * is enabled. This test, which is based on progs/demos/lodbias.c, sets up
- * all the texturing, disables all textures, adjusts the LOD bias, then
- * re-enables \c GL_TEXTURE_2D.
- *
- * \author Brian Paul
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <GL/glut.h>
-#include <GL/glext.h>
-
-#include "readtex.h"
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-static GLfloat Xrot = 0, Yrot = -30, Zrot = 0;
-static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
-static GLint BiasMin = -400, BiasMax = 400;
-
-
-
-static void
-PrintString(const char *s)
-{
- while (*s) {
- glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
- s++;
- }
-}
-
-static void Idle( void )
-{
- static int lastTime = 0;
- int time = glutGet(GLUT_ELAPSED_TIME);
- int step;
-
- if (lastTime == 0)
- lastTime = time;
- else if (time - lastTime < 10)
- return;
-
- step = (time - lastTime) / 10 * BiasStepSign;
- lastTime = time;
-
- Bias += step;
- if (Bias < BiasMin) {
- exit(0);
- }
- else if (Bias > BiasMax) {
- Bias = BiasMax;
- BiasStepSign = -1;
- }
-
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- char str[100];
-
- glClear( GL_COLOR_BUFFER_BIT );
-
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-1, 1, -1, 1, -1, 1);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-
- glDisable(GL_TEXTURE_2D);
- glColor3f(1,1,1);
- glRasterPos3f(-0.9, -0.9, 0.0);
- sprintf(str, "Texture LOD Bias = %4.1f", Bias * 0.01);
- PrintString(str);
-
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -8.0 );
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
-
- glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0.01 * Bias);
- glEnable(GL_TEXTURE_2D);
-
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex2f(-1, -1);
- glTexCoord2f(2, 0); glVertex2f( 1, -1);
- glTexCoord2f(2, 2); glVertex2f( 1, 1);
- glTexCoord2f(0, 2); glVertex2f(-1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- GLfloat maxBias;
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- printf("\nThis program should function nearly identically to Mesa's lodbias demo.\n"
- "It should cycle through the complet LOD bias range once and exit. If bug\n"
- "#3195 still exists, the demo should crash almost immediatly.\n");
- printf("This is a regression test for bug #3195.\n");
- printf("https://bugs.freedesktop.org/show_bug.cgi?id=3195\n");
-
- if (!glutExtensionSupported("GL_EXT_texture_lod_bias")) {
- printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");
- exit(1);
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- if (glutExtensionSupported("GL_SGIS_generate_mipmap")) {
- /* test auto mipmap generation */
- GLint width, height, i;
- GLenum format;
- GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
- if (!image) {
- printf("Error: could not load texture image %s\n", TEXTURE_FILE);
- exit(1);
- }
- /* resize to 256 x 256 */
- if (width != 256 || height != 256) {
- GLubyte *newImage = malloc(256 * 256 * 4);
- gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
- 256, 256, GL_UNSIGNED_BYTE, newImage);
- free(image);
- image = newImage;
- }
- printf("Using GL_SGIS_generate_mipmap\n");
- glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
- glTexImage2D(GL_TEXTURE_2D, 0, format, 256, 256, 0,
- format, GL_UNSIGNED_BYTE, image);
- free(image);
-
- /* make sure mipmap was really generated correctly */
- width = height = 256;
- for (i = 0; i < 9; i++) {
- GLint w, h;
- glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
- printf("Level %d size: %d x %d\n", i, w, h);
- assert(w == width);
- assert(h == height);
- width /= 2;
- height /= 2;
- }
-
- }
- else if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: could not load texture image %s\n", TEXTURE_FILE);
- exit(1);
- }
-
- /* mipmapping required for this extension */
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias);
- printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias);
- BiasMin = -100 * maxBias;
- BiasMax = 100 * maxBias;
-
- /* Since we have (about) 8 mipmap levels, no need to bias beyond
- * the range [-1, +8].
- */
- if (BiasMin < -100)
- BiasMin = -100;
- if (BiasMax > 800)
- BiasMax = 800;
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 350, 350 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "Bug #3195 Test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/copypixrate.c b/progs/tests/copypixrate.c
deleted file mode 100644
index e9a42a1c8c9..00000000000
--- a/progs/tests/copypixrate.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Measure glCopyPixels speed
- *
- * Brian Paul
- * 26 Jan 2006
- */
-
-#define GL_GLEXT_PROTOTYPES
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <GL/glut.h>
-
-static GLint WinWidth = 1000, WinHeight = 800;
-static GLint ImgWidth, ImgHeight;
-
-static GLenum Buffer = GL_FRONT;
-static GLenum AlphaTest = GL_FALSE;
-static GLboolean UseBlit = GL_FALSE;
-
-static PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT_func = NULL;
-
-
-/**
- * draw teapot in lower-left corner of window
- */
-static void
-DrawTestImage(void)
-{
- GLfloat ar;
-
- ImgWidth = WinWidth / 3;
- ImgHeight = WinHeight / 3;
-
- glViewport(0, 0, ImgWidth, ImgHeight);
- glScissor(0, 0, ImgWidth, ImgHeight);
- glEnable(GL_SCISSOR_TEST);
-
- glClearColor(0.5, 0.5, 0.5, 0.0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- ar = (float) WinWidth / WinHeight;
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
- glMatrixMode(GL_MODELVIEW);
-
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
- glFrontFace(GL_CW);
- glPushMatrix();
- glRotatef(45, 1, 0, 0);
- glutSolidTeapot(2.0);
- glPopMatrix();
- glFrontFace(GL_CCW);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_LIGHTING);
-
- glDisable(GL_SCISSOR_TEST);
-
- glViewport(0, 0, WinWidth, WinHeight);
- glFinish();
-}
-
-
-static int
-Rand(int max)
-{
- return ((int) random()) % max;
-}
-
-
-/**
- * Measure glCopyPixels rate
- */
-static void
-RunTest(void)
-{
- double t1, t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
- int iters = 0;
- float copyRate, mbRate;
- int r, g, b, a, bpp;
-
- if (AlphaTest) {
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_GREATER, 0.0);
- }
-
- glGetIntegerv(GL_RED_BITS, &r);
- glGetIntegerv(GL_GREEN_BITS, &g);
- glGetIntegerv(GL_BLUE_BITS, &b);
- glGetIntegerv(GL_ALPHA_BITS, &a);
- bpp = (r + g + b + a) / 8;
-
- do {
- int x, y;
- x = Rand(WinWidth);
- y = Rand(WinHeight);
-
- if (x > ImgWidth || y > ImgHeight) {
-#ifdef GL_EXT_framebuffer_blit
- if (UseBlit)
- {
- glBlitFramebufferEXT_func(0, 0, ImgWidth, ImgHeight,
- x, y, x + ImgWidth, y + ImgHeight,
- GL_COLOR_BUFFER_BIT, GL_LINEAR);
- }
- else
-#endif
- {
- glWindowPos2iARB(x, y);
- glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
- }
- glFinish(); /* XXX OK? */
-
- iters++;
-
- t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
- }
- } while (t1 - t0 < 5.0);
-
- glDisable(GL_ALPHA_TEST);
-
- copyRate = iters / (t1 - t0);
- mbRate = ImgWidth * ImgHeight * bpp * copyRate / (1024 * 1024);
-
- printf("Image size: %d x %d, %d Bpp\n", ImgWidth, ImgHeight, bpp);
- printf("%d copies in %.2f = %.2f copies/sec, %.2f MB/s\n",
- iters, t1-t0, copyRate, mbRate);
-}
-
-
-static void
-Draw(void)
-{
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClearColor(0.2, 0.2, 0.8, 0);
- glReadBuffer(Buffer);
- glDrawBuffer(Buffer);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- DrawTestImage();
-
- RunTest();
-
- if (Buffer == GL_FRONT)
- glFinish();
- else
- glutSwapBuffers();
-
- printf("exiting\n");
- exit(0);
-}
-
-
-static void
-Reshape(int width, int height)
-{
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -15.0);
-}
-
-
-static void
-Key(unsigned char key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-SpecialKey(int key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- break;
- case GLUT_KEY_DOWN:
- break;
- case GLUT_KEY_LEFT:
- break;
- case GLUT_KEY_RIGHT:
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-ParseArgs(int argc, char *argv[])
-{
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-back") == 0)
- Buffer = GL_BACK;
- else if (strcmp(argv[i], "-alpha") == 0)
- AlphaTest = GL_TRUE;
- else if (strcmp(argv[i], "-blit") == 0)
- UseBlit = GL_TRUE;
- }
-}
-
-
-static void
-Init(void)
-{
- if (glutExtensionSupported("GL_EXT_framebuffer_blit")) {
- glBlitFramebufferEXT_func = (PFNGLBLITFRAMEBUFFEREXTPROC)
- glutGetProcAddress("glBlitFramebufferEXT");
- }
- else if (UseBlit) {
- printf("Warning: GL_EXT_framebuffer_blit not supported.\n");
- UseBlit = GL_FALSE;
- }
-}
-
-
-int
-main(int argc, char *argv[])
-{
- GLint mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH;
- glutInit(&argc, argv);
-
- ParseArgs(argc, argv);
- if (AlphaTest)
- mode |= GLUT_ALPHA;
-
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(WinWidth, WinHeight);
- glutInitDisplayMode(mode);
- glutCreateWindow(argv[0]);
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutSpecialFunc(SpecialKey);
- glutDisplayFunc(Draw);
-
- printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
- printf("Draw Buffer: %s\n", (Buffer == GL_BACK) ? "Back" : "Front");
- Init();
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/crossbar.c b/progs/tests/crossbar.c
deleted file mode 100644
index 12aabb1c9ad..00000000000
--- a/progs/tests/crossbar.c
+++ /dev/null
@@ -1,235 +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
- * 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 crossbar.c
- *
- * Simple test of GL_ARB_texture_env_crossbar functionality. Several squares
- * are drawn with different texture combine modes, but all should be rendered
- * with the same final color.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <GL/glut.h>
-
-static const GLint tests[][8] = {
- { 1, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR,
- 2, GL_REPLACE, GL_TEXTURE, GL_PRIMARY_COLOR },
- { 3, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR,
- 2, GL_SUBTRACT, GL_TEXTURE0, GL_TEXTURE1 },
- { 2, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR,
- 2, GL_REPLACE, GL_TEXTURE0, GL_TEXTURE0 },
- { 2, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR,
- 1, GL_SUBTRACT, GL_TEXTURE0, GL_TEXTURE1 },
- { 3, GL_ADD, GL_TEXTURE1, GL_TEXTURE1,
- 2, GL_MODULATE, GL_TEXTURE1, GL_PREVIOUS },
- { 3, GL_ADD, GL_TEXTURE1, GL_TEXTURE1,
- 4, GL_MODULATE, GL_TEXTURE0, GL_PREVIOUS },
-};
-
-#define NUM_TESTS (sizeof(tests) / sizeof(tests[0]))
-
-static int Width = 100 * (NUM_TESTS + 1);
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
- unsigned i;
-
-
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
-
- /* This is the "reference" square.
- */
-
- glActiveTexture( GL_TEXTURE0 );
- glDisable( GL_TEXTURE_2D );
- glActiveTexture( GL_TEXTURE1 );
- glDisable( GL_TEXTURE_2D );
-
- glTranslatef(-(NUM_TESTS * 1.5), 0, 0);
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
- for ( i = 0 ; i < NUM_TESTS ; i++ ) {
- glActiveTexture( GL_TEXTURE0 );
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, tests[i][0] );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, tests[i][1] );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, tests[i][2] );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, tests[i][3] );
-
- glActiveTexture( GL_TEXTURE1 );
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, tests[i][4] );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
- glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, tests[i][5] );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, tests[i][6] );
- glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, tests[i][7] );
-
- glCallList(1);
- }
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
- float ver = strtof( ver_string, NULL );
- GLint tex_units;
- GLint temp[ 256 ];
-
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- if ( (!glutExtensionSupported("GL_ARB_multitexture")
- && (ver < 1.3))
- || (!glutExtensionSupported("GL_ARB_texture_env_combine")
- && !glutExtensionSupported("GL_EXT_texture_env_combine")
- && (ver < 1.3))
- || (!glutExtensionSupported("GL_ARB_texture_env_crossbar")
- && !glutExtensionSupported("GL_NV_texture_env_combine4")
- && (ver < 1.4)) ) {
- printf("\nSorry, this program requires GL_ARB_multitexture and either\n"
- "GL_ARB_texture_env_combine or GL_EXT_texture_env_combine (or OpenGL 1.3).\n"
- "Either GL_ARB_texture_env_crossbar or GL_NV_texture_env_combine4 (or\n"
- "OpenGL 1.4) are also required.\n");
- exit(1);
- }
-
- glGetIntegerv( GL_MAX_TEXTURE_UNITS, & tex_units );
- if ( tex_units < 2 ) {
- printf("\nSorry, this program requires at least 2 texture units.\n");
- exit(1);
- }
-
- printf("\nAll %u squares should be the same color.\n", NUM_TESTS + 1);
-
- (void) memset( temp, 0x00, sizeof( temp ) );
- glBindTexture( GL_TEXTURE_2D, 1 );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, temp );
-
- (void) memset( temp, 0x7f, sizeof( temp ) );
- glBindTexture( GL_TEXTURE_2D, 2 );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, temp );
-
- (void) memset( temp, 0xff, sizeof( temp ) );
- glBindTexture( GL_TEXTURE_2D, 3 );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, temp );
-
- (void) memset( temp, 0x3f, sizeof( temp ) );
- glBindTexture( GL_TEXTURE_2D, 4 );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, temp );
-
-
- glNewList( 1, GL_COMPILE );
- glTranslatef(3.0, 0, 0);
- glBegin(GL_QUADS);
- glColor3f( 0.9, 0.0, 0.0 );
- glMultiTexCoord2f( GL_TEXTURE0, 0.5, 0.5 );
- glMultiTexCoord2f( GL_TEXTURE1, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
- glEndList();
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "GL_ARB_texture_env_crossbar test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/cva.c b/progs/tests/cva.c
deleted file mode 100644
index 3f7960f53b6..00000000000
--- a/progs/tests/cva.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* $Id: cva.c,v 1.7 2003/12/08 09:03:35 joukj Exp $ */
-
-/*
- * Trivial CVA test, good for testing driver fastpaths (especially
- * indexed vertex buffers if they are supported).
- *
- * Gareth Hughes
- * November 2000
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef __VMS
-# include <stddef.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
-#else
-# include <malloc.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
-#endif
-#ifdef _WIN32
-#include <windows.h>
-#endif
-#define GL_GLEXT_LEGACY
-#include <GL/glut.h>
-
-
-GLfloat verts[][4] = {
- { -0.5, -0.5, -2.0, 0.0 },
- { 0.5, -0.5, -2.0, 0.0 },
- { -0.5, 0.5, -2.0, 0.0 },
- { 0.5, 0.5, -2.0, 0.0 },
-};
-
-GLubyte color[][4] = {
- { 0xff, 0x00, 0x00, 0x00 },
- { 0x00, 0xff, 0x00, 0x00 },
- { 0x00, 0x00, 0xff, 0x00 },
- { 0xff, 0xff, 0xff, 0x00 },
-};
-
-GLuint indices[] = { 0, 1, 2, 3 };
-
-GLboolean compiled = GL_TRUE;
-GLboolean doubleBuffer = GL_TRUE;
-
-
-void init( void )
-{
- glClearColor( 0.0, 0.0, 0.0, 0.0 );
- glShadeModel( GL_SMOOTH );
-
- glFrontFace( GL_CCW );
- glCullFace( GL_BACK );
- glEnable( GL_CULL_FACE );
-
- glEnable( GL_DEPTH_TEST );
-
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_COLOR_ARRAY );
-
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 2.0, 10.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-
- glVertexPointer( 3, GL_FLOAT, sizeof(verts[0]), verts );
- glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color );
-
-#ifdef GL_EXT_compiled_vertex_array
- if ( compiled ) {
- glLockArraysEXT( 0, 4 );
- }
-#endif
-}
-
-void display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glDrawElements( GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices );
-
- glFlush();
- if ( doubleBuffer ) {
- glutSwapBuffers();
- }
-}
-
-void keyboard( unsigned char key, int x, int y )
-{
- switch ( key ) {
- case 27:
- exit( 0 );
- break;
- }
-
- glutPostRedisplay();
-}
-
-GLboolean args( int argc, char **argv )
-{
- GLint i;
-
- doubleBuffer = GL_TRUE;
-
- for ( i = 1 ; i < argc ; i++ ) {
- if ( strcmp( argv[i], "-sb" ) == 0 ) {
- doubleBuffer = GL_FALSE;
- } else if ( strcmp( argv[i], "-db" ) == 0 ) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf( stderr, "%s (Bad option).\n", argv[i] );
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main( int argc, char **argv )
-{
- GLenum type;
- char *string;
-
- glutInit( &argc, argv );
-
- if ( args( argc, argv ) == GL_FALSE ) {
- exit( 1 );
- }
-
- type = GLUT_RGB | GLUT_DEPTH;
- type |= ( doubleBuffer ) ? GLUT_DOUBLE : GLUT_SINGLE;
-
- glutInitDisplayMode( type );
- glutInitWindowSize( 250, 250 );
- glutInitWindowPosition( 100, 100 );
- glutCreateWindow( "CVA Test" );
-
- /* Make sure the server supports GL 1.2 vertex arrays.
- */
- string = (char *) glGetString( GL_VERSION );
-
- if ( !strstr(string, "1.2") &&
- !strstr(string, "1.3") &&
- !strstr(string, "1.4")) {
- fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" );
- exit( -1 );
- }
-
- /* See if the server supports compiled vertex arrays.
- */
- string = (char *) glGetString( GL_EXTENSIONS );
-
- if ( !strstr( string, "GL_EXT_compiled_vertex_array" ) ) {
- fprintf( stderr, "Compiled vertex arrays not supported by this renderer.\n" );
- compiled = GL_FALSE;
- }
-
- init();
-
- glutDisplayFunc( display );
- glutKeyboardFunc( keyboard );
- glutMainLoop();
-
- return 0;
-}
diff --git a/progs/tests/debugger.c b/progs/tests/debugger.c
deleted file mode 100644
index 4c6955bcfc6..00000000000
--- a/progs/tests/debugger.c
+++ /dev/null
@@ -1,733 +0,0 @@
-/*
- * Test the GL_MESA_program_debug extension
- */
-
-
-#include <assert.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-/*
- * Print the string with line numbers
- */
-static void list_program(const GLubyte *string, GLsizei len)
-{
- const char *c = (const char *) string;
- int i, line = 1, printNumber = 1;
-
- for (i = 0; i < len; i++) {
- if (printNumber) {
- printf("%3d ", line);
- printNumber = 0;
- }
- if (*c == '\n') {
- line++;
- printNumber = 1;
- }
- putchar(*c);
- c++;
- }
- putchar('\n');
-}
-
-
-/*
- * Return the line number and column number that corresponds to the
- * given program position. Also return a null-terminated copy of that
- * line of the program string.
- */
-static const GLubyte *
-find_line_column(const GLubyte *string, const GLubyte *pos,
- GLint *line, GLint *col)
-{
- const GLubyte *lineStart = string;
- const GLubyte *p = string;
- GLubyte *s;
- int len;
-
- *line = 1;
-
- while (p != pos) {
- if (*p == (GLubyte) '\n') {
- (*line)++;
- lineStart = p + 1;
- }
- p++;
- }
-
- *col = (pos - lineStart) + 1;
-
- /* return copy of this line */
- while (*p != 0 && *p != '\n')
- p++;
- len = p - lineStart;
- s = (GLubyte *) malloc(len + 1);
- memcpy(s, lineStart, len);
- s[len] = 0;
-
- return s;
-}
-
-
-#define ARB_VERTEX_PROGRAM 1
-#define ARB_FRAGMENT_PROGRAM 2
-#define NV_VERTEX_PROGRAM 3
-#define NV_FRAGMENT_PROGRAM 4
-
-
-struct breakpoint {
- enum {PIXEL, LINE} type;
- int x, y;
- int line;
- GLboolean enabled;
-};
-
-#define MAX_BREAKPOINTS 100
-static struct breakpoint Breakpoints[MAX_BREAKPOINTS];
-static int NumBreakpoints = 0;
-
-
-
-/*
- * Interactive debugger
- */
-static void Debugger2(GLenum target, GLvoid *data)
-{
- static GLuint skipCount = 0;
- const GLubyte *ln;
- GLint pos, line, column;
- GLint id;
- int progType;
- GLint len;
- GLubyte *program;
- GLboolean stop;
- int i;
-
- /* Sigh, GL_VERTEX_PROGRAM_ARB == GL_VERTEX_PROGRAM_NV so it's a bit
- * hard to distinguish between them.
- */
- if (target == GL_FRAGMENT_PROGRAM_ARB)
- progType = ARB_FRAGMENT_PROGRAM;
- else if (target == GL_FRAGMENT_PROGRAM_NV)
- progType = NV_FRAGMENT_PROGRAM;
- else
- progType = NV_VERTEX_PROGRAM;
-
- /* Until we hit zero, continue rendering */
- if (skipCount > 0) {
- skipCount--;
- return;
- }
-
- /* Get id of the program and current position */
- switch (progType) {
- case ARB_FRAGMENT_PROGRAM:
- glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_BINDING_ARB, &id);
- glGetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos);
- break;
- case NV_FRAGMENT_PROGRAM:
- glGetIntegerv(GL_FRAGMENT_PROGRAM_BINDING_NV, &id);
- glGetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos);
- break;
- case ARB_VERTEX_PROGRAM:
- glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_BINDING_ARB, &id);
- glGetIntegerv(GL_VERTEX_PROGRAM_POSITION_MESA, &pos);
- break;
- case NV_VERTEX_PROGRAM:
- glGetIntegerv(GL_VERTEX_PROGRAM_BINDING_NV, &id);
- glGetIntegerv(GL_VERTEX_PROGRAM_POSITION_MESA, &pos);
- break;
- default:
- abort();
- }
-
- /* get program string */
- if (progType == ARB_VERTEX_PROGRAM ||
- progType == ARB_FRAGMENT_PROGRAM)
- glGetProgramivARB(target, GL_PROGRAM_LENGTH_ARB, &len);
- else
- glGetProgramivNV(id, GL_PROGRAM_LENGTH_NV, &len);
- program = malloc(len + 1);
- if (progType == ARB_VERTEX_PROGRAM ||
- progType == ARB_FRAGMENT_PROGRAM)
- glGetProgramStringARB(target, GL_PROGRAM_STRING_ARB, program);
- else
- glGetProgramStringNV(id, GL_PROGRAM_STRING_NV, program);
-
-
- /* Get current line number, column, line string */
- ln = find_line_column(program, program + pos, &line, &column);
-
- /* test breakpoints */
- if (NumBreakpoints > 0)
- stop = GL_FALSE;
- else
- stop = GL_TRUE;
- for (i = 0; i < NumBreakpoints; i++) {
- if (Breakpoints[i].enabled) {
- switch (Breakpoints[i].type) {
- case PIXEL:
- if (progType == ARB_FRAGMENT_PROGRAM) {
-
- }
- else if (progType == NV_FRAGMENT_PROGRAM) {
- GLfloat pos[4];
- int px, py;
- glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV,
- 6, (GLubyte *) "f[WPOS]", pos);
- px = (int) pos[0];
- py = (int) pos[1];
- printf("%d, %d\n", px, py);
- if (px == Breakpoints[i].x &&
- py == Breakpoints[i].y) {
- printf("Break at pixel (%d, %d)\n", px, py);
- stop = GL_TRUE;
- }
- }
- break;
- case LINE:
- if (line == Breakpoints[i].line) {
- /* hit a breakpoint! */
- printf("Break at line %d\n", line);
- stop = GL_TRUE;
- }
- break;
- }
- }
- }
- if (!stop) {
- free(program);
- return;
- }
-
- printf("%d: %s\n", line, ln);
-
- /* get commands from stdin */
- while (1) {
- char command[1000], *cmd;
-
- /* print prompt and get command */
- printf("(%s %d) ", (target == GL_VERTEX_PROGRAM_ARB ? "vert" : "frag"),
- line);
- fgets(command, 999, stdin);
-
- /* skip leading whitespace */
- for (cmd = command; cmd[0] == ' '; cmd++)
- ;
-
- if (!cmd[0])
- /* nothing (repeat the previous cmd?) */
- continue;
-
- switch (cmd[0]) {
- case 's':
- /* skip N instructions */
- i = atoi(cmd + 2);
- skipCount = i;
- printf("Skipping %d instructions\n", i);
- return;
- case 'n':
- /* next */
- return;
- case 'c':
- return;
- case 'd':
- /* dump machine state */
- if (progType == NV_FRAGMENT_PROGRAM) {
- static const char *inRegs[] = {
- "f[WPOS]", "f[COL0]", "f[COL1]", "f[FOGC]",
- "f[TEX0]", "f[TEX1]", "f[TEX2]", "f[TEX3]",
- NULL
- };
- static const char *outRegs[] = {
- "o[COLR]", "o[COLH]", "o[DEPR]", NULL
- };
- GLfloat v[4];
- int i;
- printf("Fragment input attributes:\n");
- for (i = 0; inRegs[i]; i++) {
- glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV,
- strlen(inRegs[i]),
- (const GLubyte *) inRegs[i], v);
- printf(" %s: %g, %g, %g, %g\n", inRegs[i],
- v[0], v[1], v[2], v[3]);
- }
- printf("Fragment output attributes:\n");
- for (i = 0; outRegs[i]; i++) {
- glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV,
- strlen(outRegs[i]),
- (const GLubyte *) outRegs[i], v);
- printf(" %s: %g, %g, %g, %g\n", outRegs[i],
- v[0], v[1], v[2], v[3]);
- }
- printf("Temporaries:\n");
- for (i = 0; i < 4; i++) {
- char temp[100];
- GLfloat v[4];
- sprintf(temp, "R%d", i);
- glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV,
- strlen(temp),
- (const GLubyte *) temp, v);
- printf(" %s: %g, %g, %g, %g\n", temp, v[0],v[1],v[2],v[3]);
- }
- }
- else if (progType == NV_VERTEX_PROGRAM) {
- GLfloat v[4];
- int i;
- static const char *inRegs[] = {
- "v[OPOS]", "v[WGHT]", "v[NRML]", "v[COL0]",
- "v[COL1]", "v[FOGC]", "v[6]", "v[7]",
- "v[TEX0]", "v[TEX1]", "v[TEX2]", "v[TEX3]",
- "v[TEX4]", "v[TEX5]", "v[TEX6]", "v[TEX7]",
- NULL
- };
- static const char *outRegs[] = {
- "o[HPOS]", "o[COL0]", "o[COL1]", "o[BFC0]",
- "o[BFC1]", "o[FOGC]", "o[PSIZ]",
- "o[TEX0]", "o[TEX1]", "o[TEX2]", "o[TEX3]",
- "o[TEX4]", "o[TEX5]", "o[TEX6]", "o[TEX7]",
- NULL
- };
- printf("Vertex input attributes:\n");
- for (i = 0; inRegs[i]; i++) {
- glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_NV,
- strlen(inRegs[i]),
- (const GLubyte *) inRegs[i], v);
- printf(" %s: %g, %g, %g, %g\n", inRegs[i],
- v[0], v[1], v[2], v[3]);
- }
- printf("Vertex output attributes:\n");
- for (i = 0; outRegs[i]; i++) {
- glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_NV,
- strlen(outRegs[i]),
- (const GLubyte *) outRegs[i], v);
- printf(" %s: %g, %g, %g, %g\n", outRegs[i],
- v[0], v[1], v[2], v[3]);
- }
- printf("Temporaries:\n");
- for (i = 0; i < 4; i++) {
- char temp[100];
- GLfloat v[4];
- sprintf(temp, "R%d", i);
- glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_NV,
- strlen(temp),
- (const GLubyte *) temp, v);
- printf(" %s: %g, %g, %g, %g\n", temp, v[0],v[1],v[2],v[3]);
- }
- }
- break;
- case 'l':
- /* list */
- list_program(program, len);
- break;
- case 'p':
- /* print */
- {
- GLfloat v[4];
- char *c;
- cmd++;
- while (*cmd == ' ')
- cmd++;
- c = cmd;
- while (*c) {
- if (*c == '\n' || *c == '\r')
- *c = 0;
- else
- c++;
- }
- glGetProgramRegisterfvMESA(target, strlen(cmd),
- (const GLubyte *) cmd, v);
- if (glGetError() == GL_NO_ERROR)
- printf("%s = %g, %g, %g, %g\n", cmd, v[0], v[1], v[2], v[3]);
- else
- printf("Invalid expression\n");
- }
- break;
- case 'b':
- if (cmd[1] == ' ' && isdigit(cmd[2])) {
- char *comma = strchr(cmd, ',');
- if (comma) {
- /* break at pixel */
- int x = atoi(cmd + 2);
- int y = atoi(comma + 1);
- if (NumBreakpoints < MAX_BREAKPOINTS) {
- Breakpoints[NumBreakpoints].type = PIXEL;
- Breakpoints[NumBreakpoints].x = x;
- Breakpoints[NumBreakpoints].y = y;
- Breakpoints[NumBreakpoints].enabled = GL_TRUE;
- NumBreakpoints++;
- printf("Breakpoint %d: break at pixel (%d, %d)\n",
- NumBreakpoints, x, y);
- }
- }
- else {
- /* break at line */
- int l = atoi(cmd + 2);
- if (l && NumBreakpoints < MAX_BREAKPOINTS) {
- Breakpoints[NumBreakpoints].type = LINE;
- Breakpoints[NumBreakpoints].line = l;
- Breakpoints[NumBreakpoints].enabled = GL_TRUE;
- NumBreakpoints++;
- printf("Breakpoint %d: break at line %d\n",
- NumBreakpoints, l);
- }
- }
- }
- else {
- /* list breakpoints */
- printf("Breakpoints:\n");
- for (i = 0; i < NumBreakpoints; i++) {
- switch (Breakpoints[i].type) {
- case LINE:
- printf(" %d: break at line %d\n",
- i + 1, Breakpoints[i].line);
- break;
- case PIXEL:
- printf(" %d: break at pixel (%d, %d)\n",
- i + 1, Breakpoints[i].x, Breakpoints[i].y);
- break;
- }
- }
- }
- break;
- case 'h':
- /* help */
- printf("Debugger commands:\n");
- printf(" b list breakpoints\n");
- printf(" b N break at line N\n");
- printf(" b x,y break at pixel x,y\n");
- printf(" c continue execution\n");
- printf(" d display register values\n");
- printf(" h help\n");
- printf(" l list program\n");
- printf(" n next instruction\n");
- printf(" p V print value V\n");
- printf(" s N skip N instructions\n");
- break;
- default:
- printf("Unknown command: %c\n", cmd[0]);
- }
- }
-}
-
-
-/*
- * Print current line, some registers, and continue.
- */
-static void Debugger(GLenum target, GLvoid *data)
-{
- GLint pos;
- const GLubyte *ln;
- GLint line, column;
- GLfloat v[4];
-
- assert(target == GL_FRAGMENT_PROGRAM_NV);
-
- glGetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos);
-
- ln = find_line_column((const GLubyte *) data, (const GLubyte *) data + pos,
- &line, &column);
- printf("%d:%d: %s\n", line, column, (char *) ln);
-
- glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV,
- 2, (const GLubyte *) "R0", v);
- printf(" R0 = %g, %g, %g, %g\n", v[0], v[1], v[2], v[3]);
- glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV,
- 7, (const GLubyte *) "f[WPOS]", v);
- printf(" o[WPOS] = %g, %g, %g, %g\n", v[0], v[1], v[2], v[3]);
- glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV,
- 7, (const GLubyte *) "o[COLR]", v);
- printf(" o[COLR] = %g, %g, %g, %g\n", v[0], v[1], v[2], v[3]);
-
- free((void *) ln);
-}
-
-
-
-
-/**********************************************************************/
-
-static GLfloat Diffuse[4] = { 0.5, 0.5, 1.0, 1.0 };
-static GLfloat Specular[4] = { 0.8, 0.8, 0.8, 1.0 };
-static GLfloat LightPos[4] = { 0.0, 10.0, 20.0, 1.0 };
-static GLfloat Delta = 1.0;
-
-static GLuint FragProg;
-static GLuint VertProg;
-static GLboolean Anim = GL_TRUE;
-static GLboolean Wire = GL_FALSE;
-static GLboolean PixelLight = GL_TRUE;
-
-static GLfloat Xrot = 0, Yrot = 0;
-
-
-#define NAMED_PARAMETER4FV(prog, name, v) \
- glProgramNamedParameter4fvNV(prog, strlen(name), (const GLubyte *) name, v)
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- if (PixelLight) {
- NAMED_PARAMETER4FV(FragProg, "LightPos", LightPos);
- glEnable(GL_FRAGMENT_PROGRAM_NV);
- glEnable(GL_VERTEX_PROGRAM_NV);
- glDisable(GL_LIGHTING);
- }
- else {
- glLightfv(GL_LIGHT0, GL_POSITION, LightPos);
- glDisable(GL_FRAGMENT_PROGRAM_NV);
- glDisable(GL_VERTEX_PROGRAM_NV);
- glEnable(GL_LIGHTING);
- }
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
-
-#if 1
- glutSolidSphere(2.0, 10, 5);
-#else
- {
- GLUquadricObj *q = gluNewQuadric();
- gluQuadricNormals(q, GL_SMOOTH);
- gluQuadricTexture(q, GL_TRUE);
- glRotatef(90, 1, 0, 0);
- glTranslatef(0, 0, -1);
- gluCylinder(q, 1.0, 1.0, 2.0, 24, 1);
- gluDeleteQuadric(q);
- }
-#endif
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Idle(void)
-{
- LightPos[0] += Delta;
- if (LightPos[0] > 25.0)
- Delta = -1.0;
- else if (LightPos[0] <- 25.0)
- Delta = 1.0;
- glutPostRedisplay();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- /*glOrtho( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );*/
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case ' ':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'x':
- LightPos[0] -= 1.0;
- break;
- case 'X':
- LightPos[0] += 1.0;
- break;
- case 'w':
- Wire = !Wire;
- if (Wire)
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- else
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- break;
- case 'p':
- PixelLight = !PixelLight;
- if (PixelLight) {
- printf("Per-pixel lighting\n");
- }
- else {
- printf("Conventional lighting\n");
- }
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( int argc, char *argv[] )
-{
- static const char *fragProgramText =
- "!!FP1.0\n"
- "DECLARE Diffuse; \n"
- "DECLARE Specular; \n"
- "DECLARE LightPos; \n"
-
- "# Compute normalized LightPos, put it in R0\n"
- "DP3 R0.x, LightPos, LightPos;\n"
- "RSQ R0.y, R0.x;\n"
- "MUL R0, LightPos, R0.y;\n"
-
- "# Compute normalized normal, put it in R1\n"
- "DP3 R1, f[TEX0], f[TEX0]; \n"
- "RSQ R1.y, R1.x;\n"
- "MUL R1, f[TEX0], R1.y;\n"
-
- "# Compute dot product of light direction and normal vector\n"
- "DP3 R2, R0, R1;\n"
-
- "MUL R3, Diffuse, R2; # diffuse attenuation\n"
-
- "POW R4, R2.x, {20.0}.x; # specular exponent\n"
-
- "MUL R5, Specular, R4; # specular attenuation\n"
-
- "ADD o[COLR], R3, R5; # add diffuse and specular colors\n"
- "END \n"
- ;
-
- static const char *vertProgramText =
- "!!VP1.0\n"
- "# typical modelview/projection transform\n"
- "DP4 o[HPOS].x, c[0], v[OPOS] ;\n"
- "DP4 o[HPOS].y, c[1], v[OPOS] ;\n"
- "DP4 o[HPOS].z, c[2], v[OPOS] ;\n"
- "DP4 o[HPOS].w, c[3], v[OPOS] ;\n"
- "# transform normal by inv transpose of modelview, put in tex0\n"
- "DP4 o[TEX0].x, c[4], v[NRML] ;\n"
- "DP4 o[TEX0].y, c[5], v[NRML] ;\n"
- "DP4 o[TEX0].z, c[6], v[NRML] ;\n"
- "DP4 o[TEX0].w, c[7], v[NRML] ;\n"
- "END\n";
- ;
-
- if (!glutExtensionSupported("GL_NV_vertex_program")) {
- printf("Sorry, this demo requires GL_NV_vertex_program\n");
- exit(1);
- }
- if (!glutExtensionSupported("GL_NV_fragment_program")) {
- printf("Sorry, this demo requires GL_NV_fragment_program\n");
- exit(1);
- }
-
- glGenProgramsNV(1, &FragProg);
- assert(FragProg > 0);
- glGenProgramsNV(1, &VertProg);
- assert(VertProg > 0);
-
- /*
- * Fragment program
- */
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, FragProg,
- strlen(fragProgramText),
- (const GLubyte *) fragProgramText);
- assert(glIsProgramNV(FragProg));
- glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, FragProg);
-
- NAMED_PARAMETER4FV(FragProg, "Diffuse", Diffuse);
- NAMED_PARAMETER4FV(FragProg, "Specular", Specular);
-
- /*
- * Vertex program
- */
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, VertProg,
- strlen(vertProgramText),
- (const GLubyte *) vertProgramText);
- assert(glIsProgramNV(VertProg));
- glBindProgramNV(GL_VERTEX_PROGRAM_NV, VertProg);
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV);
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV);
-
- /*
- * Misc init
- */
- glClearColor(0.3, 0.3, 0.3, 0.0);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHT0);
- glEnable(GL_LIGHTING);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular);
- glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 20.0);
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("Press p to toggle between per-pixel and per-vertex lighting\n");
-
-#ifdef GL_MESA_program_debug
- if (argc > 1 && strcmp(argv[1], "fragment") == 0) {
- printf(">> Debugging fragment program\n");
- glProgramCallbackMESA(GL_FRAGMENT_PROGRAM_ARB, Debugger2,
- (GLvoid *) fragProgramText);
- glEnable(GL_FRAGMENT_PROGRAM_CALLBACK_MESA);
- }
- else {
- printf(">> Debugging vertex program\n");
- glProgramCallbackMESA(GL_VERTEX_PROGRAM_ARB, Debugger2,
- (GLvoid *) fragProgramText);
- glEnable(GL_VERTEX_PROGRAM_CALLBACK_MESA);
- }
-#endif
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 200, 200 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
- Init(argc, argv);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/descrip.mms b/progs/tests/descrip.mms
deleted file mode 100644
index b6ba3e1aebb..00000000000
--- a/progs/tests/descrip.mms
+++ /dev/null
@@ -1,84 +0,0 @@
-# Makefile for GLUT-based demo programs for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-
-.first
- define gl [--.include.gl]
-
-.include [--]mms-config.
-
-##### MACROS #####
-
-INCDIR = ([--.include],[-.util])
-CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
-
-.ifdef SHARE
-GL_LIBS = $(XLIBS)
-.else
-GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
-.endif
-
-LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
-
-PROGS = cva.exe,\
- dinoshade.exe,\
- fogcoord.exe,\
- manytex.exe,\
- multipal.exe,\
- projtex.exe,\
- seccolor.exe,\
- sharedtex.exe,\
- texline.exe,\
- texwrap.exe,\
- vptest1.exe,\
- vptest2.exe,\
- vptest3.exe,\
- vptorus.exe,\
- vpwarpmesh.exe
-
-##### RULES #####
-.obj.exe :
- cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
-
-##### TARGETS #####
-default :
- $(MMS)$(MMSQUALIFIERS) $(PROGS)
-
-clean :
- delete *.obj;*
-
-realclean :
- delete $(PROGS)
- delete *.obj;*
-
-cva.exe : cva.obj $(LIB_DEP)
-dinoshade.exe : dinoshade.obj $(LIB_DEP)
-fogcoord.exe : fogcoord.obj $(LIB_DEP)
-manytex.exe : manytex.obj $(LIB_DEP)
-multipal.exe : multipal.obj $(LIB_DEP)
-projtex.exe : projtex.obj $(LIB_DEP)
-seccolor.exe : seccolor.obj $(LIB_DEP)
-sharedtex.exe : sharedtex.obj $(LIB_DEP)
-texline.exe : texline.obj $(LIB_DEP)
-texwrap.exe : texwrap.obj $(LIB_DEP)
-vptest1.exe : vptest1.obj $(LIB_DEP)
-vptest2.exe : vptest2.obj $(LIB_DEP)
-vptest3.exe : vptest3.obj $(LIB_DEP)
-vptorus.exe : vptorus.obj $(LIB_DEP)
-vpwarpmesh.exe : vpwarpmesh.obj $(LIB_DEP)
-
-cva.obj : cva.c
-dinoshade.obj : dinoshade.c
-fogcoord.obj : fogcoord.c
-manytex.obj : manytex.c
-multipal.obj : multipal.c
-projtex.obj : projtex.c
-seccolor.obj : seccolor.c
-sharedtex.obj : sharedtex.c
-texline.obj : texline.c
-texwrap.obj : texwrap.c
-vptest1.obj : vptest1.c
-vptest2.obj : vptest2.c
-vptest3.obj : vptest3.c
-vptorus.obj : vptorus.c
-vpwarpmesh.obj : vpwarpmesh.c
diff --git a/progs/tests/dinoshade.c b/progs/tests/dinoshade.c
deleted file mode 100644
index ed7b879bc71..00000000000
--- a/progs/tests/dinoshade.c
+++ /dev/null
@@ -1,914 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
-
-/* 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. */
-
-/* Example for PC game developers to show how to *combine* texturing,
- reflections, and projected shadows all in real-time with OpenGL.
- Robust reflections use stenciling. Robust projected shadows
- use both stenciling and polygon offset. PC game programmers
- should realize that neither stenciling nor polygon offset are
- supported by Direct3D, so these real-time rendering algorithms
- are only really viable with OpenGL.
-
- The program has modes for disabling the stenciling and polygon
- offset uses. It is worth running this example with these features
- toggled off so you can see the sort of artifacts that result.
-
- Notice that the floor texturing, reflections, and shadowing
- all co-exist properly. */
-
-/* When you run this program: Left mouse button controls the
- view. Middle mouse button controls light position (left &
- right rotates light around dino; up & down moves light
- position up and down). Right mouse button pops up menu. */
-
-/* Check out the comments in the "redraw" routine to see how the
- reflection blending and surface stenciling is done. You can
- also see in "redraw" how the projected shadows are rendered,
- including the use of stenciling and polygon offset. */
-
-/* This program is derived from glutdino.c */
-
-/* Compile: cc -o dinoshade dinoshade.c -lglut -lGLU -lGL -lXmu -lXext -lX11 -lm */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h> /* for cos(), sin(), and sqrt() */
-#ifdef __VMS
-# include <stddef.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
-#else
-# include <malloc.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
-#endif
-#ifdef _WIN32
-#include <windows.h>
-#endif
-#define GL_GLEXT_LEGACY
-#include <GL/glut.h> /* OpenGL Utility Toolkit header */
-
-/* Some <math.h> files do not define M_PI... */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-/* Variable controlling various rendering modes. */
-static int stencilReflection = 1, stencilShadow = 1, offsetShadow = 1;
-static int renderShadow = 1, renderDinosaur = 1, renderReflection = 1;
-static int linearFiltering = 0, useMipmaps = 0, useTexture = 1;
-static int reportSpeed = 0;
-static int animation = 1;
-static GLboolean lightSwitch = GL_TRUE;
-static int directionalLight = 1;
-static int forceExtension = 0;
-
-/* Time varying or user-controled variables. */
-static float jump = 0.0;
-static float lightAngle = 0.0, lightHeight = 20;
-GLfloat angle = -150; /* in degrees */
-GLfloat angle2 = 30; /* in degrees */
-
-int moving, startx, starty;
-int lightMoving = 0, lightStartX, lightStartY;
-
-enum {
- MISSING, EXTENSION, ONE_DOT_ONE
-};
-int polygonOffsetVersion;
-
-static GLdouble bodyWidth = 3.0;
-/* *INDENT-OFF* */
-static GLfloat body[][2] = { {0, 3}, {1, 1}, {5, 1}, {8, 4}, {10, 4}, {11, 5},
- {11, 11.5}, {13, 12}, {13, 13}, {10, 13.5}, {13, 14}, {13, 15}, {11, 16},
- {8, 16}, {7, 15}, {7, 13}, {8, 12}, {7, 11}, {6, 6}, {4, 3}, {3, 2},
- {1, 2} };
-static GLfloat arm[][2] = { {8, 10}, {9, 9}, {10, 9}, {13, 8}, {14, 9}, {16, 9},
- {15, 9.5}, {16, 10}, {15, 10}, {15.5, 11}, {14.5, 10}, {14, 11}, {14, 10},
- {13, 9}, {11, 11}, {9, 11} };
-static GLfloat leg[][2] = { {8, 6}, {8, 4}, {9, 3}, {9, 2}, {8, 1}, {8, 0.5}, {9, 0},
- {12, 0}, {10, 1}, {10, 2}, {12, 4}, {11, 6}, {10, 7}, {9, 7} };
-static GLfloat eye[][2] = { {8.75, 15}, {9, 14.7}, {9.6, 14.7}, {10.1, 15},
- {9.6, 15.25}, {9, 15.25} };
-static GLfloat lightPosition[4];
-static GLfloat lightColor[] = {0.8, 1.0, 0.8, 1.0}; /* green-tinted */
-static GLfloat skinColor[] = {0.1, 1.0, 0.1, 1.0}, eyeColor[] = {1.0, 0.2, 0.2, 1.0};
-/* *INDENT-ON* */
-
-/* Nice floor texture tiling pattern. */
-static char *circles[] = {
- "....xxxx........",
- "..xxxxxxxx......",
- ".xxxxxxxxxx.....",
- ".xxx....xxx.....",
- "xxx......xxx....",
- "xxx......xxx....",
- "xxx......xxx....",
- "xxx......xxx....",
- ".xxx....xxx.....",
- ".xxxxxxxxxx.....",
- "..xxxxxxxx......",
- "....xxxx........",
- "................",
- "................",
- "................",
- "................",
-};
-
-static void
-makeFloorTexture(void)
-{
- GLubyte floorTexture[16][16][3];
- GLubyte *loc;
- int s, t;
-
- /* Setup RGB image for the texture. */
- loc = (GLubyte*) floorTexture;
- for (t = 0; t < 16; t++) {
- for (s = 0; s < 16; s++) {
- if (circles[t][s] == 'x') {
- /* Nice green. */
- loc[0] = 0x1f;
- loc[1] = 0x8f;
- loc[2] = 0x1f;
- } else {
- /* Light gray. */
- loc[0] = 0xaa;
- loc[1] = 0xaa;
- loc[2] = 0xaa;
- }
- loc += 3;
- }
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- if (useMipmaps) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR_MIPMAP_LINEAR);
- gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 16, 16,
- GL_RGB, GL_UNSIGNED_BYTE, floorTexture);
- } else {
- if (linearFiltering) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- } else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- }
- glTexImage2D(GL_TEXTURE_2D, 0, 3, 16, 16, 0,
- GL_RGB, GL_UNSIGNED_BYTE, floorTexture);
- }
-}
-
-enum {
- X, Y, Z, W
-};
-enum {
- A, B, C, D
-};
-
-/* Create a matrix that will project the desired shadow. */
-void
-shadowMatrix(GLfloat shadowMat[4][4],
- GLfloat groundplane[4],
- GLfloat lightpos[4])
-{
- GLfloat dot;
-
- /* Find dot product between light position vector and ground plane normal. */
- dot = groundplane[X] * lightpos[X] +
- groundplane[Y] * lightpos[Y] +
- groundplane[Z] * lightpos[Z] +
- groundplane[W] * lightpos[W];
-
- shadowMat[0][0] = dot - lightpos[X] * groundplane[X];
- shadowMat[1][0] = 0.f - lightpos[X] * groundplane[Y];
- shadowMat[2][0] = 0.f - lightpos[X] * groundplane[Z];
- shadowMat[3][0] = 0.f - lightpos[X] * groundplane[W];
-
- shadowMat[X][1] = 0.f - lightpos[Y] * groundplane[X];
- shadowMat[1][1] = dot - lightpos[Y] * groundplane[Y];
- shadowMat[2][1] = 0.f - lightpos[Y] * groundplane[Z];
- shadowMat[3][1] = 0.f - lightpos[Y] * groundplane[W];
-
- shadowMat[X][2] = 0.f - lightpos[Z] * groundplane[X];
- shadowMat[1][2] = 0.f - lightpos[Z] * groundplane[Y];
- shadowMat[2][2] = dot - lightpos[Z] * groundplane[Z];
- shadowMat[3][2] = 0.f - lightpos[Z] * groundplane[W];
-
- shadowMat[X][3] = 0.f - lightpos[W] * groundplane[X];
- shadowMat[1][3] = 0.f - lightpos[W] * groundplane[Y];
- shadowMat[2][3] = 0.f - lightpos[W] * groundplane[Z];
- shadowMat[3][3] = dot - lightpos[W] * groundplane[W];
-
-}
-
-/* Find the plane equation given 3 points. */
-void
-findPlane(GLfloat plane[4],
- GLfloat v0[3], GLfloat v1[3], GLfloat v2[3])
-{
- GLfloat vec0[3], vec1[3];
-
- /* Need 2 vectors to find cross product. */
- vec0[X] = v1[X] - v0[X];
- vec0[Y] = v1[Y] - v0[Y];
- vec0[Z] = v1[Z] - v0[Z];
-
- vec1[X] = v2[X] - v0[X];
- vec1[Y] = v2[Y] - v0[Y];
- vec1[Z] = v2[Z] - v0[Z];
-
- /* find cross product to get A, B, and C of plane equation */
- plane[A] = vec0[Y] * vec1[Z] - vec0[Z] * vec1[Y];
- plane[B] = -(vec0[X] * vec1[Z] - vec0[Z] * vec1[X]);
- plane[C] = vec0[X] * vec1[Y] - vec0[Y] * vec1[X];
-
- plane[D] = -(plane[A] * v0[X] + plane[B] * v0[Y] + plane[C] * v0[Z]);
-}
-
-void
-extrudeSolidFromPolygon(GLfloat data[][2], unsigned int dataSize,
- GLdouble thickness, GLuint side, GLuint edge, GLuint whole)
-{
- static GLUtriangulatorObj *tobj = NULL;
- GLdouble vertex[3], dx, dy, len;
- int i;
- int count = (int) (dataSize / (2 * sizeof(GLfloat)));
-
- if (tobj == NULL) {
- tobj = gluNewTess(); /* create and initialize a GLU
- polygon tesselation object */
- gluTessCallback(tobj, GLU_BEGIN, glBegin);
- gluTessCallback(tobj, GLU_VERTEX, glVertex2fv); /* semi-tricky */
- gluTessCallback(tobj, GLU_END, glEnd);
- }
- glNewList(side, GL_COMPILE);
- glShadeModel(GL_SMOOTH); /* smooth minimizes seeing
- tessellation */
- gluBeginPolygon(tobj);
- for (i = 0; i < count; i++) {
- vertex[0] = data[i][0];
- vertex[1] = data[i][1];
- vertex[2] = 0;
- gluTessVertex(tobj, vertex, data[i]);
- }
- gluEndPolygon(tobj);
- glEndList();
- glNewList(edge, GL_COMPILE);
- glShadeModel(GL_FLAT); /* flat shade keeps angular hands
- from being "smoothed" */
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= count; i++) {
-#if 1 /* weird, but seems to be legal */
- /* mod function handles closing the edge */
- glVertex3f(data[i % count][0], data[i % count][1], 0.0);
- glVertex3f(data[i % count][0], data[i % count][1], thickness);
- /* Calculate a unit normal by dividing by Euclidean
- distance. We * could be lazy and use
- glEnable(GL_NORMALIZE) so we could pass in * arbitrary
- normals for a very slight performance hit. */
- dx = data[(i + 1) % count][1] - data[i % count][1];
- dy = data[i % count][0] - data[(i + 1) % count][0];
- len = sqrt(dx * dx + dy * dy);
- glNormal3f(dx / len, dy / len, 0.0);
-#else /* the nice way of doing it */
- /* Calculate a unit normal by dividing by Euclidean
- distance. We * could be lazy and use
- glEnable(GL_NORMALIZE) so we could pass in * arbitrary
- normals for a very slight performance hit. */
- dx = data[i % count][1] - data[(i - 1 + count) % count][1];
- dy = data[(i - 1 + count) % count][0] - data[i % count][0];
- len = sqrt(dx * dx + dy * dy);
- glNormal3f(dx / len, dy / len, 0.0);
- /* mod function handles closing the edge */
- glVertex3f(data[i % count][0], data[i % count][1], 0.0);
- glVertex3f(data[i % count][0], data[i % count][1], thickness);
-#endif
- }
- glEnd();
- glEndList();
- glNewList(whole, GL_COMPILE);
- glFrontFace(GL_CW);
- glCallList(edge);
- glNormal3f(0.0, 0.0, -1.0); /* constant normal for side */
- glCallList(side);
- glPushMatrix();
- glTranslatef(0.0, 0.0, thickness);
- glFrontFace(GL_CCW);
- glNormal3f(0.0, 0.0, 1.0); /* opposite normal for other side */
- glCallList(side);
- glPopMatrix();
- glEndList();
-}
-
-/* Enumerants for refering to display lists. */
-typedef enum {
- RESERVED, BODY_SIDE, BODY_EDGE, BODY_WHOLE, ARM_SIDE, ARM_EDGE, ARM_WHOLE,
- LEG_SIDE, LEG_EDGE, LEG_WHOLE, EYE_SIDE, EYE_EDGE, EYE_WHOLE
-} displayLists;
-
-static void
-makeDinosaur(void)
-{
- extrudeSolidFromPolygon(body, sizeof(body), bodyWidth,
- BODY_SIDE, BODY_EDGE, BODY_WHOLE);
- extrudeSolidFromPolygon(arm, sizeof(arm), bodyWidth / 4,
- ARM_SIDE, ARM_EDGE, ARM_WHOLE);
- extrudeSolidFromPolygon(leg, sizeof(leg), bodyWidth / 2,
- LEG_SIDE, LEG_EDGE, LEG_WHOLE);
- extrudeSolidFromPolygon(eye, sizeof(eye), bodyWidth + 0.2,
- EYE_SIDE, EYE_EDGE, EYE_WHOLE);
-}
-
-static void
-drawDinosaur(void)
-
-{
- glPushMatrix();
- /* Translate the dinosaur to be at (0,8,0). */
- glTranslatef(-8, 0, -bodyWidth / 2);
- glTranslatef(0.0, jump, 0.0);
- glMaterialfv(GL_FRONT, GL_DIFFUSE, skinColor);
- glCallList(BODY_WHOLE);
- glTranslatef(0.0, 0.0, bodyWidth);
- glCallList(ARM_WHOLE);
- glCallList(LEG_WHOLE);
- glTranslatef(0.0, 0.0, -bodyWidth - bodyWidth / 4);
- glCallList(ARM_WHOLE);
- glTranslatef(0.0, 0.0, -bodyWidth / 4);
- glCallList(LEG_WHOLE);
- glTranslatef(0.0, 0.0, bodyWidth / 2 - 0.1);
- glMaterialfv(GL_FRONT, GL_DIFFUSE, eyeColor);
- glCallList(EYE_WHOLE);
- glPopMatrix();
-}
-
-static GLfloat floorVertices[4][3] = {
- { -20.0, 0.0, 20.0 },
- { 20.0, 0.0, 20.0 },
- { 20.0, 0.0, -20.0 },
- { -20.0, 0.0, -20.0 },
-};
-
-/* Draw a floor (possibly textured). */
-static void
-drawFloor(void)
-{
- glDisable(GL_LIGHTING);
-
- if (useTexture) {
- glEnable(GL_TEXTURE_2D);
- }
-
- glBegin(GL_QUADS);
- glTexCoord2f(0.0, 0.0);
- glVertex3fv(floorVertices[0]);
- glTexCoord2f(0.0, 16.0);
- glVertex3fv(floorVertices[1]);
- glTexCoord2f(16.0, 16.0);
- glVertex3fv(floorVertices[2]);
- glTexCoord2f(16.0, 0.0);
- glVertex3fv(floorVertices[3]);
- glEnd();
-
- if (useTexture) {
- glDisable(GL_TEXTURE_2D);
- }
-
- glEnable(GL_LIGHTING);
-}
-
-static GLfloat floorPlane[4];
-static GLfloat floorShadow[4][4];
-
-static void
-redraw(void)
-{
- int start, end;
-
- if (reportSpeed) {
- start = glutGet(GLUT_ELAPSED_TIME);
- }
-
- /* Clear; default stencil clears to zero. */
- if ((stencilReflection && renderReflection) || (stencilShadow && renderShadow)) {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- } else {
- /* Avoid clearing stencil when not using it. */
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- }
-
- /* Reposition the light source. */
- lightPosition[0] = 12*cos(lightAngle);
- lightPosition[1] = lightHeight;
- lightPosition[2] = 12*sin(lightAngle);
- if (directionalLight) {
- lightPosition[3] = 0.0;
- } else {
- lightPosition[3] = 1.0;
- }
-
- shadowMatrix(floorShadow, floorPlane, lightPosition);
-
- glPushMatrix();
- /* Perform scene rotations based on user mouse input. */
- glRotatef(angle2, 1.0, 0.0, 0.0);
- glRotatef(angle, 0.0, 1.0, 0.0);
-
- /* Tell GL new light source position. */
- glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
-
- if (renderReflection) {
- if (stencilReflection) {
- /* We can eliminate the visual "artifact" of seeing the "flipped"
- dinosaur underneath the floor by using stencil. The idea is
- draw the floor without color or depth update but so that
- a stencil value of one is where the floor will be. Later when
- rendering the dinosaur reflection, we will only update pixels
- with a stencil value of 1 to make sure the reflection only
- lives on the floor, not below the floor. */
-
- /* Don't update color or depth. */
- glDisable(GL_DEPTH_TEST);
- glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
-
- /* Draw 1 into the stencil buffer. */
- glEnable(GL_STENCIL_TEST);
- glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
- glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
-
- /* Now render floor; floor pixels just get their stencil set to 1. */
- drawFloor();
-
- /* Re-enable update of color and depth. */
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- glEnable(GL_DEPTH_TEST);
-
- /* Now, only render where stencil is set to 1. */
- glStencilFunc(GL_EQUAL, 1, 0xffffffff); /* draw if ==1 */
- glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
- }
-
- glPushMatrix();
-
- /* The critical reflection step: Reflect dinosaur through the floor
- (the Y=0 plane) to make a relection. */
- glScalef(1.0, -1.0, 1.0);
-
- /* Reflect the light position. */
- glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
-
- /* To avoid our normals getting reversed and hence botched lighting
- on the reflection, turn on normalize. */
- glEnable(GL_NORMALIZE);
- glCullFace(GL_FRONT);
-
- /* Draw the reflected dinosaur. */
- drawDinosaur();
-
- /* Disable noramlize again and re-enable back face culling. */
- glDisable(GL_NORMALIZE);
- glCullFace(GL_BACK);
-
- glPopMatrix();
-
- /* Switch back to the unreflected light position. */
- glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
-
- if (stencilReflection) {
- glDisable(GL_STENCIL_TEST);
- }
- }
-
- /* Back face culling will get used to only draw either the top or the
- bottom floor. This let's us get a floor with two distinct
- appearances. The top floor surface is reflective and kind of red.
- The bottom floor surface is not reflective and blue. */
-
- /* Draw "bottom" of floor in blue. */
- glFrontFace(GL_CW); /* Switch face orientation. */
- glColor4f(0.1, 0.1, 0.7, 1.0);
- drawFloor();
- glFrontFace(GL_CCW);
-
- if (renderShadow) {
- if (stencilShadow) {
- /* Draw the floor with stencil value 3. This helps us only
- draw the shadow once per floor pixel (and only on the
- floor pixels). */
- glEnable(GL_STENCIL_TEST);
- glStencilFunc(GL_ALWAYS, 3, 0xffffffff);
- glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
- }
- }
-
- /* Draw "top" of floor. Use blending to blend in reflection. */
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glColor4f(0.7, 0.0, 0.0, 0.3);
- glColor4f(1.0, 1.0, 1.0, 0.3);
- drawFloor();
- glDisable(GL_BLEND);
-
- if (renderDinosaur) {
- /* Draw "actual" dinosaur, not its reflection. */
- drawDinosaur();
- }
-
- if (renderShadow) {
-
- /* Render the projected shadow. */
-
- if (stencilShadow) {
-
- /* Now, only render where stencil is set above 2 (ie, 3 where
- the top floor is). Update stencil with 2 where the shadow
- gets drawn so we don't redraw (and accidently reblend) the
- shadow). */
- glStencilFunc(GL_LESS, 2, 0xffffffff); /* draw if ==1 */
- glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
- }
-
- /* To eliminate depth buffer artifacts, we use polygon offset
- to raise the depth of the projected shadow slightly so
- that it does not depth buffer alias with the floor. */
- if (offsetShadow) {
- switch (polygonOffsetVersion) {
- case EXTENSION:
-#ifdef GL_EXT_polygon_offset
- glEnable(GL_POLYGON_OFFSET_EXT);
- break;
-#endif
-#ifdef GL_VERSION_1_1
- case ONE_DOT_ONE:
- glEnable(GL_POLYGON_OFFSET_FILL);
- break;
-#endif
- case MISSING:
- /* Oh well. */
- break;
- }
- }
-
- /* Render 50% black shadow color on top of whatever the
- floor appareance is. */
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDisable(GL_LIGHTING); /* Force the 50% black. */
- glColor4f(0.0, 0.0, 0.0, 0.5);
-
- glPushMatrix();
- /* Project the shadow. */
- glMultMatrixf((GLfloat *) floorShadow);
- drawDinosaur();
- glPopMatrix();
-
- glDisable(GL_BLEND);
- glEnable(GL_LIGHTING);
-
- if (offsetShadow) {
- switch (polygonOffsetVersion) {
-#ifdef GL_EXT_polygon_offset
- case EXTENSION:
- glDisable(GL_POLYGON_OFFSET_EXT);
- break;
-#endif
-#ifdef GL_VERSION_1_1
- case ONE_DOT_ONE:
- glDisable(GL_POLYGON_OFFSET_FILL);
- break;
-#endif
- case MISSING:
- /* Oh well. */
- break;
- }
- }
- if (stencilShadow) {
- glDisable(GL_STENCIL_TEST);
- }
- }
-
- glPushMatrix();
- glDisable(GL_LIGHTING);
- glColor3f(1.0, 1.0, 0.0);
- if (directionalLight) {
- /* Draw an arrowhead. */
- glDisable(GL_CULL_FACE);
- glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]);
- glRotatef(lightAngle * -180.0 / M_PI, 0, 1, 0);
- glRotatef(atan(lightHeight/12) * 180.0 / M_PI, 0, 0, 1);
- glBegin(GL_TRIANGLE_FAN);
- glVertex3f(0, 0, 0);
- glVertex3f(2, 1, 1);
- glVertex3f(2, -1, 1);
- glVertex3f(2, -1, -1);
- glVertex3f(2, 1, -1);
- glVertex3f(2, 1, 1);
- glEnd();
- /* Draw a white line from light direction. */
- glColor3f(1.0, 1.0, 1.0);
- glBegin(GL_LINES);
- glVertex3f(0, 0, 0);
- glVertex3f(5, 0, 0);
- glEnd();
- glEnable(GL_CULL_FACE);
- } else {
- /* Draw a yellow ball at the light source. */
- glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]);
- glutSolidSphere(1.0, 5, 5);
- }
- glEnable(GL_LIGHTING);
- glPopMatrix();
-
- glPopMatrix();
-
- if (reportSpeed) {
- glFinish();
- end = glutGet(GLUT_ELAPSED_TIME);
- printf("Speed %.3g frames/sec (%d ms)\n", 1000.0/(end-start), end-start);
- }
-
- glutSwapBuffers();
-}
-
-/* ARGSUSED2 */
-static void
-mouse(int button, int state, int x, int y)
-{
- if (button == GLUT_LEFT_BUTTON) {
- if (state == GLUT_DOWN) {
- moving = 1;
- startx = x;
- starty = y;
- }
- if (state == GLUT_UP) {
- moving = 0;
- }
- }
- if (button == GLUT_MIDDLE_BUTTON) {
- if (state == GLUT_DOWN) {
- lightMoving = 1;
- lightStartX = x;
- lightStartY = y;
- }
- if (state == GLUT_UP) {
- lightMoving = 0;
- }
- }
-}
-
-/* ARGSUSED1 */
-static void
-motion(int x, int y)
-{
- if (moving) {
- angle = angle + (x - startx);
- angle2 = angle2 + (y - starty);
- startx = x;
- starty = y;
- glutPostRedisplay();
- }
- if (lightMoving) {
- lightAngle += (x - lightStartX)/40.0;
- lightHeight += (lightStartY - y)/20.0;
- lightStartX = x;
- lightStartY = y;
- glutPostRedisplay();
- }
-}
-
-/* Advance time varying state when idle callback registered. */
-static void
-idle(void)
-{
- static float time = 0.0;
-
- time = glutGet(GLUT_ELAPSED_TIME) / 500.0;
-
- jump = 4.0 * fabs(sin(time)*0.5);
- if (!lightMoving) {
- lightAngle += 0.03;
- }
- glutPostRedisplay();
-}
-
-enum {
- M_NONE, M_MOTION, M_LIGHT, M_TEXTURE, M_SHADOWS, M_REFLECTION, M_DINOSAUR,
- M_STENCIL_REFLECTION, M_STENCIL_SHADOW, M_OFFSET_SHADOW,
- M_POSITIONAL, M_DIRECTIONAL, M_PERFORMANCE
-};
-
-static void
-controlLights(int value)
-{
- switch (value) {
- case M_NONE:
- return;
- case M_MOTION:
- animation = 1 - animation;
- if (animation) {
- glutIdleFunc(idle);
- } else {
- glutIdleFunc(NULL);
- }
- break;
- case M_LIGHT:
- lightSwitch = !lightSwitch;
- if (lightSwitch) {
- glEnable(GL_LIGHT0);
- } else {
- glDisable(GL_LIGHT0);
- }
- break;
- case M_TEXTURE:
- useTexture = !useTexture;
- break;
- case M_SHADOWS:
- renderShadow = 1 - renderShadow;
- break;
- case M_REFLECTION:
- renderReflection = 1 - renderReflection;
- break;
- case M_DINOSAUR:
- renderDinosaur = 1 - renderDinosaur;
- break;
- case M_STENCIL_REFLECTION:
- stencilReflection = 1 - stencilReflection;
- break;
- case M_STENCIL_SHADOW:
- stencilShadow = 1 - stencilShadow;
- break;
- case M_OFFSET_SHADOW:
- offsetShadow = 1 - offsetShadow;
- break;
- case M_POSITIONAL:
- directionalLight = 0;
- break;
- case M_DIRECTIONAL:
- directionalLight = 1;
- break;
- case M_PERFORMANCE:
- reportSpeed = 1 - reportSpeed;
- break;
- }
- glutPostRedisplay();
-}
-
-/* When not visible, stop animating. Restart when visible again. */
-static void
-visible(int vis)
-{
- if (vis == GLUT_VISIBLE) {
- if (animation)
- glutIdleFunc(idle);
- } else {
- if (!animation)
- glutIdleFunc(NULL);
- }
-}
-
-/* Press any key to redraw; good when motion stopped and
- performance reporting on. */
-/* ARGSUSED */
-static void
-key(unsigned char c, int x, int y)
-{
- if (c == 27) {
- exit(0); /* IRIS GLism, Escape quits. */
- }
- glutPostRedisplay();
-}
-
-/* Press any key to redraw; good when motion stopped and
- performance reporting on. */
-/* ARGSUSED */
-static void
-special(int k, int x, int y)
-{
- glutPostRedisplay();
-}
-
-static int
-supportsOneDotOne(void)
-{
- const char *version;
- int major, minor;
-
- version = (char *) glGetString(GL_VERSION);
- if (sscanf(version, "%d.%d", &major, &minor) == 2)
- return major >= 1 && minor >= 1;
- return 0; /* OpenGL version string malformed! */
-}
-
-int
-main(int argc, char **argv)
-{
- int i;
-
- glutInit(&argc, argv);
-
- for (i=1; i<argc; i++) {
- if (!strcmp("-linear", argv[i])) {
- linearFiltering = 1;
- } else if (!strcmp("-mipmap", argv[i])) {
- useMipmaps = 1;
- } else if (!strcmp("-ext", argv[i])) {
- forceExtension = 1;
- }
- }
-
- glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
-
-#if 0
- /* In GLUT 4.0, you'll be able to do this an be sure to
- get 2 bits of stencil if the machine has it for you. */
- glutInitDisplayString("samples stencil>=2 rgb double depth");
-#endif
-
- glutCreateWindow("Shadowy Leapin' Lizards");
-
- if (glutGet(GLUT_WINDOW_STENCIL_SIZE) <= 1) {
- printf("dinoshade: Sorry, I need at least 2 bits of stencil.\n");
- exit(1);
- }
-
- /* Register GLUT callbacks. */
- glutDisplayFunc(redraw);
- glutMouseFunc(mouse);
- glutMotionFunc(motion);
- glutVisibilityFunc(visible);
- glutKeyboardFunc(key);
- glutSpecialFunc(special);
-
- glutCreateMenu(controlLights);
-
- glutAddMenuEntry("Toggle motion", M_MOTION);
- glutAddMenuEntry("-----------------------", M_NONE);
- glutAddMenuEntry("Toggle light", M_LIGHT);
- glutAddMenuEntry("Toggle texture", M_TEXTURE);
- glutAddMenuEntry("Toggle shadows", M_SHADOWS);
- glutAddMenuEntry("Toggle reflection", M_REFLECTION);
- glutAddMenuEntry("Toggle dinosaur", M_DINOSAUR);
- glutAddMenuEntry("-----------------------", M_NONE);
- glutAddMenuEntry("Toggle reflection stenciling", M_STENCIL_REFLECTION);
- glutAddMenuEntry("Toggle shadow stenciling", M_STENCIL_SHADOW);
- glutAddMenuEntry("Toggle shadow offset", M_OFFSET_SHADOW);
- glutAddMenuEntry("----------------------", M_NONE);
- glutAddMenuEntry("Positional light", M_POSITIONAL);
- glutAddMenuEntry("Directional light", M_DIRECTIONAL);
- glutAddMenuEntry("-----------------------", M_NONE);
- glutAddMenuEntry("Toggle performance", M_PERFORMANCE);
- glutAttachMenu(GLUT_RIGHT_BUTTON);
- makeDinosaur();
-
-#ifdef GL_VERSION_1_1
- if (supportsOneDotOne() && !forceExtension) {
- polygonOffsetVersion = ONE_DOT_ONE;
- glPolygonOffset(-2.0, -9.0);
- } else
-#endif
- {
-#ifdef GL_EXT_polygon_offset
- /* check for the polygon offset extension */
- if (glutExtensionSupported("GL_EXT_polygon_offset")) {
- polygonOffsetVersion = EXTENSION;
- glPolygonOffsetEXT(-2.0, -0.002);
- } else
-#endif
- {
- polygonOffsetVersion = MISSING;
- printf("\ndinoshine: Missing polygon offset.\n");
- printf(" Expect shadow depth aliasing artifacts.\n\n");
- }
- }
-
- glEnable(GL_CULL_FACE);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_TEXTURE_2D);
- glLineWidth(3.0);
-
- glMatrixMode(GL_PROJECTION);
- gluPerspective( /* field of view in degree */ 40.0,
- /* aspect ratio */ 1.0,
- /* Z near */ 20.0, /* Z far */ 100.0);
- glMatrixMode(GL_MODELVIEW);
- gluLookAt(0.0, 8.0, 60.0, /* eye is at (0,8,60) */
- 0.0, 8.0, 0.0, /* center is at (0,8,0) */
- 0.0, 1.0, 0.); /* up is in postivie Y direction */
-
- glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor);
- glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1);
- glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05);
- glEnable(GL_LIGHT0);
- glEnable(GL_LIGHTING);
-
- makeFloorTexture();
-
- /* Setup floor plane for projected shadow calculations. */
- findPlane(floorPlane, floorVertices[1], floorVertices[2], floorVertices[3]);
-
- glutMainLoop();
- return 0; /* ANSI C requires main to return int. */
-}
diff --git a/progs/tests/ext422square.c b/progs/tests/ext422square.c
deleted file mode 100644
index 6533514d697..00000000000
--- a/progs/tests/ext422square.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Exercise the EXT_422_pixels extension, a less convenient
- * alternative to MESA_ycbcr_texture. Requires ARB_fragment_program
- * to perform the final YUV->RGB conversion.
- *
- * Brian Paul 13 September 2002
- * Keith Whitwell 30 November 2004
- */
-
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include <assert.h>
-
-#include "../util/readtex.c" /* I know, this is a hack. */
-
-#define TEXTURE_FILE "../images/tile.rgb"
-
-static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
-static GLint ImgWidth, ImgHeight;
-static GLushort *ImageYUV = NULL;
-static const GLuint yuvObj = 100;
-static const GLuint rgbObj = 101;
-
-static void Init( int argc, char *argv[] );
-
-static void DrawObject(void)
-{
- glBegin(GL_QUADS);
-
- glTexCoord2f(0, 0);
- glVertex2f(-1.0, -1.0);
-
- glTexCoord2f(1, 0);
- glVertex2f(1.0, -1.0);
-
- glTexCoord2f(1, 1);
- glVertex2f(1.0, 1.0);
-
- glTexCoord2f(0, 1);
- glVertex2f(-1.0, 1.0);
-
- glEnd();
-}
-
-static void Display( void )
-{
- static int firsttime = 1;
-
- if (firsttime) {
- firsttime = 0;
- Init( 0, 0 ); /* don't ask */
- }
-
- glClear( GL_COLOR_BUFFER_BIT );
- glBindTexture(GL_TEXTURE_2D, yuvObj);
-
- glPushMatrix();
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
- glTranslatef( -1.1, 0.0, -15.0 );
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glBindTexture(GL_TEXTURE_2D, yuvObj);
- DrawObject();
- glPopMatrix();
-
- glPushMatrix();
- glDisable(GL_FRAGMENT_PROGRAM_ARB);
- glTranslatef( 1.1, 0.0, -15.0 );
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glBindTexture(GL_TEXTURE_2D, rgbObj);
- DrawObject();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.1, 1.1, -1.1, 1.1, 10.0, 100.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-/* #define LINEAR_FILTER */
-
-static void Init( int argc, char *argv[] )
-{
- const char *file;
- const GLfloat yuvtorgb[16] = {
- 1.164, 1.164, 1.164, 0,
- 0, -.391, 2.018, 0,
- 1.596, -.813, 0.0, 0,
- (-.0625*1.164 + -.5*1.596), (-.0625*1.164 + -.5*-.813 + -.5*-.391), (-.0625*1.164 + -.5*2.018), 1
- };
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
-
- if (!glutExtensionSupported("GL_EXT_422_pixels")) {
- printf("Error: GL_EXT_422_pixels not supported!\n");
- exit(1);
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- file = TEXTURE_FILE;
-
- /* Load the texture as YCbCr.
- */
- glBindTexture(GL_TEXTURE_2D, yuvObj);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight );
- if (!ImageYUV) {
- printf("Couldn't read %s\n", TEXTURE_FILE);
- exit(0);
- }
-
- glTexImage2D(GL_TEXTURE_2D, 0,
- GL_RGB,
- ImgWidth, ImgHeight, 0,
- GL_422_EXT,
- GL_UNSIGNED_BYTE, ImageYUV);
-
- glEnable(GL_TEXTURE_2D);
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- {
- static const char *modulateYUV =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "TEX R0, fragment.texcoord[0], texture[0], 2D; \n"
-
- "ADD R0, R0, {-0.0625, -0.5, -0.5, 0.0}; \n"
- "DP3 result.color.x, R0, {1.164, 1.596, 0.0}; \n"
- "DP3 result.color.y, R0, {1.164, -0.813, -0.391}; \n"
- "DP3 result.color.z, R0, {1.164, 0.0, 2.018}; \n"
- "MOV result.color.w, R0.w; \n"
-
- "END"
- ;
-
- GLuint modulateProg;
-
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulateYUV), (const GLubyte *)modulateYUV);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- assert(glIsProgramARB(modulateProg));
-
- }
-
- /* Now the same, but use a color matrix to do the conversion at
- * upload time:
- */
- glBindTexture(GL_TEXTURE_2D, rgbObj);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glMatrixMode( GL_COLOR_MATRIX );
- glLoadMatrixf( yuvtorgb );
-
- glTexImage2D(GL_TEXTURE_2D, 0,
- GL_RGB,
- ImgWidth, ImgHeight, 0,
- GL_422_EXT,
- GL_UNSIGNED_BYTE, ImageYUV);
-
- glLoadIdentity();
- glMatrixMode( GL_MODELVIEW );
-
- glEnable(GL_TEXTURE_2D);
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
-
- glShadeModel(GL_FLAT);
- glClearColor(0.3, 0.3, 0.4, 1.0);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowSize( 300, 300 );
- glutInitWindowPosition( 0, 0 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0] );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/fbotest1.c b/progs/tests/fbotest1.c
deleted file mode 100644
index ed72ab16dd8..00000000000
--- a/progs/tests/fbotest1.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Test GL_EXT_framebuffer_object
- *
- * Brian Paul
- * 7 Feb 2005
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-static int Width = 400, Height = 400;
-static GLuint MyFB, MyRB;
-
-
-static void
-CheckError(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("GL Error 0x%x at line %d\n", (int) err, line);
- }
-}
-
-
-static void
-Display( void )
-{
- GLubyte *buffer = malloc(Width * Height * 4);
- GLenum status;
-
- /* draw to user framebuffer */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
- glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
- glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
-
- status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
- if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- printf("Framebuffer incomplete!!!\n");
- }
-
- glClearColor(0.5, 0.5, 1.0, 0.0);
- glClear( GL_COLOR_BUFFER_BIT );
-
- glBegin(GL_POLYGON);
- glColor3f(1, 0, 0);
- glVertex2f(-1, -1);
- glColor3f(0, 1, 0);
- glVertex2f(1, -1);
- glColor3f(0, 0, 1);
- glVertex2f(0, 1);
- glEnd();
-
- /* read from user framebuffer */
- glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
-
- /* draw to window */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- glWindowPos2iARB(0, 0);
- glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
-
- free(buffer);
- glutSwapBuffers();
- CheckError(__LINE__);
-}
-
-
-static void
-Reshape( int width, int height )
-{
-#if 0
- float ar = (float) width / (float) height;
-#endif
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
-#if 0
- glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 );
-#else
- glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
-#endif
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
- Width = width;
- Height = height;
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
-}
-
-
-static void
-CleanUp(void)
-{
- glDeleteFramebuffersEXT(1, &MyFB);
- glDeleteRenderbuffersEXT(1, &MyRB);
- assert(!glIsFramebufferEXT(MyFB));
- assert(!glIsRenderbufferEXT(MyRB));
- exit(0);
-}
-
-
-static void
-Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- CleanUp();
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init( void )
-{
- GLint i;
-
- if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
- printf("GL_EXT_framebuffer_object not found!\n");
- /*exit(0);*/
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- glGenFramebuffersEXT(1, &MyFB);
- assert(MyFB);
- assert(!glIsFramebufferEXT(MyFB));
- glDeleteFramebuffersEXT(1, &MyFB);
- assert(!glIsFramebufferEXT(MyFB));
- /* Note, continue to use MyFB below */
-
- glGenRenderbuffersEXT(1, &MyRB);
- assert(MyRB);
- assert(!glIsRenderbufferEXT(MyRB));
- glDeleteRenderbuffersEXT(1, &MyRB);
- assert(!glIsRenderbufferEXT(MyRB));
- MyRB = 42; /* an arbitrary ID */
-
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
- assert(glIsFramebufferEXT(MyFB));
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, MyRB);
- assert(glIsRenderbufferEXT(MyRB));
-
- glGetIntegerv(GL_RENDERBUFFER_BINDING_EXT, &i);
- assert(i == MyRB);
-
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
- assert(i == MyFB);
-
- CheckError(__LINE__);
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
- GL_RENDERBUFFER_EXT, MyRB);
-
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
-
- CheckError(__LINE__);
-
- {
- GLint r, g, b, a;
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_RED_SIZE_EXT, &r);
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_GREEN_SIZE_EXT, &g);
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_BLUE_SIZE_EXT, &b);
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_ALPHA_SIZE_EXT, &a);
- CheckError(__LINE__);
- printf("renderbuffer RGBA sizes = %d %d %d %d\n", r, g, b, a);
-
- glGetIntegerv(GL_RED_BITS, &r);
- glGetIntegerv(GL_GREEN_BITS, &g);
- glGetIntegerv(GL_BLUE_BITS, &b);
- glGetIntegerv(GL_ALPHA_BITS, &a);
- printf("Visual RGBA sizes = %d %d %d %d\n", r, g, b, a);
- }
-
- /* restore to default */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- CheckError(__LINE__);
-}
-
-
-int
-main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize(Width, Height);
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/fbotest2.c b/progs/tests/fbotest2.c
deleted file mode 100644
index c3117b0f767..00000000000
--- a/progs/tests/fbotest2.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Test GL_EXT_framebuffer_object
- *
- * Brian Paul
- * 19 Mar 2006
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-static int Width = 400, Height = 400;
-static GLuint MyFB, ColorRb, DepthRb;
-static GLboolean Animate = GL_TRUE;
-static GLfloat Rotation = 0.0;
-
-
-static void
-CheckError(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("fbotest2: GL Error 0x%x at line %d\n", (int) err, line);
- }
-}
-
-
-static void
-Display( void )
-{
- GLubyte *buffer = malloc(Width * Height * 4);
- GLenum status;
-
- CheckError(__LINE__);
-
- /* draw to user framebuffer */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
- glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
- glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
-
- status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
- if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- printf("fbotest2: Error: Framebuffer is incomplete!!!\n");
- }
-
- CheckError(__LINE__);
-
- glClearColor(0.5, 0.5, 1.0, 0.0);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
-
- glPushMatrix();
- glRotatef(30.0, 1, 0, 0);
- glRotatef(Rotation, 0, 1, 0);
- glutSolidTeapot(2.0);
- glPopMatrix();
-
- /* read from user framebuffer */
- glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
-
- /* draw to window */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- glWindowPos2iARB(0, 0);
- glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
-
- free(buffer);
- glutSwapBuffers();
- CheckError(__LINE__);
-}
-
-
-static void
-Reshape( int width, int height )
-{
- float ar = (float) width / (float) height;
-
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 );
-
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, width, height);
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb);
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
- width, height);
-
- Width = width;
- Height = height;
-}
-
-
-static void
-CleanUp(void)
-{
- glDeleteFramebuffersEXT(1, &MyFB);
- glDeleteRenderbuffersEXT(1, &ColorRb);
- glDeleteRenderbuffersEXT(1, &DepthRb);
- assert(!glIsFramebufferEXT(MyFB));
- assert(!glIsRenderbufferEXT(ColorRb));
- assert(!glIsRenderbufferEXT(DepthRb));
- exit(0);
-}
-
-
-static void
-Idle(void)
-{
- Rotation = glutGet(GLUT_ELAPSED_TIME) * 0.1;
- glutPostRedisplay();
-}
-
-
-static void
-Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Animate = !Animate;
- if (Animate)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 27:
- CleanUp();
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init( void )
-{
- if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
- printf("fbotest2: GL_EXT_framebuffer_object not found!\n");
- exit(0);
- }
- printf("fbotest2: GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- glGenFramebuffersEXT(1, &MyFB);
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
- assert(glIsFramebufferEXT(MyFB));
-
- /* set color buffer */
- glGenRenderbuffersEXT(1, &ColorRb);
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
- assert(glIsRenderbufferEXT(ColorRb));
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
- GL_RENDERBUFFER_EXT, ColorRb);
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
-
- /* setup depth buffer */
- glGenRenderbuffersEXT(1, &DepthRb);
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb);
- assert(glIsRenderbufferEXT(DepthRb));
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, DepthRb);
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, Width, Height);
-
- CheckError(__LINE__);
-
- /* restore to default */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- CheckError(__LINE__);
-}
-
-
-int
-main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize(Width, Height);
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- if (Animate)
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/fbotexture.c b/progs/tests/fbotexture.c
deleted file mode 100644
index 13a29db3f35..00000000000
--- a/progs/tests/fbotexture.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- * Test GL_EXT_framebuffer_object render-to-texture
- *
- * Draw a teapot into a texture image with stenciling.
- * Then draw a textured quad using that texture.
- *
- * Brian Paul
- * 18 Apr 2005
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-/* For debug */
-#define DEPTH 1
-#define STENCIL 1
-#define DRAW 1
-
-
-static int Width = 400, Height = 400;
-
-static GLenum TexTarget = GL_TEXTURE_2D; /*GL_TEXTURE_RECTANGLE_ARB;*/
-static int TexWidth = 512, TexHeight = 512;
-/*static int TexWidth = 600, TexHeight = 600;*/
-
-static GLuint MyFB;
-static GLuint TexObj;
-static GLuint DepthRB, StencilRB;
-static GLboolean Anim = GL_FALSE;
-static GLfloat Rot = 0.0;
-static GLboolean UsePackedDepthStencil = GL_FALSE;
-static GLuint TextureLevel = 1; /* which texture level to render to */
-static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
-
-
-static void
-CheckError(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("GL Error 0x%x at line %d\n", (int) err, line);
- }
-}
-
-
-static void
-Idle(void)
-{
- Rot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
- glutPostRedisplay();
-}
-
-
-static void
-RenderTexture(void)
-{
- GLenum status;
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -15.0);
-
- /* draw to texture image */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
-
- status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
- if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- printf("Framebuffer incomplete!!!\n");
- }
-
- glViewport(0, 0, TexWidth, TexHeight);
-
- glClearColor(0.5, 0.5, 1.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- CheckError(__LINE__);
-
-#if DEPTH
- glEnable(GL_DEPTH_TEST);
-#endif
-
-#if STENCIL
- glEnable(GL_STENCIL_TEST);
- glStencilFunc(GL_NEVER, 1, ~0);
- glStencilOp(GL_REPLACE, GL_KEEP, GL_REPLACE);
-#endif
-
- CheckError(__LINE__);
-
-#if DEPTH || STENCIL
- /* draw diamond-shaped stencil pattern */
- glColor3f(0, 1, 0);
- glBegin(GL_POLYGON);
- glVertex2f(-0.2, 0.0);
- glVertex2f( 0.0, -0.2);
- glVertex2f( 0.2, 0.0);
- glVertex2f( 0.0, 0.2);
- glEnd();
-#endif
-
- /* draw teapot where stencil != 1 */
-#if STENCIL
- glStencilFunc(GL_NOTEQUAL, 1, ~0);
- glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
-#endif
-
- CheckError(__LINE__);
-
-#if 0
- glBegin(GL_POLYGON);
- glColor3f(1, 0, 0);
- glVertex2f(-1, -1);
- glColor3f(0, 1, 0);
- glVertex2f(1, -1);
- glColor3f(0, 0, 1);
- glVertex2f(0, 1);
- glEnd();
-#else
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glPushMatrix();
- glRotatef(0.5 * Rot, 1.0, 0.0, 0.0);
- glutSolidTeapot(0.5);
- glPopMatrix();
- glDisable(GL_LIGHTING);
- /*
- PrintStencilHistogram(TexWidth, TexHeight);
- */
-#endif
-
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_STENCIL_TEST);
-
-#if DRAW
- /* Bind normal framebuffer */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-#endif
-
- CheckError(__LINE__);
-}
-
-
-
-static void
-Display(void)
-{
- float ar = (float) Width / (float) Height;
-
- RenderTexture();
-
- /* draw textured quad in the window */
-#if DRAW
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -7.0);
-
- glViewport(0, 0, Width, Height);
-
- glClearColor(0.25, 0.25, 0.25, 0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glPushMatrix();
- glRotatef(Rot, 0, 1, 0);
- glEnable(TexTarget);
- glBindTexture(TexTarget, TexObj);
- glBegin(GL_POLYGON);
- glColor3f(0.25, 0.25, 0.25);
- if (TexTarget == GL_TEXTURE_2D) {
- glTexCoord2f(0, 0);
- glVertex2f(-1, -1);
- glTexCoord2f(1, 0);
- glVertex2f(1, -1);
- glColor3f(1.0, 1.0, 1.0);
- glTexCoord2f(1, 1);
- glVertex2f(1, 1);
- glTexCoord2f(0, 1);
- glVertex2f(-1, 1);
- }
- else {
- assert(TexTarget == GL_TEXTURE_RECTANGLE_ARB);
- glTexCoord2f(0, 0);
- glVertex2f(-1, -1);
- glTexCoord2f(TexWidth, 0);
- glVertex2f(1, -1);
- glColor3f(1.0, 1.0, 1.0);
- glTexCoord2f(TexWidth, TexHeight);
- glVertex2f(1, 1);
- glTexCoord2f(0, TexHeight);
- glVertex2f(-1, 1);
- }
- glEnd();
- glPopMatrix();
- glDisable(TexTarget);
-#endif
-
- glutSwapBuffers();
- CheckError(__LINE__);
-}
-
-
-static void
-Reshape(int width, int height)
-{
- glViewport(0, 0, width, height);
- Width = width;
- Height = height;
-}
-
-
-static void
-CleanUp(void)
-{
-#if DEPTH
- glDeleteRenderbuffersEXT(1, &DepthRB);
-#endif
-#if STENCIL
- if (!UsePackedDepthStencil)
- glDeleteRenderbuffersEXT(1, &StencilRB);
-#endif
- glDeleteFramebuffersEXT(1, &MyFB);
-
- glDeleteTextures(1, &TexObj);
-
- exit(0);
-}
-
-
-static void
-Key(unsigned char key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 's':
- Rot += 2.0;
- break;
- case 27:
- CleanUp();
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init(int argc, char *argv[])
-{
- static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
- GLint i;
-
- if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
- printf("GL_EXT_framebuffer_object not found!\n");
- exit(0);
- }
-
- if (argc > 1 && strcmp(argv[1], "-ds") == 0) {
- if (!glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
- printf("GL_EXT_packed_depth_stencil not found!\n");
- exit(0);
- }
- UsePackedDepthStencil = GL_TRUE;
- printf("Using GL_EXT_packed_depth_stencil\n");
- }
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* gen framebuffer id, delete it, do some assertions, just for testing */
- glGenFramebuffersEXT(1, &MyFB);
- assert(MyFB);
- assert(!glIsFramebufferEXT(MyFB));
- glDeleteFramebuffersEXT(1, &MyFB);
- assert(!glIsFramebufferEXT(MyFB));
- /* Note, continue to use MyFB below */
-
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
- assert(glIsFramebufferEXT(MyFB));
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
- assert(i == MyFB);
-
- /* Make texture object/image */
- glGenTextures(1, &TexObj);
- glBindTexture(TexTarget, TexObj);
- /* make two image levels */
- glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- TexWidth = TexWidth >> TextureLevel;
- TexHeight = TexHeight >> TextureLevel;
-
- glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
- glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
-
- CheckError(__LINE__);
-
- /* Render color to texture */
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
- TexTarget, TexObj, TextureLevel);
-
-
-#if DEPTH
- /* make depth renderbuffer */
- glGenRenderbuffersEXT(1, &DepthRB);
- assert(DepthRB);
- assert(!glIsRenderbufferEXT(DepthRB));
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
- assert(glIsRenderbufferEXT(DepthRB));
- if (UsePackedDepthStencil)
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT,
- TexWidth, TexHeight);
- else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
- TexWidth, TexHeight);
- CheckError(__LINE__);
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
- CheckError(__LINE__);
- printf("Depth renderbuffer size = %d bits\n", i);
- assert(i > 0);
-
- /* attach DepthRB to MyFB */
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, DepthRB);
-#endif
-
- CheckError(__LINE__);
-
-#if STENCIL
- if (UsePackedDepthStencil) {
- /* DepthRb is a combined depth/stencil renderbuffer */
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
- GL_STENCIL_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, DepthRB);
- }
- else {
- /* make stencil renderbuffer */
- glGenRenderbuffersEXT(1, &StencilRB);
- assert(StencilRB);
- assert(!glIsRenderbufferEXT(StencilRB));
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB);
- assert(glIsRenderbufferEXT(StencilRB));
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX,
- TexWidth, TexHeight);
- /* attach StencilRB to MyFB */
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
- GL_STENCIL_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, StencilRB);
- }
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_STENCIL_SIZE_EXT, &i);
- CheckError(__LINE__);
- printf("Stencil renderbuffer size = %d bits\n", i);
- assert(i > 0);
-#endif
-
- CheckError(__LINE__);
-
- /* bind regular framebuffer */
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-
-
- /* lighting */
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat);
-}
-
-
-int
-main(int argc, char *argv[])
-{
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(Width, Height);
- glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
- glutCreateWindow(argv[0]);
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Display);
- if (Anim)
- glutIdleFunc(Idle);
- Init(argc, argv);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/floattex.c b/progs/tests/floattex.c
deleted file mode 100644
index 2345a49b270..00000000000
--- a/progs/tests/floattex.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Test floating point textures.
- * No actual rendering, yet.
- */
-
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-
-/* XXX - temporary */
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-#define GL_TEXTURE_RED_TYPE_ARB 0x9000
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x9001
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x9002
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x9003
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x9004
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x9005
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x9006
-#define GL_UNSIGNED_NORMALIZED_ARB 0x9007
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#endif
-
-
-static GLboolean
-CheckError( int line )
-{
- GLenum error = glGetError();
- if (error) {
- char *err = (char *) gluErrorString( error );
- fprintf( stderr, "GL Error: %s at line %d\n", err, line );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-
-static void
-Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glPushMatrix();
-
- glutSolidCube(2.0);
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void
-Reshape(int width, int height)
-{
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -15.0);
-}
-
-
-static void
-Key(unsigned char key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-static void
-Init(void)
-{
- GLfloat tex[16][16][4];
- GLfloat tex2[16][16][4];
- GLint i, j, t;
-
- if (!glutExtensionSupported("GL_MESAX_texture_float")) {
- printf("Sorry, this test requires GL_MESAX_texture_float\n");
- exit(1);
- }
-
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j++) {
- GLfloat s = i / 15.0;
- tex[i][j][0] = s;
- tex[i][j][1] = 2.0 * s;
- tex[i][j][2] = -3.0 * s;
- tex[i][j][3] = 4.0 * s;
- }
- }
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB, 16, 16, 0, GL_RGBA,
- GL_FLOAT, tex);
- CheckError(__LINE__);
-
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_TYPE_ARB, &t);
- assert(t == GL_FLOAT);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_TYPE_ARB, &t);
- assert(t == GL_FLOAT);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_TYPE_ARB, &t);
- assert(t == GL_FLOAT);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_TYPE_ARB, &t);
- assert(t == GL_FLOAT);
-
- CheckError(__LINE__);
-
- /* read back the texture and make sure values are correct */
- glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, tex2);
- CheckError(__LINE__);
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j++) {
- if (tex[i][j][0] != tex2[i][j][0] ||
- tex[i][j][1] != tex2[i][j][1] ||
- tex[i][j][2] != tex2[i][j][2] ||
- tex[i][j][3] != tex2[i][j][3]) {
- printf("tex[%d][%d] %g %g %g %g != tex2[%d][%d] %g %g %g %g\n",
- i, j,
- tex[i][j][0], tex[i][j][1], tex[i][j][2], tex[i][j][3],
- i, j,
- tex2[i][j][0], tex2[i][j][1], tex2[i][j][2], tex2[i][j][3]);
- }
- }
- }
-
-
-}
-
-
-int
-main(int argc, char *argv[])
-{
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(400, 400);
- glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
- glutCreateWindow(argv[0]);
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/fog.c b/progs/tests/fog.c
deleted file mode 100644
index ecd9f533f99..00000000000
--- a/progs/tests/fog.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright 2005 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, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- * Brian Paul (fogcoord.c used as a skeleton)
- */
-
-/*
- * Test to exercise fog modes and for comparison with GL_EXT_fog_coord.
- */
-
-#define GL_GLEXT_PROTOTYPES
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-static int Width = 600;
-static int Height = 600;
-static GLfloat Near = 0.0, Far = 1.0;
-GLboolean has_fogcoord;
-
-static void drawString( const char *string )
-{
- glRasterPos2f(0, .5);
- while ( *string ) {
- glutBitmapCharacter( GLUT_BITMAP_TIMES_ROMAN_10, *string );
- string++;
- }
-}
-
-static void Display( void )
-{
- GLint i, depthi;
- GLfloat fogcolor[4] = {1, 1, 1, 1};
-
- glEnable(GL_FOG);
- glFogfv(GL_FOG_COLOR, fogcolor);
-
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- for (i = 0; i < 6; i++) {
- if (i >= 3 && !has_fogcoord)
- break;
-
- glPushMatrix();
- for (depthi = 0; depthi < 5; depthi++) {
- GLfloat depth = Near + (Far - Near) * depthi / 4;
-
- switch (i % 3) {
- case 0:
- glFogi(GL_FOG_MODE, GL_LINEAR);
- glFogf(GL_FOG_START, Near);
- glFogf(GL_FOG_END, Far);
- break;
- case 1:
- glFogi(GL_FOG_MODE, GL_EXP);
- glFogf(GL_FOG_DENSITY, 2);
- break;
- case 2:
- glFogi(GL_FOG_MODE, GL_EXP2);
- glFogf(GL_FOG_DENSITY, 2);
- break;
- }
-
- glColor4f(0, 0, 0, 0);
- if (i < 3) {
- if (has_fogcoord)
- glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT);
-
- glBegin(GL_POLYGON);
- glVertex3f(0, 0, depth);
- glVertex3f(1, 0, depth);
- glVertex3f(1, 1, depth);
- glVertex3f(0, 1, depth);
- glEnd();
- } else {
- glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
- glFogCoordfEXT(depth);
-
- glBegin(GL_POLYGON);
- glVertex3f(0, 0, (Near + Far) / 2);
- glVertex3f(1, 0, (Near + Far) / 2);
- glVertex3f(1, 1, (Near + Far) / 2);
- glVertex3f(0, 1, (Near + Far) / 2);
- glEnd();
- }
- glTranslatef(1.5, 0, 0);
- }
-
- glTranslatef(.1, 0, 0);
- switch (i) {
- case 0:
- drawString("GL_LINEAR");
- break;
- case 1:
- drawString("GL_EXP");
- break;
- case 2:
- drawString("GL_EXP2");
- break;
- case 3:
- drawString("GL_FOGCOORD GL_LINEAR");
- break;
- case 4:
- drawString("GL_FOGCOORD GL_EXP");
- break;
- case 5:
- drawString("GL_FOGCOORD GL_EXP2");
- break;
- }
-
- glPopMatrix();
- glTranslatef(0, 1.5, 0);
- }
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
-
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho( 0, 11, 9, 0, -Near, -Far );
-
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef(.25, .25, 0);
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- /* setup lighting, etc */
- has_fogcoord = glutExtensionSupported("GL_EXT_fog_coord");
- if (!has_fogcoord) {
- printf("Some output of this program requires GL_EXT_fog_coord\n");
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/fogcoord.c b/progs/tests/fogcoord.c
deleted file mode 100644
index 89355742aad..00000000000
--- a/progs/tests/fogcoord.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Exercise GL_EXT_fog_coord
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-static int Width = 600;
-static int Height = 200;
-static GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
- GLfloat t;
-
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- for (t = 0.0; t <= 1.0; t += 0.25) {
- GLfloat f = Near + t * (Far - Near);
- printf("glFogCoord(%4.1f)\n", f);
- glFogCoordfEXT(f);
-
- glPushMatrix();
- glTranslatef(t * 10.0 - 5.0, 0, 0);
- glBegin(GL_POLYGON);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
- glPopMatrix();
- }
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- /* setup lighting, etc */
- if (!glutExtensionSupported("GL_EXT_fog_coord")) {
- printf("Sorry, this program requires GL_EXT_fog_coord\n");
- exit(1);
- }
- glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
- glFogi(GL_FOG_MODE, GL_LINEAR);
- glFogf(GL_FOG_START, Near);
- glFogf(GL_FOG_END, Far);
- glEnable(GL_FOG);
- printf("Squares should be colored from white -> gray -> black.\n");
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/fptest1.c b/progs/tests/fptest1.c
deleted file mode 100644
index 095190a8aef..00000000000
--- a/progs/tests/fptest1.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Test GL_NV_fragment_program */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
-
- glColor4f(0, 0.5, 0, 1);
- glColor4f(0, 1, 0, 1);
- glBegin(GL_POLYGON);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 0, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- static const char *prog0 =
- "!!FP1.0\n"
- "MUL o[COLR], R0, f[WPOS]; \n"
- "ADD o[COLH], H3, f[TEX0]; \n"
- "ADD_SAT o[COLH], H3, f[TEX0]; \n"
- "ADDX o[COLH], H3, f[TEX0]; \n"
- "ADDHC o[COLH], H3, f[TEX0]; \n"
- "ADDXC o[COLH], H3, f[TEX0]; \n"
- "ADDXC_SAT o[COLH], H30, f[TEX0]; \n"
- "MUL o[COLR].xy, R0.wzyx, f[WPOS]; \n"
- "MUL o[COLR], H0, f[WPOS]; \n"
- "MUL o[COLR], -H0, f[WPOS]; \n"
- "MOV RC, H1; \n"
- "MOV HC, H2; \n"
- "END \n"
- ;
-
- /* masked updates, defines, declarations */
- static const char *prog1 =
- "!!FP1.0\n"
- "DEFINE foo = {1, 2, 3, 4}; \n"
- "DEFINE foo2 = 5; \n"
- "DECLARE foo3 = {5, 6, 7, 8}; \n"
- "DECLARE bar = 3; \n"
- "DECLARE bar2; \n"
- "DECLARE bar3 = bar; \n"
- "#DECLARE bar4 = { a, b, c, d }; \n"
- "MOV o[COLR].xy, R0; \n"
- "MOV o[COLR] (NE), R0; \n"
- "MOV o[COLR] (NE.wzyx), R0; \n"
- "MOV o[COLR].xy (NE.wzyx), R0; \n"
- "MOV RC.x (EQ), R1.x; \n"
- "KIL NE; \n"
- "KIL EQ.xyxy; \n"
- "END \n"
- ;
-
- /* texture instructions */
- static const char *prog2 =
- "!!FP1.0\n"
- "TEX R0, f[TEX0], TEX0, 2D; \n"
- "TEX R1, f[TEX1], TEX1, CUBE; \n"
- "TEX R2, f[TEX2], TEX2, 3D; \n"
- "TXP R3, f[TEX3], TEX3, RECT; \n"
- "TXD R3, R2, R1, f[TEX3], TEX3, RECT; \n"
- "MUL o[COLR], R0, f[COL0]; \n"
- "END \n"
- ;
-
- /* test negation, absolute value */
- static const char *prog3 =
- "!!FP1.0\n"
- "MOV R0, -R1; \n"
- "MOV R0, +R1; \n"
- "MOV R0, |-R1|; \n"
- "MOV R0, |+R1|; \n"
- "MOV R0, -|R1|; \n"
- "MOV R0, +|R1|; \n"
- "MOV R0, -|-R1|; \n"
- "MOV R0, -|+R1|; \n"
- "MOV o[COLR], R0; \n"
- "END \n"
- ;
-
- /* literal constant sources */
- static const char *prog4 =
- "!!FP1.0\n"
- "DEFINE Pi = 3.14159; \n"
- "MOV R0, {1, -2, +3, 4}; \n"
- "MOV R0, 5; \n"
- "MOV R0, -5; \n"
- "MOV R0, +5; \n"
- "MOV R0, Pi; \n"
- "MOV o[COLR], R0; \n"
- "END \n"
- ;
-
- /* change the fragment color in a simple way */
- static const char *prog10 =
- "!!FP1.0\n"
- "DEFINE blue = {0, 0, 1, 0};\n"
- "DECLARE color; \n"
- "MOV R0, f[COL0]; \n"
- "#ADD o[COLR], R0, f[COL0]; \n"
- "#ADD o[COLR], blue, f[COL0]; \n"
- "#ADD o[COLR], {1, 0, 0, 0}, f[COL0]; \n"
- "ADD o[COLR], color, f[COL0]; \n"
- "END \n"
- ;
-
- GLuint progs[20];
-
- if (!glutExtensionSupported ("GL_NV_fragment_program")) {
- printf("Sorry, this program requires GL_NV_fragment_program\n");
- exit(1);
- }
-
- glGenProgramsNV(20, progs);
- assert(progs[0]);
- assert(progs[1]);
- assert(progs[0] != progs[1]);
-
-#if 0
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[0],
- strlen(prog0),
- (const GLubyte *) prog0);
- assert(glIsProgramNV(progs[0]));
-#endif
-
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[1],
- strlen(prog1),
- (const GLubyte *) prog1);
- assert(glIsProgramNV(progs[1]));
-
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[2],
- strlen(prog2),
- (const GLubyte *) prog2);
- assert(glIsProgramNV(progs[2]));
- glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[2]);
-
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[3],
- strlen(prog3),
- (const GLubyte *) prog3);
- assert(glIsProgramNV(progs[3]));
- glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[3]);
-
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[4],
- strlen(prog4),
- (const GLubyte *) prog4);
- assert(glIsProgramNV(progs[4]));
- glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[4]);
-
-
- /* a real program */
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[10],
- strlen(prog10),
- (const GLubyte *) prog10);
- assert(glIsProgramNV(progs[10]));
- glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[10]);
-
- glProgramNamedParameter4fNV(progs[10],
- strlen("color"), (const GLubyte *) "color",
- 1, 0, 0, 1);
-
- glEnable(GL_FRAGMENT_PROGRAM_NV);
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_ALWAYS, 0.0);
-
- printf("glGetError = %d\n", (int) glGetError());
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/fptexture.c b/progs/tests/fptexture.c
deleted file mode 100644
index f57ad628282..00000000000
--- a/progs/tests/fptexture.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* GL_NV_fragment_program texture test */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-#include "../util/readtex.c"
-
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
-
- glBegin(GL_POLYGON);
- glColor4f(1.0, 1.0, 1.0, 1); glTexCoord2f(0, 0); glVertex2f(-1, -1);
- glColor4f(0.2, 0.2, 1.0, 1); glTexCoord2f(1, 0); glVertex2f( 1, -1);
- glColor4f(0.2, 1.0, 0.2, 1); glTexCoord2f(1, 1); glVertex2f( 1, 1);
- glColor4f(1.0, 0.2, 0.2, 1); glTexCoord2f(0, 1); glVertex2f(-1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -8.0 );
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!FP1.0\n"
- "TEX R0, f[TEX0], TEX0, 2D; \n"
- "MUL o[COLR], R0, f[COL0]; \n"
- "END"
- ;
- GLuint modulateProg;
- GLuint Texture;
-
- if (!glutExtensionSupported("GL_NV_fragment_program")) {
- printf("Error: GL_NV_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsNV(1, &modulateProg);
- glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, modulateProg,
- strlen(modulate2D),
- (const GLubyte *) modulate2D);
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_NV) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_NV));
- assert(glIsProgramNV(modulateProg));
-
- glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, modulateProg);
- glEnable(GL_FRAGMENT_PROGRAM_NV);
-
- /* Load texture */
- glGenTextures(1, &Texture);
- glBindTexture(GL_TEXTURE_2D, Texture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE);
- exit(1);
- }
- /* XXX this enable shouldn't really be needed!!! */
- glEnable(GL_TEXTURE_2D);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/getprocaddress.c b/progs/tests/getprocaddress.c
deleted file mode 100644
index 8cca200f215..00000000000
--- a/progs/tests/getprocaddress.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * Test that glXGetProcAddress works.
- */
-
-#define GLX_GLXEXT_PROTOTYPES
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-
-typedef void (*generic_func)();
-
-#define EQUAL(X, Y) (fabs((X) - (Y)) < 0.001)
-
-/**
- * The following functions are used to check that the named OpenGL function
- * actually does what it's supposed to do.
- * The naming of these functions is signficant. The getprocaddress.py script
- * scans this file and extracts these function names.
- */
-
-
-static GLboolean
-test_ActiveTextureARB(generic_func func)
-{
- PFNGLACTIVETEXTUREARBPROC activeTexture = (PFNGLACTIVETEXTUREARBPROC) func;
- GLint t;
- GLboolean pass;
- (*activeTexture)(GL_TEXTURE1_ARB);
- glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &t);
- pass = (t == GL_TEXTURE1_ARB);
- (*activeTexture)(GL_TEXTURE0_ARB); /* restore default */
- return pass;
-}
-
-
-static GLboolean
-test_SecondaryColor3fEXT(generic_func func)
-{
- PFNGLSECONDARYCOLOR3FEXTPROC secColor3f = (PFNGLSECONDARYCOLOR3FEXTPROC) func;
- GLfloat color[4];
- GLboolean pass;
- (*secColor3f)(1.0, 1.0, 0.0);
- glGetFloatv(GL_CURRENT_SECONDARY_COLOR_EXT, color);
- pass = (color[0] == 1.0 && color[1] == 1.0 && color[2] == 0.0);
- (*secColor3f)(0.0, 0.0, 0.0); /* restore default */
- return pass;
-}
-
-
-static GLboolean
-test_ActiveStencilFaceEXT(generic_func func)
-{
- PFNGLACTIVESTENCILFACEEXTPROC activeFace = (PFNGLACTIVESTENCILFACEEXTPROC) func;
- GLint face;
- GLboolean pass;
- (*activeFace)(GL_BACK);
- glGetIntegerv(GL_ACTIVE_STENCIL_FACE_EXT, &face);
- pass = (face == GL_BACK);
- (*activeFace)(GL_FRONT); /* restore default */
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib1fvARB(generic_func func)
-{
- PFNGLVERTEXATTRIB1FVARBPROC vertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC) func;
- PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
-
- const GLfloat v[1] = {25.0};
- const GLfloat def[1] = {0};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib1fvARB)(6, v);
- (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res);
- pass = (res[0] == 25.0 && res[1] == 0.0 && res[2] == 0.0 && res[3] == 1.0);
- (*vertexAttrib1fvARB)(6, def);
- return pass;
-}
-
-static GLboolean
-test_VertexAttrib4NubvARB(generic_func func)
-{
- PFNGLVERTEXATTRIB4NUBVARBPROC vertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC) func;
- PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
-
- const GLubyte v[4] = {255, 0, 255, 0};
- const GLubyte def[4] = {0, 0, 0, 255};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib4NubvARB)(6, v);
- (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res);
- pass = (res[0] == 1.0 && res[1] == 0.0 && res[2] == 1.0 && res[3] == 0.0);
- (*vertexAttrib4NubvARB)(6, def);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib4NuivARB(generic_func func)
-{
- PFNGLVERTEXATTRIB4NUIVARBPROC vertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC) func;
- PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
-
- const GLuint v[4] = {0xffffffff, 0, 0xffffffff, 0};
- const GLuint def[4] = {0, 0, 0, 0xffffffff};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib4NuivARB)(6, v);
- (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res);
- pass = (EQUAL(res[0], 1.0) && EQUAL(res[1], 0.0) && EQUAL(res[2], 1.0) && EQUAL(res[3], 0.0));
- (*vertexAttrib4NuivARB)(6, def);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib4ivARB(generic_func func)
-{
- PFNGLVERTEXATTRIB4IVARBPROC vertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC) func;
- PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
-
- const GLint v[4] = {1, 2, -3, 4};
- const GLint def[4] = {0, 0, 0, 1};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib4ivARB)(6, v);
- (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res);
- pass = (EQUAL(res[0], 1.0) && EQUAL(res[1], 2.0) && EQUAL(res[2], -3.0) && EQUAL(res[3], 4.0));
- (*vertexAttrib4ivARB)(6, def);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib4NsvARB(generic_func func)
-{
- PFNGLVERTEXATTRIB4NSVARBPROC vertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC) func;
- PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
-
- const GLshort v[4] = {0, 32767, 32767, 0};
- const GLshort def[4] = {0, 0, 0, 32767};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib4NsvARB)(6, v);
- (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res);
- pass = (EQUAL(res[0], 0.0) && EQUAL(res[1], 1.0) && EQUAL(res[2], 1.0) && EQUAL(res[3], 0.0));
- (*vertexAttrib4NsvARB)(6, def);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib4NusvARB(generic_func func)
-{
- PFNGLVERTEXATTRIB4NUSVARBPROC vertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC) func;
- PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
-
- const GLushort v[4] = {0xffff, 0, 0xffff, 0};
- const GLushort def[4] = {0, 0, 0, 0xffff};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib4NusvARB)(6, v);
- (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res);
- pass = (EQUAL(res[0], 1.0) && EQUAL(res[1], 0.0) && EQUAL(res[2], 1.0) && EQUAL(res[3], 0.0));
- (*vertexAttrib4NusvARB)(6, def);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib4ubNV(generic_func func)
-{
- PFNGLVERTEXATTRIB4UBNVPROC vertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC) func;
- PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
-
- const GLubyte v[4] = {255, 0, 255, 0};
- const GLubyte def[4] = {0, 0, 0, 255};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib4ubNV)(6, v[0], v[1], v[2], v[3]);
- (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res);
- pass = (res[0] == 1.0 && res[1] == 0.0 && res[2] == 1.0 && res[3] == 0.0);
- (*vertexAttrib4ubNV)(6, def[0], def[1], def[2], def[3]);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib2sNV(generic_func func)
-{
- PFNGLVERTEXATTRIB2SNVPROC vertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC) func;
- PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
-
- const GLshort v[2] = {2, -4,};
- const GLshort def[2] = {0, 0};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib2sNV)(6, v[0], v[1]);
- (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res);
- pass = (EQUAL(res[0], 2) && EQUAL(res[1], -4) && EQUAL(res[2], 0) && res[3] == 1.0);
- (*vertexAttrib2sNV)(6, def[0], def[1]);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib3fNV(generic_func func)
-{
- PFNGLVERTEXATTRIB3FNVPROC vertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC) func;
- PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
-
- const GLfloat v[3] = {0.2, 0.4, 0.8};
- const GLfloat def[3] = {0, 0, 0};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib3fNV)(6, v[0], v[1], v[2]);
- (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res);
- pass = (EQUAL(res[0], 0.2) && EQUAL(res[1], 0.4) && EQUAL(res[2], 0.8) && res[3] == 1.0);
- (*vertexAttrib3fNV)(6, def[0], def[1], def[2]);
- return pass;
-}
-
-
-static GLboolean
-test_VertexAttrib4dvNV(generic_func func)
-{
- PFNGLVERTEXATTRIB4DVNVPROC vertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC) func;
- PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
-
- const GLdouble v[4] = {0.2, 0.4, 0.8, 1.2};
- const GLdouble def[4] = {0, 0, 0, 1};
- GLfloat res[4];
- GLboolean pass;
- (*vertexAttrib4dvNV)(6, v);
- (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res);
- pass = (EQUAL(res[0], 0.2) && EQUAL(res[1], 0.4) && EQUAL(res[2], 0.8) && EQUAL(res[3], 1.2));
- (*vertexAttrib4dvNV)(6, def);
- return pass;
-}
-
-
-/*
- * The following file is auto-generated with Python.
- */
-#include "getproclist.h"
-
-
-
-static int
-extension_supported(const char *haystack, const char *needle)
-{
- const char *p = strstr(haystack, needle);
- if (p) {
- /* found string, make sure next char is space or zero */
- const int len = strlen(needle);
- if (p[len] == ' ' || p[len] == 0)
- return 1;
- else
- return 0;
- }
- else
- return 0;
-}
-
-
-static void
-check_functions( const char *extensions )
-{
- struct name_test_pair *entry;
- int failures = 0, passes = 0;
- int totalFail = 0, totalPass = 0;
- int doTests;
-
- for (entry = functions; entry->name; entry++) {
- if (entry->name[0] == '-') {
- /* XXX update for OpenGL 2.0 */
- if (entry->name[1] == '1') {
- /* check GL version X.Y */
- const char *version = (const char *) glGetString(GL_VERSION);
- if (version[0] == entry->name[1] &&
- version[1] == entry->name[2] &&
- version[2] >= entry->name[3])
- doTests = 1;
- else
- doTests = 0;
- }
- else {
- /* check if the named extension is available */
- doTests = extension_supported(extensions, entry->name+1);
- }
- if (doTests)
- printf("Testing %s functions\n", entry->name + 1);
- totalFail += failures;
- totalPass += passes;
- failures = 0;
- passes = 0;
- }
- else if (doTests) {
- generic_func funcPtr = (generic_func) glXGetProcAddressARB((const GLubyte *) entry->name);
- if (funcPtr) {
- if (entry->test) {
- GLboolean b;
- printf(" Validating %s:", entry->name);
- b = (*entry->test)(funcPtr);
- if (b) {
- printf(" Pass\n");
- passes++;
- }
- else {
- printf(" FAIL!!!\n");
- failures++;
- }
- }
- else {
- passes++;
- }
- }
- else {
- printf(" glXGetProcAddress(%s) failed!\n", entry->name);
- failures++;
- }
- }
-
- if (doTests && (!(entry+1)->name || (entry+1)->name[0] == '-')) {
- if (failures > 0) {
- printf(" %d failed.\n", failures);
- }
- if (passes > 0) {
- printf(" %d passed.\n", passes);
- }
- }
- }
- totalFail += failures;
- totalPass += passes;
-
- printf("-----------------------------\n");
- printf("Total: %d pass %d fail\n", totalPass, totalFail);
-}
-
-
-
-static void
-print_screen_info(Display *dpy, int scrnum, Bool allowDirect)
-{
- Window win;
- int attribSingle[] = {
- GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- None };
- int attribDouble[] = {
- GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_DOUBLEBUFFER,
- None };
-
- XSetWindowAttributes attr;
- unsigned long mask;
- Window root;
- GLXContext ctx;
- XVisualInfo *visinfo;
- int width = 100, height = 100;
-
- root = RootWindow(dpy, scrnum);
-
- visinfo = glXChooseVisual(dpy, scrnum, attribSingle);
- if (!visinfo) {
- visinfo = glXChooseVisual(dpy, scrnum, attribDouble);
- if (!visinfo) {
- fprintf(stderr, "Error: couldn't find RGB GLX visual\n");
- return;
- }
- }
-
- attr.background_pixel = 0;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
- attr.event_mask = StructureNotifyMask | ExposureMask;
- mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
- win = XCreateWindow(dpy, root, 0, 0, width, height,
- 0, visinfo->depth, InputOutput,
- visinfo->visual, mask, &attr);
-
- ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect );
- if (!ctx) {
- fprintf(stderr, "Error: glXCreateContext failed\n");
- XDestroyWindow(dpy, win);
- return;
- }
-
- if (glXMakeCurrent(dpy, win, ctx)) {
- check_functions( (const char *) glGetString(GL_EXTENSIONS) );
- }
- else {
- fprintf(stderr, "Error: glXMakeCurrent failed\n");
- }
-
- glXDestroyContext(dpy, ctx);
- XDestroyWindow(dpy, win);
-}
-
-
-int
-main(int argc, char *argv[])
-{
- char *displayName = NULL;
- Display *dpy;
-
- dpy = XOpenDisplay(displayName);
- if (!dpy) {
- fprintf(stderr, "Error: unable to open display %s\n", displayName);
- return -1;
- }
-
- print_screen_info(dpy, 0, GL_TRUE);
-
- XCloseDisplay(dpy);
-
- return 0;
-}
diff --git a/progs/tests/getprocaddress.py b/progs/tests/getprocaddress.py
deleted file mode 100644
index d16b2d93d0e..00000000000
--- a/progs/tests/getprocaddress.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-
-# $Id: getprocaddress.py,v 1.7 2005/06/21 23:42:43 idr Exp $
-
-# Helper for the getprocaddress.c test.
-
-import sys, getopt, re
-sys.path.append("../../src/mesa/glapi/" )
-import gl_XML
-import license
-
-
-def FindTestFunctions():
- """Scan getprocaddress.c for lines that start with "test_" to find
- extension function tests. Return a list of names found."""
- functions = []
- f = open("getprocaddress.c")
- if not f:
- return functions
- for line in f.readlines():
- v = re.search("^test_([a-zA-Z0-9]+)", line)
- if v:
- func = v.group(1)
- functions.append(func)
- f.close
- return functions
-
-
-class PrintExports(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "getprocaddress.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.tests = FindTestFunctions()
- self.prevCategory = ""
- return
-
-
- def printRealHeader(self):
- print """
-struct name_test_pair {
- const char *name;
- GLboolean (*test)(generic_func);
-};
-
-static struct name_test_pair functions[] = {"""
-
- def printBody(self, api):
- prev_category = None
-
-
- for f in api.functionIterateByOffset():
- [category, num] = api.get_category_for_name( f.name )
- if category != prev_category:
- print ' { "-%s", NULL},' % category
- prev_category = category
-
- test = "NULL"
- for name in f.entry_points:
- if name in self.tests:
- test = "test_%s" % name
- break
-
- print ' { "gl%s", %s },' % (f.name, test)
-
- print ''
- print ' { NULL, NULL }'
- print '};'
- print ''
- return
-
-
-if __name__ == '__main__':
- file_name = "../../src/mesa/glapi/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
-
- printer = PrintExports()
-
- api = gl_XML.parse_GL_API( file_name, gl_XML.gl_item_factory() )
-
- printer.Print( api )
diff --git a/progs/tests/interleave.c b/progs/tests/interleave.c
deleted file mode 100644
index e98b3ed0469..00000000000
--- a/progs/tests/interleave.c
+++ /dev/null
@@ -1,406 +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
- * 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 interleave.c
- *
- * Simple test of glInterleavedArrays functionality. For each mode, two
- * meshes are drawn. One is drawn using interleaved arrays and the othe is
- * drawn using immediate mode. Both should look identical.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <GL/glut.h>
-
-static int Width = 400;
-static int Height = 300;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-static const GLfloat t[][4] = {
- { 0.5, 0.0, 0.0, 1.0 },
-
- { 0.25, 0.5, 0.0, 1.0 },
- { 0.75, 0.5, 0.0, 1.0 },
-
- { 0.0, 1.0, 0.0, 1.0 },
- { 0.5, 1.0, 0.0, 1.0 },
- { 1.0, 1.0, 0.0, 1.0 },
-};
-
-static const GLfloat c_f[][4] = {
- { 1.0, 0.0, 0.0, 1.0 },
-
- { 0.0, 1.0, 0.0, 1.0 },
- { 0.0, 1.0, 0.0, 1.0 },
-
- { 0.0, 0.0, 1.0, 1.0 },
- { 1.0, 0.0, 1.0, 1.0 },
- { 0.0, 0.0, 1.0, 1.0 },
-};
-
-static const GLubyte c_ub[][4] = {
- { 0xff, 0x00, 0x00, 0xff },
-
- { 0x00, 0xff, 0x00, 0xff },
- { 0x00, 0xff, 0x00, 0xff },
-
- { 0x00, 0x00, 0xff, 0xff },
- { 0xff, 0x00, 0xff, 0xff },
- { 0x00, 0x00, 0xff, 0xff },
-};
-
-static const GLfloat n[][3] = {
- { 0.0, 0.0, -1.0 },
-
- { 0.0, 0.0, -1.0 },
- { 0.0, 0.0, -1.0 },
-
- { 0.0, 0.0, -1.0 },
- { 0.0, 0.0, -1.0 },
- { 0.0, 0.0, -1.0 },
-};
-
-static const GLfloat v[][4] = {
- { 0.0, 1.0, 0.0, 1.0, },
-
- { -0.5, 0.0, 0.0, 1.0, },
- { 0.5, 0.0, 0.0, 1.0, },
-
- { -1.0, -1.0, 0.0, 1.0, },
- { 0.0, -1.0, 0.0, 1.0, },
- { 1.0, -1.0, 0.0, 1.0, },
-};
-
-static const unsigned indicies[12] = {
- 0, 1, 2,
- 1, 3, 4,
- 2, 4, 5,
- 1, 4, 2
-};
-
-#define NONE { NULL, 0, 0, 0 }
-#define V2F { v, 2, 2 * sizeof( GLfloat ), GL_FLOAT, sizeof( v[0] ) }
-#define V3F { v, 3, 3 * sizeof( GLfloat ), GL_FLOAT, sizeof( v[0] ) }
-#define V4F { v, 4, 4 * sizeof( GLfloat ), GL_FLOAT, sizeof( v[0] ) }
-
-#define C4UB { c_ub, 4, 4 * sizeof( GLubyte ), GL_UNSIGNED_BYTE, sizeof( c_ub[0] ) }
-#define C3F { c_f, 3, 3 * sizeof( GLfloat ), GL_FLOAT, sizeof( c_f[0] ) }
-#define C4F { c_f, 4, 4 * sizeof( GLfloat ), GL_FLOAT, sizeof( c_f[0] ) }
-
-#define T2F { t, 2, 2 * sizeof( GLfloat ), GL_FLOAT, sizeof( t[0] ) }
-#define T4F { t, 4, 4 * sizeof( GLfloat ), GL_FLOAT, sizeof( t[0] ) }
-
-#define N3F { n, 3, 3 * sizeof( GLfloat ), GL_FLOAT, sizeof( n[0] ) }
-
-struct interleave_info {
- const void * data;
- unsigned count;
- unsigned size;
- GLenum type;
- unsigned stride;
-};
-
-#define NUM_MODES 14
-#define INVALID_MODE 14
-#define INVALID_STRIDE 15
-
-struct interleave_info info[ NUM_MODES ][4] = {
- { NONE, NONE, NONE, V2F },
- { NONE, NONE, NONE, V3F },
- { NONE, C4UB, NONE, V2F },
- { NONE, C4UB, NONE, V3F },
- { NONE, C3F, NONE, V3F },
-
- { NONE, NONE, N3F, V3F },
- { NONE, C4F, N3F, V3F },
-
- { T2F, NONE, NONE, V3F },
- { T4F, NONE, NONE, V4F },
-
- { T2F, C4UB, NONE, V3F },
- { T2F, C3F, NONE, V3F },
- { T2F, NONE, N3F, V3F },
- { T2F, C4F, N3F, V3F },
- { T4F, C4F, N3F, V4F },
-};
-
-const char * const mode_names[ NUM_MODES ] = {
- "GL_V2F",
- "GL_V3F",
- "GL_C4UB_V2F",
- "GL_C4UB_V3F",
- "GL_C3F_V3F",
- "GL_N3F_V3F",
- "GL_C4F_N3F_V3F",
- "GL_T2F_V3F",
- "GL_T4F_V4F",
- "GL_T2F_C4UB_V3F",
- "GL_T2F_C3F_V3F",
- "GL_T2F_N3F_V3F",
- "GL_T2F_C4F_N3F_V3F",
- "GL_T4F_C4F_N3F_V4F",
-};
-
-static unsigned interleave_mode = 0;
-static GLboolean use_invalid_mode = GL_FALSE;
-static GLboolean use_invalid_stride = GL_FALSE;
-
-#define DEREF(item,idx) (void *) & ((char *)curr_info[item].data)[idx * curr_info[item].stride]
-
-static void Display( void )
-{
- const struct interleave_info * const curr_info = info[ interleave_mode ];
-
- /* 4 floats for 12 verticies for 4 data elements.
- */
- char data[ (sizeof( GLfloat ) * 4) * 12 * 4 ];
-
- unsigned i;
- unsigned offset;
- GLenum err;
- GLenum format;
- GLsizei stride;
-
-
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
-
- glTranslatef(-1.5, 0, 0);
-
- glColor3fv( c_f[0] );
-
- if ( curr_info[0].data != NULL ) {
- glEnable( GL_TEXTURE_2D );
- }
- else {
- glDisable( GL_TEXTURE_2D );
- }
-
-
- offset = 0;
- glBegin(GL_TRIANGLES);
- for ( i = 0 ; i < 12 ; i++ ) {
- const unsigned index = indicies[i];
-
-
- /* Handle the vertex texture coordinate.
- */
- if ( curr_info[0].data != NULL ) {
- if ( curr_info[0].count == 2 ) {
- glTexCoord2fv( DEREF(0, index) );
- }
- else {
- glTexCoord4fv( DEREF(0, index) );
- }
-
- (void) memcpy( & data[ offset ], DEREF(0, index),
- curr_info[0].size );
- offset += curr_info[0].size;
- }
-
-
- /* Handle the vertex color.
- */
- if ( curr_info[1].data != NULL ) {
- if ( curr_info[1].type == GL_FLOAT ) {
- if ( curr_info[1].count == 3 ) {
- glColor3fv( DEREF(1, index) );
- }
- else {
- glColor4fv( DEREF(1, index) );
- }
- }
- else {
- glColor4ubv( DEREF(1, index) );
- }
-
- (void) memcpy( & data[ offset ], DEREF(1, index),
- curr_info[1].size );
- offset += curr_info[1].size;
- }
-
-
- /* Handle the vertex normal.
- */
- if ( curr_info[2].data != NULL ) {
- glNormal3fv( DEREF(2, index) );
-
- (void) memcpy( & data[ offset ], DEREF(2, index),
- curr_info[2].size );
- offset += curr_info[2].size;
- }
-
-
- switch( curr_info[3].count ) {
- case 2:
- glVertex2fv( DEREF(3, index) );
- break;
- case 3:
- glVertex3fv( DEREF(3, index) );
- break;
- case 4:
- glVertex4fv( DEREF(3, index) );
- break;
- }
-
- (void) memcpy( & data[ offset ], DEREF(3, index),
- curr_info[3].size );
- offset += curr_info[3].size;
- }
- glEnd();
-
-
- glTranslatef(3.0, 0, 0);
-
- /* The masking with ~0x2A00 is a bit of a hack to make sure that format
- * ends up with an invalid value no matter what rand() returns.
- */
- format = (use_invalid_mode)
- ? (rand() & ~0x2A00) : GL_V2F + interleave_mode;
- stride = (use_invalid_stride) ? -abs(rand()) : 0;
-
- (void) glGetError();
- glInterleavedArrays( format, stride, data );
- err = glGetError();
- if ( err ) {
- printf("glInterleavedArrays(0x%04x, %d, %p) generated the error 0x%04x\n",
- format, stride, data, err );
- }
- else {
- glDrawArrays( GL_TRIANGLES, 0, 12 );
- }
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void ModeMenu( int entry )
-{
- if ( entry == INVALID_MODE ) {
- use_invalid_mode = GL_TRUE;
- use_invalid_stride = GL_FALSE;
- }
- else if ( entry == INVALID_STRIDE ) {
- use_invalid_mode = GL_FALSE;
- use_invalid_stride = GL_TRUE;
- }
- else {
- use_invalid_mode = GL_FALSE;
- use_invalid_stride = GL_FALSE;
- interleave_mode = entry;
- }
-}
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
- const GLubyte tex[16] = {
- 0xff, 0x00, 0xff, 0x00,
- 0x00, 0xff, 0x00, 0xff,
- 0xff, 0x00, 0xff, 0x00,
- 0x00, 0xff, 0x00, 0xff,
- };
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
- glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0,
- GL_LUMINANCE, GL_UNSIGNED_BYTE, tex );
-
- printf("Use the context menu (right click) to select the interleaved array mode.\n");
- printf("Press ESCAPE to exit.\n\n");
- printf("NOTE: This is *NOT* a very good test of the modes that use normals.\n");
-}
-
-
-int main( int argc, char *argv[] )
-{
- unsigned i;
-
- srand( time( NULL ) );
-
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "glInterleavedArrays test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
-
- glutCreateMenu( ModeMenu );
- for ( i = 0 ; i < NUM_MODES ; i++ ) {
- glutAddMenuEntry( mode_names[i], i);
- }
-
- glutAddMenuEntry( "Random invalid mode", INVALID_MODE);
- glutAddMenuEntry( "Random invalid stride", INVALID_STRIDE);
-
- glutAttachMenu(GLUT_RIGHT_BUTTON);
-
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/invert.c b/progs/tests/invert.c
deleted file mode 100644
index 750592ed79f..00000000000
--- a/progs/tests/invert.c
+++ /dev/null
@@ -1,195 +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
- * 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 invert.c
- *
- * Simple test of GL_MESA_pack_invert functionality. Three squares are
- * drawn. The first two should look the same, and the third one should
- * look inverted.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <GL/glut.h>
-
-#include "readtex.h"
-
-#define IMAGE_FILE "../images/tree3.rgb"
-
-static int Width = 420;
-static int Height = 150;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-static GLubyte * image = NULL;
-static GLubyte * temp_image = NULL;
-static GLuint img_width = 0;
-static GLuint img_height = 0;
-static GLuint img_format = 0;
-
-PFNGLWINDOWPOS2IPROC win_pos_2i = NULL;
-
-
-static void Display( void )
-{
- GLint err;
-
-
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT );
-
-
- /* This is the "reference" square.
- */
-
- (*win_pos_2i)( 5, 5 );
- glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, image );
-
- glPixelStorei( GL_PACK_INVERT_MESA, GL_FALSE );
- err = glGetError();
- if ( err != GL_NO_ERROR ) {
- printf( "Setting PACK_INVERT_MESA to false generated an error (0x%04x).\n",
- err );
- }
-
- glReadPixels( 5, 5, img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );
- (*win_pos_2i)( 5 + 1 * (10 + img_width), 5 );
- glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );
-
- glPixelStorei( GL_PACK_INVERT_MESA, GL_TRUE );
- err = glGetError();
- if ( err != GL_NO_ERROR ) {
- printf( "Setting PACK_INVERT_MESA to true generated an error (0x%04x).\n",
- err );
- }
-
- glReadPixels( 5, 5, img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );
- (*win_pos_2i)( 5 + 2 * (10 + img_width), 5 );
- glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
- const float ver = strtof( ver_string, NULL );
-
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- if ( !glutExtensionSupported("GL_MESA_pack_invert") ) {
- printf("\nSorry, this program requires GL_MESA_pack_invert.\n");
- exit(1);
- }
-
- if ( ver >= 1.4 ) {
- win_pos_2i = (PFNGLWINDOWPOS2IPROC) glutGetProcAddress( "glWindowPos2i" );
- }
- else if ( glutExtensionSupported("GL_ARB_window_pos") ) {
- win_pos_2i = (PFNGLWINDOWPOS2IPROC) glutGetProcAddress( "glWindowPos2iARB" );
- }
- else if ( glutExtensionSupported("GL_MESA_window_pos") ) {
- win_pos_2i = (PFNGLWINDOWPOS2IPROC) glutGetProcAddress( "glWindowPos2iMESA" );
- }
-
-
- /* Do this check as a separate if-statement instead of as an else in case
- * one of the required extensions is supported but glutGetProcAddress
- * returns NULL.
- */
-
- if ( win_pos_2i == NULL ) {
- printf("\nSorry, this program requires either GL 1.4 (or higher),\n"
- "GL_ARB_window_pos, or GL_MESA_window_pos.\n");
- exit(1);
- }
-
- printf("\nThe left 2 squares should be the same color, and the right\n"
- "square should look upside-down.\n");
-
-
- image = LoadRGBImage( IMAGE_FILE, & img_width, & img_height,
- & img_format );
- if ( image == NULL ) {
- printf( "Could not open image file \"%s\".\n", IMAGE_FILE );
- exit(1);
- }
-
- temp_image = malloc( 3 * img_height * img_width );
- if ( temp_image == NULL ) {
- printf( "Could not allocate memory for temporary image.\n" );
- exit(1);
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "GL_MESA_pack_invert test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/jkrahntest.c b/progs/tests/jkrahntest.c
deleted file mode 100644
index 85bda8d0152..00000000000
--- a/progs/tests/jkrahntest.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/* $Id: jkrahntest.c,v 1.2 2006/01/30 17:12:10 brianp Exp $ */
-
-/* This is a good test for glXSwapBuffers on non-current windows,
- * and the glXCopyContext function. Fixed several Mesa/DRI bugs with
- * this program on 15 June 2002.
- *
- * Joe's comments follow:
- *
- * I have tried some different approaches for being able to
- * draw to multiple windows using one context, or a copied
- * context. Mesa/indirect rendering works to use one context
- * for multiple windows, but crashes with glXCopyContext.
- * DRI is badly broken, at least for ATI.
- *
- * I also noticed that glXMakeCurrent allows a window and context
- * from different visuals to be attached (haven't tested recently).
- *
- * Joe Krahn <jkrahn@nc.rr.com>
- */
-
-#include <GL/glx.h>
-#include <GL/gl.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-
-#ifndef M_PI
-#define M_PI 3.14159
-#endif
-
-#define DEGTOR (M_PI/180.0)
-
-static int AttributeList[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None };
-
-int main(int argc, char **argv)
-{
- Window win1, win2;
- XVisualInfo *vi;
- XSetWindowAttributes swa;
- Display *dpy;
- GLXContext ctx1, ctx2;
- float angle;
- int test;
-
- if (argc < 2) {
- fprintf(stderr, "This program tests GLX context switching.\n");
- fprintf(stderr, "Usage: cxbug <n>\n");
- fprintf(stderr, "Where n is:\n");
- fprintf(stderr, "\t1) Use two contexts and swap only when the context is current (typical case).\n");
- fprintf(stderr, "\t2) Use two contexts and swap at the same time.\n");
- fprintf(stderr, "\t\t Used to crash Mesa & nVidia, and DRI artifacts. Seems OK now.\n");
- fprintf(stderr, "\t3) Use one context, but only swap when a context is current.\n");
- fprintf(stderr, "\t\t Serious artifacts for DRI at least with ATI.\n");
- fprintf(stderr, "\t4) Use one context, swap both windows at the same time, so the left\n");
- fprintf(stderr, "\t\t window has no context at swap time. Severe artifacts for DRI.\n");
- fprintf(stderr, "\t5) Use two contexts, copying one to the other when switching windows.\n");
- fprintf(stderr, "\t\t DRI gives an error, indirect rendering crashes server.\n");
-
- exit(1);
- }
- test = atoi(argv[1]);
-
- /* get a connection */
- dpy = XOpenDisplay(NULL);
-
- /* Get an appropriate visual */
- vi = glXChooseVisual(dpy, DefaultScreen(dpy), AttributeList);
- if (vi == 0) {
- fprintf(stderr, "No matching visuals found.\n");
- exit(-1);
- }
-
- /* Create two GLX contexts, with list sharing */
- ctx1 = glXCreateContext(dpy, vi, 0, True);
- ctx2 = glXCreateContext(dpy, vi, ctx1, True);
-
- /* create a colormap */
- swa.colormap = XCreateColormap(dpy, RootWindow(dpy, vi->screen),
- vi->visual, AllocNone);
- swa.border_pixel = 0;
-
- /* Create two windows */
- win1 = XCreateWindow(dpy, RootWindow(dpy, vi->screen),
- 10, 10, 200, 200,
- 0, vi->depth, InputOutput, vi->visual,
- CWBorderPixel | CWColormap, &swa);
- XStoreName(dpy, win1, "Test [L]");
- XMapWindow(dpy, win1);
- XMoveWindow(dpy, win1, 10, 10); /* Initial requested x,y may not be honored */
- {
- XSizeHints sizehints;
- static const char *name = "window";
- sizehints.x = 10;
- sizehints.y = 10;
- sizehints.width = 200;
- sizehints.height = 200;
- sizehints.flags = USSize | USPosition;
- XSetNormalHints(dpy, win1, &sizehints);
- XSetStandardProperties(dpy, win1, name, name,
- None, (char **)NULL, 0, &sizehints);
- }
-
-
- win2 = XCreateWindow(dpy, RootWindow(dpy, vi->screen),
- 250, 10, 200, 200,
- 0, vi->depth, InputOutput, vi->visual,
- CWBorderPixel | CWColormap, &swa);
- XStoreName(dpy, win1, "Test [R]");
- XMapWindow(dpy, win2);
- XMoveWindow(dpy, win2, 260, 10);
- {
- XSizeHints sizehints;
- static const char *name = "window";
- sizehints.x = 10;
- sizehints.y = 10;
- sizehints.width = 200;
- sizehints.height = 200;
- sizehints.flags = USSize | USPosition;
- XSetNormalHints(dpy, win2, &sizehints);
- XSetStandardProperties(dpy, win2, name, name,
- None, (char **)NULL, 0, &sizehints);
- }
-
-
- /* Now draw some spinning things */
- for (angle = 0; angle < 360*4; angle += 10.0) {
- /* Connect the context to window 1 */
- glXMakeCurrent(dpy, win1, ctx1);
-
- /* Clear and draw in window 1 */
- glDrawBuffer(GL_BACK);
- glClearColor(1, 1, 0, 1);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glColor3f(1, 0, 0);
- glBegin(GL_TRIANGLES);
- glVertex2f(0, 0);
- glVertex2f(cos(angle * DEGTOR), sin(angle * DEGTOR));
- glVertex2f(cos((angle + 20.0) * DEGTOR),
- sin((angle + 20.0) * DEGTOR));
- glEnd();
- glFlush();
-
- if (test == 1 || test == 3 || test == 5)
- glXSwapBuffers(dpy, win1);
-
- if (test == 5)
- glXCopyContext(dpy, ctx1, ctx2, GL_ALL_ATTRIB_BITS);
- /* Connect the context to window 2 */
- if (test == 3 || test == 4) {
- glXMakeCurrent(dpy, win2, ctx1);
- } else {
- glXMakeCurrent(dpy, win2, ctx2);
- }
-
- /* Clear and draw in window 2 */
- glDrawBuffer(GL_BACK);
- glClearColor(0, 0, 1, 1);
- glClear(GL_COLOR_BUFFER_BIT);
- glColor3f(1, 1, 0);
- glBegin(GL_TRIANGLES);
- glVertex2f(0, 0);
- glVertex2f(cos(angle * DEGTOR), sin(angle * DEGTOR));
- glVertex2f(cos((angle + 20.0) * DEGTOR),
- sin((angle + 20.0) * DEGTOR));
- glEnd();
- glFlush();
-
- /* Swap buffers */
- if (test == 2 || test == 4)
- glXSwapBuffers(dpy, win1);
- glXSwapBuffers(dpy, win2);
-
- /* wait a while */
- glXWaitX();
- usleep(20000);
- }
-
- return 0;
-}
diff --git a/progs/tests/manytex.c b/progs/tests/manytex.c
deleted file mode 100644
index 61a1519ae6b..00000000000
--- a/progs/tests/manytex.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/* $Id: manytex.c,v 1.5 2005/09/15 01:58:39 brianp Exp $ */
-
-/*
- * test handling of many texture maps
- * Also tests texture priority and residency.
- *
- * Brian Paul
- * August 2, 2000
- */
-
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <GL/glut.h>
-
-
-static GLint NumTextures = 20;
-static GLuint *TextureID = NULL;
-static GLint *TextureWidth = NULL, *TextureHeight = NULL;
-static GLboolean *TextureResidency = NULL;
-static GLint TexWidth = 128, TexHeight = 128;
-static GLfloat Zrot = 0;
-static GLboolean Anim = GL_TRUE;
-static GLint WinWidth = 500, WinHeight = 400;
-static GLboolean MipMap = GL_FALSE;
-static GLboolean LinearFilter = GL_FALSE;
-static GLboolean RandomSize = GL_FALSE;
-static GLint Rows, Columns;
-static GLint LowPriorityCount = 0;
-
-
-static void Idle( void )
-{
- Zrot += 1.0;
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- GLfloat spacing = WinWidth / Columns;
- GLfloat size = spacing * 0.4;
- GLint i;
-
- /* test residency */
- if (0)
- {
- GLboolean b;
- GLint i, resident;
- b = glAreTexturesResident(NumTextures, TextureID, TextureResidency);
- if (b) {
- printf("all resident\n");
- }
- else {
- resident = 0;
- for (i = 0; i < NumTextures; i++) {
- if (TextureResidency[i]) {
- resident++;
- }
- }
- printf("%d of %d texture resident\n", resident, NumTextures);
- }
- }
-
- /* render the textured quads */
- glClear( GL_COLOR_BUFFER_BIT );
- for (i = 0; i < NumTextures; i++) {
- GLint row = i / Columns;
- GLint col = i % Columns;
- GLfloat x = col * spacing + spacing * 0.5;
- GLfloat y = row * spacing + spacing * 0.5;
-
- GLfloat maxDim = (TextureWidth[i] > TextureHeight[i])
- ? TextureWidth[i] : TextureHeight[i];
- GLfloat w = TextureWidth[i] / maxDim;
- GLfloat h = TextureHeight[i] / maxDim;
-
- glPushMatrix();
- glTranslatef(x, y, 0.0);
- glRotatef(Zrot, 0, 0, 1);
- glScalef(size, size, 1);
-
- glBindTexture(GL_TEXTURE_2D, TextureID[i]);
- glBegin(GL_POLYGON);
-#if 0
- glTexCoord2f(0, 0); glVertex2f(-1, -1);
- glTexCoord2f(1, 0); glVertex2f( 1, -1);
- glTexCoord2f(1, 1); glVertex2f( 1, 1);
- glTexCoord2f(0, 1); glVertex2f(-1, 1);
-#else
- glTexCoord2f(0, 0); glVertex2f(-w, -h);
- glTexCoord2f(1, 0); glVertex2f( w, -h);
- glTexCoord2f(1, 1); glVertex2f( w, h);
- glTexCoord2f(0, 1); glVertex2f(-w, h);
-#endif
- glEnd();
- glPopMatrix();
- }
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- WinWidth = width;
- WinHeight = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(0, width, 0, height, -1, 1);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-/*
- * Return a random int in [min, max].
- */
-static int RandomInt(int min, int max)
-{
- int i = rand();
- int j = i % (max - min + 1);
- return min + j;
-}
-
-
-
-static void Init( void )
-{
- GLint i;
-
- if (RandomSize) {
- printf("Creating %d %s random-size textures, ", NumTextures,
- MipMap ? "Mipmapped" : "non-Mipmapped");
- }
- else {
- printf("Creating %d %s %d x %d textures, ", NumTextures,
- MipMap ? "Mipmapped" : "non-Mipmapped",
- TexWidth, TexHeight);
- }
-
- if (LinearFilter) {
- printf("bilinear filtering\n");
- }
- else {
- printf("nearest filtering\n");
- }
-
-
- /* compute number of rows and columns of rects */
- {
- GLfloat area = (GLfloat) (WinWidth * WinHeight) / (GLfloat) NumTextures;
- GLfloat edgeLen = sqrt(area);
-
- Columns = WinWidth / edgeLen;
- Rows = (NumTextures + Columns - 1) / Columns;
- printf("Rows: %d Cols: %d\n", Rows, Columns);
- }
-
-
- if (!TextureID) {
- TextureID = (GLuint *) malloc(sizeof(GLuint) * NumTextures);
- assert(TextureID);
- glGenTextures(NumTextures, TextureID);
- }
-
- if (!TextureResidency) {
- TextureResidency = (GLboolean *) malloc(sizeof(GLboolean) * NumTextures);
- assert(TextureResidency);
- }
-
- if (!TextureWidth) {
- TextureWidth = (GLint *) malloc(sizeof(GLint) * NumTextures);
- assert(TextureWidth);
- }
- if (!TextureHeight) {
- TextureHeight = (GLint *) malloc(sizeof(GLint) * NumTextures);
- assert(TextureHeight);
- }
-
- for (i = 0; i < NumTextures; i++) {
- GLubyte color[4];
- GLubyte *texImage;
- GLint j, row, col;
-
- row = i / Columns;
- col = i % Columns;
-
- glBindTexture(GL_TEXTURE_2D, TextureID[i]);
-
- if (i < LowPriorityCount)
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5F);
-
- if (RandomSize) {
-#if 0
- int k = (glutGet(GLUT_ELAPSED_TIME) % 7) + 2;
- TexWidth = 1 << k;
- TexHeight = 1 << k;
-#else
- TexWidth = 1 << RandomInt(2, 7);
- TexHeight = 1 << RandomInt(2, 7);
- printf("Random size of %3d: %d x %d\n", i, TexWidth, TexHeight);
-#endif
- }
-
- TextureWidth[i] = TexWidth;
- TextureHeight[i] = TexHeight;
-
- texImage = (GLubyte*) malloc(4 * TexWidth * TexHeight * sizeof(GLubyte));
- assert(texImage);
-
- /* determine texture color */
- color[0] = (GLint) (255.0 * ((float) col / (Columns - 1)));
- color[1] = 127;
- color[2] = (GLint) (255.0 * ((float) row / (Rows - 1)));
- color[3] = 255;
-
- /* fill in solid-colored teximage */
- for (j = 0; j < TexWidth * TexHeight; j++) {
- texImage[j*4+0] = color[0];
- texImage[j*4+1] = color[1];
- texImage[j*4+2] = color[2];
- texImage[j*4+3] = color[3];
- }
-
- if (MipMap) {
- GLint level = 0;
- GLint w = TexWidth, h = TexHeight;
- while (1) {
- glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w, h, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, texImage);
- if (w == 1 && h == 1)
- break;
- if (w > 1)
- w /= 2;
- if (h > 1)
- h /= 2;
- level++;
- /*printf("%d: %d x %d\n", level, w, h);*/
- }
- if (LinearFilter) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR_MIPMAP_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_NEAREST_MIPMAP_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
- }
- else {
- /* Set corners to white */
- int k = 0;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
- k = (TexWidth - 1) * 4;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
- k = (TexWidth * TexHeight - TexWidth) * 4;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
- k = (TexWidth * TexHeight - 1) * 4;
- texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, texImage);
- if (LinearFilter) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
- }
-
- free(texImage);
- }
-
- glEnable(GL_TEXTURE_2D);
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 's':
- Idle();
- break;
- case 'z':
- Zrot -= step;
- break;
- case 'Z':
- Zrot += step;
- break;
- case ' ':
- Init();
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-int main( int argc, char *argv[] )
-{
- GLint i;
-
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( WinWidth, WinHeight );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-n") == 0) {
- NumTextures = atoi(argv[i+1]);
- if (NumTextures <= 0) {
- printf("Error, bad number of textures\n");
- return 1;
- }
- i++;
- }
- else if (strcmp(argv[i], "-mipmap") == 0) {
- MipMap = GL_TRUE;
- }
- else if (strcmp(argv[i], "-linear") == 0) {
- LinearFilter = GL_TRUE;
- }
- else if (strcmp(argv[i], "-size") == 0) {
- TexWidth = atoi(argv[i+1]);
- TexHeight = atoi(argv[i+2]);
- assert(TexWidth >= 1);
- assert(TexHeight >= 1);
- i += 2;
- }
- else if (strcmp(argv[i], "-randomsize") == 0) {
- RandomSize = GL_TRUE;
- }
- else if (strcmp(argv[i], "-lowpri") == 0) {
- LowPriorityCount = atoi(argv[i+1]);
- i++;
- }
- else {
- printf("Usage:\n");
- printf(" manytex [options]\n");
- printf("Options:\n");
- printf(" -n <number of texture objects>\n");
- printf(" -size <width> <height> - specify texture size\n");
- printf(" -randomsize - use random size textures\n");
- printf(" -mipmap - generate mipmaps\n");
- printf(" -linear - use linear filtering instead of nearest\n");
- printf(" -lowpri <n> - Set lower priority on <n> textures\n");
- return 0;
- }
- }
-
- Init();
-
- glutMainLoop();
-
- return 0;
-}
diff --git a/progs/tests/mipmap_limits.c b/progs/tests/mipmap_limits.c
deleted file mode 100644
index 3bcb8a88584..00000000000
--- a/progs/tests/mipmap_limits.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/* Test GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL
- * Brian Paul
- * 10 May 2006
- */
-
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/*
- * (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.
- */
-/* mipmap.c
- * This program demonstrates using mipmaps for texture maps.
- * To overtly show the effect of mipmaps, each mipmap reduction
- * level has a solidly colored, contrasting texture image.
- * Thus, the quadrilateral which is drawn is drawn with several
- * different colors.
- */
-#include <stdlib.h>
-#include <stdio.h>
-#include <GL/glut.h>
-
-static GLint BaseLevel = 0, MaxLevel = 8;
-static GLfloat MinLod = -1, MaxLod = 9;
-static GLfloat LodBias = 0.0;
-static GLboolean NearestFilter = GL_TRUE;
-
-
-static void MakeImage(int level, int width, int height, const GLubyte color[4])
-{
- const int makeStripes = 0;
- GLubyte img[256*256*3];
- int i, j;
- for (i = 0; i < height; i++) {
- for (j = 0; j < width; j++) {
- int k = (i * width + j) * 3;
- int p = (i/8) & makeStripes;
- if (p == 0) {
- img[k + 0] = color[0];
- img[k + 1] = color[1];
- img[k + 2] = color[2];
- }
- else {
- img[k + 0] = 0;
- img[k + 1] = 0;
- img[k + 2] = 0;
- }
- }
- }
-
- glTexImage2D(GL_TEXTURE_2D, level, GL_RGB, width, height, 0,
- GL_RGB, GL_UNSIGNED_BYTE, img);
-}
-
-
-static void makeImages(void)
-{
- static const GLubyte colors[8][3] = {
- {128, 128, 128 },
- { 0, 255, 255 },
- { 255, 255, 0 },
- { 255, 0, 255 },
- { 255, 0, 0 },
- { 0, 255, 0 },
- { 0, 0, 255 },
- { 255, 255, 255 }
- };
- int i, sz = 128;
-
- for (i = 0; i < 8; i++) {
- MakeImage(i, sz, sz, colors[i]);
- sz /= 2;
- }
-}
-
-static void myinit(void)
-{
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glShadeModel(GL_FLAT);
-
- glTranslatef(0.0, 0.0, -3.6);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- makeImages();
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- glEnable(GL_TEXTURE_2D);
-}
-
-static void display(void)
-{
- GLfloat tcm = 4.0;
- printf("BASE_LEVEL = %d MAX_LEVEL = %d MIN_LOD = %f MAX_LOD = %f Bias = %.2g filter = %s\n",
- BaseLevel, MaxLevel, MinLod, MaxLod, LodBias,
- NearestFilter ? "LINEAR" : "NEAREST");
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod);
-
- if (NearestFilter) {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_NEAREST_MIPMAP_NEAREST);
- }
- else {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR_MIPMAP_LINEAR);
- }
-
- glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
- glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
- glTexCoord2f(tcm, tcm); glVertex3f(3000.0, 1.0, -6000.0);
- glTexCoord2f(tcm, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
- glEnd();
- glFlush();
-}
-
-static void myReshape(int w, int h)
-{
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-static void
-key(unsigned char k, int x, int y)
-{
- (void) x;
- (void) y;
- switch (k) {
- case 'b':
- BaseLevel--;
- if (BaseLevel < 0)
- BaseLevel = 0;
- break;
- case 'B':
- BaseLevel++;
- if (BaseLevel > 10)
- BaseLevel = 10;
- break;
- case 'm':
- MaxLevel--;
- if (MaxLevel < 0)
- MaxLevel = 0;
- break;
- case 'M':
- MaxLevel++;
- if (MaxLevel > 10)
- MaxLevel = 10;
- break;
- case 'l':
- LodBias -= 0.02;
- break;
- case 'L':
- LodBias += 0.02;
- break;
- case 'n':
- MinLod -= 0.02;
- break;
- case 'N':
- MinLod += 0.02;
- break;
- case 'x':
- MaxLod -= 0.02;
- break;
- case 'X':
- MaxLod += 0.02;
- break;
- case 'f':
- NearestFilter = !NearestFilter;
- break;
- case 27: /* Escape */
- exit(0);
- break;
- default:
- return;
- }
- glutPostRedisplay();
-}
-
-
-static void usage(void)
-{
- printf("usage:\n");
- printf(" b/B decrease/increase GL_TEXTURE_BASE_LEVEL\n");
- printf(" m/M decrease/increase GL_TEXTURE_MAX_LEVEL\n");
- printf(" n/N decrease/increase GL_TEXTURE_MIN_LOD\n");
- printf(" x/X decrease/increase GL_TEXTURE_MAX_LOD\n");
- printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n");
- printf(" f toggle nearest/linear filtering\n");
-}
-
-
-int main(int argc, char** argv)
-{
- glutInit(&argc, argv);
- glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
- glutInitWindowSize (600, 600);
- glutCreateWindow (argv[0]);
- myinit();
- glutReshapeFunc (myReshape);
- glutDisplayFunc(display);
- glutKeyboardFunc(key);
- usage();
- glutMainLoop();
- return 0; /* ANSI C requires main to return int. */
-}
diff --git a/progs/tests/multipal.c b/progs/tests/multipal.c
deleted file mode 100644
index c824b38703a..00000000000
--- a/progs/tests/multipal.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/* $Id: multipal.c,v 1.6 2003/12/08 09:03:36 joukj Exp $ */
-
-/*
- * Test multitexture and paletted textures.
- */
-
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef __VMS
-# include <stddef.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
-#else
-# include <malloc.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
-#endif
-#ifdef _WIN32
-#include <windows.h>
-#endif
-#define GL_GLEXT_LEGACY
-#include <GL/glut.h>
-
-#include "../util/readtex.c" /* I know, this is a hack. */
-
-#define TEXTURE_1_FILE "../images/tile.rgb"
-#define TEXTURE_2_FILE "../images/reflect.rgb"
-
-#define TEX0 1
-#define TEX1 2
-#define TEXBOTH 3
-#define ANIMATE 10
-#define QUIT 100
-
-static GLboolean Animate = GL_TRUE;
-
-static GLfloat Drift = 0.0;
-static GLfloat Xrot = 20.0, Yrot = 30.0, Zrot = 0.0;
-
-
-
-static void Idle( void )
-{
- if (Animate) {
- Drift += 0.05;
- if (Drift >= 1.0)
- Drift = 0.0;
-
-#ifdef GL_ARB_multitexture
- glActiveTextureARB(GL_TEXTURE0_ARB);
-#endif
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glTranslatef(Drift, 0.0, 0.0);
- glMatrixMode(GL_MODELVIEW);
-
-#ifdef GL_ARB_multitexture
- glActiveTextureARB(GL_TEXTURE1_ARB);
-#endif
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glTranslatef(0.0, Drift, 0.0);
- glMatrixMode(GL_MODELVIEW);
-
- glutPostRedisplay();
- }
-}
-
-
-static void DrawObject(void)
-{
- glBegin(GL_QUADS);
-
-#ifdef GL_ARB_multitexture
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 0.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0);
- glVertex2f(-1.0, -1.0);
-
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 2.0, 0.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 0.0);
- glVertex2f(1.0, -1.0);
-
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 2.0, 2.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 1.0);
- glVertex2f(1.0, 1.0);
-
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 2.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 1.0);
- glVertex2f(-1.0, 1.0);
-#else
- glTexCoord2f(0.0, 0.0);
- glVertex2f(-1.0, -1.0);
-
- glTexCoord2f(1.0, 0.0);
- glVertex2f(1.0, -1.0);
-
- glTexCoord2f(1.0, 1.0);
- glVertex2f(1.0, 1.0);
-
- glTexCoord2f(0.0, 1.0);
- glVertex2f(-1.0, 1.0);
-#endif
-
- glEnd();
-}
-
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glScalef(5.0, 5.0, 5.0);
- DrawObject();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 );
- /*glOrtho( -6.0, 6.0, -6.0, 6.0, 10.0, 100.0 );*/
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -70.0 );
-}
-
-
-static void ModeMenu(int entry)
-{
- GLboolean enable0 = GL_FALSE, enable1 = GL_FALSE;
- if (entry==TEX0) {
- enable0 = GL_TRUE;
- }
- else if (entry==TEX1) {
- enable1 = GL_TRUE;
- }
- else if (entry==TEXBOTH) {
- enable0 = GL_TRUE;
- enable1 = GL_TRUE;
- }
- else if (entry==ANIMATE) {
- Animate = !Animate;
- }
- else if (entry==QUIT) {
- exit(0);
- }
-
- if (entry != ANIMATE) {
-#ifdef GL_ARB_multitexture
- glActiveTextureARB(GL_TEXTURE0_ARB);
-#endif
- if (enable0) {
- glEnable(GL_TEXTURE_2D);
- }
- else
- glDisable(GL_TEXTURE_2D);
-
-#ifdef GL_ARB_multitexture
- glActiveTextureARB(GL_TEXTURE1_ARB);
-#endif
- if (enable1) {
- glEnable(GL_TEXTURE_2D);
- }
- else
- glDisable(GL_TEXTURE_2D);
- }
-
- glutPostRedisplay();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void load_tex(const char *fname, int channel)
-{
- GLubyte *image;
- GLenum format;
- GLint w, h;
- GLubyte *grayImage;
- int i;
- GLubyte table[256][4];
-
- image = LoadRGBImage(fname, &w, &h, &format);
- if (!image)
- exit(1);
-
- printf("%s %d x %d\n", fname, w, h);
- grayImage = malloc(w * h * 1);
- assert(grayImage);
- for (i = 0; i < w * h; i++) {
- int g = (image[i*3+0] + image[i*3+1] + image[i*3+2]) / 3;
- assert(g < 256);
- grayImage[i] = g;
- }
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX, w, h, 0, GL_COLOR_INDEX,
- GL_UNSIGNED_BYTE, grayImage);
-
- for (i = 0; i < 256; i++) {
- table[i][0] = channel ? i : 0;
- table[i][1] = i;
- table[i][2] = channel ? 0 : i;
- table[i][3] = 255;
- }
-
- glColorTableEXT(GL_TEXTURE_2D, /* target */
- GL_RGBA, /* internal format */
- 256, /* table size */
- GL_RGBA, /* table format */
- GL_UNSIGNED_BYTE, /* table type */
- table); /* the color table */
-
- free(grayImage);
- free(image);
-}
-
-
-
-static void Init( int argc, char *argv[] )
-{
- GLuint texObj[2];
- GLint units;
-
- if (!glutExtensionSupported("GL_ARB_multitexture")) {
- printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n");
- exit(1);
- }
- if (!glutExtensionSupported("GL_EXT_paletted_texture")) {
- printf("Sorry, GL_EXT_paletted_texture not supported by this renderer.\n");
- exit(1);
- }
-
- glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &units);
- printf("%d texture units supported\n", units);
-
- /* allocate two texture objects */
- glGenTextures(2, texObj);
-
- /* setup texture obj 0 */
- glBindTexture(GL_TEXTURE_2D, texObj[0]);
-#ifdef LINEAR_FILTER
- /* linear filtering looks much nicer but is much slower for Mesa */
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-foo
-#else
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-#endif
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- load_tex(TEXTURE_1_FILE, 0);
-#if 0
- if (!LoadRGBMipmaps(TEXTURE_1_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
-#endif
-
- /* setup texture obj 1 */
- glBindTexture(GL_TEXTURE_2D, texObj[1]);
-#ifdef LINEAR_FILTER
- /* linear filtering looks much nicer but is much slower for Mesa */
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-foo
-#else
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-#endif
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- load_tex(TEXTURE_2_FILE, 1);
-#if 0
- if (!LoadRGBMipmaps(TEXTURE_2_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
-#endif
-
- /* now bind the texture objects to the respective texture units */
-#ifdef GL_ARB_multitexture
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glBindTexture(GL_TEXTURE_2D, texObj[0]);
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glBindTexture(GL_TEXTURE_2D, texObj[1]);
-#endif
-
- glShadeModel(GL_FLAT);
- glClearColor(0.3, 0.3, 0.4, 1.0);
-
- ModeMenu(TEXBOTH);
-
- if (argc > 1 && strcmp(argv[1], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowSize( 300, 300 );
- glutInitWindowPosition( 0, 0 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0] );
-
- Init( argc, argv );
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- glutIdleFunc( Idle );
-
- glutCreateMenu(ModeMenu);
- glutAddMenuEntry("Texture 0", TEX0);
- glutAddMenuEntry("Texture 1", TEX1);
- glutAddMenuEntry("Multi-texture", TEXBOTH);
- glutAddMenuEntry("Toggle Animation", ANIMATE);
- glutAddMenuEntry("Quit", QUIT);
- glutAttachMenu(GLUT_RIGHT_BUTTON);
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/multitexarray.c b/progs/tests/multitexarray.c
deleted file mode 100644
index b4fab004a63..00000000000
--- a/progs/tests/multitexarray.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Test vertex arrays and multitexture.
- * Press 'a' to toggle vertex arrays on/off.
- * When you run this program you should see a square with four colors:
- *
- * +------+------+
- * |yellow| pink |
- * +------+------+
- * |green | blue |
- * +------+------+
- */
-
-
-#include <assert.h>
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "GL/glut.h"
-
-static GLuint Window = 0;
-
-static GLuint TexObj[2];
-static GLfloat Angle = 0.0f;
-static GLboolean UseArrays = 1, Anim = 0;
-
-static GLfloat VertArray[4][2] = {
- {-1.2, -1.2}, {1.2, -1.2}, {1.2, 1.2}, {-1.2, 1.2}
-};
-
-static GLfloat Tex0Array[4][2] = {
- {0, 0}, {1, 0}, {1, 1}, {0, 1}
-};
-
-static GLfloat Tex1Array[4][2] = {
- {0, 0}, {1, 0}, {1, 1}, {0, 1}
-};
-
-
-static void init_arrays(void)
-{
- glVertexPointer(2, GL_FLOAT, 0, VertArray);
- glEnableClientState(GL_VERTEX_ARRAY);
-
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
- glTexCoordPointer(2, GL_FLOAT, 0, Tex0Array);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
- glTexCoordPointer(2, GL_FLOAT, 0, Tex1Array);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-}
-
-
-static void draw( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glColor3f( 0.0, 0.0, 0.0 );
-
- /* draw first polygon */
- glPushMatrix();
- glRotatef( Angle, 0.0, 0.0, 1.0 );
-
- if (UseArrays) {
- glDrawArrays(GL_POLYGON, 0, 4);
- }
- else {
- glBegin( GL_POLYGON );
- glTexCoord2f( 0.0, 0.0 );
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0);
- glVertex2f( -1.0, -1.0 );
-
- glTexCoord2f( 1.0, 0.0 );
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 0.0);
- glVertex2f( 1.0, -1.0 );
-
- glTexCoord2f( 1.0, 1.0 );
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 1.0);
- glVertex2f( 1.0, 1.0 );
-
- glTexCoord2f( 0.0, 1.0 );
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 1.0);
- glVertex2f( -1.0, 1.0 );
- glEnd();
- }
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-
-static void idle( void )
-{
- Angle += 2.0;
- glutPostRedisplay();
-}
-
-
-
-/* change view Angle, exit upon ESC */
-static void key(unsigned char k, int x, int y)
-{
- (void) x;
- (void) y;
- switch (k) {
- case 'a':
- UseArrays = !UseArrays;
- printf("UseArrays: %d\n", UseArrays);
- break;
- case ' ':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(idle);
- else
- glutIdleFunc(NULL);
- break;
- case 27:
- glDeleteTextures( 2, TexObj );
- glutDestroyWindow(Window);
- exit(0);
- }
- glutPostRedisplay();
-}
-
-
-
-/* new window size or exposure */
-static void reshape( int width, int height )
-{
- glViewport(0, 0, (GLint)width, (GLint)height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- /* glOrtho( -3.0, 3.0, -3.0, 3.0, -10.0, 10.0 );*/
- glFrustum( -2.0, 2.0, -2.0, 2.0, 6.0, 20.0 );
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -8.0 );
-}
-
-
-static void init( void )
-{
- static int width=8, height=8;
- GLubyte tex[64][3];
- GLint i, j;
-
- /* generate texture object IDs */
- glGenTextures( 2, TexObj );
-
- /*
- * setup first texture object
- */
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glEnable( GL_TEXTURE_2D );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD );
-
- glBindTexture( GL_TEXTURE_2D, TexObj[0] );
- assert(glIsTexture(TexObj[0]));
-
- /* red over black */
- for (i=0;i<height;i++) {
- for (j=0;j<width;j++) {
- int p = i*width+j;
- if (i < height / 2) {
- tex[p][0] = 0; tex[p][1] = 0; tex[p][2] = 0;
- }
- else {
- tex[p][0] = 255; tex[p][1] = 0; tex[p][2] = 0;
- }
- }
- }
-
- glTexImage2D( GL_TEXTURE_2D, 0, 3, width, height, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-
-
- /*
- * setup second texture object
- */
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glEnable( GL_TEXTURE_2D );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD );
-
- glBindTexture( GL_TEXTURE_2D, TexObj[1] );
- assert(glIsTexture(TexObj[1]));
-
- /* left=green, right = blue */
- for (i=0;i<height;i++) {
- for (j=0;j<width;j++) {
- int p = i*width+j;
- if (j < width / 2) {
- tex[p][0] = 0; tex[p][1] = 255; tex[p][2] = 0;
- }
- else {
- tex[p][0] = 0; tex[p][1] = 0; tex[p][2] = 255;
- }
- }
- }
- glTexImage2D( GL_TEXTURE_2D, 0, 3, width, height, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-}
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(300, 300);
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-
- Window = glutCreateWindow("Texture Objects");
- if (!Window) {
- exit(1);
- }
-
- init();
- init_arrays();
-
- glutReshapeFunc( reshape );
- glutKeyboardFunc( key );
- if (Anim)
- glutIdleFunc( idle );
- glutDisplayFunc( draw );
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/multiwindow.c b/progs/tests/multiwindow.c
deleted file mode 100644
index e004b0336ca..00000000000
--- a/progs/tests/multiwindow.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* $Id: multiwindow.c,v 1.1 2001/08/21 14:25:31 brianp Exp $ */
-
-/*
- * A skeleton/template GLUT program
- *
- * Written by Brian Paul and in the public domain.
- */
-
-
-/*
- * $Log: multiwindow.c,v $
- * Revision 1.1 2001/08/21 14:25:31 brianp
- * simple multi-window GLUT test prog
- *
- * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
- * Imported sources
- *
- * Revision 1.2 1998/11/07 14:20:14 brianp
- * added simple rotation, animation of cube
- *
- * Revision 1.1 1998/11/07 14:14:37 brianp
- * Initial revision
- *
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-
-static GLint Window[2];
-
-static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
-static GLboolean Anim = GL_TRUE;
-
-
-static void Idle( void )
-{
- Xrot += 3.0;
- Yrot += 4.0;
- Zrot += 2.0;
-
- glutSetWindow(Window[0]);
- glutPostRedisplay();
- glutSetWindow(Window[1]);
- glutPostRedisplay();
-}
-
-
-static void Display0( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
-
- glColor3f(0, 1, 0);
- glutSolidCube(2.0);
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Display1( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
-
- glShadeModel(GL_FLAT);
-
- glBegin(GL_TRIANGLE_STRIP);
- glColor3f(1, 0, 0);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glColor3f(1, 0, 0);
- glVertex2f( -1, 1);
- glColor3f(0, 0, 1);
- glVertex2f( 1, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'z':
- Zrot -= step;
- break;
- case 'Z':
- Zrot += step;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
-
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 400, 400 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- Window[0] = glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display0 );
- glutIdleFunc(Idle);
- printf("GL_RENDERER[0] = %s\n", (char *) glGetString(GL_RENDERER));
-
- glutInitWindowPosition( 500, 0 );
- glutInitWindowSize( 400, 400 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- Window[1] = glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display1 );
- glutIdleFunc(Idle);
- printf("GL_RENDERER[1] = %s\n", (char *) glGetString(GL_RENDERER));
-
- glutMainLoop();
-
- return 0;
-}
diff --git a/progs/tests/no_s3tc.c b/progs/tests/no_s3tc.c
deleted file mode 100644
index d3383ff98af..00000000000
--- a/progs/tests/no_s3tc.c
+++ /dev/null
@@ -1,97 +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
- * 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 no_s3tc.c
- * Test program to verify the behavior of an OpenGL implementation when
- * an application calls \c glCompressedTexImage2D with an unsupported (but
- * valid) compression format. The most common example is calling it with
- * \c GL_COMPRESSED_RGBA_S3TC_DXT1_EXT when GL_EXT_texture_compression_s3tc
- * is not supported.
- *
- * This tests Mesa bug #1028405.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glut.h>
-#include <GL/glext.h>
-
-static unsigned data[16];
-
-int
-main( int argc, char ** argv )
-{
- float gl_version;
- GLenum format;
- GLuint size;
- GLuint width;
- GLenum err;
-
-
- glutInit( & argc, argv );
- glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
-
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 300, 300 );
- glutCreateWindow( "No S3TC Test" );
-
- gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL );
- if ( ! glutExtensionSupported( "GL_ARB_texture_compression" )
- && (gl_version < 1.3) ) {
- fprintf( stderr, "Either OpenGL 1.3 or GL_ARB_texture_compression "
- "must be supported.\n" );
- return( EXIT_SUCCESS );
- }
-
-
- if ( ! glutExtensionSupported( "GL_EXT_texture_compression_s3tc" ) ) {
- format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
- width = 4;
- size = 8;
- }
- else if ( ! glutExtensionSupported( "GL_3DFX_texture_compression_FXT1" ) ) {
- format = GL_COMPRESSED_RGBA_FXT1_3DFX;
- width = 8;
- size = 16;
- }
- else {
- fprintf( stderr, "Either GL_EXT_texture_compression_s3tc or "
- "GL_3DFX_texture_compression_FXT1 must NOT be supported.\n" );
- return( EXIT_SUCCESS );
- }
-
- glCompressedTexImage2D( GL_TEXTURE_2D, 0, format, width, 4, 0,
- size, data );
- err = glGetError();
- if ( err != GL_INVALID_ENUM ) {
- fprintf( stderr, "GL error 0x%04x should have been generated, but "
- "0x%04x was generated instead.\n", GL_INVALID_ENUM, err );
- }
-
- return (err == GL_INVALID_ENUM) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
diff --git a/progs/tests/packedpixels.c b/progs/tests/packedpixels.c
deleted file mode 100644
index 67ffe088259..00000000000
--- a/progs/tests/packedpixels.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Test packed pixel formats for textures.
- * Brian Paul
- * 12 May 2004
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <GL/glut.h>
-
-
-struct pixel_format {
- const char *name;
- GLenum format;
- GLenum type;
- GLint bytes;
- GLuint redTexel, greenTexel;
-};
-
-static const struct pixel_format Formats[] = {
-
- { "GL_RGBA/GL_UNSIGNED_INT_8_8_8_8",
- GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, 4, 0xff000000, 0x00ff0000 },
- { "GL_RGBA/GL_UNSIGNED_INT_8_8_8_8_REV",
- GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0x000000ff, 0x0000ff00 },
- { "GL_RGBA/GL_UNSIGNED_INT_10_10_10_2",
- GL_RGBA, GL_UNSIGNED_INT_10_10_10_2, 4, 0xffc00000, 0x3ff000 },
- { "GL_RGBA/GL_UNSIGNED_INT_2_10_10_10_REV",
- GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, 4, 0x3ff, 0xffc00 },
- { "GL_RGBA/GL_UNSIGNED_SHORT_4_4_4_4",
- GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0xf000, 0x0f00 },
- { "GL_RGBA/GL_UNSIGNED_SHORT_4_4_4_4_REV",
- GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0x000f, 0x00f0 },
- { "GL_RGBA/GL_UNSIGNED_SHORT_5_5_5_1",
- GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0xf800, 0x7c0 },
- { "GL_RGBA/GL_UNSIGNED_SHORT_1_5_5_5_REV",
- GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x1f, 0x3e0 },
-
- { "GL_BGRA/GL_UNSIGNED_INT_8_8_8_8",
- GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, 4, 0x0000ff00, 0x00ff0000 },
- { "GL_BGRA/GL_UNSIGNED_INT_8_8_8_8_REV",
- GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0x00ff0000, 0x0000ff00 },
- { "GL_BGRA/GL_UNSIGNED_SHORT_4_4_4_4",
- GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0x00f0, 0x0f00 },
- { "GL_BGRA/GL_UNSIGNED_SHORT_4_4_4_4_REV",
- GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0x0f00, 0x00f0 },
- { "GL_BGRA/GL_UNSIGNED_SHORT_5_5_5_1",
- GL_BGRA, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0x3e, 0x7c0 },
- { "GL_BGRA/GL_UNSIGNED_SHORT_1_5_5_5_REV",
- GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x7c00, 0x3e0 },
-
- { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8",
- GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8, 4, 0x000000ff, 0x0000ff00 },
- { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8_REV",
- GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0xff000000, 0x00ff0000 },
- { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4",
- GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0x000f, 0x00f0 },
- { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4_REV",
- GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0xf000, 0x0f00 },
- { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_5_5_5_1",
- GL_ABGR_EXT, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0x1, 0x3e },
- { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_1_5_5_5_REV",
- GL_ABGR_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x8000, 0x7c00 },
-
- { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5",
- GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, 0xf800, 0x7e0 },
- { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5_REV",
- GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, 2, 0x1f, 0x7e0 },
- { "GL_RGB/GL_UNSIGNED_BYTE_3_3_2",
- GL_RGB, GL_UNSIGNED_BYTE_3_3_2, 1, 0xe0, 0x1c },
- { "GL_RGB/GL_UNSIGNED_BYTE_2_3_3_REV",
- GL_RGB, GL_UNSIGNED_BYTE_2_3_3_REV, 1, 0x7, 0x38 },
-
- { NULL, 0, 0, 0, 0, 0 }
-};
-
-
-struct name_format {
- const char *name;
- GLenum format;
-};
-
-static const struct name_format IntFormats[] = {
- { "GL_RGBA", GL_RGBA },
- { "GL_RGBA2", GL_RGBA2 },
- { "GL_RGBA4", GL_RGBA4 },
- { "GL_RGB5_A1", GL_RGB5_A1 },
- { "GL_RGBA8", GL_RGBA8 },
- { "GL_RGBA12", GL_RGBA12 },
- { "GL_RGBA16", GL_RGBA16 },
- { "GL_RGB10_A2", GL_RGB10_A2 },
-
- { "GL_RGB", GL_RGB },
- { "GL_R3_G3_B2", GL_R3_G3_B2 },
- { "GL_RGB4", GL_RGB4 },
- { "GL_RGB5", GL_RGB5 },
- { "GL_RGB8", GL_RGB8 },
- { "GL_RGB10", GL_RGB10 },
- { "GL_RGB12", GL_RGB12 },
- { "GL_RGB16", GL_RGB16 },
-
-};
-
-#define NUM_INT_FORMATS (sizeof(IntFormats) / sizeof(IntFormats[0]))
-static GLuint CurFormat = 0;
-
-static GLboolean Test3D = GL_FALSE;
-
-
-
-static void
-PrintString(const char *s)
-{
- while (*s) {
- glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
- s++;
- }
-}
-
-
-static void
-MakeTexture(const struct pixel_format *format, GLenum intFormat, GLboolean swap)
-{
- GLubyte texBuffer[1000];
- int i;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, swap);
-
- if (format->bytes == 1) {
- for (i = 0; i < 8; i++) {
- texBuffer[i] = format->redTexel;
- }
- for (i = 8; i < 16; i++) {
- texBuffer[i] = format->greenTexel;
- }
- }
- else if (format->bytes == 2) {
- GLushort *us = (GLushort *) texBuffer;
- for (i = 0; i < 8; i++) {
- us[i] = format->redTexel;
- }
- for (i = 8; i < 16; i++) {
- us[i] = format->greenTexel;
- }
- if (swap) {
- for (i = 0; i < 16; i++)
- us[i] = (us[i] << 8) | (us[i] >> 8);
- }
- }
- else if (format->bytes == 4) {
- GLuint *ui = (GLuint *) texBuffer;
- for (i = 0; i < 8; i++) {
- ui[i] = format->redTexel;
- }
- for (i = 8; i < 16; i++) {
- ui[i] = format->greenTexel;
- }
- if (swap) {
- for (i = 0; i < 16; i++) {
- GLuint b = ui[i];
- ui[i] = (b >> 24)
- | ((b >> 8) & 0xff00)
- | ((b << 8) & 0xff0000)
- | ((b << 24) & 0xff000000);
- }
- }
- }
- else {
- abort();
- }
-
- if (Test3D) {
- /* 4 x 4 x 4 texture, undefined data */
- glTexImage3D(GL_TEXTURE_3D, 0, intFormat, 4, 4, 4, 0,
- format->format, format->type, NULL);
- /* fill in Z=1 and Z=2 slices with the real texture data */
- glTexSubImage3D(GL_TEXTURE_3D, 0,
- 0, 0, 1, /* offset */
- 4, 4, 1, /* size */
- format->format, format->type, texBuffer);
- glTexSubImage3D(GL_TEXTURE_3D, 0,
- 0, 0, 2, /* offset */
- 4, 4, 1, /* size */
- format->format, format->type, texBuffer);
- }
- else {
- glTexImage2D(GL_TEXTURE_2D, 0, intFormat, 4, 4, 0,
- format->format, format->type, texBuffer);
- }
-
- if (glGetError()) {
- printf("GL Error for %s\n", format->name);
- memset(texBuffer, 255, 1000);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0,
- GL_RGB, GL_UNSIGNED_BYTE, texBuffer);
- }
-}
-
-
-
-static void
-Draw(void)
-{
- char s[1000];
- int w = 350, h = 20;
- int i, swap;
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- for (swap = 0; swap < 2; swap++) {
- for (i = 0; Formats[i].name; i++) {
- glPushMatrix();
- glTranslatef(swap * (w + 2), i * (h + 2), 0);
-
- MakeTexture(Formats + i, IntFormats[CurFormat].format, swap);
-
- if (Test3D)
- glEnable(GL_TEXTURE_3D);
- else
- glEnable(GL_TEXTURE_2D);
- glBegin(GL_POLYGON);
- glTexCoord3f(0, 0, 0.5); glVertex2f(0, 0);
- glTexCoord3f(1, 0, 0.5); glVertex2f(w, 0);
- glTexCoord3f(1, 1, 0.5); glVertex2f(w, h);
- glTexCoord3f(0, 1, 0.5); glVertex2f(0, h);
- glEnd();
-
- if (Test3D)
- glDisable(GL_TEXTURE_3D);
- else
- glDisable(GL_TEXTURE_2D);
- glColor3f(0, 0, 0);
- glRasterPos2i(8, 6);
- PrintString(Formats[i].name);
-
- glPopMatrix();
- }
- }
-
- glPushMatrix();
- glTranslatef(2, i * (h + 2), 0);
- glColor3f(1, 1, 1);
- glRasterPos2i(8, 6);
- PrintString("Normal");
- glRasterPos2i(w + 2, 6);
- PrintString("Byte Swapped");
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(2, (i + 1) * (h + 2), 0);
- glRasterPos2i(8, 6);
- sprintf(s, "Internal Texture Format [f/F]: %s (%d of %d)",
- IntFormats[CurFormat].name, CurFormat + 1, NUM_INT_FORMATS);
- PrintString(s);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(2, (i + 2) * (h + 2), 0);
- glRasterPos2i(8, 6);
- if (Test3D)
- PrintString("Target [2/3]: GL_TEXTURE_3D");
- else
- PrintString("Target [2/3]: GL_TEXTURE_2D");
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void
-Reshape(int width, int height)
-{
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0, width, 0, height, -1, 1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-
-static void
-Key(unsigned char key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'F':
- if (CurFormat == 0)
- CurFormat = NUM_INT_FORMATS - 1;
- else
- CurFormat--;
- break;
- case 'f':
- CurFormat++;
- if (CurFormat == NUM_INT_FORMATS)
- CurFormat = 0;
- break;
- case '2':
- Test3D = GL_FALSE;
- break;
- case '3':
- Test3D = GL_TRUE;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init(void)
-{
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-}
-
-
-int
-main(int argc, char *argv[])
-{
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(700, 800);
- glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
- glutCreateWindow(argv[0]);
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/pbo.c b/progs/tests/pbo.c
deleted file mode 100644
index b31b36cc121..00000000000
--- a/progs/tests/pbo.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * GL_EXT_pixel_buffer_object test
- *
- * Brian Paul
- * 11 March 2004
- */
-
-#define GL_GLEXT_PROTOTYPES
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-#include "../util/readtex.c" /* a hack, I know */
-
-#define IMAGE_FILE "../images/girl.rgb"
-
-static int ImgWidth, ImgHeight;
-static GLenum ImgFormat;
-static GLubyte *Image = NULL;
-
-static int APosX, APosY; /* simple drawpixels */
-static int BPosX, BPosY; /* read/draw pixels */
-static int CPosX, CPosY; /* copypixels */
-
-static GLboolean DrawFront = GL_FALSE;
-static GLboolean ScaleAndBias = GL_FALSE;
-static GLboolean Benchmark = GL_FALSE;
-
-static GLuint DrawPBO, TempPBO;
-
-
-static GLenum ReadFormat = GL_BGRA;
-static GLenum ReadType = GL_UNSIGNED_INT_8_8_8_8_REV;
-
-
-
-static void
-CheckError(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("GL Error 0x%x at line %d\n", (int) err, line);
- }
-}
-
-
-static void
-Reset( void )
-{
- APosX = 5; APosY = 20;
- BPosX = APosX + ImgWidth + 5; BPosY = 20;
- CPosX = BPosX + ImgWidth + 5; CPosY = 20;
-}
-
-
-static void
-PrintString(const char *s)
-{
- while (*s) {
- glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
- s++;
- }
-}
-
-
-static void
-SetupPixelTransfer(GLboolean invert)
-{
- if (invert) {
- glPixelTransferf(GL_RED_SCALE, -1.0);
- glPixelTransferf(GL_RED_BIAS, 1.0);
- glPixelTransferf(GL_GREEN_SCALE, -1.0);
- glPixelTransferf(GL_GREEN_BIAS, 1.0);
- glPixelTransferf(GL_BLUE_SCALE, -1.0);
- glPixelTransferf(GL_BLUE_BIAS, 1.0);
- }
- else {
- glPixelTransferf(GL_RED_SCALE, 1.0);
- glPixelTransferf(GL_RED_BIAS, 0.0);
- glPixelTransferf(GL_GREEN_SCALE, 1.0);
- glPixelTransferf(GL_GREEN_BIAS, 0.0);
- glPixelTransferf(GL_BLUE_SCALE, 1.0);
- glPixelTransferf(GL_BLUE_BIAS, 0.0);
- }
-}
-
-
-static void
-Display( void )
-{
- glClearColor(.3, .3, .3, 1);
- glClear( GL_COLOR_BUFFER_BIT );
-
- CheckError(__LINE__);
-
- /** Unbind UNPACK pixel buffer before calling glBitmap */
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
-
- glRasterPos2i(5, ImgHeight+25);
- PrintString("f = toggle front/back s = toggle scale/bias b = benchmark");
-
- glRasterPos2i(5, ImgHeight+40);
- PrintString("GL_EXT_pixel_buffer_object test");
-
- /* draw original image */
- glRasterPos2i(APosX, 5);
- PrintString("Original");
- glRasterPos2i(APosX, APosY);
- glEnable(GL_DITHER);
- SetupPixelTransfer(GL_FALSE);
- /*** Draw from the DrawPBO */
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
- glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, 0);
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
-
- CheckError(__LINE__);
-
- /* do readpixels, drawpixels */
- glRasterPos2i(BPosX, 5);
- PrintString("Read/DrawPixels");
- SetupPixelTransfer(ScaleAndBias);
- /*** read into the Temp PBO */
- glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, TempPBO);
- CheckError(__LINE__);
- if (Benchmark) {
- GLint reads = 0;
- GLint endTime;
- GLint startTime = glutGet(GLUT_ELAPSED_TIME);
- GLdouble seconds, pixelsPerSecond;
- printf("Benchmarking...\n");
- do {
- glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
- ReadFormat, ReadType, 0);
- reads++;
- endTime = glutGet(GLUT_ELAPSED_TIME);
- } while (endTime - startTime < 4000); /* 4 seconds */
- seconds = (double) (endTime - startTime) / 1000.0;
- pixelsPerSecond = reads * ImgWidth * ImgHeight / seconds;
- printf("Result: %d reads in %f seconds = %f pixels/sec\n",
- reads, seconds, pixelsPerSecond);
- Benchmark = GL_FALSE;
- }
- else {
- glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
- ReadFormat, ReadType, 0);
- }
- CheckError(__LINE__);
- glRasterPos2i(BPosX, BPosY);
- glDisable(GL_DITHER);
- SetupPixelTransfer(GL_FALSE);
-
- CheckError(__LINE__);
-
- /*** draw from the Temp PBO */
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, TempPBO);
- glDrawPixels(ImgWidth, ImgHeight, ReadFormat, ReadType, 0);
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
-
- CheckError(__LINE__);
-
- /* do copypixels */
- glRasterPos2i(CPosX, 5);
- PrintString("CopyPixels");
- glRasterPos2i(CPosX, CPosY);
- glDisable(GL_DITHER);
- SetupPixelTransfer(ScaleAndBias);
- glCopyPixels(APosX, APosY, ImgWidth, ImgHeight, GL_COLOR);
-
- CheckError(__LINE__);
-
- if (!DrawFront)
- glutSwapBuffers();
- else
- glFinish();
-}
-
-
-static void
-Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho( 0.0, width, 0.0, height, -1.0, 1.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-static void
-Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'b':
- Benchmark = GL_TRUE;
- break;
- case 's':
- ScaleAndBias = !ScaleAndBias;
- break;
- case 'f':
- DrawFront = !DrawFront;
- if (DrawFront) {
- glDrawBuffer(GL_FRONT);
- glReadBuffer(GL_FRONT);
- }
- else {
- glDrawBuffer(GL_BACK);
- glReadBuffer(GL_BACK);
- }
- printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init(void)
-{
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- if (!glutExtensionSupported("GL_EXT_pixel_buffer_object")) {
- printf("Sorry, this demo requires GL_EXT_pixel_buffer_object\n");
- exit(0);
- }
-
- Image = LoadRGBImage( IMAGE_FILE, &ImgWidth, &ImgHeight, &ImgFormat );
- if (!Image) {
- printf("Couldn't read %s\n", IMAGE_FILE);
- exit(0);
- }
-
- printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
-
- if (ImgFormat == GL_RGB) {
- /* convert to RGBA */
- int i;
- GLubyte *image2 = (GLubyte *) malloc(ImgWidth * ImgHeight * 4);
- printf("Converting RGB image to RGBA\n");
- for (i = 0; i < ImgWidth * ImgHeight; i++) {
- image2[i*4+0] = Image[i*3+0];
- image2[i*4+1] = Image[i*3+1];
- image2[i*4+2] = Image[i*3+2];
- image2[i*4+3] = 255;
- }
- free(Image);
- Image = image2;
- ImgFormat = GL_RGBA;
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, ImgWidth);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_ROW_LENGTH, ImgWidth);
-
- Reset();
-
- /* put image into DrawPBO */
- glGenBuffersARB(1, &DrawPBO);
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
- glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT,
- ImgWidth * ImgHeight * 4, Image, GL_STATIC_DRAW);
-
- /* Setup TempPBO - used for glReadPixels & glDrawPixels */
- glGenBuffersARB(1, &TempPBO);
- glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, TempPBO);
- glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT,
- ImgWidth * ImgHeight * 4, NULL, GL_DYNAMIC_COPY);
-
-}
-
-
-int
-main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 750, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
- Init();
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c
deleted file mode 100644
index 96697e5bda6..00000000000
--- a/progs/tests/prog_parameter.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2006
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 prog_parameter.c
- *
- * Test various aspects of setting (and getting) low-level program parameters.
- * This is primarilly intended as a test for GL_EXT_gpu_program_parameters,
- * but it turns out that it hits some other functionality along the way.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-#ifndef GL_EXT_gpu_program_parameters
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)(GLenum,
- GLuint, GLsizei, const GLfloat *);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)(GLenum,
- GLuint, GLsizei, const GLfloat *);
-#endif
-
-static PFNGLPROGRAMLOCALPARAMETER4FVARBPROC program_local_parameter4fv = NULL;
-static PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC get_program_local_parameterfv = NULL;
-static PFNGLPROGRAMENVPARAMETER4FVARBPROC program_env_parameter4fv = NULL;
-static PFNGLGETPROGRAMENVPARAMETERFVARBPROC get_program_env_parameterfv = NULL;
-static PFNGLBINDPROGRAMARBPROC bind_program = NULL;
-static PFNGLGETPROGRAMIVARBPROC get_program = NULL;
-
-static PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC program_local_parameters4fv = NULL;
-static PFNGLPROGRAMENVPARAMETERS4FVEXTPROC program_env_parameters4fv = NULL;
-
-static int Width = 400;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
-}
-
-
-static void Idle( void )
-{
-}
-
-
-static void Visible( int vis )
-{
- if ( vis == GLUT_VISIBLE ) {
- glutIdleFunc( Idle );
- }
- else {
- glutIdleFunc( NULL );
- }
-}
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static int set_parameter_batch( GLsizei count, GLfloat * param,
- const char * name,
- PFNGLPROGRAMLOCALPARAMETER4FVARBPROC set_parameter,
- PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC set_parameters,
- PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC get_parameter
- )
-{
- unsigned i;
- int pass = 1;
-
-
- for ( i = 0 ; i < (4 * count) ; i++ ) {
- param[i] = (GLfloat) random() / (GLfloat) random();
- }
-
- /* Try using the "classic" interface.
- */
- printf("Testing glProgram%sParameter4fvARB (count = %u)...\n", name, count);
- for ( i = 0 ; i < count ; i++ ) {
- (*set_parameter)(GL_VERTEX_PROGRAM_ARB, i, & param[i * 4]);
- }
-
- for ( i = 0 ; i < count ; i++ ) {
- GLfloat temp[4];
-
- (*get_parameter)(GL_VERTEX_PROGRAM_ARB, i, temp);
-
- if ( (temp[0] != param[(i * 4) + 0])
- || (temp[1] != param[(i * 4) + 1])
- || (temp[2] != param[(i * 4) + 2])
- || (temp[3] != param[(i * 4) + 3]) ) {
- printf("Mismatch in glProgram%sParameter4fvARB index %u!\n", name, i);
- printf("Got { %f, %f, %f, %f }, expected { %f, %f, %f, %f }!\n",
- temp[0], temp[1],
- temp[2], temp[3],
- param[(i * 4) + 0], param[(i * 4) + 1],
- param[(i * 4) + 2], param[(i * 4) + 3]);
- pass = 0;
- break;
- }
- }
-
-
- if ( set_parameters == NULL ) {
- return pass;
- }
-
-
- for ( i = 0 ; i < (4 * count) ; i++ ) {
- param[i] = (GLfloat) random() / (GLfloat) random();
- }
-
- printf("Testing glProgram%sParameters4fvEXT (count = %u)...\n", name, count);
- (*set_parameters)(GL_VERTEX_PROGRAM_ARB, 0, count, param);
-
- for ( i = 0 ; i < count ; i++ ) {
- GLfloat temp[4];
-
- (*get_parameter)(GL_VERTEX_PROGRAM_ARB, i, temp);
-
- if ( (temp[0] != param[(i * 4) + 0])
- || (temp[1] != param[(i * 4) + 1])
- || (temp[2] != param[(i * 4) + 2])
- || (temp[3] != param[(i * 4) + 3]) ) {
- printf("Mismatch in glProgram%sParameters4fvEXT index %u!\n", name, i);
- printf("Got { %f, %f, %f, %f }, expected { %f, %f, %f, %f }!\n",
- temp[0], temp[1],
- temp[2], temp[3],
- param[(i * 4) + 0], param[(i * 4) + 1],
- param[(i * 4) + 2], param[(i * 4) + 3]);
- pass = 0;
- break;
- }
- }
-
-
- return pass;
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
- int pass = 1;
- GLfloat * params;
- GLint max_program_env_parameters;
- GLint max_program_local_parameters;
-
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n\n", ver_string);
-
- if ( !glutExtensionSupported("GL_ARB_vertex_program") ) {
- printf("Sorry, this program requires GL_ARB_vertex_program\n");
- exit(2);
- }
-
-
- program_local_parameter4fv = glutGetProcAddress( "glProgramLocalParameter4fvARB" );
- program_env_parameter4fv = glutGetProcAddress( "glProgramEnvParameter4fvARB" );
-
- get_program_local_parameterfv = glutGetProcAddress( "glGetProgramLocalParameterfvARB" );
- get_program_env_parameterfv = glutGetProcAddress( "glGetProgramEnvParameterfvARB" );
-
- bind_program = glutGetProcAddress( "glBindProgramARB" );
- get_program = glutGetProcAddress( "glGetProgramivARB" );
-
- if ( glutExtensionSupported("GL_EXT_gpu_program_parameters") ) {
- printf("GL_EXT_gpu_program_parameters available, testing that path.\n");
-
- program_local_parameters4fv = glutGetProcAddress( "glProgramLocalParameters4fvEXT" );
- program_env_parameters4fv = glutGetProcAddress( "glProgramEnvParameters4fvEXT" );
- }
- else {
- printf("GL_EXT_gpu_program_parameters not available.\n");
-
- program_local_parameters4fv = NULL;
- program_env_parameters4fv = NULL;
- }
-
-
-
- /* Since the test sets program local parameters, a program must be bound.
- * Program source, however, is not needed.
- */
- (*bind_program)(GL_VERTEX_PROGRAM_ARB, 1);
-
-
- (*get_program)(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB,
- & max_program_env_parameters);
-
- params = malloc(max_program_env_parameters * 4 * sizeof(GLfloat));
-
- pass &= set_parameter_batch(max_program_env_parameters, params, "Env",
- program_env_parameter4fv,
- program_env_parameters4fv,
- get_program_env_parameterfv);
-
-
- (*get_program)(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB,
- & max_program_local_parameters);
-
- if (max_program_local_parameters > max_program_env_parameters) {
- params = realloc(params,
- max_program_local_parameters * 4 * sizeof(GLfloat));
- }
-
- pass &= set_parameter_batch(max_program_local_parameters, params, "Local",
- program_local_parameter4fv,
- program_local_parameters4fv,
- get_program_local_parameterfv);
-
- free(params);
-
- if (! pass) {
- printf("FAIL!\n");
- exit(1);
- }
-
- printf("PASS!\n");
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB );
- glutCreateWindow( "Program Parameters Test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- glutVisibilityFunc( Visible );
-
- Init();
-
- return 0;
-}
diff --git a/progs/tests/projtex.c b/progs/tests/projtex.c
deleted file mode 100644
index e3ef948ab6a..00000000000
--- a/progs/tests/projtex.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-
-/* projtex.c - by David Yu and David Blythe, SGI */
-
-/**
- ** Demonstrates simple projective texture mapping.
- **
- ** Button1 changes view, Button2 moves texture.
- **
- ** (See: Segal, Korobkin, van Widenfelt, Foran, and Haeberli
- ** "Fast Shadows and Lighting Effects Using Texture Mapping", SIGGRAPH '92)
- **
- ** 1994,1995 -- David G Yu
- **
- ** cc -o projtex projtex.c texture.c -lglut -lGLU -lGL -lX11 -lm
- **/
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-#if 0
-#include "texture.h"
-#else
-#include "../util/readtex.c"
-#endif
-
-
-/* Some <math.h> files do not define M_PI... */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#define MAX_TEX 4
-int NumTextures = 1;
-
-int winWidth, winHeight;
-
-GLboolean redrawContinuously = GL_FALSE;
-
-float angle, axis[3];
-enum MoveModes {
- MoveNone, MoveView, MoveObject, MoveTexture
-};
-enum MoveModes mode = MoveNone;
-
-GLfloat objectXform[4][4];
-GLfloat textureXform[MAX_TEX][4][4];
-
-void (*drawObject) (void);
-void (*loadTexture) (void);
-GLboolean textureEnabled = GL_TRUE;
-GLboolean showProjection = GL_TRUE;
-GLboolean linearFilter = GL_TRUE;
-
-char *texFilename[MAX_TEX] = {
- "../images/girl.rgb",
- "../images/tile.rgb",
- "../images/bw.rgb",
- "../images/reflect.rgb"
-};
-
-
-GLfloat zoomFactor = 1.0;
-
-/*****************************************************************/
-
-
-void ActiveTexture(int i)
-{
- glActiveTextureARB(i);
-}
-
-
-/* matrix = identity */
-void
-matrixIdentity(GLfloat matrix[16])
-{
- matrix[0] = 1.0;
- matrix[1] = 0.0;
- matrix[2] = 0.0;
- matrix[3] = 0.0;
- matrix[4] = 0.0;
- matrix[5] = 1.0;
- matrix[6] = 0.0;
- matrix[7] = 0.0;
- matrix[8] = 0.0;
- matrix[9] = 0.0;
- matrix[10] = 1.0;
- matrix[11] = 0.0;
- matrix[12] = 0.0;
- matrix[13] = 0.0;
- matrix[14] = 0.0;
- matrix[15] = 1.0;
-}
-
-/* matrix2 = transpose(matrix1) */
-void
-matrixTranspose(GLfloat matrix2[16], GLfloat matrix1[16])
-{
- matrix2[0] = matrix1[0];
- matrix2[1] = matrix1[4];
- matrix2[2] = matrix1[8];
- matrix2[3] = matrix1[12];
-
- matrix2[4] = matrix1[1];
- matrix2[5] = matrix1[5];
- matrix2[6] = matrix1[9];
- matrix2[7] = matrix1[13];
-
- matrix2[8] = matrix1[2];
- matrix2[9] = matrix1[6];
- matrix2[10] = matrix1[10];
- matrix2[11] = matrix1[14];
-
- matrix2[12] = matrix1[3];
- matrix2[13] = matrix1[7];
- matrix2[14] = matrix1[14];
- matrix2[15] = matrix1[15];
-}
-
-/*****************************************************************/
-
-/* load SGI .rgb image (pad with a border of the specified width and color) */
-#if 0
-static void
-imgLoad(char *filenameIn, int borderIn, GLfloat borderColorIn[4],
- int *wOut, int *hOut, GLubyte ** imgOut)
-{
- int border = borderIn;
- int width, height;
- int w, h;
- GLubyte *image, *img, *p;
- int i, j, components;
-
- image = (GLubyte *) read_texture(filenameIn, &width, &height, &components);
- w = width + 2 * border;
- h = height + 2 * border;
- img = (GLubyte *) calloc(w * h, 4 * sizeof(unsigned char));
-
- p = img;
- for (j = -border; j < height + border; ++j) {
- for (i = -border; i < width + border; ++i) {
- if (0 <= j && j <= height - 1 && 0 <= i && i <= width - 1) {
- p[0] = image[4 * (j * width + i) + 0];
- p[1] = image[4 * (j * width + i) + 1];
- p[2] = image[4 * (j * width + i) + 2];
- p[3] = 0xff;
- } else {
- p[0] = borderColorIn[0] * 0xff;
- p[1] = borderColorIn[1] * 0xff;
- p[2] = borderColorIn[2] * 0xff;
- p[3] = borderColorIn[3] * 0xff;
- }
- p += 4;
- }
- }
- free(image);
- *wOut = w;
- *hOut = h;
- *imgOut = img;
-}
-#endif
-
-
-/*****************************************************************/
-
-/* Load the image file specified on the command line as the current texture */
-void
-loadImageTextures(void)
-{
- GLfloat borderColor[4] =
- {1.0, 1.0, 1.0, 1.0};
- int tex;
-
- for (tex = 0; tex < NumTextures; tex++) {
- GLubyte *image, *texData3, *texData4;
- GLint imgWidth, imgHeight;
- GLenum imgFormat;
- int i, j;
-
- printf("loading %s\n", texFilename[tex]);
- image = LoadRGBImage(texFilename[tex], &imgWidth, &imgHeight, &imgFormat);
- if (!image) {
- printf("can't find %s\n", texFilename[tex]);
- exit(1);
- }
- assert(imgFormat == GL_RGB);
-
- /* scale to 256x256 */
- texData3 = malloc(256 * 256 * 4);
- texData4 = malloc(256 * 256 * 4);
- assert(texData3);
- assert(texData4);
- gluScaleImage(imgFormat, imgWidth, imgHeight, GL_UNSIGNED_BYTE, image,
- 256, 256, GL_UNSIGNED_BYTE, texData3);
-
- /* convert to rgba */
- for (i = 0; i < 256 * 256; i++) {
- texData4[i*4+0] = texData3[i*3+0];
- texData4[i*4+1] = texData3[i*3+1];
- texData4[i*4+2] = texData3[i*3+2];
- texData4[i*4+3] = 128;
- }
-
- /* put transparent border around image */
- for (i = 0; i < 256; i++) {
- texData4[i*4+0] = 255;
- texData4[i*4+1] = 255;
- texData4[i*4+2] = 255;
- texData4[i*4+3] = 0;
- }
- j = 256 * 255 * 4;
- for (i = 0; i < 256; i++) {
- texData4[j + i*4+0] = 255;
- texData4[j + i*4+1] = 255;
- texData4[j + i*4+2] = 255;
- texData4[j + i*4+3] = 0;
- }
- for (i = 0; i < 256; i++) {
- j = i * 256 * 4;
- texData4[j+0] = 255;
- texData4[j+1] = 255;
- texData4[j+2] = 255;
- texData4[j+3] = 0;
- }
- for (i = 0; i < 256; i++) {
- j = i * 256 * 4 + 255 * 4;
- texData4[j+0] = 255;
- texData4[j+1] = 255;
- texData4[j+2] = 255;
- texData4[j+3] = 0;
- }
-
- ActiveTexture(GL_TEXTURE0_ARB + tex);
- glBindTexture(GL_TEXTURE_2D, tex + 1);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, texData4);
-
- if (linearFilter) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- } else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
- glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
- }
-}
-
-/* Create a simple spotlight pattern and make it the current texture */
-void
-loadSpotlightTexture(void)
-{
- static int texWidth = 64, texHeight = 64;
- static GLubyte *texData;
- GLfloat borderColor[4] =
- {0.1, 0.1, 0.1, 1.0};
-
- if (!texData) {
- GLubyte *p;
- int i, j;
-
- texData = (GLubyte *) malloc(texWidth * texHeight * 4 * sizeof(GLubyte));
-
- p = texData;
- for (j = 0; j < texHeight; ++j) {
- float dy = (texHeight * 0.5 - j + 0.5) / (texHeight * 0.5);
-
- for (i = 0; i < texWidth; ++i) {
- float dx = (texWidth * 0.5 - i + 0.5) / (texWidth * 0.5);
- float r = cos(M_PI / 2.0 * sqrt(dx * dx + dy * dy));
- float c;
-
- r = (r < 0) ? 0 : r * r;
- c = 0xff * (r + borderColor[0]);
- p[0] = (c <= 0xff) ? c : 0xff;
- c = 0xff * (r + borderColor[1]);
- p[1] = (c <= 0xff) ? c : 0xff;
- c = 0xff * (r + borderColor[2]);
- p[2] = (c <= 0xff) ? c : 0xff;
- c = 0xff * (r + borderColor[3]);
- p[3] = (c <= 0xff) ? c : 0xff;
- p += 4;
- }
- }
- }
- if (linearFilter) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- } else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
- glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
- gluBuild2DMipmaps(GL_TEXTURE_2D, 4, texWidth, texHeight,
- GL_RGBA, GL_UNSIGNED_BYTE, texData);
-}
-
-/*****************************************************************/
-
-void
-checkErrors(void)
-{
- GLenum error;
- while ((error = glGetError()) != GL_NO_ERROR) {
- fprintf(stderr, "Error: %s\n", (char *) gluErrorString(error));
- }
-}
-
-void
-drawCube(void)
-{
- glBegin(GL_QUADS);
-
- glNormal3f(-1.0, 0.0, 0.0);
- glColor3f(0.80, 0.50, 0.50);
- glVertex3f(-0.5, -0.5, -0.5);
- glVertex3f(-0.5, -0.5, 0.5);
- glVertex3f(-0.5, 0.5, 0.5);
- glVertex3f(-0.5, 0.5, -0.5);
-
- glNormal3f(1.0, 0.0, 0.0);
- glColor3f(0.50, 0.80, 0.50);
- glVertex3f(0.5, 0.5, 0.5);
- glVertex3f(0.5, -0.5, 0.5);
- glVertex3f(0.5, -0.5, -0.5);
- glVertex3f(0.5, 0.5, -0.5);
-
- glNormal3f(0.0, -1.0, 0.0);
- glColor3f(0.50, 0.50, 0.80);
- glVertex3f(-0.5, -0.5, -0.5);
- glVertex3f(0.5, -0.5, -0.5);
- glVertex3f(0.5, -0.5, 0.5);
- glVertex3f(-0.5, -0.5, 0.5);
-
- glNormal3f(0.0, 1.0, 0.0);
- glColor3f(0.50, 0.80, 0.80);
- glVertex3f(0.5, 0.5, 0.5);
- glVertex3f(0.5, 0.5, -0.5);
- glVertex3f(-0.5, 0.5, -0.5);
- glVertex3f(-0.5, 0.5, 0.5);
-
- glNormal3f(0.0, 0.0, -1.0);
- glColor3f(0.80, 0.50, 0.80);
- glVertex3f(-0.5, -0.5, -0.5);
- glVertex3f(-0.5, 0.5, -0.5);
- glVertex3f(0.5, 0.5, -0.5);
- glVertex3f(0.5, -0.5, -0.5);
-
- glNormal3f(0.0, 0.0, 1.0);
- glColor3f(1.00, 0.80, 0.50);
- glVertex3f(0.5, 0.5, 0.5);
- glVertex3f(-0.5, 0.5, 0.5);
- glVertex3f(-0.5, -0.5, 0.5);
- glVertex3f(0.5, -0.5, 0.5);
- glEnd();
-}
-
-void
-drawDodecahedron(void)
-{
-#define A (0.5 * 1.61803) /* (sqrt(5) + 1) / 2 */
-#define B (0.5 * 0.61803) /* (sqrt(5) - 1) / 2 */
-#define C (0.5 * 1.0)
- GLfloat vertexes[20][3] =
- {
- {-A, 0.0, B},
- {-A, 0.0, -B},
- {A, 0.0, -B},
- {A, 0.0, B},
- {B, -A, 0.0},
- {-B, -A, 0.0},
- {-B, A, 0.0},
- {B, A, 0.0},
- {0.0, B, -A},
- {0.0, -B, -A},
- {0.0, -B, A},
- {0.0, B, A},
- {-C, -C, C},
- {-C, -C, -C},
- {C, -C, -C},
- {C, -C, C},
- {-C, C, C},
- {-C, C, -C},
- {C, C, -C},
- {C, C, C},
- };
-#undef A
-#undef B
-#undef C
- GLint polygons[12][5] =
- {
- {0, 12, 10, 11, 16},
- {1, 17, 8, 9, 13},
- {2, 14, 9, 8, 18},
- {3, 19, 11, 10, 15},
- {4, 14, 2, 3, 15},
- {5, 12, 0, 1, 13},
- {6, 17, 1, 0, 16},
- {7, 19, 3, 2, 18},
- {8, 17, 6, 7, 18},
- {9, 14, 4, 5, 13},
- {10, 12, 5, 4, 15},
- {11, 19, 7, 6, 16},
- };
- int i;
-
- glColor3f(0.75, 0.75, 0.75);
- for (i = 0; i < 12; ++i) {
- GLfloat *p0, *p1, *p2, d;
- GLfloat u[3], v[3], n[3];
-
- p0 = &vertexes[polygons[i][0]][0];
- p1 = &vertexes[polygons[i][1]][0];
- p2 = &vertexes[polygons[i][2]][0];
-
- u[0] = p2[0] - p1[0];
- u[1] = p2[1] - p1[1];
- u[2] = p2[2] - p1[2];
-
- v[0] = p0[0] - p1[0];
- v[1] = p0[1] - p1[1];
- v[2] = p0[2] - p1[2];
-
- n[0] = u[1] * v[2] - u[2] * v[1];
- n[1] = u[2] * v[0] - u[0] * v[2];
- n[2] = u[0] * v[1] - u[1] * v[0];
-
- d = 1.0 / sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);
- n[0] *= d;
- n[1] *= d;
- n[2] *= d;
-
- glBegin(GL_POLYGON);
- glNormal3fv(n);
- glVertex3fv(p0);
- glVertex3fv(p1);
- glVertex3fv(p2);
- glVertex3fv(vertexes[polygons[i][3]]);
- glVertex3fv(vertexes[polygons[i][4]]);
- glEnd();
- }
-}
-
-void
-drawSphere(void)
-{
- int numMajor = 24;
- int numMinor = 32;
- float radius = 0.8;
- double majorStep = (M_PI / numMajor);
- double minorStep = (2.0 * M_PI / numMinor);
- int i, j;
-
- glColor3f(0.50, 0.50, 0.50);
- for (i = 0; i < numMajor; ++i) {
- double a = i * majorStep;
- double b = a + majorStep;
- double r0 = radius * sin(a);
- double r1 = radius * sin(b);
- GLfloat z0 = radius * cos(a);
- GLfloat z1 = radius * cos(b);
-
- glBegin(GL_TRIANGLE_STRIP);
- for (j = 0; j <= numMinor; ++j) {
- double c = j * minorStep;
- GLfloat x = cos(c);
- GLfloat y = sin(c);
-
- glNormal3f((x * r0) / radius, (y * r0) / radius, z0 / radius);
- glTexCoord2f(j / (GLfloat) numMinor, i / (GLfloat) numMajor);
- glVertex3f(x * r0, y * r0, z0);
-
- glNormal3f((x * r1) / radius, (y * r1) / radius, z1 / radius);
- glTexCoord2f(j / (GLfloat) numMinor, (i + 1) / (GLfloat) numMajor);
- glVertex3f(x * r1, y * r1, z1);
- }
- glEnd();
- }
-}
-
-/*****************************************************************/
-
-float xmin = -0.035, xmax = 0.035;
-float ymin = -0.035, ymax = 0.035;
-float nnear = 0.1;
-float ffar = 1.9;
-float distance = -1.0;
-
-static void
-loadTextureProjection(int texUnit, GLfloat m[16])
-{
- GLfloat mInverse[4][4];
-
- /* Should use true inverse, but since m consists only of rotations, we can
- just use the transpose. */
- matrixTranspose((GLfloat *) mInverse, m);
-
- ActiveTexture(GL_TEXTURE0_ARB + texUnit);
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glTranslatef(0.5, 0.5, 0.0);
- glScalef(0.5, 0.5, 1.0);
- glFrustum(xmin, xmax, ymin, ymax, nnear, ffar);
- glTranslatef(0.0, 0.0, distance);
- glMultMatrixf((GLfloat *) mInverse);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void
-drawTextureProjection(void)
-{
- float t = ffar / nnear;
- GLfloat n[4][3];
- GLfloat f[4][3];
-
- n[0][0] = xmin;
- n[0][1] = ymin;
- n[0][2] = -(nnear + distance);
-
- n[1][0] = xmax;
- n[1][1] = ymin;
- n[1][2] = -(nnear + distance);
-
- n[2][0] = xmax;
- n[2][1] = ymax;
- n[2][2] = -(nnear + distance);
-
- n[3][0] = xmin;
- n[3][1] = ymax;
- n[3][2] = -(nnear + distance);
-
- f[0][0] = xmin * t;
- f[0][1] = ymin * t;
- f[0][2] = -(ffar + distance);
-
- f[1][0] = xmax * t;
- f[1][1] = ymin * t;
- f[1][2] = -(ffar + distance);
-
- f[2][0] = xmax * t;
- f[2][1] = ymax * t;
- f[2][2] = -(ffar + distance);
-
- f[3][0] = xmin * t;
- f[3][1] = ymax * t;
- f[3][2] = -(ffar + distance);
-
- glColor3f(1.0, 1.0, 0.0);
- glBegin(GL_LINE_LOOP);
- glVertex3fv(n[0]);
- glVertex3fv(n[1]);
- glVertex3fv(n[2]);
- glVertex3fv(n[3]);
- glVertex3fv(f[3]);
- glVertex3fv(f[2]);
- glVertex3fv(f[1]);
- glVertex3fv(f[0]);
- glVertex3fv(n[0]);
- glVertex3fv(n[1]);
- glVertex3fv(f[1]);
- glVertex3fv(f[0]);
- glVertex3fv(f[3]);
- glVertex3fv(f[2]);
- glVertex3fv(n[2]);
- glVertex3fv(n[3]);
- glEnd();
-}
-
-/*****************************************************************/
-
-void
-initialize(void)
-{
- GLfloat light0Pos[4] =
- {0.3, 0.3, 0.0, 1.0};
- GLfloat matAmb[4] =
- {0.01, 0.01, 0.01, 1.00};
- GLfloat matDiff[4] =
- {0.65, 0.65, 0.65, 1.00};
- GLfloat matSpec[4] =
- {0.30, 0.30, 0.30, 1.00};
- GLfloat matShine = 10.0;
- GLfloat eyePlaneS[] =
- {1.0, 0.0, 0.0, 0.0};
- GLfloat eyePlaneT[] =
- {0.0, 1.0, 0.0, 0.0};
- GLfloat eyePlaneR[] =
- {0.0, 0.0, 1.0, 0.0};
- GLfloat eyePlaneQ[] =
- {0.0, 0.0, 0.0, 1.0};
- int i;
-
- /* Setup Misc. */
- glClearColor(0.41, 0.41, 0.31, 0.0);
-
- glEnable(GL_DEPTH_TEST);
-
- /* glLineWidth(2.0);*/
-
- glCullFace(GL_FRONT);
- glEnable(GL_CULL_FACE);
-
- glMatrixMode(GL_PROJECTION);
- glFrustum(-0.5, 0.5, -0.5, 0.5, 1, 3);
- glMatrixMode(GL_MODELVIEW);
- glTranslatef(0, 0, -2);
-
- matrixIdentity((GLfloat *) objectXform);
- for (i = 0; i < NumTextures; i++) {
- matrixIdentity((GLfloat *) textureXform[i]);
- }
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(0, 1, 0, 1, -1, 1);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- glRasterPos2i(0, 0);
-
- glPopMatrix();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
-
- /* Setup Lighting */
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, matAmb);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, matSpec);
- glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, matShine);
-
- glEnable(GL_COLOR_MATERIAL);
-
- glLightfv(GL_LIGHT0, GL_POSITION, light0Pos);
- glEnable(GL_LIGHT0);
-
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
- glEnable(GL_LIGHTING);
-
- /* Setup Texture */
-
- (*loadTexture) ();
-
-
- for (i = 0; i < NumTextures; i++) {
- ActiveTexture(GL_TEXTURE0_ARB + i);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
- glTexGenfv(GL_S, GL_EYE_PLANE, eyePlaneS);
-
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
- glTexGenfv(GL_T, GL_EYE_PLANE, eyePlaneT);
-
- glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
- glTexGenfv(GL_R, GL_EYE_PLANE, eyePlaneR);
-
- glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
- glTexGenfv(GL_Q, GL_EYE_PLANE, eyePlaneQ);
- }
-}
-
-void
-display(void)
-{
- int i;
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- if (textureEnabled) {
- if (mode == MoveTexture || mode == MoveView) {
- /* Have OpenGL compute the new transformation (simple but slow). */
- for (i = 0; i < NumTextures; i++) {
- glPushMatrix();
- glLoadIdentity();
-#if 0
- if (i & 1)
- glRotatef(angle, axis[0], axis[1], axis[2]);
- else
-#endif
- glRotatef(angle*(i+1), axis[0], axis[1], axis[2]);
-
- glMultMatrixf((GLfloat *) textureXform[i]);
- glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *) textureXform[i]);
- glPopMatrix();
- }
- }
- for (i = 0; i < NumTextures; i++) {
- loadTextureProjection(i, (GLfloat *) textureXform[i]);
- }
-
- if (showProjection) {
- for (i = 0; i < NumTextures; i++) {
- ActiveTexture(GL_TEXTURE0_ARB + i);
- glPushMatrix();
- glMultMatrixf((GLfloat *) textureXform[i]);
- glDisable(GL_LIGHTING);
- drawTextureProjection();
- glEnable(GL_LIGHTING);
- glPopMatrix();
- }
- }
- for (i = 0; i < NumTextures; i++) {
- ActiveTexture(GL_TEXTURE0_ARB + i);
- glEnable(GL_TEXTURE_2D);
- glEnable(GL_TEXTURE_GEN_S);
- glEnable(GL_TEXTURE_GEN_T);
- glEnable(GL_TEXTURE_GEN_R);
- glEnable(GL_TEXTURE_GEN_Q);
- }
- }
- if (mode == MoveObject || mode == MoveView) {
- /* Have OpenGL compute the new transformation (simple but slow). */
- glPushMatrix();
- glLoadIdentity();
- glRotatef(angle, axis[0], axis[1], axis[2]);
- glMultMatrixf((GLfloat *) objectXform);
- glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *) objectXform);
- glPopMatrix();
- }
- glPushMatrix();
- glMultMatrixf((GLfloat *) objectXform);
- (*drawObject) ();
- glPopMatrix();
-
- for (i = 0; i < NumTextures; i++) {
- ActiveTexture(GL_TEXTURE0_ARB + i);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_TEXTURE_GEN_S);
- glDisable(GL_TEXTURE_GEN_T);
- glDisable(GL_TEXTURE_GEN_R);
- glDisable(GL_TEXTURE_GEN_Q);
- }
-
- if (zoomFactor > 1.0) {
- glDisable(GL_DEPTH_TEST);
- glCopyPixels(0, 0, winWidth / zoomFactor, winHeight / zoomFactor, GL_COLOR);
- glEnable(GL_DEPTH_TEST);
- }
- glFlush();
- glutSwapBuffers();
- checkErrors();
-}
-
-/*****************************************************************/
-
-/* simple trackball-like motion control */
-float lastPos[3];
-int lastTime;
-
-void
-ptov(int x, int y, int width, int height, float v[3])
-{
- float d, a;
-
- /* project x,y onto a hemi-sphere centered within width, height */
- v[0] = (2.0 * x - width) / width;
- v[1] = (height - 2.0 * y) / height;
- d = sqrt(v[0] * v[0] + v[1] * v[1]);
- v[2] = cos((M_PI / 2.0) * ((d < 1.0) ? d : 1.0));
- a = 1.0 / sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
- v[0] *= a;
- v[1] *= a;
- v[2] *= a;
-}
-
-void
-startMotion(int x, int y, int but, int time)
-{
- if (but == GLUT_LEFT_BUTTON) {
- mode = MoveView;
- } else if (but == GLUT_MIDDLE_BUTTON) {
- mode = MoveTexture;
- } else {
- return;
- }
-
- lastTime = time;
- ptov(x, y, winWidth, winHeight, lastPos);
-}
-
-void
-animate(void)
-{
- glutPostRedisplay();
-}
-
-void
-vis(int visible)
-{
- if (visible == GLUT_VISIBLE) {
- if (redrawContinuously)
- glutIdleFunc(animate);
- } else {
- if (redrawContinuously)
- glutIdleFunc(NULL);
- }
-}
-
-void
-stopMotion(int but, int time)
-{
- if ((but == GLUT_LEFT_BUTTON && mode == MoveView) ||
- (but == GLUT_MIDDLE_BUTTON && mode == MoveTexture)) {
- } else {
- return;
- }
-
- if (time == lastTime) {
- /* redrawContinuously = GL_TRUE;*/
- glutIdleFunc(animate);
- } else {
- angle = 0.0;
- redrawContinuously = GL_FALSE;
- glutIdleFunc(0);
- }
- if (!redrawContinuously) {
- mode = MoveNone;
- }
-}
-
-void
-trackMotion(int x, int y)
-{
- float curPos[3], dx, dy, dz;
-
- ptov(x, y, winWidth, winHeight, curPos);
-
- dx = curPos[0] - lastPos[0];
- dy = curPos[1] - lastPos[1];
- dz = curPos[2] - lastPos[2];
- angle = 90.0 * sqrt(dx * dx + dy * dy + dz * dz);
-
- axis[0] = lastPos[1] * curPos[2] - lastPos[2] * curPos[1];
- axis[1] = lastPos[2] * curPos[0] - lastPos[0] * curPos[2];
- axis[2] = lastPos[0] * curPos[1] - lastPos[1] * curPos[0];
-
- lastTime = glutGet(GLUT_ELAPSED_TIME);
- lastPos[0] = curPos[0];
- lastPos[1] = curPos[1];
- lastPos[2] = curPos[2];
- glutPostRedisplay();
-}
-
-/*****************************************************************/
-
-void
-object(void)
-{
- static int object;
-
- object++;
- object %= 3;
- switch (object) {
- case 0:
- drawObject = drawCube;
- break;
- case 1:
- drawObject = drawDodecahedron;
- break;
- case 2:
- drawObject = drawSphere;
- break;
- default:
- break;
- }
-}
-
-static void
-nop(void)
-{
-}
-
-void
-texture(void)
-{
- static int texture = 0;
-
- texture++;
- texture %= 3;
- if (texture == 1 && texFilename == NULL) {
- /* Skip file texture if not loaded. */
- texture++;
- }
- switch (texture) {
- case 0:
- loadTexture = nop;
- textureEnabled = GL_FALSE;
- break;
- case 1:
- loadTexture = loadImageTextures;
- (*loadTexture) ();
- textureEnabled = GL_TRUE;
- break;
- case 2:
- loadTexture = loadSpotlightTexture;
- (*loadTexture) ();
- textureEnabled = GL_TRUE;
- break;
- default:
- break;
- }
-}
-
-void
-help(void)
-{
- printf("'h' - help\n");
- printf("'l' - toggle linear/nearest filter\n");
- printf("'s' - toggle projection frustum\n");
- printf("'t' - toggle projected texture\n");
- printf("'o' - toggle object\n");
- printf("'z' - increase zoom factor\n");
- printf("'Z' - decrease zoom factor\n");
- printf("left mouse - move view\n");
- printf("middle mouse - move projection\n");
-}
-
-/* ARGSUSED1 */
-void
-key(unsigned char key, int x, int y)
-{
- switch (key) {
- case '\033':
- exit(0);
- break;
- case 'l':
- linearFilter = !linearFilter;
- (*loadTexture) ();
- break;
- case 's':
- showProjection = !showProjection;
- break;
- case 't':
- texture();
- break;
- case 'o':
- object();
- break;
- case 'z':
- zoomFactor += 1.0;
- glPixelZoom(zoomFactor, zoomFactor);
- glViewport(0, 0, winWidth / zoomFactor, winHeight / zoomFactor);
- break;
- case 'Z':
- zoomFactor -= 1.0;
- if (zoomFactor < 1.0)
- zoomFactor = 1.0;
- glPixelZoom(zoomFactor, zoomFactor);
- glViewport(0, 0, winWidth / zoomFactor, winHeight / zoomFactor);
- break;
- case 'h':
- help();
- break;
- }
- glutPostRedisplay();
-}
-
-void
-mouse(int button, int state, int x, int y)
-{
- if (state == GLUT_DOWN)
- startMotion(x, y, button, glutGet(GLUT_ELAPSED_TIME));
- else if (state == GLUT_UP)
- stopMotion(button, glutGet(GLUT_ELAPSED_TIME));
- glutPostRedisplay();
-}
-
-void
-reshape(int w, int h)
-{
- winWidth = w;
- winHeight = h;
- glViewport(0, 0, w / zoomFactor, h / zoomFactor);
-}
-
-
-void
-menu(int selection)
-{
- if (selection == 666) {
- exit(0);
- }
- key((unsigned char) selection, 0, 0);
-}
-
-int
-main(int argc, char **argv)
-{
- glutInit(&argc, argv);
-
- if (argc > 1) {
- NumTextures = atoi(argv[1]);
- }
- assert(NumTextures <= MAX_TEX);
-
- glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
- (void) glutCreateWindow("projtex");
-
- loadTexture = loadImageTextures;
- drawObject = drawCube;
- initialize();
- glutDisplayFunc(display);
- glutKeyboardFunc(key);
- glutReshapeFunc(reshape);
- glutMouseFunc(mouse);
- glutMotionFunc(trackMotion);
- glutVisibilityFunc(vis);
- glutCreateMenu(menu);
- glutAddMenuEntry("Toggle showing projection", 's');
- glutAddMenuEntry("Switch texture", 't');
- glutAddMenuEntry("Switch object", 'o');
- glutAddMenuEntry("Toggle filtering", 'l');
- glutAddMenuEntry("Quit", 666);
- glutAttachMenu(GLUT_RIGHT_BUTTON);
- texture();
- glutMainLoop();
- return 0; /* ANSI C requires main to return int. */
-}
diff --git a/progs/tests/readrate.c b/progs/tests/readrate.c
deleted file mode 100644
index 42ae62d48a9..00000000000
--- a/progs/tests/readrate.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Test glReadPixels speed
- * Brian Paul
- * 9 April 2004
- *
- * Compile:
- * gcc readrate.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lX11 -o readrate
- */
-
-#define GL_GLEXT_PROTOTYPES
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-/* Hack, to test drawing instead of reading */
-#define DRAW 0
-
-#define MAX_WIDTH 1280
-#define MAX_HEIGHT 1024
-
-#define NUM_WIDTHS 4
-#define NUM_HEIGHTS 4
-static const GLint Widths[] = {256, 512, 1024, 1280};
-static const GLint Heights[] = {4, 32, 256, 512, 768, 1024};
-static int WidthIndex = 1, HeightIndex = 3;
-static GLubyte *Buffer = NULL;
-static GLboolean Benchmark = GL_TRUE;
-
-#define NUM_PBO 2
-
-static GLuint PBObjects[4];
-
-static GLboolean HavePBO = GL_FALSE;
-
-
-struct format_type {
- const char *Name;
- GLuint Bytes;
- GLenum Format;
- GLenum Type;
-};
-
-static struct format_type Formats[] = {
- { "GL_RGB, GLubyte", 3, GL_RGB, GL_UNSIGNED_BYTE },
- { "GL_BGR, GLubyte", 3, GL_BGR, GL_UNSIGNED_BYTE },
- { "GL_RGBA, GLubyte", 4, GL_RGBA, GL_UNSIGNED_BYTE },
- { "GL_BGRA, GLubyte", 4, GL_BGRA, GL_UNSIGNED_BYTE },
- { "GL_ABGR, GLubyte", 4, GL_ABGR_EXT, GL_UNSIGNED_BYTE },
- { "GL_RGBA, GLuint_8_8_8_8", 4, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8 },
- { "GL_BGRA, GLuint_8_8_8_8", 4, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8 },
- { "GL_BGRA, GLuint_8_8_8_8_rev", 4, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8_REV },
-#ifdef GL_EXT_packed_depth_stencil
- { "GL_DEPTH_STENCIL_EXT, GLuint24+8", 4, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT },
-#endif
- { "GL_DEPTH_COMPONENT, GLfloat", 4, GL_DEPTH_COMPONENT, GL_FLOAT },
- { "GL_DEPTH_COMPONENT, GLuint", 4, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT }
-};
-
-#define NUM_FORMATS (sizeof(Formats) / sizeof(struct format_type))
-
-
-static void
-PrintString(const char *s)
-{
- while (*s) {
- glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
- s++;
- }
-}
-
-
-static void
-MeasureFormat(struct format_type *fmt, GLint width, GLint height, GLuint pbo)
-{
- double t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
- double t1;
- int j;
-
- for (j = 0; ; j++) {
-
- glBegin(GL_POINTS);
- glVertex2f(1,1);
- glEnd();
-
-#if DRAW
- glWindowPos2iARB(0,0);
- glDrawPixels(width, height,
- fmt->Format, fmt->Type, Buffer);
- glFinish();
-#else
- if (pbo) {
- glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, PBObjects[j % NUM_PBO]);
- glReadPixels(0, 0, width, height,
- fmt->Format, fmt->Type, 0);
- }
- else {
- glReadPixels(0, 0, width, height,
- fmt->Format, fmt->Type, Buffer);
- }
-#endif
-
- t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
- if (t1 - t0 > 2.0) {
- GLdouble rate = width * height / (1024.0 * 1024.0) * j / (t1 - t0);
-#if DRAW
- printf("%-32s %.2f draws/sec %.2f MPixels/sec %.2f MBytes/sec\n",
- fmt->Name, j / (t1-t0), rate, rate * fmt->Bytes);
-#else
- printf("%-32s %.2f reads/sec %.2f MPixels/sec %.2f MBytes/sec\n",
- fmt->Name, j / (t1-t0), rate, rate * fmt->Bytes);
-#endif
- break;
- }
-
- if (j == 0) {
- /* check for error */
- GLenum err = glGetError();
- if (err) {
- printf("GL Error 0x%x for %s\n", err, fmt->Name);
- return;
- }
- }
- }
-}
-
-
-
-static void
-Draw(void)
-{
- char str[1000];
- int width = Widths[WidthIndex];
- int height = Heights[HeightIndex];
- int y = MAX_HEIGHT - 50;
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glWindowPos2iARB(10, y);
- sprintf(str, "ReadPixels size: %d x %d", width, height);
- PrintString(str);
- y -= 14;
-
- glWindowPos2iARB(10, y);
- PrintString("Press up/down/left/right to change image size.");
- y -= 14;
-
- glWindowPos2iARB(10, y);
- PrintString("Press 'b' to run benchmark test.");
- y -= 14;
-
- if (Benchmark) {
- glWindowPos2iARB(10, y);
- PrintString("Testing...");
- }
-
- glutSwapBuffers();
-
- if (Benchmark) {
- GLuint i, pbo;
-#if DRAW
- printf("Draw size: Width=%d Height=%d\n", width, height);
-#else
- printf("Read size: Width=%d Height=%d\n", width, height);
-#endif
- for (pbo = 0; pbo <= HavePBO; pbo++) {
- printf("Pixel Buffer Object: %d\n", pbo);
-
- if (pbo == 0) {
- glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, 0);
- }
-
- for (i = 0; i < NUM_FORMATS; i++) {
- MeasureFormat(Formats + i, width, height, pbo);
- }
- }
-
- Benchmark = GL_FALSE;
-
- /* redraw window text */
- glutPostRedisplay();
- }
-
-}
-
-
-static void
-Reshape(int width, int height)
-{
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1, 1, -1, 1, -1, 1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-
-static void
-Key(unsigned char key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'b':
- Benchmark = 1;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-SpecialKey(int key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- if (HeightIndex + 1 < NUM_WIDTHS)
- HeightIndex++;
- break;
- case GLUT_KEY_DOWN:
- if (HeightIndex > 0)
- HeightIndex--;
- break;
- case GLUT_KEY_LEFT:
- if (WidthIndex > 0)
- WidthIndex--;
- break;
- case GLUT_KEY_RIGHT:
- if (WidthIndex + 1 < NUM_HEIGHTS)
- WidthIndex++;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init(void)
-{
- Buffer = malloc(MAX_WIDTH * MAX_HEIGHT * 4);
- assert(Buffer);
-#if DRAW
- printf("glDrawPixels test report:\n");
-#else
- printf("glReadPixels test report:\n");
-#endif
- printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION: %s\n", (char *) glGetString(GL_VERSION));
-
- if (glutExtensionSupported("GL_ARB_pixel_buffer_object")) {
- int i;
- HavePBO = 1;
- glGenBuffersARB(NUM_PBO, PBObjects);
- for (i = 0; i < NUM_PBO; i++) {
- glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, PBObjects[i]);
- glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT,
- MAX_WIDTH * MAX_HEIGHT * 4, NULL, GL_STREAM_READ);
- }
- }
-}
-
-
-int
-main(int argc, char *argv[])
-{
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(MAX_WIDTH, MAX_HEIGHT);
- glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
- glutCreateWindow(argv[0]);
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutSpecialFunc(SpecialKey);
- glutDisplayFunc(Draw);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/seccolor.c b/progs/tests/seccolor.c
deleted file mode 100644
index 77fd40647ba..00000000000
--- a/progs/tests/seccolor.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Exercise GL_EXT_secondary_color
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-static int Width = 600;
-static int Height = 200;
-static GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
- GLfloat t;
-
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- for (t = 0.0; t <= 1.0; t += 0.25) {
- GLfloat x = t * 10.0 - 5.0;
- GLfloat g = t;
-
- /* top row: untextured */
- glColor3f(1, 0, 0);
- glPushMatrix();
- glTranslatef(x, 1.2, 0);
-#if defined(GL_EXT_secondary_color)
- glSecondaryColor3fEXT(0, g, 0);
-#endif
- glBegin(GL_POLYGON);
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
- glPopMatrix();
-
- /* bottom row: textured */
- glColor3f(1, 1, 1);
- glEnable(GL_TEXTURE_2D);
- glPushMatrix();
- glTranslatef(x, -1.2, 0);
-#if defined(GL_EXT_secondary_color)
- glSecondaryColor3fEXT(0, g, 0);
-#endif
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex2f(-1, -1);
- glTexCoord2f(1, 0); glVertex2f( 1, -1);
- glTexCoord2f(1, 1); glVertex2f( 1, 1);
- glTexCoord2f(0, 1); glVertex2f(-1, 1);
- glEnd();
- glPopMatrix();
- glDisable(GL_TEXTURE_2D);
- }
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- GLubyte image[4*4][3];
- GLint i;
- if (!glutExtensionSupported("GL_EXT_secondary_color")) {
- printf("Sorry, this program requires GL_EXT_secondary_color\n");
- exit(1);
- }
-
- /* setup red texture with one back texel */
- for (i = 0; i < 4*4; i++) {
- if (i == 0) {
- image[i][0] = 0;
- image[i][1] = 0;
- image[i][2] = 0;
- }
- else {
- image[i][0] = 255;
- image[i][1] = 0;
- image[i][2] = 0;
- }
- }
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0,
- GL_RGB, GL_UNSIGNED_BYTE, image);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
-#if defined(GL_EXT_secondary_color)
- glEnable(GL_COLOR_SUM_EXT);
-#endif
- glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
-
- printf("Squares should be colored from red -> orange -> yellow.\n");
- printf("Top row is untextured.\n");
- printf("Bottom row is textured (red texture with one black texel).\n");
- printf("Rows should be identical, except for lower-left texel.\n");
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/sharedtex.c b/progs/tests/sharedtex.c
deleted file mode 100644
index ebe73f19f42..00000000000
--- a/progs/tests/sharedtex.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/* $Id: sharedtex.c,v 1.2 2002/01/16 14:32:46 joukj Exp $ */
-
-/*
- * Test sharing of display lists and texture objects between GLX contests.
- * Brian Paul
- * Summer 2000
- *
- *
- * Copyright (C) 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.
- */
-
-
-#include <GL/gl.h>
-#include <GL/glx.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-
-struct window {
- char DisplayName[1000];
- Display *Dpy;
- Window Win;
- GLXContext Context;
- float Angle;
- int Id;
-};
-
-
-#define MAX_WINDOWS 20
-static struct window Windows[MAX_WINDOWS];
-static int NumWindows = 0;
-
-
-static GLuint Textures[3];
-static GLuint CubeList;
-
-
-
-static void
-Error(const char *display, const char *msg)
-{
- fprintf(stderr, "Error on display %s - %s\n", display, msg);
- exit(1);
-}
-
-
-static struct window *
-AddWindow(const char *displayName, int xpos, int ypos,
- const struct window *shareWindow)
-{
- Display *dpy;
- Window win;
- GLXContext ctx;
- int attrib[] = { GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_DOUBLEBUFFER,
- GLX_DEPTH_SIZE, 1,
- None };
- int scrnum;
- XSetWindowAttributes attr;
- unsigned long mask;
- Window root;
- XVisualInfo *visinfo;
- int width = 300, height = 300;
-
- if (NumWindows >= MAX_WINDOWS)
- return NULL;
-
- dpy = XOpenDisplay(displayName);
- if (!dpy) {
- Error(displayName, "Unable to open display");
- return NULL;
- }
-
- scrnum = DefaultScreen(dpy);
- root = RootWindow(dpy, scrnum);
-
- visinfo = glXChooseVisual(dpy, scrnum, attrib);
- if (!visinfo) {
- Error(displayName, "Unable to find RGB, double-buffered visual");
- return NULL;
- }
-
- /* window attributes */
- attr.background_pixel = 0;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
- attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
- mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
-
- win = XCreateWindow(dpy, root, xpos, ypos, width, height,
- 0, visinfo->depth, InputOutput,
- visinfo->visual, mask, &attr);
- if (!win) {
- Error(displayName, "Couldn't create window");
- return NULL;
- }
-
- {
- XSizeHints sizehints;
- sizehints.x = xpos;
- sizehints.y = ypos;
- sizehints.width = width;
- sizehints.height = height;
- sizehints.flags = USSize | USPosition;
- XSetNormalHints(dpy, win, &sizehints);
- XSetStandardProperties(dpy, win, displayName, displayName,
- None, (char **)NULL, 0, &sizehints);
- }
-
-
- ctx = glXCreateContext(dpy, visinfo,
- shareWindow ? shareWindow->Context : NULL,
- True);
- if (!ctx) {
- Error(displayName, "Couldn't create GLX context");
- return NULL;
- }
-
- XMapWindow(dpy, win);
-
- if (!glXMakeCurrent(dpy, win, ctx)) {
- Error(displayName, "glXMakeCurrent failed");
- printf("glXMakeCurrent failed in Redraw()\n");
- return NULL;
- }
-
- /* save the info for this window */
- {
- static int id = 0;
- struct window *h = &Windows[NumWindows];
- strcpy(h->DisplayName, displayName);
- h->Dpy = dpy;
- h->Win = win;
- h->Context = ctx;
- h->Angle = 0.0;
- h->Id = id++;
- NumWindows++;
- return &Windows[NumWindows-1];
- }
-
-}
-
-
-static void
-InitGLstuff(struct window *h)
-{
- if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) {
- Error(h->DisplayName, "glXMakeCurrent failed in InitGLstuff");
- return;
- }
-
- glGenTextures(3, Textures);
-
- /* setup first texture object */
- {
- GLubyte image[16][16][4];
- GLint i, j;
- glBindTexture(GL_TEXTURE_2D, Textures[0]);
-
- /* red/white checkerboard */
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j++) {
- if ((i ^ j) & 1) {
- image[i][j][0] = 255;
- image[i][j][1] = 255;
- image[i][j][2] = 255;
- image[i][j][3] = 255;
- }
- else {
- image[i][j][0] = 255;
- image[i][j][1] = 0;
- image[i][j][2] = 0;
- image[i][j][3] = 255;
- }
- }
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA,
- GL_UNSIGNED_BYTE, image);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
-
- /* setup second texture object */
- {
- GLubyte image[8][8][3];
- GLint i, j;
- glBindTexture(GL_TEXTURE_2D, Textures[1]);
-
- /* green/yellow checkerboard */
- for (i = 0; i < 8; i++) {
- for (j = 0; j < 8; j++) {
- if ((i ^ j) & 1) {
- image[i][j][0] = 0;
- image[i][j][1] = 255;
- image[i][j][2] = 0;
- }
- else {
- image[i][j][0] = 255;
- image[i][j][1] = 255;
- image[i][j][2] = 0;
- }
- }
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB,
- GL_UNSIGNED_BYTE, image);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
-
- /* setup second texture object */
- {
- GLubyte image[4][4][3];
- GLint i, j;
- glBindTexture(GL_TEXTURE_2D, Textures[2]);
-
- /* blue/gray checkerboard */
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- if ((i ^ j) & 1) {
- image[i][j][0] = 0;
- image[i][j][1] = 0;
- image[i][j][2] = 255;
- }
- else {
- image[i][j][0] = 200;
- image[i][j][1] = 200;
- image[i][j][2] = 200;
- }
- }
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0, GL_RGB,
- GL_UNSIGNED_BYTE, image);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
-
- /* Now make the cube object display list */
- CubeList = glGenLists(1);
- glNewList(CubeList, GL_COMPILE);
- {
- glBindTexture(GL_TEXTURE_2D, Textures[0]);
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
- glTexCoord2f(1, 0); glVertex3f(-1, 1, -1);
- glTexCoord2f(1, 1); glVertex3f(-1, 1, 1);
- glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
- glEnd();
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex3f(1, -1, -1);
- glTexCoord2f(1, 0); glVertex3f(1, 1, -1);
- glTexCoord2f(1, 1); glVertex3f(1, 1, 1);
- glTexCoord2f(0, 1); glVertex3f(1, -1, 1);
- glEnd();
-
- glBindTexture(GL_TEXTURE_2D, Textures[1]);
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
- glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
- glTexCoord2f(1, 1); glVertex3f( 1, -1, 1);
- glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
- glEnd();
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex3f(-1, 1, -1);
- glTexCoord2f(1, 0); glVertex3f( 1, 1, -1);
- glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
- glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
- glEnd();
-
- glBindTexture(GL_TEXTURE_2D, Textures[2]);
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
- glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
- glTexCoord2f(1, 1); glVertex3f( 1, 1, -1);
- glTexCoord2f(0, 1); glVertex3f(-1, 1, -1);
- glEnd();
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex3f(-1, -1, 1);
- glTexCoord2f(1, 0); glVertex3f( 1, -1, 1);
- glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
- glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
- glEnd();
- }
- glEndList();
-
- printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION: %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR: %s\n", (char *) glGetString(GL_VENDOR));
-}
-
-
-
-static void
-Redraw(struct window *h)
-{
- if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) {
- Error(h->DisplayName, "glXMakeCurrent failed");
- printf("glXMakeCurrent failed in Redraw()\n");
- return;
- }
-
- h->Angle += 1.0;
-
- glShadeModel(GL_FLAT);
- glClearColor(0.25, 0.25, 0.25, 1.0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glEnable(GL_TEXTURE_2D);
- glEnable(GL_DEPTH_TEST);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-
- glColor3f(1, 1, 1);
-
- glPushMatrix();
- if (h->Id == 0)
- glRotatef(h->Angle, 0, 1, -1);
- else if (h->Id == 1)
- glRotatef(-(h->Angle), 0, 1, -1);
- else if (h->Id == 2)
- glRotatef(h->Angle, 0, 1, 1);
- else if (h->Id == 3)
- glRotatef(-(h->Angle), 0, 1, 1);
- glCallList(CubeList);
- glPopMatrix();
-
- glXSwapBuffers(h->Dpy, h->Win);
-}
-
-
-
-static void
-Resize(const struct window *h, unsigned int width, unsigned int height)
-{
- if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) {
- Error(h->DisplayName, "glXMakeCurrent failed in Resize()");
- return;
- }
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1, 1, -1, 1, 2, 10);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0, 0, -3.5);
-}
-
-
-
-static void
-EventLoop(void)
-{
- while (1) {
- int i;
- for (i = 0; i < NumWindows; i++) {
- struct window *h = &Windows[i];
- while (XPending(h->Dpy) > 0) {
- XEvent event;
- XNextEvent(h->Dpy, &event);
- if (event.xany.window == h->Win) {
- switch (event.type) {
- case Expose:
- Redraw(h);
- break;
- case ConfigureNotify:
- Resize(h, event.xconfigure.width, event.xconfigure.height);
- break;
- case KeyPress:
- return;
- default:
- /*no-op*/ ;
- }
- }
- else {
- printf("window mismatch\n");
- }
- }
- Redraw(h);
- }
- usleep(1);
- }
-}
-
-
-
-static void
-PrintInfo(const struct window *h)
-{
- printf("Name: %s\n", h->DisplayName);
- printf(" Display: 0x%x\n", h->Dpy);
- printf(" Window: 0x%x\n", h->Win);
- printf(" Context: 0x%x\n", h->Context);
-}
-
-
-int
-main(int argc, char *argv[])
-{
- int i;
- struct window *h0, *h1, *h2, *h3;
-
- /* four windows and contexts sharing display lists and texture objects */
- h0 = AddWindow(":0", 10, 10, NULL);
- h1 = AddWindow(":0", 330, 10, h0);
- h2 = AddWindow(":0", 10, 350, h0);
- h3 = AddWindow(":0", 330, 350, h0);
-
- InitGLstuff(h0);
-
- EventLoop();
- return 0;
-}
diff --git a/progs/tests/stencil_wrap.c b/progs/tests/stencil_wrap.c
deleted file mode 100644
index 88cf3809caf..00000000000
--- a/progs/tests/stencil_wrap.c
+++ /dev/null
@@ -1,257 +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
- * 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 stencil_wrap.c
- *
- * Simple test of GL_EXT_stencil_wrap functionality. Four squares are drawn
- * with different stencil modes, but all should be rendered with the same
- * final color.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-static int Width = 550;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
- GLint max_stencil;
- GLint stencil_bits;
- unsigned i;
-
-
- glGetIntegerv( GL_STENCIL_BITS, & stencil_bits );
- max_stencil = (1U << stencil_bits) - 1;
- printf( "Stencil bits = %u, maximum stencil value = 0x%08x\n",
- stencil_bits, max_stencil );
-
- glClearStencil( 0 );
- glClearColor( 0.2, 0.2, 0.8, 0 );
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
- | GL_STENCIL_BUFFER_BIT );
-
-
- glPushMatrix();
-
- /* This is the "reference" square.
- */
-
- glDisable(GL_STENCIL_TEST);
- glTranslatef(-6.0, 0, 0);
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- glEnable(GL_STENCIL_TEST);
-
- /* Draw the first two squares using the two non-wrap (i.e., saturate)
- * modes.
- */
-
- glStencilFunc(GL_ALWAYS, 0, ~0);
- glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
-
- glTranslatef(3.0, 0, 0);
- glBegin(GL_QUADS);
- glColor3f( 0.9, 0.9, 0.9 );
-
- for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- }
- glEnd();
-
- glStencilFunc(GL_EQUAL, max_stencil, ~0);
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
- glStencilFunc(GL_ALWAYS, 0, ~0);
- glStencilOp(GL_KEEP, GL_KEEP, GL_DECR);
-
- glTranslatef(3.0, 0, 0);
- glBegin(GL_QUADS);
- glColor3f( 0.9, 0.9, 0.9 );
-
- for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- }
- glEnd();
-
- glStencilFunc(GL_EQUAL, 0, ~0);
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
-
-
- /* Draw the last two squares using the two wrap modes.
- */
-
- glStencilFunc(GL_ALWAYS, 0, ~0);
- glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP);
-
- glTranslatef(3.0, 0, 0);
- glBegin(GL_QUADS);
- glColor3f( 0.9, 0.9, 0.9 );
-
- for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- }
- glEnd();
-
- glStencilFunc(GL_EQUAL, 4, ~0);
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
-
- glStencilFunc(GL_ALWAYS, 0, ~0);
- glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP);
-
- glTranslatef(3.0, 0, 0);
- glBegin(GL_QUADS);
- glColor3f( 0.9, 0.9, 0.9 );
-
- for ( i = 0 ; i < 5 ; i++ ) {
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- }
- glEnd();
-
- glStencilFunc(GL_EQUAL, (max_stencil - 4), ~0);
- glBegin(GL_QUADS);
- glColor3f( 0.5, 0.5, 0.5 );
- glVertex2f(-1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 1, 1);
- glVertex2f(-1, 1);
- glEnd();
-
-
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", ver_string);
-
- if ( !glutExtensionSupported("GL_EXT_stencil_wrap")
- && (atof( ver_string ) < 1.4) ) {
- printf("Sorry, this program requires either GL_EXT_stencil_wrap or OpenGL 1.4.\n");
- exit(1);
- }
-
- printf("\nAll 5 squares should be the same color.\n");
- glEnable( GL_BLEND );
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
- glutCreateWindow( "GL_EXT_stencil_wrap test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/stencilwrap.c b/progs/tests/stencilwrap.c
deleted file mode 100644
index 753375d0f3a..00000000000
--- a/progs/tests/stencilwrap.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* Test GL_EXT_stencil_wrap extension.
- * This is by no means complete, just a quick check.
- *
- * Brian Paul 30 October 2002
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-GLboolean wrapping;
-
-static void RunTest(void)
-{
- const GLenum prim = GL_QUAD_STRIP;
- GLubyte val;
- int bits, max, i;
- int expected;
- GLboolean failed;
-
- glGetIntegerv(GL_STENCIL_BITS, &bits);
- max = (1 << bits) - 1;
-
-
- glEnable(GL_STENCIL_TEST);
- glStencilFunc(GL_ALWAYS, 0, ~0);
-
- /* test GL_KEEP */
- glClearStencil(max);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
- failed = GL_FALSE;
- printf("Testing GL_KEEP...\n");
- expected = max;
- glBegin(prim);
- glVertex2f(0, 0);
- glVertex2f(10, 0);
- glVertex2f(0, 10);
- glVertex2f(10, 10);
- glEnd();
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf("Failed GL_KEEP test(got %u, expected %u)\n", val, expected);
- failed = GL_TRUE;
- }
- else
- printf("OK!\n");
-
- /* test GL_ZERO */
- glClearStencil(max);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO);
- failed = GL_FALSE;
- printf("Testing GL_ZERO...\n");
- expected = 0;
- glBegin(prim);
- glVertex2f(0, 0);
- glVertex2f(10, 0);
- glVertex2f(0, 10);
- glVertex2f(10, 10);
- glEnd();
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf("Failed GL_ZERO test(got %u, expected %u)\n", val, expected);
- failed = GL_TRUE;
- }
- else
- printf("OK!\n");
-
- /* test GL_REPLACE */
- glClearStencil(max);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
- failed = GL_FALSE;
- printf("Testing GL_REPLACE...\n");
- expected = 0;
- glBegin(prim);
- glVertex2f(0, 0);
- glVertex2f(10, 0);
- glVertex2f(0, 10);
- glVertex2f(10, 10);
- glEnd();
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf("Failed GL_REPLACE test(got %u, expected %u)\n", val, expected);
- failed = GL_TRUE;
- }
- else
- printf("OK!\n");
-
- /* test GL_INCR (saturation) */
- glClearStencil(0);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
- failed = GL_FALSE;
- printf("Testing GL_INCR...\n");
- for (i = 1; i < max+10; i++) {
- expected = (i > max) ? max : i;
- glBegin(prim);
- glVertex2f(0, 0); glVertex2f(10, 0);
- glVertex2f(0, 10); glVertex2f(10, 10);
- glEnd();
-
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf( "Failed GL_INCR test on iteration #%u "
- "(got %u, expected %u)\n", i, val, expected );
- failed = GL_TRUE;
- }
- }
- if ( !failed )
- printf("OK!\n");
-
- /* test GL_DECR (saturation) */
- glClearStencil(max);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_DECR);
- failed = GL_FALSE;
- printf("Testing GL_DECR...\n");
- for (i = max-1; i > -10; i--) {
- expected = (i < 0) ? 0 : i;
- glBegin(prim);
- glVertex2f(0, 0); glVertex2f(10, 0);
- glVertex2f(0, 10); glVertex2f(10, 10);
- glEnd();
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf( "Failed GL_DECR test on iteration #%u "
- "(got %u, expected %u)\n", max - i, val, expected );
- failed = GL_TRUE;
- }
- }
- if ( !failed )
- printf("OK!\n");
-
- /* test GL_INVERT */
- glClearStencil(0);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT);
- failed = GL_FALSE;
- printf("Testing GL_INVERT...\n");
- expected = max;
- glBegin(prim);
- glVertex2f(0, 0);
- glVertex2f(10, 0);
- glVertex2f(0, 10);
- glVertex2f(10, 10);
- glEnd();
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf("Failed GL_INVERT test(got %u, expected %u)\n", val, expected);
- failed = GL_TRUE;
- }
- else
- printf("OK!\n");
-
- if(wrapping)
- {
- /* test GL_INCR_WRAP_EXT (wrap around) */
- glClearStencil(0);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT);
- failed = GL_FALSE;
- printf("Testing GL_INCR_WRAP_EXT...\n");
- for (i = 1; i < max+10; i++) {
- expected = i % (max + 1);
- glBegin(prim);
- glVertex2f(0, 0); glVertex2f(10, 0);
- glVertex2f(0, 10); glVertex2f(10, 10);
- glEnd();
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf( "Failed GL_INCR_WRAP test on iteration #%u "
- "(got %u, expected %u)\n", i, val, expected );
- failed = GL_TRUE;
- }
- }
- if ( !failed )
- printf("OK!\n");
-
- /* test GL_DECR_WRAP_EXT (wrap-around) */
- glClearStencil(max);
- glClear(GL_STENCIL_BUFFER_BIT);
- glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT);
- failed = GL_FALSE;
- printf("Testing GL_DECR_WRAP_EXT...\n");
- for (i = max-1; i > -10; i--) {
- expected = (i < 0) ? max + i + 1: i;
- glBegin(prim);
- glVertex2f(0, 0); glVertex2f(10, 0);
- glVertex2f(0, 10); glVertex2f(10, 10);
- glEnd();
- glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
- if (val != expected) {
- printf( "Failed GL_DECR_WRAP test on iteration #%u "
- "(got %u, expected %u)\n", max - i, val, expected );
- failed = GL_TRUE;
- }
- }
- if ( !failed )
- printf("OK!\n");
- }
-
- glDisable(GL_STENCIL_TEST);
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- RunTest();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(0, width, 0, height, -1, 1);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * ver_str;
- float version;
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
-
-
- /* Check for both the extension string and GL version 1.4 on the
- * outside chance that some vendor exports version 1.4 but doesn't
- * export the extension string. The stencil-wrap modes are a required
- * part of GL 1.4.
- */
-
- ver_str = glGetString( GL_VERSION );
- version = (ver_str == NULL) ? 1.0 : atof( ver_str );
-
- wrapping = (glutExtensionSupported("GL_EXT_stencil_wrap") || (version >= 1.4));
- if (!wrapping)
- printf("GL_EXT_stencil_wrap not supported. Only testing the rest.\n");
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 400, 400 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_STENCIL );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/subtexrate.c b/progs/tests/subtexrate.c
deleted file mode 100644
index 568b68d552d..00000000000
--- a/progs/tests/subtexrate.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Measure glTexSubImage and glCopyTexSubImage speed
- *
- * Brian Paul
- * 26 Jan 2006
- */
-
-#define GL_GLEXT_PROTOTYPES
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <GL/glut.h>
-
-static GLint WinWidth = 1024, WinHeight = 512;
-static GLint TexWidth = 512, TexHeight = 512;
-
-static GLuint TexObj = 1;
-
-static GLenum IntFormat = GL_RGBA8;
-static GLenum ReadFormat = GL_RGBA; /* for glReadPixels */
-
-static GLboolean DrawQuad = GL_TRUE;
-
-
-/**
- * draw teapot image, size TexWidth by TexHeight
- */
-static void
-DrawTestImage(void)
-{
- GLfloat ar;
-
- glViewport(0, 0, TexWidth, TexHeight);
- glScissor(0, 0, TexWidth, TexHeight);
- glEnable(GL_SCISSOR_TEST);
-
- glClearColor(0.5, 0.5, 0.5, 0.0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- ar = (float) TexWidth / TexHeight;
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
- glMatrixMode(GL_MODELVIEW);
-
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
- glFrontFace(GL_CW);
- glPushMatrix();
- glRotatef(45, 1, 0, 0);
- glRotatef(45, 0, 1, 0);
- glutSolidTeapot(2.3);
- glPopMatrix();
- glFrontFace(GL_CCW);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_LIGHTING);
-
- glDisable(GL_SCISSOR_TEST);
-
- glViewport(0, 0, WinWidth, WinHeight);
- glFinish();
-}
-
-
-/**
- * Do glCopyTexSubImage2D call (update texture with framebuffer data)
- * If doSubRect is true, do the copy in four pieces instead of all at once.
- */
-static void
-DoCopyTex(GLboolean doSubRect)
-{
- if (doSubRect) {
- /* copy in four parts */
- int w = TexWidth / 2, h = TexHeight / 2;
- int x0 = 0, y0 = 0;
- int x1 = w, y1 = h;
-#if 1
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x0, y0, w, h);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x1, y0, w, h);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, x0, y1, w, h);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, x1, y1, w, h);
-#else
- /* scramble */
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x1, y1, w, h);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x0, y1, w, h);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, x1, y0, w, h);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, x0, y0, w, h);
-#endif
- }
- else {
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TexWidth, TexHeight);
- }
-}
-
-
-/**
- * Do glTexSubImage2D (update texture w/ user data)
- * If doSubRect, do update in four pieces, else all at once.
- */
-static void
-SubTex(GLboolean doSubRect, const GLubyte *image)
-{
- if (doSubRect) {
- /* four pieces */
- int w = TexWidth / 2, h = TexHeight / 2;
- int x0 = 0, y0 = 0;
- int x1 = w, y1 = h;
- glPixelStorei(GL_UNPACK_ROW_LENGTH, TexWidth);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, y0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0);
- glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, w, h,
- ReadFormat, GL_UNSIGNED_BYTE, image);
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, y0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1);
- glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, w, h,
- ReadFormat, GL_UNSIGNED_BYTE, image);
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, y1);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0);
- glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, w, h,
- ReadFormat, GL_UNSIGNED_BYTE, image);
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, y1);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1);
- glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, w, h,
- ReadFormat, GL_UNSIGNED_BYTE, image);
- }
- else {
- /* all at once */
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TexWidth, TexHeight,
- ReadFormat, GL_UNSIGNED_BYTE, image);
- }
-}
-
-
-/**
- * Measure gl[Copy]TexSubImage rate.
- * This actually also includes time to render a quad and SwapBuffers.
- */
-static void
-RunTest(GLboolean copyTex, GLboolean doSubRect)
-{
- double t0, t1;
- int iters = 0;
- float copyRate, mbRate;
- float rot = 0.0;
- int bpp, r, g, b, a;
- int w, h;
- GLubyte *image = NULL;
-
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &r);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &g);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &b);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &a);
- bpp = (r + g + b + a) / 8;
-
- if (!copyTex) {
- /* read image from frame buffer */
- image = (GLubyte *) malloc(TexWidth * TexHeight * bpp);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glReadPixels(0, 0, TexWidth, TexHeight,
- ReadFormat, GL_UNSIGNED_BYTE, image);
- }
-
- glEnable(GL_TEXTURE_2D);
- glViewport(WinWidth / 2, 0, WinWidth / 2, WinHeight);
-
- t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
-
- do {
- if (copyTex)
- /* Framebuffer -> Texture */
- DoCopyTex(doSubRect);
- else {
- /* Main Mem -> Texture */
- SubTex(doSubRect, image);
- }
-
- /* draw textured quad */
- if (DrawQuad) {
- glPushMatrix();
- glRotatef(rot, 0, 0, 1);
- glTranslatef(1, 0, 0);
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex2f(-1, -1);
- glTexCoord2f(1, 0); glVertex2f( 1, -1);
- glTexCoord2f(1, 1); glVertex2f( 1, 1);
- glTexCoord2f(0, 1); glVertex2f(-1, 1);
- glEnd();
- glPopMatrix();
- }
-
- iters++;
- rot += 2.0;
-
- t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
- if (DrawQuad) {
- glutSwapBuffers();
- }
- } while (t1 - t0 < 5.0);
-
- glDisable(GL_TEXTURE_2D);
- if (image)
- free(image);
-
- if (doSubRect) {
- w = TexWidth / 2;
- h = TexHeight / 2;
- iters *= 4;
- }
- else {
- w = TexWidth;
- h = TexHeight;
- }
-
- copyRate = iters / (t1 - t0);
- mbRate = w * h * bpp * copyRate / (1024 * 1024);
-
- if (copyTex)
- printf("glCopyTexSubImage: %d x %d, %d Bpp:\n", w, h, bpp);
- else
- printf("glTexSubImage: %d x %d, %d Bpp:\n", w, h, bpp);
- printf(" %d calls in %.2f = %.2f calls/sec, %.2f MB/s\n",
- iters, t1-t0, copyRate, mbRate);
-}
-
-
-static void
-Draw(void)
-{
- glClearColor(0.2, 0.2, 0.8, 0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- DrawTestImage();
- if (!DrawQuad) {
- glutSwapBuffers();
- }
-
- RunTest(GL_FALSE, GL_FALSE);
- RunTest(GL_FALSE, GL_TRUE);
- RunTest(GL_TRUE, GL_FALSE);
- RunTest(GL_TRUE, GL_TRUE);
-
- glutSwapBuffers();
-
- printf("exiting\n");
- exit(0);
-}
-
-
-static void
-Reshape(int width, int height)
-{
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -15.0);
-}
-
-
-static void
-Key(unsigned char key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-SpecialKey(int key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- break;
- case GLUT_KEY_DOWN:
- break;
- case GLUT_KEY_LEFT:
- break;
- case GLUT_KEY_RIGHT:
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Init(void)
-{
- /* create initial, empty teximage */
- glBindTexture(GL_TEXTURE_2D, TexObj);
- glTexImage2D(GL_TEXTURE_2D, 0, IntFormat, TexWidth, TexHeight, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-}
-
-
-
-static void
-ParseArgs(int argc, char *argv[])
-{
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-nodraw") == 0)
- DrawQuad = GL_FALSE;
- }
-}
-
-
-int
-main(int argc, char *argv[])
-{
- GLint mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH;
- glutInit(&argc, argv);
-
- ParseArgs(argc, argv);
-
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(WinWidth, WinHeight);
- glutInitDisplayMode(mode);
- glutCreateWindow(argv[0]);
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutSpecialFunc(SpecialKey);
- glutDisplayFunc(Draw);
-
- printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
- Init();
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/tex1d.c b/progs/tests/tex1d.c
deleted file mode 100644
index 1fab849dd3e..00000000000
--- a/progs/tests/tex1d.c
+++ /dev/null
@@ -1,139 +0,0 @@
-
-/* Exercise 1D textures
- */
-
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "GL/glut.h"
-
-static GLuint Window = 0;
-static GLuint TexObj[2];
-static GLfloat Angle = 0.0f;
-
-
-static void draw( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glColor3f( 1.0, 1.0, 1.0 );
-
- /* draw first polygon */
- glPushMatrix();
- glTranslatef( -1.0, 0.0, 0.0 );
- glRotatef( Angle, 0.0, 0.0, 1.0 );
- glBindTexture( GL_TEXTURE_1D, TexObj[0] );
- glBegin( GL_POLYGON );
- glTexCoord1f( 0.0 ); glVertex2f( -1.0, -1.0 );
- glTexCoord1f( 1.0 ); glVertex2f( 1.0, -1.0 );
- glTexCoord1f( 1.0 ); glVertex2f( 1.0, 1.0 );
- glTexCoord1f( 0.0 ); glVertex2f( -1.0, 1.0 );
- glEnd();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-
-static void idle( void )
-{
- Angle += 2.0;
- glutPostRedisplay();
-}
-
-
-
-/* change view Angle, exit upon ESC */
-static void key(unsigned char k, int x, int y)
-{
- (void) x;
- (void) y;
- switch (k) {
- case 27:
- exit(0);
- }
-}
-
-
-
-/* new window size or exposure */
-static void reshape( int width, int height )
-{
- glViewport(0, 0, (GLint)width, (GLint)height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- /* glOrtho( -3.0, 3.0, -3.0, 3.0, -10.0, 10.0 );*/
- glFrustum( -2.0, 2.0, -2.0, 2.0, 6.0, 20.0 );
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -8.0 );
-}
-
-
-static void init( void )
-{
- GLubyte tex[256][3];
- GLint i;
-
-
- glDisable( GL_DITHER );
-
- /* Setup texturing */
- glEnable( GL_TEXTURE_1D );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );
-
-
- /* generate texture object IDs */
- glGenTextures( 2, TexObj );
-
- /* setup first texture object */
- glBindTexture( GL_TEXTURE_1D, TexObj[0] );
-
-
- for (i = 0; i < 256; i++) {
- GLfloat f;
-
- /* map 0..255 to -PI .. PI */
- f = ((i / 255.0) - .5) * (3.141592 * 2);
-
- f = sin(f);
-
- /* map -1..1 to 0..255 */
- tex[i][0] = (f+1.0)/2.0 * 255.0;
- tex[i][1] = 0;
- tex[i][2] = 0;
- }
-
- glTexImage1D( GL_TEXTURE_1D, 0, 3, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, tex );
- glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-}
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(300, 300);
- glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
-
- Window = glutCreateWindow("Texture Objects");
- if (!Window) {
- exit(1);
- }
-
- init();
-
- glutReshapeFunc( reshape );
- glutKeyboardFunc( key );
-/* glutIdleFunc( idle ); */
- glutDisplayFunc( draw );
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c
deleted file mode 100644
index 6e822fb6895..00000000000
--- a/progs/tests/texcmp.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Compressed texture demo. Written by Daniel Borca.
- * This program is in the public domain.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#define GL_GLEXT_PROTOTYPES 1
-#include <GL/glut.h>
-
-#include "readtex.c" /* I know, this is a hack. */
-#define TEXTURE_FILE "../images/tree2.rgba"
-
-
-static float Rot = 0.0;
-static GLboolean Anim = 1;
-
-typedef struct {
- GLubyte *data;
- GLuint size;
- GLenum format;
- GLuint w, h;
-
- GLenum TC;
-
- GLubyte *cData;
- GLuint cSize;
- GLenum cFormat;
-} TEXTURE;
-
-static TEXTURE *Tx, t1, t2, t3;
-static GLboolean fxt1, dxtc, s3tc;
-
-
-static const char *TextureName (GLenum TC)
-{
- switch (TC) {
- case GL_RGB:
- return "RGB";
- case GL_RGBA:
- return "RGBA";
- case GL_COMPRESSED_RGB:
- return "COMPRESSED_RGB";
- case GL_COMPRESSED_RGBA:
- return "COMPRESSED_RGBA";
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return "GL_COMPRESSED_RGB_FXT1_3DFX";
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return "GL_COMPRESSED_RGBA_FXT1_3DFX";
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return "GL_COMPRESSED_RGB_S3TC_DXT1_EXT";
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT";
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT";
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT";
- case GL_RGB_S3TC:
- return "GL_RGB_S3TC";
- case GL_RGB4_S3TC:
- return "GL_RGB4_S3TC";
- case GL_RGBA_S3TC:
- return "GL_RGBA_S3TC";
- case GL_RGBA4_S3TC:
- return "GL_RGBA4_S3TC";
- case 0:
- return "Invalid format";
- default:
- return "Unknown format";
- }
-}
-
-
-static void
-PrintString(const char *s)
-{
- while (*s) {
- glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
- s++;
- }
-}
-
-
-static void Idle( void )
-{
- float t = glutGet(GLUT_ELAPSED_TIME) * 0.001; /* in seconds */
- Rot = t * 360 / 4; /* 1 rotation per 4 seconds */
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- /* draw background gradient */
- glDisable(GL_TEXTURE_2D);
- glBegin(GL_POLYGON);
- glColor3f(1.0, 0.0, 0.2); glVertex2f(-1.5, -1.0);
- glColor3f(1.0, 0.0, 0.2); glVertex2f( 1.5, -1.0);
- glColor3f(0.0, 0.0, 1.0); glVertex2f( 1.5, 1.0);
- glColor3f(0.0, 0.0, 1.0); glVertex2f(-1.5, 1.0);
- glEnd();
-
- glPushMatrix();
- glRotatef(Rot, 0, 0, 1);
-
- glEnable(GL_TEXTURE_2D);
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 1); glVertex2f(-1, -0.5);
- glTexCoord2f(1, 1); glVertex2f( 1, -0.5);
- glTexCoord2f(1, 0); glVertex2f( 1, 0.5);
- glTexCoord2f(0, 0); glVertex2f(-1, 0.5);
- glEnd();
-
- glPopMatrix();
-
- /* info */
- glColor4f(1, 1, 1, 1);
-
- glRasterPos3f(-1.2, -0.7, 0);
- PrintString("Selected: ");
- PrintString(TextureName(Tx->TC));
- if (Tx->cData) {
- char tmp[64];
- glRasterPos3f(-1.2, -0.8, 0);
- PrintString("Internal: ");
- PrintString(TextureName(Tx->cFormat));
- glRasterPos3f(-1.2, -0.9, 0);
- PrintString("Size : ");
- sprintf(tmp, "%d (%d%% of %d)", Tx->cSize, Tx->cSize * 100 / Tx->size, Tx->size);
- PrintString(tmp);
- }
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho( -1.5, 1.5, -1.0, 1.0, -1.0, 1.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-static void ReInit( GLenum TC, TEXTURE *Tx )
-{
- GLint rv;
-
- if ((Tx->TC == TC) && (Tx->cData != NULL)) {
- glCompressedTexImage2DARB(GL_TEXTURE_2D, /* target */
- 0, /* level */
- Tx->cFormat, /* real format */
- Tx->w, /* original width */
- Tx->h, /* original height */
- 0, /* border */
- Tx->cSize, /* compressed size*/
- Tx->cData); /* compressed data*/
- } else {
- glTexImage2D(GL_TEXTURE_2D, /* target */
- 0, /* level */
- TC, /* internal format */
- Tx->w, Tx->h, /* width, height */
- 0, /* border */
- Tx->format, /* texture format */
- GL_UNSIGNED_BYTE, /* texture type */
- Tx->data); /* the texture */
-
- /* okay, now cache the compressed texture */
- Tx->TC = TC;
- if (Tx->cData != NULL) {
- free(Tx->cData);
- Tx->cData = NULL;
- }
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_ARB, &rv);
- if (rv) {
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, (GLint *)&Tx->cFormat);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, (GLint *)&Tx->cSize);
- if ((Tx->cData = malloc(Tx->cSize)) != NULL) {
- glGetCompressedTexImageARB(GL_TEXTURE_2D, 0, Tx->cData);
- }
- }
- }
-}
-
-
-static void Init( void )
-{
- /* HEIGHT * WIDTH + 1 (for trailing '\0') */
- static char pattern[8 * 32 + 1] = {"\
- \
- MMM EEEE SSS AAA \
- M M M E S S A A \
- M M M EEEE SS A A \
- M M M E SS AAAAA \
- M M E S S A A \
- M M EEEE SSS A A \
- "
- };
-
- GLuint i, j;
-
- GLubyte (*texture1)[8 * 32][4];
- GLubyte (*texture2)[256][256][4];
-
- t1.w = 32;
- t1.h = 8;
- t1.size = t1.w * t1.h * 4;
- t1.data = malloc(t1.size);
- t1.format = GL_RGBA;
- t1.TC = GL_RGBA;
-
- texture1 = (GLubyte (*)[8 * 32][4])t1.data;
- for (i = 0; i < sizeof(pattern) - 1; i++) {
- switch (pattern[i]) {
- default:
- case ' ':
- (*texture1)[i][0] = 255;
- (*texture1)[i][1] = 255;
- (*texture1)[i][2] = 255;
- (*texture1)[i][3] = 64;
- break;
- case 'M':
- (*texture1)[i][0] = 255;
- (*texture1)[i][1] = 0;
- (*texture1)[i][2] = 0;
- (*texture1)[i][3] = 255;
- break;
- case 'E':
- (*texture1)[i][0] = 0;
- (*texture1)[i][1] = 255;
- (*texture1)[i][2] = 0;
- (*texture1)[i][3] = 255;
- break;
- case 'S':
- (*texture1)[i][0] = 0;
- (*texture1)[i][1] = 0;
- (*texture1)[i][2] = 255;
- (*texture1)[i][3] = 255;
- break;
- case 'A':
- (*texture1)[i][0] = 255;
- (*texture1)[i][1] = 255;
- (*texture1)[i][2] = 0;
- (*texture1)[i][3] = 255;
- break;
- }
- }
-
- t2.w = 256;
- t2.h = 256;
- t2.size = t2.w * t2.h * 4;
- t2.data = malloc(t2.size);
- t2.format = GL_RGBA;
- t2.TC = GL_RGBA;
-
- texture2 = (GLubyte (*)[256][256][4])t2.data;
- for (j = 0; j < t2.h; j++) {
- for (i = 0; i < t2.w; i++) {
- (*texture2)[j][i][0] = sqrt(i * j * 255 * 255 / (t2.w * t2.h));
- (*texture2)[j][i][1] = 0;
- (*texture2)[j][i][2] = 0;
- (*texture2)[j][i][3] = 255;
- }
- }
-
- t3.data = LoadRGBImage(TEXTURE_FILE, (GLint *)&t3.w, (GLint *)&t3.h, &t3.format);
- t3.size = t3.w * t3.h * ((t3.format == GL_RGB) ? 3 : 4);
- t3.TC = GL_RGBA;
-
- ReInit(GL_RGBA, Tx = &t1);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glEnable(GL_TEXTURE_2D);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- case ' ':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc( Idle );
- else
- glutIdleFunc( NULL );
- break;
- case 't':
- if (Tx == &t1) {
- Tx = &t2;
- } else if (Tx == &t2) {
- Tx = &t3;
- } else {
- Tx = &t1;
- }
- ReInit(Tx->TC, Tx);
- break;
- case '9':
- ReInit(GL_RGB, Tx);
- break;
- case '0':
- ReInit(GL_RGBA, Tx);
- break;
- case '1':
- ReInit(GL_COMPRESSED_RGB, Tx);
- break;
- case '2':
- ReInit(GL_COMPRESSED_RGBA, Tx);
- break;
- case '3':
- if (fxt1) ReInit(GL_COMPRESSED_RGB_FXT1_3DFX, Tx);
- break;
- case '4':
- if (fxt1) ReInit(GL_COMPRESSED_RGBA_FXT1_3DFX, Tx);
- break;
- case '5':
- if (dxtc) ReInit(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, Tx);
- break;
- case '6':
- if (dxtc) ReInit(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, Tx);
- break;
- case '7':
- if (dxtc) ReInit(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, Tx);
- break;
- case '8':
- if (dxtc) ReInit(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, Tx);
- break;
- case 'a':
- if (s3tc) ReInit(GL_RGB_S3TC, Tx);
- break;
- case 's':
- if (s3tc) ReInit(GL_RGB4_S3TC, Tx);
- break;
- case 'd':
- if (s3tc) ReInit(GL_RGBA_S3TC, Tx);
- break;
- case 'f':
- if (s3tc) ReInit(GL_RGBA4_S3TC, Tx);
- break;
- }
- glutPostRedisplay();
-}
-
-
-int main( int argc, char *argv[] )
-{
- float gl_version;
- GLint num_formats;
- GLint i;
- GLint formats[64];
-
-
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 400, 300 );
-
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-
- if (glutCreateWindow(argv[0]) <= 0) {
- printf("Couldn't create window\n");
- exit(0);
- }
-
- gl_version = atof( (const char *) glGetString( GL_VERSION ) );
- if ( (gl_version < 1.3)
- && !glutExtensionSupported("GL_ARB_texture_compression") ) {
- printf("Sorry, GL_ARB_texture_compression not supported\n");
- exit(0);
- }
- if (glutExtensionSupported("GL_3DFX_texture_compression_FXT1")) {
- fxt1 = GL_TRUE;
- }
- if (glutExtensionSupported("GL_EXT_texture_compression_s3tc")) {
- dxtc = GL_TRUE;
- }
- if (glutExtensionSupported("GL_S3_s3tc")) {
- s3tc = GL_TRUE;
- }
-
- glGetIntegerv( GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, & num_formats );
-
- (void) memset( formats, 0, sizeof( formats ) );
- glGetIntegerv( GL_COMPRESSED_TEXTURE_FORMATS_ARB, formats );
-
- printf( "The following texture formats are supported:\n" );
- for ( i = 0 ; i < num_formats ; i++ ) {
- printf( "\t%s\n", TextureName( formats[i] ) );
- }
-
- Init();
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc( Idle );
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c
deleted file mode 100644
index e2eed756b62..00000000000
--- a/progs/tests/texcompress2.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Test texture compression.
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <assert.h>
-#include <stdio.h>
-#include <GL/glut.h>
-#include <GL/glx.h>
-#include "readtex.c"
-
-#define IMAGE_FILE "../images/arch.rgb"
-
-static int ImgWidth, ImgHeight;
-static GLenum ImgFormat;
-static GLenum CompFormat;
-static GLfloat EyeDist = 5.0;
-static GLfloat Rot = 0.0;
-const GLenum Target = GL_TEXTURE_2D;
-
-
-static void
-CheckError(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("GL Error %d at line %d\n", (int) err, line);
- }
-}
-
-
-static const char *
-LookupFormat(GLenum format)
-{
- switch (format) {
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return "GL_COMPRESSED_RGB_S3TC_DXT1_EXT";
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT";
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT";
- default:
- return "other";
- }
-}
-
-
-static void
-TestSubTex(void)
-{
- GLboolean all = 0*GL_TRUE;
- GLubyte *buffer;
- GLint size, fmt;
- int i;
-
- glGetTexLevelParameteriv(Target, 0,
- GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &size);
- glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_INTERNAL_FORMAT, &fmt);
-
- buffer = (GLubyte *) malloc(size);
- glGetCompressedTexImageARB(Target, 0, buffer);
-
- printf("Testing sub-texture replacement\n");
- if (all)
- glCompressedTexImage2DARB(Target, 0,
- fmt, ImgWidth, ImgHeight, 0,
- size, buffer);
- else {
- /* bottom half */
- glCompressedTexSubImage2DARB(Target, 0,
- 0, 0, /* pos */
- ImgWidth, ImgHeight / 2,
- fmt, size/2, buffer);
- /* top half */
- glCompressedTexSubImage2DARB(Target, 0,
- 0, ImgHeight / 2, /* pos */
- ImgWidth, ImgHeight / 2,
- fmt, size/2, buffer + size / 2);
- }
-
- free(buffer);
-}
-
-
-static void
-LoadCompressedImage(const char *file)
-{
- const GLenum filter = GL_LINEAR;
- GLubyte *image;
- GLint p;
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
-
- /*
- * Load image and scale if needed.
- */
- image = LoadRGBImage( file, &ImgWidth, &ImgHeight, &ImgFormat );
- if (!image) {
- printf("Couldn't read %s\n", IMAGE_FILE);
- exit(0);
- }
- printf("Image is %d x %d\n", ImgWidth, ImgHeight);
-
- /* power of two */
- assert(ImgWidth == 128 || ImgWidth == 256 || ImgWidth == 512);
- assert(ImgWidth == 128 || ImgHeight == 256 || ImgHeight == 512);
-
- if (ImgFormat == GL_RGB)
- CompFormat = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
- else
- CompFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
-
- if (ImgFormat == GL_RGBA) {
- int i, numAlpha = 0;
- for (i = 0; i < ImgWidth * ImgHeight; i++) {
- if (image[i*4+3] != 0 && image[i*4+3] != 0xff) {
- numAlpha++;
- }
- if (image[i*4+3] == 0)
- image[i*4+3] = 4 * i / ImgWidth;
- }
- printf("Num Alpha !=0,255: %d\n", numAlpha);
- }
-
- CompFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
-
-
- /*
- * Give image to OpenGL and have it compress it.
- */
- glTexImage2D(Target, 0, CompFormat, ImgWidth, ImgHeight, 0,
- ImgFormat, GL_UNSIGNED_BYTE, image);
- CheckError(__LINE__);
-
- free(image);
-
- glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_INTERNAL_FORMAT, &p);
- printf("Compressed Internal Format: %s (0x%x)\n", LookupFormat(p), p);
- assert(p == CompFormat);
-
- printf("Original size: %d bytes\n", ImgWidth * ImgHeight * 3);
- glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &p);
- printf("Compressed size: %d bytes\n", p);
-
- glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, filter);
- glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, filter);
-
- TestSubTex();
-
-}
-
-
-static void
-Init(const char *file)
-{
- GLint numFormats, formats[100];
- GLint p;
-
- if (!glutExtensionSupported("GL_ARB_texture_compression")) {
- printf("Sorry, GL_ARB_texture_compression is required.\n");
- exit(1);
- }
- if (!glutExtensionSupported("GL_EXT_texture_compression_s3tc")) {
- printf("Sorry, GL_EXT_texture_compression_s3tc is required.\n");
- exit(1);
- }
-
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, &numFormats);
- glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS_ARB, formats);
- printf("%d supported compression formats: ", numFormats);
- for (p = 0; p < numFormats; p++)
- printf("0x%x ", formats[p]);
- printf("\n");
-
- LoadCompressedImage(file);
-
- glEnable(GL_TEXTURE_2D);
-
- if (ImgFormat == GL_RGBA) {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- }
-}
-
-
-static void
-Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum(-1, 1, -1, 1, 4, 100);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-static void
-Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'd':
- EyeDist -= 1.0;
- if (EyeDist < 4.0)
- EyeDist = 4.0;
- break;
- case 'D':
- EyeDist += 1.0;
- break;
- case 'z':
- Rot += 5.0;
- break;
- case 'Z':
- Rot -= 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void
-Draw( void )
-{
- glClearColor(0.3, 0.3, .8, 0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glPushMatrix();
- glTranslatef(0, 0, -(EyeDist+0.01));
- glRotatef(Rot, 0, 0, 1);
- glBegin(GL_POLYGON);
- glTexCoord2f(0, 0); glVertex2f(-1, -1);
- glTexCoord2f(1, 0); glVertex2f( 1, -1);
- glTexCoord2f(1, 1); glVertex2f( 1, 1);
- glTexCoord2f(0, 1); glVertex2f(-1, 1);
- glEnd();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-int
-main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowSize( 600, 600 );
-
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
-
- glutCreateWindow(argv[0]);
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Draw );
-
- if (argc > 1)
- Init(argv[1]);
- else
- Init(IMAGE_FILE);
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/texfilt.c b/progs/tests/texfilt.c
deleted file mode 100644
index 6ee4bc4eae3..00000000000
--- a/progs/tests/texfilt.c
+++ /dev/null
@@ -1,398 +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
- * 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.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <GL/glut.h>
-
-const GLenum filter_modes[] = {
- GL_NEAREST,
- GL_LINEAR,
- GL_NEAREST_MIPMAP_NEAREST,
- GL_NEAREST_MIPMAP_LINEAR,
- GL_LINEAR_MIPMAP_NEAREST,
- GL_LINEAR_MIPMAP_LINEAR,
-};
-
-static GLenum min_filter = GL_LINEAR_MIPMAP_LINEAR;
-static GLenum mag_filter = GL_LINEAR;
-
-static unsigned segments = 64;
-static GLfloat * position_data = NULL;
-static GLfloat * texcoord_data = NULL;
-static GLfloat max_anisotropy = 0.0;
-static GLfloat anisotropy = 1.0;
-
-static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
- GLfloat ** tex_data );
-static void generate_textures( unsigned mode );
-
-#define min(a,b) ( (a) < (b) ) ? (a) : (b)
-#define max(a,b) ( (a) > (b) ) ? (a) : (b)
-
-
-static void Display( void )
-{
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter );
-
- if ( max_anisotropy > 0.0 ) {
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
- anisotropy );
- }
-
- glClear( GL_COLOR_BUFFER_BIT );
- glLoadIdentity();
- glTranslatef( 0.0f, 0.0f, -19.0f );
-
- glVertexPointer( 4, GL_FLOAT, 0, position_data );
- glTexCoordPointer( 2, GL_FLOAT, 0, texcoord_data );
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_TEXTURE_COORD_ARRAY );
- glDrawArrays( GL_QUADS, 0, 4 * segments );
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(45.0f, (GLfloat)(width)/(GLfloat)(height), 0.1f, 100.0f);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- GLfloat new_anisotropy = anisotropy;
-
- (void) x;
- (void) y;
-
-
- switch( key ) {
- case 'a': {
- new_anisotropy = anisotropy - 1.0;
- break;
- }
-
- case 'A': {
- new_anisotropy = anisotropy + 1.0;
- break;
- }
-
- case 's': {
- segments--;
- if ( segments < 3 ) {
- segments = 3;
- }
- generate_tunnel( segments, & position_data, & texcoord_data );
- break;
- }
-
- case 'S': {
- segments++;
- if ( segments > 128 ) {
- segments = 128;
- }
- generate_tunnel( segments, & position_data, & texcoord_data );
- break;
- }
- case 'q':
- case 'Q':
- case 27:
- exit(0);
- break;
- }
-
- new_anisotropy = max( new_anisotropy, 1.0 );
- new_anisotropy = min( new_anisotropy, max_anisotropy );
- if ( new_anisotropy != anisotropy ) {
- anisotropy = new_anisotropy;
- printf( "Texture anisotropy: %f%s\n", anisotropy,
- (anisotropy == 1.0) ? " (disabled)" : "" );
- }
-
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- (void) x;
- (void) y;
- (void) key;
- glutPostRedisplay();
-}
-
-
-static void menu_handler( int selection )
-{
- switch( selection >> 3 ) {
- case 0:
- glBindTexture( GL_TEXTURE_2D, selection );
- break;
-
- case 1:
- min_filter = filter_modes[ selection & 7 ];
- break;
-
- case 2:
- mag_filter = filter_modes[ selection & 7 ];
- break;
- }
-
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- glDisable(GL_CULL_FACE);
- glEnable(GL_TEXTURE_2D);
- glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
- glShadeModel(GL_SMOOTH);
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
-
- generate_tunnel( segments, & position_data, & texcoord_data );
-
- glBindTexture( GL_TEXTURE_2D, 1 );
- generate_textures(1);
-
- glBindTexture( GL_TEXTURE_2D, 2 );
- generate_textures(2);
-
- glBindTexture( GL_TEXTURE_2D, 3 );
- generate_textures(3);
-
- if ( glutExtensionSupported( "GL_EXT_texture_filter_anisotropic" ) ) {
- glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, & max_anisotropy );
- }
-
- printf("Maximum texture anisotropy: %f\n", max_anisotropy );
-
- /* Create the menus. */
-
- glutCreateMenu( menu_handler );
- glutAddMenuEntry( "Min filter: GL_NEAREST", 8 + 0 );
- glutAddMenuEntry( "Min filter: GL_LINEAR", 8 + 1 );
- glutAddMenuEntry( "Min filter: GL_NEAREST_MIMMAP_NEAREST", 8 + 2 );
- glutAddMenuEntry( "Min filter: GL_NEAREST_MIMMAP_LINEAR", 8 + 3 );
- glutAddMenuEntry( "Min filter: GL_LINEAR_MIMMAP_NEAREST", 8 + 4 );
- glutAddMenuEntry( "Min filter: GL_LINEAR_MIMMAP_LINEAR", 8 + 5 );
- glutAddMenuEntry( "Mag filter: GL_NEAREST", 16 + 0 );
- glutAddMenuEntry( "Mag filter: GL_LINEAR", 16 + 1 );
- glutAddMenuEntry( "Texture: regular mipmaps", 1 );
- glutAddMenuEntry( "Texture: blended mipmaps", 2 );
- glutAddMenuEntry( "Texture: color mipmaps", 3 );
- glutAttachMenu( GLUT_RIGHT_BUTTON );
-}
-
-
-static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
- GLfloat ** tex_data )
-{
- const GLfloat far = 20.0f;
- const GLfloat near = -90.0f;
- const GLfloat far_tex = 30.0f;
- const GLfloat near_tex = 0.0f;
- const GLfloat angle_step = (2 * M_PI) / num_segs;
- const GLfloat tex_coord_step = 2.0 / num_segs;
- GLfloat angle = 0.0f;
- GLfloat tex_coord = 0.0f;
- unsigned i;
- GLfloat * position;
- GLfloat * texture;
-
-
- position = realloc( *pos_data, sizeof( GLfloat ) * num_segs * 4 * 4 );
- texture = realloc( *tex_data, sizeof( GLfloat ) * num_segs * 4 * 2 );
-
- *pos_data = position;
- *tex_data = texture;
-
- for ( i = 0 ; i < num_segs ; i++ ) {
- position[0] = 2.5 * sinf( angle );
- position[1] = 2.5 * cosf( angle );
- position[2] = (i & 1) ? far : near;
- position[3] = 1.0f;
-
- position[4] = position[0];
- position[5] = position[1];
- position[6] = (i & 1) ? near : far;
- position[7] = 1.0f;
-
- position += 8;
-
- texture[0] = tex_coord;
- texture[1] = (i & 1) ? far_tex : near_tex;
- texture += 2;
-
- texture[0] = tex_coord;
- texture[1] = (i & 1) ? near_tex : far_tex;
- texture += 2;
-
- angle += angle_step;
- tex_coord += tex_coord_step;
-
- position[0] = 2.5 * sinf( angle );
- position[1] = 2.5 * cosf( angle );
- position[2] = (i & 1) ? near : far;
- position[3] = 1.0f;
-
- position[4] = position[0];
- position[5] = position[1];
- position[6] = (i & 1) ? far : near;
- position[7] = 1.0f;
-
- position += 8;
-
- texture[0] = tex_coord;
- texture[1] = (i & 1) ? near_tex : far_tex;
- texture += 2;
-
- texture[0] = tex_coord;
- texture[1] = (i & 1) ? far_tex : near_tex;
- texture += 2;
- }
-}
-
-
-static void generate_textures( unsigned mode )
-{
-#define LEVEL_COLORS 6
- const GLfloat colors[LEVEL_COLORS][3] = {
- { 1.0, 0.0, 0.0 }, /* 32 x 32 */
- { 0.0, 1.0, 0.0 }, /* 16 x 16 */
- { 0.0, 0.0, 1.0 }, /* 8 x 8 */
- { 1.0, 0.0, 1.0 }, /* 4 x 4 */
- { 1.0, 1.0, 1.0 }, /* 2 x 2 */
- { 1.0, 1.0, 0.0 } /* 1 x 1 */
- };
- const unsigned checkers_per_level = 2;
- GLfloat * tex;
- unsigned level;
- unsigned size;
- GLint max_size;
-
-
- glGetIntegerv( GL_MAX_TEXTURE_SIZE, & max_size );
- if ( max_size > 512 ) {
- max_size = 512;
- }
-
- tex = malloc( sizeof( GLfloat ) * 3 * max_size * max_size );
-
- level = 0;
- for ( size = max_size ; size > 0 ; size >>= 1 ) {
- unsigned divisor = size / checkers_per_level;
- unsigned i;
- unsigned j;
- GLfloat checkers[2][3];
-
-
- if ((level == 0) || (mode == 1)) {
- checkers[0][0] = 1.0;
- checkers[0][1] = 1.0;
- checkers[0][2] = 1.0;
- checkers[1][0] = 0.0;
- checkers[1][1] = 0.0;
- checkers[1][2] = 0.0;
- }
- else if (mode == 2) {
- checkers[0][0] = colors[level % LEVEL_COLORS][0];
- checkers[0][1] = colors[level % LEVEL_COLORS][1];
- checkers[0][2] = colors[level % LEVEL_COLORS][2];
- checkers[1][0] = colors[level % LEVEL_COLORS][0] * 0.5;
- checkers[1][1] = colors[level % LEVEL_COLORS][1] * 0.5;
- checkers[1][2] = colors[level % LEVEL_COLORS][2] * 0.5;
- }
- else {
- checkers[0][0] = colors[level % LEVEL_COLORS][0];
- checkers[0][1] = colors[level % LEVEL_COLORS][1];
- checkers[0][2] = colors[level % LEVEL_COLORS][2];
- checkers[1][0] = colors[level % LEVEL_COLORS][0];
- checkers[1][1] = colors[level % LEVEL_COLORS][1];
- checkers[1][2] = colors[level % LEVEL_COLORS][2];
- }
-
- if ( divisor == 0 ) {
- divisor = 1;
-
- checkers[0][0] = (checkers[0][0] + checkers[1][0]) / 2;
- checkers[0][1] = (checkers[0][0] + checkers[1][0]) / 2;
- checkers[0][2] = (checkers[0][0] + checkers[1][0]) / 2;
- checkers[1][0] = checkers[0][0];
- checkers[1][1] = checkers[0][1];
- checkers[1][2] = checkers[0][2];
- }
-
-
- for ( i = 0 ; i < size ; i++ ) {
- for ( j = 0 ; j < size ; j++ ) {
- const unsigned idx = ((i ^ j) / divisor) & 1;
-
- tex[ ((i * size) + j) * 3 + 0] = checkers[ idx ][0];
- tex[ ((i * size) + j) * 3 + 1] = checkers[ idx ][1];
- tex[ ((i * size) + j) * 3 + 2] = checkers[ idx ][2];
- }
- }
-
- glTexImage2D( GL_TEXTURE_2D, level, GL_RGB, size, size, 0,
- GL_RGB, GL_FLOAT, tex );
- level++;
- }
-
- free( tex );
-}
-
-
-int main( int argc, char ** argv )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 800, 600 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow( "Texture Filter Test" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
-
- Init();
-
- printf("\nUse the right-button menu to select the texture and filter mode.\n");
- printf("Use 'A' and 'a' to increase and decrease the aniotropy.\n");
- printf("Use 'S' and 's' to increase and decrease the number of cylinder segments.\n");
- printf("Use 'q' to exit.\n\n");
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/texgenmix.c b/progs/tests/texgenmix.c
deleted file mode 100644
index be8f6775c70..00000000000
--- a/progs/tests/texgenmix.c
+++ /dev/null
@@ -1,640 +0,0 @@
-
-/*
- * Demonstrates mixed texgen/non-texgen texture coordinates.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <GL/glut.h>
-
-#undef max
-#undef min
-#define max( a, b ) ((a) >= (b) ? (a) : (b))
-#define min( a, b ) ((a) <= (b) ? (a) : (b))
-
-GLfloat labelColor0[4] = { 1.0, 1.0, 1.0, 1.0 };
-GLfloat labelColor1[4] = { 1.0, 1.0, 0.4, 1.0 };
-GLfloat *labelInfoColor = labelColor0;
-
-GLboolean doubleBuffered = GL_TRUE;
-GLboolean drawTextured = GL_TRUE;
-
-int textureWidth = 64;
-int textureHeight = 64;
-
-int winWidth = 580, winHeight = 720;
-
-const GLfloat texmat_swap_rq[16] = { 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 1.0,
- 0.0, 0.0, 1.0, 0.0};
-
-const GLfloat nullPlane[4] = { 0.0, 0.0, 0.0, 0.0 };
-const GLfloat ObjPlaneS1[4] = { 1.0, 0.0, 1.0, 0.0 };
-const GLfloat ObjPlaneS2[4] = { 0.5, 0.0, 0.0, 0.0 };
-const GLfloat ObjPlaneS3[4] = { 1.0, 0.0, 0.0, 0.0 };
-const GLfloat ObjPlaneT[4] = { 0.0, 1.0, 0.0, 0.0 };
-const GLfloat ObjPlaneT2[4] = { 0.0, 0.5, 0.0, 0.0 };
-const GLfloat ObjPlaneT3[4] = { 0.0, 1.0, 0.0, 0.0 };
-const GLfloat ObjPlaneR[4] = { 0.0, 0.0, 1.0, 0.0 };
-const GLfloat ObjPlaneQ[4] = { 0.0, 0.0, 0.0, 0.5 };
-
-
-static void checkErrors( void )
-{
- GLenum error;
-
- while ( (error = glGetError()) != GL_NO_ERROR ) {
- fprintf( stderr, "Error: %s\n", (char *) gluErrorString( error ) );
- }
-}
-
-static void drawString( const char *string, GLfloat x, GLfloat y,
- const GLfloat color[4] )
-{
- glColor4fv( color );
- glRasterPos2f( x, y );
-
- while ( *string ) {
- glutBitmapCharacter( GLUT_BITMAP_TIMES_ROMAN_10, *string );
- string++;
- }
-}
-
-static void begin2D( int width, int height )
-{
- glMatrixMode( GL_PROJECTION );
-
- glPushMatrix();
- glLoadIdentity();
-
- glOrtho( 0, width, 0, height, -1, 1 );
- glMatrixMode( GL_MODELVIEW );
-
- glPushMatrix();
- glLoadIdentity();
-}
-
-static void end2D( void )
-{
- glMatrixMode( GL_PROJECTION );
- glPopMatrix();
- glMatrixMode( GL_MODELVIEW );
- glPopMatrix();
-}
-
-static void initialize( void )
-{
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
-
- glOrtho( -1.5, 1.5, -1.5, 1.5, -1.5, 1.5 );
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glShadeModel( GL_FLAT );
-}
-
-/* ARGSUSED1 */
-static void keyboard( unsigned char c, int x, int y )
-{
- switch ( c ) {
- case 't':
- drawTextured = !drawTextured;
- break;
- case 27: /* Escape key should force exit. */
- exit(0);
- break;
- default:
- break;
- }
- glutPostRedisplay();
-}
-
-/* ARGSUSED1 */
-static void special( int key, int x, int y )
-{
- switch ( key ) {
- case GLUT_KEY_DOWN:
- break;
- case GLUT_KEY_UP:
- break;
- case GLUT_KEY_LEFT:
- break;
- case GLUT_KEY_RIGHT:
- break;
- default:
- break;
- }
- glutPostRedisplay();
-}
-
-static void
-reshape( int w, int h )
-{
- winWidth = w;
- winHeight = h;
- /* No need to call glViewPort here since "draw" calls it! */
-}
-
-static void loadTexture( int width, int height )
-{
- int alphaSize = 1;
- int rgbSize = 3;
- GLubyte *texImage, *p;
- int elementsPerGroup, elementSize, groupSize, rowSize;
- int i, j;
-
-
- elementsPerGroup = alphaSize + rgbSize;
- elementSize = sizeof(GLubyte);
- groupSize = elementsPerGroup * elementSize;
- rowSize = width * groupSize;
-
- if ( (texImage = (GLubyte *) malloc( height * rowSize ) ) == NULL ) {
- fprintf( stderr, "texture malloc failed\n" );
- return;
- }
-
- for ( i = 0 ; i < height ; i++ )
- {
- p = texImage + i * rowSize;
-
- for ( j = 0 ; j < width ; j++ )
- {
- if ( rgbSize > 0 )
- {
- /**
- ** +-----+-----+
- ** | | |
- ** | R | G |
- ** | | |
- ** +-----+-----+
- ** | | |
- ** | Y | B |
- ** | | |
- ** +-----+-----+
- **/
- if ( i > height / 2 ) {
- if ( j < width / 2 ) {
- p[0] = 0xff;
- p[1] = 0x00;
- p[2] = 0x00;
- } else {
- p[0] = 0x00;
- p[1] = 0xff;
- p[2] = 0x00;
- }
- } else {
- if ( j < width / 2 ) {
- p[0] = 0xff;
- p[1] = 0xff;
- p[2] = 0x00;
- } else {
- p[0] = 0x00;
- p[1] = 0x00;
- p[2] = 0xff;
- }
- }
- p += 3 * elementSize;
- }
-
- if ( alphaSize > 0 )
- {
- /**
- ** +-----------+
- ** | W |
- ** | +-----+ |
- ** | | | |
- ** | | B | |
- ** | | | |
- ** | +-----+ |
- ** | |
- ** +-----------+
- **/
- int i2 = i - height / 2;
- int j2 = j - width / 2;
- int h8 = height / 8;
- int w8 = width / 8;
- if ( -h8 <= i2 && i2 <= h8 && -w8 <= j2 && j2 <= w8 ) {
- p[0] = 0x00;
- } else if ( -2 * h8 <= i2 && i2 <= 2 * h8 && -2 * w8 <= j2 && j2 <= 2 * w8 ) {
- p[0] = 0x55;
- } else if ( -3 * h8 <= i2 && i2 <= 3 * h8 && -3 * w8 <= j2 && j2 <= 3 * w8 ) {
- p[0] = 0xaa;
- } else {
- p[0] = 0xff;
- }
- p += elementSize;
- }
- }
- }
-
- glTexImage2D( GL_TEXTURE_2D, 0,
- GL_RGBA, width, height, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, texImage );
-
- free( texImage );
-}
-
-
-static void drawSample( int x, int y, int w, int h,
- int texgenenabled, int coordnr )
-{
- char buf[255];
-
- glViewport( x, y, w, h );
- glScissor( x, y, w, h );
-
- glClearColor( 0.1, 0.1, 0.1, 1.0 );
- glClear( GL_COLOR_BUFFER_BIT );
-
- begin2D( w, h );
- if (texgenenabled == 2) {
- sprintf( buf, "TexCoord%df", coordnr);
- drawString( buf, 10, h - 15, labelInfoColor );
- sprintf( buf, "texgen enabled for %s coordinate(s)", coordnr == 2 ? "S" : "S/T");
- drawString( buf, 10, 5, labelInfoColor );
- }
- else if (texgenenabled == 0) {
- sprintf( buf, "TexCoord%df", coordnr);
- drawString( buf, 10, h - 15, labelInfoColor );
- drawString( "no texgen", 10, 5, labelInfoColor );
- }
- else if (texgenenabled == 1) {
- drawString( "no TexCoord", 10, h - 15, labelInfoColor );
- sprintf( buf, "texgen enabled for %s coordinate(s)",
- coordnr == 2 ? "S/T" : (coordnr == 3 ? "S/T/R" : "S/T/R/Q"));
- drawString( buf, 10, 5, labelInfoColor );
- }
-
- end2D();
-
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
-
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
-
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
-
- loadTexture( textureWidth, textureHeight );
-
- if ( drawTextured ) {
- glEnable( GL_TEXTURE_2D );
- }
-
- glDisable( GL_TEXTURE_GEN_S );
- glDisable( GL_TEXTURE_GEN_T );
- glDisable( GL_TEXTURE_GEN_R );
- glDisable( GL_TEXTURE_GEN_Q );
-
- glMatrixMode( GL_TEXTURE );
- glLoadIdentity();
- glMatrixMode( GL_MODELVIEW );
- glPushMatrix();
-
- switch (coordnr) {
- case 2:
- switch (texgenenabled) {
- case 0:
- glBegin( GL_QUADS );
- glTexCoord2f( 0.0, 0.0 );
- glVertex2f( -0.8, -0.8 );
-
- glTexCoord2f( 1.0, 0.0 );
- glVertex2f( 0.8, -0.8 );
-
- glTexCoord2f( 1.0, 1.0 );
- glVertex2f( 0.8, 0.8 );
-
- glTexCoord2f( 0.0, 1.0 );
- glVertex2f( -0.8, 0.8 );
- glEnd();
- break;
- case 1:
- glTranslatef( -0.8, -0.8, 0.0 );
- glScalef( 1.6, 1.6, 1.0 );
- glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS3);
- glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT3);
- glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane);
- glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane);
-
- glEnable( GL_TEXTURE_GEN_S );
- glEnable( GL_TEXTURE_GEN_T );
-
- /* Issue a texcoord here to be sure Q isn't left over from a
- * previous sample.
- */
- glTexCoord1f( 0.0 );
- glBegin( GL_QUADS );
- glVertex2f( 0.0, 0.0 );
- glVertex2f( 1.0, 0.0 );
- glVertex2f( 1.0, 1.0 );
- glVertex2f( 0.0, 1.0 );
- glEnd();
- break;
- case 2:
- /* make sure that texgen T and non-texgen S coordinate are wrong */
- glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS1);
- glTexGenfv(GL_T, GL_OBJECT_PLANE, nullPlane);
- glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane);
- glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane);
-
- glEnable( GL_TEXTURE_GEN_S );
-
- glBegin( GL_QUADS );
- /* use z coordinate to get correct texgen values... */
- glTexCoord2f( 0.0, 0.0 );
- glVertex3f( -0.8, -0.8, 0.8 );
-
- glTexCoord2f( 0.0, 0.0 );
- glVertex3f( 0.8, -0.8, 0.2 );
-
- glTexCoord2f( 0.0, 1.0 );
- glVertex3f( 0.8, 0.8, 0.2 );
-
- glTexCoord2f( 0.0, 1.0 );
- glVertex3f( -0.8, 0.8, 0.8 );
- glEnd();
- break;
- }
- break;
- case 3:
- glMatrixMode( GL_TEXTURE );
- glLoadMatrixf( texmat_swap_rq );
- glMatrixMode( GL_MODELVIEW );
- glTranslatef( -0.8, -0.8, 0.0 );
- glScalef( 1.6, 1.6, 1.0 );
- switch (texgenenabled) {
- case 0:
- glBegin( GL_QUADS );
- glTexCoord3f( 0.0, 0.0, 0.5 );
- glVertex2f( 0.0, 0.0 );
-
- glTexCoord3f( 0.5, 0.0, 0.5 );
- glVertex2f( 1.0, 0.0 );
-
- glTexCoord3f( 0.5, 0.5, 0.5 );
- glVertex2f( 1.0, 1.0 );
-
- glTexCoord3f( 0.0, 0.5, 0.5 );
- glVertex2f( 0.0, 1.0 );
- glEnd();
- break;
- case 1:
- glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2);
- glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2);
- glTexGenfv(GL_R, GL_OBJECT_PLANE, ObjPlaneR);
- glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane);
-
- glEnable( GL_TEXTURE_GEN_S );
- glEnable( GL_TEXTURE_GEN_T );
- glEnable( GL_TEXTURE_GEN_R );
-
- glTexCoord1f( 0.0 ); /* to make sure Q is 1.0 */
- glBegin( GL_QUADS );
- glVertex3f( 0.0, 0.0, 0.5 );
- glVertex3f( 1.0, 0.0, 0.5 );
- glVertex3f( 1.0, 1.0, 0.5 );
- glVertex3f( 0.0, 1.0, 0.5 );
- glEnd();
- break;
- case 2:
- /* make sure that texgen R/Q and non-texgen S/T coordinates are wrong */
- glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2);
- glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2);
- glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane);
- glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane);
-
- glEnable( GL_TEXTURE_GEN_S );
- glEnable( GL_TEXTURE_GEN_T );
-
- glBegin( GL_QUADS );
- glTexCoord3f( 0.0, 0.0, 0.5 );
- glVertex2f( 0.0, 0.0);
-
- glTexCoord3f( 0.0, 0.0, 0.5 );
- glVertex2f( 1.0, 0.0);
-
- glTexCoord3f( 0.0, 0.0, 0.5 );
- glVertex2f( 1.0, 1.0);
-
- glTexCoord3f( 0.0, 0.0, 0.5 );
- glVertex2f( 0.0, 1.0);
- glEnd();
- break;
- }
- break;
- case 4:
- switch (texgenenabled) {
- case 0:
- glBegin( GL_QUADS );
- /* don't need r coordinate but still setting it I'm mean */
- glTexCoord4f( 0.0, 0.0, 0.0, 0.5 );
- glVertex2f( -0.8, -0.8 );
-
- glTexCoord4f( 0.5, 0.0, 0.2, 0.5 );
- glVertex2f( 0.8, -0.8 );
-
- glTexCoord4f( 0.5, 0.5, 0.5, 0.5 );
- glVertex2f( 0.8, 0.8 );
-
- glTexCoord4f( 0.0, 0.5, 0.5, 0.5 );
- glVertex2f( -0.8, 0.8 );
- glEnd();
- break;
- case 1:
- glTranslatef( -0.8, -0.8, 0.0 );
- glScalef( 1.6, 1.6, 1.0 );
- /* make sure that texgen R/Q and non-texgen S/T coordinates are wrong */
- glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2);
- glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2);
- glTexGenfv(GL_R, GL_OBJECT_PLANE, ObjPlaneR);
- glTexGenfv(GL_Q, GL_OBJECT_PLANE, ObjPlaneQ);
-
- glEnable( GL_TEXTURE_GEN_S );
- glEnable( GL_TEXTURE_GEN_T );
- glEnable( GL_TEXTURE_GEN_R );
- glEnable( GL_TEXTURE_GEN_Q );
-
- glBegin( GL_QUADS );
- glVertex2f( 0.0, 0.0 );
- glVertex2f( 1.0, 0.0 );
- glVertex2f( 1.0, 1.0 );
- glVertex2f( 0.0, 1.0 );
- glEnd();
- break;
- case 2:
- glTranslatef( -0.8, -0.8, 0.0 );
- glScalef( 1.6, 1.6, 1.0 );
- /* make sure that texgen R/Q and non-texgen S/T coordinates are wrong */
- glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
- glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2);
- glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2);
- glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane);
- glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane);
-
- glEnable( GL_TEXTURE_GEN_S );
- glEnable( GL_TEXTURE_GEN_T );
-
- glBegin( GL_QUADS );
- glTexCoord4f( 0.0, 0.0, 0.0, 0.5 );
- glVertex2f( 0.0, 0.0 );
-
- glTexCoord4f( 0.0, 0.0, 0.2, 0.5 );
- glVertex2f( 1.0, 0.0 );
-
- glTexCoord4f( 0.0, 0.0, 0.5, 0.5 );
- glVertex2f( 1.0, 1.0 );
-
- glTexCoord4f( 0.0, 0.0, 0.75, 0.5 );
- glVertex2f( 0.0, 1.0 );
- glEnd();
- break;
- }
- break;
- }
-
- glPopMatrix();
- glDisable( GL_TEXTURE_2D );
-
-}
-
-static void display( void )
-{
- int numX = 3, numY = 3;
- float xBase = (float) winWidth * 0.01;
- float xOffset = (winWidth - xBase) / numX;
- float xSize = max( xOffset - xBase, 1 );
- float yBase = (float) winHeight * 0.01;
- float yOffset = (winHeight - yBase) / numY;
- float ySize = max( yOffset - yBase, 1 );
- float x, y;
- int i, j;
-
- glViewport( 0, 0, winWidth, winHeight );
- glDisable( GL_SCISSOR_TEST );
- glClearColor( 0.0, 0.0, 0.0, 0.0 );
- glClear( GL_COLOR_BUFFER_BIT );
- glEnable( GL_SCISSOR_TEST );
-
- x = xBase;
- y = (winHeight - 1) - yOffset;
-
- for ( i = 0 ; i < numY ; i++ )
- {
-
- labelInfoColor = labelColor1;
-
-
- for ( j = 0 ; j < numX ; j++ ) {
- drawSample( x, y, xSize, ySize, i, j+2 );
- x += xOffset;
- }
-
- x = xBase;
- y -= yOffset;
- }
-
- if ( doubleBuffered ) {
- glutSwapBuffers();
- } else {
- glFlush();
- }
-
- checkErrors();
-}
-
-static void usage( char *name )
-{
- fprintf( stderr, "usage: %s [ options ]\n", name );
- fprintf( stderr, "\n" );
- fprintf( stderr, "options:\n" );
- fprintf( stderr, " -sb single buffered\n" );
- fprintf( stderr, " -db double buffered\n" );
- fprintf( stderr, " -info print OpenGL driver info\n" );
-}
-
-static void instructions( void )
-{
- fprintf( stderr, "texgenmix - mixed texgen/non-texgen texture coordinate test\n" );
- fprintf( stderr, "all quads should look the same!\n" );
- fprintf( stderr, "\n" );
- fprintf( stderr, " [t] - toggle texturing\n" );
-}
-
-int main( int argc, char *argv[] )
-{
- GLboolean info = GL_FALSE;
- int i;
-
- glutInit( &argc, argv );
-
- for ( i = 1 ; i < argc ; i++ ) {
- if ( !strcmp( "-sb", argv[i] ) ) {
- doubleBuffered = GL_FALSE;
- } else if ( !strcmp( "-db", argv[i] ) ) {
- doubleBuffered = GL_TRUE;
- } else if ( !strcmp( "-info", argv[i] ) ) {
- info = GL_TRUE;
- } else {
- usage( argv[0] );
- exit( 1 );
- }
- }
-
- if ( doubleBuffered ) {
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- } else {
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE );
- }
-
- glutInitWindowSize( winWidth, winHeight );
- glutInitWindowPosition( 0, 0 );
- glutCreateWindow( "Mixed texgen/non-texgen texture coordinate test" );
-
- initialize();
- instructions();
-
- if ( info ) {
- printf( "\n" );
- printf( "GL_RENDERER = %s\n", (char *) glGetString( GL_RENDERER ) );
- printf( "GL_VERSION = %s\n", (char *) glGetString( GL_VERSION ) );
- printf( "GL_VENDOR = %s\n", (char *) glGetString( GL_VENDOR ) ) ;
- printf( "GL_EXTENSIONS = %s\n", (char *) glGetString( GL_EXTENSIONS ) );
- }
-
- glutDisplayFunc( display );
- glutReshapeFunc( reshape );
- glutKeyboardFunc( keyboard );
- glutSpecialFunc( special );
- glutMainLoop();
-
- return 0;
-}
diff --git a/progs/tests/texline.c b/progs/tests/texline.c
deleted file mode 100644
index 3d59d9ac264..00000000000
--- a/progs/tests/texline.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* $Id: texline.c,v 1.5 2004/01/28 10:07:48 keithw Exp $ */
-
-/*
- * Test textured lines.
- *
- * Brian Paul
- * September 2000
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-#include "../util/readtex.c" /* I know, this is a hack. */
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-static GLboolean Antialias = GL_FALSE;
-static GLboolean Animate = GL_FALSE;
-static GLint Texture = 1;
-static GLboolean Stipple = GL_FALSE;
-static GLfloat LineWidth = 1.0;
-
-static GLfloat Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
-static GLfloat DYrot = 1.0;
-static GLboolean Points = GL_FALSE;
-static GLfloat Scale = 1.0;
-
-static void Idle( void )
-{
- if (Animate) {
- Zrot += DYrot;
- glutPostRedisplay();
- }
-}
-
-
-static void Display( void )
-{
- GLfloat x, y, s, t;
-
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glScalef(Scale, Scale, Scale);
-
- if (Texture)
- glColor3f(1, 1, 1);
-
- if (Points) {
- glBegin(GL_POINTS);
- for (t = 0.0; t <= 1.0; t += 0.025) {
- for (s = 0.0; s <= 1.0; s += 0.025) {
- x = s * 2.0 - 1.0;
- y = t * 2.0 - 1.0;
- if (!Texture)
- glColor3f(1, 0, 1);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, t, s);
- glTexCoord2f(s, t);
- glVertex2f(x, y);
- }
- }
- glEnd();
- }
- else {
- glBegin(GL_LINES);
- for (t = 0.0; t <= 1.0; t += 0.025) {
- x = t * 2.0 - 1.0;
- if (!Texture)
- glColor3f(1, 0, 1);
- glTexCoord2f(t, 0.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, t);
- glVertex2f(x, -1.0);
- if (!Texture)
- glColor3f(0, 1, 0);
- glTexCoord2f(t, 1.0);
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, t);
- glVertex2f(x, 1.0);
- }
- glEnd();
- }
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, 10.0, 100.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -12.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Antialias = !Antialias;
- if (Antialias) {
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_POINT_SMOOTH);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
- else {
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_POINT_SMOOTH);
- glDisable(GL_BLEND);
- }
- break;
- case 't':
- Texture++;
- if (Texture > 2)
- Texture = 0;
- if (Texture == 0) {
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glDisable(GL_TEXTURE_2D);
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glDisable(GL_TEXTURE_2D);
- }
- else if (Texture == 1) {
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glEnable(GL_TEXTURE_2D);
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glDisable(GL_TEXTURE_2D);
- }
- else {
- glActiveTextureARB(GL_TEXTURE0_ARB);
- glEnable(GL_TEXTURE_2D);
- glActiveTextureARB(GL_TEXTURE1_ARB);
- glEnable(GL_TEXTURE_2D);
- }
- break;
- case 'w':
- LineWidth -= 0.25;
- if (LineWidth < 0.25)
- LineWidth = 0.25;
- glLineWidth(LineWidth);
- glPointSize(LineWidth);
- break;
- case 'W':
- LineWidth += 0.25;
- if (LineWidth > 8.0)
- LineWidth = 8.0;
- glLineWidth(LineWidth);
- glPointSize(LineWidth);
- break;
- case 'p':
- Points = !Points;
- break;
- case 's':
- Stipple = !Stipple;
- if (Stipple)
- glEnable(GL_LINE_STIPPLE);
- else
- glDisable(GL_LINE_STIPPLE);
- break;
- case ' ':
- Animate = !Animate;
- if (Animate)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 27:
- exit(0);
- break;
- }
- printf("LineWidth, PointSize = %f\n", LineWidth);
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( int argc, char *argv[] )
-{
- GLuint u;
- for (u = 0; u < 2; u++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + u);
- glBindTexture(GL_TEXTURE_2D, 10+u);
- if (u == 0)
- glEnable(GL_TEXTURE_2D);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- if (u == 0)
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- else
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
- }
-
- glLineStipple(1, 0xff);
-
- if (argc > 1 && strcmp(argv[1], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition(0, 0);
- glutInitWindowSize( 400, 300 );
-
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-
- glutCreateWindow(argv[0] );
-
- Init(argc, argv);
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Animate)
- glutIdleFunc( Idle );
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/texobjshare.c b/progs/tests/texobjshare.c
deleted file mode 100644
index 2b31cb6c4d3..00000000000
--- a/progs/tests/texobjshare.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Create several OpenGL rendering contexts, sharing textures, display
- * lists, etc. Exercise binding, deleting, etc.
- *
- * Brian Paul
- * 21 December 2004
- */
-
-
-#include <GL/gl.h>
-#include <GL/glx.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <X11/keysym.h>
-
-
-/*
- * Each display/window/context:
- */
-struct context {
- char DisplayName[1000];
- Display *Dpy;
- Window Win;
- GLXContext Context;
-};
-
-
-#define MAX_CONTEXTS 200
-static struct context Contexts[MAX_CONTEXTS];
-static int NumContexts = 0;
-
-
-static void
-Error(const char *display, const char *msg)
-{
- fprintf(stderr, "Error on display %s - %s\n", display, msg);
- exit(1);
-}
-
-
-static struct context *
-CreateContext(const char *displayName, const char *name)
-{
- Display *dpy;
- Window win;
- GLXContext ctx;
- int attrib[] = { GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_DOUBLEBUFFER,
- None };
- int scrnum;
- XSetWindowAttributes attr;
- unsigned long mask;
- Window root;
- XVisualInfo *visinfo;
- int width = 90, height = 90;
- int xpos = 0, ypos = 0;
-
- if (NumContexts >= MAX_CONTEXTS)
- return NULL;
-
- dpy = XOpenDisplay(displayName);
- if (!dpy) {
- Error(displayName, "Unable to open display");
- return NULL;
- }
-
- scrnum = DefaultScreen(dpy);
- root = RootWindow(dpy, scrnum);
-
- visinfo = glXChooseVisual(dpy, scrnum, attrib);
- if (!visinfo) {
- Error(displayName, "Unable to find RGB, double-buffered visual");
- return NULL;
- }
-
- /* window attributes */
- xpos = (NumContexts % 10) * 100;
- ypos = (NumContexts / 10) * 100;
- attr.background_pixel = 0;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
- attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
- mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
-
- win = XCreateWindow(dpy, root, xpos, ypos, width, height,
- 0, visinfo->depth, InputOutput,
- visinfo->visual, mask, &attr);
- if (!win) {
- Error(displayName, "Couldn't create window");
- return NULL;
- }
-
- {
- XSizeHints sizehints;
- sizehints.x = xpos;
- sizehints.y = ypos;
- sizehints.width = width;
- sizehints.height = height;
- sizehints.flags = USSize | USPosition;
- XSetNormalHints(dpy, win, &sizehints);
- XSetStandardProperties(dpy, win, name, name,
- None, (char **)NULL, 0, &sizehints);
- }
-
- if (NumContexts == 0) {
- ctx = glXCreateContext(dpy, visinfo, NULL, True);
- }
- else {
- /* share textures & dlists with 0th context */
- ctx = glXCreateContext(dpy, visinfo, Contexts[0].Context, True);
- }
- if (!ctx) {
- Error(displayName, "Couldn't create GLX context");
- return NULL;
- }
-
- XMapWindow(dpy, win);
-
- if (!glXMakeCurrent(dpy, win, ctx)) {
- Error(displayName, "glXMakeCurrent failed");
- return NULL;
- }
-
- if (NumContexts == 0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- }
-
- /* save the info for this context */
- {
- struct context *h = &Contexts[NumContexts];
- strcpy(h->DisplayName, name);
- h->Dpy = dpy;
- h->Win = win;
- h->Context = ctx;
- NumContexts++;
- return &Contexts[NumContexts-1];
- }
-}
-
-
-static void
-MakeCurrent(int i)
-{
- if (!glXMakeCurrent(Contexts[i].Dpy, Contexts[i].Win, Contexts[i].Context)) {
- fprintf(stderr, "glXMakeCurrent failed!\n");
- }
-}
-
-
-
-static void
-DestroyContext(int i)
-{
- XDestroyWindow(Contexts[i].Dpy, Contexts[i].Win);
- glXDestroyContext(Contexts[i].Dpy, Contexts[i].Context);
- XCloseDisplay(Contexts[i].Dpy);
-}
-
-
-int
-main(int argc, char *argv[])
-{
- char *dpyName = NULL;
- int i;
- GLuint t;
- GLint tb;
-
- for (i = 0; i < 2; i++) {
- CreateContext(dpyName, "context");
- }
-
- /* Create texture and bind it in context 0 */
- MakeCurrent(0);
- glGenTextures(1, &t);
- printf("Generated texture ID %u\n", t);
- assert(!glIsTexture(t));
- glBindTexture(GL_TEXTURE_2D, t);
- assert(glIsTexture(t));
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb);
- assert(tb == t);
-
- /* Bind texture in context 1 */
- MakeCurrent(1);
- assert(glIsTexture(t));
- glBindTexture(GL_TEXTURE_2D, t);
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb);
- assert(tb == t);
-
- /* Delete texture from context 0 */
- MakeCurrent(0);
- glDeleteTextures(1, &t);
- assert(!glIsTexture(t));
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb);
- printf("After delete, binding = %d\n", tb);
-
- /* Check texture state from context 1 */
- MakeCurrent(1);
- assert(!glIsTexture(t));
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb);
- printf("In second context, binding = %d\n", tb);
- glBindTexture(GL_TEXTURE_2D, 0);
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb);
- assert(tb == 0);
-
-
- for (i = 0; i < NumContexts; i++) {
- DestroyContext(i);
- }
-
- printf("Success!\n");
-
- return 0;
-}
diff --git a/progs/tests/texrect.c b/progs/tests/texrect.c
deleted file mode 100644
index 61c1fdd6b4f..00000000000
--- a/progs/tests/texrect.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/* $Id: texrect.c,v 1.5 2004/05/06 20:27:32 brianp Exp $ */
-
-/* GL_NV_texture_rectangle test
- *
- * Brian Paul
- * 14 June 2002
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <GL/glut.h>
-#include "readtex.h"
-
-#define TEXTURE_0_FILE "../images/girl.rgb"
-#define TEXTURE_1_FILE "../images/reflect.rgb"
-
-#define TEX0 1
-#define TEX7 8
-#define ANIMATE 10
-#define CLAMP 20
-#define CLAMP_TO_EDGE 21
-#define CLAMP_TO_BORDER 22
-#define LINEAR_FILTER 30
-#define NEAREST_FILTER 31
-#define QUIT 100
-
-static GLboolean Animate = GL_FALSE;
-static GLint NumUnits = 2;
-static GLboolean TexEnabled[8];
-static GLint Width[8], Height[8]; /* image sizes */
-static GLenum Format[8];
-
-static GLfloat Xrot = 00.0, Yrot = 00.0, Zrot = 0.0;
-
-
-static void Idle( void )
-{
- Zrot = glutGet(GLUT_ELAPSED_TIME) * 0.01;
- glutPostRedisplay();
-}
-
-
-static void DrawObject(void)
-{
- GLint i;
- GLfloat d = 10; /* so we can see how borders are handled */
-
- glColor3f(.1, .1, .1); /* modulate this */
-
- glPushMatrix();
-
- glRotatef(Zrot, 0, 0, 1);
-
- glBegin(GL_QUADS);
-
- for (i = 0; i < NumUnits; i++)
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, -d, -d);
- glVertex2f(-1.0, -1.0);
-
- for (i = 0; i < NumUnits; i++)
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, Width[i]+d, -d);
- glVertex2f(1.0, -1.0);
-
- for (i = 0; i < NumUnits; i++)
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, Width[i]+d, Height[i]+d);
- glVertex2f(1.0, 1.0);
-
- for (i = 0; i < NumUnits; i++)
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, -d, Height[i]+d);
- glVertex2f(-1.0, 1.0);
-
- glEnd();
- glPopMatrix();
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glScalef(5.0, 5.0, 5.0);
- DrawObject();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 100.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -35.0 );
-}
-
-
-static void ModeMenu(int entry)
-{
- GLint i;
- if (entry >= TEX0 && entry < TEX0 + NumUnits) {
- /* toggle */
- i = entry - TEX0;
- TexEnabled[i] = !TexEnabled[i];
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- if (TexEnabled[i]) {
- glEnable(GL_TEXTURE_RECTANGLE_NV);
- }
- else {
- glDisable(GL_TEXTURE_RECTANGLE_NV);
- }
- printf("Enabled: ");
- for (i = 0; i < NumUnits; i++)
- printf("%d ", (int) TexEnabled[i]);
- printf("\n");
- }
- else if (entry==ANIMATE) {
- Animate = !Animate;
- if (Animate)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- }
- else if (entry==CLAMP) {
- for (i = 0; i < NumUnits; i++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, GL_CLAMP);
- }
- }
- else if (entry==CLAMP_TO_EDGE) {
- for (i = 0; i < NumUnits; i++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- }
- }
- else if (entry==CLAMP_TO_BORDER) {
- for (i = 0; i < NumUnits; i++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
- }
- }
- else if (entry==NEAREST_FILTER) {
- for (i = 0; i < NumUnits; i++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
- }
- else if (entry==LINEAR_FILTER) {
- for (i = 0; i < NumUnits; i++) {
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- }
-
- else if (entry==QUIT) {
- exit(0);
- }
-
- glutPostRedisplay();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'z':
- Zrot -= 1.0;
- break;
- case 'Z':
- Zrot += 1.0;
- break;
- case 'a':
- Animate = !Animate;
- if (Animate)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( int argc, char *argv[] )
-{
- const GLenum wrap = GL_CLAMP;
- GLuint texObj[8];
- GLint size, i;
-
- if (!glutExtensionSupported("GL_ARB_multitexture")) {
- printf("Sorry, GL_ARB_multitexture needed by this program\n");
- exit(1);
- }
-
- if (!glutExtensionSupported("GL_NV_texture_rectangle")) {
- printf("Sorry, GL_NV_texture_rectangle needed by this program\n");
- exit(1);
- }
-
- glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &NumUnits);
- printf("%d texture units supported, using 2.\n", NumUnits);
- if (NumUnits > 2)
- NumUnits = 2;
-
- glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_NV, &size);
- printf("%d x %d max texture rectangle size\n", size, size);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- for (i = 0; i < NumUnits; i++) {
- TexEnabled[i] = GL_TRUE;
- }
-
- /* allocate two texture objects */
- glGenTextures(NumUnits, texObj);
-
- /* setup the texture objects */
- for (i = 0; i < NumUnits; i++) {
-
- glActiveTextureARB(GL_TEXTURE0_ARB + i);
-
- glBindTexture(GL_TEXTURE_RECTANGLE_NV, texObj[i]);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV,
- GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV,
- GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, wrap);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, wrap);
-
- if (i == 0) {
- GLubyte *img = LoadRGBImage(TEXTURE_0_FILE, &Width[0], &Height[0],
- &Format[0]);
- if (!img) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
- printf("Texture %d: %s (%d x %d)\n", i,
- TEXTURE_0_FILE, Width[0], Height[0]);
- glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_RGB,
- Width[0], Height[0], 0,
- Format[0], GL_UNSIGNED_BYTE, img);
- }
- else {
- GLubyte *img = LoadRGBImage(TEXTURE_1_FILE, &Width[1], &Height[1],
- &Format[1]);
- if (!img) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
- printf("Texture %d: %s (%d x %d)\n", i,
- TEXTURE_1_FILE, Width[1], Height[1]);
- glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_RGB,
- Width[1], Height[1], 0,
- Format[1], GL_UNSIGNED_BYTE, img);
- }
-
- if (i < 1)
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
- else
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
-
- if (TexEnabled[i])
- glEnable(GL_TEXTURE_RECTANGLE_NV);
- }
-
- glShadeModel(GL_FLAT);
- glClearColor(0.3, 0.3, 0.4, 1.0);
-
- if (argc > 1 && strcmp(argv[1], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- GLint i;
-
- glutInit( &argc, argv );
- glutInitWindowSize( 300, 300 );
- glutInitWindowPosition( 0, 0 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0] );
-
- Init( argc, argv );
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Animate)
- glutIdleFunc( Idle );
-
- glutCreateMenu(ModeMenu);
-
- for (i = 0; i < NumUnits; i++) {
- char s[100];
- sprintf(s, "Toggle Texture %d", i);
- glutAddMenuEntry(s, TEX0 + i);
- }
- glutAddMenuEntry("Toggle Animation", ANIMATE);
- glutAddMenuEntry("GL_CLAMP", CLAMP);
- glutAddMenuEntry("GL_CLAMP_TO_EDGE", CLAMP_TO_EDGE);
- glutAddMenuEntry("GL_CLAMP_TO_BORDER", CLAMP_TO_BORDER);
- glutAddMenuEntry("GL_NEAREST", NEAREST_FILTER);
- glutAddMenuEntry("GL_LINEAR", LINEAR_FILTER);
- glutAddMenuEntry("Quit", QUIT);
- glutAttachMenu(GLUT_RIGHT_BUTTON);
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/texwrap.c b/progs/tests/texwrap.c
deleted file mode 100644
index 6e9fbe0c70f..00000000000
--- a/progs/tests/texwrap.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/* $Id: texwrap.c,v 1.8 2005/08/25 03:09:12 brianp Exp $ */
-
-/*
- * Test texture wrap modes.
- * Press 'b' to toggle texture image borders. You should see the same
- * rendering whether or not you're using borders.
- *
- * Brian Paul March 2001
- */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glut.h>
-
-
-#ifndef GL_CLAMP_TO_BORDER
-#define GL_CLAMP_TO_BORDER 0x812D
-#endif
-
-#ifndef GL_MIRRORED_REPEAT
-#define GL_MIRRORED_REPEAT 0x8370
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-#endif
-
-#define BORDER_TEXTURE 1
-#define NO_BORDER_TEXTURE 2
-
-#define SIZE 8
-static GLubyte BorderImage[SIZE+2][SIZE+2][4];
-static GLubyte NoBorderImage[SIZE][SIZE][4];
-static GLuint Border = 0;
-
-#define TILE_SIZE 110
-
-#define WRAP_MODE(m) { m , # m, GL_TRUE, 1.0, { NULL, NULL } }
-#define WRAP_EXT(m,e1,e2,v) { m , # m, GL_FALSE, v, { e1, e2 } }
-
-struct wrap_mode {
- GLenum mode;
- const char * name;
- GLboolean supported;
- GLfloat version;
- const char * extension_names[2];
-};
-
-static struct wrap_mode modes[] = {
- WRAP_MODE( GL_REPEAT ),
- WRAP_MODE( GL_CLAMP ),
- WRAP_EXT ( GL_CLAMP_TO_EDGE, "GL_EXT_texture_edge_clamp",
- "GL_SGIS_texture_edge_clamp",
- 1.2 ),
- WRAP_EXT ( GL_CLAMP_TO_BORDER, "GL_ARB_texture_border_clamp",
- "GL_SGIS_texture_border_clamp",
- 1.3 ),
- WRAP_EXT ( GL_MIRRORED_REPEAT, "GL_ARB_texture_mirrored_repeat",
- "GL_IBM_texture_mirrored_repeat",
- 1.4 ),
- WRAP_EXT ( GL_MIRROR_CLAMP_EXT, "GL_ATI_texture_mirror_once",
- "GL_EXT_texture_mirror_clamp",
- 999.0 ),
- WRAP_EXT ( GL_MIRROR_CLAMP_TO_BORDER_EXT, "GL_EXT_texture_mirror_clamp",
- NULL,
- 999.0 ),
- WRAP_EXT ( GL_MIRROR_CLAMP_TO_EDGE_EXT, "GL_ATI_texture_mirror_once",
- "GL_EXT_texture_mirror_clamp",
- 999.0 ),
- { 0 }
-};
-
-static void
-PrintString(const char *s)
-{
- while (*s) {
- glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
- s++;
- }
-}
-
-
-static void Display( void )
-{
- GLenum i, j;
- GLint offset;
- GLfloat version;
-
- /* Fill in the extensions that are supported.
- */
-
- version = atof( (char *) glGetString( GL_VERSION ) );
- for ( i = 0 ; modes[i].mode != 0 ; i++ ) {
- if ( ((modes[i].extension_names[0] != NULL)
- && glutExtensionSupported(modes[i].extension_names[0]))
- || ((modes[i].extension_names[1] != NULL)
- && glutExtensionSupported(modes[i].extension_names[1])) ) {
- modes[i].supported = GL_TRUE;
- }
- else if ( !modes[i].supported && (modes[i].version <= version) ) {
- fprintf( stderr, "WARNING: OpenGL library meets minimum version\n"
- " requirement for %s, but the\n"
- " extension string is not advertised.\n"
- " (%s%s%s)\n",
- modes[i].name,
- modes[i].extension_names[0],
- (modes[i].extension_names[1] != NULL)
- ? " or " : "",
- (modes[i].extension_names[1] != NULL)
- ? modes[i].extension_names[1] : "" );
- modes[i].supported = GL_TRUE;
- }
- }
-
-
- glClearColor(0.5, 0.5, 0.5, 1.0);
- glClear( GL_COLOR_BUFFER_BIT );
-
-#if 0
- /* draw texture as image */
- glDisable(GL_TEXTURE_2D);
- glWindowPos2iARB(1, 1);
- glDrawPixels(6, 6, GL_RGBA, GL_UNSIGNED_BYTE, (void *) TexImage);
-#endif
-
- glBindTexture(GL_TEXTURE_2D, Border ? BORDER_TEXTURE : NO_BORDER_TEXTURE);
-
-
- /* loop over min/mag filters */
- for (i = 0; i < 2; i++) {
- offset = 0;
-
- if (i) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- }
-
- /* loop over border modes */
- for (j = 0; modes[j].mode != 0; j++) {
- const GLfloat x0 = 0, y0 = 0, x1 = (TILE_SIZE - 10), y1 = (TILE_SIZE - 10);
- const GLfloat b = 1.2;
- const GLfloat s0 = -b, t0 = -b, s1 = 1.0+b, t1 = 1.0+b;
-
- if ( modes[j].supported != GL_TRUE )
- continue;
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, modes[j].mode);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, modes[j].mode);
-
- glPushMatrix();
- glTranslatef(offset * TILE_SIZE + 10, i * TILE_SIZE + 40, 0);
- offset++;
-
- glEnable(GL_TEXTURE_2D);
- glColor3f(1, 1, 1);
- glBegin(GL_POLYGON);
- glTexCoord2f(s0, t0); glVertex2f(x0, y0);
- glTexCoord2f(s1, t0); glVertex2f(x1, y0);
- glTexCoord2f(s1, t1); glVertex2f(x1, y1);
- glTexCoord2f(s0, t1); glVertex2f(x0, y1);
- glEnd();
-
- /* draw red outline showing bounds of texture at s=0,1 and t=0,1 */
- glDisable(GL_TEXTURE_2D);
- glColor3f(1, 0, 0);
- glBegin(GL_LINE_LOOP);
- glVertex2f(x0 + b * (x1-x0) / (s1-s0), y0 + b * (y1-y0) / (t1-t0));
- glVertex2f(x1 - b * (x1-x0) / (s1-s0), y0 + b * (y1-y0) / (t1-t0));
- glVertex2f(x1 - b * (x1-x0) / (s1-s0), y1 - b * (y1-y0) / (t1-t0));
- glVertex2f(x0 + b * (x1-x0) / (s1-s0), y1 - b * (y1-y0) / (t1-t0));
- glEnd();
-
- glPopMatrix();
- }
- }
-
- glDisable(GL_TEXTURE_2D);
- glColor3f(1, 1, 1);
- offset = 0;
- for (i = 0; modes[i].mode != 0; i++) {
- if ( modes[i].supported ) {
- glWindowPos2iARB( offset * TILE_SIZE + 10, 5 + ((offset & 1) * 15) );
- PrintString(modes[i].name);
- offset++;
- }
- }
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(0, width, 0, height, -1, 1);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'b':
- Border = !Border;
- printf("Texture Border Size = %d\n", Border);
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- static const GLubyte border[4] = { 0, 255, 0, 255 };
- static const GLfloat borderf[4] = { 0, 1.0, 0, 1.0 };
- GLint i, j;
-
- for (i = 0; i < SIZE+2; i++) {
- for (j = 0; j < SIZE+2; j++) {
- if (i == 0 || j == 0 || i == SIZE+1 || j == SIZE+1) {
- /* border color */
- BorderImage[i][j][0] = border[0];
- BorderImage[i][j][1] = border[1];
- BorderImage[i][j][2] = border[2];
- BorderImage[i][j][3] = border[3];
- }
- else if ((i + j) & 1) {
- /* white */
- BorderImage[i][j][0] = 255;
- BorderImage[i][j][1] = 255;
- BorderImage[i][j][2] = 255;
- BorderImage[i][j][3] = 255;
- }
- else {
- /* black */
- BorderImage[i][j][0] = 0;
- BorderImage[i][j][1] = 0;
- BorderImage[i][j][2] = 0;
- BorderImage[i][j][3] = 0;
- }
- }
- }
-
- glBindTexture(GL_TEXTURE_2D, BORDER_TEXTURE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
- GL_RGBA, GL_UNSIGNED_BYTE, (void *) BorderImage);
-
- for (i = 0; i < SIZE; i++) {
- for (j = 0; j < SIZE; j++) {
- if ((i + j) & 1) {
- /* white */
- NoBorderImage[i][j][0] = 255;
- NoBorderImage[i][j][1] = 255;
- NoBorderImage[i][j][2] = 255;
- NoBorderImage[i][j][3] = 255;
- }
- else {
- /* black */
- NoBorderImage[i][j][0] = 0;
- NoBorderImage[i][j][1] = 0;
- NoBorderImage[i][j][2] = 0;
- NoBorderImage[i][j][3] = 0;
- }
- }
- }
-
- glBindTexture(GL_TEXTURE_2D, NO_BORDER_TEXTURE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE, SIZE, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, (void *) NoBorderImage);
- glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderf);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 1000, 270 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/vao-01.c b/progs/tests/vao-01.c
deleted file mode 100644
index c2d70885f05..00000000000
--- a/progs/tests/vao-01.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2006
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 vao-01.c
- *
- * Simple test of APPLE_vertex_array_object functionality. This test creates
- * a VAO, pushed it (via \c glPushClientAttrib), modifies the VAO, then pops
- * it (via \c glPopClientAttrib). After popping, the state of the VAO is
- * examined.
- *
- * According the the APPLE_vertex_array_object spec, the contents of the VAO
- * should be restored to the values that they had when pushed.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#ifdef __darwin__
-#include <GLUT/glut.h>
-
-typedef void (* PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (* PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-
-#else
-#include <GL/glut.h>
-#endif
-
-static PFNGLBINDVERTEXARRAYAPPLEPROC bind_vertex_array = NULL;
-static PFNGLGENVERTEXARRAYSAPPLEPROC gen_vertex_arrays = NULL;
-static PFNGLDELETEVERTEXARRAYSAPPLEPROC delete_vertex_arrays = NULL;
-static PFNGLISVERTEXARRAYAPPLEPROC is_vertex_array = NULL;
-
-static int Width = 400;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
-}
-
-
-static void Idle( void )
-{
-}
-
-
-static void Visible( int vis )
-{
- if ( vis == GLUT_VISIBLE ) {
- glutIdleFunc( Idle );
- }
- else {
- glutIdleFunc( NULL );
- }
-}
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
- GLuint obj;
- int pass = 1;
- void * ptr;
-
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n\n", ver_string);
-
- if ( !glutExtensionSupported("GL_APPLE_vertex_array_object") ) {
- printf("Sorry, this program requires GL_APPLE_vertex_array_object\n");
- exit(2);
- }
-
- bind_vertex_array = glutGetProcAddress( "glBindVertexArrayAPPLE" );
- gen_vertex_arrays = glutGetProcAddress( "glGenVertexArraysAPPLE" );
- delete_vertex_arrays = glutGetProcAddress( "glDeleteVertexArraysAPPLE" );
- is_vertex_array = glutGetProcAddress( "glIsVertexArrayAPPLE" );
-
-
- (*gen_vertex_arrays)( 1, & obj );
- (*bind_vertex_array)( obj );
- glVertexPointer( 4, GL_FLOAT, sizeof(GLfloat) * 4, (void *) 0xDEADBEEF);
- glEnableClientState( GL_VERTEX_ARRAY );
-
- glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT );
-
- glVertexPointer( 4, GL_FLOAT, sizeof(GLfloat) * 4, (void *) 0xBADDC0DE);
- glDisableClientState( GL_VERTEX_ARRAY );
-
- glPopClientAttrib();
-
- if ( ! glIsEnabled( GL_VERTEX_ARRAY ) ) {
- printf( "Array state is incorrectly disabled.\n" );
- pass = 0;
- }
-
- glGetPointerv( GL_VERTEX_ARRAY_POINTER, & ptr );
- if ( ptr != (void *) 0xDEADBEEF ) {
- printf( "Array pointer is incorrectly set to 0x%p.\n", ptr );
- pass = 0;
- }
-
- if ( ! pass ) {
- printf( "FAIL!\n" );
- exit(1);
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB );
- glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- glutVisibilityFunc( Visible );
-
- Init();
-
- return 0;
-}
diff --git a/progs/tests/vao-02.c b/progs/tests/vao-02.c
deleted file mode 100644
index 993bc368d40..00000000000
--- a/progs/tests/vao-02.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2006
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 vao-02.c
- *
- * Simple test of APPLE_vertex_array_object functionality. This test creates
- * a VAO, pushed it (via \c glPushClientAttrib), deletes the VAO, then pops
- * it (via \c glPopClientAttrib). After popping, the state of the VAO is
- * examined.
- *
- * According the the APPLE_vertex_array_object spec, the contents of the VAO
- * should be restored to the values that they had when pushed.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#ifdef __darwin__
-#include <GLUT/glut.h>
-
-typedef void (* PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (* PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-
-#else
-#include <GL/glut.h>
-#endif
-
-static PFNGLBINDVERTEXARRAYAPPLEPROC bind_vertex_array = NULL;
-static PFNGLGENVERTEXARRAYSAPPLEPROC gen_vertex_arrays = NULL;
-static PFNGLDELETEVERTEXARRAYSAPPLEPROC delete_vertex_arrays = NULL;
-static PFNGLISVERTEXARRAYAPPLEPROC is_vertex_array = NULL;
-
-static int Width = 400;
-static int Height = 200;
-static const GLfloat Near = 5.0, Far = 25.0;
-
-
-static void Display( void )
-{
-}
-
-
-static void Idle( void )
-{
-}
-
-
-static void Visible( int vis )
-{
- if ( vis == GLUT_VISIBLE ) {
- glutIdleFunc( Idle );
- }
- else {
- glutIdleFunc( NULL );
- }
-}
-static void Reshape( int width, int height )
-{
- GLfloat ar = (float) width / (float) height;
- Width = width;
- Height = height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- const char * const ver_string = (const char * const)
- glGetString( GL_VERSION );
- GLuint obj;
- int pass = 1;
- void * ptr;
- GLenum err;
-
-
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n\n", ver_string);
-
- if ( !glutExtensionSupported("GL_APPLE_vertex_array_object") ) {
- printf("Sorry, this program requires GL_APPLE_vertex_array_object\n");
- exit(2);
- }
-
- bind_vertex_array = glutGetProcAddress( "glBindVertexArrayAPPLE" );
- gen_vertex_arrays = glutGetProcAddress( "glGenVertexArraysAPPLE" );
- delete_vertex_arrays = glutGetProcAddress( "glDeleteVertexArraysAPPLE" );
- is_vertex_array = glutGetProcAddress( "glIsVertexArrayAPPLE" );
-
-
- (*gen_vertex_arrays)( 1, & obj );
- (*bind_vertex_array)( obj );
- glVertexPointer( 4, GL_FLOAT, sizeof(GLfloat) * 4, (void *) 0xDEADBEEF);
- glEnableClientState( GL_VERTEX_ARRAY );
-
- glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT );
-
- (*delete_vertex_arrays)( 1, & obj );
-
- err = glGetError();
- if (err) {
- printf( "glGetError incorrectly returned 0x%04x.\n", err );
- pass = 0;
- }
-
- if ( (*is_vertex_array)( obj ) ) {
- printf( "Array object is incorrectly still valid.\n" );
- pass = 0;
- }
-
- err = glGetError();
- if (err) {
- printf( "glGetError incorrectly returned 0x%04x.\n", err );
- pass = 0;
- }
-
- glPopClientAttrib();
-
- err = glGetError();
- if (err) {
- printf( "glGetError incorrectly returned 0x%04x.\n", err );
- pass = 0;
- }
-
- if ( ! (*is_vertex_array)( obj ) ) {
- printf( "Array object is incorrectly invalid.\n" );
- pass = 0;
- }
-
- if ( ! glIsEnabled( GL_VERTEX_ARRAY ) ) {
- printf( "Array state is incorrectly disabled.\n" );
- pass = 0;
- }
-
- glGetPointerv( GL_VERTEX_ARRAY_POINTER, & ptr );
- if ( ptr != (void *) 0xDEADBEEF ) {
- printf( "Array pointer is incorrectly set to 0x%p.\n", ptr );
- pass = 0;
- }
-
- if ( ! pass ) {
- printf( "FAIL!\n" );
- exit(1);
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( Width, Height );
- glutInitDisplayMode( GLUT_RGB );
- glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- glutVisibilityFunc( Visible );
-
- Init();
-
- return 0;
-}
diff --git a/progs/tests/vparray.c b/progs/tests/vparray.c
deleted file mode 100644
index 580a670f8e1..00000000000
--- a/progs/tests/vparray.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Test vertex arrays with GL_NV_vertex_program
- *
- * Based on a stripped-down version of the isosurf demo.
- * The vertex program is trivial: compute the resulting
- * RGB color as a linear function of vertex XYZ.
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include "GL/glut.h"
-
-#define MAXVERTS 10000
-static float data[MAXVERTS][6];
-static GLint numverts;
-
-static GLfloat xrot;
-static GLfloat yrot;
-static GLboolean useArrays = GL_TRUE;
-static GLboolean useProgram = GL_TRUE;
-static GLboolean useList = GL_FALSE;
-
-
-static void read_surface( char *filename )
-{
- FILE *f;
-
- f = fopen(filename,"r");
- if (!f) {
- printf("couldn't read %s\n", filename);
- exit(1);
- }
-
- numverts = 0;
- while (!feof(f) && numverts < MAXVERTS) {
- fscanf( f, "%f %f %f %f %f %f",
- &data[numverts][0], &data[numverts][1], &data[numverts][2],
- &data[numverts][3], &data[numverts][4], &data[numverts][5] );
- numverts++;
- }
- numverts--;
-
- printf("%d vertices, %d triangles\n", numverts, numverts-2);
- printf("data = %p\n", (void *) data);
- fclose(f);
-}
-
-
-
-
-static void Display(void)
-{
- if (useProgram)
- glEnable(GL_VERTEX_PROGRAM_NV);
- else
- glDisable(GL_VERTEX_PROGRAM_NV);
-
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(xrot, 1, 0, 0);
- glRotatef(yrot, 0, 1, 0);
- glScalef(2, 2, 2);
- if (useArrays) {
- if (useProgram) {
- glVertexAttribPointerNV( 0, 3, GL_FLOAT, 6 * sizeof(GLfloat), data );
- glEnableClientState( GL_VERTEX_ATTRIB_ARRAY0_NV );
- glVertexAttribPointerNV( 2, 3, GL_FLOAT, 6 * sizeof(GLfloat), ((GLfloat *) data) + 3);
- glEnableClientState( GL_VERTEX_ATTRIB_ARRAY2_NV);
- }
- else {
- glVertexPointer( 3, GL_FLOAT, 6 * sizeof(GLfloat), data );
- glEnableClientState( GL_VERTEX_ARRAY );
- glNormalPointer( GL_FLOAT, 6 * sizeof(GLfloat), ((GLfloat *) data) + 3);
- glEnableClientState( GL_NORMAL_ARRAY );
- }
-
- if (useList) {
- /* dumb, but a good test */
- glNewList(1,GL_COMPILE);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, numverts);
- glEndList();
- glCallList(1);
- }
- else {
- glDrawArrays(GL_TRIANGLE_STRIP, 0, numverts);
- }
-
- glDisableClientState( GL_VERTEX_ATTRIB_ARRAY0_NV );
- glDisableClientState( GL_VERTEX_ATTRIB_ARRAY2_NV);
- glDisableClientState( GL_VERTEX_ARRAY );
- glDisableClientState( GL_NORMAL_ARRAY );
- }
- else {
- int i;
- glBegin(GL_TRIANGLE_STRIP);
- for (i = 0; i < numverts; i++) {
- glNormal3fv( data[i] + 3 );
- glVertex3fv( data[i] + 0 );
- }
- glEnd();
- }
- glPopMatrix();
-
- if (glGetError())
- printf("Error!\n");
-
- glutSwapBuffers();
-}
-
-
-static void InitMaterials(void)
-{
- static float ambient[] = {0.1, 0.1, 0.1, 1.0};
- static float diffuse[] = {0.5, 1.0, 1.0, 1.0};
- static float position0[] = {0.0, 0.0, 20.0, 0.0};
- static float position1[] = {0.0, 0.0, -20.0, 0.0};
- static float front_mat_shininess[] = {60.0};
- static float front_mat_specular[] = {0.2, 0.2, 0.2, 1.0};
- static float front_mat_diffuse[] = {0.5, 0.28, 0.38, 1.0};
- /*
- static float back_mat_shininess[] = {60.0};
- static float back_mat_specular[] = {0.5, 0.5, 0.2, 1.0};
- static float back_mat_diffuse[] = {1.0, 1.0, 0.2, 1.0};
- */
- static float lmodel_ambient[] = {1.0, 1.0, 1.0, 1.0};
- static float lmodel_twoside[] = {GL_FALSE};
-
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT0, GL_POSITION, position0);
- glEnable(GL_LIGHT0);
-
- glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT1, GL_POSITION, position1);
- glEnable(GL_LIGHT1);
-
- glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
- glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_mat_shininess);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_mat_specular);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, front_mat_diffuse);
- glEnable(GL_LIGHTING);
-}
-
-
-static void init_program(void)
-{
- /*
- * c[0..3] = modelview matrix
- * c[4..7] = inverse modelview matrix
- * c[30] = color scale
- * c[31] = color bias
- */
- static const char prog[] =
- "!!VP1.0\n"
-
- "# RGB is proportional to XYZ \n"
-
- "MUL R0, v[OPOS], c[30]; \n"
- "ADD o[COL0], R0, c[31]; \n"
-
- "# Continue with typical modelview/projection\n"
- "MOV R3, v[OPOS]; \n"
- "DP4 o[HPOS].x, c[0], R3 ; # object x MVP -> clip\n"
- "DP4 o[HPOS].y, c[1], R3 ;\n"
- "DP4 o[HPOS].z, c[2], R3 ;\n"
- "DP4 o[HPOS].w, c[3], R3 ;\n"
-
- "END";
-
- static const GLfloat scale[4] = {2.0, 2.0, 2.0, 0.0};
- static const GLfloat bias[4] = {1.0, 1.0, 1.0, 0.0};
-
- if (!glutExtensionSupported("GL_NV_vertex_program")) {
- printf("Sorry, this program requires GL_NV_vertex_program");
- exit(1);
- }
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
- strlen(prog), (const GLubyte *) prog);
- assert(glIsProgramNV(1));
- glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1);
-
- /* Load the program registers */
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV);
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV);
-
- glProgramParameter4fvNV(GL_VERTEX_PROGRAM_NV, 30, scale);
- glProgramParameter4fvNV(GL_VERTEX_PROGRAM_NV, 31, bias);
-}
-
-
-static void init(void)
-{
- xrot = 0;
- yrot = 0;
- glClearColor(0.0, 0.0, 1.0, 0.0);
- glEnable( GL_DEPTH_TEST );
- glEnable(GL_NORMALIZE);
- InitMaterials();
- read_surface( "../demos/isosurf.dat" );
- init_program();
-}
-
-
-static void Reshape(int width, int height)
-{
- glViewport(0, 0, (GLint)width, (GLint)height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5, 25 );
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0, 0, -15);
-}
-
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- case 'a':
- useArrays = !useArrays;
- printf("use arrays: %s\n", useArrays ? "yes" : "no");
- break;
- case 'l':
- useList = !useList;
- printf("use list: %s\n", useList ? "yes" : "no");
- break;
- case 'p':
- useProgram = !useProgram;
- printf("use program: %s\n", useProgram ? "yes" : "no");
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_LEFT:
- yrot -= 15.0;
- break;
- case GLUT_KEY_RIGHT:
- yrot += 15.0;
- break;
- case GLUT_KEY_UP:
- xrot += 15.0;
- break;
- case GLUT_KEY_DOWN:
- xrot -= 15.0;
- break;
- default:
- return;
- }
- glutPostRedisplay();
-}
-
-
-
-int main(int argc, char **argv)
-{
- glutInit(&argc, argv);
- glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_DOUBLE );
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(400, 400);
- if (glutCreateWindow("Isosurface") <= 0) {
- exit(0);
- }
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutSpecialFunc(SpecialKey);
- glutDisplayFunc(Display);
-
- init();
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/vpeval.c b/progs/tests/vpeval.c
deleted file mode 100644
index 8b6996d3b5c..00000000000
--- a/progs/tests/vpeval.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Vertex program evaluators test.
- * Based on book/bezmesh.c
- *
- * Brian Paul
- * 22 June 2002
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-/*
- * Transform position by modelview/projection.
- * Square incoming color.
- */
-static const char prog[] =
-"!!VP1.0\n"
-
-"# Typical modelview/projection\n"
-"DP4 o[HPOS].x, c[0], v[OPOS] ; # object x MVP -> clip\n"
-"DP4 o[HPOS].y, c[1], v[OPOS] ;\n"
-"DP4 o[HPOS].z, c[2], v[OPOS] ;\n"
-"DP4 o[HPOS].w, c[3], v[OPOS] ;\n"
-
-"MOV R0, v[COL0];\n # square the color\n"
-"MUL R0, R0, R0;\n"
-"MOV o[COL0], R0;\n # store output color\n"
-
-"END";
-
-
-static int program = 1;
-
-
-GLfloat ctrlpoints[4][4][4] =
-{
- {
- {-1.5, -1.5, 4.0, 1.0},
- {-0.5, -1.5, 2.0, 1.0},
- {0.5, -1.5, -1.0, 1.0},
- {1.5, -1.5, 2.0, 1.0}},
- {
- {-1.5, -0.5, 1.0, 1.0},
- {-0.5, -0.5, 3.0, 1.0},
- {0.5, -0.5, 0.0, 1.0},
- {1.5, -0.5, -1.0, 1.0}},
- {
- {-1.5, 0.5, 4.0, 1.0},
- {-0.5, 0.5, 0.0, 1.0},
- {0.5, 0.5, 3.0, 1.0},
- {1.5, 0.5, 4.0, 1.0}},
- {
- {-1.5, 1.5, -2.0, 1.0},
- {-0.5, 1.5, -2.0, 1.0},
- {0.5, 1.5, 0.0, 1.0},
- {1.5, 1.5, -1.0, 1.0}}
-};
-
-/*
- * +-------------+
- * |green |yellow
- * | |
- * | |
- * |black |red
- * +-------------+
- */
-GLfloat colorPoints[4][4][4] =
-{
- {
- {0.0, 0.0, 0.0, 1.0},
- {0.3, 0.0, 0.0, 1.0},
- {0.6, 0.0, 0.0, 1.0},
- {1.0, 0.0, 0.0, 1.0}},
- {
- {0.0, 0.3, 0.0, 1.0},
- {0.3, 0.3, 0.0, 1.0},
- {0.6, 0.3, 0.0, 1.0},
- {1.0, 0.3, 0.0, 1.0}},
- {
- {0.0, 0.6, 0.0, 1.0},
- {0.3, 0.6, 0.0, 1.0},
- {0.6, 0.6, 0.0, 1.0},
- {1.0, 0.6, 0.0, 1.0}},
- {
- {0.0, 1.0, 0.0, 1.0},
- {0.3, 1.0, 0.0, 1.0},
- {0.6, 1.0, 0.0, 1.0},
- {1.0, 1.0, 0.0, 1.0}}
-};
-
-
-void
-initlights(void)
-{
- GLfloat ambient[] = {0.2, 0.2, 0.2, 1.0};
- GLfloat position[] = {0.0, 0.0, 2.0, 1.0};
- GLfloat mat_diffuse[] = {0.6, 0.6, 0.6, 1.0};
- GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
- GLfloat mat_shininess[] = {50.0};
-
-#if 0 /* no lighting for now */
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
-
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT0, GL_POSITION, position);
-
- glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
- glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
- glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
-#endif
-}
-
-void
-display(void)
-{
- glClearColor(.3, .3, .3, 0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glPushMatrix();
-#if 1
- glRotatef(85.0, 1.0, 1.0, 1.0);
-#endif
- glEvalMesh2(GL_FILL, 0, 8, 0, 8);
- glPopMatrix();
- glFlush();
-}
-
-void
-myinit(int argc, char *argv[])
-{
- glClearColor(0.0, 0.0, 0.0, 1.0);
- glEnable(GL_DEPTH_TEST);
-
- initlights(); /* for lighted version only */
-
- glMapGrid2f(8, 0.0, 1.0, 8, 0.0, 1.0);
-
- if (argc > 1)
- program = 0;
-
- printf("Using vertex program attribs? %s\n", program ? "yes" : "no");
-
- if (!program) {
- glMap2f(GL_MAP2_VERTEX_4,
- 0.0, 1.0, 4, 4,
- 0.0, 1.0, 16, 4, &ctrlpoints[0][0][0]);
- glMap2f(GL_MAP2_COLOR_4,
- 0.0, 1.0, 4, 4,
- 0.0, 1.0, 16, 4, &colorPoints[0][0][0]);
- glEnable(GL_MAP2_VERTEX_4);
- glEnable(GL_MAP2_COLOR_4);
- /*
- glEnable(GL_AUTO_NORMAL);
- glEnable(GL_NORMALIZE);
- */
- }
- else {
- glMap2f(GL_MAP2_VERTEX_ATTRIB0_4_NV,
- 0.0, 1.0, 4, 4,
- 0.0, 1.0, 16, 4, &ctrlpoints[0][0][0]);
- glMap2f(GL_MAP2_VERTEX_ATTRIB3_4_NV,
- 0.0, 1.0, 4, 4,
- 0.0, 1.0, 16, 4, &colorPoints[0][0][0]);
- glEnable(GL_MAP2_VERTEX_ATTRIB0_4_NV);
- glEnable(GL_MAP2_VERTEX_ATTRIB3_4_NV);
-
- /*
- glEnable(GL_AUTO_NORMAL);
- glEnable(GL_NORMALIZE);
- */
-
- /* vertex program init */
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
- strlen(prog), (const GLubyte *) prog);
- assert(glIsProgramNV(1));
- glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1);
-
- /* track matrices */
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV);
- glEnable(GL_VERTEX_PROGRAM_NV);
- }
-}
-
-void
-myReshape(int w, int h)
-{
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- if (w <= h)
- glOrtho(-4.0, 4.0, -4.0 * (GLfloat) h / (GLfloat) w,
- 4.0 * (GLfloat) h / (GLfloat) w, -4.0, 4.0);
- else
- glOrtho(-4.0 * (GLfloat) w / (GLfloat) h,
- 4.0 * (GLfloat) w / (GLfloat) h, -4.0, 4.0, -4.0, 4.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-static void
-key(unsigned char k, int x, int y)
-{
- switch (k) {
- case 27: /* Escape */
- exit(0);
- break;
- default:
- return;
- }
- glutPostRedisplay();
-}
-
-int
-main(int argc, char **argv)
-{
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
- glutInitWindowPosition(0, 0);
- glutCreateWindow(argv[0]);
- myinit(argc, argv);
- glutReshapeFunc(myReshape);
- glutDisplayFunc(display);
- glutKeyboardFunc(key);
- glutMainLoop();
- return 0; /* ANSI C requires main to return int. */
-}
diff --git a/progs/tests/vptest1.c b/progs/tests/vptest1.c
deleted file mode 100644
index 560df2c3fdc..00000000000
--- a/progs/tests/vptest1.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
-
- glBegin(GL_POLYGON);
- glVertexAttrib2fNV(0, -1, -1);
- glVertexAttrib2fNV(0, 1, -1);
- glVertexAttrib2fNV(0, 0, 1);
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- static const char *prog1 =
- "!!VP1.0\n"
- "MUL o[COL0].xyz, R0, c[35]; \n"
- "END\n";
- static const char *prog2 =
- "!!VP1.0\n"
- "#\n"
- "# c[0-3] = modelview projection (composite) matrix\n"
- "# c[32] = normalized light direction in object-space\n"
- "# c[35] = yellow diffuse material, (1.0, 1.0, 0.0, 1.0)\n"
- "# c[64].x = 0.0\n"
- "# c[64].z = 0.125, a scaling factor\n"
- "#\n"
- "# outputs diffuse illumination for color and perturbed position\n"
- "#\n"
- "DP3 R0, c[32], v[NRML]; # light direction DOT normal\n"
- "MUL o[COL0].xyz, R0, c[35]; \n"
- "MAX R0, c[64].x, R0; \n"
- "MUL R0, R0, v[NRML]; \n"
- "MUL R0, R0, c[64].z; \n"
- "ADD R1, v[OPOS], -R0; # perturb object space position\n"
- "DP4 o[HPOS].x, c[0], R1; \n"
- "DP4 o[HPOS].y, c[1], R1; \n"
- "DP4 o[HPOS].z, c[2], R1; \n"
- "DP4 o[HPOS].w, c[3], R1; \n"
- "END\n";
- static const char *prog3 =
- "!!VP1.0\n"
- "DP4 o[HPOS].x, c[0], v[OPOS];\n"
- "DP4 o[HPOS].y, c[1], v[OPOS];\n"
- "DP4 o[HPOS].z, c[2], v[OPOS];\n"
- "DP4 o[HPOS].w, c[3], v[OPOS];\n"
- "DP3 R0.x, c[4], v[NRML];\n"
- "DP3 R0.y, c[5], v[NRML]; \n"
- "DP3 R0.z, c[6], v[NRML]; # R0 = n' = transformed normal\n"
- "DP3 R1.x, c[32], R0; # R1.x = Lpos DOT n'\n"
- "DP3 R1.y, c[33], R0; # R1.y = hHat DOT n'\n"
- "MOV R1.w, c[38].x; # R1.w = specular power\n"
- "LIT R2, R1; # Compute lighting values\n"
- "MAD R3, c[35].x, R2.y, c[35].y; # diffuse + emissive\n"
- "MAD o[COL0].xyz, c[36], R2.z, R3; # + specular\n"
- "END\n";
- static const char *prog4 =
- "!!VP1.0\n"
- "DP4 R2, R3, c[A0.x];\n"
- "DP4 R2, R3, c[A0.x + 5];\n"
- "DP4 o[HPOS], R3, c[A0.x - 4];\n"
- "END\n";
- static const char *prog5 =
- "!!VSP1.0\n"
- "DP4 R2, R3, c[A0.x];\n"
- "DP4 R2, R3, v[0];\n"
- "DP4 c[3], R3, R2;\n"
- "END\n";
-
-
- GLuint progs[5];
-
- glGenProgramsNV(2, progs);
- assert(progs[0]);
- assert(progs[1]);
- assert(progs[0] != progs[1]);
-
- glGenProgramsNV(3, progs + 2);
- assert(progs[2]);
- assert(progs[3]);
- assert(progs[2] != progs[3]);
- assert(progs[0] != progs[2]);
-
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
- strlen(prog1),
- (const GLubyte *) prog1);
- assert(!glIsProgramNV(1));
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 2,
- strlen(prog2),
- (const GLubyte *) prog2);
- assert(glIsProgramNV(2));
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 3,
- strlen(prog3),
- (const GLubyte *) prog3);
- assert(glIsProgramNV(3));
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 4,
- strlen(prog4),
- (const GLubyte *) prog4);
- assert(glIsProgramNV(4));
-
- glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 5,
- strlen(prog5),
- (const GLubyte *) prog5);
- assert(glIsProgramNV(5));
-
- printf("glGetError = %d\n", (int) glGetError());
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/vptest2.c b/progs/tests/vptest2.c
deleted file mode 100644
index 2158e07f042..00000000000
--- a/progs/tests/vptest2.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Test vertex state program execution */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
- glPushMatrix();
- glutSolidCube(2.0);
- glPopMatrix();
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Test1( void )
-{
- static const GLfloat p[4] = {9, 8, 7, 6};
- GLfloat q[4];
- /* test addition */
- static const char *prog =
- "!!VSP1.0\n"
- "MOV R0, c[0];\n"
- "MOV R1, c[1];\n"
- "ADD c[2], R0, R1;\n"
- "END\n";
-
- glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1,
- strlen(prog),
- (const GLubyte *) prog);
- assert(glIsProgramNV(1));
-
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 0, 1, 2, 3, 4);
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 1, 10, 20, 30, 40);
-
- glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, p);
-
- glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 2, GL_PROGRAM_PARAMETER_NV, q);
- printf("Result c[2] = %g %g %g %g (should be 11 22 33 44)\n",
- q[0], q[1], q[2], q[3]);
-}
-
-
-static void Test2( void )
-{
- static const GLfloat p[4] = {9, 8, 7, 6};
- GLfloat q[4];
- /* test swizzling */
- static const char *prog =
- "!!VSP1.0\n"
- "MOV R0, c[0].wzyx;\n"
- "MOV R1, c[1].wzyx;\n"
- "ADD c[2], R0, R1;\n"
- "END\n";
-
- glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1,
- strlen(prog),
- (const GLubyte *) prog);
- assert(glIsProgramNV(1));
-
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 0, 1, 2, 3, 4);
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 1, 10, 20, 30, 40);
-
- glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, p);
-
- glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 2, GL_PROGRAM_PARAMETER_NV, q);
- printf("Result c[2] = %g %g %g %g (should be 44 33 22 11)\n",
- q[0], q[1], q[2], q[3]);
-}
-
-
-static void Test3( void )
-{
- static const GLfloat p[4] = {0, 0, 0, 0};
- GLfloat q[4];
- /* normalize vector */
- static const char *prog =
- "!!VSP1.0\n"
- "# c[0] = (nx,ny,nz)\n"
- "# R0.xyz = normalize(R1)\n"
- "# R0.w = 1/sqrt(nx*nx + ny*ny + nz*nz)\n"
- "# c[2] = R0\n"
- "DP3 R0.w, c[0], c[0];\n"
- "RSQ R0.w, R0.w;\n"
- "MUL R0.xyz, c[0], R0.w;\n"
- "MOV c[2], R0;\n"
- "END\n";
-
- glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1,
- strlen(prog),
- (const GLubyte *) prog);
- assert(glIsProgramNV(1));
-
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 0, 0, 10, 0, 0);
-
- glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, p);
-
- glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 2, GL_PROGRAM_PARAMETER_NV, q);
- printf("Result c[2] = %g %g %g %g (should be 0, 1, 0, 0.1)\n",
- q[0], q[1], q[2], q[3]);
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 50, 50 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Test1();
- Test2();
- Test3();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/vptest3.c b/progs/tests/vptest3.c
deleted file mode 100644
index 2c5c8000408..00000000000
--- a/progs/tests/vptest3.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static float Zrot = 0.0;
-
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_VERTEX_PROGRAM_NV);
-
- glLoadIdentity();
- glRotatef(Zrot, 0, 0, 1);
-
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW, GL_IDENTITY_NV);
- glPushMatrix();
-
- glVertexAttrib3fNV(3, 1, 0.5, 0.25);
- glBegin(GL_TRIANGLES);
-#if 1
- glVertexAttrib3fNV(3, 1.0, 0.0, 0.0);
- glVertexAttrib2fNV(0, -0.5, -0.5);
- glVertexAttrib3fNV(3, 0.0, 1.0, 0.0);
- glVertexAttrib2fNV(0, 0.5, -0.5);
- glVertexAttrib3fNV(3, 0.0, 0.0, 1.0);
- glVertexAttrib2fNV(0, 0, 0.5);
-#else
- glVertex2f( -1, -1);
- glVertex2f( 1, -1);
- glVertex2f( 0, 1);
-#endif
- glEnd();
-
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- /* glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );*/
- glOrtho(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'z':
- Zrot -= 5.0;
- break;
- case 'Z':
- Zrot += 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- static const char *prog1 =
- "!!VP1.0\n"
- "MOV o[COL0], v[COL0];\n"
-#if 0
- "MOV o[HPOS], v[OPOS];\n"
-#else
- "DP4 o[HPOS].x, v[OPOS], c[0];\n"
- "DP4 o[HPOS].y, v[OPOS], c[1];\n"
- "DP4 o[HPOS].z, v[OPOS], c[2];\n"
- "DP4 o[HPOS].w, v[OPOS], c[3];\n"
-#endif
- "END\n";
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
- strlen(prog1),
- (const GLubyte *) prog1);
- assert(glIsProgramNV(1));
-
- glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1);
-
- printf("glGetError = %d\n", (int) glGetError());
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/vptorus.c b/progs/tests/vptorus.c
deleted file mode 100644
index 764dea4ec22..00000000000
--- a/progs/tests/vptorus.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * A lit, rotating torus via vertex program
- */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
-static GLboolean Anim = GL_TRUE;
-
-
-static void Idle( void )
-{
- Xrot += .3;
- Yrot += .4;
- Zrot += .2;
- glutPostRedisplay();
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
- glutSolidTorus(0.75, 2.0, 10, 20);
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -12.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case ' ':
- Xrot = Yrot = Zrot = 0;
- break;
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'z':
- Zrot -= 5.0;
- break;
- case 'Z':
- Zrot += 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- /* borrowed from an nvidia demo:
- * c[0..3] = modelview matrix
- * c[4..7] = inverse modelview matrix
- * c[32] = light pos
- * c[35] = diffuse color
- */
- static const char prog[] =
- "!!VP1.0\n"
- "#Simple transform and diffuse lighting\n"
- "\n"
- "DP4 o[HPOS].x, c[0], v[OPOS] ; # object x MVP -> clip\n"
- "DP4 o[HPOS].y, c[1], v[OPOS] ;\n"
- "DP4 o[HPOS].z, c[2], v[OPOS] ;\n"
- "DP4 o[HPOS].w, c[3], v[OPOS] ;\n"
-
- "DP3 R1.x, c[4], v[NRML] ; # normal x MV-1T -> lighting normal\n"
- "DP3 R1.y, c[5], v[NRML] ;\n"
- "DP3 R1.z, c[6], v[NRML] ;\n"
-
- "DP3 R0, c[32], R1 ; # L.N\n"
- "MUL o[COL0].xyz, R0, c[35] ; # col = L.N * diffuse\n"
- "MOV o[TEX0], v[TEX0];\n"
- "END";
-
- if (!glutExtensionSupported("GL_NV_vertex_program")) {
- printf("Sorry, this program requires GL_NV_vertex_program");
- exit(1);
- }
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
- strlen(prog), (const GLubyte *) prog);
- assert(glIsProgramNV(1));
- glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1);
-
- /* Load the program registers */
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV);
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV);
-
- /* Light position */
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 32, 2, 2, 4, 1);
- /* Diffuse material color */
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 35, 0.25, 0, 0.25, 1);
-
- glEnable(GL_VERTEX_PROGRAM_NV);
- glEnable(GL_DEPTH_TEST);
- glClearColor(0.3, 0.3, 0.3, 1);
-
- printf("glGetError = %d\n", (int) glGetError());
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/vpwarpmesh.c b/progs/tests/vpwarpmesh.c
deleted file mode 100644
index 56aa8200ec8..00000000000
--- a/progs/tests/vpwarpmesh.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Warp a triangle mesh with a vertex program.
- */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
-static GLboolean Anim = GL_TRUE;
-static GLfloat Phi = 0.0;
-
-
-static void Idle( void )
-{
- Phi += 0.01;
- glutPostRedisplay();
-}
-
-
-static void DrawMesh( int rows, int cols )
-{
- static const GLfloat colorA[3] = { 0, 1, 0 };
- static const GLfloat colorB[3] = { 0, 0, 1 };
- const float dx = 2.0 / (cols - 1);
- const float dy = 2.0 / (rows - 1);
- float x, y;
- int i, j;
-
-#if 1
-#define COLOR3FV(c) glVertexAttrib3fvNV(3, c)
-#define VERTEX2F(x, y) glVertexAttrib2fNV(0, x, y)
-#else
-#define COLOR3FV(c) glColor3fv(c)
-#define VERTEX2F(x, y) glVertex2f(x, y)
-#endif
-
- y = -1.0;
- for (i = 0; i < rows - 1; i++) {
- glBegin(GL_QUAD_STRIP);
- x = -1.0;
- for (j = 0; j < cols; j++) {
- if ((i + j) & 1)
- COLOR3FV(colorA);
- else
- COLOR3FV(colorB);
- VERTEX2F(x, y);
- VERTEX2F(x, y + dy);
- x += dx;
- }
- glEnd();
- y += dy;
- }
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1, 0, 0);
- glRotatef(Yrot, 0, 1, 0);
- glRotatef(Zrot, 0, 0, 1);
-
- /* Position the gravity source */
- {
- GLfloat x, y, z, r = 0.5;
- x = r * cos(Phi);
- y = r * sin(Phi);
- z = 1.0;
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 30, x, y, z, 1);
- glDisable(GL_VERTEX_PROGRAM_NV);
- glBegin(GL_POINTS);
- glColor3f(1,1,1);
- glVertex3f(x, y, z);
- glEnd();
- }
-
- glEnable(GL_VERTEX_PROGRAM_NV);
- DrawMesh(8, 8);
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- float ar = (float) width / (float) height;
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0 * ar, 1.0 * ar, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -12.0 );
- glScalef(2, 2, 2);
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 'a':
- Anim = !Anim;
- if (Anim)
- glutIdleFunc(Idle);
- else
- glutIdleFunc(NULL);
- break;
- case 'p':
- Phi += 0.2;
- break;
- case 'z':
- Zrot -= 5.0;
- break;
- case 'Z':
- Zrot += 5.0;
- break;
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- const GLfloat step = 3.0;
- (void) x;
- (void) y;
- switch (key) {
- case GLUT_KEY_UP:
- Xrot -= step;
- break;
- case GLUT_KEY_DOWN:
- Xrot += step;
- break;
- case GLUT_KEY_LEFT:
- Yrot -= step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot += step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init( void )
-{
- /*
- * c[0..3] = modelview matrix
- * c[4..7] = inverse modelview matrix
- * c[30] = gravity source location
- * c[31] = gravity source strength
- * c[32] = light pos
- * c[35] = diffuse color
- */
- static const char prog[] =
- "!!VP1.0\n"
-
- "# Compute distance from vertex to gravity source\n"
- "ADD R1, c[30], -v[OPOS]; # vector from vertex to gravity\n"
- "DP3 R2, R1, R1; # dot product\n"
- "RSQ R2, R2.x; # square root = distance\n"
- "MUL R2, R2, c[31].xxxx; # scale by the gravity factor\n"
-
- "# Displace vertex by gravity factor along R1 vector\n"
- "MAD R3, R1, R2, v[OPOS];\n"
-
- "# Continue with typical modelview/projection\n"
- "DP4 o[HPOS].x, c[0], R3 ; # object x MVP -> clip\n"
- "DP4 o[HPOS].y, c[1], R3 ;\n"
- "DP4 o[HPOS].z, c[2], R3 ;\n"
- "DP4 o[HPOS].w, c[3], R3 ;\n"
-
- "MOV o[COL0], v[COL0];\n # copy input color to output color\n"
-
- "END";
-
- if (!glutExtensionSupported("GL_NV_vertex_program")) {
- printf("Sorry, this program requires GL_NV_vertex_program\n");
- exit(1);
- }
-
- glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
- strlen(prog), (const GLubyte *) prog);
- assert(glIsProgramNV(1));
- glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1);
-
- /* Load the program registers */
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV);
- glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV);
-
- /* Light position */
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 32, 2, 2, 4, 1);
- /* Diffuse material color */
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 35, 0.25, 0, 0.25, 1);
-
- /* Gravity strength */
- glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 31, .5, 0, 0, 0);
-
- glEnable(GL_DEPTH_TEST);
- glClearColor(0.3, 0.3, 0.3, 1);
- glShadeModel(GL_FLAT);
- glPointSize(3);
- printf("glGetError = %d\n", (int) glGetError());
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
- if (Anim)
- glutIdleFunc(Idle);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/yuvrect.c b/progs/tests/yuvrect.c
deleted file mode 100644
index acef4060970..00000000000
--- a/progs/tests/yuvrect.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Test the GL_NV_texture_rectangle and GL_MESA_ycrcb_texture extensions.
- *
- * Brian Paul 13 September 2002
- */
-
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-#include "../util/readtex.c" /* I know, this is a hack. */
-
-#define TEXTURE_FILE "../images/girl.rgb"
-
-static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
-static GLint ImgWidth, ImgHeight;
-static GLushort *ImageYUV = NULL;
-
-
-static void DrawObject(void)
-{
- glBegin(GL_QUADS);
-
- glTexCoord2f(0, 0);
- glVertex2f(-1.0, -1.0);
-
- glTexCoord2f(ImgWidth, 0);
- glVertex2f(1.0, -1.0);
-
- glTexCoord2f(ImgWidth, ImgHeight);
- glVertex2f(1.0, 1.0);
-
- glTexCoord2f(0, ImgHeight);
- glVertex2f(-1.0, 1.0);
-
- glEnd();
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- DrawObject();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-static void Init( int argc, char *argv[] )
-{
- GLuint texObj = 100;
- const char *file;
-
- if (!glutExtensionSupported("GL_NV_texture_rectangle")) {
- printf("Sorry, GL_NV_texture_rectangle is required\n");
- exit(0);
- }
-
- if (!glutExtensionSupported("GL_MESA_ycbcr_texture")) {
- printf("Sorry, GL_MESA_ycbcr_texture is required\n");
- exit(0);
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- glBindTexture(GL_TEXTURE_RECTANGLE_NV, texObj);
-#ifdef LINEAR_FILTER
- /* linear filtering looks much nicer but is much slower for Mesa */
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-#else
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-#endif
-
- if (argc > 1)
- file = argv[1];
- else
- file = TEXTURE_FILE;
-
- ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight);
- if (!ImageYUV) {
- printf("Couldn't read %s\n", TEXTURE_FILE);
- exit(0);
- }
-
- printf("Image: %dx%d\n", ImgWidth, ImgHeight);
-
- glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0,
- GL_YCBCR_MESA, ImgWidth, ImgHeight, 0,
- GL_YCBCR_MESA, GL_UNSIGNED_SHORT_8_8_MESA, ImageYUV);
-
- assert(glGetError() == GL_NO_ERROR);
- glTexSubImage2D(GL_TEXTURE_RECTANGLE_NV, 0,
- 0, 0, ImgWidth, ImgHeight,
- GL_YCBCR_MESA, GL_UNSIGNED_SHORT_8_8_MESA, ImageYUV);
-
- assert(glGetError() == GL_NO_ERROR);
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- glEnable(GL_TEXTURE_RECTANGLE_NV);
-
- glShadeModel(GL_FLAT);
- glClearColor(0.3, 0.3, 0.4, 1.0);
-
- if (argc > 1 && strcmp(argv[1], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowSize( 300, 300 );
- glutInitWindowPosition( 0, 0 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0] );
-
- Init( argc, argv );
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/yuvsquare.c b/progs/tests/yuvsquare.c
deleted file mode 100644
index 3601e7a31c7..00000000000
--- a/progs/tests/yuvsquare.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Test the GL_NV_texture_rectangle and GL_MESA_ycrcb_texture extensions.
- *
- * Brian Paul 13 September 2002
- */
-
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-#include "../util/readtex.c" /* I know, this is a hack. */
-
-#define TEXTURE_FILE "../images/tile.rgb"
-
-static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
-static GLint ImgWidth, ImgHeight;
-static GLushort *ImageYUV = NULL;
-static GLubyte *ImageRGB = NULL;
-static const GLuint yuvObj = 100;
-static const GLuint rgbObj = 101;
-
-
-static void DrawObject(void)
-{
- glBegin(GL_QUADS);
-
- glTexCoord2f(0, 0);
- glVertex2f(-1.0, -1.0);
-
- glTexCoord2f(1, 0);
- glVertex2f(1.0, -1.0);
-
- glTexCoord2f(1, 1);
- glVertex2f(1.0, 1.0);
-
- glTexCoord2f(0, 1);
- glVertex2f(-1.0, 1.0);
-
- glEnd();
-}
-
-
-static void Display( void )
-{
- glClear( GL_COLOR_BUFFER_BIT );
-
- glPushMatrix();
- glTranslatef( -1.1, 0.0, -15.0 );
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glBindTexture(GL_TEXTURE_2D, yuvObj);
- DrawObject();
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef( 1.1, 0.0, -15.0 );
- glRotatef(Xrot, 1.0, 0.0, 0.0);
- glRotatef(Yrot, 0.0, 1.0, 0.0);
- glRotatef(Zrot, 0.0, 0.0, 1.0);
- glBindTexture(GL_TEXTURE_2D, rgbObj);
- DrawObject();
- glPopMatrix();
-
- glutSwapBuffers();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.1, 1.1, -1.1, 1.1, 10.0, 100.0 );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void SpecialKey( int key, int x, int y )
-{
- float step = 3.0;
- (void) x;
- (void) y;
-
- switch (key) {
- case GLUT_KEY_UP:
- Xrot += step;
- break;
- case GLUT_KEY_DOWN:
- Xrot -= step;
- break;
- case GLUT_KEY_LEFT:
- Yrot += step;
- break;
- case GLUT_KEY_RIGHT:
- Yrot -= step;
- break;
- }
- glutPostRedisplay();
-}
-
-
-#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
-
-
-
-/* #define LINEAR_FILTER */
-
-static void Init( int argc, char *argv[] )
-{
- const char *file;
- GLenum format;
-
- if (!glutExtensionSupported("GL_MESA_ycbcr_texture")) {
- printf("Sorry, GL_MESA_ycbcr_texture is required\n");
- exit(0);
- }
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- if (argc > 1)
- file = argv[1];
- else
- file = TEXTURE_FILE;
-
- /* First load the texture as YCbCr.
- */
-
- glBindTexture(GL_TEXTURE_2D, yuvObj);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight );
- if (!ImageYUV) {
- printf("Couldn't read %s\n", TEXTURE_FILE);
- exit(0);
- }
-
- printf("Image: %dx%d\n", ImgWidth, ImgHeight);
-
-
- glTexImage2D(GL_TEXTURE_2D, 0,
- GL_YCBCR_MESA,
- ImgWidth, ImgHeight, 0,
- GL_YCBCR_MESA,
- GL_UNSIGNED_SHORT_8_8_MESA, ImageYUV);
-
- glEnable(GL_TEXTURE_2D);
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
-
-
- /* Now load the texture as RGB.
- */
-
- glBindTexture(GL_TEXTURE_2D, rgbObj);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- ImageRGB = LoadRGBImage(file, &ImgWidth, &ImgHeight, &format );
- if (!ImageRGB) {
- printf("Couldn't read %s\n", TEXTURE_FILE);
- exit(0);
- }
-
- printf("Image: %dx%d\n", ImgWidth, ImgHeight);
-
-
- glTexImage2D(GL_TEXTURE_2D, 0,
- format,
- ImgWidth, ImgHeight, 0,
- format,
- GL_UNSIGNED_BYTE, ImageRGB);
-
- glEnable(GL_TEXTURE_2D);
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
-
-
- glShadeModel(GL_FLAT);
- glClearColor(0.3, 0.3, 0.4, 1.0);
-
- if (argc > 1 && strcmp(argv[1], "-info")==0) {
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
- }
-
- printf( "Both images should appear the same.\n" );
-}
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowSize( 300, 300 );
- glutInitWindowPosition( 0, 0 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0] );
-
- Init( argc, argv );
-
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
-
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tests/zreaddraw.c b/progs/tests/zreaddraw.c
deleted file mode 100644
index e2dacbf7f2f..00000000000
--- a/progs/tests/zreaddraw.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Test glRead/DrawPixels for GL_DEPTH_COMPONENT, with pixelzoom.
- *
- * Brian Paul
- * 23 August 2003
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static GLint WinWidth = 500, WinHeight = 500;
-
-
-static void Display(void)
-{
- GLfloat depth[100 * 100];
- GLfloat depth2[400 * 400];
- GLfloat min, max;
- int i;
-
- glClearColor(0.5, 0.5, 0.5, 0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- /* draw a sphere */
- glViewport(0, 0, 100, 100);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1, 1, -1, 1, -1, 0); /* clip away back half of sphere */
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glutSolidSphere(1.0, 20, 10);
-
- /* read the depth image */
- glReadPixels(0, 0, 100, 100, GL_DEPTH_COMPONENT, GL_FLOAT, depth);
- min = max = depth[0];
- for (i = 1; i < 100 * 100; i++) {
- if (depth[i] < min)
- min = depth[i];
- if (depth[i] > max)
- max = depth[i];
- }
- printf("Depth value range: [%f, %f]\n", min, max);
-
- /* draw depth image with scaling (into z buffer) */
- glPixelZoom(4.0, 4.0);
- glWindowPos2i(100, 0);
- glDrawPixels(100, 100, GL_DEPTH_COMPONENT, GL_FLOAT, depth);
-
- /* read back scaled depth image */
- glReadPixels(100, 0, 400, 400, GL_DEPTH_COMPONENT, GL_FLOAT, depth2);
- /* draw as luminance */
- glPixelZoom(1.0, 1.0);
- glDrawPixels(400, 400, GL_LUMINANCE, GL_FLOAT, depth2);
-
- glutSwapBuffers();
-}
-
-
-static void Reshape(int width, int height)
-{
- WinWidth = width;
- WinHeight = height;
- glViewport(0, 0, width, height);
-}
-
-
-static void Key(unsigned char key, int x, int y)
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-static void Init(void)
-{
- const GLfloat blue[4] = {.1, .1, 1.0, 0.0};
- const GLfloat gray[4] = {0.2, 0.2, 0.2, 1.0};
- const GLfloat white[4] = {1.0, 1.0, 1.0, 1.0};
- const GLfloat pos[4] = {0, 0, 10, 0};
-
- printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, blue);
- glLightfv(GL_LIGHT0, GL_AMBIENT, gray);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, white);
- glLightfv(GL_LIGHT0, GL_POSITION, pos);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-}
-
-
-int main(int argc, char *argv[])
-{
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(WinWidth, WinHeight);
- glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
- glutCreateWindow(argv[0]);
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Display);
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/tools/trace/Makefile b/progs/tools/trace/Makefile
deleted file mode 100644
index 3f7bdcbc935..00000000000
--- a/progs/tools/trace/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# Makefile for Thomas Sondergaard's API tracer
-
-TOP = ../../..
-
-include $(TOP)/configs/current
-
-
-OBJECTS = gltrace.o gltrace_support.o
-
-TRACER = gltrace.so
-
-.cc.o:
- $(CXX) -c $(INCDIRS) $(CXXFLAGS) $< -o $@
-
-
-default: $(TRACER)
-
-$(TRACER): $(OBJECTS)
- $(TOP)/bin/mklib -o $(TRACER) -noprefix -cplusplus \
- $(MKLIB_OPTIONS) $(OBJECTS)
-
-gltrace.cc: gltrace.py
- PYTHONPATH=$(TOP)/src/mesa/glapi python gltrace.py -f $(TOP)/src/mesa/glapi/gl_API.xml > gltrace.cc
-
-
-clean:
- rm -f $(OBJECTS)
- rm -f $(TRACER)
- rm -f *~
- rm -f gltrace.cc
diff --git a/progs/tools/trace/README b/progs/tools/trace/README
deleted file mode 100644
index 7b3141dba7b..00000000000
--- a/progs/tools/trace/README
+++ /dev/null
@@ -1,23 +0,0 @@
-NAME
- gltrace - trace opengl calls
-
-SYNOPSIS
- gltrace [OPTION] command [arg ...]
-
-DESCRIPTION
- -h help (this text)
- -c log gl calls
- -t time stamp log entries
- -e check for and log errors. errors occurring between
- glBegin() and glEnd() are checked at glEnd()
- -v verbose. Shows configuration settings passed to
- gltrace.so
- -l LOGFILE logfile. Default is stderr
-
-PROBLEMS
- Not all OpenGL extensions are known and traced by gltrace. Extension
- functions not initialized using glXGetProcAddress(ARB) will not be
- traced.
-
-AUTHOR
- Thomas Sondergaard (ts_news1 'at' sondergaard.cc)
diff --git a/progs/tools/trace/gltrace b/progs/tools/trace/gltrace
deleted file mode 100755
index d386912cf25..00000000000
--- a/progs/tools/trace/gltrace
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/bash
-
-# Copyright (C) 2006 Thomas Sondergaard
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to 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:
-# Thomas Sondergaard <ts@medical-insight.com>
-
-usage="usage: $0 [ -hctev ] [-l LOGFILE] program [args...]\n\t-h\t\thelp (this text)\n\t-c\t\tlog gl calls\n\t-t\t\ttime stamp log entries\n\t-e\t\tcheck for and log errors. errors occurring between\n\t\t\tglBegin() and glEnd() are checked at glEnd()\n\t-v\t\tverbose. Shows configuration settings passed to\n\t\t\tgltrace.so\n\t-l LOGFILE\tlogfile. Default is stderr"
-
-# Path to gltrace.so - must not be relative
-#GLTRACE_SO=/home/ts/Mesa_gltrace/src/mesa/glapi/gltrace.so
-# This seems to work:
-GLTRACE_SO=./gltrace.so
-
-# Set options from command line
-
-VERBOSE=0
-GLTRACE_LOG_CALLS=0
-GLTRACE_LOG_TIME=0
-GLTRACE_CHECK_ERRORS=0
-export GLTRACE_LOG_CALLS GLTRACE_LOG_TIME GLTRACE_CHECK_ERRORS
-
-if [ $# -eq 0 ]; then
- echo -e $usage
- exit
-fi
-
-while getopts "hctevl:" options; do
- case $options in
- h) echo -e $usage
- exit 1;;
- c) GLTRACE_LOG_CALLS=1;;
- t) GLTRACE_LOG_TIME=1;;
- e) GLTRACE_CHECK_ERRORS=1;;
- l) GLTRACE_LOGFILE=$OPTARG
- export GLTRACE_LOGFILE;;
- v) VERBOSE=1;;
- *) echo -e $usage
- exit 1;;
- esac
-done
-
-# Remove the parsed args
-shift $(($OPTIND-1))
-
-if [ ! -r $GLTRACE_SO ]; then
- echo "Error: The gltrace.so file '$GLTRACE_SO' is missing!"
- exit 1
-fi
-
-export LD_PRELOAD=$GLTRACE_SO
-
-if [ $VERBOSE -eq 1 ]; then
- echo GLTRACE_LOG_CALLS=$GLTRACE_LOG_CALLS
- echo GLTRACE_LOG_TIME=$GLTRACE_LOG_TIME
- echo GLTRACE_CHECK_ERRORS=$GLTRACE_CHECK_ERRORS
- echo GLTRACE_LOGFILE=$GLTRACE_LOGFILE
- echo LD_PRELOAD=$LD_PRELOAD
- echo command=$*
-fi
-
-exec $*
diff --git a/progs/tools/trace/gltrace.py b/progs/tools/trace/gltrace.py
deleted file mode 100644
index 973881ac94d..00000000000
--- a/progs/tools/trace/gltrace.py
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2006 Thomas Sondergaard
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to 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:
-# Thomas Sondergaard <ts@medical-insight.com>
-
-import gl_XML, glX_XML, glX_proto_common, license
-import sys, getopt, copy, string
-
-def create_argument_string(parameters):
- """Create a parameter string from a list of gl_parameters."""
-
- list = []
- for p in parameters:
- list.append( p.name )
- #if len(list) == 0: list = ["void"]
-
- return string.join(list, ", ")
-
-def create_logfunc_string(func, name):
- """Create a parameter string from a list of gl_parameters."""
-
- list = []
- list.append('"gl' + name + '("')
- sep = None
- for p in func.parameters:
- if (sep):
- list.append(sep)
- list.append( p.name )
- sep = '", "'
- list.append('");"')
- #if len(list) == 0: list = ["void"]
-
- return "if (config.logCalls) GLTRACE_LOG(" + string.join(list, " << ")+");";
-
-class PrintGltrace(glX_proto_common.glx_print_proto): #(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "gltrace.py"
- 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
- * gl and glX wrappers for tracing
- *
- * \\author Thomas Sondergaard <ts@medical-insight.com>
- */
-"""
- #self.printVisibility( "HIDDEN", "hidden" )
- #self.printFastcall()
- #self.printNoinline()
-
- print """
-#include <GL/gl.h>
-#include <GL/glx.h>
-#include <GL/glu.h>
-#include <dlfcn.h>
-#include "gltrace_support.h"
-
-using namespace gltrace;
-
-static GLenum real_glGetError() {
- static GLenum (*real_func)(void) = 0;
- if (!real_func) real_func = (GLenum (*)(void)) dlsym(RTLD_NEXT, "glGetError");
- return real_func();
-}
-
-bool betweenGLBeginEnd = false;
-
-extern "C" {
-
-
-__GLXextFuncPtr real_glXGetProcAddressARB(const GLubyte *func_name) {
- static __GLXextFuncPtr (*real_func)(const GLubyte *func_name) = 0;
- if (!real_func) real_func = (__GLXextFuncPtr (*)(const GLubyte *func_name)) dlsym(RTLD_NEXT, "glXGetProcAddressARB");
-
- return real_func(func_name);
-}
-
-__GLXextFuncPtr glXGetProcAddressARB(const GLubyte *func_name_ubyte) {
- std::string func_name =
- std::string("gltrace_")+reinterpret_cast<const char*>(func_name_ubyte);
-
- __GLXextFuncPtr f = (__GLXextFuncPtr) dlsym(RTLD_DEFAULT, func_name.c_str());
- if (!f) {
- GLTRACE_LOG("warning: Could not resolve '" << func_name << "' - function will not be intercepted");
- return real_glXGetProcAddressARB(func_name_ubyte);
- }
- return f;
-}
-
-"""
-
- def printRealFooter(self):
- print "} // Extern \"C\""
-
- def printBody(self, api):
- for func in api.functionIterateGlx():
- for func_name in func.entry_points:
- functionPrefix = ""
- use_dlsym = True
- if (api.get_category_for_name(func.name)[1] != None):
- functionPrefix = "gltrace_"
- use_dlsym = False
-
- print '%s %sgl%s(%s) {' % (func.return_type, functionPrefix, func_name, func.get_parameter_string())
- if (use_dlsym):
- print ' static %s (*real_func)(%s) = 0;' % (func.return_type, func.get_parameter_string())
- print ' if (!real_func) real_func = (%s (*)(%s)) dlsym(RTLD_NEXT, "gl%s");' % (func.return_type, func.get_parameter_string(), func_name)
- else: # use glXGetProcAddressArb
- print ' static %s (*real_func)(%s) = 0;' % (func.return_type, func.get_parameter_string())
- print ' if (!real_func) real_func = (%s (*)(%s)) real_glXGetProcAddressARB((GLubyte *)"gl%s");' % (func.return_type, func.get_parameter_string(), func_name)
- print ' ' + create_logfunc_string(func, func_name)
- if (func.return_type == "void"):
- print ' real_func(%s);' % (create_argument_string(func.parameters))
- else:
- print ' %s retval = real_func(%s);' % (func.return_type, create_argument_string(func.parameters))
- if (func.name == "Begin"):
- print ' betweenGLBeginEnd = true;'
- elif (func.name == "End"):
- print ' betweenGLBeginEnd = false;'
- print ' if (!betweenGLBeginEnd && config.checkErrors) {'
- print ' GLenum res;'
- print ' while ((res = real_glGetError ()) != GL_NO_ERROR) '
- print ' GLTRACE_LOG("OpenGL Error (" << res << "): <" << gluErrorString(res) << "> at " << gltrace::getStackTrace());'
- print ' }'
- if (func.return_type != "void"):
- print " return retval;"
- print '}'
-
-
-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:d")
- except Exception,e:
- show_usage()
-
- debug = 0
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
- elif arg == "-d":
- debug = 1
-
- printer = PrintGltrace()
-
- printer.debug = debug
- api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() )
-
- printer.Print( api )
diff --git a/progs/tools/trace/gltrace_support.cc b/progs/tools/trace/gltrace_support.cc
deleted file mode 100644
index fb0404c450e..00000000000
--- a/progs/tools/trace/gltrace_support.cc
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2006 Thomas Sondergaard All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION 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 "gltrace_support.h"
-#include <sstream>
-#include <fstream>
-#include <iomanip>
-#include <execinfo.h>
-#include <cxxabi.h>
-#include <sys/time.h>
-
-namespace {
-
- const char *
- demangle (const char * mangled) throw()
- {
- static char buf[4096];
- int status;
- unsigned int length = sizeof(buf)-1;
-
- memset (buf, 0, sizeof(buf));
-
- if (!mangled)
- return 0;
-
- char * demangled = __cxxabiv1::__cxa_demangle(mangled,
- buf,
- &length,
- &status);
- if (demangled && !status)
- return demangled;
- else
- return mangled;
- }
-
- void
- printStackTrace (void **stackframes,
- int stackframe_size,
- std::ostream & out )
- {
- char **strings = 0;
- std::stringstream ss;
-
- // this might actually fail if memory is tight or we are in a
- // signal handler
- strings = backtrace_symbols (stackframes, stackframe_size);
-
- ss << "Backtrace :";
-
- if (stackframe_size == gltrace::MAX_STACKFRAMES)
- ss << "(possibly incomplete maximal number of frames exceeded):" << std::endl;
- else
- ss << std::endl;
-
- out << ss.str();
-
- // the first frame is the constructor of the exception
- // the last frame always seem to be bogus?
- for (int i = 0; strings && i < stackframe_size-1; ++i) {
- char libname[257], funcname[2049];
- unsigned int address=0, funcoffset = 0x0;
-
- memset (libname,0,sizeof(libname));
- memset (funcname,0,sizeof(funcname));
-
- strcpy (funcname,"??");
- strcpy (libname, "??");
-
- int scanned = sscanf (strings[i], "%256[^(] ( %2048[^+] + %x ) [ %x ]",
- libname,
- funcname,
- &funcoffset,
- &address);
-
- /* ok, so no function was mentioned in the backtrace */
- if (scanned < 4) {
- scanned = sscanf (strings[i], "%256[^([] [ %x ]",
- libname,
- &address);
- }
-
- if (funcname[0] == '_') {
- const char * demangled;
- if ((demangled = demangle(funcname) ) != funcname) {
- strncpy (funcname, demangled, sizeof(funcname)-1);
- }
- }
- else
- strcat (funcname," ()");
-
- out << "\t#" << i << std::hex << " 0x" << address << " in " << funcname
- << " at 0x" << funcoffset << " (from " << libname << ")" << std::endl;
- }
-
- free (strings);
- }
-
-
-} // anon namespace
-
-namespace gltrace {
-
- std::string getStackTrace(int count, int first) {
- ++first;
- std::stringstream ss;
- const int BA_MAX = 1000;
- assert(count + first <= BA_MAX);
- void *ba[BA_MAX];
- int n = backtrace(ba, count+first);
-
- printStackTrace( &ba[first], n-first, ss);
-
- return ss.str();
- }
-
- std::ostream &timeNow(std::ostream &os) {
-
- struct timeval now;
- struct tm t;
- static char *months[12] =
- {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- };
-
- gettimeofday (&now, 0);
- localtime_r ((time_t*) &now.tv_sec, &t);
-
- os
- << months[t.tm_mon] << " "
- << std::setw(2) << t.tm_mday << " "
- << std::setw(2) << t.tm_hour << ":"
- << std::setw(2) << t.tm_min << ":"
- << std::setw(2) << t.tm_sec << "."
- << std::setw(3) << now.tv_usec/1000;
- return os;
- }
-
- logstream::logstream(const char *filename) {
- if (!filename)
- init(std::cerr.rdbuf());
- else {
- file_os.reset(new std::ofstream(filename));
- if (file_os->good())
- init(file_os->rdbuf());
- else {
- std::cerr << "ERROR: gltrace: Failed to open '" << filename
- << "' for writing. Falling back to stderr." << std::endl;
- init(std::cerr.rdbuf());
- }
- }
- *this << std::setfill('0'); // setw used in timeNow
- }
-
-
- Config::Config() :
- logCalls(true),
- checkErrors(true),
- logTime(true),
- log(getenv("GLTRACE_LOGFILE")) {
- if (const char *v = getenv("GLTRACE_LOG_CALLS"))
- logCalls = strncmp("1", v, 1) == 0;
- if (const char *v = getenv("GLTRACE_CHECK_ERRORS"))
- checkErrors = strncmp("1", v, 1) == 0;
- if (const char *v = getenv("GLTRACE_LOG_TIME"))
- logTime = strncmp("1", v, 1) == 0;
- }
-
- // *The* config
- Config config;
-
-} // namespace gltrace
diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile
deleted file mode 100644
index cdc63283538..00000000000
--- a/progs/trivial/Makefile
+++ /dev/null
@@ -1,134 +0,0 @@
-# progs/tests/Makefile
-
-
-# These programs aren't intended to be included with the normal distro.
-# They're not too interesting but they're good for testing.
-
-TOP = ../..
-include $(TOP)/configs/current
-
-
-LIBS = $(APP_LIB_DEPS)
-
-SOURCES = \
- clear.c \
- line-clip.c \
- line-cull.c \
- line-userclip-clip.c \
- line-userclip-nop-clip.c \
- line-userclip-nop.c \
- line-userclip.c \
- line.c \
- lineloop-clip.c \
- lineloop.c \
- point.c \
- point-clip.c \
- point-param.c \
- point-wide.c \
- poly-flat.c \
- poly-unfilled.c \
- poly.c \
- quad-clip.c \
- quad-clip-all-vertices.c \
- quad-clip-nearplane.c \
- quad-degenerate.c \
- quad-flat.c \
- quad-offset-factor.c \
- quad-offset-units.c \
- quad-offset-unfilled.c \
- quad-unfilled.c \
- quad-tex-2d.c \
- quad-tex-3d.c \
- quad.c \
- quads.c \
- quadstrip.c \
- quadstrip-flat.c \
- tri-blend.c \
- tri-tex-3d.c \
- tri-clip.c \
- tri-cull.c \
- tri-edgeflag.c \
- tri-flat-clip.c \
- tri-flat.c \
- tri-unfilled-clip.c \
- tri-unfilled-smooth.c \
- tri-unfilled-userclip.c \
- tri-unfilled.c \
- tri-userclip.c \
- tri-dlist.c \
- tri.c \
- tristrip-clip.c \
- tristrip.c \
- vp-clip.c \
- vp-tri.c \
- vp-line-clip.c \
- vp-unfilled.c \
- vp-array.c
-
-PROGS = $(SOURCES:%.c=%)
-
-INCLUDES = -I. -I$(TOP)/include -I../samples
-
-UTIL_FILES = readtex.h readtex.c
-
-
-##### RULES #####
-
-.SUFFIXES:
-.SUFFIXES: .c
-
-.c:
- $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: $(UTIL_FILES) $(PROGS)
-
-clean:
- rm -f $(PROGS)
- rm -f *.o
- rm -f getproclist.h
-
-
-# auto code generation
-getprocaddress: getprocaddress.c getproclist.h
-
-getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
- python getprocaddress.py > getproclist.h
-
-
-texrect: texrect.o readtex.o
- $(CC) texrect.o readtex.o $(LIBS) -o $@
-
-texrect.o: texrect.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-invert: invert.o readtex.o
- $(CC) invert.o readtex.o $(LIBS) -o $@
-
-invert.o: invert.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-readtex.o: readtex.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-readtex.h: $(TOP)/progs/util/readtex.h
- ln -s $(TOP)/progs/util/readtex.h .
-
-readtex.c: $(TOP)/progs/util/readtex.c
- ln -s $(TOP)/progs/util/readtex.c .
-
-
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
diff --git a/progs/trivial/clear.c b/progs/trivial/clear.c
deleted file mode 100644
index 7e7ca588c31..00000000000
--- a/progs/trivial/clear.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/line-clip.c b/progs/trivial/line-clip.c
deleted file mode 100644
index 9acd12acc7b..00000000000
--- a/progs/trivial/line-clip.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-1.9, 0.0, -30.0);
- /* Repeat - no loop support yet:
- */
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/line-cull.c b/progs/trivial/line-cull.c
deleted file mode 100644
index 8999a8f0b1c..00000000000
--- a/progs/trivial/line-cull.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,1);
- glVertex3f( -1.5, 0.5, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0, 2.0, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-1.5, 2.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/line-userclip-clip.c b/progs/trivial/line-userclip-clip.c
deleted file mode 100644
index b24d8452bcd..00000000000
--- a/progs/trivial/line-userclip-clip.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- static GLdouble plane[4] = { -.5, 0, 1, 0 };
-
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
- glClipPlane(GL_CLIP_PLANE0, plane);
- glEnable(GL_CLIP_PLANE0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(0,.9,0);
- glVertex3f(-1.9, 0.0, 0.0);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/line-userclip-nop-clip.c b/progs/trivial/line-userclip-nop-clip.c
deleted file mode 100644
index e2e0b85a522..00000000000
--- a/progs/trivial/line-userclip-nop-clip.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- static GLdouble plane[4] = { 0, 0, 1, 0 };
-
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
- glClipPlane(GL_CLIP_PLANE0, plane);
- glEnable(GL_CLIP_PLANE0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(0,.9,0);
- glVertex3f(-1.9, 0.0, 0.0);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/line-userclip-nop.c b/progs/trivial/line-userclip-nop.c
deleted file mode 100644
index eacee069789..00000000000
--- a/progs/trivial/line-userclip-nop.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- static GLdouble plane[4] = { 0, 0, 1, 0 };
-
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
- glClipPlane(GL_CLIP_PLANE0, plane);
- glEnable(GL_CLIP_PLANE0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, 0.0);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/line-userclip.c b/progs/trivial/line-userclip.c
deleted file mode 100644
index 6af91431d08..00000000000
--- a/progs/trivial/line-userclip.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- static GLdouble plane[4] = { -.5, 0, 1, 0 };
-
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
- glClipPlane(GL_CLIP_PLANE0, plane);
- glEnable(GL_CLIP_PLANE0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, 0.0);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/line.c b/progs/trivial/line.c
deleted file mode 100644
index 58bad91b05a..00000000000
--- a/progs/trivial/line.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -30.0);
- /* Repeat the first vertex - don't have lineloop support in GS yet
- */
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/lineloop-clip.c b/progs/trivial/lineloop-clip.c
deleted file mode 100644
index d8645ee3477..00000000000
--- a/progs/trivial/lineloop-clip.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_LOOP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-1.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/lineloop.c b/progs/trivial/lineloop.c
deleted file mode 100644
index 7500c54fc26..00000000000
--- a/progs/trivial/lineloop.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_LINE_LOOP);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/point-clip.c b/progs/trivial/point-clip.c
deleted file mode 100644
index 32792047c64..00000000000
--- a/progs/trivial/point-clip.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_POINTS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-1.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/point-param.c b/progs/trivial/point-param.c
deleted file mode 100644
index c5424682b85..00000000000
--- a/progs/trivial/point-param.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- static GLfloat theQuad[3] = { 0.25, 0.0, 1/60.0 };
-
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glPointSize(8.0);
- glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, theQuad);
-
-
- glBegin(GL_POINTS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/point-wide.c b/progs/trivial/point-wide.c
deleted file mode 100644
index 473ca043f1d..00000000000
--- a/progs/trivial/point-wide.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glPointSize(8.0);
-
- glBegin(GL_POINTS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/point.c b/progs/trivial/point.c
deleted file mode 100644
index 87465bfb2c1..00000000000
--- a/progs/trivial/point.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_POINTS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/poly-flat.c b/progs/trivial/poly-flat.c
deleted file mode 100644
index 747b24dc0ce..00000000000
--- a/progs/trivial/poly-flat.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glShadeModel(GL_FLAT);
-
-
- glBegin(GL_POLYGON);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/poly-unfilled.c b/progs/trivial/poly-unfilled.c
deleted file mode 100644
index e0ae463b083..00000000000
--- a/progs/trivial/poly-unfilled.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- glBegin(GL_POLYGON);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/poly.c b/progs/trivial/poly.c
deleted file mode 100644
index bdb9e27aa91..00000000000
--- a/progs/trivial/poly.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_POLYGON);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-clip-all-vertices.c b/progs/trivial/quad-clip-all-vertices.c
deleted file mode 100644
index 019ef0c479a..00000000000
--- a/progs/trivial/quad-clip-all-vertices.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 1.9, -1.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 1.9, 1.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-1.9, 1.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-1.9, -1.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-clip-nearplane.c b/progs/trivial/quad-clip-nearplane.c
deleted file mode 100644
index 7e12e58a196..00000000000
--- a/progs/trivial/quad-clip-nearplane.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, 30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, 30.0);
- glColor3f(1,0,1);
- glVertex3f(-1.9, 0.9, 30.0);
- glColor3f(0,1,1);
- glVertex3f(-1.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-clip.c b/progs/trivial/quad-clip.c
deleted file mode 100644
index 9f3a45caec3..00000000000
--- a/progs/trivial/quad-clip.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-1.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-degenerate.c b/progs/trivial/quad-degenerate.c
deleted file mode 100644
index b14b0f1d879..00000000000
--- a/progs/trivial/quad-degenerate.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-flat.c b/progs/trivial/quad-flat.c
deleted file mode 100644
index d6e9f021206..00000000000
--- a/progs/trivial/quad-flat.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glShadeModel(GL_FLAT);
-
- if (1) {
- glBegin(GL_LINES);
- glColor3f(1,0,0);
- glVertex3f( 0.95, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.95, 0.9, -30.0);
- glEnd();
- }
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-offset-factor.c b/progs/trivial/quad-offset-factor.c
deleted file mode 100644
index 861d3461c04..00000000000
--- a/progs/trivial/quad-offset-factor.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(1.0, 1.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void quad( float half )
-{
- glBegin(GL_QUADS);
- glVertex3f( half/9.0, -half/9.0, -25.0 + half);
- glVertex3f( half/9.0, half/9.0, -25.0 + half);
- glVertex3f(-half/9.0, half/9.0, -25.0 - half);
- glVertex3f(-half/9.0, -half/9.0, -25.0 - half);
- glEnd();
-
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
-
-
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(1, 0);
-
- glColor3f(1,0,0);
- quad(9);
-
- glDisable(GL_POLYGON_OFFSET_FILL);
- glColor3f(0,1,0);
- quad(6);
-
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(0, 0);
-
- /* Black - should not be visible
- */
- glColor3f(0,0,0);
- quad(6);
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(-1, 0);
- glColor3f(0,0,1);
- quad(3);
-
- glDisable(GL_POLYGON_OFFSET_FILL);
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB | GLUT_DEPTH;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-offset-unfilled.c b/progs/trivial/quad-offset-unfilled.c
deleted file mode 100644
index 1cecf3c1cef..00000000000
--- a/progs/trivial/quad-offset-unfilled.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(1.0, 1.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
-
-
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(1, 0);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -10.0);
- glVertex3f( 0.9, 0.9, -10.0);
- glVertex3f(-0.9, 0.9, -40.0);
- glVertex3f(-0.9, -0.9, -40.0);
- glEnd();
-
- glDisable(GL_POLYGON_OFFSET_FILL);
-
- glBegin(GL_QUADS);
- glColor3f(0,1,0);
- glVertex3f( 0.6, -0.6, -15.0);
- glVertex3f( 0.6, 0.6, -15.0);
- glVertex3f(-0.6, 0.6, -35.0);
- glVertex3f(-0.6, -0.6, -35.0);
- glEnd();
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(-1, 0);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- glBegin(GL_QUADS);
- glColor3f(0,0,1);
- glVertex3f( 0.3, -0.3, -20.0);
- glVertex3f( 0.3, 0.3, -20.0);
- glVertex3f(-0.3, 0.3, -30.0);
- glVertex3f(-0.3, -0.3, -30.0);
- glEnd();
-
-
- glDisable(GL_POLYGON_OFFSET_FILL);
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB | GLUT_DEPTH;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-offset-units.c b/progs/trivial/quad-offset-units.c
deleted file mode 100644
index 5c41be308ee..00000000000
--- a/progs/trivial/quad-offset-units.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(1.0, 1.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.2, 1.2, -1.2, 1.2, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void quad( float half )
-{
- glBegin(GL_QUADS);
- glVertex3f( half/9.0, -half/9.0, -25.0 + half);
- glVertex3f( half/9.0, half/9.0, -25.0 + half);
- glVertex3f(-half/9.0, half/9.0, -25.0 - half);
- glVertex3f(-half/9.0, -half/9.0, -25.0 - half);
- glEnd();
-
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
-
-
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(0, 4);
-
- glColor3f(1,0,0);
- quad(9);
-
- glDisable(GL_POLYGON_OFFSET_FILL);
- glColor3f(0,0,0);
- quad(6);
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(0, 0);
-
- glDepthFunc( GL_EQUAL );
- glColor3f(0,1,0);
- quad(6);
- glDepthFunc( GL_LESS );
-
-
- glPolygonOffset(0, -4);
- glColor3f(0,0,1);
- quad(3);
-
- glDisable(GL_POLYGON_OFFSET_FILL);
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB | GLUT_DEPTH;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-tex-2d.c b/progs/trivial/quad-tex-2d.c
deleted file mode 100644
index 70b9fbf8c61..00000000000
--- a/progs/trivial/quad-tex-2d.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-
-#define SIZE 16
- {
- GLubyte tex2d[SIZE][SIZE][3];
- GLint s, t;
-
- for (s = 0; s < SIZE; s++) {
- for (t = 0; t < SIZE; t++) {
-#if 0
- tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255;
- tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255;
- tex2d[t][s][2] = 0;
-#else
- tex2d[t][s][0] = s*255/(SIZE-1);
- tex2d[t][s][1] = t*255/(SIZE-1);
- tex2d[t][s][2] = 0;
-#endif
- }
- }
-
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, 3, SIZE, SIZE, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex2d);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glEnable(GL_TEXTURE_2D);
- }
-
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUADS);
- glTexCoord2f(1,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glTexCoord2f(1,1);
- glVertex3f( 0.9, 0.9, -30.0);
- glTexCoord2f(0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glTexCoord2f(0,0);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-tex-3d.c b/progs/trivial/quad-tex-3d.c
deleted file mode 100644
index 0b2dcc08a5f..00000000000
--- a/progs/trivial/quad-tex-3d.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-GLfloat z= 0;
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-
-#define SIZE 16
- {
- GLubyte tex3d[SIZE][SIZE][SIZE][3];
- GLint r, s, t;
-
- for (s = 0; s < SIZE; s++) {
- for (t = 0; t < SIZE; t++) {
- for (r = 0; r < SIZE; r++) {
-#if 0
- tex3d[r][t][s][0] = (s < SIZE/2) ? 0 : 255;
- tex3d[r][t][s][1] = (t < SIZE/2) ? 0 : 255;
- tex3d[r][t][s][2] = (r < SIZE/2) ? 0 : 255;
-#else
- tex3d[r][t][s][0] = s*255/(SIZE-1);
- tex3d[r][t][s][1] = t*255/(SIZE-1);
- tex3d[r][t][s][2] = r*255/(SIZE-1);
-#endif
- }
- }
- }
-
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage3D(GL_TEXTURE_3D, 0, 3, SIZE, SIZE, SIZE, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex3d);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glEnable(GL_TEXTURE_3D);
- }
-
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case ' ':
- z += 1.0/SIZE;
- break;
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- fprintf(stderr, "z: %f\n", z);
-
- glBegin(GL_QUADS);
- glTexCoord3f(1,0,z);
- glVertex3f( 0.9, -0.9, -30.0);
- glTexCoord3f(1,1,z);
- glVertex3f( 0.9, 0.9, -30.0);
- glTexCoord3f(0,1,z);
- glVertex3f(-0.9, 0.9, -30.0);
- glTexCoord3f(0,0,z);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad-unfilled.c b/progs/trivial/quad-unfilled.c
deleted file mode 100644
index 9d63d2dfb95..00000000000
--- a/progs/trivial/quad-unfilled.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quad.c b/progs/trivial/quad.c
deleted file mode 100644
index 85424b7b388..00000000000
--- a/progs/trivial/quad.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quads.c b/progs/trivial/quads.c
deleted file mode 100644
index 1ca82cd9f8b..00000000000
--- a/progs/trivial/quads.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUADS);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
-
- glColor3f(1,1,1);
- glVertex3f( 0.1, 0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f( 0.1, -0.9, -30.0);
-
- if (0) {
- glEnd();
- glFlush();
- glBegin(GL_QUADS);
- }
-
- glColor3f(0,1,0);
- glVertex3f(-0.1, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f(-0.1, 0.9, -30.0);
-
-
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quadstrip-flat.c b/progs/trivial/quadstrip-flat.c
deleted file mode 100644
index 061a0e409e4..00000000000
--- a/progs/trivial/quadstrip-flat.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glShadeModel(GL_FLAT);
-
- glBegin(GL_QUAD_STRIP);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
-
- glColor3f(1,0,0);
- glVertex3f( 0.1, -0.8, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.1, 0.8, -30.0);
-
- glColor3f(0,1,1);
- glVertex3f(-0.1, -0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.1, 0.9, -30.0);
-
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.8, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.8, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/quadstrip.c b/progs/trivial/quadstrip.c
deleted file mode 100644
index 342463f1a24..00000000000
--- a/progs/trivial/quadstrip.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_QUAD_STRIP);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
-
- glColor3f(1,0,0);
- glVertex3f( 0.1, -0.8, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.1, 0.8, -30.0);
-
- glColor3f(0,1,1);
- glVertex3f(-0.1, -0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.1, 0.9, -30.0);
-
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.8, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.8, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-blend.c b/progs/trivial/tri-blend.c
deleted file mode 100644
index 284d15fd3c9..00000000000
--- a/progs/trivial/tri-blend.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
- */
-
-/*
- * alpha.c
- * This program draws several overlapping filled polygons
- * to demonstrate the effect order has on alpha blending results.
- * Use the 't' key to toggle the order of drawing polygons.
- */
-#include <GL/glut.h>
-#include <stdlib.h>
-
-static int leftFirst = GL_TRUE;
-
-/* Initialize alpha blending function.
- */
-static void init(void)
-{
- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glShadeModel (GL_FLAT);
- glClearColor (1.0, 0.0, 0.0, 0.0);
-}
-
-static void drawLeftTriangle(void)
-{
- /* draw yellow triangle on LHS of screen */
-
- glBegin (GL_TRIANGLES);
- glColor4f(1.0, 1.0, 0.0, 0.75);
- glVertex3f(0.1, 0.9, 0.0);
- glVertex3f(0.1, 0.1, 0.0);
- glVertex3f(0.7, 0.5, 0.0);
- glEnd();
-}
-
-static void drawRightTriangle(void)
-{
- /* draw cyan triangle on RHS of screen */
-
- glEnable (GL_BLEND);
- glBegin (GL_TRIANGLES);
- glColor4f(0.0, 1.0, 1.0, 0.75);
- glVertex3f(0.9, 0.9, 0.0);
- glVertex3f(0.3, 0.5, 0.0);
- glVertex3f(0.9, 0.1, 0.0);
- glEnd();
- glDisable (GL_BLEND);
-}
-
-void display(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- if (leftFirst) {
- drawLeftTriangle();
- drawRightTriangle();
- }
- else {
- drawRightTriangle();
- drawLeftTriangle();
- }
-
- glFlush();
-}
-
-void reshape(int w, int h)
-{
- glViewport(0, 0, (GLsizei) w, (GLsizei) h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- if (w <= h)
- gluOrtho2D (0.0, 1.0, 0.0, 1.0*(GLfloat)h/(GLfloat)w);
- else
- gluOrtho2D (0.0, 1.0*(GLfloat)w/(GLfloat)h, 0.0, 1.0);
-}
-
-/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
-{
- switch (key) {
- case 't':
- case 'T':
- leftFirst = !leftFirst;
- glutPostRedisplay();
- break;
- case 27: /* Escape key */
- exit(0);
- break;
- default:
- break;
- }
-}
-
-/* Main Loop
- * Open window with initial window size, title bar,
- * RGBA display mode, and handle input events.
- */
-int main(int argc, char** argv)
-{
- glutInit(&argc, argv);
- glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
- glutInitWindowSize (200, 200);
- glutCreateWindow (argv[0]);
- init();
- glutReshapeFunc (reshape);
- glutKeyboardFunc (keyboard);
- glutDisplayFunc (display);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-clip.c b/progs/trivial/tri-clip.c
deleted file mode 100644
index bf48533adcc..00000000000
--- a/progs/trivial/tri-clip.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-1.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-cull.c b/progs/trivial/tri-cull.c
deleted file mode 100644
index 20aeaf1d7cd..00000000000
--- a/progs/trivial/tri-cull.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( -1.5, 0.5, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0, 2.0, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-1.5, 2.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-dlist.c b/progs/trivial/tri-dlist.c
deleted file mode 100644
index e0ab285eff4..00000000000
--- a/progs/trivial/tri-dlist.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-GLint list;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-
- list = glGenLists(1);
- glNewList(list, GL_COMPILE);
- glBegin(GL_TRIANGLES);
-/* glColor3f(0,0,.7); */
- glVertex3f( 0.9, -0.9, -30.0);
-/* glColor3f(.8,0,0); */
- glVertex3f( 0.9, 0.9, -30.0);
-/* glColor3f(0,.9,0); */
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
- glEndList();
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-
-
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glColor3f(0,.9,0);
- glCallList(list);
-
- glRotatef(45,0,0,1);
- glColor3f(1,0,1);
- glCallList(list);
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-edgeflag.c b/progs/trivial/tri-edgeflag.c
deleted file mode 100644
index bdc0eaa253a..00000000000
--- a/progs/trivial/tri-edgeflag.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glPolygonMode(GL_FRONT, GL_LINE);
- glPolygonMode(GL_BACK, GL_POINT);
-
- glBegin(GL_TRIANGLES);
- glEdgeFlag(1);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -0.0);
- glEdgeFlag(0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -0.0);
- glEdgeFlag(1);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-flat-clip.c b/progs/trivial/tri-flat-clip.c
deleted file mode 100644
index fafa64914d4..00000000000
--- a/progs/trivial/tri-flat-clip.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.5, 0.5, 0.5, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glShadeModel(GL_FLAT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-1.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-flat.c b/progs/trivial/tri-flat.c
deleted file mode 100644
index fb2cdbd7bba..00000000000
--- a/progs/trivial/tri-flat.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.5, 0.5, 0.5, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glShadeModel(GL_FLAT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-tex-3d.c b/progs/trivial/tri-tex-3d.c
deleted file mode 100644
index 6a9d1d1bf6d..00000000000
--- a/progs/trivial/tri-tex-3d.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-
-#define SIZE 16
- {
- GLubyte tex3d[SIZE][SIZE][SIZE][3];
- GLint r, s, t;
-
- for (s = 0; s < SIZE; s++) {
- for (t = 0; t < SIZE; t++) {
- for (r = 0; r < SIZE; r++) {
-#if 0
- tex3d[r][t][s][0] = (s < SIZE/2) ? 0 : 255;
- tex3d[r][t][s][1] = (t < SIZE/2) ? 0 : 255;
- tex3d[r][t][s][2] = (r < SIZE/2) ? 0 : 255;
-#else
- tex3d[r][t][s][0] = s*255/(SIZE-1);
- tex3d[r][t][s][1] = t*255/(SIZE-1);
- tex3d[r][t][s][2] = r*255/(SIZE-1);
-#endif
- }
- }
- }
-
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage3D(GL_TEXTURE_3D, 0, 3, SIZE, SIZE, SIZE, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex3d);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glEnable(GL_TEXTURE_3D);
- }
-
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glTexCoord3f( 0,0,.9);
- glVertex3f( 0.9, -0.9, -30.0);
- glTexCoord3f(.9,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glTexCoord3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-unfilled-clip.c b/progs/trivial/tri-unfilled-clip.c
deleted file mode 100644
index d486af23655..00000000000
--- a/progs/trivial/tri-unfilled-clip.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-1.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-unfilled-smooth.c b/progs/trivial/tri-unfilled-smooth.c
deleted file mode 100644
index e41903a3d50..00000000000
--- a/progs/trivial/tri-unfilled-smooth.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glEnable(GL_LINE_SMOOTH);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.6, -0.6, -0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.6, 0.6, -0.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.6, 0.0, -0.0);
- glEnd();
-
- glPolygonMode(GL_FRONT, GL_LINE);
-/* glPolygonMode(GL_BACK, GL_LINE); */
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -0.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-unfilled-userclip.c b/progs/trivial/tri-unfilled-userclip.c
deleted file mode 100644
index dc93a8f1abf..00000000000
--- a/progs/trivial/tri-unfilled-userclip.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- static GLdouble plane[4] = { -.5, 0, 1, 0 };
-
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
- glClipPlane(GL_CLIP_PLANE0, plane);
- glEnable(GL_CLIP_PLANE0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, 0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-unfilled.c b/progs/trivial/tri-unfilled.c
deleted file mode 100644
index 73961bc93a6..00000000000
--- a/progs/trivial/tri-unfilled.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
- glPolygonMode(GL_FRONT, GL_LINE);
- glPolygonMode(GL_BACK, GL_LINE);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -0.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri-userclip.c b/progs/trivial/tri-userclip.c
deleted file mode 100644
index cde9662ace9..00000000000
--- a/progs/trivial/tri-userclip.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- static GLdouble plane[4] = { -.5, 0, 1, 0 };
-
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
- glClipPlane(GL_CLIP_PLANE0, plane);
- glEnable(GL_CLIP_PLANE0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, 0.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c
deleted file mode 100644
index 58a650b559f..00000000000
--- a/progs/trivial/tri.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tristrip-clip.c b/progs/trivial/tristrip-clip.c
deleted file mode 100644
index f95c66a62aa..00000000000
--- a/progs/trivial/tristrip-clip.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLE_STRIP);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-1.9, 0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/tristrip.c b/progs/trivial/tristrip.c
deleted file mode 100644
index fa82a737112..00000000000
--- a/progs/trivial/tristrip.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the name of
- * Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <GL/glut.h>
-
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
-
-static void Init(void)
-{
- fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
- fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLE_STRIP);
- glColor3f(1,0,0);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,1,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,1);
- glVertex3f(-0.9, -0.9, -30.0);
- glColor3f(1,0,1);
- glVertex3f(-0.9, 0.9, -30.0);
- glEnd();
-
- glFlush();
-
- if (doubleBuffer) {
- glutSwapBuffers();
- }
-}
-
-static GLenum Args(int argc, char **argv)
-{
- GLint i;
-
- doubleBuffer = GL_FALSE;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-sb") == 0) {
- doubleBuffer = GL_FALSE;
- } else if (strcmp(argv[i], "-db") == 0) {
- doubleBuffer = GL_TRUE;
- } else {
- fprintf(stderr, "%s (Bad option).\n", argv[i]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/vp-array.c b/progs/trivial/vp-array.c
deleted file mode 100644
index abe8f62bec3..00000000000
--- a/progs/trivial/vp-array.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-GLfloat verts[][4] = {
- { 0.9, -0.9, 0.0, 1.0 },
- { 0.9, 0.9, 0.0, 1.0 },
- { -0.9, 0.9, 0.0, 1.0 },
- { -0.9, -0.9, 0.0, 1.0 },
-};
-
-GLubyte color[][4] = {
- { 0x00, 0x00, 0xff, 0x00 },
- { 0x00, 0xff, 0x00, 0x00 },
- { 0xff, 0x00, 0x00, 0x00 },
- { 0xff, 0xff, 0xff, 0x00 },
-};
-
-GLuint indices[] = { 0, 1, 2, 3 };
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
-
- static const char *prog1 =
- "!!ARBvp1.0\n"
- "MOV result.color, vertex.color;\n"
- "MOV result.position, vertex.position;\n"
- "END\n";
-
- glGenProgramsARB(1, &prognum);
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog1), (const GLubyte *) prog1);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-
-
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_COLOR_ARRAY );
- glVertexPointer( 3, GL_FLOAT, sizeof(verts[0]), verts );
- glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color );
-
-}
-
-
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_VERTEX_PROGRAM_NV);
- glDrawElements( GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices );
-
- glFlush();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/vp-clip.c b/progs/trivial/vp-clip.c
deleted file mode 100644
index 206ba0b8cb8..00000000000
--- a/progs/trivial/vp-clip.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
-
- static const char *prog1 =
- "!!ARBvp1.0\n"
- "MOV result.color, vertex.color;\n"
- "MOV result.position, vertex.position;\n"
- "END\n";
-
- glGenProgramsARB(1, &prognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog1), (const GLubyte *) prog1);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-}
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_VERTEX_PROGRAM_NV);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 2.0, -2.0, 0.0);
- glColor3f(0,1,0);
- glVertex3f( 2.0, 2.0, 0.0);
- glColor3f(1,0,0);
- glVertex3f(-2.0, 0.0, 0.0);
- glEnd();
-
-
- glFlush();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/vp-line-clip.c b/progs/trivial/vp-line-clip.c
deleted file mode 100644
index b2aaf17ca4f..00000000000
--- a/progs/trivial/vp-line-clip.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
-
- static const char *prog1 =
- "!!ARBvp1.0\n"
- "MOV result.color, vertex.color;\n"
- "MOV result.position, vertex.position;\n"
- "END\n";
-
- glGenProgramsARB(1, &prognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog1), (const GLubyte *) prog1);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-}
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_VERTEX_PROGRAM_NV);
-
-#if 0
- glBegin(GL_LINES);
- glColor3f(0,0,1);
- glVertex3f( 0.75, -0.75, 0.0);
- glColor3f(0,1,0);
- glVertex3f( 0.75, 0.75, 0.0);
-
- glColor3f(0,1,0);
- glVertex3f( 0.75, 0.75, 0.0);
- glColor3f(1,0,0);
- glVertex3f(-1.75, 0.0, 0.0);
- glEnd();
-#else
- glBegin(GL_LINE_STRIP);
- glColor3f(0,0,1);
- glVertex3f( 0.75, -0.75, 0.0);
- glColor3f(0,1,0);
- glVertex3f( 0.75, 0.75, 0.0);
- glColor3f(1,0,0);
- glVertex3f(-1.75, 0.0, 0.0);
- glEnd();
-#endif
-
-
- glFlush();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/vp-tri.c b/progs/trivial/vp-tri.c
deleted file mode 100644
index f8e18654c60..00000000000
--- a/progs/trivial/vp-tri.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
-
- static const char *prog1 =
- "!!ARBvp1.0\n"
- "MOV result.color, vertex.color;\n"
-/* "MOV result.color, {0,0,0,1};\n" */
- "MOV result.position, vertex.position;\n"
- "END\n";
-
-
- glGenProgramsARB(1, &prognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog1), (const GLubyte *) prog1);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-}
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT );
-
- glEnable(GL_VERTEX_PROGRAM_NV);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(0,1,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(1,0,0);
- glVertex3f(-0.9, 0.0, 0.0);
- glEnd();
-
-
- glFlush();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/trivial/vp-unfilled.c b/progs/trivial/vp-unfilled.c
deleted file mode 100644
index ac23181fff7..00000000000
--- a/progs/trivial/vp-unfilled.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
-
- static const char *prog1 =
- "!!ARBvp1.0\n"
- "MOV result.color, vertex.color;\n"
- "MOV result.position, vertex.position;\n"
- "END\n";
-
- glGenProgramsARB(1, &prognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(prog1), (const GLubyte *) prog1);
-
- assert(glIsProgramARB(prognum));
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
-}
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
- glPolygonMode(GL_FRONT, GL_LINE);
- glPolygonMode(GL_BACK, GL_POINT);
-
- glEnable(GL_VERTEX_PROGRAM_NV);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(0,1,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(1,0,0);
- glVertex3f(-0.9, 0.0, 0.0);
- glEnd();
-
-
- glFlush();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/vp/Makefile b/progs/vp/Makefile
deleted file mode 100644
index c3faeb5b602..00000000000
--- a/progs/vp/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# progs/tests/Makefile
-
-
-# These programs aren't intended to be included with the normal distro.
-# They're not too interesting but they're good for testing.
-
-TOP = ../..
-include $(TOP)/configs/current
-
-
-LIBS = $(APP_LIB_DEPS)
-
-SOURCES = \
- vp-tris.c
-
-
-
-PROGS = $(SOURCES:%.c=%)
-
-INCLUDES = -I. -I$(TOP)/include -I../samples
-
-
-##### RULES #####
-
-.SUFFIXES:
-.SUFFIXES: .c
-
-.c:
- $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: $(PROGS)
-
-clean:
- rm -f $(PROGS)
- rm -f *.o
- rm -f getproclist.h
-
-
-
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
diff --git a/progs/vp/abs.txt b/progs/vp/abs.txt
deleted file mode 100644
index cd00952e349..00000000000
--- a/progs/vp/abs.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-SUB R0, {0.5}.x, vertex.color;
-ABS result.color, R0;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/add.txt b/progs/vp/add.txt
deleted file mode 100644
index 4094cd448dc..00000000000
--- a/progs/vp/add.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-ADD R0, vertex.color, vertex.color;
-ADD result.color, R0, R0;
-MOV result.position, vertex.position;
-END
diff --git a/progs/vp/arl.txt b/progs/vp/arl.txt
deleted file mode 100644
index a262b0149c6..00000000000
--- a/progs/vp/arl.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-!!ARBvp1.0
-PARAM arr[5] = { {0,1,2,3}, {4,5,6,7}, {8,9,10,11}, {12,13,14,14}, {16,17,18,19} };
-ADDRESS addr;
-TEMP R0;
-MAD R0, {5.0}.x, vertex.color, {2.0}.x;
-ARL addr.x, R0.x;
-MUL result.color, arr[addr.x-2], {.07}.x;
-MOV result.position, vertex.position;
-END
diff --git a/progs/vp/dp3.txt b/progs/vp/dp3.txt
deleted file mode 100644
index 8336bd3dd8e..00000000000
--- a/progs/vp/dp3.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-DP3 result.color, vertex.color, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/dp4.txt b/progs/vp/dp4.txt
deleted file mode 100644
index 70505a494c5..00000000000
--- a/progs/vp/dp4.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-DP4 result.color, vertex.color.xxxx, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/dph.txt b/progs/vp/dph.txt
deleted file mode 100644
index c7cab1384dd..00000000000
--- a/progs/vp/dph.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-DPH result.color, vertex.color, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/dst.txt b/progs/vp/dst.txt
deleted file mode 100644
index 03613c0eece..00000000000
--- a/progs/vp/dst.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-DST result.color, vertex.color, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/ex2.txt b/progs/vp/ex2.txt
deleted file mode 100644
index bbef67bbb8a..00000000000
--- a/progs/vp/ex2.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-EX2 R0, vertex.color.x;
-SUB result.color, R0, {1.0}.x;
-MOV result.position, vertex.position;
-END
diff --git a/progs/vp/flr.txt b/progs/vp/flr.txt
deleted file mode 100644
index c33280da978..00000000000
--- a/progs/vp/flr.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-ADD R0, vertex.color, {0.5}.x;
-FLR result.color, R0;
-MOV result.position, vertex.position;
-END
diff --git a/progs/vp/frc.txt b/progs/vp/frc.txt
deleted file mode 100644
index d8e72b60cc7..00000000000
--- a/progs/vp/frc.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-MUL R0, vertex.color, {3.0}.x;
-FRC result.color, R0;
-MOV result.position, vertex.position;
-END
diff --git a/progs/vp/lg2.txt b/progs/vp/lg2.txt
deleted file mode 100644
index 2f59b993a41..00000000000
--- a/progs/vp/lg2.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-MUL R0, vertex.color, {4.0}.x;
-LG2 result.color, R0.x;
-MOV result.position, vertex.position;
-END
diff --git a/progs/vp/lit.txt b/progs/vp/lit.txt
deleted file mode 100644
index 65705b41705..00000000000
--- a/progs/vp/lit.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-SUB R0, {0.5}.x, vertex.color;
-LIT result.color, R0;
-MOV result.position, vertex.position;
-END
diff --git a/progs/vp/mad.txt b/progs/vp/mad.txt
deleted file mode 100644
index 0c9ed6c8b7f..00000000000
--- a/progs/vp/mad.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-MAD result.color, vertex.color.z, {1,0,0,1}, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/max.txt b/progs/vp/max.txt
deleted file mode 100644
index 6747ca57277..00000000000
--- a/progs/vp/max.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-MAX result.color, {0.5}.x, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/min.txt b/progs/vp/min.txt
deleted file mode 100644
index 2adc872ed9c..00000000000
--- a/progs/vp/min.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-MIN result.color, {0.5}.x, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/mov.txt b/progs/vp/mov.txt
deleted file mode 100644
index 9ce1a453067..00000000000
--- a/progs/vp/mov.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-MOV result.color, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/mul.txt b/progs/vp/mul.txt
deleted file mode 100644
index e479cdb8543..00000000000
--- a/progs/vp/mul.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-MUL result.color, vertex.color, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/pow.txt b/progs/vp/pow.txt
deleted file mode 100644
index 512412997de..00000000000
--- a/progs/vp/pow.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-POW result.color, vertex.color.x, vertex.color.y;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/rcp.txt b/progs/vp/rcp.txt
deleted file mode 100644
index e16292bd00a..00000000000
--- a/progs/vp/rcp.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-ADD R0, vertex.color.x, vertex.color.x;
-RCP result.color, R0.x;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/rsq.txt b/progs/vp/rsq.txt
deleted file mode 100644
index 3e3f3251ee0..00000000000
--- a/progs/vp/rsq.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-!!ARBvp1.0
-TEMP R0;
-MUL R0, vertex.color, {3.0}.x;
-RSQ result.color, R0.x;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/sge.txt b/progs/vp/sge.txt
deleted file mode 100644
index 3fa82e5d5ea..00000000000
--- a/progs/vp/sge.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-SGE result.color, {0.5}.x, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/slt.txt b/progs/vp/slt.txt
deleted file mode 100644
index 6bf8ffa775d..00000000000
--- a/progs/vp/slt.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-SLT result.color, {0.5}.x, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/sub.txt b/progs/vp/sub.txt
deleted file mode 100644
index a58ab101bcd..00000000000
--- a/progs/vp/sub.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-SUB result.color, vertex.color.yzxw, vertex.color;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/swz.txt b/progs/vp/swz.txt
deleted file mode 100644
index 92c58089b1a..00000000000
--- a/progs/vp/swz.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-MOV result.color, vertex.color.xxzx;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/swz2.txt b/progs/vp/swz2.txt
deleted file mode 100644
index 84c78db49f6..00000000000
--- a/progs/vp/swz2.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-SWZ result.color, vertex.color, 1,x,y,z;
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
deleted file mode 100644
index 5dbe5ac8359..00000000000
--- a/progs/vp/vp-tris.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-static const char *filename = NULL;
-static GLuint nr_steps = 4;
-
-static void usage( char *name )
-{
- fprintf( stderr, "usage: %s [ options ] shader_filename\n", name );
- fprintf( stderr, "\n" );
- fprintf( stderr, "options:\n" );
- fprintf( stderr, " -f flat shaded\n" );
- fprintf( stderr, " -nNr subdivision steps\n" );
-}
-
-
-static void args(int argc, char *argv[])
-{
- GLint i;
-
- for (i = 1; i < argc; i++) {
- if (strncmp(argv[i], "-n", 2) == 0) {
- nr_steps = atoi((argv[i]) + 2);
- }
- else if (strcmp(argv[i], "-f") == 0) {
- glShadeModel(GL_FLAT);
- }
- else if (i == argc - 1) {
- filename = argv[i];
- }
- else {
- usage(argv[0]);
- exit(1);
- }
- }
-
- if (!filename) {
- usage(argv[0]);
- exit(1);
- }
-}
-
-
-
-static void Init( void )
-{
- GLint errno;
- GLuint prognum;
- char buf[4096];
- GLuint sz;
- FILE *f;
-
- if ((f = fopen(filename, "r")) == NULL) {
- fprintf(stderr, "couldn't open %s\n", filename);
- exit(1);
- }
-
- sz = fread(buf, 1, sizeof(buf), f);
- if (!feof(f)) {
- fprintf(stderr, "file too long\n");
- exit(1);
- }
-
- fprintf(stderr, "%.*s\n", sz, buf);
-
- glGenProgramsARB(1, &prognum);
-
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- sz, (const GLubyte *) buf);
-
- errno = glGetError();
- printf("glGetError = %d\n", errno);
- if (errno != GL_NO_ERROR)
- {
- GLint errorpos;
-
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
- printf("errorpos: %d\n", errorpos);
- printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
- }
- assert(glIsProgramARB(prognum));
-}
-
-
-union vert {
- struct {
- GLfloat color[3];
- GLfloat pos[3];
- } v;
- GLfloat f[6];
-};
-
-static void make_midpoint( union vert *out,
- const union vert *v0,
- const union vert *v1)
-{
- int i;
- for (i = 0; i < 6; i++)
- out->f[i] = v0->f[i] + .5 * (v1->f[i] - v0->f[i]);
-}
-
-static void subdiv( union vert *v0,
- union vert *v1,
- union vert *v2,
- GLuint depth )
-{
- if (depth == 0) {
- glColor3fv(v0->v.color);
- glVertex3fv(v0->v.pos);
- glColor3fv(v1->v.color);
- glVertex3fv(v1->v.pos);
- glColor3fv(v2->v.color);
- glVertex3fv(v2->v.pos);
- }
- else {
- union vert m[3];
-
- make_midpoint(&m[0], v0, v1);
- make_midpoint(&m[1], v1, v2);
- make_midpoint(&m[2], v2, v0);
-
- subdiv(&m[0], &m[2], v0, depth-1);
- subdiv(&m[1], &m[0], v1, depth-1);
- subdiv(&m[2], &m[1], v2, depth-1);
- subdiv(&m[0], &m[1], &m[2], depth-1);
- }
-}
-
-/** Assignment */
-#define ASSIGN_3V( V, V0, V1, V2 ) \
-do { \
- V[0] = V0; \
- V[1] = V1; \
- V[2] = V2; \
-} while(0)
-
-static void Display( void )
-{
- glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- glEnable(GL_VERTEX_PROGRAM_NV);
-
- glBegin(GL_TRIANGLES);
-
-
- {
- union vert v[3];
-
- ASSIGN_3V(v[0].v.color, 0,0,1);
- ASSIGN_3V(v[0].v.pos, 0.9, -0.9, 0.0);
- ASSIGN_3V(v[1].v.color, 1,0,0);
- ASSIGN_3V(v[1].v.pos, 0.9, 0.9, 0.0);
- ASSIGN_3V(v[2].v.color, 0,1,0);
- ASSIGN_3V(v[2].v.pos, -0.9, 0, 0.0);
-
- subdiv(&v[0], &v[1], &v[2], nr_steps);
- }
-
- glEnd();
-
-
- glFlush();
-}
-
-
-static void Reshape( int width, int height )
-{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- /*glTranslatef( 0.0, 0.0, -15.0 );*/
-}
-
-
-static void Key( unsigned char key, int x, int y )
-{
- (void) x;
- (void) y;
- switch (key) {
- case 27:
- exit(0);
- break;
- }
- glutPostRedisplay();
-}
-
-
-
-
-int main( int argc, char *argv[] )
-{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutDisplayFunc( Display );
- args( argc, argv );
- Init();
- glutMainLoop();
- return 0;
-}
diff --git a/progs/vp/xpd.txt b/progs/vp/xpd.txt
deleted file mode 100644
index b8818ebc60e..00000000000
--- a/progs/vp/xpd.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-!!ARBvp1.0
-XPD result.color, vertex.color, {2,2,2,0};
-MOV result.position, vertex.position;
-END
-
diff --git a/progs/xdemos/wincopy.c b/progs/xdemos/wincopy.c
index 3ec67dc6724..f670983a0f7 100644
--- a/progs/xdemos/wincopy.c
+++ b/progs/xdemos/wincopy.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -32,6 +32,7 @@
*/
+#define GL_GLEXT_PROTOTYPES
#define GLX_GLXEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glx.h>
@@ -50,7 +51,7 @@ static int ScrNum;
static GLXContext Context;
static Window Win[2]; /* Win[0] = source, Win[1] = dest */
static GLint Width[2], Height[2];
-
+static GLboolean TestClipping = GL_FALSE;
static GLfloat Angle = 0.0;
static GLboolean DrawFront = GL_FALSE;
@@ -123,7 +124,7 @@ Redraw(void)
glMatrixMode(GL_MODELVIEW);
glShadeModel(GL_FLAT);
- glClearColor(0.5, 0.5, 0.5, 1.0);
+ glClearColor(0.5, 0.5, 0.5, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
/* draw blue quad */
@@ -150,22 +151,18 @@ Redraw(void)
return;
}
- /* raster pos setup */
- glViewport(0, 0, Width[1], Height[1]);
- glPushMatrix();
- glLoadIdentity();
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(-1, 1, -1, 1, -1, 1);
- glRasterPos2f(-1, -1);
-
/* copy the image between windows */
- glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR);
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
+ if (TestClipping) {
+ glWindowPos2iARB(-2, -2);
+ glCopyPixels(-2, -2, Width[0] + 4, Height[0] + 4, GL_COLOR);
+ }
+ else {
+ glWindowPos2iARB(0, 0);
+ glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR);
+ }
if (DrawFront)
glFinish();
@@ -309,6 +306,8 @@ Init(void)
int
main(int argc, char *argv[])
{
+ if (argc > 1 && strcmp(argv[1], "-clip") == 0)
+ TestClipping = GL_TRUE;
Init();
EventLoop();
return 0;
diff --git a/src/egl/Makefile b/src/egl/Makefile
deleted file mode 100644
index 931e9d0cb86..00000000000
--- a/src/egl/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# src/egl/Makefile
-
-TOP = ../..
-
-SUBDIRS = main drivers/demo drivers/dri
-
-
-default: subdirs
-
-
-subdirs:
- @for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir ; $(MAKE)) || exit 1 ; \
- fi \
- done
-
-
-clean:
- @for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir ; $(MAKE) clean) ; \
- fi \
- done
diff --git a/src/egl/docs/EGL_MESA_screen_surface b/src/egl/docs/EGL_MESA_screen_surface
deleted file mode 100644
index 3a11da7ac9b..00000000000
--- a/src/egl/docs/EGL_MESA_screen_surface
+++ /dev/null
@@ -1,578 +0,0 @@
-Name
-
- MESA_screen_surface
-
-Name Strings
-
- EGL_MESA_screen_surface
-
-Contact
-
- Brian Paul
-
- To discuss, join the dri-egl@lists.freedesktop.org list.
-
-Status
-
- Preliminary - totally subject to change.
-
-Version
-
- 10 (10 August 2005)
-
-Number
-
- TBD
-
-Dependencies
-
- EGL 1.0 or later.
-
-Overview
-
- EGL 1.1 supports three types of drawing surfaces:
- * Window surfaces
- * Pixmap surfaces
- * Pbuffer surfaces
- This extension defines a fourth type of drawing surface:
- * Screen surface
-
- A screen surface is a surface for which the (front) color buffer can
- be directly displayed (i.e. scanned out) on a monitor (such as a flat
- panel or CRT). In particular the color buffer memory will be allocated
- at a location in VRAM (and in a suitable format) which can be displayed
- by the graphics hardware.
-
- Note that the width and height of the screen surface need not exactly
- match the monitor's current resolution. For example, while the monitor
- may be configured to to show 1024x768 pixels, the associated screen
- surface may be larger, such as 1200x1000. The "screen origin" attribute
- will specify which region of the screen surface which is visible on the
- monitor. The screen surface can be scrolled by changing this origin.
-
- This extension also defines functions for controlling the monitor's
- display mode (width, height, refresh rate, etc), and specifing which
- screen surface is to be displayed on a monitor.
-
- The new EGLModeMESA type and related functions are very similar to the
- EGLConfig type and related functions. The user may get a list of
- supported modes for a screen and specify the mode to be used when
- displaying a screen surface.
-
-
-Issues
-
- 1. Should EGL_INTERLACE be a supported mode attribute?
-
- Arguments against:
-
- No, this should be provided by another extension which would
- also provide the mechanisms needed to play back interlaced video
- material correctly on hardware that supports it.
- This extension should prefer non-interlaced modes. [M. Danzer]
-
- Arguments for:
-
- An interlaced display can be of use without considering video
- material. Being able to query whether a screen is operating in
- interlaced mode can be used by applications to control their
- drawing. For example: avoid drawing 1-pixel-wide horizontal lines
- if screen is interlaced. [B. Paul]
-
- Resolution: Defer for future extension?
-
-
- 2. Should EGL_REFRESH_RATE be a supported mode attribute?
-
- Arguments for:
-
- Yes, it's been shown that applications and/or users need to select
- modes by this. [M. Danzer]
-
- Many examples have been given in which it's desirable to let the
- user choose from a variety of refresh rates without having to
- restart/reconfigure. [B. Paul]
-
- Arguments against:
-
- TBD.
-
- Resolution: Yes.
-
-
- 3. Exactly how should the list of modes returned by eglChooseConfigMESA
- be sorted?
-
- Current method is described in the text below. Subject to change.
-
- Alternately, leave the sorting order undefined so that each
- implementation can return the modes in order of "most desirable"
- to "least desirable" which may depend on the display technology
- (CRT vs LCD, etc) or other factors.
-
-
- 4. How should screen blanking be supported? Note that a screen can be
- disabled or turned off by calling eglShowSurface(dpy, scrn,
- EGL_NO_SURFACE, EGL_NO_MODE_MESA). But what about power-save mode?
-
- I would defer this to other extensions that depend on this one.
- I can imagine people wanting different semantics not just in
- relation to the power management API being exposed (DPMS or whatever)
- but also relating to what events can trigger EGL_CONTEXT_LOST. Also
- I'm not sure whether power management commands are properly operations
- on the Display or on a screen surface. [A. Jackson]
-
-
- 5. Should the EGL_PHYSICAL_SIZE_EGL query be kept? The size information
- isn't always reliable (consider video projectors) but can still be
- used to determine the pixel aspect ratio.
-
- Arguments for:
-
- X supports a similar query with DisplayWidthMM(), DisplayHeightMM().
- If this information can be easily queried with EDID, why not
- make it available to the user?
-
- Arguments against:
-
- Historically, these values aren't always accurate. Also, they're
- not always applicable to the display device.
-
- Other options:
-
- Perhaps just a pixel aspect ratio should be supported. [M. Danzer]
-
- Postpone for a future extension, if needed. [A. Jackson]
-
-
- 6. Should detailed mode timing information be exposed by this API?
-
- Probably not. Instead, offer that information in a layered extension.
-
-
- 7. How should the notion of a screen's "native" mode be expressed?
- For example, LCD panels have a native resolution and refresh rate
- that looks best but other sub-optimal resolutions may be supported.
-
- The mode attribute EGL_OPTIMAL_MESA will be set for modes which
- best match the screen. [M. Danzer]
-
-
- 8. Should eglQueryModeStringMESA() be included? This function returns
- a human-readable string which corresponds to an EGLMode.
-
- Arguments for:
-
- A mode name such as "HDTV-720P" might mean more to users than
- "1280x720@60Hz" if the later were generated via code.
-
- Arguments against:
-
- There's no standard syntax for the strings. May cause more
- trouble than it's worth.
-
- Postpone for future extension. [A. Jackson]
-
- Latest discussion leaning toward omitting this function.
-
-
- 9. Should we use "Get" or "Query" for functions which return state?
- The EGL 1.x specification doesn't seem to be totally consistent
- in this regard, but "Query" is used more often.
-
- Use "Get" for mode-related queries (as for EGLConfigs) but "Query"
- for everything else.
-
-
- 10. What should be the default size for screen surfaces?
-
- For Pbuffer surfaces the default width and height are zero.
- We'll do the same for screen surfaces. Since there's no function
- to resize surfaces it's useless to have a 0x0 screen, but this isn't
- a situation that'll normally be encountered.
-
-
- 11. Should there be a function for resizing a screen surface?
-
- Suppose one wants to change the screen's size in the EGL application.
- Also suppose there's a hardware restriction such that only one screen
- surface can exist at a time (either for lack of memory or because of
- memory layout restrictions).
-
- The basic idea is that the currently displayed screen surface must
- be deallocated before a new one can be created. Perhaps a resize
- function would work better?
-
-
- 12. How should sub-pixel LCD color information be made available?
- What about the display's gamma value?
-
- Perhaps expose as additional read-only mode attributes.
-
- Perhaps postpone for a layered extension.
-
-
- 13. What happens if the user attempts to delete a screen surface that
- is currently being shown?
-
- Spec currently says that's illegal and that an error (TBD) will be
- generated.
-
-
- 14. What if the physical screen size can't be determined? Should
- a query of EGL_PHYSICAL_SIZE_MESA return [0,0]?
-
- TBD.
-
-
- 15. Suppose the device's number of RAMDACs is different from the
- number of output ports. For example, a graphics card with
- two RAMDACs but three ports (VGA, DVI, TV).
-
- Address this in a follow-on extension. [Matthias Hopf]
-
-
- 16. How should we deal with on-the-fly device changes? For example,
- the monitor being unplugged and replaced by another with different
- characteristics?
-
- A HAL event could be received via DBUS in the application [J. Smirl,
- A. Jackson].
-
- Should there be an EGL mechanism for detecting this? Maybe an
- EGL_SCREEN_LOST error (similar to EGL_CONTEXT_LOST) can be recorded
- when there's a screen change. At least then the application can
- poll to detect this situation.
-
- Maybe leave that to a future extension.
-
- See also the EGL_SCREEN_COUNT_MESA query.
-
-
- 17. What if pixel-accurate panning is not supported (see
- eglScreenPositionMESA)? [M. Danzer]
-
- Is this a common problem? Can we ignore it for now?
-
-
- 18. Should eglShowSurfaceMESA be renamed to eglShowScreenSurfaceMESA?
-
- Probably.
-
-
-
-New Procedures and Functions
-
- EGLBoolean eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen,
- const EGLint *attrib_list,
- EGLModeMESA *modes, EGLint modes_size,
- EGLint *num_modes)
-
- EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA *modes, EGLint modes_size,
- EGLint *num_modes)
-
- EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode,
- EGLint attrib, EGLint *value)
-
-
- EGLBoolean eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens,
- EGLint screens_size, EGLint *num_screens)
-
- EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-
- EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLSurface surface, EGLModeMESA mode)
-
- EGLBoolean eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLint x, EGLint y)
-
-
- EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLint attrib, EGLint *value);
-
- EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLSurface *surface)
-
- EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA *mode)
-
- const char *eglQueryModeStringMESA(EGLDisplay dpy, EGLMode mode);
-
-
-New Types
-
- EGLModeMESA
- EGLScreenMESA
-
-New Tokens
-
- New error codes:
-
- EGL_BAD_SCREEN_MESA
- EGL_BAD_MODE_MESA
-
- Screen-related tokens:
-
- EGL_SCREEN_COUNT_MESA
- EGL_SCREEN_POSITION_MESA
- EGL_PHYSICAL_SIZE_MESA
- EGL_SCREEN_BIT_MESA
- EGL_SCREEN_POSITION_GRANULARITY_MESA
-
- Mode-related tokens:
-
- EGL_MODE_ID_MESA
- EGL_REFRESH_RATE_MESA
- EGL_INTERLACED_MESA
- EGL_OPTIMAL_MESA
- EGL_NO_MODE_MESA
-
-
-Additions to Chapter X of the EGL 1.1 Specification
-
- [XXX this all has to be rewritten to fit into the EGL specification
- and match the conventions of an EGL extension. For now, just list
- all the functions with brief descriptions.]
-
-
- EGLBoolean eglChooseModeMESA(EGLDisplay dpy, const EGLScreenMESA screen,
- EGLint *attrib_list, EGLModeMESA *modes,
- EGLint modes_size, EGLint *num_modes)
-
- Like eglChooseConfig, returns a list of EGLModes which match the given
- attribute list. This does not set the screen's current display mode.
- The attribute list is a list of token/value pairs terminated with
- EGL_NONE. Supported attributes include:
-
- Name Description
- --------------------- ---------------------------------------------
- EGL_WIDTH Mode width (resolution)
- EGL_HEIGHT Mode height (resolution)
- EGL_REFRESH_RATE_MESA The mode's refresh rate, multiplied by 1000
- EGL_INTERLACED_MESA 1 indicates an interlaced mode, 0 otherwise
- EGL_OPTIMAL_MESA Set if the most is especially optimal for the
- screen (ex. for particular LCD resolutions)
-
- Any other token will generate the error EGL_BAD_ATTRIBUTE.
-
- The list of modes returned by eglChooseModeMESA will be sorted
- according to the following criteria. See the discussion of table 3.3
- in the EGL specification for more information.
-
- Selection Sort Sort
- Attribute Default Criteria Order Priority
- -------------------- -------------- ----------- ------ --------
- EGL_OPTIMAL_MESA EGL_DONT_CARE Exact 1,0 1
- EGL_INTERLACED_MESA EGL_DONT_CARE Exact 0,1 2
- EGL_REFRESH_RATE EGL_DONT_CARE AtLeast Larger 3
- EGL_WIDTH EGL_DONT_CARE AtLeast Larger 4
- EGL_HEIGHT EGL_DONT_CARE AtLeast Larger 5
- EGL_MODE_ID_MESA EGL_DONT_CARE Exact Smaller 6
-
-
- EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA *modes, EGLint modes_size,
- EGLint *num_modes)
-
- Like eglGetConfigs, returns a list of all modes supported by the
- given screen. The returned modes will be sorted in the same manner
- as for eglChooseModeMESA().
-
-
-
- EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode,
- EGLint attrib, EGLint *value)
-
- Used to query mode attributes. The following attributes are supported:
-
- Name Return value description
- --------------------- ----------------------------------------------
- EGL_OPTIMAL_MESA 1 indicates an optimal mode, 0 otherwise
- EGL_INTERLACED_MESA 1 indicates an interlaced mode, 0 otherwise
- EGL_REFRESH_RATE_MESA The mode's refresh rate, multiplied by 1000
- EGL_WIDTH Mode width (resolution)
- EGL_HEIGHT Mode height (resolution)
- EGL_MODE_ID_MESA A unique small integer identifier for the mode
-
- Any other token will generate the error EGL_BAD_ATTRIBUTE.
-
-
-
- EGLBoolean eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens,
- EGLint screens_size, EGLint *num_screens)
-
- This function returns an array of all available screen handles.
- <screens_size> is the maximum number of screens to return in the
- <screens> array. <num_screens> will return the number of screen handles
- placed in the array, even if <screens> is NULL.
-
- The number of screens and the availability of each may change over
- time (hot-plugging). Screen handles will not be reused. When a
- screen handle becomes invalid, function calls which reference an
- invalid handle will generate EGL_BAD_SCREEN_MESA.
-
- The first screen handle returned will be considered to be the primary
- one.
-
-
-
- EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-
- Create a surface that can be displayed on a screen. <attrib_list> is
- an array of token/value pairs terminated with EGL_NONE. Valid tokens
- include:
-
- Name Description
- ---------------- --------------------------------
- EGL_WIDTH desired surface width in pixels
- EGL_HEIGHT desired surface height in pixels
-
- Any other token will generate the error EGL_BAD_ATTRIBUTE.
- The default width and height are zero.
-
-
-
- EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLSurface surface, EGLModeMESA mode)
-
- This function causes a screen to show the given surface (or more
- precisely, the surface's front color buffer) with the given mode.
-
- If the surface is in any way incompatible with the mode, the error
- EGL_BAD_MATCH will be generated, EGL_FALSE will be returned, and the
- previous screen state will remain in effect. This might occur when
- the bandwidth of the video-out subsystem is exceeded, or if the mode
- specifies a width or height that's greater than the width or height
- of the surface.
-
- To disable a screen, the values EGL_NO_SURFACE and EGL_NO_MODE_MESA
- be passed as the <surface> and <mode> parameters.
-
- The values of EGL_SCREEN_POSITION_MESA are clamped to the new valid
- range computed from the screen size and surface size. If the new
- surface is EGL_NO_SURFACE, EGL_SCREEN_POSITION_MESA is set to [0, 0].
-
-
- Attempting to delete a screen surface which is currently being
- displayed will result in the error EGL_BAD_ACCESS being generated.
-
-
-
- EGLBoolean eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLint x, EGLint y)
-
- Specifies the origin of the screen's view into the surface, if the
- surface is larger than the screen. Valid values for x and y are
- [0, surfaceWidth - screenWidth] and [0, surfaceHeight - screenHeight],
- respectively.
-
- The x and y values are also constrained to be integer multiples of the
- EGL_SCREEN_POSITION_GRANULARITY_MESA values.
-
-
-
-
- EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLint attrib, EGLint *value);
-
- Used to query screen attributes. <attrib> may be one of the following:
-
- Name Return value description
- ------------------------ ---------------------------------------------
- EGL_SCREEN_POSITION_MESA x, y position of the screen's origin with
- respect to the surface. If no surface is
- attached to the screen, [0, 0] is returned.
- EGL_SCREEN_POSITION_GRANULARITY_MESA
- Returns the granularity, in pixels, for
- which the screen position is constrained.
- EGL_PHYSICAL_SIZE_MESA Physical width and height of the screen
- in millimeters
-
- Any other token will generate the error EGL_BAD_ATTRIBUTE.
-
-
-
-
- EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLSurface *surface)
-
- Returns the surface currently displayed on the given screen. <surface>
- may be EGL_NO_SURFACE if the screen isn't currently showing any surface.
-
-
-
-
- EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA *mode)
-
- Returns the given screen's current display mode. The mode may be
- EGL_NO_MODE_MESA if the screen is currently disabled.
-
-
-
- const char *eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
-
- Returns a human-readable string for the given mode. The string is a
- zero-terminated C string which the user should not attempt to free.
- There is no standard syntax for mode strings. Applications should
- not directly rely on mode strings.
-
-
-
-Version History
-
- 1. 15 March 2005 - BrianP
- Initial version
-
- 2. 16 March 2005 - BrianP
- Removed EGL_DEPTH_MESA
- Added EGL_PHYSICAL_WIDTH_MESA, EGL_PHYSICAL_HEIGHT_MESA queries
- Added EGL_OPTIMAL_MESA for width/height/refresh rate selection
- Added possible eglQueryModeStringMESA() function
- More details of the new functions explained.
-
- 3. 18 March 2005 - BrianP
- Added screen_number to eglChooseModeMESA().
- Fix off by one mistake in value range for ORIGIN attributes
- Added Issues section
-
- 4. 21 March 2005 - BrianP
- Removed eglScreenAttribsMESA().
- Added eglScreenPositionMESA() to set screen origin.
- Replaced EGL_SCREEN_X/Y_OFFSET_MESA with EGL_SCREEN_POSITION_MESA.
- Replaced EGL_PHYSICAL_WIDTH/HEIGHT_MESA with EGL_PHYSICAL_SIZE_MESA.
- Use EGL_OPTIMAL_MESA as a new mode attribute. (Michel Danzer)
- Added a few more issues.
-
- 5. 6 April 2005 - BrianP
- More language for eglGetModeStringMESA().
- Added issues 10, 11, 12, 13, 14.
- Updated issue 3 discussion about mode sorting.
-
- 6. 22 April 2005 - BrianP
- Fixed "LDC" typo.
- Added issues 15, 16.
- Changed dependency on EGL 1.1 to EGL 1.0
- s/EGL_NUM_SCREENS_MESA/EGL_SCREEN_COUNT_MESA/
- Added eglQueryDisplayMESA() to New Functions section.
- Clarified language for the EGL_SCREEN_COUNT_MESA query.
-
- 7. 29 April 2005 - BrianP
- Added EGLScreenMESA type and eglGetScreensMESA() function. [J. Smirl].
- Replaced EGLint screen_number parameters with EGLScreenMESA screen.
- Added issue 17 (pixel-accurate panning)
-
- 8. 2 May 2005 - BrianP
- Removed eglQueryDisplayMESA.
- Fixed a few more EGLint -> EGLScreenMESA changes.
-
- 9. 20 May 2005 - BrianP
- Fixed a few typos.
- Updated some open issues text.
-
- 10. 10 August 2005 - BrianP
- Added EGL_SCREEN_POSITION_GRANULARITY_MESA.
-
diff --git a/src/egl/drivers/demo/Makefile b/src/egl/drivers/demo/Makefile
deleted file mode 100644
index 5c05633df50..00000000000
--- a/src/egl/drivers/demo/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# src/egl/drivers/demo/Makefile
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-
-INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/egl/main
-
-
-SOURCES = demo.c
-
-OBJECTS = $(SOURCES:.c=.o)
-
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-
-
-default: $(TOP)/$(LIB_DIR)/demodriver.so
-
-
-$(TOP)/$(LIB_DIR)/demodriver.so: $(OBJECTS)
- $(TOP)/bin/mklib -o demodriver.so -noprefix \
- -install $(TOP)/$(LIB_DIR) $(OBJECTS)
-
-
-
-clean:
- rm -f *.o
- rm -f *.so
diff --git a/src/egl/drivers/demo/demo.c b/src/egl/drivers/demo/demo.c
deleted file mode 100644
index 45545755c00..00000000000
--- a/src/egl/drivers/demo/demo.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Sample driver: Demo
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.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"
-
-
-/**
- * Demo driver-specific driver class derived from _EGLDriver
- */
-typedef struct demo_driver
-{
- _EGLDriver Base; /* base class/object */
- GLuint DemoStuff;
-} DemoDriver;
-
-#define DEMO_DRIVER(D) ((DemoDriver *) (D))
-
-
-/**
- * Demo driver-specific surface class derived from _EGLSurface
- */
-typedef struct demo_surface
-{
- _EGLSurface Base; /* base class/object */
- GLuint DemoStuff;
-} DemoSurface;
-
-
-/**
- * Demo driver-specific context class derived from _EGLContext
- */
-typedef struct demo_context
-{
- _EGLContext Base; /* base class/object */
- GLuint DemoStuff;
-} DemoContext;
-
-
-
-static EGLBoolean
-demoInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
- _EGLScreen *scrn;
- EGLint i;
-
- /* Create a screen */
- scrn = calloc(1, sizeof(*scrn));
- _eglAddScreen(disp, scrn);
-
- /* Create the screen's modes - silly example */
- _eglAddNewMode(scrn, 1600, 1200, 72 * 1000, "1600x1200-72");
- _eglAddNewMode(scrn, 1280, 1024, 72 * 1000, "1280x1024-70");
- _eglAddNewMode(scrn, 1280, 1024, 70 * 1000, "1280x1024-70");
- _eglAddNewMode(scrn, 1024, 768, 72 * 1000, "1024x768-72");
-
- /* Create the display's visual configs - silly example */
- for (i = 0; i < 4; i++) {
- _EGLConfig config;
- _eglInitConfig(&config, i + 1);
- _eglSetConfigAttrib(&config, EGL_RED_SIZE, 8);
- _eglSetConfigAttrib(&config, EGL_GREEN_SIZE, 8);
- _eglSetConfigAttrib(&config, EGL_BLUE_SIZE, 8);
- _eglSetConfigAttrib(&config, EGL_ALPHA_SIZE, 8);
- _eglSetConfigAttrib(&config, EGL_BUFFER_SIZE, 32);
- if (i & 1) {
- _eglSetConfigAttrib(&config, EGL_DEPTH_SIZE, 32);
- }
- if (i & 2) {
- _eglSetConfigAttrib(&config, EGL_STENCIL_SIZE, 8);
- }
- _eglSetConfigAttrib(&config, EGL_SURFACE_TYPE,
- (EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT));
- _eglAddConfig(disp, &config);
- }
-
- drv->Initialized = EGL_TRUE;
-
- *major = 1;
- *minor = 0;
-
- return EGL_TRUE;
-}
-
-
-static EGLBoolean
-demoTerminate(_EGLDriver *drv, EGLDisplay dpy)
-{
- /*DemoDriver *demo = DEMO_DRIVER(dpy);*/
- free(drv);
- return EGL_TRUE;
-}
-
-
-static DemoContext *
-LookupDemoContext(EGLContext ctx)
-{
- _EGLContext *c = _eglLookupContext(ctx);
- return (DemoContext *) c;
-}
-
-
-static DemoSurface *
-LookupDemoSurface(EGLSurface surf)
-{
- _EGLSurface *s = _eglLookupSurface(surf);
- return (DemoSurface *) s;
-}
-
-
-
-static EGLContext
-demoCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list)
-{
- _EGLConfig *conf;
- DemoContext *c;
- 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 = (DemoContext *) calloc(1, sizeof(DemoContext));
- if (!c)
- return EGL_NO_CONTEXT;
-
- _eglInitContext(drv, dpy, &c->Base, config, attrib_list);
- c->DemoStuff = 1;
- printf("demoCreateContext\n");
-
- /* generate handle and insert into hash table */
- _eglSaveContext(&c->Base);
- assert(c->Base.Handle);
-
- return c->Base.Handle;
-}
-
-
-static EGLSurface
-demoCreateWindowSurface(_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
-demoCreatePixmapSurface(_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
-demoCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-{
- DemoSurface *surf = (DemoSurface *) calloc(1, sizeof(DemoSurface));
- if (!surf)
- return EGL_NO_SURFACE;
-
- if (!_eglInitSurface(drv, dpy, &surf->Base, EGL_PBUFFER_BIT,
- config, attrib_list)) {
- free(surf);
- return EGL_NO_SURFACE;
- }
-
- /* a real driver would allocate the pbuffer memory here */
-
- return surf->Base.Handle;
-}
-
-
-static EGLBoolean
-demoDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
-{
- DemoSurface *fs = LookupDemoSurface(surface);
- _eglRemoveSurface(&fs->Base);
- if (fs->Base.IsBound) {
- fs->Base.DeletePending = EGL_TRUE;
- }
- else {
- free(fs);
- }
- return EGL_TRUE;
-}
-
-
-static EGLBoolean
-demoDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext context)
-{
- DemoContext *fc = LookupDemoContext(context);
- _eglRemoveContext(&fc->Base);
- if (fc->Base.IsBound) {
- fc->Base.DeletePending = EGL_TRUE;
- }
- else {
- free(fc);
- }
- return EGL_TRUE;
-}
-
-
-static EGLBoolean
-demoMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context)
-{
- /*DemoDriver *demo = DEMO_DRIVER(dpy);*/
- DemoSurface *readSurf = LookupDemoSurface(read);
- DemoSurface *drawSurf = LookupDemoSurface(draw);
- DemoContext *ctx = LookupDemoContext(context);
- EGLBoolean b;
-
- b = _eglMakeCurrent(drv, dpy, draw, read, context);
- if (!b)
- return EGL_FALSE;
-
- /* XXX this is where we'd do the hardware context switch */
- (void) drawSurf;
- (void) readSurf;
- (void) ctx;
-
- printf("eglMakeCurrent()\n");
- return EGL_TRUE;
-}
-
-
-/**
- * The bootstrap function. Return a new DemoDriver object and
- * plug in API functions.
- */
-_EGLDriver *
-_eglMain(_EGLDisplay *dpy)
-{
- DemoDriver *demo;
-
- demo = (DemoDriver *) calloc(1, sizeof(DemoDriver));
- if (!demo) {
- return NULL;
- }
-
- /* First fill in the dispatch table with defaults */
- _eglInitDriverFallbacks(&demo->Base);
- /* then plug in our Demo-specific functions */
- demo->Base.API.Initialize = demoInitialize;
- demo->Base.API.Terminate = demoTerminate;
- demo->Base.API.CreateContext = demoCreateContext;
- demo->Base.API.MakeCurrent = demoMakeCurrent;
- demo->Base.API.CreateWindowSurface = demoCreateWindowSurface;
- demo->Base.API.CreatePixmapSurface = demoCreatePixmapSurface;
- demo->Base.API.CreatePbufferSurface = demoCreatePbufferSurface;
- demo->Base.API.DestroySurface = demoDestroySurface;
- demo->Base.API.DestroyContext = demoDestroyContext;
-
- /* enable supported extensions */
- demo->Base.Extensions.MESA_screen_surface = EGL_TRUE;
- demo->Base.Extensions.MESA_copy_context = EGL_TRUE;
-
- return &demo->Base;
-}
diff --git a/src/egl/drivers/dri/Makefile b/src/egl/drivers/dri/Makefile
deleted file mode 100644
index cb11971c640..00000000000
--- a/src/egl/drivers/dri/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-# src/egl/drivers/dri/Makefile
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-
-### Include directories
-INCLUDE_DIRS = \
- -I. \
- -I/usr/include \
- -I/usr/include/drm \
- -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/mesa/drivers/dri/common
-
-
-HEADERS = egldri.h
-
-SOURCES = egldri.c
-
-OBJECTS = $(SOURCES:.c=.o)
-
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-
-
-default: depend library Makefile
-
-
-# EGLdri Library
-library: $(TOP)/$(LIB_DIR)/libEGLdri.so
-
-$(TOP)/$(LIB_DIR)/libEGLdri.so: $(OBJECTS)
- $(TOP)/bin/mklib -o EGLdri -major 1 -minor 0 \
- -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS)
-
-
-clean:
- rm -f *.o
- rm -f *.so
-
-depend: $(SOURCES) $(HEADERS)
- @ echo "running $(MKDEP)"
- @ touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
- $(SOURCES) $(HEADERS) > /dev/null
-
-include depend
-# DO NOT DELETE
-
diff --git a/src/egl/drivers/dri/egldri.c b/src/egl/drivers/dri/egldri.c
deleted file mode 100644
index cab0be2bd18..00000000000
--- a/src/egl/drivers/dri/egldri.c
+++ /dev/null
@@ -1,1138 +0,0 @@
-/**
- * Generic EGL driver for DRI.
- *
- * This file contains all the code needed to interface DRI-based drivers
- * with libEGL.
- *
- * There's a lot of dependencies on fbdev and the /sys/ filesystem.
- */
-
-
-#include <dirent.h>
-#include <stdio.h>
-#include <string.h>
-#include <linux/fb.h>
-#include <assert.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/time.h>
-
-#include "egldriver.h"
-#include "egldisplay.h"
-#include "eglcontext.h"
-#include "eglconfig.h"
-#include "eglsurface.h"
-#include "eglscreen.h"
-#include "eglglobals.h"
-#include "egllog.h"
-#include "eglmode.h"
-
-#include "egldri.h"
-
-const char *sysfs = "/sys/class";
-#define None 0
-static const int empty_attribute_list[1] = { None };
-
-
-/**
- * The bootstrap function.
- * Return a new driDriver object and plug in API functions.
- * This function, in turn, loads a specific DRI driver (ex: r200_dri.so).
- */
-_EGLDriver *
-_eglMain(_EGLDisplay *dpy)
-{
- int length;
- char path[NAME_MAX];
- struct dirent *dirent;
-#if 1
- FILE *file;
-#endif
- DIR *dir;
- _EGLDriver *driver = NULL;;
-
- snprintf(path, sizeof(path), "%s/drm", sysfs);
- if (!(dir = opendir(path))) {
- _eglLog(_EGL_WARNING, "%s DRM devices not found.", path);
- return EGL_FALSE;
- }
- while ((dirent = readdir(dir))) {
-
- if (strncmp(&dirent->d_name[0], "card", 4) != 0)
- continue;
- if (strcmp(&dirent->d_name[4], &dpy->Name[1]) != 0)
- continue;
-
- snprintf(path, sizeof(path), "%s/drm/card%s/dri_library_name", sysfs, &dpy->Name[1]);
- _eglLog(_EGL_INFO, "Opening %s", path);
-#if 1
- file = fopen(path, "r");
- if (!file) {
- _eglLog(_EGL_WARNING, "Failed to open %s", path);
- return NULL;
- }
- fgets(path, sizeof(path), file);
- fclose(file);
-#else
- strcpy(path, "r200\n");
-#endif
- if ((length = strlen(path)) > 0)
- path[length - 1] = '\0'; /* remove the trailing newline from sysfs */
- strncat(path, "_dri", sizeof(path));
-
- driver = _eglOpenDriver(dpy, path);
-
- break;
- }
- closedir(dir);
-
- return driver;
-}
-
-
-/**
- * Called by eglCreateContext via drv->API.CreateContext().
- */
-static EGLContext
-_eglDRICreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- EGLContext share_list, const EGLint *attrib_list)
-{
- driDisplay *disp = Lookup_driDisplay(dpy);
- driContext *c, *share;
- void *sharePriv;
- _EGLConfig *conf;
- __GLcontextModes visMode;
-
- c = (driContext *) calloc(1, sizeof(*c));
- if (!c)
- return EGL_NO_CONTEXT;
-
- if (!_eglInitContext(drv, dpy, &c->Base, config, attrib_list)) {
- free(c);
- return EGL_NO_CONTEXT;
- }
-
- if (share_list != EGL_NO_CONTEXT) {
- _EGLContext *shareCtx = _eglLookupContext(share_list);
- if (!shareCtx) {
- _eglError(EGL_BAD_CONTEXT, "eglCreateContext(share_list)");
- return EGL_FALSE;
- }
- }
- share = Lookup_driContext(share_list);
- if (share)
- sharePriv = share->driContext.private;
- else
- sharePriv = NULL;
-
- conf = _eglLookupConfig(drv, dpy, config);
- assert(conf);
- _eglConfigToContextModesRec(conf, &visMode);
-
- c->driContext.private = disp->driScreen.createNewContext(disp, &visMode,
- GLX_WINDOW_BIT, sharePriv, &c->driContext);
- if (!c->driContext.private) {
- free(c);
- return EGL_FALSE;
- }
-
- /* generate handle and insert into hash table */
- _eglSaveContext(&c->Base);
-
- return c->Base.Handle;
-}
-
-
-static EGLBoolean
-_eglDRIMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw,
- EGLSurface read, EGLContext context)
-{
- driDisplay *disp = Lookup_driDisplay(dpy);
- driContext *ctx = Lookup_driContext(context);
- EGLBoolean b;
-
- b = _eglMakeCurrent(drv, dpy, draw, read, context);
- if (!b)
- return EGL_FALSE;
-
- if (ctx) {
- ctx->driContext.bindContext(disp, 0, read, draw, &ctx->driContext);
- }
- else {
- /* what's this??? */
- /* _mesa_make_current( NULL, NULL, NULL );*/
- }
- return EGL_TRUE;
-}
-
-
-static EGLSurface
-_eglDRICreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-{
- driSurface *surf;
-
- surf = (driSurface *) calloc(1, sizeof(*surf));
- if (!surf) {
- return EGL_NO_SURFACE;
- }
-
- if (!_eglInitSurface(drv, dpy, &surf->Base, EGL_PBUFFER_BIT,
- config, attrib_list)) {
- free(surf);
- return EGL_NO_SURFACE;
- }
-
- /* create software-based pbuffer */
- {
-#if 0
- GLcontext *ctx = NULL; /* this _should_ be OK */
-#endif
- GLvisual visMode;
- _EGLConfig *conf = _eglLookupConfig(drv, dpy, config);
- assert(conf); /* bad config should be caught earlier */
- _eglConfigToContextModesRec(conf, &visMode);
-
-#if 0
- surf->mesa_framebuffer = _mesa_create_framebuffer(&visMode);
- _mesa_add_soft_renderbuffers(surf->mesa_framebuffer,
- GL_TRUE, /* color bufs */
- visMode.haveDepthBuffer,
- visMode.haveStencilBuffer,
- visMode.haveAccumBuffer,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */ );
-
- /* set pbuffer/framebuffer size */
- _mesa_resize_framebuffer(ctx, surf->mesa_framebuffer,
- surf->Base.Width, surf->Base.Height);
-#endif
- }
-
- _eglSaveSurface(&surf->Base);
-
- return surf->Base.Handle;
-}
-
-
-static EGLBoolean
-_eglDRIDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
-{
- driDisplay *disp = Lookup_driDisplay(dpy);
- driSurface *fs = Lookup_driSurface(surface);
-
- _eglRemoveSurface(&fs->Base);
-
- fs->drawable.destroyDrawable(disp, fs->drawable.private);
-
- if (fs->Base.IsBound) {
- fs->Base.DeletePending = EGL_TRUE;
- }
- else {
- free(fs);
- }
- return EGL_TRUE;
-}
-
-
-static EGLBoolean
-_eglDRIDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext context)
-{
- driDisplay *disp = Lookup_driDisplay(dpy);
- driContext *fc = Lookup_driContext(context);
-
- _eglRemoveContext(&fc->Base);
-
- fc->driContext.destroyContext(disp, 0, fc->driContext.private);
-
- if (fc->Base.IsBound) {
- fc->Base.DeletePending = EGL_TRUE;
- }
- else {
- free(fc);
- }
- return EGL_TRUE;
-}
-
-
-/**
- * Create a drawing surface which can be directly displayed on a screen.
- */
-static EGLSurface
-_eglDRICreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig cfg,
- const EGLint *attrib_list)
-{
- _EGLConfig *config = _eglLookupConfig(drv, dpy, cfg);
- driDisplay *disp = Lookup_driDisplay(dpy);
- driSurface *surface;
- GLvisual visMode;
-
- surface = (driSurface *) calloc(1, sizeof(*surface));
- if (!surface) {
- return EGL_NO_SURFACE;
- }
-
- /* init base class, do error checking, etc. */
- if (!_eglInitSurface(drv, dpy, &surface->Base, EGL_SCREEN_BIT_MESA,
- cfg, attrib_list)) {
- free(surface);
- return EGL_NO_SURFACE;
- }
-
- _eglSaveSurface(&surface->Base);
-
-
- /*
- * XXX this is where we should allocate video memory for the surface!
- */
-
-
- /* convert EGLConfig to GLvisual */
- _eglConfigToContextModesRec(config, &visMode);
-
- /* Create a new DRI drawable */
- if (!disp->driScreen.createNewDrawable(disp, &visMode, surface->Base.Handle,
- &surface->drawable, GLX_WINDOW_BIT,
- empty_attribute_list)) {
- _eglRemoveSurface(&surface->Base);
- free(surface);
- return EGL_NO_SURFACE;
- }
-
- return surface->Base.Handle;
-}
-
-
-/**
- * Set the fbdev colormap to a simple linear ramp.
- */
-static void
-_eglDRILoadColormap(driScreen *scrn)
-{
- char path[ NAME_MAX ];
- char *buffer;
- int i, fd;
-
- /* cmap attribute uses 256 lines of 16 bytes.
- * Allocate one extra char for the \0 added by sprintf()
- */
- if ( !( buffer = malloc( 256 * 16 + 1 ) ) ) {
- _eglLog(_EGL_WARNING, "Out of memory in _eglDRILoadColormap");
- return;
- }
-
- /* cmap attribute uses 256 lines of 16 bytes */
- for ( i = 0; i < 256; i++ ) {
- int c = (i << 8) | i; /* expand to 16-bit value */
- sprintf(&buffer[i * 16], "%02x%c%04x%04x%04x\n", i, ' ', c, c, c);
- }
-
- snprintf(path, sizeof(path), "%s/graphics/%s/color_map", sysfs, scrn->fb);
- if ( !( fd = open( path, O_RDWR ) ) ) {
- _eglLog(_EGL_WARNING, "Unable to open %s to set colormap", path);
- return;
- }
- write( fd, buffer, 256 * 16 );
- close( fd );
-
- free( buffer );
-}
-
-
-/**
- * Show the given surface on the named screen.
- * If surface is EGL_NO_SURFACE, disable the screen's output.
- * Called via eglShowSurfaceMESA().
- */
-EGLBoolean
-_eglDRIShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLScreenMESA screen,
- EGLSurface surface, EGLModeMESA m)
-{
- driDisplay *display = Lookup_driDisplay(dpy);
- driScreen *scrn = Lookup_driScreen(dpy, screen);
- driSurface *surf = Lookup_driSurface(surface);
- _EGLMode *mode = _eglLookupMode(dpy, m);
- FILE *file;
- char fname[NAME_MAX], buffer[1000];
- int temp;
-
- _eglLog(_EGL_DEBUG, "Enter _eglDRIShowScreenSurface");
-
- /* This will check that surface, screen, and mode are valid.
- * Also, it checks that the surface is large enough for the mode, etc.
- */
- if (!_eglShowScreenSurfaceMESA(drv, dpy, screen, surface, m))
- return EGL_FALSE;
-
- assert(surface == EGL_NO_SURFACE || surf);
- assert(m == EGL_NO_MODE_MESA || mode);
- assert(scrn);
-
- /*
- * Blank/unblank screen depending on if m == EGL_NO_MODE_MESA
- */
- snprintf(fname, sizeof(fname), "%s/graphics/%s/blank", sysfs, scrn->fb);
- file = fopen(fname, "r+");
- if (!file) {
- _eglLog(_EGL_WARNING, "kernel patch?? chown all fb sysfs attrib to allow"
- " write - %s\n", fname);
- 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) {
- /* all done! */
- return EGL_TRUE;
- }
-
- _eglLog(_EGL_INFO, "Setting display mode to %d x %d, %d bpp",
- mode->Width, mode->Height, display->bpp);
-
- /*
- * Set the display mode
- */
- snprintf(fname, sizeof(fname), "%s/graphics/%s/mode", sysfs, scrn->fb);
- file = fopen(fname, "r+");
- if (!file) {
- _eglLog(_EGL_WARNING, "Failed to open %s to set mode", fname);
- return EGL_FALSE;
- }
- /* note: nothing happens without the \n! */
- snprintf(buffer, sizeof(buffer), "%s\n", mode->Name);
- fputs(buffer, file);
- fclose(file);
- _eglLog(_EGL_INFO, "Set mode to %s in %s", mode->Name, fname);
-
- /*
- * Set display bpp
- */
- snprintf(fname, sizeof(fname), "%s/graphics/%s/bits_per_pixel",
- sysfs, scrn->fb);
- file = fopen(fname, "r+");
- if (!file) {
- _eglLog(_EGL_WARNING, "Failed to open %s to set bpp", fname);
- return EGL_FALSE;
- }
- display->bpp = GET_CONFIG_ATTRIB(surf->Base.Config, EGL_BUFFER_SIZE);
- display->cpp = display->bpp / 8;
- snprintf(buffer, sizeof(buffer), "%d", display->bpp);
- fputs(buffer, file);
- fclose(file);
-
- /*
- * Unblank display
- */
- snprintf(fname, sizeof(fname), "%s/graphics/%s/blank", sysfs, scrn->fb);
- file = fopen(fname, "r+");
- if (!file) {
- _eglLog(_EGL_WARNING, "Failed to open %s", fname);
- return EGL_FALSE;
- }
- snprintf(buffer, sizeof(buffer), "%d", VESA_NO_BLANKING);
- fputs(buffer, file);
- fclose(file);
-
- /*
- * Set fbdev buffer virtual size to surface's size.
- */
- snprintf(fname, sizeof(fname), "%s/graphics/%s/virtual_size", sysfs, scrn->fb);
- file = fopen(fname, "r+");
- snprintf(buffer, sizeof(buffer), "%d,%d", surf->Base.Width, surf->Base.Height);
- fputs(buffer, file);
- rewind(file);
- fgets(buffer, sizeof(buffer), file);
- sscanf(buffer, "%d,%d", &display->virtualWidth, &display->virtualHeight);
- fclose(file);
-
- /*
- * round up pitch as needed
- */
- temp = display->virtualWidth;
- switch (display->bpp / 8) {
- case 1: temp = (display->virtualWidth + 127) & ~127; break;
- case 2: temp = (display->virtualWidth + 31) & ~31; break;
- case 3:
- case 4: temp = (display->virtualWidth + 15) & ~15; break;
- default:
- _eglLog(_EGL_WARNING, "Bad display->bpp = %d in _eglDRIShowScreenSurface");
- }
- display->virtualWidth = temp;
-
- /*
- * sanity check
- */
- if (surf->Base.Width < display->virtualWidth ||
- surf->Base.Height < display->virtualHeight) {
- /* this case _should_ have been caught at the top of this function */
- _eglLog(_EGL_WARNING, "too small of surface in _eglDRIShowScreenSurfaceMESA "
- "%d x %d < %d x %d",
- surf->Base.Width,
- surf->Base.Height,
- display->virtualWidth,
- display->virtualHeight);
- /*
- return EGL_FALSE;
- */
- }
-
- /* This used to be done in the _eglDRICreateScreens routine. */
- _eglDRILoadColormap(scrn);
-
- return EGL_TRUE;
-}
-
-
-/**
- * Called by eglSwapBuffers via the drv->API.SwapBuffers() pointer.
- *
- * If the backbuffer is on a videocard, this is extraordinarily slow!
- */
-static EGLBoolean
-_eglDRISwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
-{
- driSurface *drawable = Lookup_driSurface(draw);
-
- /* this does error checking */
- if (!_eglSwapBuffers(drv, dpy, draw))
- return EGL_FALSE;
-
- drawable->drawable.swapBuffers(NULL, drawable->drawable.private);
-
- return EGL_TRUE;
-}
-
-
-EGLBoolean
-_eglDRIGetDisplayInfo(driDisplay *dpy)
-{
- char path[ NAME_MAX ];
- FILE *file;
- int i, rc;
- drmSetVersion sv;
- drm_magic_t magic;
-
- snprintf( path, sizeof( path ), "%s/graphics/fb%d/device/device", sysfs, dpy->minor );
- file = fopen( path, "r" );
- if (!file) {
- _eglLog(_EGL_WARNING, "Unable to open %s", path);
- return EGL_FALSE;
- }
- fgets( path, sizeof( path ), file );
- sscanf( path, "%x", &dpy->chipset );
- fclose( file );
-
- sprintf(path, DRM_DEV_NAME, DRM_DIR_NAME, dpy->minor);
- if ( ( dpy->drmFD = open(path, O_RDWR, 0) ) < 0 ) {
- _eglLog(_EGL_WARNING, "drmOpen failed.");
- return EGL_FALSE;
- }
-
- /* Set the interface version, asking for 1.2 */
- sv.drm_di_major = 1;
- sv.drm_di_minor = 2;
- sv.drm_dd_major = -1;
- if ((rc = drmSetInterfaceVersion(dpy->drmFD, &sv)))
- return EGL_FALSE;
-
- /* self authorize */
- if (drmGetMagic(dpy->drmFD, &magic))
- return EGL_FALSE;
- if (drmAuthMagic(dpy->drmFD, magic))
- return EGL_FALSE;
-
- /* Map framebuffer and SAREA */
- for (i = 0; ; i++) {
- drm_handle_t handle, offset;
- drmSize size;
- drmMapType type;
- drmMapFlags flags;
- int mtrr;
-
- if (drmGetMap(dpy->drmFD, i, &offset, &size, &type, &flags,
- &handle, &mtrr))
- break;
-
- if (type == DRM_FRAME_BUFFER) {
- rc = drmMap( dpy->drmFD, offset, size, (drmAddressPtr) &dpy->pFB);
- if (rc < 0) {
- _eglLog(_EGL_WARNING, "drmMap DRM_FAME_BUFFER failed");
- return EGL_FALSE;
- }
- dpy->fbSize = size;
- _eglLog(_EGL_INFO, "Found framebuffer size: %d", dpy->fbSize);
- }
- else if (type == DRM_SHM) {
- rc = drmMap(dpy->drmFD, offset, size, (drmAddressPtr) &dpy->pSAREA);
- if (rc < 0 ) {
- _eglLog(_EGL_WARNING, "drmMap DRM_SHM failed.");
- return EGL_FALSE;
- }
- dpy->SAREASize = SAREA_MAX;
- _eglLog(_EGL_DEBUG, "mapped SAREA 0x%08lx to %p, size %d",
- (unsigned long) offset, dpy->pSAREA, dpy->SAREASize );
- }
- }
-
- if (!dpy->pFB) {
- _eglLog(_EGL_WARNING, "failed to map framebuffer");
- return EGL_FALSE;
- }
-
- if (!dpy->pSAREA) {
- /* if this happens, make sure you're using the most recent DRM modules */
- _eglLog(_EGL_WARNING, "failed to map SAREA");
- return EGL_FALSE;
- }
-
- memset( dpy->pSAREA, 0, dpy->SAREASize );
-
- return EGL_TRUE;
-}
-
-
- /* Return the DRI per screen structure */
-static __DRIscreen *
-__eglFindDRIScreen(__DRInativeDisplay *ndpy, int scrn)
-{
- driDisplay *disp = (driDisplay *)ndpy;
- return &disp->driScreen;
-}
-
-
-static GLboolean
-__eglCreateContextWithConfig(__DRInativeDisplay* ndpy, int screen,
- int configID, void* context,
- drm_context_t * hHWContext)
-{
- __DRIscreen *pDRIScreen;
- __DRIscreenPrivate *psp;
-
- pDRIScreen = __eglFindDRIScreen(ndpy, screen);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- return GL_FALSE;
- }
- psp = (__DRIscreenPrivate *) pDRIScreen->private;
- if (psp->fd) {
- if (drmCreateContext(psp->fd, hHWContext)) {
- _eglLog(_EGL_WARNING, "drmCreateContext failed.");
- return GL_FALSE;
- }
- *(void**)context = (void*) *hHWContext;
- }
-#if 0
- __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)) {
- _eglLog(_EGL_WARNING, "drmCreateContext failed.");
- return GL_FALSE;
- }
- *(void**)contextID = (void*) *hHWContext;
- }
-#endif
- return GL_TRUE;
-}
-
-
-static GLboolean
-__eglDestroyContext( __DRInativeDisplay * ndpy, int screen, __DRIid context )
-{
- __DRIscreen *pDRIScreen;
- __DRIscreenPrivate *psp;
-
- pDRIScreen = __eglFindDRIScreen(ndpy, screen);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- return GL_FALSE;
- }
- psp = (__DRIscreenPrivate *) pDRIScreen->private;
- if (psp->fd)
- drmDestroyContext(psp->fd, context);
-
- return GL_TRUE;
-}
-
-
-static GLboolean
-__eglCreateDrawable(__DRInativeDisplay * ndpy, int screen,
- __DRIid drawable, drm_drawable_t * hHWDrawable)
-{
- __DRIscreen *pDRIScreen;
- __DRIscreenPrivate *psp;
-
- pDRIScreen = __eglFindDRIScreen(ndpy, screen);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- return GL_FALSE;
- }
- psp = (__DRIscreenPrivate *) pDRIScreen->private;
- if (psp->fd) {
- if (drmCreateDrawable(psp->fd, hHWDrawable)) {
- _eglLog(_EGL_WARNING, "drmCreateDrawable failed.");
- return GL_FALSE;
- }
- }
- return GL_TRUE;
-}
-
-
-static GLboolean
-__eglDestroyDrawable( __DRInativeDisplay * ndpy, int screen, __DRIid drawable )
-{
- __DRIscreen *pDRIScreen;
- __DRIscreenPrivate *psp;
-
- pDRIScreen = __eglFindDRIScreen(ndpy, screen);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- return GL_FALSE;
- }
- psp = (__DRIscreenPrivate *) pDRIScreen->private;
- if (psp->fd)
- drmDestroyDrawable(psp->fd, drawable);
-
- return GL_TRUE;
-}
-
-static GLboolean
-__eglGetDrawableInfo(__DRInativeDisplay * ndpy, int screen, __DRIid 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 )
-{
- __DRIscreen *pDRIScreen;
- __DRIscreenPrivate *psp;
- driSurface *surf = Lookup_driSurface(drawable);
-
- pDRIScreen = __eglFindDRIScreen(ndpy, screen);
-
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- return GL_FALSE;
- }
- psp = (__DRIscreenPrivate *) pDRIScreen->private;
- *X = 0;
- *Y = 0;
- *W = surf->Base.Width;
- *H = surf->Base.Height;
-
- *backX = 0;
- *backY = 0;
- *numBackClipRects = 0;
- *pBackClipRects = NULL;
-
- *numClipRects = 1;
- *pClipRects = malloc(sizeof(**pClipRects));
- **pClipRects = (drm_clip_rect_t){0, 0, surf->Base.Width, surf->Base.Height};
-
- psp->pSAREA->drawableTable[0].stamp = 1;
- *stamp = 1;
-#if 0
- 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;
-#endif
- return GL_TRUE;
-}
-
-
-/**
- * Implement \c __DRIinterfaceMethods::getProcAddress.
- */
-static __DRIfuncPtr
-get_proc_address(const char * proc_name)
-{
- return NULL;
-}
-
-
-/**
- * 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.
- */
-static void
-__egl_context_modes_destroy(__GLcontextModes *modes)
-{
- while ( modes != NULL ) {
- __GLcontextModes * const next = modes->next;
-
- free( modes );
- modes = next;
- }
-}
-
-
-/**
- * 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.
- */
-static __GLcontextModes *
-__egl_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 *) malloc( size );
- if ( *next == NULL ) {
- __egl_context_modes_destroy( base );
- base = NULL;
- break;
- }
-
- (void) memset( *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;
-}
-
-
-static GLboolean
-__eglWindowExists(__DRInativeDisplay *dpy, __DRIid draw)
-{
- return EGL_TRUE;
-}
-
-
-/**
- * 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.
- */
-static int
-__eglGetUST(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;
- }
-}
-
-/**
- * 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.
- */
-static GLboolean
-__eglGetMSCRate(__DRInativeDisplay * dpy, __DRIid drawable,
- int32_t * numerator, int32_t * denominator)
-{
- return EGL_TRUE;
-}
-
-
-/**
- * Table of functions exported by the loader to the driver.
- */
-static const __DRIinterfaceMethods interface_methods = {
- get_proc_address,
-
- __egl_context_modes_create,
- __egl_context_modes_destroy,
-
- __eglFindDRIScreen,
- __eglWindowExists,
-
- __eglCreateContextWithConfig,
- __eglDestroyContext,
-
- __eglCreateDrawable,
- __eglDestroyDrawable,
- __eglGetDrawableInfo,
-
- __eglGetUST,
- __eglGetMSCRate,
-};
-
-
-static int
-__glXGetInternalVersion(void)
-{
- return 20050725;
-}
-
-static const char createNewScreenName[] = "__driCreateNewScreen_20050727";
-
-
-/**
- * Do per-display initialization.
- */
-EGLBoolean
-_eglDRICreateDisplay(driDisplay *dpy, __DRIframebuffer *framebuffer)
-{
- PFNCREATENEWSCREENFUNC createNewScreen;
- int api_ver = __glXGetInternalVersion();
- __DRIversion ddx_version;
- __DRIversion dri_version;
- __DRIversion drm_version;
- drmVersionPtr version;
-
- version = drmGetVersion( dpy->drmFD );
- 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;
-
- createNewScreen = ( PFNCREATENEWSCREENFUNC ) dlsym( dpy->Base.Driver->LibHandle, createNewScreenName );
- if ( !createNewScreen ) {
- _eglLog(_EGL_WARNING, "Couldn't find %s function in the driver.",
- createNewScreenName );
- return EGL_FALSE;
- }
-
- dpy->driScreen.private = createNewScreen( dpy, 0, &dpy->driScreen, NULL,
- &ddx_version, &dri_version,
- &drm_version, framebuffer,
- dpy->pSAREA, dpy->drmFD,
- api_ver,
- & interface_methods,
- NULL);
- if (!dpy->driScreen.private)
- return EGL_FALSE;
-
- DRM_UNLOCK( dpy->drmFD, dpy->pSAREA, dpy->serverContext );
-
- return EGL_TRUE;
-}
-
-
-/**
- * Create all the EGL screens for the given display.
- */
-EGLBoolean
-_eglDRICreateScreens(driDisplay *dpy)
-{
- const int numScreens = 1; /* XXX fix this someday */
- int i;
-
- for (i = 0; i < numScreens; i++) {
- char path[ NAME_MAX ];
- FILE *file;
- driScreen *s;
-
- /* Create a screen */
- if ( !( s = ( driScreen * ) calloc( 1, sizeof( *s ) ) ) )
- return EGL_FALSE;
-
- snprintf( s->fb, NAME_MAX, "fb%d", dpy->minor );
- _eglInitScreen( &s->Base );
-
- _eglAddScreen( &dpy->Base, &s->Base );
-
- /* Create the screen's mode list */
- snprintf( path, sizeof( path ), "%s/graphics/%s/modes", sysfs, s->fb );
- file = fopen( path, "r" );
- while ( fgets( path, sizeof( path ), file ) ) {
- unsigned int x, y, r;
- char c;
- path[ strlen( path ) - 1 ] = '\0'; /* strip off \n from sysfs */
- sscanf( path, "%c:%ux%u-%u", &c, &x, &y, &r );
- _eglAddNewMode( &s->Base, x, y, r * 1000, path );
- }
- fclose( file );
-
- /*
- * NOTE: we used to set the colormap here, but that didn't work reliably.
- * Some entries near the start of the table would get corrupted by later
- * mode changes.
- */
- }
-
- return EGL_TRUE;
-}
-
-
-EGLBoolean
-_eglDRIInitialize(_EGLDriver *drv, EGLDisplay dpy,
- EGLint *major, EGLint *minor)
-{
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
- driDisplay *display;
-
- assert(disp);
-
- /* Create new driDisplay object to replace the _EGLDisplay that was
- * previously created.
- */
- display = calloc(1, sizeof(*display));
- display->Base = *disp;
- _eglHashInsert(_eglGlobal.Displays, disp->Handle, display);
- free(disp);
-
- *major = 1;
- *minor = 0;
-
- sscanf(&disp->Name[1], "%d", &display->minor);
-
- drv->Initialized = EGL_TRUE;
- return EGL_TRUE;
-}
-
-
-static EGLBoolean
-_eglDRITerminate(_EGLDriver *drv, EGLDisplay dpy)
-{
- driDisplay *display = Lookup_driDisplay(dpy);
- _eglCleanupDisplay(&display->Base);/*rename that function*/
- free(display);
- free(drv);
- return EGL_TRUE;
-}
-
-
-/**
- * Plug in the DRI-specific functions into the driver's dispatch table.
- * Also, enable some EGL extensions.
- */
-void
-_eglDRIInitDriverFallbacks(_EGLDriver *drv)
-{
- _eglInitDriverFallbacks(drv);
-
- drv->API.Initialize = _eglDRIInitialize;
- drv->API.Terminate = _eglDRITerminate;
- drv->API.CreateContext = _eglDRICreateContext;
- drv->API.MakeCurrent = _eglDRIMakeCurrent;
- drv->API.CreatePbufferSurface = _eglDRICreatePbufferSurface;
- drv->API.DestroySurface = _eglDRIDestroySurface;
- drv->API.DestroyContext = _eglDRIDestroyContext;
- drv->API.CreateScreenSurfaceMESA = _eglDRICreateScreenSurfaceMESA;
- drv->API.ShowScreenSurfaceMESA = _eglDRIShowScreenSurfaceMESA;
- drv->API.SwapBuffers = _eglDRISwapBuffers;
-
- /* enable supported extensions */
- drv->Extensions.MESA_screen_surface = EGL_TRUE;
- drv->Extensions.MESA_copy_context = EGL_TRUE;
-}
diff --git a/src/egl/drivers/dri/egldri.h b/src/egl/drivers/dri/egldri.h
deleted file mode 100644
index 34b12d64fcd..00000000000
--- a/src/egl/drivers/dri/egldri.h
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef EGLDRI_INCLUDED
-#define EGLDRI_INCLUDED
-
-#include "egldisplay.h"
-#include "eglscreen.h"
-#include "eglsurface.h"
-#include "eglcontext.h"
-#include "mtypes.h"
-#include "dri_util.h"
-#include "drm_sarea.h"
-
-/**
- * dri display-specific driver class derived from _EGLDisplay
- */
-typedef struct dri_display
-{
- _EGLDisplay Base; /* base class/object */
- void *pFB;
- int drmFD; /**< \brief DRM device file descriptor */
- int minor;
- unsigned long hFrameBuffer;
-
- int virtualWidth;
- int virtualHeight;
- int fbSize;
- int bpp;
- int cpp;
- int card_type;
- int SAREASize;
- drm_sarea_t *pSAREA;
- unsigned int serverContext; /**< \brief DRM context only active on server */
- unsigned long FBStart; /**< \brief physical address of the framebuffer */
- void *driverClientMsg;
- int driverClientMsgSize;
- int chipset;
- void *driverPrivate;
- drm_magic_t magic;
-
- __DRIscreen driScreen;
-
-} driDisplay;
-
-
-/**
- * dri driver-specific screen class derived from _EGLScreen
- */
-typedef struct dri_screen
-{
- _EGLScreen Base;
- char fb[NAME_MAX]; /** the screen name, like "fb0" */
-} driScreen;
-
-
-/**
- * dri driver-specific surface class derived from _EGLSurface
- */
-typedef struct dri_surface
-{
- _EGLSurface Base; /* base class/object */
- __DRIdrawable drawable;
-} driSurface;
-
-
-/**
- * dri driver-specific context class derived from _EGLContext
- */
-typedef struct dri_context
-{
- _EGLContext Base; /* base class/object */
- __DRIcontext driContext; /**< \brief context dependent methods */
-} driContext;
-
-
-
-static inline driDisplay *
-Lookup_driDisplay(EGLDisplay dpy)
-{
- _EGLDisplay *d = _eglLookupDisplay(dpy);
- return (driDisplay *) d;
-}
-
-
-static inline driScreen *
-Lookup_driScreen(EGLDisplay dpy, EGLScreenMESA screen)
-{
- _EGLScreen *s = _eglLookupScreen(dpy, screen);
- return (driScreen *) s;
-}
-
-
-static inline driContext *
-Lookup_driContext(EGLContext ctx)
-{
- _EGLContext *c = _eglLookupContext(ctx);
- return (driContext *) c;
-}
-
-
-static inline driSurface *
-Lookup_driSurface(EGLSurface surf)
-{
- _EGLSurface *s = _eglLookupSurface(surf);
- return (driSurface *) s;
-}
-
-extern void _eglDRIInitDriverFallbacks(_EGLDriver *drv);
-extern EGLBoolean _eglDRIShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA m);
-extern EGLBoolean _eglDRIInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor);
-extern EGLBoolean _eglDRIGetDisplayInfo(driDisplay *dpy);
-extern EGLBoolean _eglDRICreateDisplay(driDisplay *dpy, __DRIframebuffer *framebuffer);
-extern EGLBoolean _eglDRICreateScreens(driDisplay *dpy);
-
-#endif /* EGLDRI_INCLUDED */
diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile
deleted file mode 100644
index 431eda4197f..00000000000
--- a/src/egl/main/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-# src/egl/main/Makefile
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-
-INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/mesa/glapi
-
-HEADERS = \
- eglconfig.h \
- eglcontext.h \
- egldisplay.h \
- egldriver.h \
- eglglobals.h \
- egllog.h \
- eglhash.h \
- eglmode.h \
- eglscreen.h \
- eglsurface.h
-
-SOURCES = \
- eglapi.c \
- eglconfig.c \
- eglcontext.c \
- egldisplay.c \
- egldriver.c \
- eglglobals.c \
- egllog.c \
- eglhash.c \
- eglmode.c \
- eglscreen.c \
- eglsurface.c
-
-OBJECTS = $(SOURCES:.c=.o)
-
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-
-
-default: depend library
-
-
-# EGL Library
-library: $(TOP)/$(LIB_DIR)/libEGL.so
-
-$(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS)
- $(TOP)/bin/mklib -o EGL -major 1 -minor 0 \
- -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS)
-
-
-
-clean:
- rm -f *.o *.so*
- rm -f core.*
-
-
-depend: $(SOURCES) $(HEADERS)
- @ echo "running $(MKDEP)"
- @ touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
- $(SOURCES) $(HEADERS) > /dev/null
-
-include depend
-# DO NOT DELETE
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
deleted file mode 100644
index bfa580e6c3f..00000000000
--- a/src/egl/main/eglapi.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/**
- * Public EGL API entrypoints
- *
- * Generally, we use the EGLDisplay parameter as a key to lookup the
- * appropriate device driver handle, then jump though the driver's
- * dispatch table to handle the function.
- *
- * That allows us the option of supporting multiple, simultaneous,
- * heterogeneous hardware devices in the future.
- *
- * The EGLDisplay, EGLConfig, EGLContext and EGLSurface types are
- * opaque handles implemented with 32-bit unsigned integers.
- * It's up to the driver function or fallback function to look up the
- * handle and get an object.
- * By using opaque handles, we leave open the possibility of having
- * indirect rendering in the future, like GLX.
- *
- *
- * Notes on naming conventions:
- *
- * eglFooBar - public EGL function
- * EGL_FOO_BAR - public EGL token
- * EGLDatatype - public EGL datatype
- *
- * _eglFooBar - private EGL function
- * _EGLDatatype - private EGL datatype, typedef'd struct
- * _egl_struct - private EGL struct, non-typedef'd
- *
- */
-
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "eglcontext.h"
-#include "egldisplay.h"
-#include "egltypedefs.h"
-#include "eglglobals.h"
-#include "egldriver.h"
-#include "eglsurface.h"
-
-
-
-/**
- * NOTE: displayName is treated as a string in _eglChooseDriver()!!!
- * This will probably change!
- * See _eglChooseDriver() for details!
- */
-EGLDisplay APIENTRY
-eglGetDisplay(NativeDisplayType displayName)
-{
- _EGLDisplay *dpy;
- _eglInitGlobals();
- dpy = _eglNewDisplay(displayName);
- if (dpy)
- return dpy->Handle;
- else
- return EGL_NO_DISPLAY;
-}
-
-
-EGLBoolean APIENTRY
-eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- if (dpy) {
- _EGLDriver *drv = _eglChooseDriver(dpy);
- if (drv)
- return drv->API.Initialize(drv, dpy, major, minor);
- }
- return EGL_FALSE;
-}
-
-
-EGLBoolean APIENTRY
-eglTerminate(EGLDisplay dpy)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- if (drv)
- return _eglCloseDriver(drv, dpy);
- else
- return EGL_FALSE;
-}
-
-
-const char * APIENTRY
-eglQueryString(EGLDisplay dpy, EGLint name)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- if (drv)
- return drv->API.QueryString(drv, dpy, name);
- else
- return NULL;
-}
-
-
-EGLBoolean APIENTRY
-eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- /* XXX check drv for null in remaining functions */
- return drv->API.GetConfigs(drv, dpy, configs, config_size, num_config);
-}
-
-
-EGLBoolean APIENTRY
-eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.ChooseConfig(drv, dpy, attrib_list, configs, config_size, num_config);
-}
-
-
-EGLBoolean APIENTRY
-eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.GetConfigAttrib(drv, dpy, config, attribute, value);
-}
-
-
-EGLContext APIENTRY
-eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.CreateContext(drv, dpy, config, share_list, attrib_list);
-}
-
-
-EGLBoolean APIENTRY
-eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.DestroyContext(drv, dpy, ctx);
-}
-
-
-EGLBoolean APIENTRY
-eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.MakeCurrent(drv, dpy, draw, read, ctx);
-}
-
-
-EGLBoolean APIENTRY
-eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.QueryContext(drv, dpy, ctx, attribute, value);
-}
-
-
-EGLSurface APIENTRY
-eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.CreateWindowSurface(drv, dpy, config, window, attrib_list);
-}
-
-
-EGLSurface APIENTRY
-eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.CreatePixmapSurface(drv, dpy, config, pixmap, attrib_list);
-}
-
-
-EGLSurface APIENTRY
-eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.CreatePbufferSurface(drv, dpy, config, attrib_list);
-}
-
-
-EGLBoolean APIENTRY
-eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.DestroySurface(drv, dpy, surface);
-}
-
-
-EGLBoolean APIENTRY
-eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.QuerySurface(drv, dpy, surface, attribute, value);
-}
-
-
-EGLBoolean APIENTRY
-eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.SurfaceAttrib(drv, dpy, surface, attribute, value);
-}
-
-
-EGLBoolean APIENTRY
-eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.BindTexImage(drv, dpy, surface, buffer);
-}
-
-
-EGLBoolean APIENTRY
-eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.ReleaseTexImage(drv, dpy, surface, buffer);
-}
-
-
-EGLBoolean APIENTRY
-eglSwapInterval(EGLDisplay dpy, EGLint interval)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.SwapInterval(drv, dpy, interval);
-}
-
-
-EGLBoolean APIENTRY
-eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.SwapBuffers(drv, dpy, draw);
-}
-
-
-EGLBoolean APIENTRY
-eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, NativePixmapType target)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.CopyBuffers(drv, dpy, surface, target);
-}
-
-
-EGLBoolean APIENTRY
-eglWaitGL(void)
-{
- EGLDisplay dpy = eglGetCurrentDisplay();
- if (dpy != EGL_NO_DISPLAY) {
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.WaitGL(drv, dpy);
- }
- else
- return EGL_FALSE;
-}
-
-
-EGLBoolean APIENTRY
-eglWaitNative(EGLint engine)
-{
- EGLDisplay dpy = eglGetCurrentDisplay();
- if (dpy != EGL_NO_DISPLAY) {
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.WaitNative(drv, dpy, engine);
- }
- else
- return EGL_FALSE;
-}
-
-
-EGLDisplay APIENTRY
-eglGetCurrentDisplay(void)
-{
- _EGLDisplay *dpy = _eglGetCurrentDisplay();
- if (dpy)
- return dpy->Handle;
- else
- return EGL_NO_DISPLAY;
-}
-
-
-EGLContext APIENTRY
-eglGetCurrentContext(void)
-{
- _EGLContext *ctx = _eglGetCurrentContext();
- if (ctx)
- return ctx->Handle;
- else
- return EGL_NO_CONTEXT;
-}
-
-
-EGLSurface APIENTRY
-eglGetCurrentSurface(EGLint readdraw)
-{
- _EGLSurface *s = _eglGetCurrentSurface(readdraw);
- if (s)
- return s->Handle;
- else
- return EGL_NO_SURFACE;
-}
-
-
-EGLint APIENTRY
-eglGetError(void)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- EGLint e = t->LastError;
- t->LastError = EGL_SUCCESS;
- return e;
-}
-
-
-void (* APIENTRY eglGetProcAddress(const char *procname))()
-{
- typedef void (*genericFunc)();
- struct name_function {
- const char *name;
- _EGLProc function;
- };
- static struct name_function egl_functions[] = {
- /* alphabetical order */
- { "eglBindTexImage", (_EGLProc) eglBindTexImage },
- { "eglChooseConfig", (_EGLProc) eglChooseConfig },
- { "eglCopyBuffers", (_EGLProc) eglCopyBuffers },
- { "eglCreateContext", (_EGLProc) eglCreateContext },
- { "eglCreatePbufferSurface", (_EGLProc) eglCreatePbufferSurface },
- { "eglCreatePixmapSurface", (_EGLProc) eglCreatePixmapSurface },
- { "eglCreateWindowSurface", (_EGLProc) eglCreateWindowSurface },
- { "eglDestroyContext", (_EGLProc) eglDestroyContext },
- { "eglDestroySurface", (_EGLProc) eglDestroySurface },
- { "eglGetConfigAttrib", (_EGLProc) eglGetConfigAttrib },
- { "eglGetConfigs", (_EGLProc) eglGetConfigs },
- { "eglGetCurrentContext", (_EGLProc) eglGetCurrentContext },
- { "eglGetCurrentDisplay", (_EGLProc) eglGetCurrentDisplay },
- { "eglGetCurrentSurface", (_EGLProc) eglGetCurrentSurface },
- { "eglGetDisplay", (_EGLProc) eglGetDisplay },
- { "eglGetError", (_EGLProc) eglGetError },
- { "eglGetProcAddress", (_EGLProc) eglGetProcAddress },
- { "eglInitialize", (_EGLProc) eglInitialize },
- { "eglMakeCurrent", (_EGLProc) eglMakeCurrent },
- { "eglQueryContext", (_EGLProc) eglQueryContext },
- { "eglQueryString", (_EGLProc) eglQueryString },
- { "eglQuerySurface", (_EGLProc) eglQuerySurface },
- { "eglReleaseTexImage", (_EGLProc) eglReleaseTexImage },
- { "eglSurfaceAttrib", (_EGLProc) eglSurfaceAttrib },
- { "eglSwapBuffers", (_EGLProc) eglSwapBuffers },
- { "eglSwapInterval", (_EGLProc) eglSwapInterval },
- { "eglTerminate", (_EGLProc) eglTerminate },
- { "eglWaitGL", (_EGLProc) eglWaitGL },
- { "eglWaitNative", (_EGLProc) eglWaitNative },
- /* Extensions */
-#ifdef EGL_MESA_screen_surface
- { "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA },
- { "eglGetModesMESA", (_EGLProc) eglGetModesMESA },
- { "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA },
- { "eglCopyContextMESA", (_EGLProc) eglCopyContextMESA },
- { "eglGetScreensMESA", (_EGLProc) eglGetScreensMESA },
- { "eglCreateScreenSurfaceMESA", (_EGLProc) eglCreateScreenSurfaceMESA },
- { "eglShowScreenSurfaceMESA", (_EGLProc) eglShowScreenSurfaceMESA },
- { "eglScreenPositionMESA", (_EGLProc) eglScreenPositionMESA },
- { "eglQueryScreenMESA", (_EGLProc) eglQueryScreenMESA },
- { "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA },
- { "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA },
- { "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA },
-#endif /* EGL_MESA_screen_surface */
-#ifdef EGL_VERSION_1_2
- { "eglBindAPI", (_EGLProc) eglBindAPI },
- { "eglCreatePbufferFromClientBuffer", (_EGLProc) eglCreatePbufferFromClientBuffer },
- { "eglQueryAPI", (_EGLProc) eglQueryAPI },
- { "eglReleaseThread", (_EGLProc) eglReleaseThread },
- { "eglWaitClient", (_EGLProc) eglWaitClient },
-#endif /* EGL_VERSION_1_2 */
- { NULL, NULL }
- };
- EGLint i;
- for (i = 0; egl_functions[i].name; i++) {
- if (strcmp(egl_functions[i].name, procname) == 0) {
- return (genericFunc) egl_functions[i].function;
- }
- }
-#if 0
- /* XXX enable this code someday */
- return (genericFunc) _glapi_get_proc_address(procname);
-#else
- return NULL;
-#endif
-}
-
-
-/*
- * EGL_MESA_screen extension
- */
-
-EGLBoolean APIENTRY
-eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen,
- const EGLint *attrib_list, EGLModeMESA *modes,
- EGLint modes_size, EGLint *num_modes)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- if (drv)
- return drv->API.ChooseModeMESA(drv, dpy, screen, attrib_list, modes, modes_size, num_modes);
- else
- return EGL_FALSE;
-}
-
-
-EGLBoolean APIENTRY
-eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- if (drv)
- return drv->API.GetModesMESA(drv, dpy, screen, modes, mode_size, num_mode);
- else
- return EGL_FALSE;
-}
-
-
-EGLBoolean APIENTRY
-eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- if (drv)
- return drv->API.GetModeAttribMESA(drv, dpy, mode, attribute, value);
- else
- return EGL_FALSE;
-}
-
-
-EGLBoolean APIENTRY
-eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- if (drv)
- return drv->API.CopyContextMESA(drv, dpy, source, dest, mask);
- else
- return EGL_FALSE;
-}
-
-
-EGLBoolean
-eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- if (drv)
- return drv->API.GetScreensMESA(drv, dpy, screens, max_screens, num_screens);
- else
- return EGL_FALSE;
-}
-
-
-EGLSurface
-eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.CreateScreenSurfaceMESA(drv, dpy, config, attrib_list);
-}
-
-
-EGLBoolean
-eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.ShowScreenSurfaceMESA(drv, dpy, screen, surface, mode);
-}
-
-
-EGLBoolean
-eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.ScreenPositionMESA(drv, dpy, screen, x, y);
-}
-
-
-EGLBoolean
-eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.QueryScreenMESA(drv, dpy, screen, attribute, value);
-}
-
-
-EGLBoolean
-eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.QueryScreenSurfaceMESA(drv, dpy, screen, surface);
-}
-
-
-EGLBoolean
-eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.QueryScreenModeMESA(drv, dpy, screen, mode);
-}
-
-
-const char *
-eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.QueryModeStringMESA(drv, dpy, mode);
-}
-
-
-/**
- ** EGL 1.2
- **/
-
-#ifdef EGL_VERSION_1_2
-
-EGLBoolean
-eglBindAPI(EGLenum api)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
-
- switch (api) {
- case EGL_OPENGL_ES_API:
- if (_eglGlobal.OpenGLESAPISupported) {
- t->CurrentAPI = api;
- return EGL_TRUE;
- }
- _eglError(EGL_BAD_PARAMETER, "eglBindAPI");
- return EGL_FALSE;
- case EGL_OPENVG_API:
- if (_eglGlobal.OpenVGAPISupported) {
- t->CurrentAPI = api;
- return EGL_TRUE;
- }
- _eglError(EGL_BAD_PARAMETER, "eglBindAPI");
- return EGL_FALSE;
- default:
- return EGL_FALSE;
- }
- return EGL_TRUE;
-}
-
-
-EGLSurface
-eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
- EGLClientBuffer buffer, EGLConfig config,
- const EGLint *attrib_list)
-{
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.CreatePbufferFromClientBuffer(drv, dpy, buftype, buffer,
- config, attrib_list);
-}
-
-
-EGLenum
-eglQueryAPI(void)
-{
- /* returns one of EGL_OPENGL_ES_API or EGL_OPENVG_API */
- _EGLThreadInfo *t = _eglGetCurrentThread();
- return t->CurrentAPI;
-}
-
-
-EGLBoolean
-eglReleaseThread(void)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- EGLDisplay dpy = eglGetCurrentDisplay();
- if (dpy) {
- _EGLDriver *drv = _eglLookupDriver(dpy);
- /* unbind context */
- (void) drv->API.MakeCurrent(drv, dpy, EGL_NO_SURFACE,
- EGL_NO_SURFACE, EGL_NO_CONTEXT);
- }
- _eglDeleteThreadData(t);
- return EGL_TRUE;
-}
-
-
-EGLBoolean
-eglWaitClient(void)
-{
- EGLDisplay dpy = eglGetCurrentDisplay();
- if (dpy != EGL_NO_DISPLAY) {
- _EGLDriver *drv = _eglLookupDriver(dpy);
- return drv->API.WaitClient(drv, dpy);
- }
- else
- return EGL_FALSE;
-}
-
-#endif /* EGL_VERSION_1_2 */
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
deleted file mode 100644
index 555aa5dd9ef..00000000000
--- a/src/egl/main/eglapi.h
+++ /dev/null
@@ -1,119 +0,0 @@
-#ifndef EGLAPI_INCLUDED
-#define EGLAPI_INCLUDED
-
-/**
- * Typedefs for all EGL API entrypoint functions.
- */
-
-
-/* driver funcs */
-typedef EGLBoolean (*Initialize_t)(_EGLDriver *, EGLDisplay dpy, EGLint *major, EGLint *minor);
-typedef EGLBoolean (*Terminate_t)(_EGLDriver *, EGLDisplay dpy);
-
-/* config funcs */
-typedef EGLBoolean (*GetConfigs_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-typedef EGLBoolean (*ChooseConfig_t)(_EGLDriver *drv, EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-typedef EGLBoolean (*GetConfigAttrib_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
-
-/* context funcs */
-typedef EGLContext (*CreateContext_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
-typedef EGLBoolean (*DestroyContext_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx);
-typedef EGLBoolean (*MakeCurrent_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
-typedef EGLBoolean (*QueryContext_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
-
-/* surface funcs */
-typedef EGLSurface (*CreateWindowSurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
-typedef EGLSurface (*CreatePixmapSurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
-typedef EGLSurface (*CreatePbufferSurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-typedef EGLBoolean (*DestroySurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface);
-typedef EGLBoolean (*QuerySurface_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
-typedef EGLBoolean (*SurfaceAttrib_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
-typedef EGLBoolean (*BindTexImage_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-typedef EGLBoolean (*ReleaseTexImage_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-typedef EGLBoolean (*SwapInterval_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
-typedef EGLBoolean (*SwapBuffers_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw);
-typedef EGLBoolean (*CopyBuffers_t)(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
-
-/* misc funcs */
-typedef const char *(*QueryString_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint name);
-typedef EGLBoolean (*WaitGL_t)(_EGLDriver *drv, EGLDisplay dpy);
-typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint engine);
-
-
-#ifdef EGL_MESA_screen_surface
-typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
-typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
-typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
-typedef EGLBoolean (*CopyContextMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
-typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
-typedef EGLSurface (*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-typedef EGLBoolean (*ShowScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode);
-typedef EGLBoolean (*ScreenPositionMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
-typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
-typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
-typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
-typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode);
-#endif /* EGL_MESA_screen_surface */
-
-
-#ifdef EGL_VERSION_1_2
-typedef EGLBoolean (*WaitClient_t)(_EGLDriver *drv, EGLDisplay dpy);
-typedef EGLSurface (*CreatePbufferFromClientBuffer_t)(_EGLDriver *drv, EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
-#endif /* EGL_VERSION_1_2 */
-
-
-
-/**
- * The API dispatcher jumps through these functions
- */
-struct _egl_api
-{
- Initialize_t Initialize;
- Terminate_t Terminate;
-
- GetConfigs_t GetConfigs;
- ChooseConfig_t ChooseConfig;
- GetConfigAttrib_t GetConfigAttrib;
-
- CreateContext_t CreateContext;
- DestroyContext_t DestroyContext;
- MakeCurrent_t MakeCurrent;
- QueryContext_t QueryContext;
-
- CreateWindowSurface_t CreateWindowSurface;
- CreatePixmapSurface_t CreatePixmapSurface;
- CreatePbufferSurface_t CreatePbufferSurface;
- DestroySurface_t DestroySurface;
- QuerySurface_t QuerySurface;
- SurfaceAttrib_t SurfaceAttrib;
- BindTexImage_t BindTexImage;
- ReleaseTexImage_t ReleaseTexImage;
- SwapInterval_t SwapInterval;
- SwapBuffers_t SwapBuffers;
- CopyBuffers_t CopyBuffers;
-
- QueryString_t QueryString;
- WaitGL_t WaitGL;
- WaitNative_t WaitNative;
-
- /* EGL_MESA_screen extension */
- ChooseModeMESA_t ChooseModeMESA;
- GetModesMESA_t GetModesMESA;
- GetModeAttribMESA_t GetModeAttribMESA;
- CopyContextMESA_t CopyContextMESA;
- GetScreensMESA_t GetScreensMESA;
- CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA;
- ShowScreenSurfaceMESA_t ShowScreenSurfaceMESA;
- ScreenPositionMESA_t ScreenPositionMESA;
- QueryScreenMESA_t QueryScreenMESA;
- QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA;
- QueryScreenModeMESA_t QueryScreenModeMESA;
- QueryModeStringMESA_t QueryModeStringMESA;
-
-#ifdef EGL_VERSION_1_2
- WaitClient_t WaitClient;
- CreatePbufferFromClientBuffer_t CreatePbufferFromClientBuffer;
-#endif
-};
-
-#endif /* EGLAPI_INCLUDED */
diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c
deleted file mode 100644
index c180e30d7fa..00000000000
--- a/src/egl/main/eglconfig.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/**
- * EGL Configuration (pixel format) functions.
- */
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include "eglconfig.h"
-#include "egldisplay.h"
-#include "egldriver.h"
-#include "eglglobals.h"
-#include "egllog.h"
-
-
-#define MIN2(A, B) (((A) < (B)) ? (A) : (B))
-
-
-/**
- * Convert an _EGLConfig to a __GLcontextModes object.
- * NOTE: This routine may be incomplete - we're only making sure that
- * the fields needed by Mesa (for _mesa_create_context/framebuffer) are
- * set correctly.
- */
-void
-_eglConfigToContextModesRec(const _EGLConfig *config, __GLcontextModes *mode)
-{
- memset(mode, 0, sizeof(*mode));
-
- mode->rgbMode = GL_TRUE; /* no color index */
- mode->colorIndexMode = GL_FALSE;
- mode->doubleBufferMode = GL_TRUE; /* always DB for now */
- mode->stereoMode = GL_FALSE;
-
- mode->redBits = GET_CONFIG_ATTRIB(config, EGL_RED_SIZE);
- mode->greenBits = GET_CONFIG_ATTRIB(config, EGL_GREEN_SIZE);
- mode->blueBits = GET_CONFIG_ATTRIB(config, EGL_BLUE_SIZE);
- mode->alphaBits = GET_CONFIG_ATTRIB(config, EGL_ALPHA_SIZE);
- mode->rgbBits = GET_CONFIG_ATTRIB(config, EGL_BUFFER_SIZE);
-
- /* no rgba masks - fix? */
-
- mode->depthBits = GET_CONFIG_ATTRIB(config, EGL_DEPTH_SIZE);
- mode->haveDepthBuffer = mode->depthBits > 0;
-
- mode->stencilBits = GET_CONFIG_ATTRIB(config, EGL_STENCIL_SIZE);
- mode->haveStencilBuffer = mode->stencilBits > 0;
-
- /* no accum */
-
- mode->level = GET_CONFIG_ATTRIB(config, EGL_LEVEL);
- mode->samples = GET_CONFIG_ATTRIB(config, EGL_SAMPLES);
- mode->sampleBuffers = GET_CONFIG_ATTRIB(config, EGL_SAMPLE_BUFFERS);
-
- /* surface type - not really needed */
- mode->visualType = GLX_TRUE_COLOR;
- mode->renderType = GLX_RGBA_BIT;
-}
-
-
-void
-_eglSetConfigAttrib(_EGLConfig *config, EGLint attr, EGLint val)
-{
- assert(attr >= FIRST_ATTRIB);
- assert(attr < FIRST_ATTRIB + MAX_ATTRIBS);
- config->Attrib[attr - FIRST_ATTRIB] = val;
-}
-
-
-/**
- * Init the given _EGLconfig to default values.
- * \param id the configuration's ID.
- */
-void
-_eglInitConfig(_EGLConfig *config, EGLint id)
-{
- memset(config, 0, sizeof(*config));
- config->Handle = id;
- _eglSetConfigAttrib(config, EGL_CONFIG_ID, id);
- _eglSetConfigAttrib(config, EGL_BIND_TO_TEXTURE_RGB, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_BIND_TO_TEXTURE_RGBA, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_CONFIG_CAVEAT, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_NATIVE_RENDERABLE, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_MIN_SWAP_INTERVAL, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_MAX_SWAP_INTERVAL, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_SURFACE_TYPE,
- EGL_SCREEN_BIT_MESA | EGL_PBUFFER_BIT |
- EGL_PIXMAP_BIT | EGL_WINDOW_BIT);
- _eglSetConfigAttrib(config, EGL_TRANSPARENT_TYPE, EGL_NONE);
- _eglSetConfigAttrib(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE);
- _eglSetConfigAttrib(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE);
-#ifdef EGL_VERSION_1_2
- _eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER);
- _eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
-#endif /* EGL_VERSION_1_2 */
-}
-
-
-/**
- * Given an EGLConfig handle, return the corresponding _EGLConfig object.
- */
-_EGLConfig *
-_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config)
-{
- EGLint i;
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
- for (i = 0; i < disp->NumConfigs; i++) {
- if (disp->Configs[i].Handle == config) {
- return disp->Configs + i;
- }
- }
- return NULL;
-}
-
-
-/**
- * Add the given _EGLConfig to the given display.
- */
-_EGLConfig *
-_eglAddConfig(_EGLDisplay *display, const _EGLConfig *config)
-{
- _EGLConfig *newConfigs;
- EGLint n;
-
- n = display->NumConfigs;
-
- newConfigs = (_EGLConfig *) realloc(display->Configs,
- (n + 1) * sizeof(_EGLConfig));
- if (newConfigs) {
- display->Configs = newConfigs;
- display->Configs[n] = *config; /* copy struct */
- display->Configs[n].Handle = n;
- display->NumConfigs++;
- return display->Configs + n;
- }
- else {
- return NULL;
- }
-}
-
-
-/**
- * Parse the attrib_list to fill in the fields of the given _eglConfig
- * Return EGL_FALSE if any errors, EGL_TRUE otherwise.
- */
-EGLBoolean
-_eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list)
-{
- EGLint i;
-
- /* set all config attribs to EGL_DONT_CARE */
- for (i = 0; i < MAX_ATTRIBS; i++) {
- config->Attrib[i] = EGL_DONT_CARE;
- }
-
- for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
- const EGLint attr = attrib_list[i];
- if (attr >= EGL_BUFFER_SIZE &&
- attr <= EGL_MAX_SWAP_INTERVAL) {
- EGLint k = attr - FIRST_ATTRIB;
- assert(k >= 0);
- assert(k < MAX_ATTRIBS);
- config->Attrib[k] = attrib_list[++i];
- }
-#ifdef EGL_VERSION_1_2
- else if (attr == EGL_COLOR_BUFFER_TYPE) {
- EGLint bufType = attrib_list[++i];
- if (bufType != EGL_RGB_BUFFER && bufType != EGL_LUMINANCE_BUFFER) {
- _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
- return EGL_FALSE;
- }
- _eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, bufType);
- }
- else if (attr == EGL_RENDERABLE_TYPE) {
- EGLint renType = attrib_list[++i];
- if (renType & ~(EGL_OPENGL_ES_BIT | EGL_OPENVG_BIT)) {
- _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
- return EGL_FALSE;
- }
- _eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, renType);
- }
- else if (attr == EGL_ALPHA_MASK_SIZE ||
- attr == EGL_LUMINANCE_SIZE) {
- EGLint value = attrib_list[++i];
- _eglSetConfigAttrib(config, attr, value);
- }
-#endif /* EGL_VERSION_1_2 */
- else {
- _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
- return EGL_FALSE;
- }
- }
- return EGL_TRUE;
-}
-
-
-#define EXACT 1
-#define ATLEAST 2
-#define MASK 3
-#define SMALLER 4
-#define SPECIAL 5
-#define NONE 6
-
-struct sort_info {
- EGLint Attribute;
- EGLint MatchCriteria;
- EGLint SortOrder;
-};
-
-/* This encodes the info from Table 3.5 of the EGL spec, ordered by
- * Sort Priority.
- *
- * XXX To do: EGL 1.2 attribs
- */
-static struct sort_info SortInfo[] = {
- { EGL_CONFIG_CAVEAT, EXACT, SPECIAL },
- { EGL_RED_SIZE, ATLEAST, SPECIAL },
- { EGL_GREEN_SIZE, ATLEAST, SPECIAL },
- { EGL_BLUE_SIZE, ATLEAST, SPECIAL },
- { EGL_ALPHA_SIZE, ATLEAST, SPECIAL },
- { EGL_BUFFER_SIZE, ATLEAST, SMALLER },
- { EGL_SAMPLE_BUFFERS, ATLEAST, SMALLER },
- { EGL_SAMPLES, ATLEAST, SMALLER },
- { EGL_DEPTH_SIZE, ATLEAST, SMALLER },
- { EGL_STENCIL_SIZE, ATLEAST, SMALLER },
- { EGL_NATIVE_VISUAL_TYPE, EXACT, SPECIAL },
- { EGL_CONFIG_ID, EXACT, SMALLER },
- { EGL_BIND_TO_TEXTURE_RGB, EXACT, NONE },
- { EGL_BIND_TO_TEXTURE_RGBA, EXACT, NONE },
- { EGL_LEVEL, EXACT, NONE },
- { EGL_NATIVE_RENDERABLE, EXACT, NONE },
- { EGL_MAX_SWAP_INTERVAL, EXACT, NONE },
- { EGL_MIN_SWAP_INTERVAL, EXACT, NONE },
- { EGL_SURFACE_TYPE, MASK, NONE },
- { EGL_TRANSPARENT_TYPE, EXACT, NONE },
- { EGL_TRANSPARENT_RED_VALUE, EXACT, NONE },
- { EGL_TRANSPARENT_GREEN_VALUE, EXACT, NONE },
- { EGL_TRANSPARENT_BLUE_VALUE, EXACT, NONE },
- { 0, 0, 0 }
-};
-
-
-/**
- * Return EGL_TRUE if the attributes of c meet or exceed the minimums
- * specified by min.
- */
-static EGLBoolean
-_eglConfigQualifies(const _EGLConfig *c, const _EGLConfig *min)
-{
- EGLint i;
- for (i = 0; SortInfo[i].Attribute != 0; i++) {
- const EGLint mv = GET_CONFIG_ATTRIB(min, SortInfo[i].Attribute);
- if (mv != EGL_DONT_CARE) {
- const EGLint cv = GET_CONFIG_ATTRIB(c, SortInfo[i].Attribute);
- if (SortInfo[i].MatchCriteria == EXACT) {
- if (cv != mv) {
- return EGL_FALSE;
- }
- }
- else if (SortInfo[i].MatchCriteria == ATLEAST) {
- if (cv < mv) {
- return EGL_FALSE;
- }
- }
- else {
- assert(SortInfo[i].MatchCriteria == MASK);
- if ((mv & cv) != mv) {
- return EGL_FALSE;
- }
- }
- }
- }
- return EGL_TRUE;
-}
-
-
-/**
- * Compare configs 'a' and 'b' and return -1 if a belongs before b,
- * 1 if a belongs after b, or 0 if they're equal.
- * Used by qsort().
- */
-static int
-_eglCompareConfigs(const void *a, const void *b)
-{
- const _EGLConfig *aConfig = (const _EGLConfig *) a;
- const _EGLConfig *bConfig = (const _EGLConfig *) b;
- EGLint i;
-
- for (i = 0; SortInfo[i].Attribute != 0; i++) {
- const EGLint aVal = GET_CONFIG_ATTRIB(aConfig, SortInfo[i].Attribute);
- const EGLint bVal = GET_CONFIG_ATTRIB(bConfig, SortInfo[i].Attribute);
- if (SortInfo[i].SortOrder == SMALLER) {
- if (aVal < bVal)
- return -1;
- else if (aVal > bVal)
- return 1;
- /* else, continue examining attribute values */
- }
- else if (SortInfo[i].SortOrder == SPECIAL) {
- if (SortInfo[i].Attribute == EGL_CONFIG_CAVEAT) {
- /* values are EGL_NONE, SLOW_CONFIG, or NON_CONFORMANT_CONFIG */
- if (aVal < bVal)
- return -1;
- else if (aVal > bVal)
- return 1;
- }
- else if (SortInfo[i].Attribute == EGL_RED_SIZE ||
- SortInfo[i].Attribute == EGL_GREEN_SIZE ||
- SortInfo[i].Attribute == EGL_BLUE_SIZE ||
- SortInfo[i].Attribute == EGL_ALPHA_SIZE) {
- if (aVal > bVal)
- return -1;
- else if (aVal < bVal)
- return 1;
- }
- else {
- assert(SortInfo[i].Attribute == EGL_NATIVE_VISUAL_TYPE);
- if (aVal < bVal)
- return -1;
- else if (aVal > bVal)
- return 1;
- }
- }
- else {
- assert(SortInfo[i].SortOrder == NONE);
- /* continue examining attribute values */
- }
- }
-
- /* all attributes identical */
- return 0;
-}
-
-
-/**
- * Typical fallback routine for eglChooseConfig
- */
-EGLBoolean
-_eglChooseConfig(_EGLDriver *drv, EGLDisplay dpy, const EGLint *attrib_list,
- EGLConfig *configs, EGLint config_size, EGLint *num_configs)
-{
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
- _EGLConfig **configList, criteria;
- EGLint i, count;
-
- /* parse the attrib_list to initialize criteria */
- if (!_eglParseConfigAttribs(&criteria, attrib_list)) {
- return EGL_FALSE;
- }
-
- /* allocate array of config pointers */
- configList = (_EGLConfig **) malloc(config_size * sizeof(_EGLConfig *));
- if (!configList) {
- _eglError(EGL_BAD_CONFIG, "eglChooseConfig(out of memory)");
- return EGL_FALSE;
- }
-
- /* make array of pointers to qualifying configs */
- for (i = count = 0; i < disp->NumConfigs && count < config_size; i++) {
- if (_eglConfigQualifies(disp->Configs + i, &criteria)) {
- configList[count++] = disp->Configs + i;
- }
- }
-
- /* sort array of pointers */
- qsort(configList, count, sizeof(_EGLConfig *), _eglCompareConfigs);
-
- /* copy config handles to output array */
- for (i = 0; i < count; i++) {
- configs[i] = configList[i]->Handle;
- }
-
- free(configList);
-
- *num_configs = count;
-
- return EGL_TRUE;
-}
-
-
-/**
- * Fallback for eglGetConfigAttrib.
- */
-EGLBoolean
-_eglGetConfigAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- EGLint attribute, EGLint *value)
-{
- const _EGLConfig *conf = _eglLookupConfig(drv, dpy, config);
- const EGLint k = attribute - FIRST_ATTRIB;
- if (k >= 0 && k < MAX_ATTRIBS) {
- *value = conf->Attrib[k];
- return EGL_TRUE;
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
- return EGL_FALSE;
- }
-}
-
-
-/**
- * Fallback for eglGetConfigs.
- */
-EGLBoolean
-_eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs,
- EGLint config_size, EGLint *num_config)
-{
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
-
- if (!drv->Initialized) {
- _eglError(EGL_NOT_INITIALIZED, "eglGetConfigs");
- return EGL_FALSE;
- }
-
- if (configs) {
- EGLint i;
- *num_config = MIN2(disp->NumConfigs, config_size);
- for (i = 0; i < *num_config; i++) {
- configs[i] = disp->Configs[i].Handle;
- }
- }
- else {
- /* just return total number of supported configs */
- *num_config = disp->NumConfigs;
- }
-
- return EGL_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
-_eglFillInConfigs(_EGLConfig * configs,
- 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;
- _EGLConfig *config;
- unsigned i;
- unsigned j;
- unsigned k;
-
- if ( bytes_per_pixel[index] == 0 ) {
- _eglLog(_EGL_INFO,
- "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.",
- __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:
- _eglLog(_EGL_WARNING,
- "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.",
- __FUNCTION__, __LINE__, fb_format);
- return GL_FALSE;
- }
-
- config = configs;
- for (k = 0; k < num_depth_stencil_bits; k++) {
- for (i = 0; i < num_db_modes; i++) {
- for (j = 0; j < 2; j++) {
- _eglSetConfigAttrib(config, EGL_RED_SIZE, bits[0]);
- _eglSetConfigAttrib(config, EGL_GREEN_SIZE, bits[1]);
- _eglSetConfigAttrib(config, EGL_BLUE_SIZE, bits[2]);
- _eglSetConfigAttrib(config, EGL_ALPHA_SIZE, bits[3]);
- _eglSetConfigAttrib(config, EGL_BUFFER_SIZE,
- bits[0] + bits[1] + bits[2] + bits[3]);
-
- _eglSetConfigAttrib(config, EGL_STENCIL_SIZE, stencil_bits[k]);
- _eglSetConfigAttrib(config, EGL_DEPTH_SIZE, depth_bits[i]);
-
- _eglSetConfigAttrib(config, EGL_SURFACE_TYPE, EGL_SCREEN_BIT_MESA |
- EGL_PBUFFER_BIT | EGL_PIXMAP_BIT | EGL_WINDOW_BIT);
-
- config++;
- }
- }
- }
- return GL_TRUE;
-}
diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h
deleted file mode 100644
index 1fb976e5b4b..00000000000
--- a/src/egl/main/eglconfig.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef EGLCONFIG_INCLUDED
-#define EGLCONFIG_INCLUDED
-
-
-#include "egltypedefs.h"
-#include "GL/internal/glcore.h"
-
-
-#define MAX_ATTRIBS 100
-#define FIRST_ATTRIB EGL_BUFFER_SIZE
-
-
-struct _egl_config
-{
- EGLConfig Handle; /* the public/opaque handle which names this config */
- EGLint Attrib[MAX_ATTRIBS];
-};
-
-
-#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL)
-#define GET_CONFIG_ATTRIB(CONF, ATTR) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB])
-
-
-extern void
-_eglInitConfig(_EGLConfig *config, EGLint id);
-
-
-extern _EGLConfig *
-_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config);
-
-
-extern _EGLConfig *
-_eglAddConfig(_EGLDisplay *display, const _EGLConfig *config);
-
-
-extern EGLBoolean
-_eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list);
-
-
-extern EGLBoolean
-_eglChooseConfig(_EGLDriver *drv, EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-
-
-extern EGLBoolean
-_eglGetConfigAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
-
-
-extern EGLBoolean
-_eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-
-
-extern void
-_eglSetConfigAttrib(_EGLConfig *config, EGLint attr, EGLint val);
-
-extern GLboolean
-_eglFillInConfigs( _EGLConfig *configs,
- 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 );
-
-extern void
-_eglConfigToContextModesRec(const _EGLConfig *config, __GLcontextModes *mode);
-
-
-#endif /* EGLCONFIG_INCLUDED */
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
deleted file mode 100644
index 374c006dae7..00000000000
--- a/src/egl/main/eglcontext.c
+++ /dev/null
@@ -1,276 +0,0 @@
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include "eglconfig.h"
-#include "eglcontext.h"
-#include "egldisplay.h"
-#include "egldriver.h"
-#include "eglglobals.h"
-#include "eglhash.h"
-#include "eglsurface.h"
-
-
-/**
- * Initialize the given _EGLContext object to defaults.
- */
-EGLBoolean
-_eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
- EGLConfig config, const EGLint *attrib_list)
-{
- _EGLConfig *conf;
- _EGLDisplay *display = _eglLookupDisplay(dpy);
- EGLint i;
-
- conf = _eglLookupConfig(drv, dpy, config);
- if (!conf) {
- _eglError(EGL_BAD_CONFIG, "eglCreateContext");
- return EGL_FALSE;
- }
-
- 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;
- }
- }
-
- memset(ctx, 0, sizeof(_EGLContext));
- ctx->Display = display;
- ctx->Config = conf;
- ctx->DrawSurface = EGL_NO_SURFACE;
- ctx->ReadSurface = EGL_NO_SURFACE;
-
- return EGL_TRUE;
-}
-
-
-/*
- * Assign an EGLContext handle to the _EGLContext object then put it into
- * the hash table.
- */
-void
-_eglSaveContext(_EGLContext *ctx)
-{
- assert(ctx);
- ctx->Handle = _eglHashGenKey(_eglGlobal.Contexts);
- _eglHashInsert(_eglGlobal.Contexts, ctx->Handle, ctx);
-}
-
-
-/**
- * Remove the given _EGLContext object from the hash table.
- */
-void
-_eglRemoveContext(_EGLContext *ctx)
-{
- _eglHashRemove(_eglGlobal.Contexts, ctx->Handle);
-}
-
-
-/**
- * Return the _EGLContext object that corresponds to the given
- * EGLContext handle.
- */
-_EGLContext *
-_eglLookupContext(EGLContext ctx)
-{
- _EGLContext *c = (_EGLContext *) _eglHashLookup(_eglGlobal.Contexts, ctx);
- return c;
-}
-
-
-/**
- * Return the currently bound _EGLContext object, or NULL.
- */
-_EGLContext *
-_eglGetCurrentContext(void)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- return t->CurrentContext;
-}
-
-
-/**
- * Just a placeholder/demo function. Real driver will never use this!
- */
-EGLContext
-_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- EGLContext share_list, const EGLint *attrib_list)
-{
-#if 0 /* example code */
- _EGLContext *context;
-
- context = (_EGLContext *) calloc(1, sizeof(_EGLContext));
- if (!context)
- return EGL_NO_CONTEXT;
-
- if (!_eglInitContext(drv, dpy, context, config, attrib_list)) {
- free(context);
- return EGL_NO_CONTEXT;
- }
-
- _eglSaveContext(context);
- return context->Handle;
-#endif
- return EGL_NO_CONTEXT;
-}
-
-
-/**
- * Default fallback routine - drivers should usually override this.
- */
-EGLBoolean
-_eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx)
-{
- _EGLContext *context = _eglLookupContext(ctx);
- if (context) {
- _eglHashRemove(_eglGlobal.Contexts, ctx);
- if (context->IsBound) {
- context->DeletePending = EGL_TRUE;
- }
- else {
- free(context);
- }
- return EGL_TRUE;
- }
- else {
- _eglError(EGL_BAD_CONTEXT, "eglDestroyContext");
- return EGL_TRUE;
- }
-}
-
-
-EGLBoolean
-_eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx,
- EGLint attribute, EGLint *value)
-{
- _EGLContext *c = _eglLookupContext(ctx);
-
- (void) drv;
- (void) dpy;
-
- if (!c) {
- _eglError(EGL_BAD_CONTEXT, "eglQueryContext");
- return EGL_FALSE;
- }
-
- switch (attribute) {
- case EGL_CONFIG_ID:
- *value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID);
- return EGL_TRUE;
-#ifdef EGL_VERSION_1_2
- case EGL_CONTEXT_CLIENT_TYPE:
- *value = c->ClientAPI;
- return EGL_FALSE;
-#endif /* EGL_VERSION_1_2 */
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
- return EGL_FALSE;
- }
-}
-
-
-/**
- * Drivers will typically call this to do the error checking and
- * update the various IsBound and DeletePending flags.
- * Then, the driver will do its device-dependent Make-Current stuff.
- */
-EGLBoolean
-_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface d,
- EGLSurface r, EGLContext context)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- _EGLContext *ctx = _eglLookupContext(context);
- _EGLSurface *draw = _eglLookupSurface(d);
- _EGLSurface *read = _eglLookupSurface(r);
-
- _EGLContext *oldContext = _eglGetCurrentContext();
- _EGLSurface *oldDrawSurface = _eglGetCurrentSurface(EGL_DRAW);
- _EGLSurface *oldReadSurface = _eglGetCurrentSurface(EGL_READ);
-
- /* error checking */
- if (ctx) {
- if (draw == NULL || read == NULL) {
- _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
- return EGL_FALSE;
- }
- if (draw->Config != ctx->Config) {
- _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
- return EGL_FALSE;
- }
- if (read->Config != ctx->Config) {
- _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
- return EGL_FALSE;
- }
- }
-
- /*
- * check if the old context or surfaces need to be deleted
- */
- if (oldDrawSurface != NULL) {
- oldDrawSurface->IsBound = EGL_FALSE;
- if (oldDrawSurface->DeletePending) {
- /* make sure we don't try to rebind a deleted surface */
- if (draw == oldDrawSurface || draw == oldReadSurface) {
- draw = NULL;
- }
- /* really delete surface now */
- drv->API.DestroySurface(drv, dpy, oldDrawSurface->Handle);
- }
- }
- if (oldReadSurface != NULL && oldReadSurface != oldDrawSurface) {
- oldReadSurface->IsBound = EGL_FALSE;
- if (oldReadSurface->DeletePending) {
- /* make sure we don't try to rebind a deleted surface */
- if (read == oldDrawSurface || read == oldReadSurface) {
- read = NULL;
- }
- /* really delete surface now */
- drv->API.DestroySurface(drv, dpy, oldReadSurface->Handle);
- }
- }
- if (oldContext != NULL) {
- oldContext->IsBound = EGL_FALSE;
- if (oldContext->DeletePending) {
- /* make sure we don't try to rebind a deleted context */
- if (ctx == oldContext) {
- ctx = NULL;
- }
- /* really delete context now */
- drv->API.DestroyContext(drv, dpy, oldContext->Handle);
- }
- }
-
- if (ctx) {
- /* check read/draw again, in case we deleted them above */
- if (draw == NULL || read == NULL) {
- _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
- return EGL_FALSE;
- }
- ctx->DrawSurface = draw;
- ctx->ReadSurface = read;
- ctx->IsBound = EGL_TRUE;
- draw->IsBound = EGL_TRUE;
- read->IsBound = EGL_TRUE;
- }
-
- t->CurrentContext = ctx;
-
- return EGL_TRUE;
-}
-
-
-/**
- * This is defined by the EGL_MESA_copy_context extension.
- */
-EGLBoolean
-_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source,
- EGLContext dest, EGLint mask)
-{
- /* This function will always have to be overridden/implemented in the
- * device driver. If the driver is based on Mesa, use _mesa_copy_context().
- */
- return EGL_FALSE;
-}
diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h
deleted file mode 100644
index 82bfde151f3..00000000000
--- a/src/egl/main/eglcontext.h
+++ /dev/null
@@ -1,71 +0,0 @@
-
-#ifndef EGLCONTEXT_INCLUDED
-#define EGLCONTEXT_INCLUDED
-
-
-#include "egltypedefs.h"
-
-
-/**
- * "Base" class for device driver contexts.
- */
-struct _egl_context
-{
- EGLContext Handle; /* The public/opaque handle which names this object */
-
- _EGLDisplay *Display; /* who do I belong to? */
-
- _EGLConfig *Config;
-
- _EGLSurface *DrawSurface;
- _EGLSurface *ReadSurface;
-
- EGLBoolean IsBound;
- EGLBoolean DeletePending;
-#ifdef EGL_VERSION_1_2
- EGLint ClientAPI; /* Either EGL_OPENGL_ES_API or EGL_OPENVG_API */
-#endif /* EGL_VERSION_1_2 */
-};
-
-
-extern EGLBoolean
-_eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
- EGLConfig config, const EGLint *attrib_list);
-
-
-extern void
-_eglSaveContext(_EGLContext *ctx);
-
-
-extern void
-_eglRemoveContext(_EGLContext *ctx);
-
-
-extern _EGLContext *
-_eglLookupContext(EGLContext ctx);
-
-
-extern _EGLContext *
-_eglGetCurrentContext(void);
-
-
-extern EGLContext
-_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
-
-
-extern EGLBoolean
-_eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx);
-
-
-extern EGLBoolean
-_eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
-
-
-extern EGLBoolean
-_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
-
-
-extern EGLBoolean
-_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
-
-#endif /* EGLCONTEXT_INCLUDED */
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
deleted file mode 100644
index 074a85bf26b..00000000000
--- a/src/egl/main/egldisplay.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "eglcontext.h"
-#include "egldisplay.h"
-#include "eglglobals.h"
-#include "eglhash.h"
-
-
-static char *
-my_strdup(const char *s)
-{
- int l = strlen(s);
- char *s2 = malloc(l + 1);
- strcpy(s2, s);
- return s2;
-}
-
-
-/**
- * We're assuming that the NativeDisplayType parameter is actually
- * a string.
- * Return a new _EGLDisplay object for the given displayName
- */
-_EGLDisplay *
-_eglNewDisplay(NativeDisplayType displayName)
-{
- _EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay));
- if (dpy) {
- dpy->Handle = _eglHashGenKey(_eglGlobal.Displays);
- _eglHashInsert(_eglGlobal.Displays, dpy->Handle, dpy);
- if (displayName)
- dpy->Name = my_strdup(displayName);
- else
- dpy->Name = NULL;
- dpy->Driver = NULL; /* this gets set later */
- }
- return dpy;
-}
-
-
-/**
- * Return the _EGLDisplay object that corresponds to the given public/
- * opaque display handle.
- */
-_EGLDisplay *
-_eglLookupDisplay(EGLDisplay dpy)
-{
- _EGLDisplay *d = (_EGLDisplay *) _eglHashLookup(_eglGlobal.Displays, dpy);
- return d;
-}
-
-
-_EGLDisplay *
-_eglGetCurrentDisplay(void)
-{
- _EGLContext *ctx = _eglGetCurrentContext();
- if (ctx)
- return ctx->Display;
- else
- return NULL;
-}
-
-
-void
-_eglCleanupDisplay(_EGLDisplay *disp)
-{
- /* XXX incomplete */
- free(disp->Configs);
- free(disp->Name);
- /* driver deletes _EGLDisplay */
-}
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
deleted file mode 100644
index 1a03fdd4ad9..00000000000
--- a/src/egl/main/egldisplay.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef EGLDISPLAY_INCLUDED
-#define EGLDISPLAY_INCLUDED
-
-
-#include "egltypedefs.h"
-
-
-struct _egl_display
-{
- EGLDisplay Handle;
-
- char *Name;
- _EGLDriver *Driver;
-
- EGLint NumScreens;
- _EGLScreen **Screens; /* array [NumScreens] */
-
- EGLint NumConfigs;
- _EGLConfig *Configs; /* array [NumConfigs] */
-};
-
-
-extern _EGLDisplay *
-_eglNewDisplay(NativeDisplayType displayName);
-
-
-extern _EGLDisplay *
-_eglLookupDisplay(EGLDisplay dpy);
-
-
-extern _EGLDisplay *
-_eglGetCurrentDisplay(void);
-
-
-extern void
-_eglCleanupDisplay(_EGLDisplay *disp);
-
-
-extern EGLBoolean
-_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value);
-
-
-
-#endif /* EGLDISPLAY_INCLUDED */
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
deleted file mode 100644
index bda06dd827d..00000000000
--- a/src/egl/main/egldriver.c
+++ /dev/null
@@ -1,272 +0,0 @@
-#include <assert.h>
-#include <dlfcn.h>
-#include <stdio.h>
-#include <string.h>
-#include "eglconfig.h"
-#include "eglcontext.h"
-#include "egldisplay.h"
-#include "egldriver.h"
-#include "eglglobals.h"
-#include "egllog.h"
-#include "eglmode.h"
-#include "eglscreen.h"
-#include "eglsurface.h"
-
-
-const char *DefaultDriverName = "demodriver";
-
-
-/**
- * Choose and open/init the hardware driver for the given EGLDisplay.
- * Previously, the EGLDisplay was created with _eglNewDisplay() where
- * we recorded the user's NativeDisplayType parameter.
- *
- * Now we'll use the NativeDisplayType value.
- *
- * Currently, the native display value is treated as a string.
- * If the first character is ':' we interpret it as a screen or card index
- * number (i.e. ":0" or ":1", etc)
- * Else if the first character is '!' we interpret it as specific driver name
- * (i.e. "!r200" or "!i830".
- */
-_EGLDriver *
-_eglChooseDriver(EGLDisplay display)
-{
- _EGLDisplay *dpy = _eglLookupDisplay(display);
- _EGLDriver *drv;
- const char *driverName = DefaultDriverName;
- const char *name;
-
- assert(dpy);
-
- name = dpy->Name;
- if (!name) {
- /* use default */
- }
- else if (name[0] == ':' && (name[1] >= '0' && name[1] <= '9') && !name[2]) {
- /* XXX probe hardware here to determine which driver to open */
- driverName = "libEGLdri";
- }
- else if (name[0] == '!') {
- /* use specified driver name */
- driverName = name + 1;
- }
- else {
- /* Maybe display was returned by XOpenDisplay? */
- _eglLog(_EGL_FATAL, "eglChooseDriver() bad name");
- }
-
- _eglLog(_EGL_INFO, "eglChooseDriver() choosing %s", driverName);
-
- drv = _eglOpenDriver(dpy, driverName);
- dpy->Driver = drv;
-
- return drv;
-}
-
-
-/**
- * Open/load the named driver and call its bootstrap function: _eglMain().
- * \return new _EGLDriver object.
- */
-_EGLDriver *
-_eglOpenDriver(_EGLDisplay *dpy, const char *driverName)
-{
- _EGLDriver *drv;
- _EGLMain_t mainFunc;
- void *lib;
- char driverFilename[1000];
-
- /* XXX also prepend a directory path??? */
- sprintf(driverFilename, "%s.so", driverName);
-
- _eglLog(_EGL_DEBUG, "dlopen(%s)", driverFilename);
- lib = dlopen(driverFilename, RTLD_NOW);
- if (!lib) {
- _eglLog(_EGL_WARNING, "Could not open %s (%s)",
- driverFilename, dlerror());
- return NULL;
- }
-
- mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain");
- if (!mainFunc) {
- _eglLog(_EGL_WARNING, "_eglMain not found in %s", driverFilename);
- dlclose(lib);
- return NULL;
- }
-
- drv = mainFunc(dpy);
- if (!drv) {
- dlclose(lib);
- return NULL;
- }
- /* with a recurvise open you want the inner most handle */
- if (!drv->LibHandle)
- drv->LibHandle = lib;
- else
- dlclose(lib);
-
- drv->Display = dpy;
- return drv;
-}
-
-
-EGLBoolean
-_eglCloseDriver(_EGLDriver *drv, EGLDisplay dpy)
-{
- void *handle = drv->LibHandle;
- EGLBoolean b;
-
- _eglLog(_EGL_INFO, "Closing driver");
-
- /*
- * XXX check for currently bound context/surfaces and delete them?
- */
-
- b = drv->API.Terminate(drv, dpy);
- dlclose(handle);
- return b;
-}
-
-
-/**
- * Given a display handle, return the _EGLDriver for that display.
- */
-_EGLDriver *
-_eglLookupDriver(EGLDisplay dpy)
-{
- _EGLDisplay *d = _eglLookupDisplay(dpy);
- if (d)
- return d->Driver;
- else
- return NULL;
-}
-
-
-/**
- * Plug all the available fallback routines into the given driver's
- * dispatch table.
- */
-void
-_eglInitDriverFallbacks(_EGLDriver *drv)
-{
- /* If a pointer is set to NULL, then the device driver _really_ has
- * to implement it.
- */
- drv->API.Initialize = NULL;
- drv->API.Terminate = NULL;
-
- drv->API.GetConfigs = _eglGetConfigs;
- drv->API.ChooseConfig = _eglChooseConfig;
- drv->API.GetConfigAttrib = _eglGetConfigAttrib;
-
- drv->API.CreateContext = _eglCreateContext;
- drv->API.DestroyContext = _eglDestroyContext;
- drv->API.MakeCurrent = _eglMakeCurrent;
- drv->API.QueryContext = _eglQueryContext;
-
- drv->API.CreateWindowSurface = _eglCreateWindowSurface;
- drv->API.CreatePixmapSurface = _eglCreatePixmapSurface;
- drv->API.CreatePbufferSurface = _eglCreatePbufferSurface;
- drv->API.DestroySurface = _eglDestroySurface;
- drv->API.QuerySurface = _eglQuerySurface;
- drv->API.SurfaceAttrib = _eglSurfaceAttrib;
- drv->API.BindTexImage = _eglBindTexImage;
- drv->API.ReleaseTexImage = _eglReleaseTexImage;
- drv->API.SwapInterval = _eglSwapInterval;
- drv->API.SwapBuffers = _eglSwapBuffers;
- drv->API.CopyBuffers = _eglCopyBuffers;
-
- drv->API.QueryString = _eglQueryString;
- drv->API.WaitGL = _eglWaitGL;
- drv->API.WaitNative = _eglWaitNative;
-
-#ifdef EGL_MESA_screen_surface
- drv->API.ChooseModeMESA = _eglChooseModeMESA;
- drv->API.GetModesMESA = _eglGetModesMESA;
- drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
- drv->API.GetScreensMESA = _eglGetScreensMESA;
- drv->API.CreateScreenSurfaceMESA = _eglCreateScreenSurfaceMESA;
- drv->API.ShowScreenSurfaceMESA = _eglShowScreenSurfaceMESA;
- drv->API.ScreenPositionMESA = _eglScreenPositionMESA;
- drv->API.QueryScreenMESA = _eglQueryScreenMESA;
- drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
- drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
- drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
-#endif /* EGL_MESA_screen_surface */
-
-#ifdef EGL_VERSION_1_2
- drv->API.CreatePbufferFromClientBuffer = _eglCreatePbufferFromClientBuffer;
-#endif /* EGL_VERSION_1_2 */
-}
-
-
-/**
- * Examine the individual extension enable/disable flags and recompute
- * the driver's Extensions string.
- */
-static void
-_eglUpdateExtensionsString(_EGLDriver *drv)
-{
- drv->Extensions.String[0] = 0;
-
- if (drv->Extensions.MESA_screen_surface)
- strcat(drv->Extensions.String, "EGL_MESA_screen_surface ");
- if (drv->Extensions.MESA_copy_context)
- strcat(drv->Extensions.String, "EGL_MESA_copy_context ");
- assert(strlen(drv->Extensions.String) < MAX_EXTENSIONS_LEN);
-}
-
-
-
-const char *
-_eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
-{
- (void) drv;
- (void) dpy;
- switch (name) {
- case EGL_VENDOR:
- return "Mesa Project";
- case EGL_VERSION:
- return "1.0";
- case EGL_EXTENSIONS:
- _eglUpdateExtensionsString(drv);
- return drv->Extensions.String;
-#ifdef EGL_VERSION_1_2
- case EGL_CLIENT_APIS:
- /* XXX need to initialize somewhere */
- return drv->ClientAPIs;
-#endif
- default:
- _eglError(EGL_BAD_PARAMETER, "eglQueryString");
- return NULL;
- }
-}
-
-
-EGLBoolean
-_eglWaitGL(_EGLDriver *drv, EGLDisplay dpy)
-{
- /* just a placeholder */
- (void) drv;
- (void) dpy;
- return EGL_TRUE;
-}
-
-
-EGLBoolean
-_eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine)
-{
- /* just a placeholder */
- (void) drv;
- (void) dpy;
- switch (engine) {
- case EGL_CORE_NATIVE_ENGINE:
- break;
- default:
- _eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)");
- return EGL_FALSE;
- }
-
- return EGL_TRUE;
-}
diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h
deleted file mode 100644
index 88526e973d1..00000000000
--- a/src/egl/main/egldriver.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef EGLDRIVER_INCLUDED
-#define EGLDRIVER_INCLUDED
-
-
-#include "egltypedefs.h"
-#include "eglapi.h"
-
-/* should probably use a dynamic-length string, but this will do */
-#define MAX_EXTENSIONS_LEN 1000
-
-
-/**
- * Optional EGL extensions info.
- */
-struct _egl_extensions
-{
- EGLBoolean MESA_screen_surface;
- EGLBoolean MESA_copy_context;
-
- char String[MAX_EXTENSIONS_LEN];
-};
-
-
-/**
- * Base class for device drivers.
- */
-struct _egl_driver
-{
- EGLBoolean Initialized; /* set by driver after initialized */
-
- void *LibHandle; /* dlopen handle */
-
- _EGLDisplay *Display;
-
- int ABIversion;
- int APImajor, APIminor; /* returned through eglInitialize */
- const char *ClientAPIs;
-
- _EGLAPI API;
-
- _EGLExtensions Extensions;
-};
-
-
-extern _EGLDriver *_eglMain(_EGLDisplay *dpy);
-
-
-extern _EGLDriver *
-_eglChooseDriver(EGLDisplay dpy);
-
-
-extern _EGLDriver *
-_eglOpenDriver(_EGLDisplay *dpy, const char *driverName);
-
-
-extern EGLBoolean
-_eglCloseDriver(_EGLDriver *drv, EGLDisplay dpy);
-
-
-extern _EGLDriver *
-_eglLookupDriver(EGLDisplay d);
-
-
-extern void
-_eglInitDriverFallbacks(_EGLDriver *drv);
-
-
-extern const char *
-_eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name);
-
-
-extern EGLBoolean
-_eglWaitGL(_EGLDriver *drv, EGLDisplay dpy);
-
-
-extern EGLBoolean
-_eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine);
-
-
-
-#endif /* EGLDRIVER_INCLUDED */
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
deleted file mode 100644
index 608311d7494..00000000000
--- a/src/egl/main/eglglobals.c
+++ /dev/null
@@ -1,148 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "eglglobals.h"
-
-
-struct _egl_global _eglGlobal = { .Initialized = EGL_FALSE };
-
-
-/**
- * Init the fields in the _eglGlobal struct
- * May be safely called more than once.
- */
-void
-_eglInitGlobals(void)
-{
- if (!_eglGlobal.Initialized) {
- _eglGlobal.Displays = _eglNewHashTable();
- _eglGlobal.Contexts = _eglNewHashTable();
- _eglGlobal.Surfaces = _eglNewHashTable();
- _eglGlobal.FreeScreenHandle = 1;
- _eglGlobal.Initialized = EGL_TRUE;
-
- _eglGlobal.OpenGLESAPISupported = EGL_TRUE;
- _eglGlobal.OpenVGAPISupported = EGL_FALSE;
-
- /* XXX temporary */
- _eglGlobal.ThreadInfo = _eglNewThreadInfo();
- }
-}
-
-
-/**
- * Should call this via an atexit handler.
- */
-void
-_eglDestroyGlobals(void)
-{
- /* XXX TODO walk over table entries, deleting each */
- _eglDeleteHashTable(_eglGlobal.Displays);
- _eglDeleteHashTable(_eglGlobal.Contexts);
- _eglDeleteHashTable(_eglGlobal.Surfaces);
-}
-
-
-/**
- * Allocate and init a new _EGLThreadInfo object.
- */
-_EGLThreadInfo *
-_eglNewThreadInfo(void)
-{
- _EGLThreadInfo *t = (_EGLThreadInfo *) calloc(1, sizeof(_EGLThreadInfo));
- if (t) {
- t->CurrentContext = EGL_NO_CONTEXT;
- t->LastError = EGL_SUCCESS;
- t->CurrentAPI = EGL_NONE;
- }
- return t;
-}
-
-
-/**
- * Delete/free a _EGLThreadInfo object.
- */
-void
-_eglDeleteThreadData(_EGLThreadInfo *t)
-{
- free(t);
-}
-
-
-
-/**
- * Return pointer to calling thread's _EGLThreadInfo object.
- * Create a new one if needed.
- * Should never return NULL.
- */
-_EGLThreadInfo *
-_eglGetCurrentThread(void)
-{
- _eglInitGlobals();
-
- /* XXX temporary */
- return _eglGlobal.ThreadInfo;
-}
-
-
-/**
- * Record EGL error code.
- */
-void
-_eglError(EGLint errCode, const char *msg)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- const char *s;
-
- if (t->LastError == EGL_SUCCESS) {
- t->LastError = errCode;
-
- switch (errCode) {
- case EGL_BAD_ACCESS:
- s = "EGL_BAD_ACCESS";
- break;
- case EGL_BAD_ALLOC:
- s = "EGL_BAD_ALLOC";
- break;
- case EGL_BAD_ATTRIBUTE:
- s = "EGL_BAD_ATTRIBUTE";
- break;
- case EGL_BAD_CONFIG:
- s = "EGL_BAD_CONFIG";
- break;
- case EGL_BAD_CONTEXT:
- s = "EGL_BAD_CONTEXT";
- break;
- case EGL_BAD_CURRENT_SURFACE:
- s = "EGL_BAD_CURRENT_SURFACE";
- break;
- case EGL_BAD_DISPLAY:
- s = "EGL_BAD_DISPLAY";
- break;
- case EGL_BAD_MATCH:
- s = "EGL_BAD_MATCH";
- break;
- case EGL_BAD_NATIVE_PIXMAP:
- s = "EGL_BAD_NATIVE_PIXMAP";
- break;
- case EGL_BAD_NATIVE_WINDOW:
- s = "EGL_BAD_NATIVE_WINDOW";
- break;
- case EGL_BAD_PARAMETER:
- s = "EGL_BAD_PARAMETER";
- break;
- case EGL_BAD_SURFACE:
- s = "EGL_BAD_SURFACE";
- break;
- case EGL_BAD_SCREEN_MESA:
- s = "EGL_BAD_SCREEN_MESA";
- break;
- case EGL_BAD_MODE_MESA:
- s = "EGL_BAD_MODE_MESA";
- break;
- default:
- s = "other";
- }
- /* XXX temporary */
- fprintf(stderr, "EGL user error 0x%x (%s) in %s\n", errCode, s, msg);
- }
-}
diff --git a/src/egl/main/eglglobals.h b/src/egl/main/eglglobals.h
deleted file mode 100644
index c16baa2d6bd..00000000000
--- a/src/egl/main/eglglobals.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef EGLGLOBALS_INCLUDED
-#define EGLGLOBALS_INCLUDED
-
-#include "egltypedefs.h"
-#include "eglhash.h"
-
-
-/**
- * Per-thread info
- */
-struct _egl_thread_info
-{
- EGLint LastError;
- _EGLContext *CurrentContext;
- EGLenum CurrentAPI;
-};
-
-
-/**
- * Global library data
- */
-struct _egl_global
-{
- EGLBoolean Initialized;
-
- _EGLHashtable *Displays;
- _EGLHashtable *Contexts;
- _EGLHashtable *Surfaces;
-
- EGLScreenMESA FreeScreenHandle;
-
- /* XXX these may be temporary */
- EGLBoolean OpenGLESAPISupported;
- EGLBoolean OpenVGAPISupported;
-
- /* XXX temporary - should be thread-specific data (TSD) */
- _EGLThreadInfo *ThreadInfo;
-};
-
-
-extern struct _egl_global _eglGlobal;
-
-
-extern void
-_eglInitGlobals(void);
-
-
-extern void
-_eglDestroyGlobals(void);
-
-
-extern _EGLThreadInfo *
-_eglNewThreadInfo(void);
-
-
-extern void
-_eglDeleteThreadData(_EGLThreadInfo *t);
-
-
-extern _EGLThreadInfo *
-_eglGetCurrentThread(void);
-
-
-extern void
-_eglError(EGLint errCode, const char *msg);
-
-
-#endif /* EGLGLOBALS_INCLUDED */
diff --git a/src/egl/main/eglhash.c b/src/egl/main/eglhash.c
deleted file mode 100644
index 8e3da2e9061..00000000000
--- a/src/egl/main/eglhash.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/**
- * \file hash.c
- * Generic hash table.
- *
- * This code taken from Mesa and adapted.
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "eglhash.h"
-
-
-#define TABLE_SIZE 1023 /**< Size of lookup table/array */
-
-#define HASH_FUNC(K) ((K) % TABLE_SIZE)
-
-
-/*
- * Unfinished mutex stuff
- */
-
-typedef int _EGLMutex;
-
-static void
-_eglInitMutex(_EGLMutex m)
-{
-}
-
-static void
-_eglDestroyMutex(_EGLMutex m)
-{
-}
-
-static void
-_eglLockMutex(_EGLMutex m)
-{
-}
-
-static void
-_eglUnlockMutex(_EGLMutex m)
-{
-}
-
-
-
-typedef struct _egl_hashentry _EGLHashentry;
-
-struct _egl_hashentry
-{
- EGLuint Key; /**< the entry's key */
- void *Data; /**< the entry's data */
- _EGLHashentry *Next; /**< pointer to next entry */
-};
-
-
-struct _egl_hashtable
-{
- _EGLHashentry *Table[TABLE_SIZE]; /**< the lookup table */
- EGLuint MaxKey; /**< highest key inserted so far */
- _EGLMutex Mutex; /**< mutual exclusion lock */
-};
-
-
-/**
- * Create a new hash table.
- *
- * \return pointer to a new, empty hash table.
- */
-_EGLHashtable *
-_eglNewHashTable(void)
-{
- _EGLHashtable *table = (_EGLHashtable *) calloc(1, sizeof(_EGLHashtable));
- if (table) {
- _eglInitMutex(table->Mutex);
- table->MaxKey = 1;
- }
- return table;
-}
-
-
-
-/**
- * Delete a hash table.
- * Frees each entry on the hash table and then the hash table structure itself.
- * Note that the caller should have already traversed the table and deleted
- * the objects in the table (i.e. We don't free the entries' data pointer).
- *
- * \param table the hash table to delete.
- */
-void
-_eglDeleteHashTable(_EGLHashtable *table)
-{
- EGLuint i;
- assert(table);
- for (i = 0; i < TABLE_SIZE; i++) {
- _EGLHashentry *entry = table->Table[i];
- while (entry) {
- _EGLHashentry *next = entry->Next;
- free(entry);
- entry = next;
- }
- }
- _eglDestroyMutex(table->Mutex);
- free(table);
-}
-
-
-
-/**
- * Lookup an entry in the hash table.
- *
- * \param table the hash table.
- * \param key the key.
- *
- * \return pointer to user's data or NULL if key not in table
- */
-void *
-_eglHashLookup(const _EGLHashtable *table, EGLuint key)
-{
- EGLuint pos;
- const _EGLHashentry *entry;
-
- assert(table);
-
- if (!key)
- return NULL;
-
- pos = HASH_FUNC(key);
- entry = table->Table[pos];
- while (entry) {
- if (entry->Key == key) {
- return entry->Data;
- }
- entry = entry->Next;
- }
- return NULL;
-}
-
-
-
-/**
- * Insert a key/pointer pair into the hash table.
- * If an entry with this key already exists we'll replace the existing entry.
- *
- * \param table the hash table.
- * \param key the key (not zero).
- * \param data pointer to user data.
- */
-void
-_eglHashInsert(_EGLHashtable *table, EGLuint key, void *data)
-{
- /* search for existing entry with this key */
- EGLuint pos;
- _EGLHashentry *entry;
-
- assert(table);
- assert(key);
-
- _eglLockMutex(table->Mutex);
-
- if (key > table->MaxKey)
- table->MaxKey = key;
-
- pos = HASH_FUNC(key);
- entry = table->Table[pos];
- while (entry) {
- if (entry->Key == key) {
- /* replace entry's data */
- entry->Data = data;
- _eglUnlockMutex(table->Mutex);
- return;
- }
- entry = entry->Next;
- }
-
- /* alloc and insert new table entry */
- entry = (_EGLHashentry *) malloc(sizeof(_EGLHashentry));
- entry->Key = key;
- entry->Data = data;
- entry->Next = table->Table[pos];
- table->Table[pos] = entry;
-
- _eglUnlockMutex(table->Mutex);
-}
-
-
-
-/**
- * Remove an entry from the hash table.
- *
- * \param table the hash table.
- * \param key key of entry to remove.
- *
- * While holding the hash table's lock, searches the entry with the matching
- * key and unlinks it.
- */
-void
-_eglHashRemove(_EGLHashtable *table, EGLuint key)
-{
- EGLuint pos;
- _EGLHashentry *entry, *prev;
-
- assert(table);
- assert(key);
-
- _eglLockMutex(table->Mutex);
-
- pos = HASH_FUNC(key);
- prev = NULL;
- entry = table->Table[pos];
- while (entry) {
- if (entry->Key == key) {
- /* found it! */
- if (prev) {
- prev->Next = entry->Next;
- }
- else {
- table->Table[pos] = entry->Next;
- }
- free(entry);
- _eglUnlockMutex(table->Mutex);
- return;
- }
- prev = entry;
- entry = entry->Next;
- }
-
- _eglUnlockMutex(table->Mutex);
-}
-
-
-
-/**
- * Get the key of the "first" entry in the hash table.
- *
- * This is used in the course of deleting all display lists when
- * a context is destroyed.
- *
- * \param table the hash table
- *
- * \return key for the "first" entry in the hash table.
- *
- * While holding the lock, walks through all table positions until finding
- * the first entry of the first non-empty one.
- */
-EGLuint
-_eglHashFirstEntry(_EGLHashtable *table)
-{
- EGLuint pos;
- assert(table);
- _eglLockMutex(table->Mutex);
- for (pos = 0; pos < TABLE_SIZE; pos++) {
- if (table->Table[pos]) {
- _eglUnlockMutex(table->Mutex);
- return table->Table[pos]->Key;
- }
- }
- _eglUnlockMutex(table->Mutex);
- return 0;
-}
-
-
-/**
- * Given a hash table key, return the next key. This is used to walk
- * over all entries in the table. Note that the keys returned during
- * walking won't be in any particular order.
- * \return next hash key or 0 if end of table.
- */
-EGLuint
-_eglHashNextEntry(const _EGLHashtable *table, EGLuint key)
-{
- const _EGLHashentry *entry;
- EGLuint pos;
-
- assert(table);
- assert(key);
-
- /* Find the entry with given key */
- pos = HASH_FUNC(key);
- entry = table->Table[pos];
- while (entry) {
- if (entry->Key == key) {
- break;
- }
- entry = entry->Next;
- }
-
- if (!entry) {
- /* the key was not found, we can't find next entry */
- return 0;
- }
-
- if (entry->Next) {
- /* return next in linked list */
- return entry->Next->Key;
- }
- else {
- /* look for next non-empty table slot */
- pos++;
- while (pos < TABLE_SIZE) {
- if (table->Table[pos]) {
- return table->Table[pos]->Key;
- }
- pos++;
- }
- return 0;
- }
-}
-
-
-/**
- * Dump contents of hash table for debugging.
- *
- * \param table the hash table.
- */
-void
-_eglHashPrint(const _EGLHashtable *table)
-{
- EGLuint i;
- assert(table);
- for (i = 0; i < TABLE_SIZE; i++) {
- const _EGLHashentry *entry = table->Table[i];
- while (entry) {
- printf("%u %p\n", entry->Key, entry->Data);
- entry = entry->Next;
- }
- }
-}
-
-
-
-/**
- * Return a new, unused hash key.
- */
-EGLuint
-_eglHashGenKey(_EGLHashtable *table)
-{
- EGLuint k;
-
- _eglLockMutex(table->Mutex);
- k = table->MaxKey;
- table->MaxKey++;
- _eglUnlockMutex(table->Mutex);
- return k;
-}
-
diff --git a/src/egl/main/eglhash.h b/src/egl/main/eglhash.h
deleted file mode 100644
index 1d6db9598ce..00000000000
--- a/src/egl/main/eglhash.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * \file eglhash.h
- * Generic hash table.
- */
-
-
-#ifndef EGLHASH_INCLUDED
-#define EGLHASH_INCLUDED
-
-
-/* XXX move this? */
-typedef unsigned int EGLuint;
-
-
-typedef struct _egl_hashtable _EGLHashtable;
-
-
-extern _EGLHashtable *_eglNewHashTable(void);
-
-extern void _eglDeleteHashTable(_EGLHashtable *table);
-
-extern void *_eglHashLookup(const _EGLHashtable *table, EGLuint key);
-
-extern void _eglHashInsert(_EGLHashtable *table, EGLuint key, void *data);
-
-extern void _eglHashRemove(_EGLHashtable *table, EGLuint key);
-
-extern EGLuint _eglHashFirstEntry(_EGLHashtable *table);
-
-extern EGLuint _eglHashNextEntry(const _EGLHashtable *table, EGLuint key);
-
-extern void _eglHashPrint(const _EGLHashtable *table);
-
-extern EGLuint _eglHashGenKey(_EGLHashtable *table);
-
-extern void _egltest_hash_functions(void);
-
-
-#endif /* EGLHASH_INCLUDED */
diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c
deleted file mode 100644
index 59b1d2684e3..00000000000
--- a/src/egl/main/egllog.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Logging facility for debug/info messages.
- */
-
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "egllog.h"
-
-#define MAXSTRING 1000
-
-
-/* XXX init this with an env var or something */
-static EGLint ReportingLevel = _EGL_DEBUG;
-
-
-/**
- * Log a message to stderr.
- * \param level one of _EGL_FATAL, _EGL_WARNING, _EGL_INFO, _EGL_DEBUG.
- */
-void
-_eglLog(EGLint level, const char *fmtStr, ...)
-{
- va_list args;
- char msg[MAXSTRING];
- const char *levelStr;
-
- if (level <= ReportingLevel) {
- switch (level) {
- case _EGL_FATAL:
- levelStr = "Fatal";
- break;
- case _EGL_WARNING:
- levelStr = "Warning";
- break;
- case _EGL_INFO:
- levelStr = "Info";
- break;
- case _EGL_DEBUG:
- levelStr = "Debug";
- break;
- default:
- levelStr = "";
- }
-
- va_start(args, fmtStr);
- vsnprintf(msg, MAXSTRING, fmtStr, args);
- va_end(args);
-
- fprintf(stderr, "EGL %s: %s\n", levelStr, msg);
-
- if (level == _EGL_FATAL) {
- exit(1); /* or abort()? */
- }
- }
-}
diff --git a/src/egl/main/egllog.h b/src/egl/main/egllog.h
deleted file mode 100644
index 2fa352f155d..00000000000
--- a/src/egl/main/egllog.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef EGLLOG_INCLUDED
-#define EGLLOG_INCLUDED
-
-#include "egltypedefs.h"
-
-#define _EGL_FATAL 0 /* unrecoverable error */
-#define _EGL_WARNING 1 /* recoverable error/problem */
-#define _EGL_INFO 2 /* just useful info */
-#define _EGL_DEBUG 3 /* useful info for debugging */
-
-
-extern void
-_eglLog(EGLint level, const char *fmtStr, ...);
-
-
-#endif /* EGLLOG_INCLUDED */
diff --git a/src/egl/main/eglmode.c b/src/egl/main/eglmode.c
deleted file mode 100644
index 786432234bb..00000000000
--- a/src/egl/main/eglmode.c
+++ /dev/null
@@ -1,431 +0,0 @@
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "egldisplay.h"
-#include "egldriver.h"
-#include "eglmode.h"
-#include "eglglobals.h"
-#include "eglscreen.h"
-
-
-#define MIN2(A, B) (((A) < (B)) ? (A) : (B))
-
-
-static char *
-my_strdup(const char *s)
-{
- if (s) {
- int l = strlen(s);
- char *s2 = malloc(l + 1);
- if (s2)
- strcpy(s2, s);
- return s2;
- }
- else {
- return NULL;
- }
-}
-
-
-/**
- * Given an EGLModeMESA handle, return the corresponding _EGLMode object
- * or null if non-existant.
- */
-_EGLMode *
-_eglLookupMode(EGLDisplay dpy, EGLModeMESA mode)
-{
- const _EGLDisplay *disp = _eglLookupDisplay(dpy);
- EGLint scrnum;
-
- /* loop over all screens on the display */
- for (scrnum = 0; scrnum < disp->NumScreens; scrnum++) {
- const _EGLScreen *scrn = disp->Screens[scrnum];
- EGLint i;
- /* search list of modes for handle */
- for (i = 0; i < scrn->NumModes; i++) {
- if (scrn->Modes[i].Handle == mode) {
- return scrn->Modes + i;
- }
- }
- }
-
- return NULL;
-}
-
-
-/**
- * Add a new mode with the given attributes (width, height, depth, refreshRate)
- * to the given screen.
- * Assign a new mode ID/handle to the mode as well.
- * \return pointer to the new _EGLMode
- */
-_EGLMode *
-_eglAddNewMode(_EGLScreen *screen, EGLint width, EGLint height,
- EGLint refreshRate, const char *name)
-{
- EGLint n;
- _EGLMode *newModes;
-
- assert(screen);
- assert(width > 0);
- assert(height > 0);
- assert(refreshRate > 0);
-
- n = screen->NumModes;
- newModes = (_EGLMode *) realloc(screen->Modes, (n+1) * sizeof(_EGLMode));
- if (newModes) {
- screen->Modes = newModes;
- screen->Modes[n].Handle = n + 1;
- screen->Modes[n].Width = width;
- screen->Modes[n].Height = height;
- screen->Modes[n].RefreshRate = refreshRate;
- screen->Modes[n].Optimal = EGL_FALSE;
- screen->Modes[n].Interlaced = EGL_FALSE;
- screen->Modes[n].Name = my_strdup(name);
- screen->NumModes++;
- return screen->Modes + n;
- }
- else {
- return NULL;
- }
-}
-
-
-
-/**
- * Parse the attrib_list to fill in the fields of the given _eglMode
- * Return EGL_FALSE if any errors, EGL_TRUE otherwise.
- */
-static EGLBoolean
-_eglParseModeAttribs(_EGLMode *mode, const EGLint *attrib_list)
-{
- EGLint i;
-
- /* init all attribs to EGL_DONT_CARE */
- mode->Handle = EGL_DONT_CARE;
- mode->Width = EGL_DONT_CARE;
- mode->Height = EGL_DONT_CARE;
- mode->RefreshRate = EGL_DONT_CARE;
- mode->Optimal = EGL_DONT_CARE;
- mode->Interlaced = EGL_DONT_CARE;
- mode->Name = NULL;
-
- for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
- switch (attrib_list[i]) {
- case EGL_MODE_ID_MESA:
- mode->Handle = attrib_list[++i];
- if (mode->Handle <= 0) {
- _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(handle)");
- return EGL_FALSE;
- }
- break;
- case EGL_WIDTH:
- mode->Width = attrib_list[++i];
- if (mode->Width <= 0) {
- _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(width)");
- return EGL_FALSE;
- }
- break;
- case EGL_HEIGHT:
- mode->Height = attrib_list[++i];
- if (mode->Height <= 0) {
- _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(height)");
- return EGL_FALSE;
- }
- break;
- case EGL_REFRESH_RATE_MESA:
- mode->RefreshRate = attrib_list[++i];
- if (mode->RefreshRate <= 0) {
- _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(refresh rate)");
- return EGL_FALSE;
- }
- break;
- case EGL_INTERLACED_MESA:
- mode->Interlaced = attrib_list[++i];
- if (mode->Interlaced != EGL_TRUE && mode->Interlaced != EGL_FALSE) {
- _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(interlaced)");
- return EGL_FALSE;
- }
- break;
- case EGL_OPTIMAL_MESA:
- mode->Optimal = attrib_list[++i];
- if (mode->Optimal != EGL_TRUE && mode->Optimal != EGL_FALSE) {
- _eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(optimal)");
- return EGL_FALSE;
- }
- break;
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglChooseModeMESA");
- return EGL_FALSE;
- }
- }
- return EGL_TRUE;
-}
-
-
-/**
- * Determine if the candidate mode's attributes are at least as good
- * as the minimal mode's.
- * \return EGL_TRUE if qualifies, EGL_FALSE otherwise
- */
-static EGLBoolean
-_eglModeQualifies(const _EGLMode *c, const _EGLMode *min)
-{
- if (min->Handle != EGL_DONT_CARE && c->Handle != min->Handle)
- return EGL_FALSE;
- if (min->Width != EGL_DONT_CARE && c->Width < min->Width)
- return EGL_FALSE;
- if (min->Height != EGL_DONT_CARE && c->Height < min->Height)
- return EGL_FALSE;
- if (min->RefreshRate != EGL_DONT_CARE && c->RefreshRate < min->RefreshRate)
- return EGL_FALSE;
- if (min->Optimal != EGL_DONT_CARE && c->Optimal != min->Optimal)
- return EGL_FALSE;
- if (min->Interlaced != EGL_DONT_CARE && c->Interlaced != min->Interlaced)
- return EGL_FALSE;
-
- return EGL_TRUE;
-}
-
-
-/**
- * Return value of given mode attribute, or -1 if bad attrib.
- */
-static EGLint
-getModeAttrib(const _EGLMode *m, EGLint attrib)
-{
- switch (attrib) {
- case EGL_MODE_ID_MESA:
- return m->Handle;
- case EGL_WIDTH:
- return m->Width;
- case EGL_HEIGHT:
- return m->Height;
- case EGL_REFRESH_RATE_MESA:
- return m->RefreshRate;
- case EGL_OPTIMAL_MESA:
- return m->Optimal;
- case EGL_INTERLACED_MESA:
- return m->Interlaced;
- default:
- return -1;
- }
-}
-
-
-#define SMALLER 1
-#define LARGER 2
-
-struct sort_info {
- EGLint Attrib;
- EGLint Order; /* SMALLER or LARGER */
-};
-
-/* the order of these entries is the priority */
-static struct sort_info SortInfo[] = {
- { EGL_OPTIMAL_MESA, LARGER },
- { EGL_INTERLACED_MESA, SMALLER },
- { EGL_WIDTH, LARGER },
- { EGL_HEIGHT, LARGER },
- { EGL_REFRESH_RATE_MESA, LARGER },
- { EGL_MODE_ID_MESA, SMALLER },
- { 0, 0 }
-};
-
-
-/**
- * Compare modes 'a' and 'b' and return -1 if a belongs before b, or 1 if a
- * belongs after b, or 0 if they're equal.
- * Used by qsort().
- */
-static int
-_eglCompareModes(const void *a, const void *b)
-{
- const _EGLMode *aMode = *((const _EGLMode **) a);
- const _EGLMode *bMode = *((const _EGLMode **) b);
- EGLint i;
-
- for (i = 0; SortInfo[i].Attrib; i++) {
- const EGLint aVal = getModeAttrib(aMode, SortInfo[i].Attrib);
- const EGLint bVal = getModeAttrib(bMode, SortInfo[i].Attrib);
- if (aVal == bVal) {
- /* a tie */
- continue;
- }
- else if (SortInfo[i].Order == SMALLER) {
- return (aVal < bVal) ? -1 : 1;
- }
- else if (SortInfo[i].Order == LARGER) {
- return (aVal > bVal) ? -1 : 1;
- }
- }
-
- /* all attributes identical */
- return 0;
-}
-
-
-/**
- * Search for EGLModes which match the given attribute list.
- * Called via eglChooseModeMESA API function.
- */
-EGLBoolean
-_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- const EGLint *attrib_list, EGLModeMESA *modes,
- EGLint modes_size, EGLint *num_modes)
-{
- const _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
- _EGLMode **modeList, min;
- EGLint i, count;
-
- if (!scrn) {
- _eglError(EGL_BAD_SCREEN_MESA, "eglChooseModeMESA");
- return EGL_FALSE;
- }
-
- if (!_eglParseModeAttribs(&min, attrib_list)) {
- /* error code will have been recorded */
- return EGL_FALSE;
- }
-
- /* allocate array of mode pointers */
- modeList = (_EGLMode **) malloc(modes_size * sizeof(_EGLMode *));
- if (!modeList) {
- _eglError(EGL_BAD_MODE_MESA, "eglChooseModeMESA(out of memory)");
- return EGL_FALSE;
- }
-
- /* make array of pointers to qualifying modes */
- for (i = count = 0; i < scrn->NumModes && count < modes_size; i++) {
- if (_eglModeQualifies(scrn->Modes + i, &min)) {
- modeList[count++] = scrn->Modes + i;
- }
- }
-
- /* sort array of pointers */
- qsort(modeList, count, sizeof(_EGLMode *), _eglCompareModes);
-
- /* copy mode handles to output array */
- for (i = 0; i < count; i++) {
- modes[i] = modeList[i]->Handle;
- }
-
- free(modeList);
-
- *num_modes = count;
-
- return EGL_TRUE;
-}
-
-
-
-/**
- * Return all possible modes for the given screen. No sorting of results.
- * Called via eglGetModesMESA() API function.
- */
-EGLBoolean
-_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes)
-{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
-
- if (!scrn) {
- _eglError(EGL_BAD_SCREEN_MESA, "eglGetModesMESA");
- return EGL_FALSE;
- }
-
- if (modes) {
- EGLint i;
- *num_modes = MIN2(scrn->NumModes, modes_size);
- for (i = 0; i < *num_modes; i++) {
- modes[i] = scrn->Modes[i].Handle;
- }
- }
- else {
- /* just return total number of supported modes */
- *num_modes = scrn->NumModes;
- }
-
- return EGL_TRUE;
-}
-
-
-/**
- * Query an attribute of a mode.
- */
-EGLBoolean
-_eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLModeMESA mode, EGLint attribute, EGLint *value)
-{
- _EGLMode *m = _eglLookupMode(dpy, mode);
- EGLint v;
-
- if (!m) {
- _eglError(EGL_BAD_MODE_MESA, "eglGetModeAttribMESA");
- return EGL_FALSE;
- }
-
- v = getModeAttrib(m, attribute);
- if (v < 0) {
- _eglError(EGL_BAD_ATTRIBUTE, "eglGetModeAttribMESA");
- return EGL_FALSE;
- }
- *value = v;
- return EGL_TRUE;
-}
-
-
-/**
- * Return human-readable string for given mode.
- * This is the default function called by eglQueryModeStringMESA().
- */
-const char *
-_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode)
-{
- _EGLMode *m = _eglLookupMode(dpy, mode);
- if (!m) {
- _eglError(EGL_BAD_MODE_MESA, "eglQueryModeStringMESA");
- return NULL;
- }
- return m->Name;
-}
-
-
-#if 0
-static int
-_eglRand(int max)
-{
- return rand() % max;
-}
-
-void
-_eglTestModeModule(void)
-{
- EGLint count = 30;
- _EGLMode *modes = (_EGLMode *) malloc(count * sizeof(_EGLMode));
- _EGLMode **modeList = (_EGLMode **) malloc(count * sizeof(_EGLMode*));
- EGLint i;
-
- for (i = 0; i < count; i++) {
- modes[i].Handle = _eglRand(20);
- modes[i].Width = 512 + 256 * _eglRand(2);
- modes[i].Height = 512 + 256 * _eglRand(2);
- modes[i].RefreshRate = 50 + 5 * _eglRand(3);
- modes[i].Interlaced = _eglRand(2);
- modes[i].Optimal = _eglRand(4) == 0;
- modeList[i] = modes + i;
- }
-
- /* sort array of pointers */
- qsort(modeList, count, sizeof(_EGLMode *), compareModes);
-
- for (i = 0; i < count; i++) {
- _EGLMode *m = modeList[i];
- printf("%2d: %3d %4d x %4d @ %3d opt %d int %d\n", i,
- m->Handle, m->Width, m->Height, m->RefreshRate,
- m->Optimal, m->Interlaced);
- }
-}
-#endif
diff --git a/src/egl/main/eglmode.h b/src/egl/main/eglmode.h
deleted file mode 100644
index e70da857595..00000000000
--- a/src/egl/main/eglmode.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef EGLMODE_INCLUDED
-#define EGLMODE_INCLUDED
-
-#include "egltypedefs.h"
-
-
-/**
- * Data structure which corresponds to an EGLModeMESA.
- */
-struct _egl_mode
-{
- EGLModeMESA Handle; /* the public/opaque handle which names this mode */
- EGLint Width, Height; /* size in pixels */
- EGLint RefreshRate; /* rate * 1000.0 */
- EGLint Optimal;
- EGLint Interlaced;
- const char *Name;
-
- /* Other possible attributes */
- /* interlaced */
- /* external sync */
-};
-
-
-extern _EGLMode *
-_eglLookupMode(EGLDisplay dpy, EGLModeMESA mode);
-
-
-extern _EGLMode *
-_eglAddNewMode(_EGLScreen *screen, EGLint width, EGLint height,
- EGLint refreshRate, const char *name);
-
-
-extern EGLBoolean
-_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- const EGLint *attrib_list, EGLModeMESA *modes,
- EGLint modes_size, EGLint *num_modes);
-
-
-extern EGLBoolean
-_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
-
-
-extern EGLBoolean
-_eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode,
- EGLint attribute, EGLint *value);
-
-
-extern const char *
-_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode);
-
-
-#endif /* EGLMODE_INCLUDED */
diff --git a/src/egl/main/eglscreen.c b/src/egl/main/eglscreen.c
deleted file mode 100644
index 9c9a8377bf2..00000000000
--- a/src/egl/main/eglscreen.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Ideas for screen management extension to EGL.
- *
- * Each EGLDisplay has one or more screens (CRTs, Flat Panels, etc).
- * The screens' handles can be obtained with eglGetScreensMESA().
- *
- * A new kind of EGLSurface is possible- one which can be directly scanned
- * out on a screen. Such a surface is created with eglCreateScreenSurface().
- *
- * To actually display a screen surface on a screen, the eglShowSurface()
- * function is called.
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "egldisplay.h"
-#include "eglglobals.h"
-#include "eglmode.h"
-#include "eglconfig.h"
-#include "eglsurface.h"
-#include "eglscreen.h"
-
-
-/**
- * Return a new screen handle/ID.
- * NOTE: we never reuse these!
- */
-EGLScreenMESA
-_eglAllocScreenHandle(void)
-{
- EGLScreenMESA s = _eglGlobal.FreeScreenHandle;
- _eglGlobal.FreeScreenHandle++;
- return s;
-}
-
-
-/**
- * Initialize an _EGLScreen object to default values.
- */
-void
-_eglInitScreen(_EGLScreen *screen)
-{
- memset(screen, 0, sizeof(_EGLScreen));
- screen->StepX = 1;
- screen->StepY = 1;
-}
-
-
-/**
- * Given a public screen handle, return the internal _EGLScreen object.
- */
-_EGLScreen *
-_eglLookupScreen(EGLDisplay dpy, EGLScreenMESA screen)
-{
- EGLint i;
- _EGLDisplay *display = _eglLookupDisplay(dpy);
-
- if (!display)
- return NULL;
-
- for (i = 0; i < display->NumScreens; i++) {
- if (display->Screens[i]->Handle == screen)
- return display->Screens[i];
- }
- return NULL;
-}
-
-
-/**
- * Add the given _EGLScreen to the display's list of screens.
- */
-void
-_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen)
-{
- EGLint n;
-
- assert(display);
- assert(screen);
-
- screen->Handle = _eglAllocScreenHandle();
- n = display->NumScreens;
- display->Screens = realloc(display->Screens, (n+1) * sizeof(_EGLScreen *));
- display->Screens[n] = screen;
- display->NumScreens++;
-}
-
-
-
-EGLBoolean
-_eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens,
- EGLint max_screens, EGLint *num_screens)
-{
- _EGLDisplay *display = _eglLookupDisplay(dpy);
- EGLint n;
-
- if (!display) {
- _eglError(EGL_BAD_DISPLAY, "eglGetScreensMESA");
- return EGL_FALSE;
- }
-
- if (display->NumScreens > max_screens) {
- n = max_screens;
- }
- else {
- n = display->NumScreens;
- }
-
- if (screens) {
- EGLint i;
- for (i = 0; i < n; i++)
- screens[i] = display->Screens[i]->Handle;
- }
- if (num_screens)
- *num_screens = n;
-
- return EGL_TRUE;
-}
-
-
-/**
- * Example function - drivers should do a proper implementation.
- */
-EGLSurface
-_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-{
-#if 0 /* THIS IS JUST EXAMPLE CODE */
- _EGLSurface *surf;
-
- surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
- if (!surf)
- return EGL_NO_SURFACE;
-
- if (!_eglInitSurface(drv, dpy, surf, EGL_SCREEN_BIT_MESA,
- config, attrib_list)) {
- free(surf);
- return EGL_NO_SURFACE;
- }
-
- _eglSaveSurface(surf);
-
- return surf->Handle;
-#endif
- return EGL_NO_SURFACE;
-}
-
-
-/**
- * Show the given surface on the named screen.
- * If surface is EGL_NO_SURFACE, disable the screen's output.
- *
- * This is just a placeholder function; drivers will always override
- * this with code that _really_ shows the surface.
- */
-EGLBoolean
-_eglShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLScreenMESA screen, EGLSurface surface,
- EGLModeMESA m)
-{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
- _EGLMode *mode = _eglLookupMode(dpy, m);
-
- if (!scrn) {
- _eglError(EGL_BAD_SCREEN_MESA, "eglShowSurfaceMESA");
- return EGL_FALSE;
- }
- if (!mode && (m != EGL_NO_MODE_MESA )) {
- _eglError(EGL_BAD_MODE_MESA, "eglShowSurfaceMESA");
- return EGL_FALSE;
- }
-
- if (surface == EGL_NO_SURFACE) {
- scrn->CurrentSurface = NULL;
- }
- else {
- _EGLSurface *surf = _eglLookupSurface(surface);
- if (!surf || surf->Type != EGL_SCREEN_BIT_MESA) {
- _eglError(EGL_BAD_SURFACE, "eglShowSurfaceMESA");
- return EGL_FALSE;
- }
- if (surf->Width < mode->Width || surf->Height < mode->Height) {
- _eglError(EGL_BAD_SURFACE,
- "eglShowSurfaceMESA(surface smaller than screen size)");
- return EGL_FALSE;
- }
-
- scrn->CurrentSurface = surf;
- scrn->CurrentMode = mode;
- }
- return EGL_TRUE;
-}
-
-
-/**
- * Set a screen's current display mode.
- * Note: mode = EGL_NO_MODE is valid (turns off the screen)
- *
- * This is just a placeholder function; drivers will always override
- * this with code that _really_ sets the mode.
- */
-EGLBoolean
-_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA mode)
-{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
-
- if (!scrn) {
- _eglError(EGL_BAD_SCREEN_MESA, "eglScreenModeMESA");
- return EGL_FALSE;
- }
-
- scrn->CurrentMode = _eglLookupMode(dpy, mode);
-
- return EGL_TRUE;
-}
-
-
-/**
- * Set a screen's surface origin.
- */
-EGLBoolean
-_eglScreenPositionMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLScreenMESA screen, EGLint x, EGLint y)
-{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
- if (!scrn) {
- _eglError(EGL_BAD_SCREEN_MESA, "eglScreenPositionMESA");
- return EGL_FALSE;
- }
-
- scrn->OriginX = x;
- scrn->OriginY = y;
-
- return EGL_TRUE;
-}
-
-
-/**
- * Query a screen's current surface.
- */
-EGLBoolean
-_eglQueryScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLScreenMESA screen, EGLSurface *surface)
-{
- const _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
- if (scrn->CurrentSurface)
- *surface = scrn->CurrentSurface->Handle;
- else
- *surface = EGL_NO_SURFACE;
- return EGL_TRUE;
-}
-
-
-/**
- * Query a screen's current mode.
- */
-EGLBoolean
-_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- EGLModeMESA *mode)
-{
- const _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
- if (scrn->CurrentMode)
- *mode = scrn->CurrentMode->Handle;
- else
- *mode = EGL_NO_MODE_MESA;
- return EGL_TRUE;
-}
-
-
-EGLBoolean
-_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- EGLint attribute, EGLint *value)
-{
- const _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
-
- if (!scrn) {
- _eglError(EGL_BAD_SCREEN_MESA, "eglQueryScreenMESA");
- return EGL_FALSE;
- }
-
- switch (attribute) {
- case EGL_SCREEN_POSITION_MESA:
- value[0] = scrn->OriginX;
- value[1] = scrn->OriginY;
- break;
- case EGL_SCREEN_POSITION_GRANULARITY_MESA:
- value[0] = scrn->StepX;
- value[1] = scrn->StepY;
- break;
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglQueryScreenMESA");
- return EGL_FALSE;
- }
-
- return EGL_TRUE;
-}
-
-
-/**
- * Delete the modes associated with given screen.
- */
-void
-_eglDestroyScreenModes(_EGLScreen *scrn)
-{
- EGLint i;
- for (i = 0; i < scrn->NumModes; i++) {
- if (scrn->Modes[i].Name)
- free((char *) scrn->Modes[i].Name); /* cast away const */
- }
- if (scrn->Modes)
- free(scrn->Modes);
- scrn->Modes = NULL;
- scrn->NumModes = 0;
-}
-
-
-/**
- * Default fallback routine - drivers should usually override this.
- */
-void
-_eglDestroyScreen(_EGLScreen *scrn)
-{
- _eglDestroyScreenModes(scrn);
- free(scrn);
-}
-
diff --git a/src/egl/main/eglscreen.h b/src/egl/main/eglscreen.h
deleted file mode 100644
index 833439b4107..00000000000
--- a/src/egl/main/eglscreen.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef EGLSCREEN_INCLUDED
-#define EGLSCREEN_INCLUDED
-
-
-/**
- * Per-screen information.
- * Note that an EGL screen doesn't have a size. A screen may be set to
- * one of several display modes (width/height/scanrate). The screen
- * then displays a drawing surface. The drawing surface must be at least
- * as large as the display mode's resolution. If it's larger, the
- * OriginX and OriginY fields control what part of the surface is visible
- * on the screen.
- */
-struct _egl_screen
-{
- EGLScreenMESA Handle; /* The public/opaque handle which names this object */
-
- _EGLMode *CurrentMode;
- _EGLSurface *CurrentSurface;
-
- EGLint OriginX, OriginY; /**< Origin of scan-out region w.r.t. surface */
- EGLint StepX, StepY; /**< Screen position/origin granularity */
-
- EGLint NumModes;
- _EGLMode *Modes; /**< array [NumModes] */
-};
-
-
-extern EGLScreenMESA
-_eglAllocScreenHandle(void);
-
-
-extern void
-_eglInitScreen(_EGLScreen *screen);
-
-
-extern _EGLScreen *
-_eglLookupScreen(EGLDisplay dpy, EGLScreenMESA screen);
-
-
-extern void
-_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen);
-
-
-extern EGLBoolean
-_eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
-
-
-extern EGLSurface
-_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-
-
-extern EGLBoolean
-_eglShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode);
-
-
-extern EGLBoolean
-_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA mode);
-
-
-extern EGLBoolean
-_eglScreenPositionMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
-
-
-extern EGLBoolean
-_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attribute, EGLint *value);
-
-
-extern EGLBoolean
-_eglQueryScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLScreenMESA screen, EGLSurface *surface);
-
-
-extern EGLBoolean
-_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
-
-
-extern EGLBoolean
-_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
-
-
-extern void
-_eglDestroyScreenModes(_EGLScreen *scrn);
-
-
-extern void
-_eglDestroyScreen(_EGLScreen *scrn);
-
-
-#endif /* EGLSCREEN_INCLUDED */
diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
deleted file mode 100644
index 874f318e966..00000000000
--- a/src/egl/main/eglsurface.c
+++ /dev/null
@@ -1,530 +0,0 @@
-/**
- * Surface-related functions.
- */
-
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include "eglcontext.h"
-#include "eglconfig.h"
-#include "eglglobals.h"
-#include "eglhash.h"
-#include "egllog.h"
-#include "eglsurface.h"
-
-
-/**
- * Do error check on parameters and initialize the given _EGLSurface object.
- * \return EGL_TRUE if no errors, EGL_FALSE otherwise.
- */
-EGLBoolean
-_eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
- _EGLSurface *surf, EGLint type, EGLConfig config,
- const EGLint *attrib_list)
-{
- const char *func;
- _EGLConfig *conf;
- EGLint width = 0, height = 0, largest = 0;
- EGLint texFormat = 0, texTarget = 0, mipmapTex = 0;
- EGLint renderBuffer = EGL_BACK_BUFFER;
-#ifdef EGL_VERSION_1_2
- EGLint colorspace = EGL_COLORSPACE_sRGB;
- EGLint alphaFormat = EGL_ALPHA_FORMAT_NONPRE;
-#endif
- EGLint i;
-
- switch (type) {
- case EGL_WINDOW_BIT:
- func = "eglCreateWindowSurface";
- break;
- case EGL_PIXMAP_BIT:
- func = "eglCreatePixmapSurface";
- renderBuffer = EGL_SINGLE_BUFFER;
- break;
- case EGL_PBUFFER_BIT:
- func = "eglCreatePBufferSurface";
- break;
- case EGL_SCREEN_BIT_MESA:
- func = "eglCreateScreenSurface";
- renderBuffer = EGL_SINGLE_BUFFER; /* XXX correct? */
- break;
- default:
- _eglLog(_EGL_WARNING, "Bad type in _eglInitSurface");
- return EGL_FALSE;
- }
-
- conf = _eglLookupConfig(drv, dpy, config);
- if (!conf) {
- _eglError(EGL_BAD_CONFIG, func);
- return EGL_FALSE;
- }
-
- /*
- * Parse attribute list. Different kinds of surfaces support different
- * attributes.
- */
- for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
- switch (attrib_list[i]) {
- case EGL_WIDTH:
- if (type == EGL_PBUFFER_BIT || type == EGL_SCREEN_BIT_MESA) {
- width = attrib_list[++i];
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
- case EGL_HEIGHT:
- if (type == EGL_PBUFFER_BIT || type == EGL_SCREEN_BIT_MESA) {
- height = attrib_list[++i];
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
- case EGL_LARGEST_PBUFFER:
- if (type == EGL_PBUFFER_BIT) {
- largest = attrib_list[++i];
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
- case EGL_TEXTURE_FORMAT:
- if (type == EGL_PBUFFER_BIT) {
- texFormat = attrib_list[++i];
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
- case EGL_TEXTURE_TARGET:
- if (type == EGL_PBUFFER_BIT) {
- texTarget = attrib_list[++i];
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
- case EGL_MIPMAP_TEXTURE:
- if (type == EGL_PBUFFER_BIT) {
- mipmapTex = attrib_list[++i];
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
-#ifdef EGL_VERSION_1_2
- case EGL_RENDER_BUFFER:
- if (type == EGL_WINDOW_BIT) {
- renderBuffer = attrib_list[++i];
- if (renderBuffer != EGL_BACK_BUFFER &&
- renderBuffer != EGL_SINGLE_BUFFER) {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
- case EGL_COLORSPACE:
- if (type == EGL_WINDOW_BIT ||
- type == EGL_PBUFFER_BIT ||
- type == EGL_PIXMAP_BIT) {
- colorspace = attrib_list[++i];
- if (colorspace != EGL_COLORSPACE_sRGB &&
- colorspace != EGL_COLORSPACE_LINEAR) {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
- case EGL_ALPHA_FORMAT:
- if (type == EGL_WINDOW_BIT ||
- type == EGL_PBUFFER_BIT ||
- type == EGL_PIXMAP_BIT) {
- alphaFormat = attrib_list[++i];
- if (alphaFormat != EGL_ALPHA_FORMAT_NONPRE &&
- alphaFormat != EGL_ALPHA_FORMAT_PRE) {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- }
- else {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- break;
-
-#endif /* EGL_VERSION_1_2 */
- default:
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
- }
-
- if (width <= 0 || height <= 0) {
- _eglError(EGL_BAD_ATTRIBUTE, func);
- return EGL_FALSE;
- }
-
- memset(surf, 0, sizeof(_EGLSurface));
- surf->Config = conf;
- surf->Type = type;
- surf->Width = width;
- surf->Height = height;
- surf->TextureFormat = texFormat;
- surf->TextureTarget = texTarget;
- surf->MipmapTexture = mipmapTex;
- surf->MipmapLevel = 0;
- surf->SwapInterval = 0;
-#ifdef EGL_VERSION_1_2
- surf->SwapBehavior = EGL_BUFFER_DESTROYED; /* XXX ok? */
- surf->HorizontalResolution = EGL_UNKNOWN; /* set by caller */
- surf->VerticalResolution = EGL_UNKNOWN; /* set by caller */
- surf->AspectRatio = EGL_UNKNOWN; /* set by caller */
- surf->RenderBuffer = renderBuffer;
- surf->AlphaFormat = alphaFormat;
- surf->Colorspace = colorspace;
-#endif
-
- return EGL_TRUE;
-}
-
-
-void
-_eglSaveSurface(_EGLSurface *surf)
-{
- assert(surf);
- assert(!surf->Handle);
- surf->Handle = _eglHashGenKey(_eglGlobal.Contexts);
- assert(surf->Handle);
- _eglHashInsert(_eglGlobal.Surfaces, surf->Handle, surf);
-}
-
-
-void
-_eglRemoveSurface(_EGLSurface *surf)
-{
- _eglHashRemove(_eglGlobal.Surfaces, surf->Handle);
-}
-
-
-_EGLSurface *
-_eglLookupSurface(EGLSurface surf)
-{
- _EGLSurface *c = (_EGLSurface *) _eglHashLookup(_eglGlobal.Surfaces, surf);
- return c;
-}
-
-
-_EGLSurface *
-_eglGetCurrentSurface(EGLint readdraw)
-{
- _EGLContext *ctx = _eglGetCurrentContext();
- if (ctx) {
- switch (readdraw) {
- case EGL_DRAW:
- return ctx->DrawSurface;
- case EGL_READ:
- return ctx->ReadSurface;
- default:
- return NULL;
- }
- }
- return NULL;
-}
-
-
-EGLBoolean
-_eglSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
-{
- /* Basically just do error checking here. Drivers have to do the
- * actual buffer swap.
- */
- _EGLContext *context = _eglGetCurrentContext();
- _EGLSurface *surface = _eglLookupSurface(draw);
- if (context && context->DrawSurface != surface) {
- _eglError(EGL_BAD_SURFACE, "eglSwapBuffers");
- return EGL_FALSE;
- }
- if (surface == NULL) {
- _eglError(EGL_BAD_SURFACE, "eglSwapBuffers");
- return EGL_FALSE;
- }
- return EGL_TRUE;
-}
-
-
-EGLBoolean
-_eglCopyBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface,
- NativePixmapType target)
-{
- /* copy surface to native pixmap */
- /* All implementation burdon for this is in the device driver */
- return EGL_FALSE;
-}
-
-
-EGLBoolean
-_eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf,
- EGLint attribute, EGLint *value)
-{
- _EGLSurface *surface = _eglLookupSurface(surf);
- if (surface == NULL) {
- _eglError(EGL_BAD_SURFACE, "eglQuerySurface");
- return EGL_FALSE;
- }
- switch (attribute) {
- case EGL_WIDTH:
- *value = surface->Width;
- return EGL_TRUE;
- case EGL_HEIGHT:
- *value = surface->Height;
- return EGL_TRUE;
- case EGL_CONFIG_ID:
- *value = GET_CONFIG_ATTRIB(surface->Config, EGL_CONFIG_ID);
- return EGL_TRUE;
- /*XXX case EGL_LARGEST_PBUFFER:*/
- case EGL_SURFACE_TYPE:
- *value = surface->Type;
- return EGL_TRUE;
-#ifdef EGL_VERSION_1_1
- case EGL_TEXTURE_FORMAT:
- /* texture attributes: only for pbuffers, no error otherwise */
- if (surface->Type == EGL_PBUFFER_BIT)
- *value = surface->TextureFormat;
- return EGL_TRUE;
- case EGL_TEXTURE_TARGET:
- if (surface->Type == EGL_PBUFFER_BIT)
- *value = surface->TextureTarget;
- return EGL_TRUE;
- case EGL_MIPMAP_TEXTURE:
- if (surface->Type == EGL_PBUFFER_BIT)
- *value = surface->MipmapTexture;
- return EGL_TRUE;
- case EGL_MIPMAP_LEVEL:
- if (surface->Type == EGL_PBUFFER_BIT)
- *value = surface->MipmapLevel;
- return EGL_TRUE;
-#endif /* EGL_VERSION_1_1 */
-#ifdef EGL_VERSION_1_2
- case EGL_SWAP_BEHAVIOR:
- *value = surface->SwapBehavior;
- return EGL_TRUE;
- case EGL_RENDER_BUFFER:
- *value = surface->RenderBuffer;
- return EGL_TRUE;
- case EGL_PIXEL_ASPECT_RATIO:
- *value = surface->AspectRatio;
- return EGL_TRUE;
- case EGL_HORIZONTAL_RESOLUTION:
- *value = surface->HorizontalResolution;
- return EGL_TRUE;
- case EGL_VERTICAL_RESOLUTION:
- *value = surface->VerticalResolution;
- return EGL_TRUE;
- case EGL_ALPHA_FORMAT:
- *value = surface->AlphaFormat;
- return EGL_TRUE;
- case EGL_COLORSPACE:
- *value = surface->Colorspace;
- return EGL_TRUE;
-#endif /* EGL_VERSION_1_2 */
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
- return EGL_FALSE;
- }
-}
-
-
-/**
- * Example function - drivers should do a proper implementation.
- */
-EGLSurface
-_eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- NativeWindowType window, const EGLint *attrib_list)
-{
-#if 0 /* THIS IS JUST EXAMPLE CODE */
- _EGLSurface *surf;
-
- surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
- if (!surf)
- return EGL_NO_SURFACE;
-
- if (!_eglInitSurface(drv, dpy, surf, EGL_WINDOW_BIT, config, attrib_list)) {
- free(surf);
- return EGL_NO_SURFACE;
- }
-
- _eglSaveSurface(surf);
-
- return surf->Handle;
-#endif
- return EGL_NO_SURFACE;
-}
-
-
-/**
- * Example function - drivers should do a proper implementation.
- */
-EGLSurface
-_eglCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- NativePixmapType pixmap, const EGLint *attrib_list)
-{
-#if 0 /* THIS IS JUST EXAMPLE CODE */
- _EGLSurface *surf;
-
- surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
- if (!surf)
- return EGL_NO_SURFACE;
-
- if (!_eglInitSurface(drv, dpy, surf, EGL_PIXMAP_BIT, config, attrib_list)) {
- free(surf);
- return EGL_NO_SURFACE;
- }
-
- _eglSaveSurface(surf);
-
- return surf->Handle;
-#endif
- return EGL_NO_SURFACE;
-}
-
-
-/**
- * Example function - drivers should do a proper implementation.
- */
-EGLSurface
-_eglCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-{
-#if 0 /* THIS IS JUST EXAMPLE CODE */
- _EGLSurface *surf;
-
- surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
- if (!surf)
- return EGL_NO_SURFACE;
-
- if (!_eglInitSurface(drv, dpy, surf, EGL_PBUFFER_BIT, config, attrib_list)) {
- free(surf);
- return EGL_NO_SURFACE;
- }
-
- _eglSaveSurface(surf);
-
- return surf->Handle;
-#endif
- return EGL_NO_SURFACE;
-}
-
-
-/**
- * Default fallback routine - drivers should usually override this.
- */
-EGLBoolean
-_eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
-{
- _EGLSurface *surf = _eglLookupSurface(surface);
- if (surf) {
- _eglHashRemove(_eglGlobal.Surfaces, surface);
- if (surf->IsBound) {
- surf->DeletePending = EGL_TRUE;
- }
- else {
- free(surf);
- }
- return EGL_TRUE;
- }
- else {
- _eglError(EGL_BAD_SURFACE, "eglDestroySurface");
- return EGL_FALSE;
- }
-}
-
-
-/**
- * Default fallback routine - drivers might override this.
- */
-EGLBoolean
-_eglSurfaceAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf, EGLint attribute, EGLint value)
-{
- _EGLSurface *surface = _eglLookupSurface(surf);
-
- if (surface == NULL) {
- _eglError(EGL_BAD_SURFACE, "eglSurfaceAttrib");
- return EGL_FALSE;
- }
-
- switch (attribute) {
- case EGL_MIPMAP_LEVEL:
- surface->MipmapLevel = value;
- break;
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglSurfaceAttrib");
- return EGL_FALSE;
- }
- return EGL_TRUE;
-}
-
-
-EGLBoolean
-_eglBindTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- /* XXX unfinished */
- return EGL_FALSE;
-}
-
-
-EGLBoolean
-_eglReleaseTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- /* XXX unfinished */
- return EGL_FALSE;
-}
-
-
-EGLBoolean
-_eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval)
-{
- _EGLSurface *surf = _eglGetCurrentSurface(EGL_DRAW);
- if (surf == NULL) {
- _eglError(EGL_BAD_SURFACE, "eglSwapInterval");
- return EGL_FALSE;
- }
- surf->SwapInterval = interval;
- return EGL_TRUE;
-}
-
-
-#ifdef EGL_VERSION_1_2
-
-/**
- * Example function - drivers should do a proper implementation.
- */
-EGLSurface
-_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
- EGLenum buftype, EGLClientBuffer buffer,
- EGLConfig config, const EGLint *attrib_list)
-{
- if (buftype != EGL_OPENVG_IMAGE) {
- _eglError(EGL_BAD_PARAMETER, "eglCreatePbufferFromClientBuffer");
- return EGL_NO_SURFACE;
- }
-
- return EGL_NO_SURFACE;
-}
-
-#endif /* EGL_VERSION_1_2 */
diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h
deleted file mode 100644
index 79abeca0b2a..00000000000
--- a/src/egl/main/eglsurface.h
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef EGLSURFACE_INCLUDED
-#define EGLSURFACE_INCLUDED
-
-
-#include "egltypedefs.h"
-
-
-/**
- * "Base" class for device driver surfaces.
- */
-struct _egl_surface
-{
- EGLSurface Handle; /* The public/opaque handle which names this object */
- _EGLConfig *Config;
-
- /* May need reference counting here */
- EGLBoolean IsBound;
- EGLBoolean DeletePending;
-
- EGLint Type; /* one of EGL_WINDOW_BIT, EGL_PIXMAP_BIT or EGL_PBUFFER_BIT */
- EGLint Width, Height;
- EGLint TextureFormat, TextureTarget;
- EGLint MipmapTexture, MipmapLevel;
- EGLint SwapInterval;
-
- /* If type == EGL_SCREEN_BIT: */
- EGLint VisibleRefCount; /* number of screens I'm displayed on */
-
-#ifdef EGL_VERSION_1_2
- EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
- EGLint HorizontalResolution, VerticalResolution;
- EGLint AspectRatio;
- EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
- EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
- EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
-#endif /* EGL_VERSION_1_2 */
-};
-
-
-extern EGLBoolean
-_eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
- _EGLSurface *surf, EGLint type, EGLConfig config,
- const EGLint *attrib_list);
-
-
-extern void
-_eglSaveSurface(_EGLSurface *surf);
-
-
-extern void
-_eglRemoveSurface(_EGLSurface *surf);
-
-
-extern _EGLSurface *
-_eglLookupSurface(EGLSurface surf);
-
-
-extern _EGLSurface *
-_eglGetCurrentSurface(EGLint readdraw);
-
-
-extern EGLBoolean
-_eglSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw);
-
-
-extern EGLBoolean
-_eglCopyBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
-
-
-extern EGLBoolean
-_eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
-
-
-extern EGLSurface
-_eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
-
-
-extern EGLSurface
-_eglCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
-
-
-extern EGLSurface
-_eglCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-
-
-extern EGLBoolean
-_eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface);
-
-
-extern EGLBoolean
-_eglSurfaceAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
-
-
-extern EGLBoolean
-_eglBindTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-
-
-extern EGLBoolean
-_eglReleaseTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-
-
-extern EGLBoolean
-_eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
-
-
-#ifdef EGL_VERSION_1_2
-
-extern EGLSurface
-_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
- EGLenum buftype, EGLClientBuffer buffer,
- EGLConfig config, const EGLint *attrib_list);
-
-#endif /* EGL_VERSION_1_2 */
-
-
-
-#endif /* EGLSURFACE_INCLUDED */
diff --git a/src/egl/main/egltypedefs.h b/src/egl/main/egltypedefs.h
deleted file mode 100644
index fa8cb496f8d..00000000000
--- a/src/egl/main/egltypedefs.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef EGLTYPEDEFS_INCLUDED
-#define EGLTYPEDEFS_INCLUDED
-
-
-#include <GLES/egl.h>
-
-
-typedef struct _egl_api _EGLAPI;
-
-typedef struct _egl_config _EGLConfig;
-
-typedef struct _egl_context _EGLContext;
-
-typedef struct _egl_display _EGLDisplay;
-
-typedef struct _egl_driver _EGLDriver;
-
-typedef struct _egl_extensions _EGLExtensions;
-
-typedef struct _egl_mode _EGLMode;
-
-typedef struct _egl_screen _EGLScreen;
-
-typedef struct _egl_surface _EGLSurface;
-
-typedef struct _egl_thread_info _EGLThreadInfo;
-
-
-typedef void (*_EGLProc)();
-
-typedef _EGLDriver *(*_EGLMain_t)(_EGLDisplay *dpy);
-
-
-#endif /* EGLTYPEDEFS_INCLUDED */
diff --git a/src/glu/Makefile b/src/glu/Makefile
index ca9ad39442c..5ddc50946aa 100644
--- a/src/glu/Makefile
+++ b/src/glu/Makefile
@@ -15,7 +15,7 @@ default: $(TOP)/configs/current
install:
$(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
- $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGLU.* $(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(INSTALL_DIR)/$(LIB_DIR)
clean:
@for dir in $(SUBDIRS) ; do \
diff --git a/src/glu/mesa/Makefile b/src/glu/mesa/Makefile
deleted file mode 100644
index 47f95ef0240..00000000000
--- a/src/glu/mesa/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/glu/mesa/Makefile
-
-TOP = ../../..
-
-include $(TOP)/configs/current
-
-GLU_MAJOR = 1
-GLU_MINOR = 1
-GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
-
-C_SOURCES = \
- glu.c \
- mipmap.c \
- nurbs.c \
- nurbscrv.c \
- nurbssrf.c \
- nurbsutl.c \
- polytest.c \
- project.c \
- quadric.c \
- tess.c \
- tesselat.c
-
-OBJECTS = $(C_SOURCES:.c=.o)
-
-INCLUDES = -I. -I- -I$(TOP)/include
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
-
-##### TARGETS #####
-
-default:
- @if [ "${CONFIG_NAME}" = "beos" ] ; then \
- echo "$(GLU_LIB_NAME) not build under BeOS, but integrated into ${GL_LIB_NAME}." ; \
- exit 0 ; \
- else \
- $(MAKE) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) ; \
- fi
-
-$(TOP)/$(LIB_DIR):
- -mkdir $(TOP)/$(LIB_DIR)
-
-# Make the library:
-$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
- @ $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CC)' \
- -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
- $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
- $(GLU_LIB_DEPS) $(OBJECTS)
-
-clean:
- -rm -f *.o */*.o */*/*.o
- -rm -f *.lo */*.lo */*/*.lo
- -rm -f *.la */*.la */*/*.la
diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ
deleted file mode 100644
index 92bcdaae945..00000000000
--- a/src/glu/mesa/Makefile.DJ
+++ /dev/null
@@ -1,100 +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 glu makefile v1.5 for Mesa
-#
-# Copyright (C) 2002 - Daniel Borca
-# Email : dborca@users.sourceforge.net
-# Web : http://www.geocities.com/dborca
-
-
-#
-# Available options:
-#
-# Environment variables:
-# CFLAGS
-#
-# Targets:
-# all: build GLU
-# clean: remove object files
-#
-
-
-
-.PHONY: all clean
-
-TOP = ../../..
-LIBDIR = $(TOP)/lib
-GLU_LIB = libglu.a
-GLU_DXE = glu.dxe
-GLU_IMP = libiglu.a
-
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
-
-CC = gcc
-CFLAGS += -I$(TOP)/include
-
-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
-
-CORE_SOURCES = \
- glu.c \
- mipmap.c \
- nurbs.c \
- nurbscrv.c \
- nurbssrf.c \
- nurbsutl.c \
- polytest.c \
- project.c \
- quadric.c \
- tess.c \
- tesselat.c
-
-SOURCES = $(CORE_SOURCES)
-
-OBJECTS = $(SOURCES:.c=.o)
-
-.c.o:
- $(CC) -o $@ $(CFLAGS) -c $<
-
-all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
-
-$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $@ $^
-
-$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
-ifeq ($(HAVEDXE3),)
- $(warning Missing DXE3 package... Skipping $(GLU_DXE))
-else
- -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $^
-endif
-
-clean:
- -$(call UNLINK,*.o)
diff --git a/src/glu/mesa/Makefile.m32 b/src/glu/mesa/Makefile.m32
deleted file mode 100644
index 3e217ef5d52..00000000000
--- a/src/glu/mesa/Makefile.m32
+++ /dev/null
@@ -1,63 +0,0 @@
-# Makefile for GLU for GCC-2.95.2/Mingw32 contributed by
-# Paul Garceau <pgarceau@teleport.com>
-
-# Mesa 3-D graphics library
-# Version: 3.3
-# Copyright (C) 1995-1999 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.
-
-
-MESA_MAJOR=3
-MESA_MINOR=3
-MESA_TINY=0
-VERSION=$(MESA_MAJOR).$(MESA_MINOR)
-
-CFLAGS = -I. -DWIN32 -D__WIN32__ -D_WINDOWS \
- -O2 -funroll-loops \
- -fexpensive-optimizations -fomit-frame-pointer -ffast-math \
- -malign-loops=2 -malign-jumps=2 -malign-functions=2 \
- -mwindows
-CC = gcc
-MAKELIB = ar ru
-GLU_LIB = libGLU.a
-
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = ../include
-LIBDIR = ../lib
-
-SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
- polytest.c project.c quadric.c tess.c tesselat.c
-
-OBJECTS = $(SOURCES:.c=.o)
-
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c -I$(INCDIR) $(CFLAGS) $<
-
-
-
-##### TARGETS #####
-
-# Make the library:
-$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
- $(MAKELIB) $(GLU_LIB) $(MAJOR) $(MINOR) $(TINY) $(OBJECTS) \ No newline at end of file
diff --git a/src/glu/mesa/Makefile.ugl b/src/glu/mesa/Makefile.ugl
deleted file mode 100644
index fc189bd8047..00000000000
--- a/src/glu/mesa/Makefile.ugl
+++ /dev/null
@@ -1,96 +0,0 @@
-# Mesa 3-D graphics library
-# Version: 3.5
-#
-# 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 GLU library
-
-##### MACROS #####
-GLU_MAJOR = 1
-GLU_MINOR = 3
-GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
-
-##### RULES #####
-
-include ../rules.windml
-
-GLU_SOURCES = \
- glu.c \
- mipmap.c \
- nurbs.c \
- nurbscrv.c \
- nurbssrf.c \
- nurbsutl.c \
- polytest.c \
- project.c \
- quadric.c \
- tess.c \
- tesselat.c \
- ../src/windml/tornado/torMesaGLUInit.c
-
-GLU_OBJECTS = $(GLU_SOURCES:.c=.o)
-GLU_OBJNAME = $(MESA_LIBDIR)/objMesaGLU.o
-
-SOURCES = $(GLU_SOURCES)
-
-##### TARGETS #####
-
-all: depend.$(CPU)$(TOOL) $(GLU_OBJNAME)
-
-# Make the GLU library
-$(GLU_OBJNAME): $(GLU_OBJECTS)
-# $(LD) -r $(GLU_OBJECTS) -o $(MESA_OBJNAME)
- $(LD) -r $(GLU_OBJECTS) -o $(GLU_OBJNAME)
-# $(AR) rus $(MESA_LIBNAME) $(GLU_OBJNAME)
-# $(AR) rus $(VX_LIBNAME) $(GLU_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) $(GLU_OBJNAME)
-# $(AR) d $(VX_LIBNAME) $(GLU_OBJNAME)
- $(RM) $(GLU_OBJNAME)
- $(RM) $(GLU_OBJECTS)
- $(RM) depend.$(CPU)$(TOOL)
-
-include depend.$(CPU)$(TOOL)
diff --git a/src/glu/mesa/MesaGLU.def b/src/glu/mesa/MesaGLU.def
deleted file mode 100644
index 0cdd7bb7875..00000000000
--- a/src/glu/mesa/MesaGLU.def
+++ /dev/null
@@ -1,62 +0,0 @@
-LIBRARY GLU32
-DESCRIPTION 'GLU for Windows Mesa'
-EXETYPE WINDOWS
-CODE MOVEABLE DISCARDABLE
-DATA MOVEABLE SINGLE
-HEAPSIZE 256000
-
-STACKSIZE 4096
-
-EXPORTS
- gluLookAt
- gluOrtho2D
- gluPerspective
- gluPickMatrix
- gluProject
- gluUnProject
- gluErrorString
- gluScaleImage
- gluBuild1DMipmaps
- gluBuild2DMipmaps
- gluNewQuadric
- gluDeleteQuadric
- gluQuadricDrawStyle
- gluQuadricOrientation
- gluQuadricNormals
- gluQuadricTexture
- gluQuadricCallback
- gluCylinder
- gluSphere
- gluDisk
- gluPartialDisk
- gluNewNurbsRenderer
- gluDeleteNurbsRenderer
- gluLoadSamplingMatrices
- gluNurbsProperty
- gluGetNurbsProperty
- gluBeginCurve
- gluEndCurve
- gluNurbsCurve
- gluBeginSurface
- gluEndSurface
- gluNurbsSurface
- gluBeginTrim
- gluEndTrim
- gluPwlCurve
- gluNurbsCallback
- gluNewTess
- gluDeleteTess
-; gluTessBeginPolygon
-; gluTessBeginContour
- gluTessVertex
-; gluTessEndContour
-; gluTessEndPolygon
-; gluTessProperty
-; gluTessNormal
- gluTessCallback
-; gluGetTessProperty
- gluBeginPolygon
- gluNextContour
- gluEndPolygon
- gluGetString
-
diff --git a/src/glu/mesa/README1 b/src/glu/mesa/README1
deleted file mode 100644
index 75968572ff6..00000000000
--- a/src/glu/mesa/README1
+++ /dev/null
@@ -1,195 +0,0 @@
-
-Notes on the GLU polygon tesselation facility implemented by Bogdan Sikorski...
-
-
-
-The tesselation module is provided under the same terms as the Mesa
-package.
-
-This is the first release of polygon tesselation code for Mesa.
-It was written during my very little free time, so lets name it:
-"its not perfect". If someone hates pointers, don't look at the code.
-I preffer dynamic allocation versus static. But _all_ ideas, suggestions,
-bug reports and fixes are welcome (if You want, also flames). I am aware
-that many things could have been written using better techniques, but time
-that I could devote to this library was very limited. It is not well commented,
-excuse me. Also I am thinking of continuing working on this code to improve,
-fix and polish it. And make it as compliant as possible to the OpenGL, so
-software ports from OpenGL to Mesa will work correctly. If You know of any
-differences in behaviour, expected input/output between Mesa tesselation library
-and OpenGL, please send me a note. I explain later on why I am not
-confident with this code.
-
-I tried to be fully compliant with the OpenGL routines. By "tried" I mean that
-up to my knowledge it behaves as OpenGL tesselation routines. Just recently
-I began to experiment with OpenGL (actually only Mesa), and also have
-no access to any machine providing official implementation of OpenGL,
-nor access to books (particulary Addison-Wesley publications). Thus my
-knowledge on how the original tesselation code works, what kind of data
-it expects etc. is based _only_ on the publicly available documentation
-provided by SGI. Namely:
-
-* "The OpenGL Graphics System Utility Library" by K.P.Smith
- (Silicon Graphics, 1992)
-* "The OpenGL Graphics Interface" by M.Segal and K.Akeley
- (Silicon Graphics, 19??)
-* "OpenGL and X, Part 1: Introduction" by M.J.Kilgard
- (Silicon Graphics, 1994)
-* "OpenGL and X, Part 2: Using OpenGL with Xlib" by M.J.Kilgard
- (Silicon Graphics, 1994)
-* "OpenGL Graphics with the X Window System" by P.Karlton
- (Silicon Graphics, 1993)
-* Online Docs - Appendix C of OpenGL Programming Guide, Polygon Tesselation
- (partial text cut and sent by e-mail)
-
-
-The tesselation routines use slightly different prototypes than the ones
-specified in the mentioned above publications. The _only_ differences are
-the enumeration types which are not GLenum, but are GLUenum. So the
-implemented routines have following prototypes:
-
-GLUtringulatorObj *gluNewTess(void);
-
-void gluTessCallback(GLUtriangulatorObj *,GLUenum,void (*)());
- ^^^^^^^
-void gluBeginPolygon(GLUtriangulatorObj *);
-
-void gluTessVertex(GLUtriangulatorObj *,GLdouble [3],void *);
-
-void gluNextContour(GLUtriangulatorObj *,GLUenum);
- ^^^^^^^
-void gluEndPolygon(GLUtriangulatorObj *);
-
-const GLubyte *gluErrorString(GLUenum);
- ^^^^^^^
- prototypes for callback functions:
-
-void <begin>(GLUenum);
- ^^^^^^^
-void <edgeFlag>(GLboolean);
-void <vertex>(void *);
-void <end>(void);
-void <error>(GLUenum);
- ^^^^^^^
-
-The begin callback will be called only with GLU_TRIANGLES. No support
-for traingle fans or strips yet.
-
-In case of errors an internal error variable is set to the appropiate
-error enum values (GLU_TESS_ERROR?). Initially it is set to GLU_NO_ERROR.
-The OpenGL library provides 8 error conditions, the tesselation code
-of Mesa provides 9. They are:
-
-GLU_TESS_ERROR1: missing gluEndPolygon /* same as OpenGL */
-GLU_TESS_ERROR2: missing gluBeginPolygon /* same as OpenGL */
-GLU_TESS_ERROR3: misoriented contour /* not used in Mesa
- in OpenGL is bad orientation or intersecting edges */
-GLU_TESS_ERROR4: vertex/edge intersection /* same as OpenGL */
-GLU_TESS_ERROR5: misoriented or self-intersecting loops /* same as OpenGL */
-GLU_TESS_ERROR6: coincident vertices /* same as OpenGL */
-GLU_TESS_ERROR7: colinear vertices /* OpenGL's illegal data */
-GLU_TESS_ERROR8: intersecting edges /* same as OpenGL */
-GLU_TESS_ERROR9: not coplanar contours /* new for Mesa */
-
-The Mesa tesselation code ignores all data and calls after detecting an error
-codition. This means that a _new_ tesselation object must be used for further
-triangulations. Maybe this is too restrictive, and will be lifted in
-future versions.
-
-The tesselation code completely ignores the type parameter passed in
-gluNextContour. It also doesn't check if the passed parameter is a legal
-enum value - ignores silently (maybe at least this should be checked).
-The reason I chose this behaviour is based on what I read in the
-beforementioned documents. I cite:
-
-"....
-void gluNextContour(GLUtriangulatorObj *tessobj, GLenum type);
-
-Marks the beginning of the next contour when multiple contours make up the
-boundary of the polygon to be tessellated. type can be GLU_EXTERIOR,
-GLU_INTERIOR, GLU_CCW, GLU_CW, or GLU_UNKNOWN. These serve only as
-to the tessellation. If you get them right, the tessellation might
-go faster. If you get them wrong, they're ignored, and the tesselation still
-works.
-....."
-
-I hope You agree with me that my decision was correct. Mesa tesselation
-_always_ checks by itself the interrelations between contours. Just as if
-all contours were specified with the type GLU_UNKNOWN.
-
-One of OpenGL's policy is not to check all error conditions - rely sometimes
-that the user "got things right". This is justified, since exhausting
-error checking is timeconsuming, and would significantly slow down
-a correct application. The Mesa tesselation code assumes only _one_ condition
-when triangulating - all vertices in a contour are planar. This is _not_
-checked for correctness. Trying to tesselate such objects will lead to
-unpredictable output.
-
-And now we arrive to the moment where I would like to list the required
-(but checked for) conditions for triangulation, as well as summarize the
-library:
-
-* all contours in a single tesselation cycle _must_ be coplanar - if not
- an error is raised (and if provided a call to the error callback
- is made)
-* the contours can be passed in _any_ order, exteriors and holes can be
- intermixed within a tesselation cycle and the correct hierarchy
- will be determined by the library; thus specifying first holes then
- exteriors, then holes within holes form a valid input.
-* a hole within a hole is consider to be a yet another exterior contour
-* multiple exterior contours (polygons) can be tesselated in one cycle;
- _but_ this significantly degrades performance since many tests will be
- performed for every contour pair; if You want triangulation to be fast
- tesselate a single polygon (with possible holes) one at a time.
-* orientation of exterior contours is arbitray, but if it has holes,
- all interior holes of this particular exterior contour _must_ have an
- opposite orientation.
-* the output triangles have the same orientation as the exterior contour
- that forms them
-* each triangle is "enclosed" within the begin and end callbacks;
- this is not efficent, but was made on purpose; so if triangulation
- results in 2 triangles the following callbacks will be made in such
- order:
- <begin>(GLU_TRAINGLES)
- <vertex>(...) /* 3 vertices of first triangle */
- <vertex>(...)
- <vertex>(...)
- <end>()
- <begin>(GLU_TRAINGLES)
- <vertex>(...) /* 3 vertices of second triangle */
- <vertex>(...)
- <vertex>(...)
- <end>()
- Of course only when begin, vertex, and end callback were provided,
- otherwise no output is done (actually tesselation does not take place).
-* You will notice that some output traingles are very "thin"; there
- exist possible several ways to traingulate a polygon, but "smart" code
- avoiding such cases would require time to write, and will impact on
- execution speed.
-* like OpenGL, no new vertices are introduced during triangulation
-* if the edgeflag callback is provided it will be called whenever
- the just-about-to be output vertex begins a different type of edge
- than the previous vertices; always before the first output a call
- is made with GL_TRUE, to allow synchronization.
-* all intermediate computations are done using GLdouble type, and comparisons
- are biased with a precision value (EPSILON defined in tess.h)
-* the point_in_poly function is my adaptation of code from the
- comp.graphics.alg newsgroup FAQ (originally written by Mr. Wm. Randolph
- Franklin, modified by Scott Anguish).
-* the edge_edge_intersect test is also an adopted code from comp.graphics.alg
- newsgroup FAQ
-* the general idea for traingulation used in this library is described in
- the book "Computational Geometry in C" by Joseph O'Rourke.
-
-
-Excuse my English, its not my mother tongue. I should be available for some
-time uner the following e-mail address. But For how long I am not certain.
-Once I am settled in my new place, I'll post on the Mesa mailing list
-my new address.
-
-(PS: today is my last day of work here, I'm changing my job).
-
-Bogdan. ( bogdan@dia.unisa.it )
-
-Apr 28, 1995.
-
diff --git a/src/glu/mesa/README2 b/src/glu/mesa/README2
deleted file mode 100644
index 3c9959179b0..00000000000
--- a/src/glu/mesa/README2
+++ /dev/null
@@ -1,43 +0,0 @@
-The current NURBS implementation has no trimming facilities yet.
-
-The code is not well commented.
-
-1) Normal calculus fails for special cases of NURBS (independent
- of the NURBS modules)
- Those cases arise when for u or v, some control points
- for a fixed value of that parameter form the same point.
- Imagine a Bezier patch degenerated into a "triangle".
-
- v ^ 0,1,2 order=3
- | *
- |
- | 3* 4* 5*
- |
- | 6* 7* 8*
- |
- |
- +------------------------> u
-
- The calculus of du derivative at triple point (0,1 and 2) will fail.
- As a result, the normal vector will be 0.
- The eval2.c code has to be changed to handle the above situation.
-
-2) Adjacent NURBS surfaces ("sharing" the same control points along
- the "joining" edge) will be sampled with the same factor.
- This prevents the formation of "cracks".
- When the control polygon of the "shared" edge is not the same,
- cracks might appear.
-
-The sampling tolerance is sometimes not respected!
-A NURBS object is broken into Bezier curves/surfaces. If one of such
-Bezier objects has a local high curvature with other portions of it
-relatively flat then the high curvature part will be sampled more dense that
-its flatter regions.
-The flat regions might be tesselated into quads having sides of length
-greater than the current sampling tolernace setting.
-I believe such behaviour is acceptable, though not along the concept of
-sampling tolerance.
-
-February 20, 1996.
-
-Bogdan.
diff --git a/src/glu/mesa/all.h b/src/glu/mesa/all.h
deleted file mode 100644
index 874c9359254..00000000000
--- a/src/glu/mesa/all.h
+++ /dev/null
@@ -1,54 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file includes all .h files needed for the GLU source code for
- * the purpose of precompiled headers.
- *
- * If the preprocessor symbol PCH is defined at compile time then each
- * of the .c files will #include "all.h" only, instead of a bunch of
- * individual .h files.
- */
-
-
-#ifndef GLU_ALL_H
-#define GLU_ALL_H
-
-
-#ifndef PC_HEADER
-This is an error. all.h should be included only if PCH is defined.
-#endif
-
-
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "GL/gl.h"
-#include "GL/glu.h"
-#include "gluP.h"
-#include "nurbs.h"
-#include "tess.h"
-
-
-#endif /*GLU_ALL_H */
diff --git a/src/glu/mesa/descrip.mms b/src/glu/mesa/descrip.mms
deleted file mode 100644
index 2b3f64d8bcc..00000000000
--- a/src/glu/mesa/descrip.mms
+++ /dev/null
@@ -1,61 +0,0 @@
-# Makefile for GLU for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-.first
- define gl [-.include.gl]
-
-.include [-]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = $disk2:[-.include]
-LIBDIR = [-.lib]
-CFLAGS = /include=$(INCDIR)/define=(FBIND=1)/name=(as_is,short)/float=ieee/ieee=denorm
-
-SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
- polytest.c project.c quadric.c tess.c tesselat.c
-
-OBJECTS =glu.obj,mipmap.obj,nurbs.obj,nurbscrv.obj,nurbssrf.obj,nurbsutl.obj,\
- polytest.obj,project.obj,quadric.obj,tess.obj,tesselat.obj
-
-
-##### RULES #####
-
-VERSION=MesaGlu V3.2
-
-##### TARGETS #####
-
-# Make the library:
-$(LIBDIR)$(GLU_LIB) : $(OBJECTS)
-.ifdef SHARE
- @ WRITE_ SYS$OUTPUT " generating mesagl1.opt"
- @ OPEN_/WRITE FILE mesagl1.opt
- @ WRITE_ FILE "!"
- @ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)"
- @ WRITE_ FILE "!"
- @ WRITE_ FILE "IDENTIFICATION=""$(VERSION)"""
- @ WRITE_ FILE "GSMATCH=LEQUAL,3,2
- @ WRITE_ FILE "$(OBJECTS)"
- @ WRITE_ FILE "[-.lib]libmesagl.exe/SHARE"
- @ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE"
- @ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE"
- @ CLOSE_ FILE
- @ WRITE_ SYS$OUTPUT " generating mesagl.map ..."
- @ LINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT
- @ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..."
- @ @[-.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt
- @ WRITE_ SYS$OUTPUT " linking $(GLU_LIB) ..."
- @ LINK_/noinform/NODEB/SHARE=$(GLU_LIB)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt
-.else
- @ $(MAKELIB) $(GLU_LIB) $(OBJECTS)
-.endif
- @ rename $(GLU_LIB)* $(LIBDIR)
-
-clean :
- delete *.obj;*
- purge
-
-include mms_depend.
-
diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c
deleted file mode 100644
index f9e33980a4e..00000000000
--- a/src/glu/mesa/glu.c
+++ /dev/null
@@ -1,416 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- * 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.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "gluP.h"
-#endif
-
-
-/*
- * Miscellaneous utility functions
- */
-
-
-#ifndef M_PI
-#define M_PI 3.1415926536
-#endif
-#define EPS 0.00001
-
-#ifndef GLU_INCOMPATIBLE_GL_VERSION
-#define GLU_INCOMPATIBLE_GL_VERSION 100903
-#endif
-
-
-void GLAPIENTRY
-gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez,
- GLdouble centerx, GLdouble centery, GLdouble centerz,
- GLdouble upx, GLdouble upy, GLdouble upz)
-{
- GLdouble m[16];
- GLdouble x[3], y[3], z[3];
- GLdouble mag;
-
- /* Make rotation matrix */
-
- /* Z vector */
- z[0] = eyex - centerx;
- z[1] = eyey - centery;
- z[2] = eyez - centerz;
- mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]);
- if (mag) { /* mpichler, 19950515 */
- z[0] /= mag;
- z[1] /= mag;
- z[2] /= mag;
- }
-
- /* Y vector */
- y[0] = upx;
- y[1] = upy;
- y[2] = upz;
-
- /* X vector = Y cross Z */
- x[0] = y[1] * z[2] - y[2] * z[1];
- x[1] = -y[0] * z[2] + y[2] * z[0];
- x[2] = y[0] * z[1] - y[1] * z[0];
-
- /* Recompute Y = Z cross X */
- y[0] = z[1] * x[2] - z[2] * x[1];
- y[1] = -z[0] * x[2] + z[2] * x[0];
- y[2] = z[0] * x[1] - z[1] * x[0];
-
- /* mpichler, 19950515 */
- /* cross product gives area of parallelogram, which is < 1.0 for
- * non-perpendicular unit-length vectors; so normalize x, y here
- */
-
- mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
- if (mag) {
- x[0] /= mag;
- x[1] /= mag;
- x[2] /= mag;
- }
-
- mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]);
- if (mag) {
- y[0] /= mag;
- y[1] /= mag;
- y[2] /= mag;
- }
-
-#define M(row,col) m[col*4+row]
- M(0, 0) = x[0];
- M(0, 1) = x[1];
- M(0, 2) = x[2];
- M(0, 3) = 0.0;
- M(1, 0) = y[0];
- M(1, 1) = y[1];
- M(1, 2) = y[2];
- M(1, 3) = 0.0;
- M(2, 0) = z[0];
- M(2, 1) = z[1];
- M(2, 2) = z[2];
- M(2, 3) = 0.0;
- M(3, 0) = 0.0;
- M(3, 1) = 0.0;
- M(3, 2) = 0.0;
- M(3, 3) = 1.0;
-#undef M
- glMultMatrixd(m);
-
- /* Translate Eye to Origin */
- glTranslated(-eyex, -eyey, -eyez);
-
-}
-
-
-
-void GLAPIENTRY
-gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top)
-{
- glOrtho(left, right, bottom, top, -1.0, 1.0);
-}
-
-
-
-static void
-frustum(GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval)
-{
- GLdouble x, y, a, b, c, d;
- GLdouble m[16];
-
- x = (2.0 * nearval) / (right - left);
- y = (2.0 * nearval) / (top - bottom);
- a = (right + left) / (right - left);
- b = (top + bottom) / (top - bottom);
- c = -(farval + nearval) / ( farval - nearval);
- d = -(2.0 * farval * nearval) / (farval - nearval);
-
-#define M(row,col) m[col*4+row]
- M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F;
- M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F;
- M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d;
- M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F;
-#undef M
-
- glMultMatrixd(m);
-}
-
-
-void GLAPIENTRY
-gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
-{
- GLdouble xmin, xmax, ymin, ymax;
-
- ymax = zNear * tan(fovy * M_PI / 360.0);
- ymin = -ymax;
- xmin = ymin * aspect;
- xmax = ymax * aspect;
-
- /* don't call glFrustum() because of error semantics (covglu) */
- frustum(xmin, xmax, ymin, ymax, zNear, zFar);
-}
-
-
-
-void GLAPIENTRY
-gluPickMatrix(GLdouble x, GLdouble y,
- GLdouble width, GLdouble height, GLint viewport[4])
-{
- GLfloat m[16];
- GLfloat sx, sy;
- GLfloat tx, ty;
-
- sx = viewport[2] / width;
- sy = viewport[3] / height;
- tx = (viewport[2] + 2.0 * (viewport[0] - x)) / width;
- ty = (viewport[3] + 2.0 * (viewport[1] - y)) / height;
-
-#define M(row,col) m[col*4+row]
- M(0, 0) = sx;
- M(0, 1) = 0.0;
- M(0, 2) = 0.0;
- M(0, 3) = tx;
- M(1, 0) = 0.0;
- M(1, 1) = sy;
- M(1, 2) = 0.0;
- M(1, 3) = ty;
- M(2, 0) = 0.0;
- M(2, 1) = 0.0;
- M(2, 2) = 1.0;
- M(2, 3) = 0.0;
- M(3, 0) = 0.0;
- M(3, 1) = 0.0;
- M(3, 2) = 0.0;
- M(3, 3) = 1.0;
-#undef M
-
- glMultMatrixf(m);
-}
-
-
-
-const GLubyte *GLAPIENTRY
-gluErrorString(GLenum errorCode)
-{
- static char *tess_error[] = {
- "missing gluBeginPolygon",
- "missing gluBeginContour",
- "missing gluEndPolygon",
- "missing gluEndContour",
- "misoriented or self-intersecting loops",
- "coincident vertices",
- "colinear vertices",
- "FIST recovery process fatal error"
- };
- static char *nurbs_error[] = {
- "spline order un-supported",
- "too few knots",
- "valid knot range is empty",
- "decreasing knot sequence knot",
- "knot multiplicity greater than order of spline",
- "endcurve() must follow bgncurve()",
- "bgncurve() must precede endcurve()",
- "missing or extra geometric data",
- "can't draw pwlcurves",
- "missing bgncurve()",
- "missing bgnsurface()",
- "endtrim() must precede endsurface()",
- "bgnsurface() must precede endsurface()",
- "curve of improper type passed as trim curve",
- "bgnsurface() must precede bgntrim()",
- "endtrim() must follow bgntrim()",
- "bgntrim() must precede endtrim()",
- "invalid or missing trim curve",
- "bgntrim() must precede pwlcurve()",
- "pwlcurve referenced twice",
- "pwlcurve and nurbscurve mixed",
- "improper usage of trim data type",
- "nurbscurve referenced twice",
- "nurbscurve and pwlcurve mixed",
- "nurbssurface referenced twice",
- "invalid property",
- "endsurface() must follow bgnsurface()",
- "misoriented trim curves",
- "intersecting trim curves",
- "UNUSED",
- "unconnected trim curves",
- "unknown knot error",
- "negative vertex count encountered",
- "negative byte-stride encountered",
- "unknown type descriptor",
- "null control array or knot vector",
- "duplicate point on pwlcurve"
- };
-
- /* GL Errors */
- if (errorCode == GL_NO_ERROR) {
- return (GLubyte *) "no error";
- }
- else if (errorCode == GL_INVALID_VALUE) {
- return (GLubyte *) "invalid value";
- }
- else if (errorCode == GL_INVALID_ENUM) {
- return (GLubyte *) "invalid enum";
- }
- else if (errorCode == GL_INVALID_OPERATION) {
- return (GLubyte *) "invalid operation";
- }
- else if (errorCode == GL_STACK_OVERFLOW) {
- return (GLubyte *) "stack overflow";
- }
- else if (errorCode == GL_STACK_UNDERFLOW) {
- return (GLubyte *) "stack underflow";
- }
- else if (errorCode == GL_OUT_OF_MEMORY) {
- return (GLubyte *) "out of memory";
- }
- /* GLU Errors */
- else if (errorCode == GLU_NO_ERROR) {
- return (GLubyte *) "no error";
- }
- else if (errorCode == GLU_INVALID_ENUM) {
- return (GLubyte *) "invalid enum";
- }
- else if (errorCode == GLU_INVALID_VALUE) {
- return (GLubyte *) "invalid value";
- }
- else if (errorCode == GLU_OUT_OF_MEMORY) {
- return (GLubyte *) "out of memory";
- }
- else if (errorCode == GLU_INCOMPATIBLE_GL_VERSION) {
- return (GLubyte *) "incompatible GL version";
- }
- else if (errorCode >= GLU_TESS_ERROR1 && errorCode <= GLU_TESS_ERROR8) {
- return (GLubyte *) tess_error[errorCode - GLU_TESS_ERROR1];
- }
- else if (errorCode >= GLU_NURBS_ERROR1 && errorCode <= GLU_NURBS_ERROR37) {
- return (GLubyte *) nurbs_error[errorCode - GLU_NURBS_ERROR1];
- }
- else {
- return NULL;
- }
-}
-
-
-
-/*
- * New in GLU 1.1
- */
-
-const GLubyte *GLAPIENTRY
-gluGetString(GLenum name)
-{
- static char *extensions = "GL_EXT_abgr";
- static char *version = "1.1 Mesa 3.5";
-
- switch (name) {
- case GLU_EXTENSIONS:
- return (GLubyte *) extensions;
- case GLU_VERSION:
- return (GLubyte *) version;
- default:
- return NULL;
- }
-}
-
-
-
-#if 0 /* gluGetProcAddressEXT not finalized yet! */
-
-#ifdef __cplusplus
- /* for BeOS R4.5 */
-void GLAPIENTRY(*gluGetProcAddressEXT(const GLubyte * procName)) (...)
-#else
-void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) ()
-#endif
-{
- struct proc
- {
- const char *name;
- void *address;
- };
- static struct proc procTable[] = {
- {"gluGetProcAddressEXT", (void *) gluGetProcAddressEXT}, /* me! */
-
- /* new 1.1 functions */
- {"gluGetString", (void *) gluGetString},
-
- /* new 1.2 functions */
- {"gluTessBeginPolygon", (void *) gluTessBeginPolygon},
- {"gluTessBeginContour", (void *) gluTessBeginContour},
- {"gluTessEndContour", (void *) gluTessEndContour},
- {"gluTessEndPolygon", (void *) gluTessEndPolygon},
- {"gluGetTessProperty", (void *) gluGetTessProperty},
-
- /* new 1.3 functions */
-
- {NULL, NULL}
- };
- GLuint i;
-
- for (i = 0; procTable[i].address; i++) {
- if (strcmp((const char *) procName, procTable[i].name) == 0)
- return (void (GLAPIENTRY *) ()) procTable[i].address;
- }
-
- return NULL;
-}
-
-#endif
-
-
-
-/*
- * New in GLU 1.3
- */
-#ifdef GLU_VERSION_1_3
-GLboolean GLAPIENTRY
-gluCheckExtension(const GLubyte *extName, const GLubyte * extString)
-{
- assert(extName);
- assert(extString);
- {
- const int len = strlen((const char *) extName);
- const char *start = (const char *) extString;
-
- while (1) {
- const char *c = strstr(start, (const char *) extName);
- if (!c)
- return GL_FALSE;
-
- if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0))
- return GL_TRUE;
-
- start = c + len;
- }
- }
-}
-#endif
diff --git a/src/glu/mesa/gluP.h b/src/glu/mesa/gluP.h
deleted file mode 100644
index dc1b05b6a1b..00000000000
--- a/src/glu/mesa/gluP.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- * Copyright (C) 1995-2004 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 file allows the GLU code to be compiled either with the Mesa
- * headers or with the real OpenGL headers.
- */
-
-
-#ifndef GLUP_H
-#define GLUP_H
-
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include <string.h>
-
-
-#if defined(_WIN32) && !defined(__WIN32__)
-# define __WIN32__
-#endif
-
-#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
-# pragma warning( disable : 4068 ) /* unknown pragma */
-# pragma warning( disable : 4710 ) /* function 'foo' not inlined */
-# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
-# pragma warning( disable : 4127 ) /* conditional expression is constant */
-# if defined(MESA_MINWARN)
-# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
-# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
-# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
-# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
-# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
-# endif
-# define GLCALLBACK __stdcall
-# if defined(__CYGWIN__)
-# define GLCALLBACKPCAST *
-# else
-# define GLCALLBACKPCAST __stdcall *
-# endif
-#else
-/* non-Windows compilation */
-# define GLCALLBACK
-# define GLCALLBACKPCAST *
-#endif /* WIN32 / CYGWIN bracket */
-
-/* compatability guard so we don't need to change client code */
-
-#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
-# define CALLBACK GLCALLBACK
-#endif
-
-
-
-#ifndef GLU_TESS_ERROR9
- /* If we're using the real OpenGL header files... */
-# define GLU_TESS_ERROR9 100159
-#endif
-
-
-#define GLU_NO_ERROR GL_NO_ERROR
-
-
-/* for Sun: */
-#ifdef SUNOS4
-#define MEMCPY( DST, SRC, BYTES) \
- memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) )
-#else
-#define MEMCPY( DST, SRC, BYTES) \
- memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )
-#endif
-
-
-#ifndef NULL
-# define NULL 0
-#endif
-
-
-#endif
diff --git a/src/glu/mesa/mipmap.c b/src/glu/mesa/mipmap.c
deleted file mode 100644
index d85ce9b9b0a..00000000000
--- a/src/glu/mesa/mipmap.c
+++ /dev/null
@@ -1,824 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.4
- * Copyright (C) 1995-2000 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.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "gluP.h"
-#endif
-
-
-/*
- * Compute ceiling of integer quotient of A divided by B:
- */
-#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
-
-
-
-#ifdef EPSILON
-#undef EPSILON
-#endif
-#define EPSILON 0.001
-
-
-/* To work around optimizer bug in MSVC4.1 */
-#if defined(__WIN32__) && !defined(OPENSTEP)
-void
-dummy(GLuint j, GLuint k)
-{
-}
-#else
-#define dummy(J, K)
-#endif
-
-
-GLint GLAPIENTRY
-gluScaleImage(GLenum format,
- GLsizei widthin, GLsizei heightin,
- GLenum typein, const void *datain,
- GLsizei widthout, GLsizei heightout,
- GLenum typeout, void *dataout)
-{
- GLint components, i, j, k;
- GLfloat *tempin, *tempout;
- GLfloat sx, sy;
- GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels;
- GLint packrowlength, packalignment, packskiprows, packskippixels;
- GLint sizein, sizeout;
- GLint rowstride, rowlen;
-
-
- /* Determine number of components per pixel */
- switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- components = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- components = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- components = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
-#ifdef GL_EXT_abgr
- case GL_ABGR_EXT:
-#endif
- components = 4;
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
- /* Determine bytes per input datum */
- switch (typein) {
- case GL_UNSIGNED_BYTE:
- sizein = sizeof(GLubyte);
- break;
- case GL_BYTE:
- sizein = sizeof(GLbyte);
- break;
- case GL_UNSIGNED_SHORT:
- sizein = sizeof(GLushort);
- break;
- case GL_SHORT:
- sizein = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- sizein = sizeof(GLuint);
- break;
- case GL_INT:
- sizein = sizeof(GLint);
- break;
- case GL_FLOAT:
- sizein = sizeof(GLfloat);
- break;
- case GL_BITMAP:
- /* not implemented yet */
- default:
- return GL_INVALID_ENUM;
- }
-
- /* Determine bytes per output datum */
- switch (typeout) {
- case GL_UNSIGNED_BYTE:
- sizeout = sizeof(GLubyte);
- break;
- case GL_BYTE:
- sizeout = sizeof(GLbyte);
- break;
- case GL_UNSIGNED_SHORT:
- sizeout = sizeof(GLushort);
- break;
- case GL_SHORT:
- sizeout = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- sizeout = sizeof(GLuint);
- break;
- case GL_INT:
- sizeout = sizeof(GLint);
- break;
- case GL_FLOAT:
- sizeout = sizeof(GLfloat);
- break;
- case GL_BITMAP:
- /* not implemented yet */
- default:
- return GL_INVALID_ENUM;
- }
-
- /* Get glPixelStore state */
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength);
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength);
- glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels);
-
- /* Allocate storage for intermediate images */
- tempin = (GLfloat *) malloc(widthin * heightin
- * components * sizeof(GLfloat));
- if (!tempin) {
- return GLU_OUT_OF_MEMORY;
- }
- tempout = (GLfloat *) malloc(widthout * heightout
- * components * sizeof(GLfloat));
- if (!tempout) {
- free(tempin);
- return GLU_OUT_OF_MEMORY;
- }
-
-
- /*
- * Unpack the pixel data and convert to floating point
- */
-
- if (unpackrowlength > 0) {
- rowlen = unpackrowlength;
- }
- else {
- rowlen = widthin;
- }
- if (sizein >= unpackalignment) {
- rowstride = components * rowlen;
- }
- else {
- rowstride = unpackalignment / sizein
- * CEILING(components * rowlen * sizein, unpackalignment);
- }
-
- switch (typein) {
- case GL_UNSIGNED_BYTE:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLubyte *ubptr = (GLubyte *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * ubptr++;
- }
- }
- break;
- case GL_BYTE:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLbyte *bptr = (GLbyte *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * bptr++;
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLushort *usptr = (GLushort *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * usptr++;
- }
- }
- break;
- case GL_SHORT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLshort *sptr = (GLshort *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * sptr++;
- }
- }
- break;
- case GL_UNSIGNED_INT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLuint *uiptr = (GLuint *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * uiptr++;
- }
- }
- break;
- case GL_INT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLint *iptr = (GLint *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * iptr++;
- }
- }
- break;
- case GL_FLOAT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLfloat *fptr = (GLfloat *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = *fptr++;
- }
- }
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
-
- /*
- * Scale the image!
- */
-
- if (widthout > 1)
- sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1);
- else
- sx = (GLfloat) (widthin - 1);
- if (heightout > 1)
- sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1);
- else
- sy = (GLfloat) (heightin - 1);
-
-/*#define POINT_SAMPLE*/
-#ifdef POINT_SAMPLE
- for (i = 0; i < heightout; i++) {
- GLint ii = i * sy;
- for (j = 0; j < widthout; j++) {
- GLint jj = j * sx;
-
- GLfloat *src = tempin + (ii * widthin + jj) * components;
- GLfloat *dst = tempout + (i * widthout + j) * components;
-
- for (k = 0; k < components; k++) {
- *dst++ = *src++;
- }
- }
- }
-#else
- if (sx < 1.0 && sy < 1.0) {
- /* magnify both width and height: use weighted sample of 4 pixels */
- GLint i0, i1, j0, j1;
- GLfloat alpha, beta;
- GLfloat *src00, *src01, *src10, *src11;
- GLfloat s1, s2;
- GLfloat *dst;
-
- for (i = 0; i < heightout; i++) {
- i0 = i * sy;
- i1 = i0 + 1;
- if (i1 >= heightin)
- i1 = heightin - 1;
-/* i1 = (i+1) * sy - EPSILON;*/
- alpha = i * sy - i0;
- for (j = 0; j < widthout; j++) {
- j0 = j * sx;
- j1 = j0 + 1;
- if (j1 >= widthin)
- j1 = widthin - 1;
-/* j1 = (j+1) * sx - EPSILON; */
- beta = j * sx - j0;
-
- /* compute weighted average of pixels in rect (i0,j0)-(i1,j1) */
- src00 = tempin + (i0 * widthin + j0) * components;
- src01 = tempin + (i0 * widthin + j1) * components;
- src10 = tempin + (i1 * widthin + j0) * components;
- src11 = tempin + (i1 * widthin + j1) * components;
-
- dst = tempout + (i * widthout + j) * components;
-
- for (k = 0; k < components; k++) {
- s1 = *src00++ * (1.0 - beta) + *src01++ * beta;
- s2 = *src10++ * (1.0 - beta) + *src11++ * beta;
- *dst++ = s1 * (1.0 - alpha) + s2 * alpha;
- }
- }
- }
- }
- else {
- /* shrink width and/or height: use an unweighted box filter */
- GLint i0, i1;
- GLint j0, j1;
- GLint ii, jj;
- GLfloat sum, *dst;
-
- for (i = 0; i < heightout; i++) {
- i0 = i * sy;
- i1 = i0 + 1;
- if (i1 >= heightin)
- i1 = heightin - 1;
-/* i1 = (i+1) * sy - EPSILON; */
- for (j = 0; j < widthout; j++) {
- j0 = j * sx;
- j1 = j0 + 1;
- if (j1 >= widthin)
- j1 = widthin - 1;
-/* j1 = (j+1) * sx - EPSILON; */
-
- dst = tempout + (i * widthout + j) * components;
-
- /* compute average of pixels in the rectangle (i0,j0)-(i1,j1) */
- for (k = 0; k < components; k++) {
- sum = 0.0;
- for (ii = i0; ii <= i1; ii++) {
- for (jj = j0; jj <= j1; jj++) {
- sum += *(tempin + (ii * widthin + jj) * components + k);
- }
- }
- sum /= (j1 - j0 + 1) * (i1 - i0 + 1);
- *dst++ = sum;
- }
- }
- }
- }
-#endif
-
-
- /*
- * Return output image
- */
-
- if (packrowlength > 0) {
- rowlen = packrowlength;
- }
- else {
- rowlen = widthout;
- }
- if (sizeout >= packalignment) {
- rowstride = components * rowlen;
- }
- else {
- rowstride = packalignment / sizeout
- * CEILING(components * rowlen * sizeout, packalignment);
- }
-
- switch (typeout) {
- case GL_UNSIGNED_BYTE:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLubyte *ubptr = (GLubyte *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *ubptr++ = (GLubyte) tempout[k++];
- }
- }
- break;
- case GL_BYTE:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLbyte *bptr = (GLbyte *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *bptr++ = (GLbyte) tempout[k++];
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLushort *usptr = (GLushort *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *usptr++ = (GLushort) tempout[k++];
- }
- }
- break;
- case GL_SHORT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLshort *sptr = (GLshort *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *sptr++ = (GLshort) tempout[k++];
- }
- }
- break;
- case GL_UNSIGNED_INT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLuint *uiptr = (GLuint *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *uiptr++ = (GLuint) tempout[k++];
- }
- }
- break;
- case GL_INT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLint *iptr = (GLint *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *iptr++ = (GLint) tempout[k++];
- }
- }
- break;
- case GL_FLOAT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLfloat *fptr = (GLfloat *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *fptr++ = tempout[k++];
- }
- }
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
-
- /* free temporary image storage */
- free(tempin);
- free(tempout);
-
- return 0;
-}
-
-
-
-/*
- * Return the largest k such that 2^k <= n.
- */
-static GLint
-ilog2(GLint n)
-{
- GLint k;
-
- if (n <= 0)
- return 0;
- for (k = 0; n >>= 1; k++);
- return k;
-}
-
-
-
-/*
- * Find the value nearest to n which is also a power of two.
- */
-static GLint
-round2(GLint n)
-{
- GLint m;
-
- for (m = 1; m < n; m *= 2);
-
- /* m>=n */
- if (m - n <= n - m / 2) {
- return m;
- }
- else {
- return m / 2;
- }
-}
-
-
-/*
- * Given an pixel format and datatype, return the number of bytes to
- * store one pixel.
- */
-static GLint
-bytes_per_pixel(GLenum format, GLenum type)
-{
- GLint n, m;
-
- switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- n = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- n = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- n = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
-#ifdef GL_EXT_abgr
- case GL_ABGR_EXT:
-#endif
- n = 4;
- break;
- default:
- n = 0;
- }
-
- switch (type) {
- case GL_UNSIGNED_BYTE:
- m = sizeof(GLubyte);
- break;
- case GL_BYTE:
- m = sizeof(GLbyte);
- break;
- case GL_BITMAP:
- m = 1;
- break;
- case GL_UNSIGNED_SHORT:
- m = sizeof(GLushort);
- break;
- case GL_SHORT:
- m = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- m = sizeof(GLuint);
- break;
- case GL_INT:
- m = sizeof(GLint);
- break;
- case GL_FLOAT:
- m = sizeof(GLfloat);
- break;
- default:
- m = 0;
- }
-
- return n * m;
-}
-
-
-
-/*
- * WARNING: This function isn't finished and has never been tested!!!!
- */
-GLint GLAPIENTRY
-gluBuild1DMipmaps(GLenum target, GLint components,
- GLsizei width, GLenum format, GLenum type, const void *data)
-{
- GLubyte *texture;
- GLint levels, max_levels;
- GLint new_width, max_width;
- GLint i, j, k, l;
-
- if (width < 1)
- return GLU_INVALID_VALUE;
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_width);
- max_levels = ilog2(max_width) + 1;
-
- /* Compute how many mipmap images to make */
- levels = ilog2(width) + 1;
- if (levels > max_levels) {
- levels = max_levels;
- }
-
- new_width = 1 << (levels - 1);
-
- texture = (GLubyte *) malloc(new_width * components);
- if (!texture) {
- return GLU_OUT_OF_MEMORY;
- }
-
- if (width != new_width) {
- /* initial rescaling */
- switch (type) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *ub_data = (GLubyte *) data;
- for (i = 0; i < new_width; i++) {
- j = i * width / new_width;
- for (k = 0; k < components; k++) {
- texture[i * components + k] = ub_data[j * components + k];
- }
- }
- }
- break;
- default:
- /* Not implemented */
- return GLU_ERROR;
- }
- }
-
- /* generate and load mipmap images */
- for (l = 0; l < levels; l++) {
- glTexImage1D(GL_TEXTURE_1D, l, components, new_width, 0,
- format, GL_UNSIGNED_BYTE, texture);
-
- /* Scale image down to 1/2 size */
- new_width = new_width / 2;
- for (i = 0; i < new_width; i++) {
- for (k = 0; k < components; k++) {
- GLint sample1, sample2;
- sample1 = (GLint) texture[i * 2 * components + k];
- sample2 = (GLint) texture[(i * 2 + 1) * components + k];
- texture[i * components + k] = (GLubyte) ((sample1 + sample2) / 2);
- }
- }
- }
-
- free(texture);
-
- return 0;
-}
-
-
-
-GLint GLAPIENTRY
-gluBuild2DMipmaps(GLenum target, GLint components,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const void *data)
-{
- GLint w, h, maxsize;
- void *image, *newimage;
- GLint neww, newh, level, bpp;
- int error;
- GLboolean done;
- GLint retval = 0;
- GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels;
- GLint packrowlength, packalignment, packskiprows, packskippixels;
-
- if (width < 1 || height < 1)
- return GLU_INVALID_VALUE;
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
-
- w = round2(width);
- if (w > maxsize) {
- w = maxsize;
- }
- h = round2(height);
- if (h > maxsize) {
- h = maxsize;
- }
-
- bpp = bytes_per_pixel(format, type);
- if (bpp == 0) {
- /* probably a bad format or type enum */
- return GLU_INVALID_ENUM;
- }
-
- /* Get current glPixelStore values */
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength);
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength);
- glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels);
-
- /* set pixel packing */
- glPixelStorei(GL_PACK_ROW_LENGTH, 0);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_SKIP_ROWS, 0);
- glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
-
- done = GL_FALSE;
-
- if (w != width || h != height) {
- /* must rescale image to get "top" mipmap texture image */
- image = malloc((w + 4) * h * bpp);
- if (!image) {
- return GLU_OUT_OF_MEMORY;
- }
- error = gluScaleImage(format, width, height, type, data,
- w, h, type, image);
- if (error) {
- retval = error;
- done = GL_TRUE;
- }
- }
- else {
- image = (void *) data;
- }
-
- level = 0;
- while (!done) {
- if (image != data) {
- /* set pixel unpacking */
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- }
-
- glTexImage2D(target, level, components, w, h, 0, format, type, image);
-
- if (w == 1 && h == 1)
- break;
-
- neww = (w < 2) ? 1 : w / 2;
- newh = (h < 2) ? 1 : h / 2;
- newimage = malloc((neww + 4) * newh * bpp);
- if (!newimage) {
- return GLU_OUT_OF_MEMORY;
- }
-
- error = gluScaleImage(format, w, h, type, image,
- neww, newh, type, newimage);
- if (error) {
- retval = error;
- done = GL_TRUE;
- }
-
- if (image != data) {
- free(image);
- }
- image = newimage;
-
- w = neww;
- h = newh;
- level++;
- }
-
- if (image != data) {
- free(image);
- }
-
- /* Restore original glPixelStore state */
- glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength);
- glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels);
- glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength);
- glPixelStorei(GL_PACK_ALIGNMENT, packalignment);
- glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows);
- glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels);
-
- return retval;
-}
diff --git a/src/glu/mesa/mms_depend b/src/glu/mesa/mms_depend
deleted file mode 100644
index ed59ca9de89..00000000000
--- a/src/glu/mesa/mms_depend
+++ /dev/null
@@ -1,15 +0,0 @@
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-glu.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
-mipmap.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
-nurbs.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h
-nurbscrv.obj : nurbs.h gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
-nurbssrf.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h
-nurbsutl.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h
-project.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
-quadric.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
-tess.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
-tess_fist.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
-tess_hash.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
-tess_heap.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
-tess_clip.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
diff --git a/src/glu/mesa/nurbs.c b/src/glu/mesa/nurbs.c
deleted file mode 100644
index 3f102b4e455..00000000000
--- a/src/glu/mesa/nurbs.c
+++ /dev/null
@@ -1,628 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#include "gluP.h"
-#include "nurbs.h"
-#endif
-
-
-void
-call_user_error(GLUnurbsObj * nobj, GLenum error)
-{
- nobj->error = error;
- if (nobj->error_callback != NULL) {
- (*(nobj->error_callback)) (error);
- }
- else {
- printf("NURBS error %d %s\n", error, (char *) gluErrorString(error));
- }
-}
-
-
-
-GLUnurbsObj *GLAPIENTRY
-gluNewNurbsRenderer(void)
-{
- GLUnurbsObj *n;
- GLfloat tmp_viewport[4];
- GLint i, j;
-
- n = (GLUnurbsObj *) malloc(sizeof(GLUnurbsObj));
- if (n) {
- /* init */
- n->culling = GL_FALSE;
- n->nurbs_type = GLU_NURBS_NONE;
- n->error = GLU_NO_ERROR;
- n->error_callback = NULL;
- n->auto_load_matrix = GL_TRUE;
- n->sampling_tolerance = 50.0;
- n->parametric_tolerance = 0.5;
- n->u_step = n->v_step = 100;
- n->sampling_method = GLU_PATH_LENGTH;
- n->display_mode = GLU_FILL;
- /* in case the user doesn't supply the sampling matrices */
- /* set projection and modelview to identity */
- for (i = 0; i < 4; i++)
- for (j = 0; j < 4; j++)
- if (i == j) {
- n->sampling_matrices.model[i * 4 + j] = 1.0;
- n->sampling_matrices.proj[i * 4 + j] = 1.0;
- }
- else {
- n->sampling_matrices.model[i * 4 + j] = 0.0;
- n->sampling_matrices.proj[i * 4 + j] = 0.0;
- }
- /* and set the viewport sampling matrix to current ciewport */
- glGetFloatv(GL_VIEWPORT, tmp_viewport);
- for (i = 0; i < 4; i++)
- n->sampling_matrices.viewport[i] = tmp_viewport[i];
- n->trim = NULL;
- }
- return n;
-}
-
-
-
-void GLAPIENTRY
-gluDeleteNurbsRenderer(GLUnurbsObj * nobj)
-{
- if (nobj) {
- free(nobj);
- }
-}
-
-
-
-void GLAPIENTRY
-gluLoadSamplingMatrices(GLUnurbsObj * nobj,
- const GLfloat modelMatrix[16],
- const GLfloat projMatrix[16], const GLint viewport[4])
-{
- GLint i;
-
- for (i = 0; i < 16; i++) {
- nobj->sampling_matrices.model[i] = modelMatrix[i];
- nobj->sampling_matrices.proj[i] = projMatrix[i];
- }
- for (i = 0; i < 4; i++)
- nobj->sampling_matrices.viewport[i] = viewport[i];
-}
-
-
-void GLAPIENTRY
-gluNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat value)
-{
- GLenum val;
-
- switch (property) {
- case GLU_SAMPLING_TOLERANCE:
- if (value <= 0.0) {
- call_user_error(nobj, GLU_INVALID_VALUE);
- return;
- }
- nobj->sampling_tolerance = value;
- break;
- case GLU_PARAMETRIC_TOLERANCE:
- if (value <= 0.0) {
- call_user_error(nobj, GLU_INVALID_VALUE);
- return;
- }
- nobj->parametric_tolerance = value;
- break;
- case GLU_U_STEP:
- if (value <= 0.0) {
- call_user_error(nobj, GLU_INVALID_VALUE);
- return;
- }
- nobj->u_step = (GLint) value;
- break;
- case GLU_V_STEP:
- if (value <= 0.0) {
- call_user_error(nobj, GLU_INVALID_VALUE);
- return;
- }
- nobj->v_step = (GLint) value;
- break;
- case GLU_SAMPLING_METHOD:
- val = (GLenum) value;
- if (val != GLU_PATH_LENGTH && val != GLU_PARAMETRIC_ERROR
- && val != GLU_DOMAIN_DISTANCE) {
- call_user_error(nobj, GLU_INVALID_ENUM);
- return;
- }
- nobj->sampling_method = val;
- break;
- case GLU_DISPLAY_MODE:
- val = (GLenum) value;
- if (val != GLU_FILL && val != GLU_OUTLINE_POLYGON
- && val != GLU_OUTLINE_PATCH) {
- call_user_error(nobj, GLU_INVALID_ENUM);
- return;
- }
- if (nobj->nurbs_type == GLU_NURBS_CURVE) {
- call_user_error(nobj, GLU_NURBS_ERROR26);
- return;
- }
- nobj->display_mode = val;
- if (val == GLU_OUTLINE_PATCH)
- fprintf(stderr,
- "NURBS, for the moment, can display only in POLYGON mode\n");
- break;
- case GLU_CULLING:
- val = (GLenum) value;
- if (val != GL_TRUE && val != GL_FALSE) {
- call_user_error(nobj, GLU_INVALID_ENUM);
- return;
- }
- nobj->culling = (GLboolean) value;
- break;
- case GLU_AUTO_LOAD_MATRIX:
- val = (GLenum) value;
- if (val != GL_TRUE && val != GL_FALSE) {
- call_user_error(nobj, GLU_INVALID_ENUM);
- return;
- }
- nobj->auto_load_matrix = (GLboolean) value;
- break;
- default:
- call_user_error(nobj, GLU_NURBS_ERROR26);
- }
-}
-
-
-void GLAPIENTRY
-gluGetNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat * value)
-{
- switch (property) {
- case GLU_SAMPLING_TOLERANCE:
- *value = nobj->sampling_tolerance;
- break;
- case GLU_DISPLAY_MODE:
- *value = (GLfloat) (GLint) nobj->display_mode;
- break;
- case GLU_CULLING:
- *value = nobj->culling ? 1.0 : 0.0;
- break;
- case GLU_AUTO_LOAD_MATRIX:
- *value = nobj->auto_load_matrix ? 1.0 : 0.0;
- break;
- default:
- call_user_error(nobj, GLU_INVALID_ENUM);
- }
-}
-
-
-
-void GLAPIENTRY
-gluBeginCurve(GLUnurbsObj * nobj)
-{
- if (nobj->nurbs_type == GLU_NURBS_CURVE) {
- call_user_error(nobj, GLU_NURBS_ERROR6);
- return;
- }
- nobj->nurbs_type = GLU_NURBS_CURVE;
- nobj->curve.geom.type = GLU_INVALID_ENUM;
- nobj->curve.color.type = GLU_INVALID_ENUM;
- nobj->curve.texture.type = GLU_INVALID_ENUM;
- nobj->curve.normal.type = GLU_INVALID_ENUM;
-}
-
-
-void GLAPIENTRY
-gluEndCurve(GLUnurbsObj * nobj)
-{
- if (nobj->nurbs_type == GLU_NURBS_NONE) {
- call_user_error(nobj, GLU_NURBS_ERROR7);
- return;
- }
- if (nobj->curve.geom.type == GLU_INVALID_ENUM) {
- call_user_error(nobj, GLU_NURBS_ERROR8);
- nobj->nurbs_type = GLU_NURBS_NONE;
- return;
- }
- glPushAttrib((GLbitfield) (GL_EVAL_BIT | GL_ENABLE_BIT));
- glDisable(GL_MAP1_VERTEX_3);
- glDisable(GL_MAP1_VERTEX_4);
- glDisable(GL_MAP1_INDEX);
- glDisable(GL_MAP1_COLOR_4);
- glDisable(GL_MAP1_NORMAL);
- glDisable(GL_MAP1_TEXTURE_COORD_1);
- glDisable(GL_MAP1_TEXTURE_COORD_2);
- glDisable(GL_MAP1_TEXTURE_COORD_3);
- glDisable(GL_MAP1_TEXTURE_COORD_4);
- glDisable(GL_MAP2_VERTEX_3);
- glDisable(GL_MAP2_VERTEX_4);
- glDisable(GL_MAP2_INDEX);
- glDisable(GL_MAP2_COLOR_4);
- glDisable(GL_MAP2_NORMAL);
- glDisable(GL_MAP2_TEXTURE_COORD_1);
- glDisable(GL_MAP2_TEXTURE_COORD_2);
- glDisable(GL_MAP2_TEXTURE_COORD_3);
- glDisable(GL_MAP2_TEXTURE_COORD_4);
- do_nurbs_curve(nobj);
- glPopAttrib();
- nobj->nurbs_type = GLU_NURBS_NONE;
-}
-
-
-void GLAPIENTRY
-gluNurbsCurve(GLUnurbsObj * nobj, GLint nknots, GLfloat * knot,
- GLint stride, GLfloat * ctlarray, GLint order, GLenum type)
-{
- if (nobj->nurbs_type == GLU_NURBS_TRIM) {
-#if 0
-/* TODO: NOT IMPLEMENTED YET */
- nurbs_trim *ptr1;
- trim_list *ptr2;
-
- if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) {
- call_user_error(nobj, GLU_NURBS_ERROR14);
- return;
- }
- for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next);
- if (ptr1->trim_loop) {
- for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next);
- if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) {
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return;
- }
- ptr2 = ptr2->next;
- }
- else {
- if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) {
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return;
- }
- ptr1->trim_loop = ptr2;
- }
- ptr2->trim_type = GLU_TRIM_NURBS;
- ptr2->curve.nurbs_curve.knot_count = nknots;
- ptr2->curve.nurbs_curve.knot = knot;
- ptr2->curve.nurbs_curve.stride = stride;
- ptr2->curve.nurbs_curve.ctrlarray = ctlarray;
- ptr2->curve.nurbs_curve.order = order;
- ptr2->curve.nurbs_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3);
- ptr2->curve.nurbs_curve.type = type;
- ptr2->next = NULL;
-#endif
- }
- else {
- if (type == GLU_MAP1_TRIM_2 || type == GLU_MAP1_TRIM_3) {
- call_user_error(nobj, GLU_NURBS_ERROR22);
- return;
- }
- if (nobj->nurbs_type != GLU_NURBS_CURVE) {
- call_user_error(nobj, GLU_NURBS_ERROR10);
- return;
- }
- switch (type) {
- case GL_MAP1_VERTEX_3:
- case GL_MAP1_VERTEX_4:
- if (nobj->curve.geom.type != GLU_INVALID_ENUM) {
- call_user_error(nobj, GLU_NURBS_ERROR8);
- return;
- }
- nobj->curve.geom.type = type;
- nobj->curve.geom.knot_count = nknots;
- nobj->curve.geom.knot = knot;
- nobj->curve.geom.stride = stride;
- nobj->curve.geom.ctrlarray = ctlarray;
- nobj->curve.geom.order = order;
- break;
- case GL_MAP1_INDEX:
- case GL_MAP1_COLOR_4:
- nobj->curve.color.type = type;
- nobj->curve.color.knot_count = nknots;
- nobj->curve.color.knot = knot;
- nobj->curve.color.stride = stride;
- nobj->curve.color.ctrlarray = ctlarray;
- nobj->curve.color.order = order;
- break;
- case GL_MAP1_NORMAL:
- nobj->curve.normal.type = type;
- nobj->curve.normal.knot_count = nknots;
- nobj->curve.normal.knot = knot;
- nobj->curve.normal.stride = stride;
- nobj->curve.normal.ctrlarray = ctlarray;
- nobj->curve.normal.order = order;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- case GL_MAP1_TEXTURE_COORD_2:
- case GL_MAP1_TEXTURE_COORD_3:
- case GL_MAP1_TEXTURE_COORD_4:
- nobj->curve.texture.type = type;
- nobj->curve.texture.knot_count = nknots;
- nobj->curve.texture.knot = knot;
- nobj->curve.texture.stride = stride;
- nobj->curve.texture.ctrlarray = ctlarray;
- nobj->curve.texture.order = order;
- break;
- default:
- call_user_error(nobj, GLU_INVALID_ENUM);
- }
- }
-}
-
-
-void GLAPIENTRY
-gluBeginSurface(GLUnurbsObj * nobj)
-{
- switch (nobj->nurbs_type) {
- case GLU_NURBS_NONE:
- nobj->nurbs_type = GLU_NURBS_SURFACE;
- nobj->surface.geom.type = GLU_INVALID_ENUM;
- nobj->surface.color.type = GLU_INVALID_ENUM;
- nobj->surface.texture.type = GLU_INVALID_ENUM;
- nobj->surface.normal.type = GLU_INVALID_ENUM;
- break;
- case GLU_NURBS_TRIM:
- call_user_error(nobj, GLU_NURBS_ERROR16);
- break;
- case GLU_NURBS_SURFACE:
- case GLU_NURBS_NO_TRIM:
- case GLU_NURBS_TRIM_DONE:
- call_user_error(nobj, GLU_NURBS_ERROR27);
- break;
- case GLU_NURBS_CURVE:
- call_user_error(nobj, GLU_NURBS_ERROR6);
- break;
- }
-}
-
-
-void GLAPIENTRY
-gluEndSurface(GLUnurbsObj * nobj)
-{
- switch (nobj->nurbs_type) {
- case GLU_NURBS_NONE:
- call_user_error(nobj, GLU_NURBS_ERROR13);
- break;
- case GLU_NURBS_TRIM:
- call_user_error(nobj, GLU_NURBS_ERROR12);
- break;
- case GLU_NURBS_TRIM_DONE:
-/* if(nobj->trim->trim_loop==NULL)
- {
- call_user_error(nobj,GLU_NURBS_ERROR18);
- return;
- }*/
- /* no break - fallthrough */
- case GLU_NURBS_NO_TRIM:
- glPushAttrib((GLbitfield)
- (GL_EVAL_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT));
- glDisable(GL_MAP2_VERTEX_3);
- glDisable(GL_MAP2_VERTEX_4);
- glDisable(GL_MAP2_INDEX);
- glDisable(GL_MAP2_COLOR_4);
- glDisable(GL_MAP2_NORMAL);
- glDisable(GL_MAP2_TEXTURE_COORD_1);
- glDisable(GL_MAP2_TEXTURE_COORD_2);
- glDisable(GL_MAP2_TEXTURE_COORD_3);
- glDisable(GL_MAP2_TEXTURE_COORD_4);
-/* glDisable(GL_MAP1_VERTEX_3);
- glDisable(GL_MAP1_VERTEX_4);
- glDisable(GL_MAP1_INDEX);
- glDisable(GL_MAP1_COLOR_4);
- glDisable(GL_MAP1_NORMAL);
- glDisable(GL_MAP1_TEXTURE_COORD_1);
- glDisable(GL_MAP1_TEXTURE_COORD_2);
- glDisable(GL_MAP1_TEXTURE_COORD_3);
- glDisable(GL_MAP1_TEXTURE_COORD_4);*/
- do_nurbs_surface(nobj);
- glPopAttrib();
- break;
- default:
- call_user_error(nobj, GLU_NURBS_ERROR8);
- }
- nobj->nurbs_type = GLU_NURBS_NONE;
-}
-
-
-void GLAPIENTRY
-gluNurbsSurface(GLUnurbsObj * nobj,
- GLint sknot_count, GLfloat * sknot,
- GLint tknot_count, GLfloat * tknot,
- GLint s_stride, GLint t_stride,
- GLfloat * ctrlarray, GLint sorder, GLint torder, GLenum type)
-{
- if (nobj->nurbs_type == GLU_NURBS_NO_TRIM
- || nobj->nurbs_type == GLU_NURBS_TRIM
- || nobj->nurbs_type == GLU_NURBS_TRIM_DONE) {
- if (type == GL_MAP2_VERTEX_3 || type == GL_MAP2_VERTEX_4) {
- call_user_error(nobj, GLU_NURBS_ERROR8);
- return;
- }
- }
- else if (nobj->nurbs_type != GLU_NURBS_SURFACE) {
- call_user_error(nobj, GLU_NURBS_ERROR11);
- return;
- }
- switch (type) {
- case GL_MAP2_VERTEX_3:
- case GL_MAP2_VERTEX_4:
- nobj->surface.geom.sknot_count = sknot_count;
- nobj->surface.geom.sknot = sknot;
- nobj->surface.geom.tknot_count = tknot_count;
- nobj->surface.geom.tknot = tknot;
- nobj->surface.geom.s_stride = s_stride;
- nobj->surface.geom.t_stride = t_stride;
- nobj->surface.geom.ctrlarray = ctrlarray;
- nobj->surface.geom.sorder = sorder;
- nobj->surface.geom.torder = torder;
- nobj->surface.geom.type = type;
- nobj->nurbs_type = GLU_NURBS_NO_TRIM;
- break;
- case GL_MAP2_INDEX:
- case GL_MAP2_COLOR_4:
- nobj->surface.color.sknot_count = sknot_count;
- nobj->surface.color.sknot = sknot;
- nobj->surface.color.tknot_count = tknot_count;
- nobj->surface.color.tknot = tknot;
- nobj->surface.color.s_stride = s_stride;
- nobj->surface.color.t_stride = t_stride;
- nobj->surface.color.ctrlarray = ctrlarray;
- nobj->surface.color.sorder = sorder;
- nobj->surface.color.torder = torder;
- nobj->surface.color.type = type;
- break;
- case GL_MAP2_NORMAL:
- nobj->surface.normal.sknot_count = sknot_count;
- nobj->surface.normal.sknot = sknot;
- nobj->surface.normal.tknot_count = tknot_count;
- nobj->surface.normal.tknot = tknot;
- nobj->surface.normal.s_stride = s_stride;
- nobj->surface.normal.t_stride = t_stride;
- nobj->surface.normal.ctrlarray = ctrlarray;
- nobj->surface.normal.sorder = sorder;
- nobj->surface.normal.torder = torder;
- nobj->surface.normal.type = type;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- case GL_MAP2_TEXTURE_COORD_2:
- case GL_MAP2_TEXTURE_COORD_3:
- case GL_MAP2_TEXTURE_COORD_4:
- nobj->surface.texture.sknot_count = sknot_count;
- nobj->surface.texture.sknot = sknot;
- nobj->surface.texture.tknot_count = tknot_count;
- nobj->surface.texture.tknot = tknot;
- nobj->surface.texture.s_stride = s_stride;
- nobj->surface.texture.t_stride = t_stride;
- nobj->surface.texture.ctrlarray = ctrlarray;
- nobj->surface.texture.sorder = sorder;
- nobj->surface.texture.torder = torder;
- nobj->surface.texture.type = type;
- break;
- default:
- call_user_error(nobj, GLU_INVALID_ENUM);
- }
-}
-
-
-void GLAPIENTRY
-gluNurbsCallback(GLUnurbsObj * nobj, GLenum which, void (GLCALLBACK * fn) ())
-{
- nobj->error_callback = (void (GLCALLBACKPCAST) (GLenum)) fn;
-
- if (which != GLU_ERROR)
- call_user_error(nobj, GLU_INVALID_ENUM);
-}
-
-void GLAPIENTRY
-gluBeginTrim(GLUnurbsObj * nobj)
-{
-#if 0
- nurbs_trim *ptr;
-#endif
-
- if (nobj->nurbs_type != GLU_NURBS_TRIM_DONE)
- if (nobj->nurbs_type != GLU_NURBS_NO_TRIM) {
- call_user_error(nobj, GLU_NURBS_ERROR15);
- return;
- }
- nobj->nurbs_type = GLU_NURBS_TRIM;
- fprintf(stderr, "NURBS - trimming not supported yet\n");
-#if 0
- if ((ptr = (nurbs_trim *) malloc(sizeof(nurbs_trim))) == NULL) {
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return;
- }
- if (nobj->trim) {
- nurbs_trim *tmp_ptr;
-
- for (tmp_ptr = nobj->trim; tmp_ptr->next; tmp_ptr = tmp_ptr->next);
- tmp_ptr->next = ptr;
- }
- else
- nobj->trim = ptr;
- ptr->trim_loop = NULL;
- ptr->segments = NULL;
- ptr->next = NULL;
-#endif
-}
-
-void GLAPIENTRY
-gluPwlCurve(GLUnurbsObj * nobj, GLint count, GLfloat * array, GLint stride,
- GLenum type)
-{
-#if 0
- nurbs_trim *ptr1;
- trim_list *ptr2;
-#endif
- if (nobj->nurbs_type == GLU_NURBS_CURVE) {
- call_user_error(nobj, GLU_NURBS_ERROR9);
- return;
- }
- if (nobj->nurbs_type == GLU_NURBS_NONE) {
- call_user_error(nobj, GLU_NURBS_ERROR19);
- return;
- }
- if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) {
- call_user_error(nobj, GLU_NURBS_ERROR14);
- return;
- }
-#if 0
- for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next);
- if (ptr1->trim_loop) {
- for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next);
- if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) {
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return;
- }
- ptr2 = ptr2->next;
- }
- else {
- if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) {
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return;
- }
- ptr1->trim_loop = ptr2;
- }
- ptr2->trim_type = GLU_TRIM_PWL;
- ptr2->curve.pwl_curve.pt_count = count;
- ptr2->curve.pwl_curve.ctrlarray = array;
- ptr2->curve.pwl_curve.stride = stride;
- ptr2->curve.pwl_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3);
- ptr2->curve.pwl_curve.type = type;
- ptr2->next = NULL;
-#endif
-}
-
-void GLAPIENTRY
-gluEndTrim(GLUnurbsObj * nobj)
-{
- if (nobj->nurbs_type != GLU_NURBS_TRIM) {
- call_user_error(nobj, GLU_NURBS_ERROR17);
- return;
- }
- nobj->nurbs_type = GLU_NURBS_TRIM_DONE;
-}
diff --git a/src/glu/mesa/nurbs.h b/src/glu/mesa/nurbs.h
deleted file mode 100644
index 3642e213a8c..00000000000
--- a/src/glu/mesa/nurbs.h
+++ /dev/null
@@ -1,252 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifndef NURBS_H
-#define NURBS_H
-
-
-#define EPSILON 1e-06 /* epsilon for double precision compares */
-
-typedef enum
-{
- GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM,
- GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE
-}
-GLU_nurbs_enum;
-
-typedef enum
-{
- GLU_TRIM_NURBS, GLU_TRIM_PWL
-}
-GLU_trim_enum;
-
-typedef struct
-{
- GLint sknot_count;
- GLfloat *sknot;
- GLint tknot_count;
- GLfloat *tknot;
- GLint s_stride;
- GLint t_stride;
- GLfloat *ctrlarray;
- GLint sorder;
- GLint torder;
- GLint dim;
- GLenum type;
-}
-surface_attribs;
-
-typedef struct
-{
- surface_attribs geom;
- surface_attribs color;
- surface_attribs texture;
- surface_attribs normal;
-}
-nurbs_surface;
-
-typedef struct
-{
- GLint knot_count;
- GLfloat *knot;
- GLint stride;
- GLfloat *ctrlarray;
- GLint order;
- GLint dim;
- GLenum type;
-}
-curve_attribs;
-
-typedef struct
-{
- GLint pt_count;
- GLfloat *ctrlarray;
- GLint stride;
- GLint dim;
- GLenum type;
-}
-pwl_curve_attribs;
-
-typedef struct
-{
- curve_attribs geom;
- curve_attribs color;
- curve_attribs texture;
- curve_attribs normal;
-}
-nurbs_curve;
-
-typedef struct trim_list_str
-{
- GLU_trim_enum trim_type;
- union
- {
- pwl_curve_attribs pwl_curve;
- curve_attribs nurbs_curve;
- }
- curve;
- struct trim_list_str *next;
-}
-trim_list;
-
-typedef struct seg_trim_str
-{
- GLfloat *points;
- GLint pt_cnt, seg_array_len;
- struct seg_trim_str *next;
-}
-trim_segments;
-
-typedef struct nurbs_trim_str
-{
- trim_list *trim_loop;
- trim_segments *segments;
- struct nurbs_trim_str *next;
-}
-nurbs_trim;
-
-typedef struct
-{
- GLfloat model[16], proj[16], viewport[4];
-}
-culling_and_sampling_str;
-
-struct GLUnurbs
-{
- GLboolean culling;
- GLenum error;
- void (GLCALLBACK * error_callback) (GLenum err);
- GLenum display_mode;
- GLU_nurbs_enum nurbs_type;
- GLboolean auto_load_matrix;
- culling_and_sampling_str sampling_matrices;
- GLenum sampling_method;
- GLfloat sampling_tolerance;
- GLfloat parametric_tolerance;
- GLint u_step, v_step;
- nurbs_surface surface;
- nurbs_curve curve;
- nurbs_trim *trim;
-};
-
-typedef struct
-{
- GLfloat *knot;
- GLint nknots;
- GLfloat *unified_knot;
- GLint unified_nknots;
- GLint order;
- GLint t_min, t_max;
- GLint delta_nknots;
- GLboolean open_at_begin, open_at_end;
- GLfloat *new_knot;
- GLfloat *alpha;
-}
-knot_str_type;
-
-typedef struct
-{
- GLfloat *geom_ctrl;
- GLint geom_s_stride, geom_t_stride;
- GLfloat **geom_offsets;
- GLint geom_s_pt_cnt, geom_t_pt_cnt;
- GLfloat *color_ctrl;
- GLint color_s_stride, color_t_stride;
- GLfloat **color_offsets;
- GLint color_s_pt_cnt, color_t_pt_cnt;
- GLfloat *normal_ctrl;
- GLint normal_s_stride, normal_t_stride;
- GLfloat **normal_offsets;
- GLint normal_s_pt_cnt, normal_t_pt_cnt;
- GLfloat *texture_ctrl;
- GLint texture_s_stride, texture_t_stride;
- GLfloat **texture_offsets;
- GLint texture_s_pt_cnt, texture_t_pt_cnt;
- GLint s_bezier_cnt, t_bezier_cnt;
-}
-new_ctrl_type;
-
-extern void call_user_error(GLUnurbsObj * nobj, GLenum error);
-
-extern GLenum test_knot(GLint nknots, GLfloat * knot, GLint order);
-
-extern GLenum explode_knot(knot_str_type * the_knot);
-
-extern GLenum calc_alphas(knot_str_type * the_knot);
-
-extern GLenum calc_new_ctrl_pts(GLfloat * ctrl, GLint stride,
- knot_str_type * the_knot, GLint dim,
- GLfloat ** new_ctrl, GLint * ncontrol);
-
-extern GLenum glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * new_ctrl,
- GLint n_ctrl, GLint order, GLint dim,
- GLint ** factors);
-
-extern GLenum glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- int **sfactors, GLint ** tfactors);
-
-extern GLenum glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- int **sfactors, GLint ** tfactors);
-
-extern GLenum glu_do_sampling_param_3D(GLUnurbsObj * nobj,
- new_ctrl_type * new_ctrl,
- int **sfactors, GLint ** tfactors);
-
-extern GLboolean fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * ctrl,
- GLint n_ctrl, GLint stride, GLint dim);
-
-extern GLboolean fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * ctrl,
- GLint s_n_ctrl, GLint t_n_ctrl,
- GLint s_stride, GLint t_stride,
- GLint dim);
-
-extern void do_nurbs_curve(GLUnurbsObj * nobj);
-
-extern void do_nurbs_surface(GLUnurbsObj * nobj);
-
-extern GLenum patch_trimming(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- GLint * sfactors, GLint * tfactors);
-
-extern void collect_unified_knot(knot_str_type * dest, knot_str_type * src,
- GLfloat maximal_min_knot,
- GLfloat minimal_max_knot);
-
-extern GLenum select_knot_working_range(GLUnurbsObj * nobj,
- knot_str_type * geom_knot,
- knot_str_type * color_knot,
- knot_str_type * normal_knot,
- knot_str_type * texture_knot);
-
-extern void free_unified_knots(knot_str_type * geom_knot,
- knot_str_type * color_knot,
- knot_str_type * normal_knot,
- knot_str_type * texture_knot);
-
-
-
-#endif
diff --git a/src/glu/mesa/nurbscrv.c b/src/glu/mesa/nurbscrv.c
deleted file mode 100644
index 4483e1f7761..00000000000
--- a/src/glu/mesa/nurbscrv.c
+++ /dev/null
@@ -1,444 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include "gluP.h"
-#include "nurbs.h"
-#endif
-
-
-static int
-get_curve_dim(GLenum type)
-{
- switch (type) {
- case GL_MAP1_VERTEX_3:
- return 3;
- case GL_MAP1_VERTEX_4:
- return 4;
- case GL_MAP1_INDEX:
- return 1;
- case GL_MAP1_COLOR_4:
- return 4;
- case GL_MAP1_NORMAL:
- return 3;
- case GL_MAP1_TEXTURE_COORD_1:
- return 1;
- case GL_MAP1_TEXTURE_COORD_2:
- return 2;
- case GL_MAP1_TEXTURE_COORD_3:
- return 3;
- case GL_MAP1_TEXTURE_COORD_4:
- return 4;
- default:
- abort(); /* TODO: is this OK? */
- }
- return 0; /*never get here */
-}
-
-static GLenum
-test_nurbs_curve(GLUnurbsObj * nobj, curve_attribs * attribs)
-{
- GLenum err;
- GLint tmp_int;
-
- if (attribs->order < 0) {
- call_user_error(nobj, GLU_INVALID_VALUE);
- return GLU_ERROR;
- }
- glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int);
- if (attribs->order > tmp_int || attribs->order < 2) {
- call_user_error(nobj, GLU_NURBS_ERROR1);
- return GLU_ERROR;
- }
- if (attribs->knot_count < attribs->order + 2) {
- call_user_error(nobj, GLU_NURBS_ERROR2);
- return GLU_ERROR;
- }
- if (attribs->stride < 0) {
- call_user_error(nobj, GLU_NURBS_ERROR34);
- return GLU_ERROR;
- }
- if (attribs->knot == NULL || attribs->ctrlarray == NULL) {
- call_user_error(nobj, GLU_NURBS_ERROR36);
- return GLU_ERROR;
- }
- if ((err = test_knot(attribs->knot_count, attribs->knot, attribs->order))
- != GLU_NO_ERROR) {
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- return GLU_NO_ERROR;
-}
-
-static GLenum
-test_nurbs_curves(GLUnurbsObj * nobj)
-{
- /* test the geometric data */
- if (test_nurbs_curve(nobj, &(nobj->curve.geom)) != GLU_NO_ERROR)
- return GLU_ERROR;
- /* now test the attributive data */
- /* color */
- if (nobj->curve.color.type != GLU_INVALID_ENUM)
- if (test_nurbs_curve(nobj, &(nobj->curve.color)) != GLU_NO_ERROR)
- return GLU_ERROR;
- /* normal */
- if (nobj->curve.normal.type != GLU_INVALID_ENUM)
- if (test_nurbs_curve(nobj, &(nobj->curve.normal)) != GLU_NO_ERROR)
- return GLU_ERROR;
- /* texture */
- if (nobj->curve.texture.type != GLU_INVALID_ENUM)
- if (test_nurbs_curve(nobj, &(nobj->curve.texture)) != GLU_NO_ERROR)
- return GLU_ERROR;
- return GLU_NO_ERROR;
-}
-
-/* prepare the knot information structures */
-static GLenum
-fill_knot_structures(GLUnurbsObj * nobj, knot_str_type * geom_knot,
- knot_str_type * color_knot, knot_str_type * normal_knot,
- knot_str_type * texture_knot)
-{
- GLint order;
- GLfloat *knot;
- GLint nknots;
- GLint t_min, t_max;
-
- geom_knot->unified_knot = NULL;
- knot = geom_knot->knot = nobj->curve.geom.knot;
- nknots = geom_knot->nknots = nobj->curve.geom.knot_count;
- order = geom_knot->order = nobj->curve.geom.order;
- geom_knot->delta_nknots = 0;
- t_min = geom_knot->t_min = order - 1;
- t_max = geom_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- geom_knot->open_at_begin = GL_TRUE;
- }
- else
- geom_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- geom_knot->open_at_end = GL_TRUE;
- }
- else
- geom_knot->open_at_end = GL_FALSE;
- if (nobj->curve.color.type != GLU_INVALID_ENUM) {
- color_knot->unified_knot = (GLfloat *) 1;
- knot = color_knot->knot = nobj->curve.color.knot;
- nknots = color_knot->nknots = nobj->curve.color.knot_count;
- order = color_knot->order = nobj->curve.color.order;
- color_knot->delta_nknots = 0;
- t_min = color_knot->t_min = order - 1;
- t_max = color_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- color_knot->open_at_begin = GL_TRUE;
- }
- else
- color_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- color_knot->open_at_end = GL_TRUE;
- }
- else
- color_knot->open_at_end = GL_FALSE;
- }
- else
- color_knot->unified_knot = NULL;
- if (nobj->curve.normal.type != GLU_INVALID_ENUM) {
- normal_knot->unified_knot = (GLfloat *) 1;
- knot = normal_knot->knot = nobj->curve.normal.knot;
- nknots = normal_knot->nknots = nobj->curve.normal.knot_count;
- order = normal_knot->order = nobj->curve.normal.order;
- normal_knot->delta_nknots = 0;
- t_min = normal_knot->t_min = order - 1;
- t_max = normal_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- normal_knot->open_at_begin = GL_TRUE;
- }
- else
- normal_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- normal_knot->open_at_end = GL_TRUE;
- }
- else
- normal_knot->open_at_end = GL_FALSE;
- }
- else
- normal_knot->unified_knot = NULL;
- if (nobj->curve.texture.type != GLU_INVALID_ENUM) {
- texture_knot->unified_knot = (GLfloat *) 1;
- knot = texture_knot->knot = nobj->curve.texture.knot;
- nknots = texture_knot->nknots = nobj->curve.texture.knot_count;
- order = texture_knot->order = nobj->curve.texture.order;
- texture_knot->delta_nknots = 0;
- t_min = texture_knot->t_min = order - 1;
- t_max = texture_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- texture_knot->open_at_begin = GL_TRUE;
- }
- else
- texture_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- texture_knot->open_at_end = GL_TRUE;
- }
- else
- texture_knot->open_at_end = GL_FALSE;
- }
- else
- texture_knot->unified_knot = NULL;
- return GLU_NO_ERROR;
-}
-
-/* covert the NURBS curve into a series of adjacent Bezier curves */
-static GLenum
-convert_curve(knot_str_type * the_knot, curve_attribs * attrib,
- GLfloat ** new_ctrl, GLint * ncontrol)
-{
- GLenum err;
-
- if ((err = explode_knot(the_knot)) != GLU_NO_ERROR) {
- if (the_knot->unified_knot) {
- free(the_knot->unified_knot);
- the_knot->unified_knot = NULL;
- }
- return err;
- }
- if (the_knot->unified_knot) {
- free(the_knot->unified_knot);
- the_knot->unified_knot = NULL;
- }
- if ((err = calc_alphas(the_knot)) != GLU_NO_ERROR) {
- free(the_knot->new_knot);
- return err;
- }
- free(the_knot->new_knot);
- if ((err = calc_new_ctrl_pts(attrib->ctrlarray, attrib->stride, the_knot,
- attrib->dim, new_ctrl, ncontrol))
- != GLU_NO_ERROR) {
- free(the_knot->alpha);
- return err;
- }
- free(the_knot->alpha);
- return GLU_NO_ERROR;
-}
-
-/* covert curves - geometry and possible attribute ones into equivalent */
-/* sequence of adjacent Bezier curves */
-static GLenum
-convert_curves(GLUnurbsObj * nobj, GLfloat ** new_geom_ctrl,
- GLint * ncontrol, GLfloat ** new_color_ctrl,
- GLfloat ** new_normal_ctrl, GLfloat ** new_texture_ctrl)
-{
- knot_str_type geom_knot, color_knot, normal_knot, texture_knot;
- GLint junk;
- GLenum err;
-
- *new_color_ctrl = *new_normal_ctrl = *new_texture_ctrl = NULL;
-
- if (fill_knot_structures(nobj, &geom_knot, &color_knot, &normal_knot,
- &texture_knot) != GLU_NO_ERROR)
- return GLU_ERROR;
-
- /* unify knots - all knots should have the same number of working */
- /* ranges */
- if (
- (err =
- select_knot_working_range(nobj, &geom_knot, &color_knot, &normal_knot,
- &texture_knot)) != GLU_NO_ERROR) {
- return err;
- }
- /* convert the geometry curve */
- nobj->curve.geom.dim = get_curve_dim(nobj->curve.geom.type);
- if ((err = convert_curve(&geom_knot, &(nobj->curve.geom), new_geom_ctrl,
- ncontrol)) != GLU_NO_ERROR) {
- free_unified_knots(&geom_knot, &color_knot, &normal_knot,
- &texture_knot);
- call_user_error(nobj, err);
- return err;
- }
- /* if additional attributive curves are given convert them as well */
- if (color_knot.unified_knot) {
- nobj->curve.color.dim = get_curve_dim(nobj->curve.color.type);
- if ((err = convert_curve(&color_knot, &(nobj->curve.color),
- new_color_ctrl, &junk)) != GLU_NO_ERROR) {
- free_unified_knots(&geom_knot, &color_knot, &normal_knot,
- &texture_knot);
- free(*new_geom_ctrl);
- call_user_error(nobj, err);
- return err;
- }
- }
- if (normal_knot.unified_knot) {
- nobj->curve.normal.dim = get_curve_dim(nobj->curve.normal.type);
- if ((err = convert_curve(&normal_knot, &(nobj->curve.normal),
- new_normal_ctrl, &junk)) != GLU_NO_ERROR) {
- free_unified_knots(&geom_knot, &color_knot, &normal_knot,
- &texture_knot);
- free(*new_geom_ctrl);
- if (*new_color_ctrl)
- free(*new_color_ctrl);
- call_user_error(nobj, err);
- return err;
- }
- }
- if (texture_knot.unified_knot) {
- nobj->curve.texture.dim = get_curve_dim(nobj->curve.texture.type);
- if ((err = convert_curve(&texture_knot, &(nobj->curve.texture),
- new_texture_ctrl, &junk)) != GLU_NO_ERROR) {
- free_unified_knots(&geom_knot, &color_knot, &normal_knot,
- &texture_knot);
- free(*new_geom_ctrl);
- if (*new_color_ctrl)
- free(*new_color_ctrl);
- if (*new_normal_ctrl)
- free(*new_normal_ctrl);
- call_user_error(nobj, err);
- return err;
- }
- }
- return GLU_NO_ERROR;
-}
-
-/* main NURBS curve procedure */
-void
-do_nurbs_curve(GLUnurbsObj * nobj)
-{
- GLint geom_order, color_order = 0, normal_order = 0, texture_order = 0;
- GLenum geom_type;
- GLint n_ctrl;
- GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl,
- *new_texture_ctrl;
- GLfloat *geom_ctrl = 0, *color_ctrl = 0, *normal_ctrl = 0, *texture_ctrl = 0;
- GLint *factors;
- GLint i, j;
- GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0;
-
- /* test the user supplied data */
- if (test_nurbs_curves(nobj) != GLU_NO_ERROR)
- return;
-
- if (convert_curves(nobj, &new_geom_ctrl, &n_ctrl, &new_color_ctrl,
- &new_normal_ctrl, &new_texture_ctrl) != GLU_NO_ERROR)
- return;
-
- geom_order = nobj->curve.geom.order;
- geom_type = nobj->curve.geom.type;
- geom_dim = nobj->curve.geom.dim;
-
- if (glu_do_sampling_crv(nobj, new_geom_ctrl, n_ctrl, geom_order, geom_dim,
- &factors) != GLU_NO_ERROR) {
- free(new_geom_ctrl);
- if (new_color_ctrl)
- free(new_color_ctrl);
- if (new_normal_ctrl)
- free(new_normal_ctrl);
- if (new_texture_ctrl)
- free(new_texture_ctrl);
- return;
- }
- glEnable(geom_type);
- if (new_color_ctrl) {
- glEnable(nobj->curve.color.type);
- color_dim = nobj->curve.color.dim;
- color_ctrl = new_color_ctrl;
- color_order = nobj->curve.color.order;
- }
- if (new_normal_ctrl) {
- glEnable(nobj->curve.normal.type);
- normal_dim = nobj->curve.normal.dim;
- normal_ctrl = new_normal_ctrl;
- normal_order = nobj->curve.normal.order;
- }
- if (new_texture_ctrl) {
- glEnable(nobj->curve.texture.type);
- texture_dim = nobj->curve.texture.dim;
- texture_ctrl = new_texture_ctrl;
- texture_order = nobj->curve.texture.order;
- }
- for (i = 0, j = 0, geom_ctrl = new_geom_ctrl;
- i < n_ctrl; i += geom_order, j++, geom_ctrl += geom_order * geom_dim) {
- if (fine_culling_test_2D
- (nobj, geom_ctrl, geom_order, geom_dim, geom_dim)) {
- color_ctrl += color_order * color_dim;
- normal_ctrl += normal_order * normal_dim;
- texture_ctrl += texture_order * texture_dim;
- continue;
- }
- glMap1f(geom_type, 0.0, 1.0, geom_dim, geom_order, geom_ctrl);
- if (new_color_ctrl) {
- glMap1f(nobj->curve.color.type, 0.0, 1.0, color_dim,
- color_order, color_ctrl);
- color_ctrl += color_order * color_dim;
- }
- if (new_normal_ctrl) {
- glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim,
- normal_order, normal_ctrl);
- normal_ctrl += normal_order * normal_dim;
- }
- if (new_texture_ctrl) {
- glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim,
- texture_order, texture_ctrl);
- texture_ctrl += texture_order * texture_dim;
- }
- glMapGrid1f(factors[j], 0.0, 1.0);
- glEvalMesh1(GL_LINE, 0, factors[j]);
- }
- free(new_geom_ctrl);
- free(factors);
- if (new_color_ctrl)
- free(new_color_ctrl);
- if (new_normal_ctrl)
- free(new_normal_ctrl);
- if (new_texture_ctrl)
- free(new_texture_ctrl);
-}
diff --git a/src/glu/mesa/nurbssrf.c b/src/glu/mesa/nurbssrf.c
deleted file mode 100644
index d39fa47d18a..00000000000
--- a/src/glu/mesa/nurbssrf.c
+++ /dev/null
@@ -1,1317 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include "gluP.h"
-#include "nurbs.h"
-#endif
-
-
-static int
-get_surface_dim(GLenum type)
-{
- switch (type) {
- case GL_MAP2_VERTEX_3:
- return 3;
- case GL_MAP2_VERTEX_4:
- return 4;
- case GL_MAP2_INDEX:
- return 1;
- case GL_MAP2_COLOR_4:
- return 4;
- case GL_MAP2_NORMAL:
- return 3;
- case GL_MAP2_TEXTURE_COORD_1:
- return 1;
- case GL_MAP2_TEXTURE_COORD_2:
- return 2;
- case GL_MAP2_TEXTURE_COORD_3:
- return 3;
- case GL_MAP2_TEXTURE_COORD_4:
- return 4;
- default:
- abort(); /* TODO: is this OK? */
- }
- return 0; /*never get here */
-}
-
-static GLenum
-test_nurbs_surface(GLUnurbsObj * nobj, surface_attribs * attrib)
-{
- GLenum err;
- GLint tmp_int;
-
- if (attrib->sorder < 0 || attrib->torder < 0) {
- call_user_error(nobj, GLU_INVALID_VALUE);
- return GLU_ERROR;
- }
- glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int);
- if (attrib->sorder > tmp_int || attrib->sorder < 2) {
- call_user_error(nobj, GLU_NURBS_ERROR1);
- return GLU_ERROR;
- }
- if (attrib->torder > tmp_int || attrib->torder < 2) {
- call_user_error(nobj, GLU_NURBS_ERROR1);
- return GLU_ERROR;
- }
- if (attrib->sknot_count < attrib->sorder + 2) {
- call_user_error(nobj, GLU_NURBS_ERROR2);
- return GLU_ERROR;
- }
- if (attrib->tknot_count < attrib->torder + 2) {
- call_user_error(nobj, GLU_NURBS_ERROR2);
- return GLU_ERROR;
- }
- if (attrib->s_stride < 0 || attrib->t_stride < 0) {
- call_user_error(nobj, GLU_NURBS_ERROR34);
- return GLU_ERROR;
- }
- if (attrib->sknot == NULL || attrib->tknot == NULL
- || attrib->ctrlarray == NULL) {
- call_user_error(nobj, GLU_NURBS_ERROR36);
- return GLU_ERROR;
- }
- if ((err = test_knot(attrib->tknot_count, attrib->tknot, attrib->torder))
- != GLU_NO_ERROR) {
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- if ((err = test_knot(attrib->sknot_count, attrib->sknot, attrib->sorder))
- != GLU_NO_ERROR) {
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- return GLU_NO_ERROR;
-}
-
-static GLenum
-test_nurbs_surfaces(GLUnurbsObj * nobj)
-{
- /* test the geometric data */
- if (test_nurbs_surface(nobj, &(nobj->surface.geom)) != GLU_NO_ERROR)
- return GLU_ERROR;
- /* now test the attributive data */
- /* color */
- if (nobj->surface.color.type != GLU_INVALID_ENUM)
- if (test_nurbs_surface(nobj, &(nobj->surface.color)) != GLU_NO_ERROR)
- return GLU_ERROR;
- /* normal */
- if (nobj->surface.normal.type != GLU_INVALID_ENUM)
- if (test_nurbs_surface(nobj, &(nobj->surface.normal)) != GLU_NO_ERROR)
- return GLU_ERROR;
- /* texture */
- if (nobj->surface.texture.type != GLU_INVALID_ENUM)
- if (test_nurbs_surface(nobj, &(nobj->surface.texture)) != GLU_NO_ERROR)
- return GLU_ERROR;
- return GLU_NO_ERROR;
-}
-
-static GLenum
-convert_surf(knot_str_type * s_knot, knot_str_type * t_knot,
- surface_attribs * attrib, GLfloat ** new_ctrl,
- GLint * s_n_ctrl, GLint * t_n_ctrl)
-{
- GLfloat **tmp_ctrl;
- GLfloat *ctrl_offset;
- GLint tmp_n_control;
- GLint i, j, t_cnt, s_cnt;
- GLint tmp_stride;
- GLint dim;
- GLenum err;
-
- /* valid range is empty? */
- if ((s_knot->unified_knot != NULL && s_knot->unified_nknots == 0) ||
- (t_knot->unified_knot != NULL && t_knot->unified_nknots == 0)) {
- if (s_knot->unified_knot) {
- free(s_knot->unified_knot);
- s_knot->unified_knot = NULL;
- }
- if (t_knot->unified_knot) {
- free(t_knot->unified_knot);
- t_knot->unified_knot = NULL;
- }
- *s_n_ctrl = 0;
- *t_n_ctrl = 0;
- return GLU_NO_ERROR;
- }
- t_cnt = attrib->tknot_count - attrib->torder;
- s_cnt = attrib->sknot_count - attrib->sorder;
- if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * t_cnt)) == NULL)
- return GLU_OUT_OF_MEMORY;
- if ((err = explode_knot(s_knot)) != GLU_NO_ERROR) {
- free(tmp_ctrl);
- if (s_knot->unified_knot) {
- free(s_knot->unified_knot);
- s_knot->unified_knot = NULL;
- }
- return err;
- }
- if (s_knot->unified_knot) {
- free(s_knot->unified_knot);
- s_knot->unified_knot = NULL;
- }
- if ((err = calc_alphas(s_knot)) != GLU_NO_ERROR) {
- free(tmp_ctrl);
- free(s_knot->new_knot);
- return err;
- }
- free(s_knot->new_knot);
- ctrl_offset = attrib->ctrlarray;
- dim = attrib->dim;
- for (i = 0; i < t_cnt; i++) {
- if ((err = calc_new_ctrl_pts(ctrl_offset, attrib->s_stride, s_knot,
- dim, &(tmp_ctrl[i]),
- &tmp_n_control)) != GLU_NO_ERROR) {
- for (--i; i <= 0; i--)
- free(tmp_ctrl[i]);
- free(tmp_ctrl);
- free(s_knot->alpha);
- return err;
- }
- ctrl_offset += attrib->t_stride;
- }
- free(s_knot->alpha);
- tmp_stride = dim * tmp_n_control;
- if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * t_cnt))
- == NULL) {
- for (i = 0; i < t_cnt; i++)
- free(tmp_ctrl[i]);
- free(tmp_ctrl);
- return GLU_OUT_OF_MEMORY;
- }
- for (i = 0; i < tmp_n_control; i++)
- for (j = 0; j < t_cnt; j++)
- MEMCPY(*new_ctrl + j * dim + i * dim * t_cnt, tmp_ctrl[j] + dim * i,
- sizeof(GLfloat) * dim);
- for (i = 0; i < t_cnt; i++)
- free(tmp_ctrl[i]);
- free(tmp_ctrl);
- *s_n_ctrl = tmp_n_control;
-
- if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * (*s_n_ctrl))) ==
- NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- if ((err = explode_knot(t_knot)) != GLU_NO_ERROR) {
- free(tmp_ctrl);
- if (t_knot->unified_knot) {
- free(t_knot->unified_knot);
- t_knot->unified_knot = NULL;
- }
- return err;
- }
- if (t_knot->unified_knot) {
- free(t_knot->unified_knot);
- t_knot->unified_knot = NULL;
- }
- if ((err = calc_alphas(t_knot)) != GLU_NO_ERROR) {
- free(tmp_ctrl);
- free(t_knot->new_knot);
- return err;
- }
- free(t_knot->new_knot);
- ctrl_offset = *new_ctrl;
- for (i = 0; i < (*s_n_ctrl); i++) {
- if ((err = calc_new_ctrl_pts(ctrl_offset, dim, t_knot,
- dim, &(tmp_ctrl[i]),
- &tmp_n_control)) != GLU_NO_ERROR) {
- for (--i; i <= 0; i--)
- free(tmp_ctrl[i]);
- free(tmp_ctrl);
- free(t_knot->alpha);
- return err;
- }
- ctrl_offset += dim * t_cnt;
- }
- free(t_knot->alpha);
- free(*new_ctrl);
- tmp_stride = dim * tmp_n_control;
- if (
- (*new_ctrl =
- (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * (*s_n_ctrl))) ==
- NULL) {
- for (i = 0; i < (*s_n_ctrl); i++)
- free(tmp_ctrl[i]);
- free(tmp_ctrl);
- return GLU_OUT_OF_MEMORY;
- }
- for (i = 0; i < (*s_n_ctrl); i++) {
- MEMCPY(*new_ctrl + i * tmp_stride, tmp_ctrl[i],
- sizeof(GLfloat) * tmp_stride);
- free(tmp_ctrl[i]);
- }
- free(tmp_ctrl);
- *t_n_ctrl = tmp_n_control;
- return GLU_NO_ERROR;
-}
-
-/* prepare the knot information structures */
-static GLenum
-fill_knot_structures(GLUnurbsObj * nobj,
- knot_str_type * geom_s_knot, knot_str_type * geom_t_knot,
- knot_str_type * color_s_knot,
- knot_str_type * color_t_knot,
- knot_str_type * normal_s_knot,
- knot_str_type * normal_t_knot,
- knot_str_type * texture_s_knot,
- knot_str_type * texture_t_knot)
-{
- GLint order;
- GLfloat *knot;
- GLint nknots;
- GLint t_min, t_max;
-
- geom_s_knot->unified_knot = NULL;
- knot = geom_s_knot->knot = nobj->surface.geom.sknot;
- nknots = geom_s_knot->nknots = nobj->surface.geom.sknot_count;
- order = geom_s_knot->order = nobj->surface.geom.sorder;
- geom_s_knot->delta_nknots = 0;
- t_min = geom_s_knot->t_min = order - 1;
- t_max = geom_s_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- geom_s_knot->open_at_begin = GL_TRUE;
- }
- else
- geom_s_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- geom_s_knot->open_at_end = GL_TRUE;
- }
- else
- geom_s_knot->open_at_end = GL_FALSE;
- geom_t_knot->unified_knot = NULL;
- knot = geom_t_knot->knot = nobj->surface.geom.tknot;
- nknots = geom_t_knot->nknots = nobj->surface.geom.tknot_count;
- order = geom_t_knot->order = nobj->surface.geom.torder;
- geom_t_knot->delta_nknots = 0;
- t_min = geom_t_knot->t_min = order - 1;
- t_max = geom_t_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- geom_t_knot->open_at_begin = GL_TRUE;
- }
- else
- geom_t_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- geom_t_knot->open_at_end = GL_TRUE;
- }
- else
- geom_t_knot->open_at_end = GL_FALSE;
-
- if (nobj->surface.color.type != GLU_INVALID_ENUM) {
- color_s_knot->unified_knot = (GLfloat *) 1;
- knot = color_s_knot->knot = nobj->surface.color.sknot;
- nknots = color_s_knot->nknots = nobj->surface.color.sknot_count;
- order = color_s_knot->order = nobj->surface.color.sorder;
- color_s_knot->delta_nknots = 0;
- t_min = color_s_knot->t_min = order - 1;
- t_max = color_s_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- color_s_knot->open_at_begin = GL_TRUE;
- }
- else
- color_s_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- color_s_knot->open_at_end = GL_TRUE;
- }
- else
- color_s_knot->open_at_end = GL_FALSE;
- color_t_knot->unified_knot = (GLfloat *) 1;
- knot = color_t_knot->knot = nobj->surface.color.tknot;
- nknots = color_t_knot->nknots = nobj->surface.color.tknot_count;
- order = color_t_knot->order = nobj->surface.color.torder;
- color_t_knot->delta_nknots = 0;
- t_min = color_t_knot->t_min = order - 1;
- t_max = color_t_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- color_t_knot->open_at_begin = GL_TRUE;
- }
- else
- color_t_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- color_t_knot->open_at_end = GL_TRUE;
- }
- else
- color_t_knot->open_at_end = GL_FALSE;
- }
- else {
- color_s_knot->unified_knot = NULL;
- color_t_knot->unified_knot = NULL;
- }
-
- if (nobj->surface.normal.type != GLU_INVALID_ENUM) {
- normal_s_knot->unified_knot = (GLfloat *) 1;
- knot = normal_s_knot->knot = nobj->surface.normal.sknot;
- nknots = normal_s_knot->nknots = nobj->surface.normal.sknot_count;
- order = normal_s_knot->order = nobj->surface.normal.sorder;
- normal_s_knot->delta_nknots = 0;
- t_min = normal_s_knot->t_min = order - 1;
- t_max = normal_s_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- normal_s_knot->open_at_begin = GL_TRUE;
- }
- else
- normal_s_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- normal_s_knot->open_at_end = GL_TRUE;
- }
- else
- normal_s_knot->open_at_end = GL_FALSE;
- normal_t_knot->unified_knot = (GLfloat *) 1;
- knot = normal_t_knot->knot = nobj->surface.normal.tknot;
- nknots = normal_t_knot->nknots = nobj->surface.normal.tknot_count;
- order = normal_t_knot->order = nobj->surface.normal.torder;
- normal_t_knot->delta_nknots = 0;
- t_min = normal_t_knot->t_min = order - 1;
- t_max = normal_t_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- normal_t_knot->open_at_begin = GL_TRUE;
- }
- else
- normal_t_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- normal_t_knot->open_at_end = GL_TRUE;
- }
- else
- normal_t_knot->open_at_end = GL_FALSE;
- }
- else {
- normal_s_knot->unified_knot = NULL;
- normal_t_knot->unified_knot = NULL;
- }
-
- if (nobj->surface.texture.type != GLU_INVALID_ENUM) {
- texture_s_knot->unified_knot = (GLfloat *) 1;
- knot = texture_s_knot->knot = nobj->surface.texture.sknot;
- nknots = texture_s_knot->nknots = nobj->surface.texture.sknot_count;
- order = texture_s_knot->order = nobj->surface.texture.sorder;
- texture_s_knot->delta_nknots = 0;
- t_min = texture_s_knot->t_min = order - 1;
- t_max = texture_s_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- texture_s_knot->open_at_begin = GL_TRUE;
- }
- else
- texture_s_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- texture_s_knot->open_at_end = GL_TRUE;
- }
- else
- texture_s_knot->open_at_end = GL_FALSE;
- texture_t_knot->unified_knot = (GLfloat *) 1;
- knot = texture_t_knot->knot = nobj->surface.texture.tknot;
- nknots = texture_t_knot->nknots = nobj->surface.texture.tknot_count;
- order = texture_t_knot->order = nobj->surface.texture.torder;
- texture_t_knot->delta_nknots = 0;
- t_min = texture_t_knot->t_min = order - 1;
- t_max = texture_t_knot->t_max = nknots - order;
- if (fabs(knot[t_min] - knot[t_max]) < EPSILON) {
- call_user_error(nobj, GLU_NURBS_ERROR3);
- return GLU_ERROR;
- }
- if (fabs(knot[0] - knot[t_min]) < EPSILON) {
- /* knot open at beggining */
- texture_t_knot->open_at_begin = GL_TRUE;
- }
- else
- texture_t_knot->open_at_begin = GL_FALSE;
- if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) {
- /* knot open at end */
- texture_t_knot->open_at_end = GL_TRUE;
- }
- else
- texture_t_knot->open_at_end = GL_FALSE;
- }
- else {
- texture_s_knot->unified_knot = NULL;
- texture_t_knot->unified_knot = NULL;
- }
- return GLU_NO_ERROR;
-}
-
-
-static void
-free_new_ctrl(new_ctrl_type * p)
-{
- if (p->geom_ctrl)
- free(p->geom_ctrl);
- if (p->geom_offsets)
- free(p->geom_offsets);
- if (p->color_ctrl) {
- free(p->color_ctrl);
- if (p->color_offsets)
- free(p->color_offsets);
- }
- if (p->normal_ctrl) {
- free(p->normal_ctrl);
- if (p->normal_offsets)
- free(p->normal_offsets);
- }
- if (p->texture_ctrl) {
- free(p->texture_ctrl);
- if (p->texture_offsets)
- free(p->texture_offsets);
- }
-}
-
-/* convert surfaces - geometry and possible attribute ones into equivalent */
-/* sequence of adjacent Bezier patches */
-static GLenum
-convert_surfs(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl)
-{
- knot_str_type geom_s_knot, color_s_knot, normal_s_knot, texture_s_knot;
- knot_str_type geom_t_knot, color_t_knot, normal_t_knot, texture_t_knot;
- GLenum err;
-
- if ((err = fill_knot_structures(nobj, &geom_s_knot, &geom_t_knot,
- &color_s_knot, &color_t_knot,
- &normal_s_knot, &normal_t_knot,
- &texture_s_knot,
- &texture_t_knot)) != GLU_NO_ERROR) {
- return err;
- }
- /* unify knots - all knots should have the same working range */
- if ((err = select_knot_working_range(nobj, &geom_s_knot, &color_s_knot,
- &normal_s_knot,
- &texture_s_knot)) != GLU_NO_ERROR) {
- call_user_error(nobj, err);
- return err;
- }
- if ((err = select_knot_working_range(nobj, &geom_t_knot, &color_t_knot,
- &normal_t_knot,
- &texture_t_knot)) != GLU_NO_ERROR) {
- free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot,
- &texture_s_knot);
- call_user_error(nobj, err);
- return err;
- }
-
- /* convert the geometry surface */
- nobj->surface.geom.dim = get_surface_dim(nobj->surface.geom.type);
- if ((err = convert_surf(&geom_s_knot, &geom_t_knot, &(nobj->surface.geom),
- &(new_ctrl->geom_ctrl), &(new_ctrl->geom_s_pt_cnt),
- &(new_ctrl->geom_t_pt_cnt))) != GLU_NO_ERROR) {
- free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot,
- &texture_s_knot);
- free_unified_knots(&geom_t_knot, &color_t_knot, &normal_t_knot,
- &texture_t_knot);
- call_user_error(nobj, err);
- return err;
- }
- /* if additional attributive surfaces are given convert them as well */
- if (color_s_knot.unified_knot) {
- nobj->surface.color.dim = get_surface_dim(nobj->surface.color.type);
- if (
- (err =
- convert_surf(&color_s_knot, &color_t_knot, &(nobj->surface.color),
- &(new_ctrl->color_ctrl), &(new_ctrl->color_s_pt_cnt),
- &(new_ctrl->color_t_pt_cnt))) != GLU_NO_ERROR) {
- free_unified_knots(&color_s_knot, &color_s_knot, &normal_s_knot,
- &texture_s_knot);
- free_unified_knots(&color_t_knot, &color_t_knot, &normal_t_knot,
- &texture_t_knot);
- free_new_ctrl(new_ctrl);
- call_user_error(nobj, err);
- return err;
- }
- }
- if (normal_s_knot.unified_knot) {
- nobj->surface.normal.dim = get_surface_dim(nobj->surface.normal.type);
- if ((err = convert_surf(&normal_s_knot, &normal_t_knot,
- &(nobj->surface.normal),
- &(new_ctrl->normal_ctrl),
- &(new_ctrl->normal_s_pt_cnt),
- &(new_ctrl->normal_t_pt_cnt))) !=
- GLU_NO_ERROR) {
- free_unified_knots(&normal_s_knot, &normal_s_knot, &normal_s_knot,
- &texture_s_knot);
- free_unified_knots(&normal_t_knot, &normal_t_knot, &normal_t_knot,
- &texture_t_knot);
- free_new_ctrl(new_ctrl);
- call_user_error(nobj, err);
- return err;
- }
- }
- if (texture_s_knot.unified_knot) {
- nobj->surface.texture.dim = get_surface_dim(nobj->surface.texture.type);
- if ((err = convert_surf(&texture_s_knot, &texture_t_knot,
- &(nobj->surface.texture),
- &(new_ctrl->texture_ctrl),
- &(new_ctrl->texture_s_pt_cnt),
- &(new_ctrl->texture_t_pt_cnt))) !=
- GLU_NO_ERROR) {
- free_unified_knots(&texture_s_knot, &texture_s_knot, &texture_s_knot,
- &texture_s_knot);
- free_unified_knots(&texture_t_knot, &texture_t_knot, &texture_t_knot,
- &texture_t_knot);
- free_new_ctrl(new_ctrl);
- call_user_error(nobj, err);
- return err;
- }
- }
- return GLU_NO_ERROR;
-}
-
-/* tesselate the "boundary" Bezier edge strips */
-static void
-tesselate_strip_t_line(GLint top_start, GLint top_end, GLint top_z,
- GLint bottom_start, GLint bottom_end, GLint bottom_z,
- GLint bottom_domain)
-{
- GLint top_cnt, bottom_cnt, tri_cnt, k;
- GLint direction;
-
- top_cnt = top_end - top_start;
- direction = (top_cnt >= 0 ? 1 : -1);
- bottom_cnt = bottom_end - bottom_start;
- glBegin(GL_LINES);
- while (top_cnt) {
- if (bottom_cnt)
- tri_cnt = top_cnt / bottom_cnt;
- else
- tri_cnt = abs(top_cnt);
- for (k = 0; k <= tri_cnt; k++, top_start += direction) {
- glEvalCoord2f((GLfloat) bottom_z / bottom_domain,
- (GLfloat) bottom_start / bottom_domain);
- glEvalPoint2(top_z, top_start);
- }
- if (bottom_cnt) {
- glEvalCoord2f((GLfloat) bottom_z / bottom_domain,
- (GLfloat) bottom_start / bottom_domain);
- bottom_start += direction;
- top_start -= direction;
- glEvalCoord2f((GLfloat) bottom_z / bottom_domain,
- (GLfloat) bottom_start / bottom_domain);
- glEvalCoord2f((GLfloat) bottom_z / bottom_domain,
- (GLfloat) bottom_start / bottom_domain);
- glEvalPoint2(top_z, top_start);
- }
- top_cnt -= direction * tri_cnt;
- bottom_cnt -= direction;
- }
- glEnd();
-}
-
-
-static void
-tesselate_strip_t_fill(GLint top_start, GLint top_end, GLint top_z,
- GLint bottom_start, GLint bottom_end, GLint bottom_z,
- GLint bottom_domain)
-{
- GLint top_cnt, bottom_cnt, tri_cnt, k;
- GLint direction;
-
- top_cnt = top_end - top_start;
- direction = (top_cnt >= 0 ? 1 : -1);
- bottom_cnt = bottom_end - bottom_start;
- while (top_cnt) {
- if (bottom_cnt)
- tri_cnt = top_cnt / bottom_cnt;
- else
- tri_cnt = abs(top_cnt);
- glBegin(GL_TRIANGLE_FAN);
- glEvalCoord2f((GLfloat) bottom_z / bottom_domain,
- (GLfloat) bottom_start / bottom_domain);
- for (k = 0; k <= tri_cnt; k++, top_start += direction)
- glEvalPoint2(top_z, top_start);
- if (bottom_cnt) {
- bottom_start += direction;
- top_start -= direction;
- glEvalCoord2f((GLfloat) bottom_z / bottom_domain,
- (GLfloat) bottom_start / bottom_domain);
- }
- glEnd();
- top_cnt -= direction * tri_cnt;
- bottom_cnt -= direction;
- }
-}
-
-
-static void
-tesselate_strip_t(GLenum display_mode, GLint top_start, GLint top_end,
- GLint top_z, GLint bottom_start, GLint bottom_end,
- GLint bottom_z, GLint bottom_domain)
-{
- if (display_mode == GL_FILL)
- tesselate_strip_t_fill(top_start, top_end, top_z, bottom_start,
- bottom_end, bottom_z, bottom_domain);
- else
- tesselate_strip_t_line(top_start, top_end, top_z, bottom_start,
- bottom_end, bottom_z, bottom_domain);
-}
-
-
-static void
-tesselate_strip_s_fill(GLint top_start, GLint top_end, GLint top_z,
- GLint bottom_start, GLint bottom_end, GLint bottom_z,
- GLfloat bottom_domain)
-{
- GLint top_cnt, bottom_cnt, tri_cnt, k;
- GLint direction;
-
- top_cnt = top_end - top_start;
- direction = (top_cnt >= 0 ? 1 : -1);
- bottom_cnt = bottom_end - bottom_start;
- while (top_cnt) {
- if (bottom_cnt)
- tri_cnt = top_cnt / bottom_cnt;
- else
- tri_cnt = abs(top_cnt);
- glBegin(GL_TRIANGLE_FAN);
- glEvalCoord2f((GLfloat) bottom_start / bottom_domain,
- (GLfloat) bottom_z / bottom_domain);
- for (k = 0; k <= tri_cnt; k++, top_start += direction)
- glEvalPoint2(top_start, top_z);
- if (bottom_cnt) {
- bottom_start += direction;
- top_start -= direction;
- glEvalCoord2f((GLfloat) bottom_start / bottom_domain,
- (GLfloat) bottom_z / bottom_domain);
- }
- glEnd();
- top_cnt -= direction * tri_cnt;
- bottom_cnt -= direction;
- }
-}
-
-
-static void
-tesselate_strip_s_line(GLint top_start, GLint top_end, GLint top_z,
- GLint bottom_start, GLint bottom_end, GLint bottom_z,
- GLfloat bottom_domain)
-{
- GLint top_cnt, bottom_cnt, tri_cnt, k;
- GLint direction;
-
- top_cnt = top_end - top_start;
- direction = (top_cnt >= 0 ? 1 : -1);
- bottom_cnt = bottom_end - bottom_start;
- glBegin(GL_LINES);
- while (top_cnt) {
- if (bottom_cnt)
- tri_cnt = top_cnt / bottom_cnt;
- else
- tri_cnt = abs(top_cnt);
- for (k = 0; k <= tri_cnt; k++, top_start += direction) {
- glEvalCoord2f((GLfloat) bottom_start / bottom_domain,
- (GLfloat) bottom_z / bottom_domain);
- glEvalPoint2(top_start, top_z);
- }
- if (bottom_cnt) {
- glEvalCoord2f((GLfloat) bottom_start / bottom_domain,
- (GLfloat) bottom_z / bottom_domain);
- bottom_start += direction;
- top_start -= direction;
- glEvalCoord2f((GLfloat) bottom_start / bottom_domain,
- (GLfloat) bottom_z / bottom_domain);
- glEvalPoint2(top_start, top_z);
- glEvalCoord2f((GLfloat) bottom_start / bottom_domain,
- (GLfloat) bottom_z / bottom_domain);
- }
- top_cnt -= direction * tri_cnt;
- bottom_cnt -= direction;
- }
- glEnd();
-}
-
-
-static void
-tesselate_strip_s(GLenum display_mode, GLint top_start, GLint top_end,
- GLint top_z, GLint bottom_start, GLint bottom_end,
- GLint bottom_z, GLfloat bottom_domain)
-{
- if (display_mode == GL_FILL)
- tesselate_strip_s_fill(top_start, top_end, top_z, bottom_start,
- bottom_end, bottom_z, bottom_domain);
- else
- tesselate_strip_s_line(top_start, top_end, top_z, bottom_start,
- bottom_end, bottom_z, bottom_domain);
-}
-
-static void
-tesselate_bottom_left_corner(GLenum display_mode, GLfloat s_1, GLfloat t_1)
-{
- if (display_mode == GL_FILL) {
- glBegin(GL_TRIANGLE_FAN);
- glEvalPoint2(1, 1);
- glEvalCoord2f(s_1, 0.0);
- glEvalCoord2f(0.0, 0.0);
- glEvalCoord2f(0.0, t_1);
- }
- else {
- glBegin(GL_LINES);
- glEvalCoord2f(0.0, 0.0);
- glEvalCoord2f(0.0, t_1);
- glEvalCoord2f(0.0, 0.0);
- glEvalPoint2(1, 1);
- glEvalCoord2f(0.0, 0.0);
- glEvalCoord2f(s_1, 0.0);
- }
- glEnd();
-}
-
-static void
-tesselate_bottom_right_corner(GLenum display_mode, GLint v_top,
- GLint v_bottom, GLfloat s_1, GLfloat t_1)
-{
- if (display_mode == GL_FILL) {
- glBegin(GL_TRIANGLE_FAN);
- glEvalPoint2(1, v_top);
- glEvalCoord2f(0.0, v_bottom * t_1);
- glEvalCoord2f(0.0, (v_bottom + 1) * t_1);
- glEvalCoord2f(s_1, (v_bottom + 1) * t_1);
- }
- else {
- glBegin(GL_LINES);
- glEvalCoord2f(0.0, (v_bottom + 1) * t_1);
- glEvalPoint2(1, v_top);
- glEvalCoord2f(0.0, (v_bottom + 1) * t_1);
- glEvalCoord2f(0.0, v_bottom * t_1);
- glEvalCoord2f(0.0, (v_bottom + 1) * t_1);
- glEvalCoord2f(s_1, (v_bottom + 1) * t_1);
- }
- glEnd();
-}
-
-static void
-tesselate_top_left_corner(GLenum display_mode, GLint u_right, GLint u_left,
- GLfloat s_1, GLfloat t_1)
-{
- if (display_mode == GL_FILL) {
- glBegin(GL_TRIANGLE_FAN);
- glEvalPoint2(u_right, 1);
- glEvalCoord2f((u_left + 1) * s_1, t_1);
- glEvalCoord2f((u_left + 1) * s_1, 0.0);
- glEvalCoord2f(u_left * s_1, 0.0);
- }
- else {
- glBegin(GL_LINES);
- glEvalCoord2f((u_left + 1) * s_1, 0.0);
- glEvalPoint2(u_right, 1);
- glEvalCoord2f((u_left + 1) * s_1, 0.0);
- glEvalCoord2f(u_left * s_1, 0.0);
- glEvalCoord2f((u_left + 1) * s_1, 0.0);
- glEvalCoord2f((u_left + 1) * s_1, t_1);
- }
- glEnd();
-}
-
-static void
-tesselate_top_right_corner(GLenum display_mode, GLint u_left, GLint v_bottom,
- GLint u_right, GLint v_top, GLfloat s_1,
- GLfloat t_1)
-{
- if (display_mode == GL_FILL) {
- glBegin(GL_TRIANGLE_FAN);
- glEvalPoint2(u_left, v_bottom);
- glEvalCoord2f((u_right - 1) * s_1, v_top * t_1);
- glEvalCoord2f(u_right * s_1, v_top * t_1);
- glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1);
- }
- else {
- glBegin(GL_LINES);
- glEvalCoord2f(u_right * s_1, v_top * t_1);
- glEvalPoint2(u_left, v_bottom);
- glEvalCoord2f(u_right * s_1, v_top * t_1);
- glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1);
- glEvalCoord2f(u_right * s_1, v_top * t_1);
- glEvalCoord2f((u_right - 1) * s_1, v_top * t_1);
- }
- glEnd();
-}
-
-/* do mesh mapping of Bezier */
-static void
-nurbs_map_bezier(GLenum display_mode, GLint * sfactors, GLint * tfactors,
- GLint s_bezier_cnt, GLint t_bezier_cnt, GLint s, GLint t)
-{
- GLint top, bottom, right, left;
-
-
- if (s == 0) {
- top = *(tfactors + t * 3);
- bottom = *(tfactors + t * 3 + 1);
- }
- else if (s == s_bezier_cnt - 1) {
- top = *(tfactors + t * 3 + 2);
- bottom = *(tfactors + t * 3);
- }
- else {
- top = bottom = *(tfactors + t * 3);
- }
- if (t == 0) {
- left = *(sfactors + s * 3 + 1);
- right = *(sfactors + s * 3);
- }
- else if (t == t_bezier_cnt - 1) {
- left = *(sfactors + s * 3);
- right = *(sfactors + s * 3 + 2);
- }
- else {
- left = right = *(sfactors + s * 3);
- }
-
- if (top > bottom) {
- if (left < right) {
- glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0);
- glEvalMesh2(display_mode, 1, right, 1, top);
- tesselate_strip_s(display_mode, 1, right, 1, 1, left, 0,
- (GLfloat) left);
- tesselate_bottom_left_corner(display_mode, (GLfloat) (1.0 / left),
- (GLfloat) (1.0 / bottom));
-/* tesselate_strip_t(display_mode,1,top,1,1,bottom,0,(GLfloat)bottom);*/
- tesselate_strip_t(display_mode, top, 1, 1, bottom, 1, 0,
- (GLfloat) bottom);
- }
- else if (left == right) {
- glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0);
- glEvalMesh2(display_mode, 1, right, 0, top);
-/* tesselate_strip_t(display_mode,0,top,1,0,bottom,0,(GLfloat)bottom);*/
- tesselate_strip_t(display_mode, top, 0, 1, bottom, 0, 0,
- (GLfloat) bottom);
- }
- else {
- glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0);
- glEvalMesh2(display_mode, 1, left, 0, top - 1);
-/* tesselate_strip_t(display_mode,0,top-1,1,0,bottom-1,0,
- (GLfloat)bottom);*/
- tesselate_strip_t(display_mode, top - 1, 0, 1, bottom - 1, 0, 0,
- (GLfloat) bottom);
- tesselate_bottom_right_corner(display_mode, top - 1, bottom - 1,
- (GLfloat) (1.0 / right),
- (GLfloat) (1.0 / bottom));
-/* tesselate_strip_s(display_mode,1,left,top-1,1,right,right,
- (GLfloat)right);*/
- tesselate_strip_s(display_mode, left, 1, top - 1, right, 1, right,
- (GLfloat) right);
- }
- }
- else if (top == bottom) {
- if (left < right) {
- glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0);
- glEvalMesh2(display_mode, 0, right, 1, top);
- tesselate_strip_s(display_mode, 0, right, 1, 0, left, 0,
- (GLfloat) left);
- }
- else if (left == right) {
- glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0);
- glEvalMesh2(display_mode, 0, right, 0, top);
- }
- else {
- glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0);
- glEvalMesh2(display_mode, 0, left, 0, top - 1);
-/* tesselate_strip_s(display_mode,0,left,top-1,0,right,right,
- (GLfloat)right);*/
- tesselate_strip_s(display_mode, left, 0, top - 1, right, 0, right,
- (GLfloat) right);
- }
- }
- else {
- if (left < right) {
- glMapGrid2f(right, 0.0, 1.0, bottom, 0.0, 1.0);
- glEvalMesh2(display_mode, 0, right - 1, 1, bottom);
- tesselate_strip_s(display_mode, 0, right - 1, 1, 0, left - 1, 0,
- (GLfloat) left);
- tesselate_top_left_corner(display_mode, right - 1, left - 1,
- (GLfloat) (1.0 / left),
- (GLfloat) (1.0 / top));
- tesselate_strip_t(display_mode, 1, bottom, right - 1, 1, top, top,
- (GLfloat) top);
- }
- else if (left == right) {
- glMapGrid2f(right, 0.0, 1.0, bottom, 0.0, 1.0);
- glEvalMesh2(display_mode, 0, right - 1, 0, bottom);
- tesselate_strip_t(display_mode, 0, bottom, right - 1, 0, top, top,
- (GLfloat) top);
- }
- else {
- glMapGrid2f(left, 0.0, 1.0, bottom, 0.0, 1.0);
- glEvalMesh2(display_mode, 0, left - 1, 0, bottom - 1);
- tesselate_strip_t(display_mode, 0, bottom - 1, left - 1, 0, top - 1,
- top, (GLfloat) top);
- tesselate_top_right_corner(display_mode, left - 1, bottom - 1, right,
- top, (GLfloat) (1.0 / right),
- (GLfloat) (1.0 / top));
-/* tesselate_strip_s(display_mode,0,left-1,bottom-1,0,right-1,right,
- (GLfloat)right);*/
- tesselate_strip_s(display_mode, left - 1, 0, bottom - 1, right - 1,
- 0, right, (GLfloat) right);
- }
- }
-}
-
-/* draw NURBS surface in OUTLINE POLYGON mode */
-static void
-draw_polygon_mode(GLenum display_mode, GLUnurbsObj * nobj,
- new_ctrl_type * new_ctrl, GLint * sfactors,
- GLint * tfactors)
-{
- GLsizei offset;
- GLint t_bezier_cnt, s_bezier_cnt;
- GLboolean do_color, do_normal, do_texture;
- GLint i, j;
-
- t_bezier_cnt = new_ctrl->t_bezier_cnt;
- s_bezier_cnt = new_ctrl->s_bezier_cnt;
- glEnable(nobj->surface.geom.type);
- if (new_ctrl->color_ctrl) {
- glEnable(nobj->surface.color.type);
- do_color = GL_TRUE;
- }
- else
- do_color = GL_FALSE;
- if (new_ctrl->normal_ctrl) {
- glEnable(nobj->surface.normal.type);
- do_normal = GL_TRUE;
- }
- else
- do_normal = GL_FALSE;
- if (new_ctrl->texture_ctrl) {
- glEnable(nobj->surface.texture.type);
- do_texture = GL_TRUE;
- }
- else
- do_texture = GL_FALSE;
- for (j = 0; j < s_bezier_cnt; j++) {
- for (i = 0; i < t_bezier_cnt; i++) {
- offset = j * t_bezier_cnt + i;
- if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset),
- nobj->surface.geom.sorder,
- nobj->surface.geom.torder,
- new_ctrl->geom_s_stride,
- new_ctrl->geom_t_stride,
- nobj->surface.geom.dim)) continue;
- glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride,
- nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride,
- nobj->surface.geom.torder,
- *(new_ctrl->geom_offsets + offset));
- if (do_color) {
- glMap2f(nobj->surface.color.type, 0.0, 1.0,
- new_ctrl->color_s_stride, nobj->surface.color.sorder,
- 0.0, 1.0, new_ctrl->color_t_stride,
- nobj->surface.color.torder,
- *(new_ctrl->color_offsets + offset));
- }
- if (do_normal) {
- glMap2f(nobj->surface.normal.type, 0.0, 1.0,
- new_ctrl->normal_s_stride, nobj->surface.normal.sorder,
- 0.0, 1.0, new_ctrl->normal_t_stride,
- nobj->surface.normal.torder,
- *(new_ctrl->normal_offsets + offset));
- }
- if (do_texture) {
- glMap2f(nobj->surface.texture.type, 0.0, 1.0,
- new_ctrl->texture_s_stride, nobj->surface.texture.sorder,
- 0.0, 1.0, new_ctrl->texture_t_stride,
- nobj->surface.texture.torder,
- *(new_ctrl->texture_offsets + offset));
- }
-/* glMapGrid2f(sfactors[j*3+0],0.0,1.0,tfactors[i*3+0],0.0,1.0);
- glEvalMesh2(display_mode,0,sfactors[j*3+0],0,tfactors[i*3+0]);*/
- nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt,
- t_bezier_cnt, j, i);
- }
- }
-}
-
-
-
-/* draw NURBS surface in OUTLINE POLYGON mode */
-#if 0
-static void
-draw_patch_mode(GLenum display_mode, GLUnurbsObj * nobj,
- new_ctrl_type * new_ctrl, GLint * sfactors, GLint * tfactors)
-{
- GLsizei offset;
- GLint t_bezier_cnt, s_bezier_cnt;
- GLboolean do_color, do_normal, do_texture;
- GLint i, j;
-
- t_bezier_cnt = new_ctrl->t_bezier_cnt;
- s_bezier_cnt = new_ctrl->s_bezier_cnt;
- glEnable(nobj->surface.geom.type);
- if (new_ctrl->color_ctrl) {
- glEnable(nobj->surface.color.type);
- do_color = GL_TRUE;
- }
- else
- do_color = GL_FALSE;
- if (new_ctrl->normal_ctrl) {
- glEnable(nobj->surface.normal.type);
- do_normal = GL_TRUE;
- }
- else
- do_normal = GL_FALSE;
- if (new_ctrl->texture_ctrl) {
- glEnable(nobj->surface.texture.type);
- do_texture = GL_TRUE;
- }
- else
- do_texture = GL_FALSE;
- for (j = 0; j < s_bezier_cnt; j++) {
- for (i = 0; i < t_bezier_cnt; i++) {
- offset = j * t_bezier_cnt + i;
- if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset),
- nobj->surface.geom.sorder,
- nobj->surface.geom.torder,
- new_ctrl->geom_s_stride,
- new_ctrl->geom_t_stride,
- nobj->surface.geom.dim)) continue;
- glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride,
- nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride,
- nobj->surface.geom.torder,
- *(new_ctrl->geom_offsets + offset));
- if (do_color) {
- glMap2f(nobj->surface.color.type, 0.0, 1.0,
- new_ctrl->color_s_stride, nobj->surface.color.sorder,
- 0.0, 1.0, new_ctrl->color_t_stride,
- nobj->surface.color.torder,
- *(new_ctrl->color_offsets + offset));
- }
- if (do_normal) {
- glMap2f(nobj->surface.normal.type, 0.0, 1.0,
- new_ctrl->normal_s_stride, nobj->surface.normal.sorder,
- 0.0, 1.0, new_ctrl->normal_t_stride,
- nobj->surface.normal.torder,
- *(new_ctrl->normal_offsets + offset));
- }
- if (do_texture) {
- glMap2f(nobj->surface.texture.type, 0.0, 1.0,
- new_ctrl->texture_s_stride, nobj->surface.texture.sorder,
- 0.0, 1.0, new_ctrl->texture_t_stride,
- nobj->surface.texture.torder,
- *(new_ctrl->texture_offsets + offset));
- }
- nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt,
- t_bezier_cnt, i, j);
-/* glMapGrid2f(sfactors[j],0.0,1.0,tfactors[i],0.0,1.0);
- glEvalMesh2(display_mode,0,sfactors[j],0,tfactors[i]);*/
- }
- }
-}
-#endif
-
-
-
-static void
-init_new_ctrl(new_ctrl_type * p)
-{
- p->geom_ctrl = p->color_ctrl = p->normal_ctrl = p->texture_ctrl = NULL;
- p->geom_offsets = p->color_offsets = p->normal_offsets =
- p->texture_offsets = NULL;
- p->s_bezier_cnt = p->t_bezier_cnt = 0;
-}
-
-
-static GLenum
-augment_new_ctrl(GLUnurbsObj * nobj, new_ctrl_type * p)
-{
- GLsizei offset_size;
- GLint i, j;
-
- p->s_bezier_cnt = (p->geom_s_pt_cnt) / (nobj->surface.geom.sorder);
- p->t_bezier_cnt = (p->geom_t_pt_cnt) / (nobj->surface.geom.torder);
- offset_size = (p->s_bezier_cnt) * (p->t_bezier_cnt);
- p->geom_t_stride = nobj->surface.geom.dim;
- p->geom_s_stride = (p->geom_t_pt_cnt) * (nobj->surface.geom.dim);
- p->color_t_stride = nobj->surface.color.dim;
- p->color_s_stride = (p->color_t_pt_cnt) * (nobj->surface.color.dim);
- p->normal_t_stride = nobj->surface.normal.dim;
- p->normal_s_stride = (p->normal_t_pt_cnt) * (nobj->surface.normal.dim);
- p->texture_t_stride = nobj->surface.texture.dim;
- p->texture_s_stride = (p->texture_t_pt_cnt) * (nobj->surface.texture.dim);
- if (
- (p->geom_offsets =
- (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) {
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- if (p->color_ctrl)
- if (
- (p->color_offsets =
- (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) {
- free_new_ctrl(p);
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- if (p->normal_ctrl)
- if (
- (p->normal_offsets =
- (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) {
- free_new_ctrl(p);
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- if (p->texture_ctrl)
- if (
- (p->texture_offsets =
- (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) {
- free_new_ctrl(p);
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- for (i = 0; i < p->s_bezier_cnt; i++)
- for (j = 0; j < p->t_bezier_cnt; j++)
- *(p->geom_offsets + i * (p->t_bezier_cnt) + j) =
- p->geom_ctrl + i * (nobj->surface.geom.sorder) *
- (nobj->surface.geom.dim) * (p->geom_t_pt_cnt) +
- j * (nobj->surface.geom.dim) * (nobj->surface.geom.torder);
- if (p->color_ctrl)
- for (i = 0; i < p->s_bezier_cnt; i++)
- for (j = 0; j < p->t_bezier_cnt; j++)
- *(p->color_offsets + i * (p->t_bezier_cnt) + j) =
- p->color_ctrl + i * (nobj->surface.color.sorder) *
- (nobj->surface.color.dim) * (p->color_t_pt_cnt) +
- j * (nobj->surface.color.dim) * (nobj->surface.color.torder);
- if (p->normal_ctrl)
- for (i = 0; i < p->s_bezier_cnt; i++)
- for (j = 0; j < p->t_bezier_cnt; j++)
- *(p->normal_offsets + i * (p->t_bezier_cnt) + j) =
- p->normal_ctrl + i * (nobj->surface.normal.sorder) *
- (nobj->surface.normal.dim) * (p->normal_t_pt_cnt) +
- j * (nobj->surface.normal.dim) * (nobj->surface.normal.torder);
- if (p->texture_ctrl)
- for (i = 0; i < p->s_bezier_cnt; i++)
- for (j = 0; j < p->t_bezier_cnt; j++)
- *(p->texture_offsets + i * (p->t_bezier_cnt) + j) =
- p->texture_ctrl + i * (nobj->surface.texture.sorder) *
- (nobj->surface.texture.dim) * (p->texture_t_pt_cnt) +
- j * (nobj->surface.texture.dim) *
- (nobj->surface.texture.torder);
- return GLU_NO_ERROR;
-}
-
-/* main NURBS surface procedure */
-void
-do_nurbs_surface(GLUnurbsObj * nobj)
-{
- GLint *sfactors, *tfactors;
- new_ctrl_type new_ctrl;
-
- /* test user supplied data */
- if (test_nurbs_surfaces(nobj) != GLU_NO_ERROR)
- return;
-
- init_new_ctrl(&new_ctrl);
-
- if (convert_surfs(nobj, &new_ctrl) != GLU_NO_ERROR)
- return;
- if (augment_new_ctrl(nobj, &new_ctrl) != GLU_NO_ERROR)
- return;
- switch (nobj->sampling_method) {
- case GLU_PATH_LENGTH:
- if (glu_do_sampling_3D(nobj, &new_ctrl, &sfactors, &tfactors) !=
- GLU_NO_ERROR) {
- free_new_ctrl(&new_ctrl);
- return;
- }
- break;
- case GLU_DOMAIN_DISTANCE:
- if (glu_do_sampling_uv(nobj, &new_ctrl, &sfactors, &tfactors) !=
- GLU_NO_ERROR) {
- free_new_ctrl(&new_ctrl);
- return;
- }
- break;
- case GLU_PARAMETRIC_ERROR:
- if (glu_do_sampling_param_3D(nobj, &new_ctrl, &sfactors, &tfactors) !=
- GLU_NO_ERROR) {
- free_new_ctrl(&new_ctrl);
- return;
- }
- break;
- default:
- abort();
- }
- glFrontFace(GL_CW);
- switch (nobj->display_mode) {
- case GLU_FILL:
-/* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/
- draw_polygon_mode(GL_FILL, nobj, &new_ctrl, sfactors, tfactors);
- break;
- case GLU_OUTLINE_POLYGON:
- /* TODO - missing trimming handeling */
-/* just for now - no OUTLINE_PATCH mode
- draw_patch_mode(GL_LINE,nobj,&new_ctrl,sfactors,tfactors);
- break; */
- case GLU_OUTLINE_PATCH:
-/* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/
- draw_polygon_mode(GL_LINE, nobj, &new_ctrl, sfactors, tfactors);
- break;
- default:
- abort(); /* TODO: is this OK? */
- }
- free(sfactors);
- free(tfactors);
- free_new_ctrl(&new_ctrl);
-}
diff --git a/src/glu/mesa/nurbsutl.c b/src/glu/mesa/nurbsutl.c
deleted file mode 100644
index b46348a50b2..00000000000
--- a/src/glu/mesa/nurbsutl.c
+++ /dev/null
@@ -1,1309 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include "gluP.h"
-#include "nurbs.h"
-#endif
-
-
-GLenum test_knot(GLint nknots, GLfloat * knot, GLint order)
-{
- GLsizei i;
- GLint knot_mult;
- GLfloat tmp_knot;
-
- tmp_knot = knot[0];
- knot_mult = 1;
- for (i = 1; i < nknots; i++) {
- if (knot[i] < tmp_knot)
- return GLU_NURBS_ERROR4;
- if (fabs(tmp_knot - knot[i]) > EPSILON) {
- if (knot_mult > order)
- return GLU_NURBS_ERROR5;
- knot_mult = 1;
- tmp_knot = knot[i];
- }
- else
- ++knot_mult;
- }
- return GLU_NO_ERROR;
-}
-
-static int
-/* qsort function */
-#if defined(WIN32) && !defined(OPENSTEP)
- __cdecl
-#endif
-knot_sort(const void *a, const void *b)
-{
- GLfloat x, y;
-
- x = *((GLfloat *) a);
- y = *((GLfloat *) b);
- if (fabs(x - y) < EPSILON)
- return 0;
- if (x > y)
- return 1;
- return -1;
-}
-
-/* insert into dest knot all values within the valid range from src knot */
-/* that do not appear in dest */
-void
-collect_unified_knot(knot_str_type * dest, knot_str_type * src,
- GLfloat maximal_min_knot, GLfloat minimal_max_knot)
-{
- GLfloat *src_knot, *dest_knot;
- GLint src_t_min, src_t_max, dest_t_min, dest_t_max;
- GLint src_nknots, dest_nknots;
- GLint i, j, k, new_cnt;
- GLboolean not_found_flag;
-
- src_knot = src->unified_knot;
- dest_knot = dest->unified_knot;
- src_t_min = src->t_min;
- src_t_max = src->t_max;
- dest_t_min = dest->t_min;
- dest_t_max = dest->t_max;
- src_nknots = src->unified_nknots;
- dest_nknots = dest->unified_nknots;
-
- k = new_cnt = dest_nknots;
- for (i = src_t_min; i <= src_t_max; i++)
- if (src_knot[i] - maximal_min_knot > -EPSILON &&
- src_knot[i] - minimal_max_knot < EPSILON) {
- not_found_flag = GL_TRUE;
- for (j = dest_t_min; j <= dest_t_max; j++)
- if (fabs(dest_knot[j] - src_knot[i]) < EPSILON) {
- not_found_flag = GL_FALSE;
- break;
- }
- if (not_found_flag) {
- /* knot from src is not in dest - add this knot to dest */
- dest_knot[k++] = src_knot[i];
- ++new_cnt;
- ++(dest->t_max); /* the valid range widens */
- ++(dest->delta_nknots); /* increment the extra knot value counter */
- }
- }
- dest->unified_nknots = new_cnt;
- qsort((void *) dest_knot, (size_t) new_cnt, (size_t) sizeof(GLfloat),
- &knot_sort);
-}
-
-/* basing on the new common knot range for all attributes set */
-/* t_min and t_max values for each knot - they will be used later on */
-/* by explode_knot() and calc_new_ctrl_pts */
-static void
-set_new_t_min_t_max(knot_str_type * geom_knot, knot_str_type * color_knot,
- knot_str_type * normal_knot, knot_str_type * texture_knot,
- GLfloat maximal_min_knot, GLfloat minimal_max_knot)
-{
- GLuint t_min = 0, t_max = 0, cnt = 0;
-
- if (minimal_max_knot - maximal_min_knot < EPSILON) {
- /* knot common range empty */
- geom_knot->t_min = geom_knot->t_max = 0;
- color_knot->t_min = color_knot->t_max = 0;
- normal_knot->t_min = normal_knot->t_max = 0;
- texture_knot->t_min = texture_knot->t_max = 0;
- }
- else {
- if (geom_knot->unified_knot != NULL) {
- cnt = geom_knot->unified_nknots;
- for (t_min = 0; t_min < cnt; t_min++)
- if (fabs((geom_knot->unified_knot)[t_min] - maximal_min_knot) <
- EPSILON) break;
- for (t_max = cnt - 1; t_max; t_max--)
- if (fabs((geom_knot->unified_knot)[t_max] - minimal_max_knot) <
- EPSILON) break;
- }
- else if (geom_knot->nknots) {
- cnt = geom_knot->nknots;
- for (t_min = 0; t_min < cnt; t_min++)
- if (fabs((geom_knot->knot)[t_min] - maximal_min_knot) < EPSILON)
- break;
- for (t_max = cnt - 1; t_max; t_max--)
- if (fabs((geom_knot->knot)[t_max] - minimal_max_knot) < EPSILON)
- break;
- }
- geom_knot->t_min = t_min;
- geom_knot->t_max = t_max;
- if (color_knot->unified_knot != NULL) {
- cnt = color_knot->unified_nknots;
- for (t_min = 0; t_min < cnt; t_min++)
- if (fabs((color_knot->unified_knot)[t_min] - maximal_min_knot) <
- EPSILON) break;
- for (t_max = cnt - 1; t_max; t_max--)
- if (fabs((color_knot->unified_knot)[t_max] - minimal_max_knot) <
- EPSILON) break;
- color_knot->t_min = t_min;
- color_knot->t_max = t_max;
- }
- if (normal_knot->unified_knot != NULL) {
- cnt = normal_knot->unified_nknots;
- for (t_min = 0; t_min < cnt; t_min++)
- if (fabs((normal_knot->unified_knot)[t_min] - maximal_min_knot) <
- EPSILON) break;
- for (t_max = cnt - 1; t_max; t_max--)
- if (fabs((normal_knot->unified_knot)[t_max] - minimal_max_knot) <
- EPSILON) break;
- normal_knot->t_min = t_min;
- normal_knot->t_max = t_max;
- }
- if (texture_knot->unified_knot != NULL) {
- cnt = texture_knot->unified_nknots;
- for (t_min = 0; t_min < cnt; t_min++)
- if (fabs((texture_knot->unified_knot)[t_min] - maximal_min_knot)
- < EPSILON)
- break;
- for (t_max = cnt - 1; t_max; t_max--)
- if (fabs((texture_knot->unified_knot)[t_max] - minimal_max_knot)
- < EPSILON)
- break;
- texture_knot->t_min = t_min;
- texture_knot->t_max = t_max;
- }
- }
-}
-
-/* modify all knot valid ranges in such a way that all have the same */
-/* range, common to all knots */
-/* do this by knot insertion */
-GLenum
-select_knot_working_range(GLUnurbsObj * nobj, knot_str_type * geom_knot,
- knot_str_type * color_knot,
- knot_str_type * normal_knot,
- knot_str_type * texture_knot)
-{
- GLint max_nknots;
- GLfloat maximal_min_knot, minimal_max_knot;
- GLint i;
-
- /* find the maximum modified knot length */
- max_nknots = geom_knot->nknots;
- if (color_knot->unified_knot)
- max_nknots += color_knot->nknots;
- if (normal_knot->unified_knot)
- max_nknots += normal_knot->nknots;
- if (texture_knot->unified_knot)
- max_nknots += texture_knot->nknots;
- maximal_min_knot = (geom_knot->knot)[geom_knot->t_min];
- minimal_max_knot = (geom_knot->knot)[geom_knot->t_max];
- /* any attirb data ? */
- if (max_nknots != geom_knot->nknots) {
- /* allocate space for the unified knots */
- if ((geom_knot->unified_knot =
- (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) {
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- /* copy the original knot to the unified one */
- geom_knot->unified_nknots = geom_knot->nknots;
- for (i = 0; i < geom_knot->nknots; i++)
- (geom_knot->unified_knot)[i] = (geom_knot->knot)[i];
- if (color_knot->unified_knot) {
- if ((color_knot->knot)[color_knot->t_min] - maximal_min_knot >
- EPSILON)
- maximal_min_knot = (color_knot->knot)[color_knot->t_min];
- if (minimal_max_knot - (color_knot->knot)[color_knot->t_max] >
- EPSILON)
- minimal_max_knot = (color_knot->knot)[color_knot->t_max];
- if ((color_knot->unified_knot =
- (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) {
- free(geom_knot->unified_knot);
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- /* copy the original knot to the unified one */
- color_knot->unified_nknots = color_knot->nknots;
- for (i = 0; i < color_knot->nknots; i++)
- (color_knot->unified_knot)[i] = (color_knot->knot)[i];
- }
- if (normal_knot->unified_knot) {
- if ((normal_knot->knot)[normal_knot->t_min] - maximal_min_knot >
- EPSILON)
- maximal_min_knot = (normal_knot->knot)[normal_knot->t_min];
- if (minimal_max_knot - (normal_knot->knot)[normal_knot->t_max] >
- EPSILON)
- minimal_max_knot = (normal_knot->knot)[normal_knot->t_max];
- if ((normal_knot->unified_knot =
- (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) {
- free(geom_knot->unified_knot);
- free(color_knot->unified_knot);
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- /* copy the original knot to the unified one */
- normal_knot->unified_nknots = normal_knot->nknots;
- for (i = 0; i < normal_knot->nknots; i++)
- (normal_knot->unified_knot)[i] = (normal_knot->knot)[i];
- }
- if (texture_knot->unified_knot) {
- if ((texture_knot->knot)[texture_knot->t_min] - maximal_min_knot >
- EPSILON)
- maximal_min_knot = (texture_knot->knot)[texture_knot->t_min];
- if (minimal_max_knot - (texture_knot->knot)[texture_knot->t_max] >
- EPSILON)
- minimal_max_knot = (texture_knot->knot)[texture_knot->t_max];
- if ((texture_knot->unified_knot =
- (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) {
- free(geom_knot->unified_knot);
- free(color_knot->unified_knot);
- free(normal_knot->unified_knot);
- call_user_error(nobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- /* copy the original knot to the unified one */
- texture_knot->unified_nknots = texture_knot->nknots;
- for (i = 0; i < texture_knot->nknots; i++)
- (texture_knot->unified_knot)[i] = (texture_knot->knot)[i];
- }
- /* work on the geometry knot with all additional knot values */
- /* appearing in attirbutive knots */
- if (minimal_max_knot - maximal_min_knot < EPSILON) {
- /* empty working range */
- geom_knot->unified_nknots = 0;
- color_knot->unified_nknots = 0;
- normal_knot->unified_nknots = 0;
- texture_knot->unified_nknots = 0;
- }
- else {
- if (color_knot->unified_knot)
- collect_unified_knot(geom_knot, color_knot, maximal_min_knot,
- minimal_max_knot);
- if (normal_knot->unified_knot)
- collect_unified_knot(geom_knot, normal_knot, maximal_min_knot,
- minimal_max_knot);
- if (texture_knot->unified_knot)
- collect_unified_knot(geom_knot, texture_knot, maximal_min_knot,
- minimal_max_knot);
- /* since we have now built the "unified" geometry knot */
- /* add same knot values to all attributive knots */
- if (color_knot->unified_knot)
- collect_unified_knot(color_knot, geom_knot, maximal_min_knot,
- minimal_max_knot);
- if (normal_knot->unified_knot)
- collect_unified_knot(normal_knot, geom_knot, maximal_min_knot,
- minimal_max_knot);
- if (texture_knot->unified_knot)
- collect_unified_knot(texture_knot, geom_knot, maximal_min_knot,
- minimal_max_knot);
- }
- }
- set_new_t_min_t_max(geom_knot, color_knot, normal_knot, texture_knot,
- maximal_min_knot, minimal_max_knot);
- return GLU_NO_ERROR;
-}
-
-void
-free_unified_knots(knot_str_type * geom_knot, knot_str_type * color_knot,
- knot_str_type * normal_knot, knot_str_type * texture_knot)
-{
- if (geom_knot->unified_knot)
- free(geom_knot->unified_knot);
- if (color_knot->unified_knot)
- free(color_knot->unified_knot);
- if (normal_knot->unified_knot)
- free(normal_knot->unified_knot);
- if (texture_knot->unified_knot)
- free(texture_knot->unified_knot);
-}
-
-GLenum explode_knot(knot_str_type * the_knot)
-{
- GLfloat *knot, *new_knot;
- GLint nknots, n_new_knots = 0;
- GLint t_min, t_max;
- GLint ord;
- GLsizei i, j, k;
- GLfloat tmp_float;
-
- if (the_knot->unified_knot) {
- knot = the_knot->unified_knot;
- nknots = the_knot->unified_nknots;
- }
- else {
- knot = the_knot->knot;
- nknots = the_knot->nknots;
- }
- ord = the_knot->order;
- t_min = the_knot->t_min;
- t_max = the_knot->t_max;
-
- for (i = t_min; i <= t_max;) {
- tmp_float = knot[i];
- for (j = 0; j < ord && (i + j) <= t_max; j++)
- if (fabs(tmp_float - knot[i + j]) > EPSILON)
- break;
- n_new_knots += ord - j;
- i += j;
- }
- /* alloc space for new_knot */
- if (
- (new_knot =
- (GLfloat *) malloc(sizeof(GLfloat) * (nknots + n_new_knots + 1))) == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- /* fill in new knot */
- for (j = 0; j < t_min; j++)
- new_knot[j] = knot[j];
- for (i = j; i <= t_max; i++) {
- tmp_float = knot[i];
- for (k = 0; k < ord; k++) {
- new_knot[j++] = knot[i];
- if (tmp_float == knot[i + 1])
- i++;
- }
- }
- for (i = t_max + 1; i < (int) nknots; i++)
- new_knot[j++] = knot[i];
- /* fill in the knot structure */
- the_knot->new_knot = new_knot;
- the_knot->delta_nknots += n_new_knots;
- the_knot->t_max += n_new_knots;
- return GLU_NO_ERROR;
-}
-
-GLenum calc_alphas(knot_str_type * the_knot)
-{
- GLfloat tmp_float;
- int i, j, k, m, n;
- int order;
- GLfloat *alpha, *alpha_new, *tmp_alpha;
- GLfloat denom;
- GLfloat *knot, *new_knot;
-
-
- knot = the_knot->knot;
- order = the_knot->order;
- new_knot = the_knot->new_knot;
- n = the_knot->nknots - the_knot->order;
- m = n + the_knot->delta_nknots;
- if ((alpha = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- if ((alpha_new = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) {
- free(alpha);
- return GLU_OUT_OF_MEMORY;
- }
- for (j = 0; j < m; j++) {
- for (i = 0; i < n; i++) {
- if ((knot[i] <= new_knot[j]) && (new_knot[j] < knot[i + 1]))
- tmp_float = 1.0;
- else
- tmp_float = 0.0;
- alpha[i + j * n] = tmp_float;
- }
- }
- for (k = 1; k < order; k++) {
- for (j = 0; j < m; j++)
- for (i = 0; i < n; i++) {
- denom = knot[i + k] - knot[i];
- if (fabs(denom) < EPSILON)
- tmp_float = 0.0;
- else
- tmp_float = (new_knot[j + k] - knot[i]) / denom *
- alpha[i + j * n];
- denom = knot[i + k + 1] - knot[i + 1];
- if (fabs(denom) > EPSILON)
- tmp_float += (knot[i + k + 1] - new_knot[j + k]) / denom *
- alpha[(i + 1) + j * n];
- alpha_new[i + j * n] = tmp_float;
- }
- tmp_alpha = alpha_new;
- alpha_new = alpha;
- alpha = tmp_alpha;
- }
- the_knot->alpha = alpha;
- free(alpha_new);
- return GLU_NO_ERROR;
-}
-
-GLenum
-calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, knot_str_type * the_knot,
- GLint dim, GLfloat ** new_ctrl, GLint * ncontrol)
-{
- GLsizei i, j, k, l, m, n;
- GLsizei index1, index2;
- GLfloat *alpha;
- GLfloat *new_knot;
-
- new_knot = the_knot->new_knot;
- n = the_knot->nknots - the_knot->order;
- alpha = the_knot->alpha;
-
- m = the_knot->t_max + 1 - the_knot->t_min - the_knot->order;
- k = the_knot->t_min;
- /* allocate space for new control points */
- if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * dim * m)) == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- for (j = 0; j < m; j++) {
- for (l = 0; l < dim; l++)
- (*new_ctrl)[j * dim + l] = 0.0;
- for (i = 0; i < n; i++) {
- index1 = i + (j + k) * n;
- index2 = i * stride;
- for (l = 0; l < dim; l++)
- (*new_ctrl)[j * dim + l] += alpha[index1] * ctrl[index2 + l];
- }
- }
- *ncontrol = (GLint) m;
- return GLU_NO_ERROR;
-}
-
-static GLint
-calc_factor(GLfloat * pts, GLint order, GLint indx, GLint stride,
- GLfloat tolerance, GLint dim)
-{
- GLdouble model[16], proj[16];
- GLint viewport[4];
- GLdouble x, y, z, w, winx1, winy1, winz, winx2, winy2;
- GLint i;
- GLdouble len, dx, dy;
-
- glGetDoublev(GL_MODELVIEW_MATRIX, model);
- glGetDoublev(GL_PROJECTION_MATRIX, proj);
- glGetIntegerv(GL_VIEWPORT, viewport);
- if (dim == 4) {
- w = (GLdouble) pts[indx + 3];
- x = (GLdouble) pts[indx] / w;
- y = (GLdouble) pts[indx + 1] / w;
- z = (GLdouble) pts[indx + 2] / w;
- gluProject(x, y, z, model, proj, viewport, &winx1, &winy1, &winz);
- len = 0.0;
- for (i = 1; i < order; i++) {
- w = (GLdouble) pts[indx + i * stride + 3];
- x = (GLdouble) pts[indx + i * stride] / w;
- y = (GLdouble) pts[indx + i * stride + 1] / w;
- z = (GLdouble) pts[indx + i * stride + 2] / w;
- if (gluProject
- (x, y, z, model, proj, viewport, &winx2, &winy2, &winz)) {
- dx = winx2 - winx1;
- dy = winy2 - winy1;
- len += sqrt(dx * dx + dy * dy);
- }
- winx1 = winx2;
- winy1 = winy2;
- }
- }
- else {
- x = (GLdouble) pts[indx];
- y = (GLdouble) pts[indx + 1];
- if (dim == 2)
- z = 0.0;
- else
- z = (GLdouble) pts[indx + 2];
- gluProject(x, y, z, model, proj, viewport, &winx1, &winy1, &winz);
- len = 0.0;
- for (i = 1; i < order; i++) {
- x = (GLdouble) pts[indx + i * stride];
- y = (GLdouble) pts[indx + i * stride + 1];
- if (dim == 2)
- z = 0.0;
- else
- z = (GLdouble) pts[indx + i * stride + 2];
- if (gluProject
- (x, y, z, model, proj, viewport, &winx2, &winy2, &winz)) {
- dx = winx2 - winx1;
- dy = winy2 - winy1;
- len += sqrt(dx * dx + dy * dy);
- }
- winx1 = winx2;
- winy1 = winy2;
- }
- }
- len /= tolerance;
- return ((GLint) len + 1);
-}
-
-/* we can't use the Mesa evaluators - no way to get the point coords */
-/* so we use our own Bezier point calculus routines */
-/* because I'm lazy, I reuse the ones from eval.c */
-
-static void
-bezier_curve(GLfloat * cp, GLfloat * out, GLfloat t,
- GLuint dim, GLuint order, GLint offset)
-{
- GLfloat s, powert;
- GLuint i, k, bincoeff;
-
- if (order >= 2) {
- bincoeff = order - 1;
- s = 1.0 - t;
-
- for (k = 0; k < dim; k++)
- out[k] = s * cp[k] + bincoeff * t * cp[offset + k];
-
- for (i = 2, cp += 2 * offset, powert = t * t; i < order;
- i++, powert *= t, cp += offset) {
- bincoeff *= order - i;
- bincoeff /= i;
-
- for (k = 0; k < dim; k++)
- out[k] = s * out[k] + bincoeff * powert * cp[k];
- }
- }
- else { /* order=1 -> constant curve */
-
- for (k = 0; k < dim; k++)
- out[k] = cp[k];
- }
-}
-
-static GLint
-calc_parametric_factor(GLfloat * pts, GLint order, GLint indx, GLint stride,
- GLfloat tolerance, GLint dim)
-{
- GLdouble model[16], proj[16];
- GLint viewport[4];
- GLdouble x, y, z, w, x1, y1, z1, x2, y2, z2, x3, y3, z3;
- GLint i;
- GLint P;
- GLfloat bez_pt[4];
- GLdouble len = 0.0, tmp, z_med;
-
- P = 2 * (order + 2);
- glGetDoublev(GL_MODELVIEW_MATRIX, model);
- glGetDoublev(GL_PROJECTION_MATRIX, proj);
- glGetIntegerv(GL_VIEWPORT, viewport);
- z_med = (viewport[2] + viewport[3]) * 0.5;
- switch (dim) {
- case 4:
- for (i = 1; i < P; i++) {
- bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 4,
- order, stride);
- w = (GLdouble) bez_pt[3];
- x = (GLdouble) bez_pt[0] / w;
- y = (GLdouble) bez_pt[1] / w;
- z = (GLdouble) bez_pt[2] / w;
- gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3);
- z3 *= z_med;
- bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 4,
- order, stride);
- w = (GLdouble) bez_pt[3];
- x = (GLdouble) bez_pt[0] / w;
- y = (GLdouble) bez_pt[1] / w;
- z = (GLdouble) bez_pt[2] / w;
- gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1);
- z1 *= z_med;
- bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 4,
- order, stride);
- w = (GLdouble) bez_pt[3];
- x = (GLdouble) bez_pt[0] / w;
- y = (GLdouble) bez_pt[1] / w;
- z = (GLdouble) bez_pt[2] / w;
- gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2);
- z2 *= z_med;
- /* calc distance between point (x3,y3,z3) and line segment */
- /* <x1,y1,z1><x2,y2,z2> */
- x = x2 - x1;
- y = y2 - y1;
- z = z2 - z1;
- tmp = sqrt(x * x + y * y + z * z);
- x /= tmp;
- y /= tmp;
- z /= tmp;
- tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z;
- x = x1 + x * tmp - x3;
- y = y1 + y * tmp - y3;
- z = z1 + z * tmp - z3;
- tmp = sqrt(x * x + y * y + z * z);
- if (tmp > len)
- len = tmp;
- }
- break;
- case 3:
- for (i = 1; i < P; i++) {
- bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 3,
- order, stride);
- x = (GLdouble) bez_pt[0];
- y = (GLdouble) bez_pt[1];
- z = (GLdouble) bez_pt[2];
- gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3);
- z3 *= z_med;
- bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 3,
- order, stride);
- x = (GLdouble) bez_pt[0];
- y = (GLdouble) bez_pt[1];
- z = (GLdouble) bez_pt[2];
- gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1);
- z1 *= z_med;
- bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 3,
- order, stride);
- x = (GLdouble) bez_pt[0];
- y = (GLdouble) bez_pt[1];
- z = (GLdouble) bez_pt[2];
- gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2);
- z2 *= z_med;
- /* calc distance between point (x3,y3,z3) and line segment */
- /* <x1,y1,z1><x2,y2,z2> */
- x = x2 - x1;
- y = y2 - y1;
- z = z2 - z1;
- tmp = sqrt(x * x + y * y + z * z);
- x /= tmp;
- y /= tmp;
- z /= tmp;
- tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z;
- x = x1 + x * tmp - x3;
- y = y1 + y * tmp - y3;
- z = z1 + z * tmp - z3;
- tmp = sqrt(x * x + y * y + z * z);
- if (tmp > len)
- len = tmp;
- }
- break;
- case 2:
- for (i = 1; i < P; i++) {
- bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 2,
- order, stride);
- x = (GLdouble) bez_pt[0];
- y = (GLdouble) bez_pt[1];
- z = 0.0;
- gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3);
- z3 *= z_med;
- bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 2,
- order, stride);
- x = (GLdouble) bez_pt[0];
- y = (GLdouble) bez_pt[1];
- z = 0.0;
- gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1);
- z1 *= z_med;
- bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 2,
- order, stride);
- x = (GLdouble) bez_pt[0];
- y = (GLdouble) bez_pt[1];
- z = 0.0;
- gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2);
- z2 *= z_med;
- /* calc distance between point (x3,y3,z3) and line segment */
- /* <x1,y1,z1><x2,y2,z2> */
- x = x2 - x1;
- y = y2 - y1;
- z = z2 - z1;
- tmp = sqrt(x * x + y * y + z * z);
- x /= tmp;
- y /= tmp;
- z /= tmp;
- tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z;
- x = x1 + x * tmp - x3;
- y = y1 + y * tmp - y3;
- z = z1 + z * tmp - z3;
- tmp = sqrt(x * x + y * y + z * z);
- if (tmp > len)
- len = tmp;
- }
- break;
-
- }
- if (len < tolerance)
- return (order);
- else
- return (GLint) (sqrt(len / tolerance) * (order + 2) + 1);
-}
-
-static GLenum
-calc_sampling_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim,
- GLint uorder, GLint vorder, GLint ** ufactors,
- GLint ** vfactors)
-{
- GLfloat *ctrl;
- GLint tmp_factor1, tmp_factor2;
- GLint ufactor_cnt, vfactor_cnt;
- GLint offset1, offset2, offset3;
- GLint i, j;
-
- ufactor_cnt = new_ctrl->s_bezier_cnt;
- vfactor_cnt = new_ctrl->t_bezier_cnt;
- if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3))
- == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3))
- == NULL) {
- free(*ufactors);
- return GLU_OUT_OF_MEMORY;
- }
- ctrl = new_ctrl->geom_ctrl;
- offset1 = new_ctrl->geom_t_stride * vorder;
- offset2 = new_ctrl->geom_s_stride * uorder;
- for (j = 0; j < vfactor_cnt; j++) {
- *(*vfactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, vorder,
- j * offset1, dim,
- tolerance, dim);
- /* loop ufactor_cnt-1 times */
- for (i = 1; i < ufactor_cnt; i++) {
- tmp_factor2 = calc_factor(ctrl, vorder,
- j * offset1 + i * offset2, dim, tolerance,
- dim);
- if (tmp_factor2 > tmp_factor1)
- tmp_factor1 = tmp_factor2;
- }
- /* last time for the opposite edge */
- *(*vfactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, vorder,
- j * offset1 +
- i * offset2 -
- new_ctrl->
- geom_s_stride, dim,
- tolerance, dim);
- if (tmp_factor2 > tmp_factor1)
- *(*vfactors + j * 3) = tmp_factor2;
- else
- *(*vfactors + j * 3) = tmp_factor1;
- }
- offset3 = new_ctrl->geom_s_stride;
- offset2 = new_ctrl->geom_s_stride * uorder;
- for (j = 0; j < ufactor_cnt; j++) {
- *(*ufactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, uorder,
- j * offset2,
- offset3, tolerance,
- dim);
- /* loop vfactor_cnt-1 times */
- for (i = 1; i < vfactor_cnt; i++) {
- tmp_factor2 = calc_factor(ctrl, uorder,
- j * offset2 + i * offset1, offset3,
- tolerance, dim);
- if (tmp_factor2 > tmp_factor1)
- tmp_factor1 = tmp_factor2;
- }
- /* last time for the opposite edge */
- *(*ufactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, uorder,
- j * offset2 +
- i * offset1 -
- new_ctrl->
- geom_t_stride,
- offset3, tolerance,
- dim);
- if (tmp_factor2 > tmp_factor1)
- *(*ufactors + j * 3) = tmp_factor2;
- else
- *(*ufactors + j * 3) = tmp_factor1;
- }
- return GL_NO_ERROR;
-}
-
-static GLenum
-calc_sampling_param_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim,
- GLint uorder, GLint vorder, GLint ** ufactors,
- GLint ** vfactors)
-{
- GLfloat *ctrl;
- GLint tmp_factor1, tmp_factor2;
- GLint ufactor_cnt, vfactor_cnt;
- GLint offset1, offset2, offset3;
- GLint i, j;
-
- ufactor_cnt = new_ctrl->s_bezier_cnt;
- vfactor_cnt = new_ctrl->t_bezier_cnt;
- if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3))
- == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3))
- == NULL) {
- free(*ufactors);
- return GLU_OUT_OF_MEMORY;
- }
- ctrl = new_ctrl->geom_ctrl;
- offset1 = new_ctrl->geom_t_stride * vorder;
- offset2 = new_ctrl->geom_s_stride * uorder;
- for (j = 0; j < vfactor_cnt; j++) {
- *(*vfactors + j * 3 + 1) = tmp_factor1 =
- calc_parametric_factor(ctrl, vorder, j * offset1, dim, tolerance,
- dim);
- /* loop ufactor_cnt-1 times */
- for (i = 1; i < ufactor_cnt; i++) {
- tmp_factor2 = calc_parametric_factor(ctrl, vorder,
- j * offset1 + i * offset2, dim,
- tolerance, dim);
- if (tmp_factor2 > tmp_factor1)
- tmp_factor1 = tmp_factor2;
- }
- /* last time for the opposite edge */
- *(*vfactors + j * 3 + 2) = tmp_factor2 =
- calc_parametric_factor(ctrl, vorder,
- j * offset1 + i * offset2 -
- new_ctrl->geom_s_stride, dim, tolerance, dim);
- if (tmp_factor2 > tmp_factor1)
- *(*vfactors + j * 3) = tmp_factor2;
- else
- *(*vfactors + j * 3) = tmp_factor1;
- }
- offset3 = new_ctrl->geom_s_stride;
- offset2 = new_ctrl->geom_s_stride * uorder;
- for (j = 0; j < ufactor_cnt; j++) {
- *(*ufactors + j * 3 + 1) = tmp_factor1 =
- calc_parametric_factor(ctrl, uorder, j * offset2, offset3, tolerance,
- dim);
- /* loop vfactor_cnt-1 times */
- for (i = 1; i < vfactor_cnt; i++) {
- tmp_factor2 = calc_parametric_factor(ctrl, uorder,
- j * offset2 + i * offset1,
- offset3, tolerance, dim);
- if (tmp_factor2 > tmp_factor1)
- tmp_factor1 = tmp_factor2;
- }
- /* last time for the opposite edge */
- *(*ufactors + j * 3 + 2) = tmp_factor2 =
- calc_parametric_factor(ctrl, uorder,
- j * offset2 + i * offset1 -
- new_ctrl->geom_t_stride, offset3, tolerance,
- dim);
- if (tmp_factor2 > tmp_factor1)
- *(*ufactors + j * 3) = tmp_factor2;
- else
- *(*ufactors + j * 3) = tmp_factor1;
- }
- return GL_NO_ERROR;
-}
-
-static GLenum
-calc_sampling_2D(GLfloat * ctrl, GLint cnt, GLint order,
- GLfloat tolerance, GLint dim, GLint ** factors)
-{
- GLint factor_cnt;
- GLint tmp_factor;
- GLint offset;
- GLint i;
-
- factor_cnt = cnt / order;
- if ((*factors = (GLint *) malloc(sizeof(GLint) * factor_cnt)) == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- offset = order * dim;
- for (i = 0; i < factor_cnt; i++) {
- tmp_factor = calc_factor(ctrl, order, i * offset, dim, tolerance, dim);
- if (tmp_factor == 0)
- (*factors)[i] = 1;
- else
- (*factors)[i] = tmp_factor;
- }
- return GL_NO_ERROR;
-}
-
-static void
-set_sampling_and_culling(GLUnurbsObj * nobj)
-{
- if (nobj->auto_load_matrix == GL_FALSE) {
- GLint i;
- GLfloat m[4];
-
- glPushAttrib((GLbitfield) (GL_VIEWPORT_BIT | GL_TRANSFORM_BIT));
- for (i = 0; i < 4; i++)
- m[i] = nobj->sampling_matrices.viewport[i];
- glViewport(m[0], m[1], m[2], m[3]);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadMatrixf(nobj->sampling_matrices.proj);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadMatrixf(nobj->sampling_matrices.model);
- }
-}
-
-static void
-revert_sampling_and_culling(GLUnurbsObj * nobj)
-{
- if (nobj->auto_load_matrix == GL_FALSE) {
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glPopAttrib();
- }
-}
-
-GLenum
-glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- GLint ** sfactors, GLint ** tfactors)
-{
- GLint dim;
- GLenum err;
-
- *sfactors = NULL;
- *tfactors = NULL;
- dim = nobj->surface.geom.dim;
- set_sampling_and_culling(nobj);
- if ((err = calc_sampling_3D(new_ctrl, nobj->sampling_tolerance, dim,
- nobj->surface.geom.sorder,
- nobj->surface.geom.torder, sfactors,
- tfactors)) == GLU_ERROR) {
- revert_sampling_and_culling(nobj);
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- revert_sampling_and_culling(nobj);
- return GLU_NO_ERROR;
-}
-
-GLenum
-glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- GLint ** sfactors, GLint ** tfactors)
-{
- GLint s_cnt, t_cnt, i;
- GLint u_steps, v_steps;
-
- s_cnt = new_ctrl->s_bezier_cnt;
- t_cnt = new_ctrl->t_bezier_cnt;
- *sfactors = NULL;
- *tfactors = NULL;
- if ((*sfactors = (GLint *) malloc(sizeof(GLint) * s_cnt * 3))
- == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- if ((*tfactors = (GLint *) malloc(sizeof(GLint) * t_cnt * 3))
- == NULL) {
- free(*sfactors);
- return GLU_OUT_OF_MEMORY;
- }
- u_steps = nobj->u_step;
- v_steps = nobj->v_step;
- for (i = 0; i < s_cnt; i++) {
- *(*sfactors + i * 3) = u_steps;
- *(*sfactors + i * 3 + 1) = u_steps;
- *(*sfactors + i * 3 + 2) = u_steps;
- }
- for (i = 0; i < t_cnt; i++) {
- *(*tfactors + i * 3) = v_steps;
- *(*tfactors + i * 3 + 1) = v_steps;
- *(*tfactors + i * 3 + 2) = v_steps;
- }
- return GLU_NO_ERROR;
-}
-
-
-GLenum
-glu_do_sampling_param_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- GLint ** sfactors, GLint ** tfactors)
-{
- GLint dim;
- GLenum err;
-
- *sfactors = NULL;
- *tfactors = NULL;
- dim = nobj->surface.geom.dim;
- set_sampling_and_culling(nobj);
- if (
- (err =
- calc_sampling_param_3D(new_ctrl, nobj->parametric_tolerance, dim,
- nobj->surface.geom.sorder,
- nobj->surface.geom.torder, sfactors,
- tfactors)) == GLU_ERROR) {
- revert_sampling_and_culling(nobj);
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- revert_sampling_and_culling(nobj);
- return GLU_NO_ERROR;
-}
-
-
-static GLenum
-glu_do_sampling_2D(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order,
- GLint dim, GLint ** factors)
-{
- GLenum err;
-
- set_sampling_and_culling(nobj);
- err = calc_sampling_2D(ctrl, cnt, order, nobj->sampling_tolerance, dim,
- factors);
- revert_sampling_and_culling(nobj);
- return err;
-}
-
-
-static GLenum
-glu_do_sampling_u(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order,
- GLint dim, GLint ** factors)
-{
- GLint i;
- GLint u_steps;
-
- cnt /= order;
- if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt))
- == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- u_steps = nobj->u_step;
- for (i = 0; i < cnt; i++)
- (*factors)[i] = u_steps;
- return GLU_NO_ERROR;
-}
-
-
-static GLenum
-glu_do_sampling_param_2D(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt,
- GLint order, GLint dim, GLint ** factors)
-{
- GLint i;
- GLint u_steps;
- GLfloat tolerance;
-
- set_sampling_and_culling(nobj);
- tolerance = nobj->parametric_tolerance;
- cnt /= order;
- if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt))
- == NULL) {
- revert_sampling_and_culling(nobj);
- return GLU_OUT_OF_MEMORY;
- }
- u_steps = nobj->u_step;
- for (i = 0; i < cnt; i++) {
- (*factors)[i] = calc_parametric_factor(ctrl, order, 0,
- dim, tolerance, dim);
-
- }
- revert_sampling_and_culling(nobj);
- return GLU_NO_ERROR;
-}
-
-GLenum
-glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt,
- GLint order, GLint dim, GLint ** factors)
-{
- GLenum err;
-
- *factors = NULL;
- switch (nobj->sampling_method) {
- case GLU_PATH_LENGTH:
- if ((err = glu_do_sampling_2D(nobj, ctrl, cnt, order, dim, factors)) !=
- GLU_NO_ERROR) {
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- break;
- case GLU_DOMAIN_DISTANCE:
- if ((err = glu_do_sampling_u(nobj, ctrl, cnt, order, dim, factors)) !=
- GLU_NO_ERROR) {
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- break;
- case GLU_PARAMETRIC_ERROR:
- if (
- (err =
- glu_do_sampling_param_2D(nobj, ctrl, cnt, order, dim,
- factors)) != GLU_NO_ERROR) {
- call_user_error(nobj, err);
- return GLU_ERROR;
- }
- break;
- default:
- abort();
- }
-
- return GLU_NO_ERROR;
-}
-
-/* TODO - i don't like this culling - this one just tests if at least one */
-/* ctrl point lies within the viewport . Also the point_in_viewport() */
-/* should be included in the fnctions for efficiency reasons */
-
-static GLboolean
-point_in_viewport(GLfloat * pt, GLint dim)
-{
- GLdouble model[16], proj[16];
- GLint viewport[4];
- GLdouble x, y, z, w, winx, winy, winz;
-
- glGetDoublev(GL_MODELVIEW_MATRIX, model);
- glGetDoublev(GL_PROJECTION_MATRIX, proj);
- glGetIntegerv(GL_VIEWPORT, viewport);
- if (dim == 3) {
- x = (GLdouble) pt[0];
- y = (GLdouble) pt[1];
- z = (GLdouble) pt[2];
- gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz);
- }
- else {
- w = (GLdouble) pt[3];
- x = (GLdouble) pt[0] / w;
- y = (GLdouble) pt[1] / w;
- z = (GLdouble) pt[2] / w;
- gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz);
- }
- if ((GLint) winx >= viewport[0] && (GLint) winx < viewport[2] &&
- (GLint) winy >= viewport[1] && (GLint) winy < viewport[3])
- return GL_TRUE;
- return GL_FALSE;
-}
-
-GLboolean
-fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * pts, GLint s_cnt,
- GLint t_cnt, GLint s_stride, GLint t_stride, GLint dim)
-{
- GLint i, j;
-
- if (nobj->culling == GL_FALSE)
- return GL_FALSE;
- set_sampling_and_culling(nobj);
-
- if (dim == 3) {
- for (i = 0; i < s_cnt; i++)
- for (j = 0; j < t_cnt; j++)
- if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) {
- revert_sampling_and_culling(nobj);
- return GL_FALSE;
- }
- }
- else {
- for (i = 0; i < s_cnt; i++)
- for (j = 0; j < t_cnt; j++)
- if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) {
- revert_sampling_and_culling(nobj);
- return GL_FALSE;
- }
- }
- revert_sampling_and_culling(nobj);
- return GL_TRUE;
-}
-
-/*GLboolean
-fine_culling_test_3D(GLUnurbsObj *nobj,GLfloat *pts,GLint s_cnt,GLint t_cnt,
- GLint s_stride,GLint t_stride, GLint dim)
-{
- GLint visible_cnt;
- GLfloat feedback_buffer[5];
- GLsizei buffer_size;
- GLint i,j;
-
- if(nobj->culling==GL_FALSE)
- return GL_FALSE;
- buffer_size=5;
- set_sampling_and_culling(nobj);
-
- glFeedbackBuffer(buffer_size,GL_2D,feedback_buffer);
- glRenderMode(GL_FEEDBACK);
- if(dim==3)
- {
- for(i=0;i<s_cnt;i++)
- {
- glBegin(GL_LINE_LOOP);
- for(j=0;j<t_cnt;j++)
- glVertex3fv(pts+i*s_stride+j*t_stride);
- glEnd();
- }
- for(j=0;j<t_cnt;j++)
- {
- glBegin(GL_LINE_LOOP);
- for(i=0;i<s_cnt;i++)
- glVertex3fv(pts+i*s_stride+j*t_stride);
- glEnd();
- }
- }
- else
- {
- for(i=0;i<s_cnt;i++)
- {
- glBegin(GL_LINE_LOOP);
- for(j=0;j<t_cnt;j++)
- glVertex4fv(pts+i*s_stride+j*t_stride);
- glEnd();
- }
- for(j=0;j<t_cnt;j++)
- {
- glBegin(GL_LINE_LOOP);
- for(i=0;i<s_cnt;i++)
- glVertex4fv(pts+i*s_stride+j*t_stride);
- glEnd();
- }
- }
- visible_cnt=glRenderMode(GL_RENDER);
-
- revert_sampling_and_culling(nobj);
- return (GLboolean)(visible_cnt==0);
-}*/
-
-GLboolean
-fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * pts, GLint cnt,
- GLint stride, GLint dim)
-{
- GLint i;
-
- if (nobj->culling == GL_FALSE)
- return GL_FALSE;
- set_sampling_and_culling(nobj);
-
- if (dim == 3) {
- for (i = 0; i < cnt; i++)
- if (point_in_viewport(pts + i * stride, dim)) {
- revert_sampling_and_culling(nobj);
- return GL_FALSE;
- }
- }
- else {
- for (i = 0; i < cnt; i++)
- if (point_in_viewport(pts + i * stride, dim)) {
- revert_sampling_and_culling(nobj);
- return GL_FALSE;
- }
- }
- revert_sampling_and_culling(nobj);
- return GL_TRUE;
-}
-
-/*GLboolean
-fine_culling_test_2D(GLUnurbsObj *nobj,GLfloat *pts,GLint cnt,
- GLint stride, GLint dim)
-{
- GLint visible_cnt;
- GLfloat feedback_buffer[5];
- GLsizei buffer_size;
- GLint i;
-
- if(nobj->culling==GL_FALSE)
- return GL_FALSE;
- buffer_size=5;
- set_sampling_and_culling(nobj);
-
- glFeedbackBuffer(buffer_size,GL_2D,feedback_buffer);
- glRenderMode(GL_FEEDBACK);
- glBegin(GL_LINE_LOOP);
- if(dim==3)
- {
- for(i=0;i<cnt;i++)
- glVertex3fv(pts+i*stride);
- }
- else
- {
- for(i=0;i<cnt;i++)
- glVertex4fv(pts+i*stride);
- }
- glEnd();
- visible_cnt=glRenderMode(GL_RENDER);
-
- revert_sampling_and_culling(nobj);
- return (GLboolean)(visible_cnt==0);
-}*/
diff --git a/src/glu/mesa/polytest.c b/src/glu/mesa/polytest.c
deleted file mode 100644
index 1ff966f61ce..00000000000
--- a/src/glu/mesa/polytest.c
+++ /dev/null
@@ -1,937 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include "gluP.h"
-#include "tess.h"
-#endif
-
-
-
-static GLenum store_polygon_as_contour(GLUtriangulatorObj *);
-static void free_current_polygon(tess_polygon *);
-static void prepare_projection_info(GLUtriangulatorObj *);
-static GLdouble twice_the_polygon_area(tess_vertex *, tess_vertex *);
-static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *);
-void tess_find_contour_hierarchies(GLUtriangulatorObj *);
-static GLenum test_for_overlapping_contours(GLUtriangulatorObj *);
-static GLenum contours_overlap(tess_contour *, tess_polygon *);
-static GLenum is_contour_contained_in(tess_contour *, tess_contour *);
-static void add_new_exterior(GLUtriangulatorObj *, tess_contour *);
-static void add_new_interior(GLUtriangulatorObj *, tess_contour *,
- tess_contour *);
-static void add_interior_with_hierarchy_check(GLUtriangulatorObj *,
- tess_contour *, tess_contour *);
-static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *,
- tess_contour *,
- tess_contour *);
-static GLboolean point_in_polygon(tess_contour *, GLdouble, GLdouble);
-static void shift_interior_to_exterior(GLUtriangulatorObj *, tess_contour *);
-static void add_exterior_with_check(GLUtriangulatorObj *, tess_contour *,
- tess_contour *);
-static GLenum cut_out_hole(GLUtriangulatorObj *, tess_contour *,
- tess_contour *);
-static GLenum merge_hole_with_contour(GLUtriangulatorObj *,
- tess_contour *, tess_contour *,
- tess_vertex *, tess_vertex *);
-
-static GLenum
-find_normal(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *va, *vb, *vc;
- GLdouble A, B, C;
- GLdouble A0, A1, A2, B0, B1, B2;
-
- va = polygon->vertices;
- vb = va->next;
- A0 = vb->location[0] - va->location[0];
- A1 = vb->location[1] - va->location[1];
- A2 = vb->location[2] - va->location[2];
- for (vc = vb->next; vc != va; vc = vc->next) {
- B0 = vc->location[0] - va->location[0];
- B1 = vc->location[1] - va->location[1];
- B2 = vc->location[2] - va->location[2];
- A = A1 * B2 - A2 * B1;
- B = A2 * B0 - A0 * B2;
- C = A0 * B1 - A1 * B0;
- if (fabs(A) > EPSILON || fabs(B) > EPSILON || fabs(C) > EPSILON) {
- polygon->A = A;
- polygon->B = B;
- polygon->C = C;
- polygon->D =
- -A * va->location[0] - B * va->location[1] - C * va->location[2];
- return GLU_NO_ERROR;
- }
- }
- tess_call_user_error(tobj, GLU_TESS_ERROR7);
- return GLU_ERROR;
-}
-
-void
-tess_test_polygon(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
-
- /* any vertices defined? */
- if (polygon->vertex_cnt < 3) {
- free_current_polygon(polygon);
- return;
- }
- /* wrap pointers */
- polygon->last_vertex->next = polygon->vertices;
- polygon->vertices->previous = polygon->last_vertex;
- /* determine the normal */
- if (find_normal(tobj) == GLU_ERROR)
- return;
- /* compare the normals of previously defined contours and this one */
- /* first contour define ? */
- if (tobj->contours == NULL) {
- tobj->A = polygon->A;
- tobj->B = polygon->B;
- tobj->C = polygon->C;
- tobj->D = polygon->D;
- /* determine the best projection to use */
- if (fabs(polygon->A) > fabs(polygon->B))
- if (fabs(polygon->A) > fabs(polygon->C))
- tobj->projection = OYZ;
- else
- tobj->projection = OXY;
- else if (fabs(polygon->B) > fabs(polygon->C))
- tobj->projection = OXZ;
- else
- tobj->projection = OXY;
- }
- else {
- GLdouble a[3], b[3];
- tess_vertex *vertex = polygon->vertices;
-
- a[0] = tobj->A;
- a[1] = tobj->B;
- a[2] = tobj->C;
- b[0] = polygon->A;
- b[1] = polygon->B;
- b[2] = polygon->C;
-
- /* compare the normals */
- if (fabs(a[1] * b[2] - a[2] * b[1]) > EPSILON ||
- fabs(a[2] * b[0] - a[0] * b[2]) > EPSILON ||
- fabs(a[0] * b[1] - a[1] * b[0]) > EPSILON) {
- /* not coplanar */
- tess_call_user_error(tobj, GLU_TESS_ERROR9);
- return;
- }
- /* the normals are parallel - test for plane equation */
- if (fabs(a[0] * vertex->location[0] + a[1] * vertex->location[1] +
- a[2] * vertex->location[2] + tobj->D) > EPSILON) {
- /* not the same plane */
- tess_call_user_error(tobj, GLU_TESS_ERROR9);
- return;
- }
- }
- prepare_projection_info(tobj);
- if (verify_edge_vertex_intersections(tobj) == GLU_ERROR)
- return;
- if (test_for_overlapping_contours(tobj) == GLU_ERROR)
- return;
- if (store_polygon_as_contour(tobj) == GLU_ERROR)
- return;
-}
-
-static GLenum
-test_for_overlapping_contours(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour;
- tess_polygon *polygon;
-
- polygon = tobj->current_polygon;
- for (contour = tobj->contours; contour != NULL; contour = contour->next)
- if (contours_overlap(contour, polygon) != GLU_NO_ERROR) {
- tess_call_user_error(tobj, GLU_TESS_ERROR5);
- return GLU_ERROR;
- }
- return GLU_NO_ERROR;
-}
-
-static GLenum
-store_polygon_as_contour(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_contour *contour = tobj->contours;
-
- /* the first contour defined */
- if (contour == NULL) {
- if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- free_current_polygon(polygon);
- return GLU_ERROR;
- }
- tobj->contours = tobj->last_contour = contour;
- contour->next = contour->previous = NULL;
- }
- else {
- if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- free_current_polygon(polygon);
- return GLU_ERROR;
- }
- contour->previous = tobj->last_contour;
- tobj->last_contour->next = contour;
- tobj->last_contour = contour;
- contour->next = NULL;
- }
- /* mark all vertices in new contour as not special */
- /* and all are boundary edges */
- {
- tess_vertex *vertex;
- GLuint vertex_cnt, i;
-
- for (vertex = polygon->vertices, i = 0, vertex_cnt =
- polygon->vertex_cnt; i < vertex_cnt; vertex = vertex->next, i++) {
- vertex->shadow_vertex = NULL;
- vertex->edge_flag = GL_TRUE;
- }
- }
- contour->vertex_cnt = polygon->vertex_cnt;
- contour->area = polygon->area;
- contour->orientation = polygon->orientation;
- contour->type = GLU_UNKNOWN;
- contour->vertices = polygon->vertices;
- contour->last_vertex = polygon->last_vertex;
- polygon->vertices = polygon->last_vertex = NULL;
- polygon->vertex_cnt = 0;
- ++(tobj->contour_cnt);
- return GLU_NO_ERROR;
-}
-
-static void
-free_current_polygon(tess_polygon * polygon)
-{
- tess_vertex *vertex, *vertex_tmp;
- GLuint i;
-
- /* free current_polygon structures */
- for (vertex = polygon->vertices, i = 0; i < polygon->vertex_cnt; i++) {
- vertex_tmp = vertex->next;
- free(vertex);
- vertex = vertex_tmp;
- }
- polygon->vertices = polygon->last_vertex = NULL;
- polygon->vertex_cnt = 0;
-}
-
-static void
-prepare_projection_info(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *vertex, *last_vertex_ptr;
- GLdouble area;
-
- last_vertex_ptr = polygon->last_vertex;
- switch (tobj->projection) {
- case OXY:
- for (vertex = polygon->vertices; vertex != last_vertex_ptr;
- vertex = vertex->next) {
- vertex->x = vertex->location[0];
- vertex->y = vertex->location[1];
- }
- last_vertex_ptr->x = last_vertex_ptr->location[0];
- last_vertex_ptr->y = last_vertex_ptr->location[1];
- break;
- case OXZ:
- for (vertex = polygon->vertices; vertex != last_vertex_ptr;
- vertex = vertex->next) {
- vertex->x = vertex->location[0];
- vertex->y = vertex->location[2];
- }
- last_vertex_ptr->x = last_vertex_ptr->location[0];
- last_vertex_ptr->y = last_vertex_ptr->location[2];
- break;
- case OYZ:
- for (vertex = polygon->vertices; vertex != last_vertex_ptr;
- vertex = vertex->next) {
- vertex->x = vertex->location[1];
- vertex->y = vertex->location[2];
- }
- last_vertex_ptr->x = last_vertex_ptr->location[1];
- last_vertex_ptr->y = last_vertex_ptr->location[2];
- break;
- }
- area = twice_the_polygon_area(polygon->vertices, polygon->last_vertex);
- if (area >= 0.0) {
- polygon->orientation = GLU_CCW;
- polygon->area = area;
- }
- else {
- polygon->orientation = GLU_CW;
- polygon->area = -area;
- }
-}
-
-static GLdouble
-twice_the_polygon_area(tess_vertex * vertex, tess_vertex * last_vertex)
-{
- tess_vertex *next;
- GLdouble area, x, y;
-
- area = 0.0;
- x = vertex->x;
- y = vertex->y;
- vertex = vertex->next;
- for (; vertex != last_vertex; vertex = vertex->next) {
- next = vertex->next;
- area +=
- (vertex->x - x) * (next->y - y) - (vertex->y - y) * (next->x - x);
- }
- return area;
-}
-
-/* test if edges ab and cd intersect */
-/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */
-/* else if adjacent return GLU_TESS_ERROR4 */
-static GLenum
-edge_edge_intersect(tess_vertex * a,
- tess_vertex * b, tess_vertex * c, tess_vertex * d)
-{
- GLdouble denom, r, s;
- GLdouble xba, ydc, yba, xdc, yac, xac;
-
- xba = b->x - a->x;
- yba = b->y - a->y;
- xdc = d->x - c->x;
- ydc = d->y - c->y;
- xac = a->x - c->x;
- yac = a->y - c->y;
- denom = xba * ydc - yba * xdc;
- r = yac * xdc - xac * ydc;
- /* parallel? */
- if (fabs(denom) < EPSILON) {
- if (fabs(r) < EPSILON) {
- /* colinear */
- if (fabs(xba) < EPSILON) {
- /* compare the Y coordinate */
- if (yba > 0.0) {
- if (
- (fabs(a->y - c->y) < EPSILON
- && fabs(c->y - b->y) < EPSILON)
- || (fabs(a->y - d->y) < EPSILON
- && fabs(d->y - b->y) <
- EPSILON)) return GLU_TESS_ERROR4;
-
- }
- else {
- if (
- (fabs(b->y - c->y) < EPSILON
- && fabs(c->y - a->y) < EPSILON)
- || (fabs(b->y - d->y) < EPSILON
- && fabs(d->y - a->y) <
- EPSILON)) return GLU_TESS_ERROR4;
- }
- }
- else {
- /* compare the X coordinate */
- if (xba > 0.0) {
- if (
- (fabs(a->x - c->x) < EPSILON
- && fabs(c->x - b->x) < EPSILON)
- || (fabs(a->x - d->x) < EPSILON
- && fabs(d->x - b->x) <
- EPSILON)) return GLU_TESS_ERROR4;
- }
- else {
- if (
- (fabs(b->x - c->x) < EPSILON
- && fabs(c->x - a->x) < EPSILON)
- || (fabs(b->x - d->x) < EPSILON
- && fabs(d->x - a->x) <
- EPSILON)) return GLU_TESS_ERROR4;
- }
- }
- }
- return GLU_NO_ERROR;
- }
- r /= denom;
- s = (yac * xba - xac * yba) / denom;
- /* test if one vertex lies on other edge */
- if (((fabs(r) < EPSILON || (r < 1.0 + EPSILON && r > 1.0 - EPSILON)) &&
- s > -EPSILON && s < 1.0 + EPSILON) ||
- ((fabs(s) < EPSILON || (s < 1.0 + EPSILON && s > 1.0 - EPSILON)) &&
- r > -EPSILON && r < 1.0 + EPSILON)) {
- return GLU_TESS_ERROR4;
- }
- /* test for crossing */
- if (r > -EPSILON && r < 1.0 + EPSILON && s > -EPSILON && s < 1.0 + EPSILON) {
- return GLU_TESS_ERROR8;
- }
- return GLU_NO_ERROR;
-}
-
-static GLenum
-verify_edge_vertex_intersections(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *vertex1, *last_vertex, *vertex2;
- GLenum test;
-
- last_vertex = polygon->last_vertex;
- vertex1 = last_vertex;
- for (vertex2 = vertex1->next->next;
- vertex2->next != last_vertex; vertex2 = vertex2->next) {
- test = edge_edge_intersect(vertex1, vertex1->next, vertex2,
- vertex2->next);
- if (test != GLU_NO_ERROR) {
- tess_call_user_error(tobj, test);
- return GLU_ERROR;
- }
- }
- for (vertex1 = polygon->vertices;
- vertex1->next->next != last_vertex; vertex1 = vertex1->next) {
- for (vertex2 = vertex1->next->next;
- vertex2 != last_vertex; vertex2 = vertex2->next) {
- test = edge_edge_intersect(vertex1, vertex1->next, vertex2,
- vertex2->next);
- if (test != GLU_NO_ERROR) {
- tess_call_user_error(tobj, test);
- return GLU_ERROR;
- }
- }
- }
- return GLU_NO_ERROR;
-}
-
-static int
-#ifdef WIN32
- __cdecl
-#endif
-area_compare(const void *a, const void *b)
-{
- GLdouble area1, area2;
-
- area1 = (*((tess_contour **) a))->area;
- area2 = (*((tess_contour **) b))->area;
- if (area1 < area2)
- return 1;
- if (area1 > area2)
- return -1;
- return 0;
-}
-
-void
-tess_find_contour_hierarchies(GLUtriangulatorObj * tobj)
-{
- tess_contour **contours; /* dinamic array of pointers */
- tess_contour *tmp_contour_ptr = tobj->contours;
- GLuint cnt, i;
- GLenum result;
- GLboolean hierarchy_changed;
-
- /* any contours? */
- if (tobj->contour_cnt < 2) {
- tobj->contours->type = GLU_EXTERIOR;
- return;
- }
- if ((contours = (tess_contour **)
- malloc(sizeof(tess_contour *) * (tobj->contour_cnt))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- for (tmp_contour_ptr = tobj->contours, cnt = 0;
- tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next)
- contours[cnt++] = tmp_contour_ptr;
- /* now sort the contours in decreasing area size order */
- qsort((void *) contours, (size_t) cnt, (size_t) sizeof(tess_contour *),
- area_compare);
- /* we leave just the first contour - remove others from list */
- tobj->contours = contours[0];
- tobj->contours->next = tobj->contours->previous = NULL;
- tobj->last_contour = tobj->contours;
- tobj->contour_cnt = 1;
- /* first contour is the one with greatest area */
- /* must be EXTERIOR */
- tobj->contours->type = GLU_EXTERIOR;
- tmp_contour_ptr = tobj->contours;
- /* now we play! */
- for (i = 1; i < cnt; i++) {
- hierarchy_changed = GL_FALSE;
- for (tmp_contour_ptr = tobj->contours;
- tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) {
- if (tmp_contour_ptr->type == GLU_EXTERIOR) {
- /* check if contour completely contained in EXTERIOR */
- result = is_contour_contained_in(tmp_contour_ptr, contours[i]);
- switch (result) {
- case GLU_INTERIOR:
- /* now we have to check if contour is inside interiors */
- /* or not */
- /* any interiors? */
- if (tmp_contour_ptr->next != NULL &&
- tmp_contour_ptr->next->type == GLU_INTERIOR) {
- /* for all interior, check if inside any of them */
- /* if not inside any of interiors, its another */
- /* interior */
- /* or it may contain some interiors, then change */
- /* the contained interiors to exterior ones */
- add_interior_with_hierarchy_check(tobj,
- tmp_contour_ptr,
- contours[i]);
- }
- else {
- /* not in interior, add as new interior contour */
- add_new_interior(tobj, tmp_contour_ptr, contours[i]);
- }
- hierarchy_changed = GL_TRUE;
- break;
- case GLU_EXTERIOR:
- /* ooops, the marked as EXTERIOR (contours[i]) is */
- /* actually an interior of tmp_contour_ptr */
- /* reverse the local hierarchy */
- reverse_hierarchy_and_add_exterior(tobj, tmp_contour_ptr,
- contours[i]);
- hierarchy_changed = GL_TRUE;
- break;
- case GLU_NO_ERROR:
- break;
- default:
- abort();
- }
- }
- if (hierarchy_changed)
- break; /* break from for loop */
- }
- if (hierarchy_changed == GL_FALSE) {
- /* disjoint with all contours, add to contour list */
- add_new_exterior(tobj, contours[i]);
- }
- }
- free(contours);
-}
-
-/* returns GLU_INTERIOR if inner is completey enclosed within outer */
-/* returns GLU_EXTERIOR if outer is completely enclosed within inner */
-/* returns GLU_NO_ERROR if contours are disjoint */
-static GLenum
-is_contour_contained_in(tess_contour * outer, tess_contour * inner)
-{
- GLenum relation_flag;
-
- /* set relation_flag to relation of containment of first inner vertex */
- /* regarding outer contour */
- if (point_in_polygon(outer, inner->vertices->x, inner->vertices->y))
- relation_flag = GLU_INTERIOR;
- else
- relation_flag = GLU_EXTERIOR;
- if (relation_flag == GLU_INTERIOR)
- return GLU_INTERIOR;
- if (point_in_polygon(inner, outer->vertices->x, outer->vertices->y))
- return GLU_EXTERIOR;
- return GLU_NO_ERROR;
-}
-
-static GLboolean
-point_in_polygon(tess_contour * contour, GLdouble x, GLdouble y)
-{
- tess_vertex *v1, *v2;
- GLuint i, vertex_cnt;
- GLdouble xp1, yp1, xp2, yp2;
- GLboolean tst;
-
- tst = GL_FALSE;
- v1 = contour->vertices;
- v2 = contour->vertices->previous;
- for (i = 0, vertex_cnt = contour->vertex_cnt; i < vertex_cnt; i++) {
- xp1 = v1->x;
- yp1 = v1->y;
- xp2 = v2->x;
- yp2 = v2->y;
- if ((((yp1 <= y) && (y < yp2)) || ((yp2 <= y) && (y < yp1))) &&
- (x < (xp2 - xp1) * (y - yp1) / (yp2 - yp1) + xp1))
- tst = (tst == GL_FALSE ? GL_TRUE : GL_FALSE);
- v2 = v1;
- v1 = v1->next;
- }
- return tst;
-}
-
-static GLenum
-contours_overlap(tess_contour * contour, tess_polygon * polygon)
-{
- tess_vertex *vertex1, *vertex2;
- GLuint vertex1_cnt, vertex2_cnt, i, j;
- GLenum test;
-
- vertex1 = contour->vertices;
- vertex2 = polygon->vertices;
- vertex1_cnt = contour->vertex_cnt;
- vertex2_cnt = polygon->vertex_cnt;
- for (i = 0; i < vertex1_cnt; vertex1 = vertex1->next, i++) {
- for (j = 0; j < vertex2_cnt; vertex2 = vertex2->next, j++)
- if ((test = edge_edge_intersect(vertex1, vertex1->next, vertex2,
- vertex2->next)) != GLU_NO_ERROR)
- return test;
- }
- return GLU_NO_ERROR;
-}
-
-static void
-add_new_exterior(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- contour->type = GLU_EXTERIOR;
- contour->next = NULL;
- contour->previous = tobj->last_contour;
- tobj->last_contour->next = contour;
- tobj->last_contour = contour;
-}
-
-static void
-add_new_interior(GLUtriangulatorObj * tobj,
- tess_contour * outer, tess_contour * contour)
-{
- contour->type = GLU_INTERIOR;
- contour->next = outer->next;
- contour->previous = outer;
- if (outer->next != NULL)
- outer->next->previous = contour;
- outer->next = contour;
- if (tobj->last_contour == outer)
- tobj->last_contour = contour;
-}
-
-static void
-add_interior_with_hierarchy_check(GLUtriangulatorObj * tobj,
- tess_contour * outer,
- tess_contour * contour)
-{
- tess_contour *ptr;
-
- /* for all interiors of outer check if they are interior of contour */
- /* if so, change that interior to exterior and move it of of the */
- /* interior sequence */
- if (outer->next != NULL && outer->next->type == GLU_INTERIOR) {
- GLenum test;
-
- for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR;
- ptr = ptr->next) {
- test = is_contour_contained_in(ptr, contour);
- switch (test) {
- case GLU_INTERIOR:
- /* contour is contained in one of the interiors */
- /* check if possibly contained in other exteriors */
- /* move ptr to first EXTERIOR */
- for (; ptr != NULL && ptr->type == GLU_INTERIOR; ptr = ptr->next);
- if (ptr == NULL)
- /* another exterior */
- add_new_exterior(tobj, contour);
- else
- add_exterior_with_check(tobj, ptr, contour);
- return;
- case GLU_EXTERIOR:
- /* one of the interiors is contained in the contour */
- /* change it to EXTERIOR, and shift it away from the */
- /* interior sequence */
- shift_interior_to_exterior(tobj, ptr);
- break;
- case GLU_NO_ERROR:
- /* disjoint */
- break;
- default:
- abort();
- }
- }
- }
- /* add contour to the interior sequence */
- add_new_interior(tobj, outer, contour);
-}
-
-static void
-reverse_hierarchy_and_add_exterior(GLUtriangulatorObj * tobj,
- tess_contour * outer,
- tess_contour * contour)
-{
- tess_contour *ptr;
-
- /* reverse INTERIORS to EXTERIORS */
- /* any INTERIORS? */
- if (outer->next != NULL && outer->next->type == GLU_INTERIOR)
- for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR;
- ptr = ptr->next) ptr->type = GLU_EXTERIOR;
- /* the outer now becomes inner */
- outer->type = GLU_INTERIOR;
- /* contour is the EXTERIOR */
- contour->next = outer;
- if (tobj->contours == outer) {
- /* first contour beeing reversed */
- contour->previous = NULL;
- tobj->contours = contour;
- }
- else {
- outer->previous->next = contour;
- contour->previous = outer->previous;
- }
- outer->previous = contour;
-}
-
-static void
-shift_interior_to_exterior(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- contour->previous->next = contour->next;
- if (contour->next != NULL)
- contour->next->previous = contour->previous;
- else
- tobj->last_contour = contour->previous;
-}
-
-static void
-add_exterior_with_check(GLUtriangulatorObj * tobj,
- tess_contour * outer, tess_contour * contour)
-{
- GLenum test;
-
- /* this contour might be interior to further exteriors - check */
- /* if not, just add as a new exterior */
- for (; outer != NULL && outer->type == GLU_EXTERIOR; outer = outer->next) {
- test = is_contour_contained_in(outer, contour);
- switch (test) {
- case GLU_INTERIOR:
- /* now we have to check if contour is inside interiors */
- /* or not */
- /* any interiors? */
- if (outer->next != NULL && outer->next->type == GLU_INTERIOR) {
- /* for all interior, check if inside any of them */
- /* if not inside any of interiors, its another */
- /* interior */
- /* or it may contain some interiors, then change */
- /* the contained interiors to exterior ones */
- add_interior_with_hierarchy_check(tobj, outer, contour);
- }
- else {
- /* not in interior, add as new interior contour */
- add_new_interior(tobj, outer, contour);
- }
- return;
- case GLU_NO_ERROR:
- /* disjoint */
- break;
- default:
- abort();
- }
- }
- /* add contour to the exterior sequence */
- add_new_exterior(tobj, contour);
-}
-
-void
-tess_handle_holes(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour, *hole;
- GLenum exterior_orientation;
-
- /* verify hole orientation */
- for (contour = tobj->contours; contour != NULL;) {
- exterior_orientation = contour->orientation;
- for (contour = contour->next;
- contour != NULL && contour->type == GLU_INTERIOR;
- contour = contour->next) {
- if (contour->orientation == exterior_orientation) {
- tess_call_user_error(tobj, GLU_TESS_ERROR5);
- return;
- }
- }
- }
- /* now cut-out holes */
- for (contour = tobj->contours; contour != NULL;) {
- hole = contour->next;
- while (hole != NULL && hole->type == GLU_INTERIOR) {
- if (cut_out_hole(tobj, contour, hole) == GLU_ERROR)
- return;
- hole = contour->next;
- }
- contour = contour->next;
- }
-}
-
-static GLenum
-cut_out_hole(GLUtriangulatorObj * tobj,
- tess_contour * contour, tess_contour * hole)
-{
- tess_contour *tmp_hole;
- tess_vertex *v1, *v2, *tmp_vertex;
- GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt;
- GLuint i, j, k;
- GLenum test = 0;
-
- /* find an edge connecting contour and hole not intersecting any other */
- /* edge belonging to either the contour or any of the other holes */
- for (v1 = contour->vertices, vertex1_cnt = contour->vertex_cnt, i = 0;
- i < vertex1_cnt; i++, v1 = v1->next) {
- for (v2 = hole->vertices, vertex2_cnt = hole->vertex_cnt, j = 0;
- j < vertex2_cnt; j++, v2 = v2->next) {
- /* does edge (v1,v2) intersect any edge of contour */
- for (tmp_vertex = contour->vertices, tmp_vertex_cnt =
- contour->vertex_cnt, k = 0; k < tmp_vertex_cnt;
- tmp_vertex = tmp_vertex->next, k++) {
- /* skip edge tests for edges directly connected */
- if (v1 == tmp_vertex || v1 == tmp_vertex->next)
- continue;
- test = edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next);
- if (test != GLU_NO_ERROR)
- break;
- }
- if (test == GLU_NO_ERROR) {
- /* does edge (v1,v2) intersect any edge of hole */
- for (tmp_vertex = hole->vertices,
- tmp_vertex_cnt = hole->vertex_cnt, k = 0;
- k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) {
- /* skip edge tests for edges directly connected */
- if (v2 == tmp_vertex || v2 == tmp_vertex->next)
- continue;
- test =
- edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next);
- if (test != GLU_NO_ERROR)
- break;
- }
- if (test == GLU_NO_ERROR) {
- /* does edge (v1,v2) intersect any other hole? */
- for (tmp_hole = hole->next;
- tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR;
- tmp_hole = tmp_hole->next) {
- /* does edge (v1,v2) intersect any edge of hole */
- for (tmp_vertex = tmp_hole->vertices,
- tmp_vertex_cnt = tmp_hole->vertex_cnt, k = 0;
- k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) {
- test = edge_edge_intersect(v1, v2, tmp_vertex,
- tmp_vertex->next);
- if (test != GLU_NO_ERROR)
- break;
- }
- if (test != GLU_NO_ERROR)
- break;
- }
- }
- }
- if (test == GLU_NO_ERROR) {
- /* edge (v1,v2) is good for eliminating the hole */
- if (merge_hole_with_contour(tobj, contour, hole, v1, v2)
- == GLU_NO_ERROR)
- return GLU_NO_ERROR;
- else
- return GLU_ERROR;
- }
- }
- }
- /* other holes are blocking all possible connections of hole */
- /* with contour, we shift this hole as the last hole and retry */
- for (tmp_hole = hole;
- tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR;
- tmp_hole = tmp_hole->next);
- contour->next = hole->next;
- hole->next->previous = contour;
- if (tmp_hole == NULL) {
- /* last EXTERIOR contour, shift hole as last contour */
- hole->next = NULL;
- hole->previous = tobj->last_contour;
- tobj->last_contour->next = hole;
- tobj->last_contour = hole;
- }
- else {
- tmp_hole->previous->next = hole;
- hole->previous = tmp_hole->previous;
- tmp_hole->previous = hole;
- hole->next = tmp_hole;
- }
- hole = contour->next;
- /* try once again - recurse */
- return cut_out_hole(tobj, contour, hole);
-}
-
-static GLenum
-merge_hole_with_contour(GLUtriangulatorObj * tobj,
- tess_contour * contour,
- tess_contour * hole,
- tess_vertex * v1, tess_vertex * v2)
-{
- tess_vertex *v1_new, *v2_new;
-
- /* make copies of v1 and v2, place them respectively after their originals */
- if ((v1_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- if ((v2_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- v1_new->edge_flag = GL_TRUE;
- v1_new->data = v1->data;
- v1_new->location[0] = v1->location[0];
- v1_new->location[1] = v1->location[1];
- v1_new->location[2] = v1->location[2];
- v1_new->x = v1->x;
- v1_new->y = v1->y;
- v1_new->shadow_vertex = v1;
- v1->shadow_vertex = v1_new;
- v1_new->next = v1->next;
- v1_new->previous = v1;
- v1->next->previous = v1_new;
- v1->next = v1_new;
- v2_new->edge_flag = GL_TRUE;
- v2_new->data = v2->data;
- v2_new->location[0] = v2->location[0];
- v2_new->location[1] = v2->location[1];
- v2_new->location[2] = v2->location[2];
- v2_new->x = v2->x;
- v2_new->y = v2->y;
- v2_new->shadow_vertex = v2;
- v2->shadow_vertex = v2_new;
- v2_new->next = v2->next;
- v2_new->previous = v2;
- v2->next->previous = v2_new;
- v2->next = v2_new;
- /* link together the two lists */
- v1->next = v2_new;
- v2_new->previous = v1;
- v2->next = v1_new;
- v1_new->previous = v2;
- /* update the vertex count of the contour */
- contour->vertex_cnt += hole->vertex_cnt + 2;
- /* remove the INTERIOR contour */
- contour->next = hole->next;
- if (hole->next != NULL)
- hole->next->previous = contour;
- free(hole);
- /* update tobj structure */
- --(tobj->contour_cnt);
- if (contour->last_vertex == v1)
- contour->last_vertex = v1_new;
- /* mark two vertices with edge_flag */
- v2->edge_flag = GL_FALSE;
- v1->edge_flag = GL_FALSE;
- return GLU_NO_ERROR;
-}
diff --git a/src/glu/mesa/project.c b/src/glu/mesa/project.c
deleted file mode 100644
index 6fa03267e53..00000000000
--- a/src/glu/mesa/project.c
+++ /dev/null
@@ -1,401 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include "gluP.h"
-#endif
-
-
-/*
- * This code was contributed by Marc Buffat (buffat@mecaflu.ec-lyon.fr).
- * Thanks Marc!!!
- */
-
-
-
-/* implementation de gluProject et gluUnproject */
-/* M. Buffat 17/2/95 */
-
-
-
-/*
- * Transform a point (column vector) by a 4x4 matrix. I.e. out = m * in
- * Input: m - the 4x4 matrix
- * in - the 4x1 vector
- * Output: out - the resulting 4x1 vector.
- */
-static void
-transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4])
-{
-#define M(row,col) m[col*4+row]
- out[0] =
- M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3];
- out[1] =
- M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3];
- out[2] =
- M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3];
- out[3] =
- M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3];
-#undef M
-}
-
-
-
-
-/*
- * Perform a 4x4 matrix multiplication (product = a x b).
- * Input: a, b - matrices to multiply
- * Output: product - product of a and b
- */
-static void
-matmul(GLdouble * product, const GLdouble * a, const GLdouble * b)
-{
- /* This matmul was contributed by Thomas Malik */
- GLdouble temp[16];
- GLint i;
-
-#define A(row,col) a[(col<<2)+row]
-#define B(row,col) b[(col<<2)+row]
-#define T(row,col) temp[(col<<2)+row]
-
- /* i-te Zeile */
- for (i = 0; i < 4; i++) {
- T(i, 0) =
- A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i,
- 3) *
- B(3, 0);
- T(i, 1) =
- A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i,
- 3) *
- B(3, 1);
- T(i, 2) =
- A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i,
- 3) *
- B(3, 2);
- T(i, 3) =
- A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i,
- 3) *
- B(3, 3);
- }
-
-#undef A
-#undef B
-#undef T
- MEMCPY(product, temp, 16 * sizeof(GLdouble));
-}
-
-
-
-/*
- * Compute inverse of 4x4 transformation matrix.
- * Code contributed by Jacques Leroy jle@star.be
- * Return GL_TRUE for success, GL_FALSE for failure (singular matrix)
- */
-static GLboolean
-invert_matrix(const GLdouble * m, GLdouble * out)
-{
-/* NB. OpenGL Matrices are COLUMN major. */
-#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; }
-#define MAT(m,r,c) (m)[(c)*4+(r)]
-
- GLdouble wtmp[4][8];
- GLdouble m0, m1, m2, m3, s;
- GLdouble *r0, *r1, *r2, *r3;
-
- r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3];
-
- r0[0] = MAT(m, 0, 0), r0[1] = MAT(m, 0, 1),
- r0[2] = MAT(m, 0, 2), r0[3] = MAT(m, 0, 3),
- r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0,
- r1[0] = MAT(m, 1, 0), r1[1] = MAT(m, 1, 1),
- r1[2] = MAT(m, 1, 2), r1[3] = MAT(m, 1, 3),
- r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0,
- r2[0] = MAT(m, 2, 0), r2[1] = MAT(m, 2, 1),
- r2[2] = MAT(m, 2, 2), r2[3] = MAT(m, 2, 3),
- r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0,
- r3[0] = MAT(m, 3, 0), r3[1] = MAT(m, 3, 1),
- r3[2] = MAT(m, 3, 2), r3[3] = MAT(m, 3, 3),
- r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0;
-
- /* choose pivot - or die */
- if (fabs(r3[0]) > fabs(r2[0]))
- SWAP_ROWS(r3, r2);
- if (fabs(r2[0]) > fabs(r1[0]))
- SWAP_ROWS(r2, r1);
- if (fabs(r1[0]) > fabs(r0[0]))
- SWAP_ROWS(r1, r0);
- if (0.0 == r0[0])
- return GL_FALSE;
-
- /* eliminate first variable */
- m1 = r1[0] / r0[0];
- m2 = r2[0] / r0[0];
- m3 = r3[0] / r0[0];
- s = r0[1];
- r1[1] -= m1 * s;
- r2[1] -= m2 * s;
- r3[1] -= m3 * s;
- s = r0[2];
- r1[2] -= m1 * s;
- r2[2] -= m2 * s;
- r3[2] -= m3 * s;
- s = r0[3];
- r1[3] -= m1 * s;
- r2[3] -= m2 * s;
- r3[3] -= m3 * s;
- s = r0[4];
- if (s != 0.0) {
- r1[4] -= m1 * s;
- r2[4] -= m2 * s;
- r3[4] -= m3 * s;
- }
- s = r0[5];
- if (s != 0.0) {
- r1[5] -= m1 * s;
- r2[5] -= m2 * s;
- r3[5] -= m3 * s;
- }
- s = r0[6];
- if (s != 0.0) {
- r1[6] -= m1 * s;
- r2[6] -= m2 * s;
- r3[6] -= m3 * s;
- }
- s = r0[7];
- if (s != 0.0) {
- r1[7] -= m1 * s;
- r2[7] -= m2 * s;
- r3[7] -= m3 * s;
- }
-
- /* choose pivot - or die */
- if (fabs(r3[1]) > fabs(r2[1]))
- SWAP_ROWS(r3, r2);
- if (fabs(r2[1]) > fabs(r1[1]))
- SWAP_ROWS(r2, r1);
- if (0.0 == r1[1])
- return GL_FALSE;
-
- /* eliminate second variable */
- m2 = r2[1] / r1[1];
- m3 = r3[1] / r1[1];
- r2[2] -= m2 * r1[2];
- r3[2] -= m3 * r1[2];
- r2[3] -= m2 * r1[3];
- r3[3] -= m3 * r1[3];
- s = r1[4];
- if (0.0 != s) {
- r2[4] -= m2 * s;
- r3[4] -= m3 * s;
- }
- s = r1[5];
- if (0.0 != s) {
- r2[5] -= m2 * s;
- r3[5] -= m3 * s;
- }
- s = r1[6];
- if (0.0 != s) {
- r2[6] -= m2 * s;
- r3[6] -= m3 * s;
- }
- s = r1[7];
- if (0.0 != s) {
- r2[7] -= m2 * s;
- r3[7] -= m3 * s;
- }
-
- /* choose pivot - or die */
- if (fabs(r3[2]) > fabs(r2[2]))
- SWAP_ROWS(r3, r2);
- if (0.0 == r2[2])
- return GL_FALSE;
-
- /* eliminate third variable */
- m3 = r3[2] / r2[2];
- r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4],
- r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7];
-
- /* last check */
- if (0.0 == r3[3])
- return GL_FALSE;
-
- s = 1.0 / r3[3]; /* now back substitute row 3 */
- r3[4] *= s;
- r3[5] *= s;
- r3[6] *= s;
- r3[7] *= s;
-
- m2 = r2[3]; /* now back substitute row 2 */
- s = 1.0 / r2[2];
- r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2),
- r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2);
- m1 = r1[3];
- r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1,
- r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1;
- m0 = r0[3];
- r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0,
- r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0;
-
- m1 = r1[2]; /* now back substitute row 1 */
- s = 1.0 / r1[1];
- r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1),
- r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1);
- m0 = r0[2];
- r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0,
- r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0;
-
- m0 = r0[1]; /* now back substitute row 0 */
- s = 1.0 / r0[0];
- r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0),
- r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0);
-
- MAT(out, 0, 0) = r0[4];
- MAT(out, 0, 1) = r0[5], MAT(out, 0, 2) = r0[6];
- MAT(out, 0, 3) = r0[7], MAT(out, 1, 0) = r1[4];
- MAT(out, 1, 1) = r1[5], MAT(out, 1, 2) = r1[6];
- MAT(out, 1, 3) = r1[7], MAT(out, 2, 0) = r2[4];
- MAT(out, 2, 1) = r2[5], MAT(out, 2, 2) = r2[6];
- MAT(out, 2, 3) = r2[7], MAT(out, 3, 0) = r3[4];
- MAT(out, 3, 1) = r3[5], MAT(out, 3, 2) = r3[6];
- MAT(out, 3, 3) = r3[7];
-
- return GL_TRUE;
-
-#undef MAT
-#undef SWAP_ROWS
-}
-
-
-
-/* projection du point (objx,objy,obz) sur l'ecran (winx,winy,winz) */
-GLint GLAPIENTRY
-gluProject(GLdouble objx, GLdouble objy, GLdouble objz,
- const GLdouble model[16], const GLdouble proj[16],
- const GLint viewport[4],
- GLdouble * winx, GLdouble * winy, GLdouble * winz)
-{
- /* matrice de transformation */
- GLdouble in[4], out[4];
-
- /* initilise la matrice et le vecteur a transformer */
- in[0] = objx;
- in[1] = objy;
- in[2] = objz;
- in[3] = 1.0;
- transform_point(out, model, in);
- transform_point(in, proj, out);
-
- /* d'ou le resultat normalise entre -1 et 1 */
- if (in[3] == 0.0)
- return GL_FALSE;
-
- in[0] /= in[3];
- in[1] /= in[3];
- in[2] /= in[3];
-
- /* en coordonnees ecran */
- *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2;
- *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2;
- /* entre 0 et 1 suivant z */
- *winz = (1 + in[2]) / 2;
- return GL_TRUE;
-}
-
-
-
-/* transformation du point ecran (winx,winy,winz) en point objet */
-GLint GLAPIENTRY
-gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz,
- const GLdouble model[16], const GLdouble proj[16],
- const GLint viewport[4],
- GLdouble * objx, GLdouble * objy, GLdouble * objz)
-{
- /* matrice de transformation */
- GLdouble m[16], A[16];
- GLdouble in[4], out[4];
-
- /* transformation coordonnees normalisees entre -1 et 1 */
- in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0;
- in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0;
- in[2] = 2 * winz - 1.0;
- in[3] = 1.0;
-
- /* calcul transformation inverse */
- matmul(A, proj, model);
- invert_matrix(A, m);
-
- /* d'ou les coordonnees objets */
- transform_point(out, m, in);
- if (out[3] == 0.0)
- return GL_FALSE;
- *objx = out[0] / out[3];
- *objy = out[1] / out[3];
- *objz = out[2] / out[3];
- return GL_TRUE;
-}
-
-
-/*
- * New in GLU 1.3
- * This is like gluUnProject but also takes near and far DepthRange values.
- */
-#ifdef GLU_VERSION_1_3
-GLint GLAPIENTRY
-gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw,
- const GLdouble modelMatrix[16],
- const GLdouble projMatrix[16],
- const GLint viewport[4],
- GLclampd nearZ, GLclampd farZ,
- GLdouble * objx, GLdouble * objy, GLdouble * objz,
- GLdouble * objw)
-{
- /* matrice de transformation */
- GLdouble m[16], A[16];
- GLdouble in[4], out[4];
- GLdouble z = nearZ + winz * (farZ - nearZ);
-
- /* transformation coordonnees normalisees entre -1 et 1 */
- in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0;
- in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0;
- in[2] = 2.0 * z - 1.0;
- in[3] = clipw;
-
- /* calcul transformation inverse */
- matmul(A, projMatrix, modelMatrix);
- invert_matrix(A, m);
-
- /* d'ou les coordonnees objets */
- transform_point(out, m, in);
- if (out[3] == 0.0)
- return GL_FALSE;
- *objx = out[0] / out[3];
- *objy = out[1] / out[3];
- *objz = out[2] / out[3];
- *objw = out[3];
- return GL_TRUE;
-}
-#endif
diff --git a/src/glu/mesa/quadric.c b/src/glu/mesa/quadric.c
deleted file mode 100644
index 0f6889b284f..00000000000
--- a/src/glu/mesa/quadric.c
+++ /dev/null
@@ -1,819 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1999-2000 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.
- */
-
-
-/* TODO:
- * texture coordinate support
- * flip normals according to orientation
- * there's still some inside/outside orientation bugs in possibly all
- * but the sphere function
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "gluP.h"
-#endif
-
-
-
-#ifndef M_PI
-# define M_PI (3.1415926)
-#endif
-
-
-/*
- * Convert degrees to radians:
- */
-#define DEG_TO_RAD(A) ((A)*(M_PI/180.0))
-
-
-/*
- * Sin and Cos for degree angles:
- */
-#define SIND( A ) sin( (A)*(M_PI/180.0) )
-#define COSD( A) cos( (A)*(M_PI/180.0) )
-
-
-/*
- * Texture coordinates if texture flag is set
- */
-#define TXTR_COORD(x,y) if (qobj->TextureFlag) glTexCoord2f(x,y);
-
-
-
-struct GLUquadric
-{
- GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */
- GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */
- GLboolean TextureFlag; /* Generate texture coords? */
- GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */
- void (GLCALLBACK * ErrorFunc) (GLenum err); /* Error handler callback function */
-};
-
-
-
-/*
- * Process a GLU error.
- */
-static void
-quadric_error(GLUquadricObj * qobj, GLenum error, const char *msg)
-{
- /* Call the error call back function if any */
- if (qobj->ErrorFunc) {
- (*qobj->ErrorFunc) (error);
- }
- /* Print a message to stdout if MESA_DEBUG variable is defined */
- if (getenv("MESA_DEBUG")) {
- fprintf(stderr, "GLUError: %s: %s\n", (char *) gluErrorString(error),
- msg);
- }
-}
-
-
-
-
-GLUquadricObj *GLAPIENTRY
-gluNewQuadric(void)
-{
- GLUquadricObj *q;
-
- q = (GLUquadricObj *) malloc(sizeof(struct GLUquadric));
- if (q) {
- q->DrawStyle = GLU_FILL;
- q->Orientation = GLU_OUTSIDE;
- q->TextureFlag = GL_FALSE;
- q->Normals = GLU_SMOOTH;
- q->ErrorFunc = NULL;
- }
- return q;
-}
-
-
-
-void GLAPIENTRY
-gluDeleteQuadric(GLUquadricObj * state)
-{
- if (state) {
- free((void *) state);
- }
-}
-
-
-
-/*
- * Set the drawing style to be GLU_FILL, GLU_LINE, GLU_SILHOUETTE,
- * or GLU_POINT.
- */
-void GLAPIENTRY
-gluQuadricDrawStyle(GLUquadricObj * quadObject, GLenum drawStyle)
-{
- if (quadObject && (drawStyle == GLU_FILL || drawStyle == GLU_LINE
- || drawStyle == GLU_SILHOUETTE
- || drawStyle == GLU_POINT)) {
- quadObject->DrawStyle = drawStyle;
- }
- else {
- quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle");
- }
-}
-
-
-
-/*
- * Set the orientation to GLU_INSIDE or GLU_OUTSIDE.
- */
-void GLAPIENTRY
-gluQuadricOrientation(GLUquadricObj * quadObject, GLenum orientation)
-{
- if (quadObject
- && (orientation == GLU_INSIDE || orientation == GLU_OUTSIDE)) {
- quadObject->Orientation = orientation;
- }
- else {
- quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation");
- }
-}
-
-
-
-/*
- * Set the error handler callback function.
- */
-void GLAPIENTRY
-gluQuadricCallback(GLUquadricObj * qobj,
- GLenum which, void (GLCALLBACK * fn) ())
-{
- /*
- * UGH, this is a mess! I thought ANSI was a standard.
- */
- if (qobj && which == GLU_ERROR) {
-#ifdef __CYGWIN32__
- qobj->ErrorFunc = (void (GLCALLBACKPCAST) (GLenum)) fn;
-#elif defined(OPENSTEP)
- qobj->ErrorFunc = (void (*)(GLenum)) fn;
-#elif defined(_WIN32)
- qobj->ErrorFunc = (void (GLCALLBACK *) (int)) fn;
-#elif defined(__STORM__)
- qobj->ErrorFunc = (void (GLCALLBACK *) (GLenum)) fn;
-#elif defined(__BEOS__)
- qobj->ErrorFunc = (void (*)(GLenum)) fn;
-#else
- qobj->ErrorFunc = (void (GLCALLBACK *) ()) fn;
-#endif
- }
-}
-
-
-void GLAPIENTRY
-gluQuadricNormals(GLUquadricObj * quadObject, GLenum normals)
-{
- if (quadObject
- && (normals == GLU_NONE || normals == GLU_FLAT
- || normals == GLU_SMOOTH)) {
- quadObject->Normals = normals;
- }
-}
-
-
-void GLAPIENTRY
-gluQuadricTexture(GLUquadricObj * quadObject, GLboolean textureCoords)
-{
- if (quadObject) {
- quadObject->TextureFlag = textureCoords;
- }
-}
-
-
-
-
-/*
- * Call glNormal3f after scaling normal to unit length.
- */
-static void
-normal3f(GLfloat x, GLfloat y, GLfloat z)
-{
- GLdouble mag;
-
- mag = sqrt(x * x + y * y + z * z);
- if (mag > 0.00001F) {
- x /= mag;
- y /= mag;
- z /= mag;
- }
- glNormal3f(x, y, z);
-}
-
-
-
-void GLAPIENTRY
-gluCylinder(GLUquadricObj * qobj,
- GLdouble baseRadius, GLdouble topRadius,
- GLdouble height, GLint slices, GLint stacks)
-{
- GLdouble da, r, dr, dz;
- GLfloat x, y, z, nz, nsign;
- GLint i, j;
-
- if (qobj->Orientation == GLU_INSIDE) {
- nsign = -1.0;
- }
- else {
- nsign = 1.0;
- }
-
- da = 2.0 * M_PI / slices;
- dr = (topRadius - baseRadius) / stacks;
- dz = height / stacks;
- nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */
-
- if (qobj->DrawStyle == GLU_POINT) {
- glBegin(GL_POINTS);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
-
- z = 0.0;
- r = baseRadius;
- for (j = 0; j <= stacks; j++) {
- glVertex3f(x * r, y * r, z);
- z += dz;
- r += dr;
- }
- }
- glEnd();
- }
- else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) {
- /* Draw rings */
- if (qobj->DrawStyle == GLU_LINE) {
- z = 0.0;
- r = baseRadius;
- for (j = 0; j <= stacks; j++) {
- glBegin(GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * r, y * r, z);
- }
- glEnd();
- z += dz;
- r += dr;
- }
- }
- else {
- /* draw one ring at each end */
- if (baseRadius != 0.0) {
- glBegin(GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * baseRadius, y * baseRadius, 0.0);
- }
- glEnd();
- glBegin(GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * topRadius, y * topRadius, height);
- }
- glEnd();
- }
- }
- /* draw length lines */
- glBegin(GL_LINES);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * baseRadius, y * baseRadius, 0.0);
- glVertex3f(x * topRadius, y * topRadius, height);
- }
- glEnd();
- }
- else if (qobj->DrawStyle == GLU_FILL) {
- GLfloat ds = 1.0 / slices;
- GLfloat dt = 1.0 / stacks;
- GLfloat t = 0.0;
- z = 0.0;
- r = baseRadius;
- for (j = 0; j < stacks; j++) {
- GLfloat s = 0.0;
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= slices; i++) {
- GLfloat x, y;
- if (i == slices) {
- x = sin(0.0);
- y = cos(0.0);
- }
- else {
- x = sin(i * da);
- y = cos(i * da);
- }
- if (nsign == 1.0) {
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t);
- glVertex3f(x * r, y * r, z);
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t + dt);
- glVertex3f(x * (r + dr), y * (r + dr), z + dz);
- }
- else {
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t);
- glVertex3f(x * r, y * r, z);
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t + dt);
- glVertex3f(x * (r + dr), y * (r + dr), z + dz);
- }
- s += ds;
- } /* for slices */
- glEnd();
- r += dr;
- t += dt;
- z += dz;
- } /* for stacks */
- }
-}
-
-
-
-
-
-void GLAPIENTRY
-gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks)
-{
- GLfloat rho, drho, theta, dtheta;
- GLfloat x, y, z;
- GLfloat s, t, ds, dt;
- GLint i, j, imin, imax;
- GLboolean normals;
- GLfloat nsign;
-
- if (qobj->Normals == GLU_NONE) {
- normals = GL_FALSE;
- }
- else {
- normals = GL_TRUE;
- }
- if (qobj->Orientation == GLU_INSIDE) {
- nsign = -1.0;
- }
- else {
- nsign = 1.0;
- }
-
- drho = M_PI / (GLfloat) stacks;
- dtheta = 2.0 * M_PI / (GLfloat) slices;
-
- /* texturing: s goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y axis */
- /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */
- /* cannot use triangle fan on texturing (s coord. at top/bottom tip varies) */
-
- if (qobj->DrawStyle == GLU_FILL) {
- if (!qobj->TextureFlag) {
- /* draw +Z end as a triangle fan */
- glBegin(GL_TRIANGLE_FAN);
- glNormal3f(0.0, 0.0, 1.0);
- glVertex3f(0.0, 0.0, nsign * radius);
- for (j = 0; j <= slices; j++) {
- theta = (j == slices) ? 0.0 : j * dtheta;
- x = -sin(theta) * sin(drho);
- y = cos(theta) * sin(drho);
- z = nsign * cos(drho);
- if (normals)
- glNormal3f(x * nsign, y * nsign, z * nsign);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
-
- ds = 1.0 / slices;
- dt = 1.0 / stacks;
- t = 1.0; /* because loop now runs from 0 */
- if (qobj->TextureFlag) {
- imin = 0;
- imax = stacks;
- }
- else {
- imin = 1;
- imax = stacks - 1;
- }
-
- /* draw intermediate stacks as quad strips */
- for (i = imin; i < imax; i++) {
- rho = i * drho;
- glBegin(GL_QUAD_STRIP);
- s = 0.0;
- for (j = 0; j <= slices; j++) {
- theta = (j == slices) ? 0.0 : j * dtheta;
- x = -sin(theta) * sin(rho);
- y = cos(theta) * sin(rho);
- z = nsign * cos(rho);
- if (normals)
- glNormal3f(x * nsign, y * nsign, z * nsign);
- TXTR_COORD(s, t);
- glVertex3f(x * radius, y * radius, z * radius);
- x = -sin(theta) * sin(rho + drho);
- y = cos(theta) * sin(rho + drho);
- z = nsign * cos(rho + drho);
- if (normals)
- glNormal3f(x * nsign, y * nsign, z * nsign);
- TXTR_COORD(s, t - dt);
- s += ds;
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- t -= dt;
- }
-
- if (!qobj->TextureFlag) {
- /* draw -Z end as a triangle fan */
- glBegin(GL_TRIANGLE_FAN);
- glNormal3f(0.0, 0.0, -1.0);
- glVertex3f(0.0, 0.0, -radius * nsign);
- rho = M_PI - drho;
- s = 1.0;
- t = dt;
- for (j = slices; j >= 0; j--) {
- theta = (j == slices) ? 0.0 : j * dtheta;
- x = -sin(theta) * sin(rho);
- y = cos(theta) * sin(rho);
- z = nsign * cos(rho);
- if (normals)
- glNormal3f(x * nsign, y * nsign, z * nsign);
- s -= ds;
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
- }
- else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) {
- /* draw stack lines */
- for (i = 1; i < stacks; i++) { /* stack line at i==stacks-1 was missing here */
- rho = i * drho;
- glBegin(GL_LINE_LOOP);
- for (j = 0; j < slices; j++) {
- theta = j * dtheta;
- x = cos(theta) * sin(rho);
- y = sin(theta) * sin(rho);
- z = cos(rho);
- if (normals)
- glNormal3f(x * nsign, y * nsign, z * nsign);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
- /* draw slice lines */
- for (j = 0; j < slices; j++) {
- theta = j * dtheta;
- glBegin(GL_LINE_STRIP);
- for (i = 0; i <= stacks; i++) {
- rho = i * drho;
- x = cos(theta) * sin(rho);
- y = sin(theta) * sin(rho);
- z = cos(rho);
- if (normals)
- glNormal3f(x * nsign, y * nsign, z * nsign);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
- }
- else if (qobj->DrawStyle == GLU_POINT) {
- /* top and bottom-most points */
- glBegin(GL_POINTS);
- if (normals)
- glNormal3f(0.0, 0.0, nsign);
- glVertex3d(0.0, 0.0, radius);
- if (normals)
- glNormal3f(0.0, 0.0, -nsign);
- glVertex3d(0.0, 0.0, -radius);
-
- /* loop over stacks */
- for (i = 1; i < stacks - 1; i++) {
- rho = i * drho;
- for (j = 0; j < slices; j++) {
- theta = j * dtheta;
- x = cos(theta) * sin(rho);
- y = sin(theta) * sin(rho);
- z = cos(rho);
- if (normals)
- glNormal3f(x * nsign, y * nsign, z * nsign);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- }
- glEnd();
- }
-
-}
-
-
-
-void GLAPIENTRY
-gluDisk(GLUquadricObj * qobj,
- GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops)
-{
- GLfloat da, dr;
-#if 0
- GLdouble a, da;
- GLfloat r, dr;
- GLfloat x, y;
- GLfloat r1, r2, dtc;
- GLint s, l;
-#endif
-
- /* Normal vectors */
- if (qobj->Normals != GLU_NONE) {
- if (qobj->Orientation == GLU_OUTSIDE) {
- glNormal3f(0.0, 0.0, +1.0);
- }
- else {
- glNormal3f(0.0, 0.0, -1.0);
- }
- }
-
- da = 2.0 * M_PI / slices;
- dr = (outerRadius - innerRadius) / (GLfloat) loops;
-
- switch (qobj->DrawStyle) {
- case GLU_FILL:
- {
- /* texture of a gluDisk is a cut out of the texture unit square
- * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1]
- * (linear mapping)
- */
- GLfloat dtc = 2.0f * outerRadius;
- GLfloat sa, ca;
- GLfloat r1 = innerRadius;
- GLint l;
- for (l = 0; l < loops; l++) {
- GLfloat r2 = r1 + dr;
- if (qobj->Orientation == GLU_OUTSIDE) {
- GLint s;
- glBegin(GL_QUAD_STRIP);
- for (s = 0; s <= slices; s++) {
- GLfloat a;
- if (s == slices)
- a = 0.0;
- else
- a = s * da;
- sa = sin(a);
- ca = cos(a);
- TXTR_COORD(0.5 + sa * r2 / dtc, 0.5 + ca * r2 / dtc);
- glVertex2f(r2 * sa, r2 * ca);
- TXTR_COORD(0.5 + sa * r1 / dtc, 0.5 + ca * r1 / dtc);
- glVertex2f(r1 * sa, r1 * ca);
- }
- glEnd();
- }
- else {
- GLint s;
- glBegin(GL_QUAD_STRIP);
- for (s = slices; s >= 0; s--) {
- GLfloat a;
- if (s == slices)
- a = 0.0;
- else
- a = s * da;
- sa = sin(a);
- ca = cos(a);
- TXTR_COORD(0.5 - sa * r2 / dtc, 0.5 + ca * r2 / dtc);
- glVertex2f(r2 * sa, r2 * ca);
- TXTR_COORD(0.5 - sa * r1 / dtc, 0.5 + ca * r1 / dtc);
- glVertex2f(r1 * sa, r1 * ca);
- }
- glEnd();
- }
- r1 = r2;
- }
- break;
- }
- case GLU_LINE:
- {
- GLint l, s;
- /* draw loops */
- for (l = 0; l <= loops; l++) {
- GLfloat r = innerRadius + l * dr;
- glBegin(GL_LINE_LOOP);
- for (s = 0; s < slices; s++) {
- GLfloat a = s * da;
- glVertex2f(r * sin(a), r * cos(a));
- }
- glEnd();
- }
- /* draw spokes */
- for (s = 0; s < slices; s++) {
- GLfloat a = s * da;
- GLfloat x = sin(a);
- GLfloat y = cos(a);
- glBegin(GL_LINE_STRIP);
- for (l = 0; l <= loops; l++) {
- GLfloat r = innerRadius + l * dr;
- glVertex2f(r * x, r * y);
- }
- glEnd();
- }
- break;
- }
- case GLU_POINT:
- {
- GLint s;
- glBegin(GL_POINTS);
- for (s = 0; s < slices; s++) {
- GLfloat a = s * da;
- GLfloat x = sin(a);
- GLfloat y = cos(a);
- GLint l;
- for (l = 0; l <= loops; l++) {
- GLfloat r = innerRadius * l * dr;
- glVertex2f(r * x, r * y);
- }
- }
- glEnd();
- break;
- }
- case GLU_SILHOUETTE:
- {
- if (innerRadius != 0.0) {
- GLfloat a;
- glBegin(GL_LINE_LOOP);
- for (a = 0.0; a < 2.0 * M_PI; a += da) {
- GLfloat x = innerRadius * sin(a);
- GLfloat y = innerRadius * cos(a);
- glVertex2f(x, y);
- }
- glEnd();
- }
- {
- GLfloat a;
- glBegin(GL_LINE_LOOP);
- for (a = 0; a < 2.0 * M_PI; a += da) {
- GLfloat x = outerRadius * sin(a);
- GLfloat y = outerRadius * cos(a);
- glVertex2f(x, y);
- }
- glEnd();
- }
- break;
- }
- default:
- abort();
- }
-}
-
-
-
-void GLAPIENTRY
-gluPartialDisk(GLUquadricObj * qobj, GLdouble innerRadius,
- GLdouble outerRadius, GLint slices, GLint loops,
- GLdouble startAngle, GLdouble sweepAngle)
-{
- if (qobj->Normals != GLU_NONE) {
- if (qobj->Orientation == GLU_OUTSIDE) {
- glNormal3f(0.0, 0.0, +1.0);
- }
- else {
- glNormal3f(0.0, 0.0, -1.0);
- }
- }
-
- if (qobj->DrawStyle == GLU_POINT) {
- GLint loop, slice;
- GLdouble radius, delta_radius;
- GLdouble angle, delta_angle;
- delta_radius = (outerRadius - innerRadius) / (loops - 1);
- delta_angle = DEG_TO_RAD((sweepAngle) / (slices - 1));
- glBegin(GL_POINTS);
- radius = innerRadius;
- for (loop = 0; loop < loops; loop++) {
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice < slices; slice++) {
- glVertex2d(radius * sin(angle), radius * cos(angle));
- angle += delta_angle;
- }
- radius += delta_radius;
- }
- glEnd();
- }
- else if (qobj->DrawStyle == GLU_LINE) {
- GLint loop, slice;
- GLdouble radius, delta_radius;
- GLdouble angle, delta_angle;
- delta_radius = (outerRadius - innerRadius) / loops;
- delta_angle = DEG_TO_RAD(sweepAngle / slices);
- /* draw rings */
- radius = innerRadius;
- for (loop = 0; loop < loops; loop++) {
- angle = DEG_TO_RAD(startAngle);
- glBegin(GL_LINE_STRIP);
- for (slice = 0; slice <= slices; slice++) {
- glVertex2d(radius * sin(angle), radius * cos(angle));
- angle += delta_angle;
- }
- glEnd();
- radius += delta_radius;
- }
- /* draw spokes */
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice <= slices; slice++) {
- radius = innerRadius;
- glBegin(GL_LINE_STRIP);
- for (loop = 0; loop < loops; loop++) {
- glVertex2d(radius * sin(angle), radius * cos(angle));
- radius += delta_radius;
- }
- glEnd();
- angle += delta_angle;
- }
- }
- else if (qobj->DrawStyle == GLU_SILHOUETTE) {
- GLint slice;
- GLdouble angle, delta_angle;
- delta_angle = DEG_TO_RAD(sweepAngle / slices);
- /* draw outer ring */
- glBegin(GL_LINE_STRIP);
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice <= slices; slice++) {
- glVertex2d(outerRadius * sin(angle), outerRadius * cos(angle));
- angle += delta_angle;
- }
- glEnd();
- /* draw inner ring */
- if (innerRadius > 0.0) {
- glBegin(GL_LINE_STRIP);
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice < slices; slice++) {
- glVertex2d(innerRadius * sin(angle), innerRadius * cos(angle));
- angle += delta_angle;
- }
- glEnd();
- }
- /* draw spokes */
- if (sweepAngle < 360.0) {
- GLdouble stopAngle = startAngle + sweepAngle;
- glBegin(GL_LINES);
- glVertex2d(innerRadius * SIND(startAngle),
- innerRadius * COSD(startAngle));
- glVertex2d(outerRadius * SIND(startAngle),
- outerRadius * COSD(startAngle));
- glVertex2d(innerRadius * SIND(stopAngle),
- innerRadius * COSD(stopAngle));
- glVertex2d(outerRadius * SIND(stopAngle),
- outerRadius * COSD(stopAngle));
- glEnd();
- }
- }
- else if (qobj->DrawStyle == GLU_FILL) {
- GLint loop, slice;
- GLdouble radius, delta_radius;
- GLdouble angle, delta_angle;
- delta_radius = (outerRadius - innerRadius) / loops;
- delta_angle = DEG_TO_RAD(sweepAngle / slices);
- radius = innerRadius;
- for (loop = 0; loop < loops; loop++) {
- glBegin(GL_QUAD_STRIP);
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice <= slices; slice++) {
- if (qobj->Orientation == GLU_OUTSIDE) {
- glVertex2d((radius + delta_radius) * sin(angle),
- (radius + delta_radius) * cos(angle));
- glVertex2d(radius * sin(angle), radius * cos(angle));
- }
- else {
- glVertex2d(radius * sin(angle), radius * cos(angle));
- glVertex2d((radius + delta_radius) * sin(angle),
- (radius + delta_radius) * cos(angle));
- }
- angle += delta_angle;
- }
- glEnd();
- radius += delta_radius;
- }
- }
-}
diff --git a/src/glu/mesa/tess.c b/src/glu/mesa/tess.c
deleted file mode 100644
index 341d29bae3a..00000000000
--- a/src/glu/mesa/tess.c
+++ /dev/null
@@ -1,327 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include "tess.h"
-#endif
-
-
-/*
- * This is ugly, but seems the easiest way to do things to make the
- * code work under YellowBox for Windows
- */
-#if defined(OPENSTEP) && defined(CALLBACK)
-#undef CALLBACK
-#define CALLBACK
-#endif
-
-
-static void delete_contours(GLUtriangulatorObj *);
-
-#ifdef __CYGWIN32__
-#define _CALLBACK
-#else
-#define _CALLBACK GLCALLBACK
-#endif
-
-
-static void
-init_callbacks(tess_callbacks * callbacks)
-{
- callbacks->begin = (void (_CALLBACK *) (GLenum)) 0;
- callbacks->edgeFlag = (void (_CALLBACK *) (GLboolean)) 0;
- callbacks->vertex = (void (_CALLBACK *) (void *)) 0;
- callbacks->end = (void (_CALLBACK *) (void)) 0;
- callbacks->error = (void (_CALLBACK *) (GLenum)) 0;
-}
-
-void
-tess_call_user_error(GLUtriangulatorObj * tobj, GLenum gluerr)
-{
- if (tobj->error == GLU_NO_ERROR)
- tobj->error = gluerr;
- if (tobj->callbacks.error != NULL)
- (tobj->callbacks.error) (gluerr);
-}
-
-GLUtriangulatorObj *GLAPIENTRY
-gluNewTess(void)
-{
- GLUtriangulatorObj *tobj;
-
- if ((tobj = (GLUtriangulatorObj *)
- malloc(sizeof(struct GLUtesselator))) == NULL)
- return NULL;
- tobj->contours = tobj->last_contour = NULL;
- init_callbacks(&tobj->callbacks);
- tobj->error = GLU_NO_ERROR;
- tobj->current_polygon = NULL;
- tobj->contour_cnt = 0;
- return tobj;
-}
-
-
-void GLAPIENTRY
-gluTessCallback(GLUtriangulatorObj * tobj, GLenum which,
- void (GLCALLBACK * fn) ())
-{
- switch (which) {
- case GLU_BEGIN:
- tobj->callbacks.begin = (void (_CALLBACK *) (GLenum)) fn;
- break;
- case GLU_EDGE_FLAG:
- tobj->callbacks.edgeFlag = (void (_CALLBACK *) (GLboolean)) fn;
- break;
- case GLU_VERTEX:
- tobj->callbacks.vertex = (void (_CALLBACK *) (void *)) fn;
- break;
- case GLU_END:
- tobj->callbacks.end = (void (_CALLBACK *) (void)) fn;
- break;
- case GLU_ERROR:
- tobj->callbacks.error = (void (_CALLBACK *) (GLenum)) fn;
- break;
- default:
- tobj->error = GLU_INVALID_ENUM;
- break;
- }
-}
-
-
-
-void GLAPIENTRY
-gluDeleteTess(GLUtriangulatorObj * tobj)
-{
- if (tobj->error == GLU_NO_ERROR && tobj->contour_cnt)
- /* was gluEndPolygon called? */
- tess_call_user_error(tobj, GLU_TESS_ERROR1);
- /* delete all internal structures */
- delete_contours(tobj);
- free(tobj);
-}
-
-
-void GLAPIENTRY
-gluBeginPolygon(GLUtriangulatorObj * tobj)
-{
-/*
- if(tobj->error!=GLU_NO_ERROR)
- return;
-*/
- tobj->error = GLU_NO_ERROR;
- if (tobj->current_polygon != NULL) {
- /* gluEndPolygon was not called */
- tess_call_user_error(tobj, GLU_TESS_ERROR1);
- /* delete all internal structures */
- delete_contours(tobj);
- }
- else {
- if ((tobj->current_polygon =
- (tess_polygon *) malloc(sizeof(tess_polygon))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- tobj->current_polygon->vertex_cnt = 0;
- tobj->current_polygon->vertices =
- tobj->current_polygon->last_vertex = NULL;
- }
-}
-
-
-void GLAPIENTRY
-gluEndPolygon(GLUtriangulatorObj * tobj)
-{
- /*tess_contour *contour_ptr; */
-
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- /* check if gluBeginPolygon was called */
- if (tobj->current_polygon == NULL) {
- tess_call_user_error(tobj, GLU_TESS_ERROR2);
- return;
- }
- tess_test_polygon(tobj);
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- /* any real contours? */
- if (tobj->contour_cnt == 0) {
- /* delete all internal structures */
- delete_contours(tobj);
- return;
- }
- tess_find_contour_hierarchies(tobj);
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- tess_handle_holes(tobj);
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- /* if no callbacks, nothing to do */
- if (tobj->callbacks.begin != NULL && tobj->callbacks.vertex != NULL &&
- tobj->callbacks.end != NULL) {
- if (tobj->callbacks.edgeFlag == NULL)
- tess_tesselate(tobj);
- else
- tess_tesselate_with_edge_flag(tobj);
- }
-
- end:
- /* delete all internal structures */
- delete_contours(tobj);
-}
-
-
-void GLAPIENTRY
-gluNextContour(GLUtriangulatorObj * tobj, GLenum type)
-{
- if (tobj->error != GLU_NO_ERROR)
- return;
- if (tobj->current_polygon == NULL) {
- tess_call_user_error(tobj, GLU_TESS_ERROR2);
- return;
- }
- /* first contour? */
- if (tobj->current_polygon->vertex_cnt)
- tess_test_polygon(tobj);
-}
-
-
-void GLAPIENTRY
-gluTessVertex(GLUtriangulatorObj * tobj, GLdouble v[3], void *data)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *last_vertex_ptr;
-
- if (tobj->error != GLU_NO_ERROR)
- return;
- if (polygon == NULL) {
- tess_call_user_error(tobj, GLU_TESS_ERROR2);
- return;
- }
- last_vertex_ptr = polygon->last_vertex;
- if (last_vertex_ptr == NULL) {
- if ((last_vertex_ptr = (tess_vertex *)
- malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- polygon->vertices = last_vertex_ptr;
- polygon->last_vertex = last_vertex_ptr;
- last_vertex_ptr->data = data;
- last_vertex_ptr->location[0] = v[0];
- last_vertex_ptr->location[1] = v[1];
- last_vertex_ptr->location[2] = v[2];
- last_vertex_ptr->next = NULL;
- last_vertex_ptr->previous = NULL;
- ++(polygon->vertex_cnt);
- }
- else {
- tess_vertex *vertex_ptr;
-
- /* same point twice? */
- if (fabs(last_vertex_ptr->location[0] - v[0]) < EPSILON &&
- fabs(last_vertex_ptr->location[1] - v[1]) < EPSILON &&
- fabs(last_vertex_ptr->location[2] - v[2]) < EPSILON) {
- tess_call_user_error(tobj, GLU_TESS_ERROR6);
- return;
- }
- if ((vertex_ptr = (tess_vertex *)
- malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- vertex_ptr->data = data;
- vertex_ptr->location[0] = v[0];
- vertex_ptr->location[1] = v[1];
- vertex_ptr->location[2] = v[2];
- vertex_ptr->next = NULL;
- vertex_ptr->previous = last_vertex_ptr;
- ++(polygon->vertex_cnt);
- last_vertex_ptr->next = vertex_ptr;
- polygon->last_vertex = vertex_ptr;
- }
-}
-
-
-static void
-delete_contours(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_contour *contour, *contour_tmp;
- tess_vertex *vertex, *vertex_tmp;
-
- /* remove current_polygon list - if exists due to detected error */
- if (polygon != NULL) {
- if (polygon->vertices) {
- for (vertex = polygon->vertices; vertex != polygon->last_vertex;) {
- vertex_tmp = vertex->next;
- free(vertex);
- vertex = vertex_tmp;
- }
- free(vertex);
- }
- free(polygon);
- tobj->current_polygon = NULL;
- }
- /* remove all contour data */
- for (contour = tobj->contours; contour != NULL;) {
- for (vertex = contour->vertices; vertex != contour->last_vertex;) {
- vertex_tmp = vertex->next;
- free(vertex);
- vertex = vertex_tmp;
- }
- free(vertex);
- contour_tmp = contour->next;
- free(contour);
- contour = contour_tmp;
- }
- tobj->contours = tobj->last_contour = NULL;
- tobj->contour_cnt = 0;
-}
-
-
-void GLAPIENTRY
-gluTessNormal(GLUtesselator *tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ)
-{
- /* dummy function */
- (void) tess;
- (void) valueX;
- (void) valueY;
- (void) valueZ;
-}
diff --git a/src/glu/mesa/tess.h b/src/glu/mesa/tess.h
deleted file mode 100644
index 4e51dddd37d..00000000000
--- a/src/glu/mesa/tess.h
+++ /dev/null
@@ -1,107 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifndef TESS_H
-#define TESS_H
-
-
-#include "gluP.h"
-
-#define EPSILON 1e-06 /* epsilon for double precision compares */
-
-typedef enum
-{
- OXY,
- OYZ,
- OXZ
-}
-projection_type;
-
-typedef struct callbacks_str
-{
- void (GLCALLBACK * begin) (GLenum mode);
- void (GLCALLBACK * edgeFlag) (GLboolean flag);
- void (GLCALLBACK * vertex) (GLvoid * v);
- void (GLCALLBACK * end) (void);
- void (GLCALLBACK * error) (GLenum err);
-}
-tess_callbacks;
-
-typedef struct vertex_str
-{
- void *data;
- GLdouble location[3];
- GLdouble x, y;
- GLboolean edge_flag;
- struct vertex_str *shadow_vertex;
- struct vertex_str *next, *previous;
-}
-tess_vertex;
-
-typedef struct contour_str
-{
- GLenum type;
- GLuint vertex_cnt;
- GLdouble area;
- GLenum orientation;
- struct vertex_str *vertices, *last_vertex;
- struct contour_str *next, *previous;
-}
-tess_contour;
-
-typedef struct polygon_str
-{
- GLuint vertex_cnt;
- GLdouble A, B, C, D;
- GLdouble area;
- GLenum orientation;
- struct vertex_str *vertices, *last_vertex;
-}
-tess_polygon;
-
-struct GLUtesselator
-{
- tess_contour *contours, *last_contour;
- GLuint contour_cnt;
- tess_callbacks callbacks;
- tess_polygon *current_polygon;
- GLenum error;
- GLdouble A, B, C, D;
- projection_type projection;
-};
-
-
-extern void tess_call_user_error(GLUtriangulatorObj *, GLenum);
-extern void tess_test_polygon(GLUtriangulatorObj *);
-extern void tess_find_contour_hierarchies(GLUtriangulatorObj *);
-extern void tess_handle_holes(GLUtriangulatorObj *);
-extern void tess_tesselate(GLUtriangulatorObj *);
-extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *);
-
-
-#endif
diff --git a/src/glu/mesa/tesselat.c b/src/glu/mesa/tesselat.c
deleted file mode 100644
index 47d230073fd..00000000000
--- a/src/glu/mesa/tesselat.c
+++ /dev/null
@@ -1,406 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <stdlib.h>
-#include <math.h>
-#include "tess.h"
-#endif
-
-
-
-static GLboolean edge_flag;
-
-static void emit_triangle(GLUtriangulatorObj *, tess_vertex *,
- tess_vertex *, tess_vertex *);
-
-static void emit_triangle_with_edge_flag(GLUtriangulatorObj *,
- tess_vertex *, GLboolean,
- tess_vertex *, GLboolean,
- tess_vertex *, GLboolean);
-
-static GLdouble
-twice_the_triangle_area(tess_vertex * va, tess_vertex * vb, tess_vertex * vc)
-{
- return (vb->x - va->x) * (vc->y - va->y) - (vb->y - va->y) * (vc->x -
- va->x);
-}
-
-static GLboolean
-left(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y)
-{
- if (A * x + B * y + C > -EPSILON)
- return GL_TRUE;
- else
- return GL_FALSE;
-}
-
-static GLboolean
-right(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y)
-{
- if (A * x + B * y + C < EPSILON)
- return GL_TRUE;
- else
- return GL_FALSE;
-}
-
-static GLint
-convex_ccw(tess_vertex * va,
- tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj)
-{
- GLdouble d;
-
- d = twice_the_triangle_area(va, vb, vc);
-
- if (d > EPSILON) {
- return 1;
- }
- else if (d < -EPSILON) {
- return 0;
- }
- else {
- return -1;
- }
-}
-
-static GLint
-convex_cw(tess_vertex * va,
- tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj)
-{
- GLdouble d;
-
- d = twice_the_triangle_area(va, vb, vc);
-
- if (d < -EPSILON) {
- return 1;
- }
- else if (d > EPSILON) {
- return 0;
- }
- else {
- return -1;
- }
-}
-
-static GLboolean
-diagonal_ccw(tess_vertex * va,
- tess_vertex * vb,
- GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vc = va->next, *vertex, *shadow_vertex;
- struct
- {
- GLdouble A, B, C;
- }
- ac, cb, ba;
- GLdouble x, y;
-
- GLint res = convex_ccw(va, vc, vb, tobj);
- if (res == 0)
- return GL_FALSE;
- if (res == -1)
- return GL_TRUE;
-
- ba.A = vb->y - va->y;
- ba.B = va->x - vb->x;
- ba.C = -ba.A * va->x - ba.B * va->y;
- ac.A = va->y - vc->y;
- ac.B = vc->x - va->x;
- ac.C = -ac.A * vc->x - ac.B * vc->y;
- cb.A = vc->y - vb->y;
- cb.B = vb->x - vc->x;
- cb.C = -cb.A * vb->x - cb.B * vb->y;
- for (vertex = vb->next; vertex != va; vertex = vertex->next) {
- shadow_vertex = vertex->shadow_vertex;
- if (shadow_vertex != NULL &&
- (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc))
- continue;
- x = vertex->x;
- y = vertex->y;
- if (left(ba.A, ba.B, ba.C, x, y) &&
- left(ac.A, ac.B, ac.C, x, y) && left(cb.A, cb.B, cb.C, x, y))
- return GL_FALSE;
- }
- return GL_TRUE;
-}
-
-static GLboolean
-diagonal_cw(tess_vertex * va,
- tess_vertex * vb,
- GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vc = va->next, *vertex, *shadow_vertex;
- struct
- {
- GLdouble A, B, C;
- }
- ac, cb, ba;
- GLdouble x, y;
-
- GLint res = convex_cw(va, vc, vb, tobj);
- if (res == 0)
- return GL_FALSE;
- if (res == -1)
- return GL_TRUE;
-
- ba.A = vb->y - va->y;
- ba.B = va->x - vb->x;
- ba.C = -ba.A * va->x - ba.B * va->y;
- ac.A = va->y - vc->y;
- ac.B = vc->x - va->x;
- ac.C = -ac.A * vc->x - ac.B * vc->y;
- cb.A = vc->y - vb->y;
- cb.B = vb->x - vc->x;
- cb.C = -cb.A * vb->x - cb.B * vb->y;
- for (vertex = vb->next; vertex != va; vertex = vertex->next) {
- shadow_vertex = vertex->shadow_vertex;
- if (shadow_vertex != NULL &&
- (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc))
- continue;
- x = vertex->x;
- y = vertex->y;
- if (right(ba.A, ba.B, ba.C, x, y) &&
- right(ac.A, ac.B, ac.C, x, y) && right(cb.A, cb.B, cb.C, x, y))
- return GL_FALSE;
- }
- return GL_TRUE;
-}
-
-static void
-clip_ear(GLUtriangulatorObj * tobj, tess_vertex * v, tess_contour * contour)
-{
- emit_triangle(tobj, v->previous, v, v->next);
- /* the first in the list */
- if (contour->vertices == v) {
- contour->vertices = v->next;
- contour->last_vertex->next = v->next;
- v->next->previous = contour->last_vertex;
- }
- else
- /* the last ? */
- if (contour->last_vertex == v) {
- contour->vertices->previous = v->previous;
- v->previous->next = v->next;
- contour->last_vertex = v->previous;
- }
- else {
- v->next->previous = v->previous;
- v->previous->next = v->next;
- }
- free(v);
- --(contour->vertex_cnt);
-}
-
-static void
-clip_ear_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_vertex * v, tess_contour * contour)
-{
- emit_triangle_with_edge_flag(tobj, v->previous, v->previous->edge_flag,
- v, v->edge_flag, v->next, GL_FALSE);
- v->previous->edge_flag = GL_FALSE;
- /* the first in the list */
- if (contour->vertices == v) {
- contour->vertices = v->next;
- contour->last_vertex->next = v->next;
- v->next->previous = contour->last_vertex;
- }
- else
- /* the last ? */
- if (contour->last_vertex == v) {
- contour->vertices->previous = v->previous;
- v->previous->next = v->next;
- contour->last_vertex = v->previous;
- }
- else {
- v->next->previous = v->previous;
- v->previous->next = v->next;
- }
- free(v);
- --(contour->vertex_cnt);
-}
-
-static void
-triangulate_ccw(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-static void
-triangulate_cw(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_cw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-static void
-triangulate_ccw_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear_with_edge_flag(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-static void
-triangulate_cw_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_cw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear_with_edge_flag(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-void
-tess_tesselate(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour;
-
- for (contour = tobj->contours; contour != NULL; contour = contour->next) {
- if (contour->orientation == GLU_CCW) {
- triangulate_ccw(tobj, contour);
- }
- else {
- triangulate_cw(tobj, contour);
- }
- if (tobj->error != GLU_NO_ERROR)
- return;
-
- /* emit the last triangle */
- emit_triangle(tobj, contour->vertices, contour->vertices->next,
- contour->vertices->next->next);
- }
-}
-
-void
-tess_tesselate_with_edge_flag(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour;
-
- edge_flag = GL_TRUE;
- /* first callback with edgeFlag set to GL_TRUE */
- (tobj->callbacks.edgeFlag) (GL_TRUE);
-
- for (contour = tobj->contours; contour != NULL; contour = contour->next) {
- if (contour->orientation == GLU_CCW)
- triangulate_ccw_with_edge_flag(tobj, contour);
- else
- triangulate_cw_with_edge_flag(tobj, contour);
- if (tobj->error != GLU_NO_ERROR)
- return;
- /* emit the last triangle */
- emit_triangle_with_edge_flag(tobj, contour->vertices,
- contour->vertices->edge_flag,
- contour->vertices->next,
- contour->vertices->next->edge_flag,
- contour->vertices->next->next,
- contour->vertices->next->next->edge_flag);
- }
-}
-
-static void
-emit_triangle(GLUtriangulatorObj * tobj,
- tess_vertex * v1, tess_vertex * v2, tess_vertex * v3)
-{
- (tobj->callbacks.begin) (GL_TRIANGLES);
- (tobj->callbacks.vertex) (v1->data);
- (tobj->callbacks.vertex) (v2->data);
- (tobj->callbacks.vertex) (v3->data);
- (tobj->callbacks.end) ();
-}
-
-static void
-emit_triangle_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_vertex * v1,
- GLboolean edge_flag1,
- tess_vertex * v2,
- GLboolean edge_flag2,
- tess_vertex * v3, GLboolean edge_flag3)
-{
- (tobj->callbacks.begin) (GL_TRIANGLES);
- if (edge_flag1 != edge_flag) {
- edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE);
- (tobj->callbacks.edgeFlag) (edge_flag);
- }
- (tobj->callbacks.vertex) (v1->data);
- if (edge_flag2 != edge_flag) {
- edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE);
- (tobj->callbacks.edgeFlag) (edge_flag);
- }
- (tobj->callbacks.vertex) (v2->data);
- if (edge_flag3 != edge_flag) {
- edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE);
- (tobj->callbacks.edgeFlag) (edge_flag);
- }
- (tobj->callbacks.vertex) (v3->data);
- (tobj->callbacks.end) ();
-}
diff --git a/src/glu/mini/all.h b/src/glu/mini/all.h
deleted file mode 100644
index d626bee937f..00000000000
--- a/src/glu/mini/all.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* $Id: all.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file includes all .h files needed for the GLU source code for
- * the purpose of precompiled headers.
- *
- * If the preprocessor symbol PCH is defined at compile time then each
- * of the .c files will #include "all.h" only, instead of a bunch of
- * individual .h files.
- */
-
-
-#ifndef GLU_ALL_H
-#define GLU_ALL_H
-
-
-#ifndef PC_HEADER
-This is an error. all.h should be included only if PCH is defined.
-#endif
-
-
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "GL/gl.h"
-#include "GL/glu.h"
-#include "gluP.h"
-#include "nurbs.h"
-#include "tess.h"
-
-
-#endif /*GLU_ALL_H */
diff --git a/src/glu/mini/glu.c b/src/glu/mini/glu.c
deleted file mode 100644
index 5c7722c5f0b..00000000000
--- a/src/glu/mini/glu.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/* $Id: glu.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- * 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.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "gluP.h"
-#endif
-
-
-/*
- * Miscellaneous utility functions
- */
-
-
-#ifndef M_PI
-#define M_PI 3.1415926536
-#endif
-#define EPS 0.00001
-
-#ifndef GLU_INCOMPATIBLE_GL_VERSION
-#define GLU_INCOMPATIBLE_GL_VERSION 100903
-#endif
-
-
-void GLAPIENTRY
-gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez,
- GLdouble centerx, GLdouble centery, GLdouble centerz,
- GLdouble upx, GLdouble upy, GLdouble upz)
-{
- GLfloat m[16];
- GLfloat x[3], y[3], z[3];
- GLfloat mag;
-
- /* Make rotation matrix */
-
- /* Z vector */
- z[0] = eyex - centerx;
- z[1] = eyey - centery;
- z[2] = eyez - centerz;
- mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]);
- if (mag) { /* mpichler, 19950515 */
- z[0] /= mag;
- z[1] /= mag;
- z[2] /= mag;
- }
-
- /* Y vector */
- y[0] = upx;
- y[1] = upy;
- y[2] = upz;
-
- /* X vector = Y cross Z */
- x[0] = y[1] * z[2] - y[2] * z[1];
- x[1] = -y[0] * z[2] + y[2] * z[0];
- x[2] = y[0] * z[1] - y[1] * z[0];
-
- /* Recompute Y = Z cross X */
- y[0] = z[1] * x[2] - z[2] * x[1];
- y[1] = -z[0] * x[2] + z[2] * x[0];
- y[2] = z[0] * x[1] - z[1] * x[0];
-
- /* mpichler, 19950515 */
- /* cross product gives area of parallelogram, which is < 1.0 for
- * non-perpendicular unit-length vectors; so normalize x, y here
- */
-
- mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
- if (mag) {
- x[0] /= mag;
- x[1] /= mag;
- x[2] /= mag;
- }
-
- mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]);
- if (mag) {
- y[0] /= mag;
- y[1] /= mag;
- y[2] /= mag;
- }
-
-#define M(row,col) m[col*4+row]
- M(0, 0) = x[0];
- M(0, 1) = x[1];
- M(0, 2) = x[2];
- M(0, 3) = 0.0;
- M(1, 0) = y[0];
- M(1, 1) = y[1];
- M(1, 2) = y[2];
- M(1, 3) = 0.0;
- M(2, 0) = z[0];
- M(2, 1) = z[1];
- M(2, 2) = z[2];
- M(2, 3) = 0.0;
- M(3, 0) = 0.0;
- M(3, 1) = 0.0;
- M(3, 2) = 0.0;
- M(3, 3) = 1.0;
-#undef M
- glMultMatrixf(m);
-
- /* Translate Eye to Origin */
- glTranslatef(-eyex, -eyey, -eyez);
-
-}
-
-
-
-void GLAPIENTRY
-gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top)
-{
- glOrtho(left, right, bottom, top, -1.0, 1.0);
-}
-
-
-
-static void
-frustum(GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
- GLfloat nearval, GLfloat farval)
-{
- GLfloat x, y, a, b, c, d;
- GLfloat m[16];
-
- x = (2.0 * nearval) / (right - left);
- y = (2.0 * nearval) / (top - bottom);
- a = (right + left) / (right - left);
- b = (top + bottom) / (top - bottom);
- c = -(farval + nearval) / ( farval - nearval);
- d = -(2.0 * farval * nearval) / (farval - nearval);
-
-#define M(row,col) m[col*4+row]
- M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F;
- M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F;
- M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d;
- M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F;
-#undef M
-
- glMultMatrixf(m);
-}
-
-
-void GLAPIENTRY
-gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
-{
- GLfloat xmin, xmax, ymin, ymax;
-
- ymax = zNear * tan(fovy * M_PI / 360.0);
- ymin = -ymax;
- xmin = ymin * aspect;
- xmax = ymax * aspect;
-
- /* don't call glFrustum() because of error semantics (covglu) */
- frustum(xmin, xmax, ymin, ymax, zNear, zFar);
-}
-
-
-
-void GLAPIENTRY
-gluPickMatrix(GLdouble x, GLdouble y,
- GLdouble width, GLdouble height, GLint viewport[4])
-{
- GLfloat m[16];
- GLfloat sx, sy;
- GLfloat tx, ty;
-
- sx = viewport[2] / width;
- sy = viewport[3] / height;
- tx = (viewport[2] + 2.0 * (viewport[0] - x)) / width;
- ty = (viewport[3] + 2.0 * (viewport[1] - y)) / height;
-
-#define M(row,col) m[col*4+row]
- M(0, 0) = sx;
- M(0, 1) = 0.0;
- M(0, 2) = 0.0;
- M(0, 3) = tx;
- M(1, 0) = 0.0;
- M(1, 1) = sy;
- M(1, 2) = 0.0;
- M(1, 3) = ty;
- M(2, 0) = 0.0;
- M(2, 1) = 0.0;
- M(2, 2) = 1.0;
- M(2, 3) = 0.0;
- M(3, 0) = 0.0;
- M(3, 1) = 0.0;
- M(3, 2) = 0.0;
- M(3, 3) = 1.0;
-#undef M
-
- glMultMatrixf(m);
-}
-
-
-
-const GLubyte *GLAPIENTRY
-gluErrorString(GLenum errorCode)
-{
- static char *tess_error[] = {
- "missing gluBeginPolygon",
- "missing gluBeginContour",
- "missing gluEndPolygon",
- "missing gluEndContour",
- "misoriented or self-intersecting loops",
- "coincident vertices",
- "colinear vertices",
- "FIST recovery process fatal error"
- };
- static char *nurbs_error[] = {
- "spline order un-supported",
- "too few knots",
- "valid knot range is empty",
- "decreasing knot sequence knot",
- "knot multiplicity greater than order of spline",
- "endcurve() must follow bgncurve()",
- "bgncurve() must precede endcurve()",
- "missing or extra geometric data",
- "can't draw pwlcurves",
- "missing bgncurve()",
- "missing bgnsurface()",
- "endtrim() must precede endsurface()",
- "bgnsurface() must precede endsurface()",
- "curve of improper type passed as trim curve",
- "bgnsurface() must precede bgntrim()",
- "endtrim() must follow bgntrim()",
- "bgntrim() must precede endtrim()",
- "invalid or missing trim curve",
- "bgntrim() must precede pwlcurve()",
- "pwlcurve referenced twice",
- "pwlcurve and nurbscurve mixed",
- "improper usage of trim data type",
- "nurbscurve referenced twice",
- "nurbscurve and pwlcurve mixed",
- "nurbssurface referenced twice",
- "invalid property",
- "endsurface() must follow bgnsurface()",
- "misoriented trim curves",
- "intersecting trim curves",
- "UNUSED",
- "unconnected trim curves",
- "unknown knot error",
- "negative vertex count encountered",
- "negative byte-stride encountered",
- "unknown type descriptor",
- "null control array or knot vector",
- "duplicate point on pwlcurve"
- };
-
- /* GL Errors */
- if (errorCode == GL_NO_ERROR) {
- return (GLubyte *) "no error";
- }
- else if (errorCode == GL_INVALID_VALUE) {
- return (GLubyte *) "invalid value";
- }
- else if (errorCode == GL_INVALID_ENUM) {
- return (GLubyte *) "invalid enum";
- }
- else if (errorCode == GL_INVALID_OPERATION) {
- return (GLubyte *) "invalid operation";
- }
- else if (errorCode == GL_STACK_OVERFLOW) {
- return (GLubyte *) "stack overflow";
- }
- else if (errorCode == GL_STACK_UNDERFLOW) {
- return (GLubyte *) "stack underflow";
- }
- else if (errorCode == GL_OUT_OF_MEMORY) {
- return (GLubyte *) "out of memory";
- }
- /* GLU Errors */
- else if (errorCode == GLU_NO_ERROR) {
- return (GLubyte *) "no error";
- }
- else if (errorCode == GLU_INVALID_ENUM) {
- return (GLubyte *) "invalid enum";
- }
- else if (errorCode == GLU_INVALID_VALUE) {
- return (GLubyte *) "invalid value";
- }
- else if (errorCode == GLU_OUT_OF_MEMORY) {
- return (GLubyte *) "out of memory";
- }
- else if (errorCode == GLU_INCOMPATIBLE_GL_VERSION) {
- return (GLubyte *) "incompatible GL version";
- }
- else if (errorCode >= GLU_TESS_ERROR1 && errorCode <= GLU_TESS_ERROR8) {
- return (GLubyte *) tess_error[errorCode - GLU_TESS_ERROR1];
- }
- else if (errorCode >= GLU_NURBS_ERROR1 && errorCode <= GLU_NURBS_ERROR37) {
- return (GLubyte *) nurbs_error[errorCode - GLU_NURBS_ERROR1];
- }
- else {
- return NULL;
- }
-}
-
-
-
-/*
- * New in GLU 1.1
- */
-
-const GLubyte *GLAPIENTRY
-gluGetString(GLenum name)
-{
- static char *extensions = "GL_EXT_abgr";
- static char *version = "1.1 Mesa 3.5";
-
- switch (name) {
- case GLU_EXTENSIONS:
- return (GLubyte *) extensions;
- case GLU_VERSION:
- return (GLubyte *) version;
- default:
- return NULL;
- }
-}
-
-
-
-#if 0 /* gluGetProcAddressEXT not finalized yet! */
-
-#ifdef __cplusplus
- /* for BeOS R4.5 */
-void GLAPIENTRY(*gluGetProcAddressEXT(const GLubyte * procName)) (...)
-#else
-void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) ()
-#endif
-{
- struct proc
- {
- const char *name;
- void *address;
- };
- static struct proc procTable[] = {
- {"gluGetProcAddressEXT", (void *) gluGetProcAddressEXT}, /* me! */
-
- /* new 1.1 functions */
- {"gluGetString", (void *) gluGetString},
-
- /* new 1.2 functions */
- {"gluTessBeginPolygon", (void *) gluTessBeginPolygon},
- {"gluTessBeginContour", (void *) gluTessBeginContour},
- {"gluTessEndContour", (void *) gluTessEndContour},
- {"gluTessEndPolygon", (void *) gluTessEndPolygon},
- {"gluGetTessProperty", (void *) gluGetTessProperty},
-
- /* new 1.3 functions */
-
- {NULL, NULL}
- };
- GLuint i;
-
- for (i = 0; procTable[i].address; i++) {
- if (strcmp((const char *) procName, procTable[i].name) == 0)
- return (void (GLAPIENTRY *) ()) procTable[i].address;
- }
-
- return NULL;
-}
-
-#endif
-
-
-
-/*
- * New in GLU 1.3
- */
-#ifdef GLU_VERSION_1_3
-GLboolean GLAPIENTRY
-gluCheckExtension(const GLubyte *extName, const GLubyte * extString)
-{
- assert(extName);
- assert(extString);
- {
- const int len = strlen((const char *) extName);
- const char *start = (const char *) extString;
-
- while (1) {
- const char *c = strstr(start, (const char *) extName);
- if (!c)
- return GL_FALSE;
-
- if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0))
- return GL_TRUE;
-
- start = c + len;
- }
- }
-}
-#endif
diff --git a/src/glu/mini/gluP.h b/src/glu/mini/gluP.h
deleted file mode 100644
index 85fbc33c625..00000000000
--- a/src/glu/mini/gluP.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/* $Id: gluP.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file allows the GLU code to be compiled either with the Mesa
- * headers or with the real OpenGL headers.
- */
-
-
-#ifndef GLUP_H
-#define GLUP_H
-
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include <string.h>
-
-
-#if defined(_WIN32) && !defined(__WIN32__)
-# define __WIN32__
-#endif
-
-#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
-# pragma warning( disable : 4068 ) /* unknown pragma */
-# pragma warning( disable : 4710 ) /* function 'foo' not inlined */
-# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
-# pragma warning( disable : 4127 ) /* conditional expression is constant */
-# if defined(MESA_MINWARN)
-# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
-# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
-# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
-# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
-# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
-# endif
-# if defined(_MSC_VER) && 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(_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
-# define GLAPIENTRYP __stdcall *
-# define GLCALLBACK __stdcall
-# define GLCALLBACKP __stdcall *
-# if defined(__CYGWIN__)
-# define GLCALLBACKPCAST *
-# else
-# define GLCALLBACKPCAST __stdcall *
-# endif
-# define GLWINAPI __stdcall
-# define GLWINAPIV __cdecl
-#else
-/* non-Windows compilation */
-# define GLAPI extern
-# define GLAPIENTRY
-# define GLAPIENTRYP *
-# define GLCALLBACK
-# define GLCALLBACKP *
-# define GLCALLBACKPCAST *
-# define GLWINAPI
-# define GLWINAPIV
-#endif /* WIN32 / CYGWIN bracket */
-
-/* compatibility guard so we don't need to change client code */
-
-#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
-# define CALLBACK GLCALLBACK
-typedef int (GLAPIENTRY *PROC)();
-typedef void *HGLRC;
-typedef void *HDC;
-typedef unsigned long COLORREF;
-#endif
-
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
-# define WGL_FONT_LINES 0
-# define WGL_FONT_POLYGONS 1
-#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;
-#include <gl/mesa_wgl.h>
-#endif
-
-
-
-#ifndef GLU_TESS_ERROR9
- /* If we're using the real OpenGL header files... */
-# define GLU_TESS_ERROR9 100159
-#endif
-
-
-#define GLU_NO_ERROR GL_NO_ERROR
-
-
-/* for Sun: */
-#ifdef SUNOS4
-#define MEMCPY( DST, SRC, BYTES) \
- memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) )
-#else
-#define MEMCPY( DST, SRC, BYTES) \
- memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )
-#endif
-
-
-#ifndef NULL
-# define NULL 0
-#endif
-
-
-#endif
diff --git a/src/glu/mini/mipmap.c b/src/glu/mini/mipmap.c
deleted file mode 100644
index 97297729e78..00000000000
--- a/src/glu/mini/mipmap.c
+++ /dev/null
@@ -1,764 +0,0 @@
-/* $Id: mipmap.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.4
- * Copyright (C) 1995-2000 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.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "gluP.h"
-#endif
-
-
-/*
- * Compute ceiling of integer quotient of A divided by B:
- */
-#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
-
-
-
-#ifdef EPSILON
-#undef EPSILON
-#endif
-#define EPSILON 0.001
-
-
-/* To work around optimizer bug in MSVC4.1 */
-#if defined(__WIN32__) && !defined(OPENSTEP)
-void
-dummy(GLuint j, GLuint k)
-{
-}
-#else
-#define dummy(J, K)
-#endif
-
-
-GLint GLAPIENTRY
-gluScaleImage(GLenum format,
- GLsizei widthin, GLsizei heightin,
- GLenum typein, const void *datain,
- GLsizei widthout, GLsizei heightout,
- GLenum typeout, void *dataout)
-{
- GLint components, i, j, k;
- GLfloat *tempin, *tempout, f;
- GLfloat sx, sy;
- GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels;
- GLint packrowlength, packalignment, packskiprows, packskippixels;
- GLint sizein, sizeout;
- GLint rowstride, rowlen;
-
-
- /* Determine number of components per pixel */
- switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- components = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- components = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- components = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
-#ifdef GL_EXT_abgr
- case GL_ABGR_EXT:
-#endif
- components = 4;
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
- /* Determine bytes per input datum */
- switch (typein) {
- case GL_UNSIGNED_BYTE:
- sizein = sizeof(GLubyte);
- break;
- case GL_BYTE:
- sizein = sizeof(GLbyte);
- break;
- case GL_UNSIGNED_SHORT:
- sizein = sizeof(GLushort);
- break;
- case GL_SHORT:
- sizein = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- sizein = sizeof(GLuint);
- break;
- case GL_INT:
- sizein = sizeof(GLint);
- break;
- case GL_FLOAT:
- sizein = sizeof(GLfloat);
- break;
- case GL_BITMAP:
- /* not implemented yet */
- default:
- return GL_INVALID_ENUM;
- }
-
- /* Determine bytes per output datum */
- switch (typeout) {
- case GL_UNSIGNED_BYTE:
- sizeout = sizeof(GLubyte);
- break;
- case GL_BYTE:
- sizeout = sizeof(GLbyte);
- break;
- case GL_UNSIGNED_SHORT:
- sizeout = sizeof(GLushort);
- break;
- case GL_SHORT:
- sizeout = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- sizeout = sizeof(GLuint);
- break;
- case GL_INT:
- sizeout = sizeof(GLint);
- break;
- case GL_FLOAT:
- sizeout = sizeof(GLfloat);
- break;
- case GL_BITMAP:
- /* not implemented yet */
- default:
- return GL_INVALID_ENUM;
- }
-
- /* Get glPixelStore state */
- glGetFloatv(GL_UNPACK_ROW_LENGTH, &f); unpackrowlength = (int)f;
- glGetFloatv(GL_UNPACK_ALIGNMENT, &f); unpackalignment = (int)f;
- glGetFloatv(GL_UNPACK_SKIP_ROWS, &f); unpackskiprows = (int)f;
- glGetFloatv(GL_UNPACK_SKIP_PIXELS, &f); unpackskippixels = (int)f;
- glGetFloatv(GL_PACK_ROW_LENGTH, &f); packrowlength = (int)f;
- glGetFloatv(GL_PACK_ALIGNMENT, &f); packalignment = (int)f;
- glGetFloatv(GL_PACK_SKIP_ROWS, &f); packskiprows = (int)f;
- glGetFloatv(GL_PACK_SKIP_PIXELS, &f); packskippixels = (int)f;
-
- /* Allocate storage for intermediate images */
- tempin = (GLfloat *) malloc(widthin * heightin
- * components * sizeof(GLfloat));
- if (!tempin) {
- return GLU_OUT_OF_MEMORY;
- }
- tempout = (GLfloat *) malloc(widthout * heightout
- * components * sizeof(GLfloat));
- if (!tempout) {
- free(tempin);
- return GLU_OUT_OF_MEMORY;
- }
-
-
- /*
- * Unpack the pixel data and convert to floating point
- */
-
- if (unpackrowlength > 0) {
- rowlen = unpackrowlength;
- }
- else {
- rowlen = widthin;
- }
- if (sizein >= unpackalignment) {
- rowstride = components * rowlen;
- }
- else {
- rowstride = unpackalignment / sizein
- * CEILING(components * rowlen * sizein, unpackalignment);
- }
-
- switch (typein) {
- case GL_UNSIGNED_BYTE:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLubyte *ubptr = (GLubyte *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * ubptr++;
- }
- }
- break;
- case GL_BYTE:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLbyte *bptr = (GLbyte *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * bptr++;
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLushort *usptr = (GLushort *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * usptr++;
- }
- }
- break;
- case GL_SHORT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLshort *sptr = (GLshort *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * sptr++;
- }
- }
- break;
- case GL_UNSIGNED_INT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLuint *uiptr = (GLuint *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * uiptr++;
- }
- }
- break;
- case GL_INT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLint *iptr = (GLint *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat) * iptr++;
- }
- }
- break;
- case GL_FLOAT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLfloat *fptr = (GLfloat *) datain
- + i * rowstride
- + unpackskiprows * rowstride + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = *fptr++;
- }
- }
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
-
- /*
- * Scale the image!
- */
-
- if (widthout > 1)
- sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1);
- else
- sx = (GLfloat) (widthin - 1);
- if (heightout > 1)
- sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1);
- else
- sy = (GLfloat) (heightin - 1);
-
-/*#define POINT_SAMPLE*/
-#ifdef POINT_SAMPLE
- for (i = 0; i < heightout; i++) {
- GLint ii = i * sy;
- for (j = 0; j < widthout; j++) {
- GLint jj = j * sx;
-
- GLfloat *src = tempin + (ii * widthin + jj) * components;
- GLfloat *dst = tempout + (i * widthout + j) * components;
-
- for (k = 0; k < components; k++) {
- *dst++ = *src++;
- }
- }
- }
-#else
- if (sx < 1.0 && sy < 1.0) {
- /* magnify both width and height: use weighted sample of 4 pixels */
- GLint i0, i1, j0, j1;
- GLfloat alpha, beta;
- GLfloat *src00, *src01, *src10, *src11;
- GLfloat s1, s2;
- GLfloat *dst;
-
- for (i = 0; i < heightout; i++) {
- i0 = i * sy;
- i1 = i0 + 1;
- if (i1 >= heightin)
- i1 = heightin - 1;
-/* i1 = (i+1) * sy - EPSILON;*/
- alpha = i * sy - i0;
- for (j = 0; j < widthout; j++) {
- j0 = j * sx;
- j1 = j0 + 1;
- if (j1 >= widthin)
- j1 = widthin - 1;
-/* j1 = (j+1) * sx - EPSILON; */
- beta = j * sx - j0;
-
- /* compute weighted average of pixels in rect (i0,j0)-(i1,j1) */
- src00 = tempin + (i0 * widthin + j0) * components;
- src01 = tempin + (i0 * widthin + j1) * components;
- src10 = tempin + (i1 * widthin + j0) * components;
- src11 = tempin + (i1 * widthin + j1) * components;
-
- dst = tempout + (i * widthout + j) * components;
-
- for (k = 0; k < components; k++) {
- s1 = *src00++ * (1.0 - beta) + *src01++ * beta;
- s2 = *src10++ * (1.0 - beta) + *src11++ * beta;
- *dst++ = s1 * (1.0 - alpha) + s2 * alpha;
- }
- }
- }
- }
- else {
- /* shrink width and/or height: use an unweighted box filter */
- GLint i0, i1;
- GLint j0, j1;
- GLint ii, jj;
- GLfloat sum, *dst;
-
- for (i = 0; i < heightout; i++) {
- i0 = i * sy;
- i1 = i0 + 1;
- if (i1 >= heightin)
- i1 = heightin - 1;
-/* i1 = (i+1) * sy - EPSILON; */
- for (j = 0; j < widthout; j++) {
- j0 = j * sx;
- j1 = j0 + 1;
- if (j1 >= widthin)
- j1 = widthin - 1;
-/* j1 = (j+1) * sx - EPSILON; */
-
- dst = tempout + (i * widthout + j) * components;
-
- /* compute average of pixels in the rectangle (i0,j0)-(i1,j1) */
- for (k = 0; k < components; k++) {
- sum = 0.0;
- for (ii = i0; ii <= i1; ii++) {
- for (jj = j0; jj <= j1; jj++) {
- sum += *(tempin + (ii * widthin + jj) * components + k);
- }
- }
- sum /= (j1 - j0 + 1) * (i1 - i0 + 1);
- *dst++ = sum;
- }
- }
- }
- }
-#endif
-
-
- /*
- * Return output image
- */
-
- if (packrowlength > 0) {
- rowlen = packrowlength;
- }
- else {
- rowlen = widthout;
- }
- if (sizeout >= packalignment) {
- rowstride = components * rowlen;
- }
- else {
- rowstride = packalignment / sizeout
- * CEILING(components * rowlen * sizeout, packalignment);
- }
-
- switch (typeout) {
- case GL_UNSIGNED_BYTE:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLubyte *ubptr = (GLubyte *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *ubptr++ = (GLubyte) tempout[k++];
- }
- }
- break;
- case GL_BYTE:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLbyte *bptr = (GLbyte *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *bptr++ = (GLbyte) tempout[k++];
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLushort *usptr = (GLushort *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *usptr++ = (GLushort) tempout[k++];
- }
- }
- break;
- case GL_SHORT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLshort *sptr = (GLshort *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *sptr++ = (GLshort) tempout[k++];
- }
- }
- break;
- case GL_UNSIGNED_INT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLuint *uiptr = (GLuint *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *uiptr++ = (GLuint) tempout[k++];
- }
- }
- break;
- case GL_INT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLint *iptr = (GLint *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *iptr++ = (GLint) tempout[k++];
- }
- }
- break;
- case GL_FLOAT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLfloat *fptr = (GLfloat *) dataout
- + i * rowstride
- + packskiprows * rowstride + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *fptr++ = tempout[k++];
- }
- }
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
-
- /* free temporary image storage */
- free(tempin);
- free(tempout);
-
- return 0;
-}
-
-
-
-/*
- * Return the largest k such that 2^k <= n.
- */
-static GLint
-ilog2(GLint n)
-{
- GLint k;
-
- if (n <= 0)
- return 0;
- for (k = 0; n >>= 1; k++);
- return k;
-}
-
-
-
-/*
- * Find the value nearest to n which is also a power of two.
- */
-static GLint
-round2(GLint n)
-{
- GLint m;
-
- for (m = 1; m < n; m *= 2);
-
- /* m>=n */
- if (m - n <= n - m / 2) {
- return m;
- }
- else {
- return m / 2;
- }
-}
-
-
-/*
- * Given an pixel format and data type, return the number of bytes to
- * store one pixel.
- */
-static GLint
-bytes_per_pixel(GLenum format, GLenum type)
-{
- GLint n, m;
-
- switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- n = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- n = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- n = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
-#ifdef GL_EXT_abgr
- case GL_ABGR_EXT:
-#endif
- n = 4;
- break;
- default:
- n = 0;
- }
-
- switch (type) {
- case GL_UNSIGNED_BYTE:
- m = sizeof(GLubyte);
- break;
- case GL_BYTE:
- m = sizeof(GLbyte);
- break;
- case GL_BITMAP:
- m = 1;
- break;
- case GL_UNSIGNED_SHORT:
- m = sizeof(GLushort);
- break;
- case GL_SHORT:
- m = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- m = sizeof(GLuint);
- break;
- case GL_INT:
- m = sizeof(GLint);
- break;
- case GL_FLOAT:
- m = sizeof(GLfloat);
- break;
- default:
- m = 0;
- }
-
- return n * m;
-}
-
-
-
-/*
- * WARNING: This function isn't finished and has never been tested!!!!
- */
-GLint GLAPIENTRY
-gluBuild1DMipmaps(GLenum target, GLint components,
- GLsizei width, GLenum format, GLenum type, const void *data)
-{
- return 0;
-}
-
-
-
-GLint GLAPIENTRY
-gluBuild2DMipmaps(GLenum target, GLint components,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const void *data)
-{
- GLint w, h;
- GLint maxsize;
- void *image, *newimage;
- GLint neww, newh, level, bpp;
- int error;
- GLboolean done;
- GLint retval = 0;
- GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels;
- GLint packrowlength, packalignment, packskiprows, packskippixels;
- GLfloat f;
-
- if (width < 1 || height < 1)
- return GLU_INVALID_VALUE;
-
- glGetFloatv(GL_MAX_TEXTURE_SIZE, &f); maxsize = (int)f;
-
- w = round2(width);
- if (w > maxsize) {
- w = maxsize;
- }
- h = round2(height);
- if (h > maxsize) {
- h = maxsize;
- }
-
- bpp = bytes_per_pixel(format, type);
- if (bpp == 0) {
- /* probably a bad format or type enum */
- return GLU_INVALID_ENUM;
- }
-
- /* Get current glPixelStore values */
- glGetFloatv(GL_UNPACK_ROW_LENGTH, &f); unpackrowlength = (int)f;
- glGetFloatv(GL_UNPACK_ALIGNMENT, &f); unpackalignment = (int)f;
- glGetFloatv(GL_UNPACK_SKIP_ROWS, &f); unpackskiprows = (int)f;
- glGetFloatv(GL_UNPACK_SKIP_PIXELS, &f); unpackskippixels = (int)f;
- glGetFloatv(GL_PACK_ROW_LENGTH, &f); packrowlength = (int)f;
- glGetFloatv(GL_PACK_ALIGNMENT, &f); packalignment = (int)f;
- glGetFloatv(GL_PACK_SKIP_ROWS, &f); packskiprows = (int)f;
- glGetFloatv(GL_PACK_SKIP_PIXELS, &f); packskippixels = (int)f;
-
- /* set pixel packing */
- glPixelStorei(GL_PACK_ROW_LENGTH, 0);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_SKIP_ROWS, 0);
- glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
-
- done = GL_FALSE;
-
- if (w != width || h != height) {
- /* must rescale image to get "top" mipmap texture image */
- image = malloc((w + 4) * h * bpp);
- if (!image) {
- return GLU_OUT_OF_MEMORY;
- }
- error = gluScaleImage(format, width, height, type, data,
- w, h, type, image);
- if (error) {
- retval = error;
- done = GL_TRUE;
- }
- }
- else {
- image = (void *) data;
- }
-
- level = 0;
- while (!done) {
- if (image != data) {
- /* set pixel unpacking */
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- }
-
- glTexImage2D(target, level, components, w, h, 0, format, type, image);
-
- if (w == 1 && h == 1)
- break;
-
- neww = (w < 2) ? 1 : w / 2;
- newh = (h < 2) ? 1 : h / 2;
- newimage = malloc((neww + 4) * newh * bpp);
- if (!newimage) {
- return GLU_OUT_OF_MEMORY;
- }
-
- error = gluScaleImage(format, w, h, type, image,
- neww, newh, type, newimage);
- if (error) {
- retval = error;
- done = GL_TRUE;
- }
-
- if (image != data) {
- free(image);
- }
- image = newimage;
-
- w = neww;
- h = newh;
- level++;
- }
-
- if (image != data) {
- free(image);
- }
-
- /* Restore original glPixelStore state */
- glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength);
- glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels);
- glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength);
- glPixelStorei(GL_PACK_ALIGNMENT, packalignment);
- glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows);
- glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels);
-
- return retval;
-}
diff --git a/src/glu/mini/nurbs.c b/src/glu/mini/nurbs.c
deleted file mode 100644
index 93c0dd3ce23..00000000000
--- a/src/glu/mini/nurbs.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/* $Id: nurbs.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#include "gluP.h"
-#include "nurbs.h"
-#endif
-
-
-void
-call_user_error(GLUnurbsObj * nobj, GLenum error)
-{
- nobj->error = error;
- if (nobj->error_callback != NULL) {
- (*(nobj->error_callback)) (error);
- }
- else {
- printf("NURBS error %d %s\n", error, (char *) gluErrorString(error));
- }
-}
-
-
-
-GLUnurbsObj *GLAPIENTRY
-gluNewNurbsRenderer(void)
-{
- GLUnurbsObj *n;
- GLfloat tmp_viewport[4];
- GLint i, j;
-
- n = (GLUnurbsObj *) malloc(sizeof(GLUnurbsObj));
- return n;
-}
-
-
-
-void GLAPIENTRY
-gluDeleteNurbsRenderer(GLUnurbsObj * nobj)
-{
- if (nobj) {
- free(nobj);
- }
-}
-
-
-
-void GLAPIENTRY
-gluLoadSamplingMatrices(GLUnurbsObj * nobj,
- const GLfloat modelMatrix[16],
- const GLfloat projMatrix[16], const GLint viewport[4])
-{
-}
-
-
-void GLAPIENTRY
-gluNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat value)
-{
-}
-
-
-void GLAPIENTRY
-gluGetNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat * value)
-{
-}
-
-
-
-void GLAPIENTRY
-gluBeginCurve(GLUnurbsObj * nobj)
-{
-}
-
-
-void GLAPIENTRY
-gluEndCurve(GLUnurbsObj * nobj)
-{
-}
-
-
-void GLAPIENTRY
-gluNurbsCurve(GLUnurbsObj * nobj, GLint nknots, GLfloat * knot,
- GLint stride, GLfloat * ctlarray, GLint order, GLenum type)
-{
-}
-
-
-void GLAPIENTRY
-gluBeginSurface(GLUnurbsObj * nobj)
-{
-}
-
-
-void GLAPIENTRY
-gluEndSurface(GLUnurbsObj * nobj)
-{
-}
-
-
-void GLAPIENTRY
-gluNurbsSurface(GLUnurbsObj * nobj,
- GLint sknot_count, GLfloat * sknot,
- GLint tknot_count, GLfloat * tknot,
- GLint s_stride, GLint t_stride,
- GLfloat * ctrlarray, GLint sorder, GLint torder, GLenum type)
-{
-}
-
-
-void GLAPIENTRY
-gluNurbsCallback(GLUnurbsObj * nobj, GLenum which, void (GLCALLBACK * fn) ())
-{
-}
-
-void GLAPIENTRY
-gluBeginTrim(GLUnurbsObj * nobj)
-{
-}
-
-void GLAPIENTRY
-gluPwlCurve(GLUnurbsObj * nobj, GLint count, GLfloat * array, GLint stride,
- GLenum type)
-{
-}
-
-void GLAPIENTRY
-gluEndTrim(GLUnurbsObj * nobj)
-{
-}
diff --git a/src/glu/mini/nurbs.h b/src/glu/mini/nurbs.h
deleted file mode 100644
index c9c9c094f1a..00000000000
--- a/src/glu/mini/nurbs.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/* $Id: nurbs.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifndef NURBS_H
-#define NURBS_H
-
-
-#define EPSILON 1e-06 /* epsilon for double precision compares */
-
-typedef enum
-{
- GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM,
- GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE
-}
-GLU_nurbs_enum;
-
-typedef enum
-{
- GLU_TRIM_NURBS, GLU_TRIM_PWL
-}
-GLU_trim_enum;
-
-typedef struct
-{
- GLint sknot_count;
- GLfloat *sknot;
- GLint tknot_count;
- GLfloat *tknot;
- GLint s_stride;
- GLint t_stride;
- GLfloat *ctrlarray;
- GLint sorder;
- GLint torder;
- GLint dim;
- GLenum type;
-}
-surface_attribs;
-
-typedef struct
-{
- surface_attribs geom;
- surface_attribs color;
- surface_attribs texture;
- surface_attribs normal;
-}
-nurbs_surface;
-
-typedef struct
-{
- GLint knot_count;
- GLfloat *knot;
- GLint stride;
- GLfloat *ctrlarray;
- GLint order;
- GLint dim;
- GLenum type;
-}
-curve_attribs;
-
-typedef struct
-{
- GLint pt_count;
- GLfloat *ctrlarray;
- GLint stride;
- GLint dim;
- GLenum type;
-}
-pwl_curve_attribs;
-
-typedef struct
-{
- curve_attribs geom;
- curve_attribs color;
- curve_attribs texture;
- curve_attribs normal;
-}
-nurbs_curve;
-
-typedef struct trim_list_str
-{
- GLU_trim_enum trim_type;
- union
- {
- pwl_curve_attribs pwl_curve;
- curve_attribs nurbs_curve;
- }
- curve;
- struct trim_list_str *next;
-}
-trim_list;
-
-typedef struct seg_trim_str
-{
- GLfloat *points;
- GLint pt_cnt, seg_array_len;
- struct seg_trim_str *next;
-}
-trim_segments;
-
-typedef struct nurbs_trim_str
-{
- trim_list *trim_loop;
- trim_segments *segments;
- struct nurbs_trim_str *next;
-}
-nurbs_trim;
-
-typedef struct
-{
- GLfloat model[16], proj[16], viewport[4];
-}
-culling_and_sampling_str;
-
-struct GLUnurbs
-{
- GLboolean culling;
- GLenum error;
- void (GLCALLBACK * error_callback) (GLenum err);
- GLenum display_mode;
- GLU_nurbs_enum nurbs_type;
- GLboolean auto_load_matrix;
- culling_and_sampling_str sampling_matrices;
- GLenum sampling_method;
- GLfloat sampling_tolerance;
- GLfloat parametric_tolerance;
- GLint u_step, v_step;
- nurbs_surface surface;
- nurbs_curve curve;
- nurbs_trim *trim;
-};
-
-typedef struct
-{
- GLfloat *knot;
- GLint nknots;
- GLfloat *unified_knot;
- GLint unified_nknots;
- GLint order;
- GLint t_min, t_max;
- GLint delta_nknots;
- GLboolean open_at_begin, open_at_end;
- GLfloat *new_knot;
- GLfloat *alpha;
-}
-knot_str_type;
-
-typedef struct
-{
- GLfloat *geom_ctrl;
- GLint geom_s_stride, geom_t_stride;
- GLfloat **geom_offsets;
- GLint geom_s_pt_cnt, geom_t_pt_cnt;
- GLfloat *color_ctrl;
- GLint color_s_stride, color_t_stride;
- GLfloat **color_offsets;
- GLint color_s_pt_cnt, color_t_pt_cnt;
- GLfloat *normal_ctrl;
- GLint normal_s_stride, normal_t_stride;
- GLfloat **normal_offsets;
- GLint normal_s_pt_cnt, normal_t_pt_cnt;
- GLfloat *texture_ctrl;
- GLint texture_s_stride, texture_t_stride;
- GLfloat **texture_offsets;
- GLint texture_s_pt_cnt, texture_t_pt_cnt;
- GLint s_bezier_cnt, t_bezier_cnt;
-}
-new_ctrl_type;
-
-extern void call_user_error(GLUnurbsObj * nobj, GLenum error);
-
-extern GLenum test_knot(GLint nknots, GLfloat * knot, GLint order);
-
-extern GLenum explode_knot(knot_str_type * the_knot);
-
-extern GLenum calc_alphas(knot_str_type * the_knot);
-
-extern GLenum calc_new_ctrl_pts(GLfloat * ctrl, GLint stride,
- knot_str_type * the_knot, GLint dim,
- GLfloat ** new_ctrl, GLint * ncontrol);
-
-extern GLenum glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * new_ctrl,
- GLint n_ctrl, GLint order, GLint dim,
- GLint ** factors);
-
-extern GLenum glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- int **sfactors, GLint ** tfactors);
-
-extern GLenum glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- int **sfactors, GLint ** tfactors);
-
-extern GLenum glu_do_sampling_param_3D(GLUnurbsObj * nobj,
- new_ctrl_type * new_ctrl,
- int **sfactors, GLint ** tfactors);
-
-extern GLboolean fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * ctrl,
- GLint n_ctrl, GLint stride, GLint dim);
-
-extern GLboolean fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * ctrl,
- GLint s_n_ctrl, GLint t_n_ctrl,
- GLint s_stride, GLint t_stride,
- GLint dim);
-
-extern void do_nurbs_curve(GLUnurbsObj * nobj);
-
-extern void do_nurbs_surface(GLUnurbsObj * nobj);
-
-extern GLenum patch_trimming(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl,
- GLint * sfactors, GLint * tfactors);
-
-extern void collect_unified_knot(knot_str_type * dest, knot_str_type * src,
- GLfloat maximal_min_knot,
- GLfloat minimal_max_knot);
-
-extern GLenum select_knot_working_range(GLUnurbsObj * nobj,
- knot_str_type * geom_knot,
- knot_str_type * color_knot,
- knot_str_type * normal_knot,
- knot_str_type * texture_knot);
-
-extern void free_unified_knots(knot_str_type * geom_knot,
- knot_str_type * color_knot,
- knot_str_type * normal_knot,
- knot_str_type * texture_knot);
-
-
-
-#endif
diff --git a/src/glu/mini/nurbscrv.c b/src/glu/mini/nurbscrv.c
deleted file mode 100644
index 62d91b46d3f..00000000000
--- a/src/glu/mini/nurbscrv.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* $Id: nurbscrv.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-/*
- * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
- * See README2 for more info.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include "gluP.h"
-#include "nurbs.h"
-#endif
-
-
-
-/* main NURBS curve procedure */
-void
-do_nurbs_curve(GLUnurbsObj * nobj)
-{
- GLint geom_order, color_order = 0, normal_order = 0, texture_order = 0;
- GLenum geom_type;
- GLint n_ctrl;
- GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl,
- *new_texture_ctrl;
- GLfloat *geom_ctrl = 0, *color_ctrl = 0, *normal_ctrl = 0, *texture_ctrl = 0;
- GLint *factors;
- GLint i, j;
- GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0;
-
- /* test the user supplied data */
- if (test_nurbs_curves(nobj) != GLU_NO_ERROR)
- return;
-
- if (convert_curves(nobj, &new_geom_ctrl, &n_ctrl, &new_color_ctrl,
- &new_normal_ctrl, &new_texture_ctrl) != GLU_NO_ERROR)
- return;
-
- geom_order = nobj->curve.geom.order;
- geom_type = nobj->curve.geom.type;
- geom_dim = nobj->curve.geom.dim;
-
- if (glu_do_sampling_crv(nobj, new_geom_ctrl, n_ctrl, geom_order, geom_dim,
- &factors) != GLU_NO_ERROR) {
- free(new_geom_ctrl);
- if (new_color_ctrl)
- free(new_color_ctrl);
- if (new_normal_ctrl)
- free(new_normal_ctrl);
- if (new_texture_ctrl)
- free(new_texture_ctrl);
- return;
- }
- glEnable(geom_type);
- if (new_color_ctrl) {
- glEnable(nobj->curve.color.type);
- color_dim = nobj->curve.color.dim;
- color_ctrl = new_color_ctrl;
- color_order = nobj->curve.color.order;
- }
- if (new_normal_ctrl) {
- glEnable(nobj->curve.normal.type);
- normal_dim = nobj->curve.normal.dim;
- normal_ctrl = new_normal_ctrl;
- normal_order = nobj->curve.normal.order;
- }
- if (new_texture_ctrl) {
- glEnable(nobj->curve.texture.type);
- texture_dim = nobj->curve.texture.dim;
- texture_ctrl = new_texture_ctrl;
- texture_order = nobj->curve.texture.order;
- }
- for (i = 0, j = 0, geom_ctrl = new_geom_ctrl;
- i < n_ctrl; i += geom_order, j++, geom_ctrl += geom_order * geom_dim) {
- if (fine_culling_test_2D
- (nobj, geom_ctrl, geom_order, geom_dim, geom_dim)) {
- color_ctrl += color_order * color_dim;
- normal_ctrl += normal_order * normal_dim;
- texture_ctrl += texture_order * texture_dim;
- continue;
- }
- glMap1f(geom_type, 0.0, 1.0, geom_dim, geom_order, geom_ctrl);
- if (new_color_ctrl) {
- glMap1f(nobj->curve.color.type, 0.0, 1.0, color_dim,
- color_order, color_ctrl);
- color_ctrl += color_order * color_dim;
- }
- if (new_normal_ctrl) {
- glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim,
- normal_order, normal_ctrl);
- normal_ctrl += normal_order * normal_dim;
- }
- if (new_texture_ctrl) {
- glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim,
- texture_order, texture_ctrl);
- texture_ctrl += texture_order * texture_dim;
- }
- glMapGrid1f(factors[j], 0.0, 1.0);
- glEvalMesh1(GL_LINE, 0, factors[j]);
- }
- free(new_geom_ctrl);
- free(factors);
- if (new_color_ctrl)
- free(new_color_ctrl);
- if (new_normal_ctrl)
- free(new_normal_ctrl);
- if (new_texture_ctrl)
- free(new_texture_ctrl);
-}
diff --git a/src/glu/mini/polytest.c b/src/glu/mini/polytest.c
deleted file mode 100644
index 52f272a3cb4..00000000000
--- a/src/glu/mini/polytest.c
+++ /dev/null
@@ -1,938 +0,0 @@
-/* $Id: polytest.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include "gluP.h"
-#include "tess.h"
-#endif
-
-
-
-static GLenum store_polygon_as_contour(GLUtriangulatorObj *);
-static void free_current_polygon(tess_polygon *);
-static void prepare_projection_info(GLUtriangulatorObj *);
-static GLdouble twice_the_polygon_area(tess_vertex *, tess_vertex *);
-static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *);
-void tess_find_contour_hierarchies(GLUtriangulatorObj *);
-static GLenum test_for_overlapping_contours(GLUtriangulatorObj *);
-static GLenum contours_overlap(tess_contour *, tess_polygon *);
-static GLenum is_contour_contained_in(tess_contour *, tess_contour *);
-static void add_new_exterior(GLUtriangulatorObj *, tess_contour *);
-static void add_new_interior(GLUtriangulatorObj *, tess_contour *,
- tess_contour *);
-static void add_interior_with_hierarchy_check(GLUtriangulatorObj *,
- tess_contour *, tess_contour *);
-static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *,
- tess_contour *,
- tess_contour *);
-static GLboolean point_in_polygon(tess_contour *, GLdouble, GLdouble);
-static void shift_interior_to_exterior(GLUtriangulatorObj *, tess_contour *);
-static void add_exterior_with_check(GLUtriangulatorObj *, tess_contour *,
- tess_contour *);
-static GLenum cut_out_hole(GLUtriangulatorObj *, tess_contour *,
- tess_contour *);
-static GLenum merge_hole_with_contour(GLUtriangulatorObj *,
- tess_contour *, tess_contour *,
- tess_vertex *, tess_vertex *);
-
-static GLenum
-find_normal(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *va, *vb, *vc;
- GLdouble A, B, C;
- GLdouble A0, A1, A2, B0, B1, B2;
-
- va = polygon->vertices;
- vb = va->next;
- A0 = vb->location[0] - va->location[0];
- A1 = vb->location[1] - va->location[1];
- A2 = vb->location[2] - va->location[2];
- for (vc = vb->next; vc != va; vc = vc->next) {
- B0 = vc->location[0] - va->location[0];
- B1 = vc->location[1] - va->location[1];
- B2 = vc->location[2] - va->location[2];
- A = A1 * B2 - A2 * B1;
- B = A2 * B0 - A0 * B2;
- C = A0 * B1 - A1 * B0;
- if (fabs(A) > EPSILON || fabs(B) > EPSILON || fabs(C) > EPSILON) {
- polygon->A = A;
- polygon->B = B;
- polygon->C = C;
- polygon->D =
- -A * va->location[0] - B * va->location[1] - C * va->location[2];
- return GLU_NO_ERROR;
- }
- }
- tess_call_user_error(tobj, GLU_TESS_ERROR7);
- return GLU_ERROR;
-}
-
-void
-tess_test_polygon(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
-
- /* any vertices defined? */
- if (polygon->vertex_cnt < 3) {
- free_current_polygon(polygon);
- return;
- }
- /* wrap pointers */
- polygon->last_vertex->next = polygon->vertices;
- polygon->vertices->previous = polygon->last_vertex;
- /* determine the normal */
- if (find_normal(tobj) == GLU_ERROR)
- return;
- /* compare the normals of previously defined contours and this one */
- /* first contour define ? */
- if (tobj->contours == NULL) {
- tobj->A = polygon->A;
- tobj->B = polygon->B;
- tobj->C = polygon->C;
- tobj->D = polygon->D;
- /* determine the best projection to use */
- if (fabs(polygon->A) > fabs(polygon->B))
- if (fabs(polygon->A) > fabs(polygon->C))
- tobj->projection = OYZ;
- else
- tobj->projection = OXY;
- else if (fabs(polygon->B) > fabs(polygon->C))
- tobj->projection = OXZ;
- else
- tobj->projection = OXY;
- }
- else {
- GLdouble a[3], b[3];
- tess_vertex *vertex = polygon->vertices;
-
- a[0] = tobj->A;
- a[1] = tobj->B;
- a[2] = tobj->C;
- b[0] = polygon->A;
- b[1] = polygon->B;
- b[2] = polygon->C;
-
- /* compare the normals */
- if (fabs(a[1] * b[2] - a[2] * b[1]) > EPSILON ||
- fabs(a[2] * b[0] - a[0] * b[2]) > EPSILON ||
- fabs(a[0] * b[1] - a[1] * b[0]) > EPSILON) {
- /* not coplanar */
- tess_call_user_error(tobj, GLU_TESS_ERROR9);
- return;
- }
- /* the normals are parallel - test for plane equation */
- if (fabs(a[0] * vertex->location[0] + a[1] * vertex->location[1] +
- a[2] * vertex->location[2] + tobj->D) > EPSILON) {
- /* not the same plane */
- tess_call_user_error(tobj, GLU_TESS_ERROR9);
- return;
- }
- }
- prepare_projection_info(tobj);
- if (verify_edge_vertex_intersections(tobj) == GLU_ERROR)
- return;
- if (test_for_overlapping_contours(tobj) == GLU_ERROR)
- return;
- if (store_polygon_as_contour(tobj) == GLU_ERROR)
- return;
-}
-
-static GLenum
-test_for_overlapping_contours(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour;
- tess_polygon *polygon;
-
- polygon = tobj->current_polygon;
- for (contour = tobj->contours; contour != NULL; contour = contour->next)
- if (contours_overlap(contour, polygon) != GLU_NO_ERROR) {
- tess_call_user_error(tobj, GLU_TESS_ERROR5);
- return GLU_ERROR;
- }
- return GLU_NO_ERROR;
-}
-
-static GLenum
-store_polygon_as_contour(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_contour *contour = tobj->contours;
-
- /* the first contour defined */
- if (contour == NULL) {
- if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- free_current_polygon(polygon);
- return GLU_ERROR;
- }
- tobj->contours = tobj->last_contour = contour;
- contour->next = contour->previous = NULL;
- }
- else {
- if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- free_current_polygon(polygon);
- return GLU_ERROR;
- }
- contour->previous = tobj->last_contour;
- tobj->last_contour->next = contour;
- tobj->last_contour = contour;
- contour->next = NULL;
- }
- /* mark all vertices in new contour as not special */
- /* and all are boundary edges */
- {
- tess_vertex *vertex;
- GLuint vertex_cnt, i;
-
- for (vertex = polygon->vertices, i = 0, vertex_cnt =
- polygon->vertex_cnt; i < vertex_cnt; vertex = vertex->next, i++) {
- vertex->shadow_vertex = NULL;
- vertex->edge_flag = GL_TRUE;
- }
- }
- contour->vertex_cnt = polygon->vertex_cnt;
- contour->area = polygon->area;
- contour->orientation = polygon->orientation;
- contour->type = GLU_UNKNOWN;
- contour->vertices = polygon->vertices;
- contour->last_vertex = polygon->last_vertex;
- polygon->vertices = polygon->last_vertex = NULL;
- polygon->vertex_cnt = 0;
- ++(tobj->contour_cnt);
- return GLU_NO_ERROR;
-}
-
-static void
-free_current_polygon(tess_polygon * polygon)
-{
- tess_vertex *vertex, *vertex_tmp;
- GLuint i;
-
- /* free current_polygon structures */
- for (vertex = polygon->vertices, i = 0; i < polygon->vertex_cnt; i++) {
- vertex_tmp = vertex->next;
- free(vertex);
- vertex = vertex_tmp;
- }
- polygon->vertices = polygon->last_vertex = NULL;
- polygon->vertex_cnt = 0;
-}
-
-static void
-prepare_projection_info(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *vertex, *last_vertex_ptr;
- GLdouble area;
-
- last_vertex_ptr = polygon->last_vertex;
- switch (tobj->projection) {
- case OXY:
- for (vertex = polygon->vertices; vertex != last_vertex_ptr;
- vertex = vertex->next) {
- vertex->x = vertex->location[0];
- vertex->y = vertex->location[1];
- }
- last_vertex_ptr->x = last_vertex_ptr->location[0];
- last_vertex_ptr->y = last_vertex_ptr->location[1];
- break;
- case OXZ:
- for (vertex = polygon->vertices; vertex != last_vertex_ptr;
- vertex = vertex->next) {
- vertex->x = vertex->location[0];
- vertex->y = vertex->location[2];
- }
- last_vertex_ptr->x = last_vertex_ptr->location[0];
- last_vertex_ptr->y = last_vertex_ptr->location[2];
- break;
- case OYZ:
- for (vertex = polygon->vertices; vertex != last_vertex_ptr;
- vertex = vertex->next) {
- vertex->x = vertex->location[1];
- vertex->y = vertex->location[2];
- }
- last_vertex_ptr->x = last_vertex_ptr->location[1];
- last_vertex_ptr->y = last_vertex_ptr->location[2];
- break;
- }
- area = twice_the_polygon_area(polygon->vertices, polygon->last_vertex);
- if (area >= 0.0) {
- polygon->orientation = GLU_CCW;
- polygon->area = area;
- }
- else {
- polygon->orientation = GLU_CW;
- polygon->area = -area;
- }
-}
-
-static GLdouble
-twice_the_polygon_area(tess_vertex * vertex, tess_vertex * last_vertex)
-{
- tess_vertex *next;
- GLdouble area, x, y;
-
- area = 0.0;
- x = vertex->x;
- y = vertex->y;
- vertex = vertex->next;
- for (; vertex != last_vertex; vertex = vertex->next) {
- next = vertex->next;
- area +=
- (vertex->x - x) * (next->y - y) - (vertex->y - y) * (next->x - x);
- }
- return area;
-}
-
-/* test if edges ab and cd intersect */
-/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */
-/* else if adjacent return GLU_TESS_ERROR4 */
-static GLenum
-edge_edge_intersect(tess_vertex * a,
- tess_vertex * b, tess_vertex * c, tess_vertex * d)
-{
- GLdouble denom, r, s;
- GLdouble xba, ydc, yba, xdc, yac, xac;
-
- xba = b->x - a->x;
- yba = b->y - a->y;
- xdc = d->x - c->x;
- ydc = d->y - c->y;
- xac = a->x - c->x;
- yac = a->y - c->y;
- denom = xba * ydc - yba * xdc;
- r = yac * xdc - xac * ydc;
- /* parallel? */
- if (fabs(denom) < EPSILON) {
- if (fabs(r) < EPSILON) {
- /* colinear */
- if (fabs(xba) < EPSILON) {
- /* compare the Y coordinate */
- if (yba > 0.0) {
- if (
- (fabs(a->y - c->y) < EPSILON
- && fabs(c->y - b->y) < EPSILON)
- || (fabs(a->y - d->y) < EPSILON
- && fabs(d->y - b->y) <
- EPSILON)) return GLU_TESS_ERROR4;
-
- }
- else {
- if (
- (fabs(b->y - c->y) < EPSILON
- && fabs(c->y - a->y) < EPSILON)
- || (fabs(b->y - d->y) < EPSILON
- && fabs(d->y - a->y) <
- EPSILON)) return GLU_TESS_ERROR4;
- }
- }
- else {
- /* compare the X coordinate */
- if (xba > 0.0) {
- if (
- (fabs(a->x - c->x) < EPSILON
- && fabs(c->x - b->x) < EPSILON)
- || (fabs(a->x - d->x) < EPSILON
- && fabs(d->x - b->x) <
- EPSILON)) return GLU_TESS_ERROR4;
- }
- else {
- if (
- (fabs(b->x - c->x) < EPSILON
- && fabs(c->x - a->x) < EPSILON)
- || (fabs(b->x - d->x) < EPSILON
- && fabs(d->x - a->x) <
- EPSILON)) return GLU_TESS_ERROR4;
- }
- }
- }
- return GLU_NO_ERROR;
- }
- r /= denom;
- s = (yac * xba - xac * yba) / denom;
- /* test if one vertex lies on other edge */
- if (((fabs(r) < EPSILON || (r < 1.0 + EPSILON && r > 1.0 - EPSILON)) &&
- s > -EPSILON && s < 1.0 + EPSILON) ||
- ((fabs(s) < EPSILON || (s < 1.0 + EPSILON && s > 1.0 - EPSILON)) &&
- r > -EPSILON && r < 1.0 + EPSILON)) {
- return GLU_TESS_ERROR4;
- }
- /* test for crossing */
- if (r > -EPSILON && r < 1.0 + EPSILON && s > -EPSILON && s < 1.0 + EPSILON) {
- return GLU_TESS_ERROR8;
- }
- return GLU_NO_ERROR;
-}
-
-static GLenum
-verify_edge_vertex_intersections(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *vertex1, *last_vertex, *vertex2;
- GLenum test;
-
- last_vertex = polygon->last_vertex;
- vertex1 = last_vertex;
- for (vertex2 = vertex1->next->next;
- vertex2->next != last_vertex; vertex2 = vertex2->next) {
- test = edge_edge_intersect(vertex1, vertex1->next, vertex2,
- vertex2->next);
- if (test != GLU_NO_ERROR) {
- tess_call_user_error(tobj, test);
- return GLU_ERROR;
- }
- }
- for (vertex1 = polygon->vertices;
- vertex1->next->next != last_vertex; vertex1 = vertex1->next) {
- for (vertex2 = vertex1->next->next;
- vertex2 != last_vertex; vertex2 = vertex2->next) {
- test = edge_edge_intersect(vertex1, vertex1->next, vertex2,
- vertex2->next);
- if (test != GLU_NO_ERROR) {
- tess_call_user_error(tobj, test);
- return GLU_ERROR;
- }
- }
- }
- return GLU_NO_ERROR;
-}
-
-static int
-#ifdef WIN32
- __cdecl
-#endif
-area_compare(const void *a, const void *b)
-{
- GLdouble area1, area2;
-
- area1 = (*((tess_contour **) a))->area;
- area2 = (*((tess_contour **) b))->area;
- if (area1 < area2)
- return 1;
- if (area1 > area2)
- return -1;
- return 0;
-}
-
-void
-tess_find_contour_hierarchies(GLUtriangulatorObj * tobj)
-{
- tess_contour **contours; /* dinamic array of pointers */
- tess_contour *tmp_contour_ptr = tobj->contours;
- GLuint cnt, i;
- GLenum result;
- GLboolean hierarchy_changed;
-
- /* any contours? */
- if (tobj->contour_cnt < 2) {
- tobj->contours->type = GLU_EXTERIOR;
- return;
- }
- if ((contours = (tess_contour **)
- malloc(sizeof(tess_contour *) * (tobj->contour_cnt))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- for (tmp_contour_ptr = tobj->contours, cnt = 0;
- tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next)
- contours[cnt++] = tmp_contour_ptr;
- /* now sort the contours in decreasing area size order */
- qsort((void *) contours, (size_t) cnt, (size_t) sizeof(tess_contour *),
- area_compare);
- /* we leave just the first contour - remove others from list */
- tobj->contours = contours[0];
- tobj->contours->next = tobj->contours->previous = NULL;
- tobj->last_contour = tobj->contours;
- tobj->contour_cnt = 1;
- /* first contour is the one with greatest area */
- /* must be EXTERIOR */
- tobj->contours->type = GLU_EXTERIOR;
- tmp_contour_ptr = tobj->contours;
- /* now we play! */
- for (i = 1; i < cnt; i++) {
- hierarchy_changed = GL_FALSE;
- for (tmp_contour_ptr = tobj->contours;
- tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) {
- if (tmp_contour_ptr->type == GLU_EXTERIOR) {
- /* check if contour completely contained in EXTERIOR */
- result = is_contour_contained_in(tmp_contour_ptr, contours[i]);
- switch (result) {
- case GLU_INTERIOR:
- /* now we have to check if contour is inside interiors */
- /* or not */
- /* any interiors? */
- if (tmp_contour_ptr->next != NULL &&
- tmp_contour_ptr->next->type == GLU_INTERIOR) {
- /* for all interior, check if inside any of them */
- /* if not inside any of interiors, its another */
- /* interior */
- /* or it may contain some interiors, then change */
- /* the contained interiors to exterior ones */
- add_interior_with_hierarchy_check(tobj,
- tmp_contour_ptr,
- contours[i]);
- }
- else {
- /* not in interior, add as new interior contour */
- add_new_interior(tobj, tmp_contour_ptr, contours[i]);
- }
- hierarchy_changed = GL_TRUE;
- break;
- case GLU_EXTERIOR:
- /* ooops, the marked as EXTERIOR (contours[i]) is */
- /* actually an interior of tmp_contour_ptr */
- /* reverse the local hierarchy */
- reverse_hierarchy_and_add_exterior(tobj, tmp_contour_ptr,
- contours[i]);
- hierarchy_changed = GL_TRUE;
- break;
- case GLU_NO_ERROR:
- break;
- default:
- abort();
- }
- }
- if (hierarchy_changed)
- break; /* break from for loop */
- }
- if (hierarchy_changed == GL_FALSE) {
- /* disjoint with all contours, add to contour list */
- add_new_exterior(tobj, contours[i]);
- }
- }
- free(contours);
-}
-
-/* returns GLU_INTERIOR if inner is completey enclosed within outer */
-/* returns GLU_EXTERIOR if outer is completely enclosed within inner */
-/* returns GLU_NO_ERROR if contours are disjoint */
-static GLenum
-is_contour_contained_in(tess_contour * outer, tess_contour * inner)
-{
- GLenum relation_flag;
-
- /* set relation_flag to relation of containment of first inner vertex */
- /* regarding outer contour */
- if (point_in_polygon(outer, inner->vertices->x, inner->vertices->y))
- relation_flag = GLU_INTERIOR;
- else
- relation_flag = GLU_EXTERIOR;
- if (relation_flag == GLU_INTERIOR)
- return GLU_INTERIOR;
- if (point_in_polygon(inner, outer->vertices->x, outer->vertices->y))
- return GLU_EXTERIOR;
- return GLU_NO_ERROR;
-}
-
-static GLboolean
-point_in_polygon(tess_contour * contour, GLdouble x, GLdouble y)
-{
- tess_vertex *v1, *v2;
- GLuint i, vertex_cnt;
- GLdouble xp1, yp1, xp2, yp2;
- GLboolean tst;
-
- tst = GL_FALSE;
- v1 = contour->vertices;
- v2 = contour->vertices->previous;
- for (i = 0, vertex_cnt = contour->vertex_cnt; i < vertex_cnt; i++) {
- xp1 = v1->x;
- yp1 = v1->y;
- xp2 = v2->x;
- yp2 = v2->y;
- if ((((yp1 <= y) && (y < yp2)) || ((yp2 <= y) && (y < yp1))) &&
- (x < (xp2 - xp1) * (y - yp1) / (yp2 - yp1) + xp1))
- tst = (tst == GL_FALSE ? GL_TRUE : GL_FALSE);
- v2 = v1;
- v1 = v1->next;
- }
- return tst;
-}
-
-static GLenum
-contours_overlap(tess_contour * contour, tess_polygon * polygon)
-{
- tess_vertex *vertex1, *vertex2;
- GLuint vertex1_cnt, vertex2_cnt, i, j;
- GLenum test;
-
- vertex1 = contour->vertices;
- vertex2 = polygon->vertices;
- vertex1_cnt = contour->vertex_cnt;
- vertex2_cnt = polygon->vertex_cnt;
- for (i = 0; i < vertex1_cnt; vertex1 = vertex1->next, i++) {
- for (j = 0; j < vertex2_cnt; vertex2 = vertex2->next, j++)
- if ((test = edge_edge_intersect(vertex1, vertex1->next, vertex2,
- vertex2->next)) != GLU_NO_ERROR)
- return test;
- }
- return GLU_NO_ERROR;
-}
-
-static void
-add_new_exterior(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- contour->type = GLU_EXTERIOR;
- contour->next = NULL;
- contour->previous = tobj->last_contour;
- tobj->last_contour->next = contour;
- tobj->last_contour = contour;
-}
-
-static void
-add_new_interior(GLUtriangulatorObj * tobj,
- tess_contour * outer, tess_contour * contour)
-{
- contour->type = GLU_INTERIOR;
- contour->next = outer->next;
- contour->previous = outer;
- if (outer->next != NULL)
- outer->next->previous = contour;
- outer->next = contour;
- if (tobj->last_contour == outer)
- tobj->last_contour = contour;
-}
-
-static void
-add_interior_with_hierarchy_check(GLUtriangulatorObj * tobj,
- tess_contour * outer,
- tess_contour * contour)
-{
- tess_contour *ptr;
-
- /* for all interiors of outer check if they are interior of contour */
- /* if so, change that interior to exterior and move it of of the */
- /* interior sequence */
- if (outer->next != NULL && outer->next->type == GLU_INTERIOR) {
- GLenum test;
-
- for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR;
- ptr = ptr->next) {
- test = is_contour_contained_in(ptr, contour);
- switch (test) {
- case GLU_INTERIOR:
- /* contour is contained in one of the interiors */
- /* check if possibly contained in other exteriors */
- /* move ptr to first EXTERIOR */
- for (; ptr != NULL && ptr->type == GLU_INTERIOR; ptr = ptr->next);
- if (ptr == NULL)
- /* another exterior */
- add_new_exterior(tobj, contour);
- else
- add_exterior_with_check(tobj, ptr, contour);
- return;
- case GLU_EXTERIOR:
- /* one of the interiors is contained in the contour */
- /* change it to EXTERIOR, and shift it away from the */
- /* interior sequence */
- shift_interior_to_exterior(tobj, ptr);
- break;
- case GLU_NO_ERROR:
- /* disjoint */
- break;
- default:
- abort();
- }
- }
- }
- /* add contour to the interior sequence */
- add_new_interior(tobj, outer, contour);
-}
-
-static void
-reverse_hierarchy_and_add_exterior(GLUtriangulatorObj * tobj,
- tess_contour * outer,
- tess_contour * contour)
-{
- tess_contour *ptr;
-
- /* reverse INTERIORS to EXTERIORS */
- /* any INTERIORS? */
- if (outer->next != NULL && outer->next->type == GLU_INTERIOR)
- for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR;
- ptr = ptr->next) ptr->type = GLU_EXTERIOR;
- /* the outer now becomes inner */
- outer->type = GLU_INTERIOR;
- /* contour is the EXTERIOR */
- contour->next = outer;
- if (tobj->contours == outer) {
- /* first contour beeing reversed */
- contour->previous = NULL;
- tobj->contours = contour;
- }
- else {
- outer->previous->next = contour;
- contour->previous = outer->previous;
- }
- outer->previous = contour;
-}
-
-static void
-shift_interior_to_exterior(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- contour->previous->next = contour->next;
- if (contour->next != NULL)
- contour->next->previous = contour->previous;
- else
- tobj->last_contour = contour->previous;
-}
-
-static void
-add_exterior_with_check(GLUtriangulatorObj * tobj,
- tess_contour * outer, tess_contour * contour)
-{
- GLenum test;
-
- /* this contour might be interior to further exteriors - check */
- /* if not, just add as a new exterior */
- for (; outer != NULL && outer->type == GLU_EXTERIOR; outer = outer->next) {
- test = is_contour_contained_in(outer, contour);
- switch (test) {
- case GLU_INTERIOR:
- /* now we have to check if contour is inside interiors */
- /* or not */
- /* any interiors? */
- if (outer->next != NULL && outer->next->type == GLU_INTERIOR) {
- /* for all interior, check if inside any of them */
- /* if not inside any of interiors, its another */
- /* interior */
- /* or it may contain some interiors, then change */
- /* the contained interiors to exterior ones */
- add_interior_with_hierarchy_check(tobj, outer, contour);
- }
- else {
- /* not in interior, add as new interior contour */
- add_new_interior(tobj, outer, contour);
- }
- return;
- case GLU_NO_ERROR:
- /* disjoint */
- break;
- default:
- abort();
- }
- }
- /* add contour to the exterior sequence */
- add_new_exterior(tobj, contour);
-}
-
-void
-tess_handle_holes(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour, *hole;
- GLenum exterior_orientation;
-
- /* verify hole orientation */
- for (contour = tobj->contours; contour != NULL;) {
- exterior_orientation = contour->orientation;
- for (contour = contour->next;
- contour != NULL && contour->type == GLU_INTERIOR;
- contour = contour->next) {
- if (contour->orientation == exterior_orientation) {
- tess_call_user_error(tobj, GLU_TESS_ERROR5);
- return;
- }
- }
- }
- /* now cut-out holes */
- for (contour = tobj->contours; contour != NULL;) {
- hole = contour->next;
- while (hole != NULL && hole->type == GLU_INTERIOR) {
- if (cut_out_hole(tobj, contour, hole) == GLU_ERROR)
- return;
- hole = contour->next;
- }
- contour = contour->next;
- }
-}
-
-static GLenum
-cut_out_hole(GLUtriangulatorObj * tobj,
- tess_contour * contour, tess_contour * hole)
-{
- tess_contour *tmp_hole;
- tess_vertex *v1, *v2, *tmp_vertex;
- GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt;
- GLuint i, j, k;
- GLenum test = 0;
-
- /* find an edge connecting contour and hole not intersecting any other */
- /* edge belonging to either the contour or any of the other holes */
- for (v1 = contour->vertices, vertex1_cnt = contour->vertex_cnt, i = 0;
- i < vertex1_cnt; i++, v1 = v1->next) {
- for (v2 = hole->vertices, vertex2_cnt = hole->vertex_cnt, j = 0;
- j < vertex2_cnt; j++, v2 = v2->next) {
- /* does edge (v1,v2) intersect any edge of contour */
- for (tmp_vertex = contour->vertices, tmp_vertex_cnt =
- contour->vertex_cnt, k = 0; k < tmp_vertex_cnt;
- tmp_vertex = tmp_vertex->next, k++) {
- /* skip edge tests for edges directly connected */
- if (v1 == tmp_vertex || v1 == tmp_vertex->next)
- continue;
- test = edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next);
- if (test != GLU_NO_ERROR)
- break;
- }
- if (test == GLU_NO_ERROR) {
- /* does edge (v1,v2) intersect any edge of hole */
- for (tmp_vertex = hole->vertices,
- tmp_vertex_cnt = hole->vertex_cnt, k = 0;
- k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) {
- /* skip edge tests for edges directly connected */
- if (v2 == tmp_vertex || v2 == tmp_vertex->next)
- continue;
- test =
- edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next);
- if (test != GLU_NO_ERROR)
- break;
- }
- if (test == GLU_NO_ERROR) {
- /* does edge (v1,v2) intersect any other hole? */
- for (tmp_hole = hole->next;
- tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR;
- tmp_hole = tmp_hole->next) {
- /* does edge (v1,v2) intersect any edge of hole */
- for (tmp_vertex = tmp_hole->vertices,
- tmp_vertex_cnt = tmp_hole->vertex_cnt, k = 0;
- k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) {
- test = edge_edge_intersect(v1, v2, tmp_vertex,
- tmp_vertex->next);
- if (test != GLU_NO_ERROR)
- break;
- }
- if (test != GLU_NO_ERROR)
- break;
- }
- }
- }
- if (test == GLU_NO_ERROR) {
- /* edge (v1,v2) is good for eliminating the hole */
- if (merge_hole_with_contour(tobj, contour, hole, v1, v2)
- == GLU_NO_ERROR)
- return GLU_NO_ERROR;
- else
- return GLU_ERROR;
- }
- }
- }
- /* other holes are blocking all possible connections of hole */
- /* with contour, we shift this hole as the last hole and retry */
- for (tmp_hole = hole;
- tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR;
- tmp_hole = tmp_hole->next);
- contour->next = hole->next;
- hole->next->previous = contour;
- if (tmp_hole == NULL) {
- /* last EXTERIOR contour, shift hole as last contour */
- hole->next = NULL;
- hole->previous = tobj->last_contour;
- tobj->last_contour->next = hole;
- tobj->last_contour = hole;
- }
- else {
- tmp_hole->previous->next = hole;
- hole->previous = tmp_hole->previous;
- tmp_hole->previous = hole;
- hole->next = tmp_hole;
- }
- hole = contour->next;
- /* try once again - recurse */
- return cut_out_hole(tobj, contour, hole);
-}
-
-static GLenum
-merge_hole_with_contour(GLUtriangulatorObj * tobj,
- tess_contour * contour,
- tess_contour * hole,
- tess_vertex * v1, tess_vertex * v2)
-{
- tess_vertex *v1_new, *v2_new;
-
- /* make copies of v1 and v2, place them respectively after their originals */
- if ((v1_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- if ((v2_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return GLU_ERROR;
- }
- v1_new->edge_flag = GL_TRUE;
- v1_new->data = v1->data;
- v1_new->location[0] = v1->location[0];
- v1_new->location[1] = v1->location[1];
- v1_new->location[2] = v1->location[2];
- v1_new->x = v1->x;
- v1_new->y = v1->y;
- v1_new->shadow_vertex = v1;
- v1->shadow_vertex = v1_new;
- v1_new->next = v1->next;
- v1_new->previous = v1;
- v1->next->previous = v1_new;
- v1->next = v1_new;
- v2_new->edge_flag = GL_TRUE;
- v2_new->data = v2->data;
- v2_new->location[0] = v2->location[0];
- v2_new->location[1] = v2->location[1];
- v2_new->location[2] = v2->location[2];
- v2_new->x = v2->x;
- v2_new->y = v2->y;
- v2_new->shadow_vertex = v2;
- v2->shadow_vertex = v2_new;
- v2_new->next = v2->next;
- v2_new->previous = v2;
- v2->next->previous = v2_new;
- v2->next = v2_new;
- /* link together the two lists */
- v1->next = v2_new;
- v2_new->previous = v1;
- v2->next = v1_new;
- v1_new->previous = v2;
- /* update the vertex count of the contour */
- contour->vertex_cnt += hole->vertex_cnt + 2;
- /* remove the INTERIOR contour */
- contour->next = hole->next;
- if (hole->next != NULL)
- hole->next->previous = contour;
- free(hole);
- /* update tobj structure */
- --(tobj->contour_cnt);
- if (contour->last_vertex == v1)
- contour->last_vertex = v1_new;
- /* mark two vertices with edge_flag */
- v2->edge_flag = GL_FALSE;
- v1->edge_flag = GL_FALSE;
- return GLU_NO_ERROR;
-}
diff --git a/src/glu/mini/project.c b/src/glu/mini/project.c
deleted file mode 100644
index a2747de55f2..00000000000
--- a/src/glu/mini/project.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/* $Id: project.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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.
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include "gluP.h"
-#endif
-
-
-/*
- * This code was contributed by Marc Buffat (buffat@mecaflu.ec-lyon.fr).
- * Thanks Marc!!!
- */
-
-
-
-/* implementation de gluProject et gluUnproject */
-/* M. Buffat 17/2/95 */
-
-
-
-/*
- * Transform a point (column vector) by a 4x4 matrix. I.e. out = m * in
- * Input: m - the 4x4 matrix
- * in - the 4x1 vector
- * Output: out - the resulting 4x1 vector.
- */
-static void
-transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4])
-{
-#define M(row,col) m[col*4+row]
- out[0] =
- M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3];
- out[1] =
- M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3];
- out[2] =
- M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3];
- out[3] =
- M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3];
-#undef M
-}
-
-
-
-
-/*
- * Perform a 4x4 matrix multiplication (product = a x b).
- * Input: a, b - matrices to multiply
- * Output: product - product of a and b
- */
-static void
-matmul(GLdouble * product, const GLdouble * a, const GLdouble * b)
-{
- /* This matmul was contributed by Thomas Malik */
- GLdouble temp[16];
- GLint i;
-
-#define A(row,col) a[(col<<2)+row]
-#define B(row,col) b[(col<<2)+row]
-#define T(row,col) temp[(col<<2)+row]
-
- /* i-te Zeile */
- for (i = 0; i < 4; i++) {
- T(i, 0) =
- A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i,
- 3) *
- B(3, 0);
- T(i, 1) =
- A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i,
- 3) *
- B(3, 1);
- T(i, 2) =
- A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i,
- 3) *
- B(3, 2);
- T(i, 3) =
- A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i,
- 3) *
- B(3, 3);
- }
-
-#undef A
-#undef B
-#undef T
- MEMCPY(product, temp, 16 * sizeof(GLdouble));
-}
-
-
-
-/*
- * Compute inverse of 4x4 transformation matrix.
- * Code contributed by Jacques Leroy jle@star.be
- * Return GL_TRUE for success, GL_FALSE for failure (singular matrix)
- */
-static GLboolean
-invert_matrix(const GLdouble * m, GLdouble * out)
-{
-/* NB. OpenGL Matrices are COLUMN major. */
-#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; }
-#define MAT(m,r,c) (m)[(c)*4+(r)]
-
- GLdouble wtmp[4][8];
- GLdouble m0, m1, m2, m3, s;
- GLdouble *r0, *r1, *r2, *r3;
-
- r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3];
-
- r0[0] = MAT(m, 0, 0), r0[1] = MAT(m, 0, 1),
- r0[2] = MAT(m, 0, 2), r0[3] = MAT(m, 0, 3),
- r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0,
- r1[0] = MAT(m, 1, 0), r1[1] = MAT(m, 1, 1),
- r1[2] = MAT(m, 1, 2), r1[3] = MAT(m, 1, 3),
- r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0,
- r2[0] = MAT(m, 2, 0), r2[1] = MAT(m, 2, 1),
- r2[2] = MAT(m, 2, 2), r2[3] = MAT(m, 2, 3),
- r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0,
- r3[0] = MAT(m, 3, 0), r3[1] = MAT(m, 3, 1),
- r3[2] = MAT(m, 3, 2), r3[3] = MAT(m, 3, 3),
- r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0;
-
- /* choose pivot - or die */
- if (fabs(r3[0]) > fabs(r2[0]))
- SWAP_ROWS(r3, r2);
- if (fabs(r2[0]) > fabs(r1[0]))
- SWAP_ROWS(r2, r1);
- if (fabs(r1[0]) > fabs(r0[0]))
- SWAP_ROWS(r1, r0);
- if (0.0 == r0[0])
- return GL_FALSE;
-
- /* eliminate first variable */
- m1 = r1[0] / r0[0];
- m2 = r2[0] / r0[0];
- m3 = r3[0] / r0[0];
- s = r0[1];
- r1[1] -= m1 * s;
- r2[1] -= m2 * s;
- r3[1] -= m3 * s;
- s = r0[2];
- r1[2] -= m1 * s;
- r2[2] -= m2 * s;
- r3[2] -= m3 * s;
- s = r0[3];
- r1[3] -= m1 * s;
- r2[3] -= m2 * s;
- r3[3] -= m3 * s;
- s = r0[4];
- if (s != 0.0) {
- r1[4] -= m1 * s;
- r2[4] -= m2 * s;
- r3[4] -= m3 * s;
- }
- s = r0[5];
- if (s != 0.0) {
- r1[5] -= m1 * s;
- r2[5] -= m2 * s;
- r3[5] -= m3 * s;
- }
- s = r0[6];
- if (s != 0.0) {
- r1[6] -= m1 * s;
- r2[6] -= m2 * s;
- r3[6] -= m3 * s;
- }
- s = r0[7];
- if (s != 0.0) {
- r1[7] -= m1 * s;
- r2[7] -= m2 * s;
- r3[7] -= m3 * s;
- }
-
- /* choose pivot - or die */
- if (fabs(r3[1]) > fabs(r2[1]))
- SWAP_ROWS(r3, r2);
- if (fabs(r2[1]) > fabs(r1[1]))
- SWAP_ROWS(r2, r1);
- if (0.0 == r1[1])
- return GL_FALSE;
-
- /* eliminate second variable */
- m2 = r2[1] / r1[1];
- m3 = r3[1] / r1[1];
- r2[2] -= m2 * r1[2];
- r3[2] -= m3 * r1[2];
- r2[3] -= m2 * r1[3];
- r3[3] -= m3 * r1[3];
- s = r1[4];
- if (0.0 != s) {
- r2[4] -= m2 * s;
- r3[4] -= m3 * s;
- }
- s = r1[5];
- if (0.0 != s) {
- r2[5] -= m2 * s;
- r3[5] -= m3 * s;
- }
- s = r1[6];
- if (0.0 != s) {
- r2[6] -= m2 * s;
- r3[6] -= m3 * s;
- }
- s = r1[7];
- if (0.0 != s) {
- r2[7] -= m2 * s;
- r3[7] -= m3 * s;
- }
-
- /* choose pivot - or die */
- if (fabs(r3[2]) > fabs(r2[2]))
- SWAP_ROWS(r3, r2);
- if (0.0 == r2[2])
- return GL_FALSE;
-
- /* eliminate third variable */
- m3 = r3[2] / r2[2];
- r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4],
- r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7];
-
- /* last check */
- if (0.0 == r3[3])
- return GL_FALSE;
-
- s = 1.0 / r3[3]; /* now back substitute row 3 */
- r3[4] *= s;
- r3[5] *= s;
- r3[6] *= s;
- r3[7] *= s;
-
- m2 = r2[3]; /* now back substitute row 2 */
- s = 1.0 / r2[2];
- r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2),
- r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2);
- m1 = r1[3];
- r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1,
- r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1;
- m0 = r0[3];
- r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0,
- r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0;
-
- m1 = r1[2]; /* now back substitute row 1 */
- s = 1.0 / r1[1];
- r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1),
- r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1);
- m0 = r0[2];
- r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0,
- r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0;
-
- m0 = r0[1]; /* now back substitute row 0 */
- s = 1.0 / r0[0];
- r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0),
- r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0);
-
- MAT(out, 0, 0) = r0[4];
- MAT(out, 0, 1) = r0[5], MAT(out, 0, 2) = r0[6];
- MAT(out, 0, 3) = r0[7], MAT(out, 1, 0) = r1[4];
- MAT(out, 1, 1) = r1[5], MAT(out, 1, 2) = r1[6];
- MAT(out, 1, 3) = r1[7], MAT(out, 2, 0) = r2[4];
- MAT(out, 2, 1) = r2[5], MAT(out, 2, 2) = r2[6];
- MAT(out, 2, 3) = r2[7], MAT(out, 3, 0) = r3[4];
- MAT(out, 3, 1) = r3[5], MAT(out, 3, 2) = r3[6];
- MAT(out, 3, 3) = r3[7];
-
- return GL_TRUE;
-
-#undef MAT
-#undef SWAP_ROWS
-}
-
-
-
-/* projection du point (objx,objy,obz) sur l'ecran (winx,winy,winz) */
-GLint GLAPIENTRY
-gluProject(GLdouble objx, GLdouble objy, GLdouble objz,
- const GLdouble model[16], const GLdouble proj[16],
- const GLint viewport[4],
- GLdouble * winx, GLdouble * winy, GLdouble * winz)
-{
- /* matrice de transformation */
- GLdouble in[4], out[4];
-
- /* initilise la matrice et le vecteur a transformer */
- in[0] = objx;
- in[1] = objy;
- in[2] = objz;
- in[3] = 1.0;
- transform_point(out, model, in);
- transform_point(in, proj, out);
-
- /* d'ou le resultat normalise entre -1 et 1 */
- if (in[3] == 0.0)
- return GL_FALSE;
-
- in[0] /= in[3];
- in[1] /= in[3];
- in[2] /= in[3];
-
- /* en coordonnees ecran */
- *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2;
- *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2;
- /* entre 0 et 1 suivant z */
- *winz = (1 + in[2]) / 2;
- return GL_TRUE;
-}
-
-
-
-/* transformation du point ecran (winx,winy,winz) en point objet */
-GLint GLAPIENTRY
-gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz,
- const GLdouble model[16], const GLdouble proj[16],
- const GLint viewport[4],
- GLdouble * objx, GLdouble * objy, GLdouble * objz)
-{
- /* matrice de transformation */
- GLdouble m[16], A[16];
- GLdouble in[4], out[4];
-
- /* transformation coordonnees normalisees entre -1 et 1 */
- in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0;
- in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0;
- in[2] = 2 * winz - 1.0;
- in[3] = 1.0;
-
- /* calcul transformation inverse */
- matmul(A, proj, model);
- invert_matrix(A, m);
-
- /* d'ou les coordonnees objets */
- transform_point(out, m, in);
- if (out[3] == 0.0)
- return GL_FALSE;
- *objx = out[0] / out[3];
- *objy = out[1] / out[3];
- *objz = out[2] / out[3];
- return GL_TRUE;
-}
-
-
-/*
- * New in GLU 1.3
- * This is like gluUnProject but also takes near and far DepthRange values.
- */
-#ifdef GLU_VERSION_1_3
-GLint GLAPIENTRY
-gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw,
- const GLdouble modelMatrix[16],
- const GLdouble projMatrix[16],
- const GLint viewport[4],
- GLclampd nearZ, GLclampd farZ,
- GLdouble * objx, GLdouble * objy, GLdouble * objz,
- GLdouble * objw)
-{
- /* matrice de transformation */
- GLdouble m[16], A[16];
- GLdouble in[4], out[4];
- GLdouble z = nearZ + winz * (farZ - nearZ);
-
- /* transformation coordonnees normalisees entre -1 et 1 */
- in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0;
- in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0;
- in[2] = 2.0 * z - 1.0;
- in[3] = clipw;
-
- /* calcul transformation inverse */
- matmul(A, projMatrix, modelMatrix);
- invert_matrix(A, m);
-
- /* d'ou les coordonnees objets */
- transform_point(out, m, in);
- if (out[3] == 0.0)
- return GL_FALSE;
- *objx = out[0] / out[3];
- *objy = out[1] / out[3];
- *objz = out[2] / out[3];
- *objw = out[3];
- return GL_TRUE;
-}
-#endif
diff --git a/src/glu/mini/quadric.c b/src/glu/mini/quadric.c
deleted file mode 100644
index 015552e1237..00000000000
--- a/src/glu/mini/quadric.c
+++ /dev/null
@@ -1,774 +0,0 @@
-/* $Id: quadric.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1999-2000 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.
- */
-
-
-/* TODO:
- * texture coordinate support
- * flip normals according to orientation
- * there's still some inside/outside orientation bugs in possibly all
- * but the sphere function
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "gluP.h"
-#endif
-
-
-
-#ifndef M_PI
-# define M_PI (3.1415926)
-#endif
-
-
-/*
- * Convert degrees to radians:
- */
-#define DEG_TO_RAD(A) ((A)*(M_PI/180.0))
-
-
-/*
- * Sin and Cos for degree angles:
- */
-#define SIND( A ) sin( (A)*(M_PI/180.0) )
-#define COSD( A) cos( (A)*(M_PI/180.0) )
-
-
-/*
- * Texture coordinates if texture flag is set
- */
-#define TXTR_COORD(x,y) if (qobj->TextureFlag) glTexCoord2f(x,y);
-
-
-
-struct GLUquadric
-{
- GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */
- GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */
- GLboolean TextureFlag; /* Generate texture coords? */
- GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */
- void (GLCALLBACK * ErrorFunc) (GLenum err); /* Error handler callback function */
-};
-
-
-
-/*
- * Process a GLU error.
- */
-static void
-quadric_error(GLUquadricObj * qobj, GLenum error, const char *msg)
-{
- /* Call the error call back function if any */
- if (qobj->ErrorFunc) {
- (*qobj->ErrorFunc) (error);
- }
- /* Print a message to stdout if MESA_DEBUG variable is defined */
- if (getenv("MESA_DEBUG")) {
- fprintf(stderr, "GLUError: %s: %s\n", (char *) gluErrorString(error),
- msg);
- }
-}
-
-
-
-
-GLUquadricObj *GLAPIENTRY
-gluNewQuadric(void)
-{
- GLUquadricObj *q;
-
- q = (GLUquadricObj *) malloc(sizeof(struct GLUquadric));
- if (q) {
- q->DrawStyle = GLU_FILL;
- q->Orientation = GLU_OUTSIDE;
- q->TextureFlag = GL_FALSE;
- q->Normals = GLU_SMOOTH;
- q->ErrorFunc = NULL;
- }
- return q;
-}
-
-
-
-void GLAPIENTRY
-gluDeleteQuadric(GLUquadricObj * state)
-{
- if (state) {
- free((void *) state);
- }
-}
-
-
-
-/*
- * Set the drawing style to be GLU_FILL, GLU_LINE, GLU_SILHOUETTE,
- * or GLU_POINT.
- */
-void GLAPIENTRY
-gluQuadricDrawStyle(GLUquadricObj * quadObject, GLenum drawStyle)
-{
- if (quadObject && (drawStyle == GLU_FILL || drawStyle == GLU_LINE
- || drawStyle == GLU_SILHOUETTE
- || drawStyle == GLU_POINT)) {
- quadObject->DrawStyle = drawStyle;
- }
- else {
- quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle");
- }
-}
-
-
-
-/*
- * Set the orientation to GLU_INSIDE or GLU_OUTSIDE.
- */
-void GLAPIENTRY
-gluQuadricOrientation(GLUquadricObj * quadObject, GLenum orientation)
-{
- if (quadObject
- && (orientation == GLU_INSIDE || orientation == GLU_OUTSIDE)) {
- quadObject->Orientation = orientation;
- }
- else {
- quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation");
- }
-}
-
-
-
-/*
- * Set the error handler callback function.
- */
-void GLAPIENTRY
-gluQuadricCallback(GLUquadricObj * qobj,
- GLenum which, void (GLCALLBACK * fn) ())
-{
- /*
- * UGH, this is a mess! I thought ANSI was a standard.
- */
- if (qobj && which == GLU_ERROR) {
-#ifdef __CYGWIN32__
- qobj->ErrorFunc = (void (GLCALLBACKPCAST) (GLenum)) fn;
-#elif defined(OPENSTEP)
- qobj->ErrorFunc = (void (*)(GLenum)) fn;
-#elif defined(_WIN32)
- qobj->ErrorFunc = (void (GLCALLBACK *) (int)) fn;
-#elif defined(__STORM__)
- qobj->ErrorFunc = (void (GLCALLBACK *) (GLenum)) fn;
-#elif defined(__BEOS__)
- qobj->ErrorFunc = (void (*)(GLenum)) fn;
-#else
- qobj->ErrorFunc = (void (GLCALLBACK *) ()) fn;
-#endif
- }
-}
-
-
-void GLAPIENTRY
-gluQuadricNormals(GLUquadricObj * quadObject, GLenum normals)
-{
- if (quadObject
- && (normals == GLU_NONE || normals == GLU_FLAT
- || normals == GLU_SMOOTH)) {
- quadObject->Normals = normals;
- }
-}
-
-
-void GLAPIENTRY
-gluQuadricTexture(GLUquadricObj * quadObject, GLboolean textureCoords)
-{
- if (quadObject) {
- quadObject->TextureFlag = textureCoords;
- }
-}
-
-
-
-
-/*
- * Call glNormal3f after scaling normal to unit length.
- */
-static void
-normal3f(GLfloat x, GLfloat y, GLfloat z)
-{
-}
-
-
-
-void GLAPIENTRY
-gluCylinder(GLUquadricObj * qobj,
- GLdouble baseRadius, GLdouble topRadius,
- GLdouble height, GLint slices, GLint stacks)
-{
- GLdouble da, r, dr, dz;
- GLfloat x, y, z, nz, nsign;
- GLint i, j;
-
- if (qobj->Orientation == GLU_INSIDE) {
- nsign = -1.0;
- }
- else {
- nsign = 1.0;
- }
-
- da = 2.0 * M_PI / slices;
- dr = (topRadius - baseRadius) / stacks;
- dz = height / stacks;
- nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */
-
- if (qobj->DrawStyle == GLU_POINT) {
- glBegin(GL_POINTS);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
-
- z = 0.0;
- r = baseRadius;
- for (j = 0; j <= stacks; j++) {
- glVertex3f(x * r, y * r, z);
- z += dz;
- r += dr;
- }
- }
- glEnd();
- }
- else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) {
- /* Draw rings */
- if (qobj->DrawStyle == GLU_LINE) {
- z = 0.0;
- r = baseRadius;
- for (j = 0; j <= stacks; j++) {
- glBegin(GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * r, y * r, z);
- }
- glEnd();
- z += dz;
- r += dr;
- }
- }
- else {
- /* draw one ring at each end */
- if (baseRadius != 0.0) {
- glBegin(GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * baseRadius, y * baseRadius, 0.0);
- }
- glEnd();
- glBegin(GL_LINE_LOOP);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * topRadius, y * topRadius, height);
- }
- glEnd();
- }
- }
- /* draw length lines */
- glBegin(GL_LINES);
- for (i = 0; i < slices; i++) {
- x = cos(i * da);
- y = sin(i * da);
- normal3f(x * nsign, y * nsign, nz * nsign);
- glVertex3f(x * baseRadius, y * baseRadius, 0.0);
- glVertex3f(x * topRadius, y * topRadius, height);
- }
- glEnd();
- }
- else if (qobj->DrawStyle == GLU_FILL) {
- GLfloat ds = 1.0 / slices;
- GLfloat dt = 1.0 / stacks;
- GLfloat t = 0.0;
- z = 0.0;
- r = baseRadius;
- for (j = 0; j < stacks; j++) {
- GLfloat s = 0.0;
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= slices; i++) {
- GLfloat x, y;
- if (i == slices) {
- x = sin(0.0);
- y = cos(0.0);
- }
- else {
- x = sin(i * da);
- y = cos(i * da);
- }
- if (nsign == 1.0) {
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t);
- glVertex3f(x * r, y * r, z);
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t + dt);
- glVertex3f(x * (r + dr), y * (r + dr), z + dz);
- }
- else {
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t);
- glVertex3f(x * r, y * r, z);
- normal3f(x * nsign, y * nsign, nz * nsign);
- TXTR_COORD(s, t + dt);
- glVertex3f(x * (r + dr), y * (r + dr), z + dz);
- }
- s += ds;
- } /* for slices */
- glEnd();
- r += dr;
- t += dt;
- z += dz;
- } /* for stacks */
- }
-}
-
-
-
-
-
-void GLAPIENTRY
-gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks)
-{
- GLfloat rho, drho, theta, dtheta;
- GLfloat x, y, z;
- GLfloat s, t, ds, dt;
- GLint i, j, imin, imax;
- GLboolean normals;
- GLfloat nsign;
-
- if (qobj->Normals == GLU_NONE) {
- normals = GL_FALSE;
- }
- else {
- normals = GL_TRUE;
- }
- if (qobj->Orientation == GLU_INSIDE) {
- nsign = -1.0;
- }
- else {
- nsign = 1.0;
- }
-
- drho = M_PI / (GLfloat) stacks;
- dtheta = 2.0 * M_PI / (GLfloat) slices;
-
- /* texturing: s goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y axis */
- /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */
- /* cannot use triangle fan on texturing (s coord. at top/bottom tip varies) */
-
- if (qobj->DrawStyle == GLU_FILL) {
- if (!qobj->TextureFlag) {
- /* draw +Z end as a triangle fan */
- glBegin(GL_TRIANGLE_FAN);
-/* glNormal3f(0.0, 0.0, 1.0); */
- glVertex3f(0.0, 0.0, nsign * radius);
- for (j = 0; j <= slices; j++) {
- theta = (j == slices) ? 0.0 : j * dtheta;
- x = -sin(theta) * sin(drho);
- y = cos(theta) * sin(drho);
- z = nsign * cos(drho);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
-
- ds = 1.0 / slices;
- dt = 1.0 / stacks;
- t = 1.0; /* because loop now runs from 0 */
- if (qobj->TextureFlag) {
- imin = 0;
- imax = stacks;
- }
- else {
- imin = 1;
- imax = stacks - 1;
- }
-
- /* draw intermediate stacks as quad strips */
- for (i = imin; i < imax; i++) {
- rho = i * drho;
- glBegin(GL_QUAD_STRIP);
- s = 0.0;
- for (j = 0; j <= slices; j++) {
- theta = (j == slices) ? 0.0 : j * dtheta;
- x = -sin(theta) * sin(rho);
- y = cos(theta) * sin(rho);
- z = nsign * cos(rho);
- TXTR_COORD(s, t);
- glVertex3f(x * radius, y * radius, z * radius);
- x = -sin(theta) * sin(rho + drho);
- y = cos(theta) * sin(rho + drho);
- z = nsign * cos(rho + drho);
- TXTR_COORD(s, t - dt);
- s += ds;
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- t -= dt;
- }
-
- if (!qobj->TextureFlag) {
- /* draw -Z end as a triangle fan */
- glBegin(GL_TRIANGLE_FAN);
- glVertex3f(0.0, 0.0, -radius * nsign);
- rho = M_PI - drho;
- s = 1.0;
- t = dt;
- for (j = slices; j >= 0; j--) {
- theta = (j == slices) ? 0.0 : j * dtheta;
- x = -sin(theta) * sin(rho);
- y = cos(theta) * sin(rho);
- z = nsign * cos(rho);
- s -= ds;
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
- }
- else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) {
- /* draw stack lines */
- for (i = 1; i < stacks; i++) { /* stack line at i==stacks-1 was missing here */
- rho = i * drho;
- glBegin(GL_LINE_LOOP);
- for (j = 0; j < slices; j++) {
- theta = j * dtheta;
- x = cos(theta) * sin(rho);
- y = sin(theta) * sin(rho);
- z = cos(rho);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
- /* draw slice lines */
- for (j = 0; j < slices; j++) {
- theta = j * dtheta;
- glBegin(GL_LINE_STRIP);
- for (i = 0; i <= stacks; i++) {
- rho = i * drho;
- x = cos(theta) * sin(rho);
- y = sin(theta) * sin(rho);
- z = cos(rho);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- glEnd();
- }
- }
- else if (qobj->DrawStyle == GLU_POINT) {
- /* top and bottom-most points */
- glBegin(GL_POINTS);
- glVertex3f(0.0, 0.0, radius);
- glVertex3f(0.0, 0.0, -radius);
-
- /* loop over stacks */
- for (i = 1; i < stacks - 1; i++) {
- rho = i * drho;
- for (j = 0; j < slices; j++) {
- theta = j * dtheta;
- x = cos(theta) * sin(rho);
- y = sin(theta) * sin(rho);
- z = cos(rho);
- glVertex3f(x * radius, y * radius, z * radius);
- }
- }
- glEnd();
- }
-
-}
-
-
-
-void GLAPIENTRY
-gluDisk(GLUquadricObj * qobj,
- GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops)
-{
- GLfloat da, dr;
-#if 0
- GLdouble a, da;
- GLfloat r, dr;
- GLfloat x, y;
- GLfloat r1, r2, dtc;
- GLint s, l;
-#endif
-
-
- da = 2.0 * M_PI / slices;
- dr = (outerRadius - innerRadius) / (GLfloat) loops;
-
- switch (qobj->DrawStyle) {
- case GLU_FILL:
- {
- /* texture of a gluDisk is a cut out of the texture unit square
- * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1]
- * (linear mapping)
- */
- GLfloat dtc = 2.0f * outerRadius;
- GLfloat sa, ca;
- GLfloat r1 = innerRadius;
- GLint l;
- for (l = 0; l < loops; l++) {
- GLfloat r2 = r1 + dr;
- if (qobj->Orientation == GLU_OUTSIDE) {
- GLint s;
- glBegin(GL_QUAD_STRIP);
- for (s = 0; s <= slices; s++) {
- GLfloat a;
- if (s == slices)
- a = 0.0;
- else
- a = s * da;
- sa = sin(a);
- ca = cos(a);
- TXTR_COORD(0.5 + sa * r2 / dtc, 0.5 + ca * r2 / dtc);
- glVertex2f(r2 * sa, r2 * ca);
- TXTR_COORD(0.5 + sa * r1 / dtc, 0.5 + ca * r1 / dtc);
- glVertex2f(r1 * sa, r1 * ca);
- }
- glEnd();
- }
- else {
- GLint s;
- glBegin(GL_QUAD_STRIP);
- for (s = slices; s >= 0; s--) {
- GLfloat a;
- if (s == slices)
- a = 0.0;
- else
- a = s * da;
- sa = sin(a);
- ca = cos(a);
- TXTR_COORD(0.5 - sa * r2 / dtc, 0.5 + ca * r2 / dtc);
- glVertex2f(r2 * sa, r2 * ca);
- TXTR_COORD(0.5 - sa * r1 / dtc, 0.5 + ca * r1 / dtc);
- glVertex2f(r1 * sa, r1 * ca);
- }
- glEnd();
- }
- r1 = r2;
- }
- break;
- }
- case GLU_LINE:
- {
- GLint l, s;
- /* draw loops */
- for (l = 0; l <= loops; l++) {
- GLfloat r = innerRadius + l * dr;
- glBegin(GL_LINE_LOOP);
- for (s = 0; s < slices; s++) {
- GLfloat a = s * da;
- glVertex2f(r * sin(a), r * cos(a));
- }
- glEnd();
- }
- /* draw spokes */
- for (s = 0; s < slices; s++) {
- GLfloat a = s * da;
- GLfloat x = sin(a);
- GLfloat y = cos(a);
- glBegin(GL_LINE_STRIP);
- for (l = 0; l <= loops; l++) {
- GLfloat r = innerRadius + l * dr;
- glVertex2f(r * x, r * y);
- }
- glEnd();
- }
- break;
- }
- case GLU_POINT:
- {
- GLint s;
- glBegin(GL_POINTS);
- for (s = 0; s < slices; s++) {
- GLfloat a = s * da;
- GLfloat x = sin(a);
- GLfloat y = cos(a);
- GLint l;
- for (l = 0; l <= loops; l++) {
- GLfloat r = innerRadius * l * dr;
- glVertex2f(r * x, r * y);
- }
- }
- glEnd();
- break;
- }
- case GLU_SILHOUETTE:
- {
- if (innerRadius != 0.0) {
- GLfloat a;
- glBegin(GL_LINE_LOOP);
- for (a = 0.0; a < 2.0 * M_PI; a += da) {
- GLfloat x = innerRadius * sin(a);
- GLfloat y = innerRadius * cos(a);
- glVertex2f(x, y);
- }
- glEnd();
- }
- {
- GLfloat a;
- glBegin(GL_LINE_LOOP);
- for (a = 0; a < 2.0 * M_PI; a += da) {
- GLfloat x = outerRadius * sin(a);
- GLfloat y = outerRadius * cos(a);
- glVertex2f(x, y);
- }
- glEnd();
- }
- break;
- }
- default:
- abort();
- }
-}
-
-
-
-void GLAPIENTRY
-gluPartialDisk(GLUquadricObj * qobj, GLdouble innerRadius,
- GLdouble outerRadius, GLint slices, GLint loops,
- GLdouble startAngle, GLdouble sweepAngle)
-{
- if (qobj->DrawStyle == GLU_POINT) {
- GLint loop, slice;
- GLdouble radius, delta_radius;
- GLdouble angle, delta_angle;
- delta_radius = (outerRadius - innerRadius) / (loops - 1);
- delta_angle = DEG_TO_RAD((sweepAngle) / (slices - 1));
- glBegin(GL_POINTS);
- radius = innerRadius;
- for (loop = 0; loop < loops; loop++) {
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice < slices; slice++) {
- glVertex2f(radius * sin(angle), radius * cos(angle));
- angle += delta_angle;
- }
- radius += delta_radius;
- }
- glEnd();
- }
- else if (qobj->DrawStyle == GLU_LINE) {
- GLint loop, slice;
- GLdouble radius, delta_radius;
- GLdouble angle, delta_angle;
- delta_radius = (outerRadius - innerRadius) / loops;
- delta_angle = DEG_TO_RAD(sweepAngle / slices);
- /* draw rings */
- radius = innerRadius;
- for (loop = 0; loop < loops; loop++) {
- angle = DEG_TO_RAD(startAngle);
- glBegin(GL_LINE_STRIP);
- for (slice = 0; slice <= slices; slice++) {
- glVertex2f(radius * sin(angle), radius * cos(angle));
- angle += delta_angle;
- }
- glEnd();
- radius += delta_radius;
- }
- /* draw spokes */
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice <= slices; slice++) {
- radius = innerRadius;
- glBegin(GL_LINE_STRIP);
- for (loop = 0; loop < loops; loop++) {
- glVertex2f(radius * sin(angle), radius * cos(angle));
- radius += delta_radius;
- }
- glEnd();
- angle += delta_angle;
- }
- }
- else if (qobj->DrawStyle == GLU_SILHOUETTE) {
- GLint slice;
- GLdouble angle, delta_angle;
- delta_angle = DEG_TO_RAD(sweepAngle / slices);
- /* draw outer ring */
- glBegin(GL_LINE_STRIP);
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice <= slices; slice++) {
- glVertex2f(outerRadius * sin(angle), outerRadius * cos(angle));
- angle += delta_angle;
- }
- glEnd();
- /* draw inner ring */
- if (innerRadius > 0.0) {
- glBegin(GL_LINE_STRIP);
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice < slices; slice++) {
- glVertex2f(innerRadius * sin(angle), innerRadius * cos(angle));
- angle += delta_angle;
- }
- glEnd();
- }
- /* draw spokes */
- if (sweepAngle < 360.0) {
- GLdouble stopAngle = startAngle + sweepAngle;
- glBegin(GL_LINES);
- glVertex2f(innerRadius * SIND(startAngle),
- innerRadius * COSD(startAngle));
- glVertex2f(outerRadius * SIND(startAngle),
- outerRadius * COSD(startAngle));
- glVertex2f(innerRadius * SIND(stopAngle),
- innerRadius * COSD(stopAngle));
- glVertex2f(outerRadius * SIND(stopAngle),
- outerRadius * COSD(stopAngle));
- glEnd();
- }
- }
- else if (qobj->DrawStyle == GLU_FILL) {
- GLint loop, slice;
- GLdouble radius, delta_radius;
- GLdouble angle, delta_angle;
- delta_radius = (outerRadius - innerRadius) / loops;
- delta_angle = DEG_TO_RAD(sweepAngle / slices);
- radius = innerRadius;
- for (loop = 0; loop < loops; loop++) {
- glBegin(GL_QUAD_STRIP);
- angle = DEG_TO_RAD(startAngle);
- for (slice = 0; slice <= slices; slice++) {
- if (qobj->Orientation == GLU_OUTSIDE) {
- glVertex2f((radius + delta_radius) * sin(angle),
- (radius + delta_radius) * cos(angle));
- glVertex2f(radius * sin(angle), radius * cos(angle));
- }
- else {
- glVertex2f(radius * sin(angle), radius * cos(angle));
- glVertex2f((radius + delta_radius) * sin(angle),
- (radius + delta_radius) * cos(angle));
- }
- angle += delta_angle;
- }
- glEnd();
- radius += delta_radius;
- }
- }
-}
diff --git a/src/glu/mini/tess.c b/src/glu/mini/tess.c
deleted file mode 100644
index 1a384239be0..00000000000
--- a/src/glu/mini/tess.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/* $Id: tess.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <math.h>
-#include <stdlib.h>
-#include "tess.h"
-#endif
-
-
-/*
- * This is ugly, but seems the easiest way to do things to make the
- * code work under YellowBox for Windows
- */
-#if defined(OPENSTEP) && defined(CALLBACK)
-#undef CALLBACK
-#define CALLBACK
-#endif
-
-
-static void delete_contours(GLUtriangulatorObj *);
-
-#ifdef __CYGWIN32__
-#define _CALLBACK
-#else
-#define _CALLBACK GLCALLBACK
-#endif
-
-
-static void
-init_callbacks(tess_callbacks * callbacks)
-{
- callbacks->begin = (void (_CALLBACK *) (GLenum)) 0;
- callbacks->edgeFlag = (void (_CALLBACK *) (GLboolean)) 0;
- callbacks->vertex = (void (_CALLBACK *) (void *)) 0;
- callbacks->end = (void (_CALLBACK *) (void)) 0;
- callbacks->error = (void (_CALLBACK *) (GLenum)) 0;
-}
-
-void
-tess_call_user_error(GLUtriangulatorObj * tobj, GLenum gluerr)
-{
- if (tobj->error == GLU_NO_ERROR)
- tobj->error = gluerr;
- if (tobj->callbacks.error != NULL)
- (tobj->callbacks.error) (gluerr);
-}
-
-GLUtriangulatorObj *GLAPIENTRY
-gluNewTess(void)
-{
- GLUtriangulatorObj *tobj;
-
- if ((tobj = (GLUtriangulatorObj *)
- malloc(sizeof(struct GLUtesselator))) == NULL)
- return NULL;
- tobj->contours = tobj->last_contour = NULL;
- init_callbacks(&tobj->callbacks);
- tobj->error = GLU_NO_ERROR;
- tobj->current_polygon = NULL;
- tobj->contour_cnt = 0;
- return tobj;
-}
-
-
-void GLAPIENTRY
-gluTessCallback(GLUtriangulatorObj * tobj, GLenum which,
- void (GLCALLBACK * fn) ())
-{
- switch (which) {
- case GLU_BEGIN:
- tobj->callbacks.begin = (void (_CALLBACK *) (GLenum)) fn;
- break;
- case GLU_EDGE_FLAG:
- tobj->callbacks.edgeFlag = (void (_CALLBACK *) (GLboolean)) fn;
- break;
- case GLU_VERTEX:
- tobj->callbacks.vertex = (void (_CALLBACK *) (void *)) fn;
- break;
- case GLU_END:
- tobj->callbacks.end = (void (_CALLBACK *) (void)) fn;
- break;
- case GLU_ERROR:
- tobj->callbacks.error = (void (_CALLBACK *) (GLenum)) fn;
- break;
- default:
- tobj->error = GLU_INVALID_ENUM;
- break;
- }
-}
-
-
-
-void GLAPIENTRY
-gluDeleteTess(GLUtriangulatorObj * tobj)
-{
- if (tobj->error == GLU_NO_ERROR && tobj->contour_cnt)
- /* was gluEndPolygon called? */
- tess_call_user_error(tobj, GLU_TESS_ERROR1);
- /* delete all internal structures */
- delete_contours(tobj);
- free(tobj);
-}
-
-
-void GLAPIENTRY
-gluBeginPolygon(GLUtriangulatorObj * tobj)
-{
-/*
- if(tobj->error!=GLU_NO_ERROR)
- return;
-*/
- tobj->error = GLU_NO_ERROR;
- if (tobj->current_polygon != NULL) {
- /* gluEndPolygon was not called */
- tess_call_user_error(tobj, GLU_TESS_ERROR1);
- /* delete all internal structures */
- delete_contours(tobj);
- }
- else {
- if ((tobj->current_polygon =
- (tess_polygon *) malloc(sizeof(tess_polygon))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- tobj->current_polygon->vertex_cnt = 0;
- tobj->current_polygon->vertices =
- tobj->current_polygon->last_vertex = NULL;
- }
-}
-
-
-void GLAPIENTRY
-gluEndPolygon(GLUtriangulatorObj * tobj)
-{
- /*tess_contour *contour_ptr; */
-
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- /* check if gluBeginPolygon was called */
- if (tobj->current_polygon == NULL) {
- tess_call_user_error(tobj, GLU_TESS_ERROR2);
- return;
- }
- tess_test_polygon(tobj);
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- /* any real contours? */
- if (tobj->contour_cnt == 0) {
- /* delete all internal structures */
- delete_contours(tobj);
- return;
- }
- tess_find_contour_hierarchies(tobj);
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- tess_handle_holes(tobj);
- /* there was an error */
- if (tobj->error != GLU_NO_ERROR)
- goto end;
-
- /* if no callbacks, nothing to do */
- if (tobj->callbacks.begin != NULL && tobj->callbacks.vertex != NULL &&
- tobj->callbacks.end != NULL) {
- if (tobj->callbacks.edgeFlag == NULL)
- tess_tesselate(tobj);
- else
- tess_tesselate_with_edge_flag(tobj);
- }
-
- end:
- /* delete all internal structures */
- delete_contours(tobj);
-}
-
-
-void GLAPIENTRY
-gluNextContour(GLUtriangulatorObj * tobj, GLenum type)
-{
- if (tobj->error != GLU_NO_ERROR)
- return;
- if (tobj->current_polygon == NULL) {
- tess_call_user_error(tobj, GLU_TESS_ERROR2);
- return;
- }
- /* first contour? */
- if (tobj->current_polygon->vertex_cnt)
- tess_test_polygon(tobj);
-}
-
-
-void GLAPIENTRY
-gluTessVertex(GLUtriangulatorObj * tobj, GLdouble v[3], void *data)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_vertex *last_vertex_ptr;
-
- if (tobj->error != GLU_NO_ERROR)
- return;
- if (polygon == NULL) {
- tess_call_user_error(tobj, GLU_TESS_ERROR2);
- return;
- }
- last_vertex_ptr = polygon->last_vertex;
- if (last_vertex_ptr == NULL) {
- if ((last_vertex_ptr = (tess_vertex *)
- malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- polygon->vertices = last_vertex_ptr;
- polygon->last_vertex = last_vertex_ptr;
- last_vertex_ptr->data = data;
- last_vertex_ptr->location[0] = v[0];
- last_vertex_ptr->location[1] = v[1];
- last_vertex_ptr->location[2] = v[2];
- last_vertex_ptr->next = NULL;
- last_vertex_ptr->previous = NULL;
- ++(polygon->vertex_cnt);
- }
- else {
- tess_vertex *vertex_ptr;
-
- /* same point twice? */
- if (fabs(last_vertex_ptr->location[0] - v[0]) < EPSILON &&
- fabs(last_vertex_ptr->location[1] - v[1]) < EPSILON &&
- fabs(last_vertex_ptr->location[2] - v[2]) < EPSILON) {
- tess_call_user_error(tobj, GLU_TESS_ERROR6);
- return;
- }
- if ((vertex_ptr = (tess_vertex *)
- malloc(sizeof(tess_vertex))) == NULL) {
- tess_call_user_error(tobj, GLU_OUT_OF_MEMORY);
- return;
- }
- vertex_ptr->data = data;
- vertex_ptr->location[0] = v[0];
- vertex_ptr->location[1] = v[1];
- vertex_ptr->location[2] = v[2];
- vertex_ptr->next = NULL;
- vertex_ptr->previous = last_vertex_ptr;
- ++(polygon->vertex_cnt);
- last_vertex_ptr->next = vertex_ptr;
- polygon->last_vertex = vertex_ptr;
- }
-}
-
-
-static void
-delete_contours(GLUtriangulatorObj * tobj)
-{
- tess_polygon *polygon = tobj->current_polygon;
- tess_contour *contour, *contour_tmp;
- tess_vertex *vertex, *vertex_tmp;
-
- /* remove current_polygon list - if exists due to detected error */
- if (polygon != NULL) {
- if (polygon->vertices) {
- for (vertex = polygon->vertices; vertex != polygon->last_vertex;) {
- vertex_tmp = vertex->next;
- free(vertex);
- vertex = vertex_tmp;
- }
- free(vertex);
- }
- free(polygon);
- tobj->current_polygon = NULL;
- }
- /* remove all contour data */
- for (contour = tobj->contours; contour != NULL;) {
- for (vertex = contour->vertices; vertex != contour->last_vertex;) {
- vertex_tmp = vertex->next;
- free(vertex);
- vertex = vertex_tmp;
- }
- free(vertex);
- contour_tmp = contour->next;
- free(contour);
- contour = contour_tmp;
- }
- tobj->contours = tobj->last_contour = NULL;
- tobj->contour_cnt = 0;
-}
-
-
-void GLAPIENTRY
-gluTessNormal(GLUtesselator *tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ)
-{
- /* dummy function */
- (void) tess;
- (void) valueX;
- (void) valueY;
- (void) valueZ;
-}
diff --git a/src/glu/mini/tess.h b/src/glu/mini/tess.h
deleted file mode 100644
index 908e20972cf..00000000000
--- a/src/glu/mini/tess.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* $Id: tess.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifndef TESS_H
-#define TESS_H
-
-
-#include "gluP.h"
-
-#define EPSILON 1e-06 /* epsilon for double precision compares */
-
-typedef enum
-{
- OXY,
- OYZ,
- OXZ
-}
-projection_type;
-
-typedef struct callbacks_str
-{
- void (GLCALLBACK * begin) (GLenum mode);
- void (GLCALLBACK * edgeFlag) (GLboolean flag);
- void (GLCALLBACK * vertex) (GLvoid * v);
- void (GLCALLBACK * end) (void);
- void (GLCALLBACK * error) (GLenum err);
-}
-tess_callbacks;
-
-typedef struct vertex_str
-{
- void *data;
- GLdouble location[3];
- GLdouble x, y;
- GLboolean edge_flag;
- struct vertex_str *shadow_vertex;
- struct vertex_str *next, *previous;
-}
-tess_vertex;
-
-typedef struct contour_str
-{
- GLenum type;
- GLuint vertex_cnt;
- GLdouble area;
- GLenum orientation;
- struct vertex_str *vertices, *last_vertex;
- struct contour_str *next, *previous;
-}
-tess_contour;
-
-typedef struct polygon_str
-{
- GLuint vertex_cnt;
- GLdouble A, B, C, D;
- GLdouble area;
- GLenum orientation;
- struct vertex_str *vertices, *last_vertex;
-}
-tess_polygon;
-
-struct GLUtesselator
-{
- tess_contour *contours, *last_contour;
- GLuint contour_cnt;
- tess_callbacks callbacks;
- tess_polygon *current_polygon;
- GLenum error;
- GLdouble A, B, C, D;
- projection_type projection;
-};
-
-
-extern void tess_call_user_error(GLUtriangulatorObj *, GLenum);
-extern void tess_test_polygon(GLUtriangulatorObj *);
-extern void tess_find_contour_hierarchies(GLUtriangulatorObj *);
-extern void tess_handle_holes(GLUtriangulatorObj *);
-extern void tess_tesselate(GLUtriangulatorObj *);
-extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *);
-
-
-#endif
diff --git a/src/glu/mini/tesselat.c b/src/glu/mini/tesselat.c
deleted file mode 100644
index a1102e6e5a6..00000000000
--- a/src/glu/mini/tesselat.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/* $Id: tesselat.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- * Copyright (C) 1995-2000 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 file is part of the polygon tesselation code contributed by
- * Bogdan Sikorski
- */
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <stdlib.h>
-#include <math.h>
-#include "tess.h"
-#endif
-
-
-
-static GLboolean edge_flag;
-
-static void emit_triangle(GLUtriangulatorObj *, tess_vertex *,
- tess_vertex *, tess_vertex *);
-
-static void emit_triangle_with_edge_flag(GLUtriangulatorObj *,
- tess_vertex *, GLboolean,
- tess_vertex *, GLboolean,
- tess_vertex *, GLboolean);
-
-static GLdouble
-twice_the_triangle_area(tess_vertex * va, tess_vertex * vb, tess_vertex * vc)
-{
- return (vb->x - va->x) * (vc->y - va->y) - (vb->y - va->y) * (vc->x -
- va->x);
-}
-
-static GLboolean
-left(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y)
-{
- if (A * x + B * y + C > -EPSILON)
- return GL_TRUE;
- else
- return GL_FALSE;
-}
-
-static GLboolean
-right(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y)
-{
- if (A * x + B * y + C < EPSILON)
- return GL_TRUE;
- else
- return GL_FALSE;
-}
-
-static GLint
-convex_ccw(tess_vertex * va,
- tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj)
-{
- GLdouble d;
-
- d = twice_the_triangle_area(va, vb, vc);
-
- if (d > EPSILON) {
- return 1;
- }
- else if (d < -EPSILON) {
- return 0;
- }
- else {
- return -1;
- }
-}
-
-static GLint
-convex_cw(tess_vertex * va,
- tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj)
-{
- GLdouble d;
-
- d = twice_the_triangle_area(va, vb, vc);
-
- if (d < -EPSILON) {
- return 1;
- }
- else if (d > EPSILON) {
- return 0;
- }
- else {
- return -1;
- }
-}
-
-static GLboolean
-diagonal_ccw(tess_vertex * va,
- tess_vertex * vb,
- GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vc = va->next, *vertex, *shadow_vertex;
- struct
- {
- GLdouble A, B, C;
- }
- ac, cb, ba;
- GLdouble x, y;
-
- GLint res = convex_ccw(va, vc, vb, tobj);
- if (res == 0)
- return GL_FALSE;
- if (res == -1)
- return GL_TRUE;
-
- ba.A = vb->y - va->y;
- ba.B = va->x - vb->x;
- ba.C = -ba.A * va->x - ba.B * va->y;
- ac.A = va->y - vc->y;
- ac.B = vc->x - va->x;
- ac.C = -ac.A * vc->x - ac.B * vc->y;
- cb.A = vc->y - vb->y;
- cb.B = vb->x - vc->x;
- cb.C = -cb.A * vb->x - cb.B * vb->y;
- for (vertex = vb->next; vertex != va; vertex = vertex->next) {
- shadow_vertex = vertex->shadow_vertex;
- if (shadow_vertex != NULL &&
- (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc))
- continue;
- x = vertex->x;
- y = vertex->y;
- if (left(ba.A, ba.B, ba.C, x, y) &&
- left(ac.A, ac.B, ac.C, x, y) && left(cb.A, cb.B, cb.C, x, y))
- return GL_FALSE;
- }
- return GL_TRUE;
-}
-
-static GLboolean
-diagonal_cw(tess_vertex * va,
- tess_vertex * vb,
- GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vc = va->next, *vertex, *shadow_vertex;
- struct
- {
- GLdouble A, B, C;
- }
- ac, cb, ba;
- GLdouble x, y;
-
- GLint res = convex_cw(va, vc, vb, tobj);
- if (res == 0)
- return GL_FALSE;
- if (res == -1)
- return GL_TRUE;
-
- ba.A = vb->y - va->y;
- ba.B = va->x - vb->x;
- ba.C = -ba.A * va->x - ba.B * va->y;
- ac.A = va->y - vc->y;
- ac.B = vc->x - va->x;
- ac.C = -ac.A * vc->x - ac.B * vc->y;
- cb.A = vc->y - vb->y;
- cb.B = vb->x - vc->x;
- cb.C = -cb.A * vb->x - cb.B * vb->y;
- for (vertex = vb->next; vertex != va; vertex = vertex->next) {
- shadow_vertex = vertex->shadow_vertex;
- if (shadow_vertex != NULL &&
- (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc))
- continue;
- x = vertex->x;
- y = vertex->y;
- if (right(ba.A, ba.B, ba.C, x, y) &&
- right(ac.A, ac.B, ac.C, x, y) && right(cb.A, cb.B, cb.C, x, y))
- return GL_FALSE;
- }
- return GL_TRUE;
-}
-
-static void
-clip_ear(GLUtriangulatorObj * tobj, tess_vertex * v, tess_contour * contour)
-{
- emit_triangle(tobj, v->previous, v, v->next);
- /* the first in the list */
- if (contour->vertices == v) {
- contour->vertices = v->next;
- contour->last_vertex->next = v->next;
- v->next->previous = contour->last_vertex;
- }
- else
- /* the last ? */
- if (contour->last_vertex == v) {
- contour->vertices->previous = v->previous;
- v->previous->next = v->next;
- contour->last_vertex = v->previous;
- }
- else {
- v->next->previous = v->previous;
- v->previous->next = v->next;
- }
- free(v);
- --(contour->vertex_cnt);
-}
-
-static void
-clip_ear_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_vertex * v, tess_contour * contour)
-{
- emit_triangle_with_edge_flag(tobj, v->previous, v->previous->edge_flag,
- v, v->edge_flag, v->next, GL_FALSE);
- v->previous->edge_flag = GL_FALSE;
- /* the first in the list */
- if (contour->vertices == v) {
- contour->vertices = v->next;
- contour->last_vertex->next = v->next;
- v->next->previous = contour->last_vertex;
- }
- else
- /* the last ? */
- if (contour->last_vertex == v) {
- contour->vertices->previous = v->previous;
- v->previous->next = v->next;
- contour->last_vertex = v->previous;
- }
- else {
- v->next->previous = v->previous;
- v->previous->next = v->next;
- }
- free(v);
- --(contour->vertex_cnt);
-}
-
-static void
-triangulate_ccw(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-static void
-triangulate_cw(GLUtriangulatorObj * tobj, tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_cw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-static void
-triangulate_ccw_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear_with_edge_flag(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-static void
-triangulate_cw_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_contour * contour)
-{
- tess_vertex *vertex;
- GLuint vertex_cnt = contour->vertex_cnt;
-
- while (vertex_cnt > 3) {
- vertex = contour->vertices;
- while (diagonal_cw(vertex, vertex->next->next, tobj, contour) ==
- GL_FALSE && tobj->error == GLU_NO_ERROR)
- vertex = vertex->next;
- if (tobj->error != GLU_NO_ERROR)
- return;
- clip_ear_with_edge_flag(tobj, vertex->next, contour);
- --vertex_cnt;
- }
-}
-
-void
-tess_tesselate(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour;
-
- for (contour = tobj->contours; contour != NULL; contour = contour->next) {
- if (contour->orientation == GLU_CCW) {
- triangulate_ccw(tobj, contour);
- }
- else {
- triangulate_cw(tobj, contour);
- }
- if (tobj->error != GLU_NO_ERROR)
- return;
-
- /* emit the last triangle */
- emit_triangle(tobj, contour->vertices, contour->vertices->next,
- contour->vertices->next->next);
- }
-}
-
-void
-tess_tesselate_with_edge_flag(GLUtriangulatorObj * tobj)
-{
- tess_contour *contour;
-
- edge_flag = GL_TRUE;
- /* first callback with edgeFlag set to GL_TRUE */
- (tobj->callbacks.edgeFlag) (GL_TRUE);
-
- for (contour = tobj->contours; contour != NULL; contour = contour->next) {
- if (contour->orientation == GLU_CCW)
- triangulate_ccw_with_edge_flag(tobj, contour);
- else
- triangulate_cw_with_edge_flag(tobj, contour);
- if (tobj->error != GLU_NO_ERROR)
- return;
- /* emit the last triangle */
- emit_triangle_with_edge_flag(tobj, contour->vertices,
- contour->vertices->edge_flag,
- contour->vertices->next,
- contour->vertices->next->edge_flag,
- contour->vertices->next->next,
- contour->vertices->next->next->edge_flag);
- }
-}
-
-static void
-emit_triangle(GLUtriangulatorObj * tobj,
- tess_vertex * v1, tess_vertex * v2, tess_vertex * v3)
-{
- (tobj->callbacks.begin) (GL_TRIANGLES);
- (tobj->callbacks.vertex) (v1->data);
- (tobj->callbacks.vertex) (v2->data);
- (tobj->callbacks.vertex) (v3->data);
- (tobj->callbacks.end) ();
-}
-
-static void
-emit_triangle_with_edge_flag(GLUtriangulatorObj * tobj,
- tess_vertex * v1,
- GLboolean edge_flag1,
- tess_vertex * v2,
- GLboolean edge_flag2,
- tess_vertex * v3, GLboolean edge_flag3)
-{
- (tobj->callbacks.begin) (GL_TRIANGLES);
- if (edge_flag1 != edge_flag) {
- edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE);
- (tobj->callbacks.edgeFlag) (edge_flag);
- }
- (tobj->callbacks.vertex) (v1->data);
- if (edge_flag2 != edge_flag) {
- edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE);
- (tobj->callbacks.edgeFlag) (edge_flag);
- }
- (tobj->callbacks.vertex) (v2->data);
- if (edge_flag3 != edge_flag) {
- edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE);
- (tobj->callbacks.edgeFlag) (edge_flag);
- }
- (tobj->callbacks.vertex) (v3->data);
- (tobj->callbacks.end) ();
-}
diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c
index 5c28c858ec6..44f519a4e21 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -377,6 +377,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLubyte *s;
const char *t;
@@ -390,6 +391,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -405,6 +407,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -476,6 +479,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLbyte *s;
const char *t;
@@ -489,6 +493,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -504,6 +509,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -573,6 +579,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLushort *s;
const char *t;
@@ -586,6 +593,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -602,6 +610,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -616,6 +625,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -708,6 +718,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLshort *s;
const char *t;
@@ -721,6 +732,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -737,6 +749,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -758,6 +771,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -850,6 +864,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLuint *s;
const char *t;
@@ -863,6 +878,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -881,6 +897,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -899,6 +916,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -990,6 +1008,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLint *s;
const char *t;
@@ -1003,6 +1022,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -1019,6 +1039,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -1041,6 +1062,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -1134,6 +1156,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLfloat *s;
const char *t;
@@ -1147,6 +1170,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -1163,6 +1187,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -1183,6 +1208,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -3845,10 +3871,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
if (width == newwidth && height == newheight) {
/* Use usersImage for level userLevel */
if (baseLevel <= level && level <= maxLevel) {
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
glTexImage2D(target, level, internalFormat, width,
height, 0, format, type,
usersImage);
}
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
if(levels == 0) { /* we're done. clean up and return */
glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
@@ -8643,7 +8671,8 @@ static void halveImageSlice(int components,
int halfHeight= height / 2;
int halfDepth= depth / 2;
const char *src= (const char *)dataIn;
- int padBytes= rowSizeInBytes - (width * groupSizeInBytes);
+ int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
int outIndex= 0;
assert((width == 1 || height == 1) && depth >= 2);
@@ -8727,7 +8756,7 @@ static void halveImageSlice(int components,
/* skip over to next horizontal square of 4 */
src+= groupSizeInBytes;
} /* for jj */
- src+= padBytes;
+ src+= rowPadBytes;
src+= rowSizeInBytes;
} /* for ii */
@@ -8772,11 +8801,12 @@ static void halveImageSlice(int components,
src+= elementSizeInBytes;
} /* for cc */
- src+= padBytes;
+ src+= rowPadBytes;
/* skip over to next vertical square of 4 */
src+= rowSizeInBytes;
} /* for jj */
+ src+= imagePadBytes;
src+= imageSizeInBytes;
} /* for ii */
@@ -8816,7 +8846,8 @@ static void halveImage3D(int components,
int halfHeight= height / 2;
int halfDepth= depth / 2;
const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*groupSizeInBytes);
+ int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
int outIndex= 0;
for (dd= 0; dd < halfDepth; dd++) {
@@ -8872,7 +8903,7 @@ static void halveImage3D(int components,
src+= groupSizeInBytes;
} /* for jj */
/* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
+ src+= rowPadBytes;
/* src is at beginning of a row here, but it's the second row of
* the square block of 4 pixels that we just worked on so we
@@ -8887,6 +8918,9 @@ static void halveImage3D(int components,
src+= rowSizeInBytes;
} /* for ii */
+ /* skip past pad bytes, if any, to get to next image */
+ src+= imagePadBytes;
+
src+= imageSizeInBytes;
} /* for dd */
diff --git a/src/glut/directfb/Makefile b/src/glut/directfb/Makefile
deleted file mode 100644
index 3791b16df89..00000000000
--- a/src/glut/directfb/Makefile
+++ /dev/null
@@ -1,86 +0,0 @@
-# subset glut
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-MARK = $(TOP)/src/glut/glx
-
-GLUT_MAJOR = 3
-GLUT_MINOR = 7
-GLUT_TINY = 1
-
-INCLUDES = -I$(TOP)/include -I$(MARK) $(shell pkg-config --cflags directfb)
-
-GLUT_LIB_DEPS += $(shell pkg-config --libs directfb)
-
-CORE_SOURCES = \
- callback.c \
- color.c \
- cursor.c \
- ext.c \
- events.c \
- font.c \
- game.c \
- globals.c \
- init.c \
- menu.c \
- models.c \
- overlay.c \
- state.c \
- teapot.c \
- window.c \
-
-
-MARK_SOURCES = \
- $(MARK)/glut_8x13.c \
- $(MARK)/glut_9x15.c \
- $(MARK)/glut_hel10.c \
- $(MARK)/glut_hel12.c \
- $(MARK)/glut_hel18.c \
- $(MARK)/glut_tr10.c \
- $(MARK)/glut_tr24.c
-
-SOURCES = $(CORE_SOURCES) $(MARK_SOURCES)
-
-OBJECTS = $(SOURCES:.c=.o)
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
-
-
-# Make the library
-$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
- -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
- $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
- $(MKLIB_OPTIONS) $(OBJECTS)
-
-
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
-depend: $(SOURCES)
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-# Remove .o and backup files
-clean: depend
- -rm -f depend
- -rm -f *.o *~ *.o *~ *.so libglut.so.3.7
-
-include depend
diff --git a/src/glut/directfb/NOTES b/src/glut/directfb/NOTES
deleted file mode 100644
index af917c6667d..00000000000
--- a/src/glut/directfb/NOTES
+++ /dev/null
@@ -1,9 +0,0 @@
-DirectFB GLUT Implementation NOTES
-----------------------------------
-
-* To have high performance rendering, it's really important to
- use glutEnterGameMode() instead of glutCreateWindow()/glutFullScreen().
- You can also force a windowed application to game mode by setting
- the environment variable "__GLUT_GAME_MODE".
-
-
diff --git a/src/glut/directfb/callback.c b/src/glut/directfb/callback.c
deleted file mode 100644
index 38cfccbd4f8..00000000000
--- a/src/glut/directfb/callback.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-
-#include "internal.h"
-
-
-typedef void (GLUTCALLBACK *__GlutTimerCallback) ( int value );
-
-typedef struct __GlutTimer_s {
- unsigned int interval;
- struct timeval expire;
-
- __GlutTimerCallback func;
- int value;
-
- struct __GlutTimer_s *next;
- struct __GlutTimer_s *prev;
-} __GlutTimer;
-
-/*****************************************************************************/
-
-static __GlutTimer *g_timers = NULL;
-
-/*****************************************************************************/
-
-
-void GLUTAPIENTRY
-glutDisplayFunc( void (GLUTCALLBACK *func) (void) )
-{
- display_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutReshapeFunc( void (GLUTCALLBACK *func) (int width, int height) )
-{
- reshape_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutKeyboardFunc( void (GLUTCALLBACK *func) (unsigned char key, int x, int y) )
-{
- keyboard_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutMouseFunc( void (GLUTCALLBACK *func) (int button, int state, int x, int y) )
-{
- mouse_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutMotionFunc( void (GLUTCALLBACK *func) (int x, int y) )
-{
- motion_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutPassiveMotionFunc( void (GLUTCALLBACK *func) (int x, int y) )
-{
- passive_motion_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutEntryFunc( void (GLUTCALLBACK *func) (int state) )
-{
- entry_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutVisibilityFunc( void (GLUTCALLBACK *func) (int state) )
-{
- visibility_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutMenuStateFunc( void (GLUTCALLBACK *func) (int state) )
-{
- menu_state_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutSpecialFunc( void (GLUTCALLBACK *func) (int key, int x, int y) )
-{
- special_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutSpaceballMotionFunc( void (GLUTCALLBACK *func) (int x, int y, int z) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutSpaceballRotateFunc( void (GLUTCALLBACK *func) (int x, int y, int z) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutSpaceballButtonFunc( void (GLUTCALLBACK *func) (int button, int state) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutButtonBoxFunc( void (GLUTCALLBACK *func) (int button, int state) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutDialsFunc( void (GLUTCALLBACK *func) (int dial, int value) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutTabletMotionFunc( void (GLUTCALLBACK *func) (int x, int y) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutTabletButtonFunc( void (GLUTCALLBACK *func) (int button, int state, int x, int y) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutMenuStatusFunc( void (GLUTCALLBACK *func) (int status, int x, int y) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutOverlayDisplayFunc( void (GLUTCALLBACK *func) (void) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutWindowStatusFunc( void (GLUTCALLBACK *func) (int state) )
-{
-}
-
-
-void GLUTAPIENTRY
-glutKeyboardUpFunc( void (GLUTCALLBACK *func) (unsigned char key, int x, int y) )
-{
- keyboard_up_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutSpecialUpFunc( void (GLUTCALLBACK *func) (int key, int x, int y) )
-{
- special_up_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutJoystickFunc( void (GLUTCALLBACK *func)(unsigned int buttons, int x, int y, int z), int pollInterval )
-{
- joystick_func = func;
- /* FIXME: take care of pollInterval */
-}
-
-
-void GLUTAPIENTRY
-glutIdleFunc( void (GLUTCALLBACK *func) (void) )
-{
- idle_func = func;
-}
-
-
-void GLUTAPIENTRY
-glutTimerFunc( unsigned int msec, void (GLUTCALLBACK *func) (int value), int value )
-{
- __GlutTimer *timer;
- struct timeval now;
-
- if (!func)
- return;
-
- timer = calloc( 1, sizeof(__GlutTimer) );
- if (!timer)
- __glutFatalError( "out of memory" );
-
- gettimeofday( &now, NULL );
-
- timer->interval = msec;
- timer->expire.tv_sec = now.tv_sec + (now.tv_usec/1000 + msec) / 1000;
- timer->expire.tv_usec = (now.tv_usec + msec*1000) % 1000000;
-
- timer->func = func;
- timer->value = value;
-
- if (g_timers) {
- timer->prev = g_timers->prev;
- g_timers->prev->next = timer;
- g_timers->prev = timer;
- }
- else {
- g_timers = timer;
- g_timers->prev = timer;
- }
-}
-
-
-void
-__glutHandleTimers( void )
-{
- __GlutTimer *cur;
- struct timeval now;
-
- for (cur = g_timers; cur; cur = cur->next ) {
- gettimeofday( &now, NULL );
-
- if (cur->expire.tv_sec > now.tv_sec ||
- (cur->expire.tv_sec == now.tv_sec &&
- cur->expire.tv_usec >= now.tv_usec))
- {
- g_idle = GL_FALSE;
-
- cur->func( cur->value );
-
- cur->expire.tv_sec += (cur->expire.tv_usec/1000 + cur->interval) / 1000;
- cur->expire.tv_usec = (cur->expire.tv_usec + cur->interval*1000) % 1000000;
- }
- }
-}
-
-
-void
-__glutFreeTimers( void )
-{
- __GlutTimer *cur = g_timers;
-
- while (cur) {
- __GlutTimer *next = cur->next;
- free( cur );
- cur = next;
- }
-
- g_timers = NULL;
-}
-
diff --git a/src/glut/directfb/color.c b/src/glut/directfb/color.c
deleted file mode 100644
index 26c514c6d5f..00000000000
--- a/src/glut/directfb/color.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include "internal.h"
-
-
-void GLUTAPIENTRY
-glutSetColor( int index, GLfloat red, GLfloat green, GLfloat blue )
-{
-}
-
-
-GLfloat GLUTAPIENTRY
-glutGetColor( int index, int component )
-{
- return 0.0;
-}
-
-
-void GLUTAPIENTRY
-glutCopyColormap( int win )
-{
-}
diff --git a/src/glut/directfb/cursor.c b/src/glut/directfb/cursor.c
deleted file mode 100644
index aca3fcc9215..00000000000
--- a/src/glut/directfb/cursor.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "internal.h"
-
-#include "cursors.h"
-
-
-void GLUTAPIENTRY
-glutSetCursor( int type )
-{
- const unsigned char *cursor;
- DFBSurfaceDescription dsc;
- IDirectFBSurface *shape;
-
- if (!g_current || !g_current->window)
- return;
-
- if (g_current->cursor == type)
- return;
-
- switch (type) {
- case GLUT_CURSOR_RIGHT_ARROW:
- cursor = &cur_right_arrow[0];
- break;
- case GLUT_CURSOR_LEFT_ARROW:
- cursor = &cur_left_arrow[0];
- break;
- case GLUT_CURSOR_INFO:
- cursor = &cur_info[0];
- break;
- case GLUT_CURSOR_DESTROY:
- cursor = &cur_destroy[0];
- break;
- case GLUT_CURSOR_HELP:
- cursor = &cur_help[0];
- break;
- case GLUT_CURSOR_CYCLE:
- cursor = &cur_cycle[0];
- break;
- case GLUT_CURSOR_SPRAY:
- cursor = &cur_spray[0];
- break;
- case GLUT_CURSOR_WAIT:
- cursor = &cur_wait[0];
- break;
- case GLUT_CURSOR_TEXT:
- cursor = &cur_text[0];
- break;
- case GLUT_CURSOR_CROSSHAIR:
- cursor = &cur_crosshair[0];
- break;
- case GLUT_CURSOR_UP_DOWN:
- cursor = &cur_up_down[0];
- break;
- case GLUT_CURSOR_LEFT_RIGHT:
- cursor = &cur_left_right[0];
- break;
- case GLUT_CURSOR_TOP_SIDE:
- cursor = &cur_top_side[0];
- break;
- case GLUT_CURSOR_BOTTOM_SIDE:
- cursor = &cur_bottom_side[0];
- break;
- case GLUT_CURSOR_LEFT_SIDE:
- cursor = &cur_left_side[0];
- break;
- case GLUT_CURSOR_RIGHT_SIDE:
- cursor = &cur_right_side[0];
- break;
- case GLUT_CURSOR_TOP_LEFT_CORNER:
- cursor = &cur_top_left[0];
- break;
- case GLUT_CURSOR_TOP_RIGHT_CORNER:
- cursor = &cur_top_right[0];
- break;
- case GLUT_CURSOR_BOTTOM_RIGHT_CORNER:
- cursor = &cur_bottom_right[0];
- break;
- case GLUT_CURSOR_BOTTOM_LEFT_CORNER:
- cursor = &cur_bottom_left[0];
- break;
- case GLUT_CURSOR_NONE:
- cursor = NULL;
- break;
- default:
- cursor = &cur_right_arrow[0];
- break;
- }
-
- dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
- dsc.width =
- dsc.height = cursor ? cursor[0] : 8;
- dsc.pixelformat = DSPF_ARGB;
-
- if (dfb->CreateSurface( dfb, &dsc, &shape ))
- return;
-
- if (cursor) {
- __u8 *src = (__u8*) &cursor[3];
- __u8 *msk = src + cursor[0]*cursor[0]/8;
- void *dst;
- int pitch;
- int x, y;
-
- if (shape->Lock( shape, DSLF_WRITE, &dst, &pitch )) {
- shape->Release( shape );
- return;
- }
-
- for (y = 0; y < cursor[0]; y++) {
- for (x = 0; x < cursor[0]; x++) {
- ((__u32*)dst)[x] =
- ((src[x>>3] & (0x80 >> (x&7))) ? 0 : 0x00ffffff) |
- ((msk[x>>3] & (0x80 >> (x&7))) ? 0xff000000 : 0);
- }
-
- dst += pitch;
- src += cursor[0]/8;
- msk += cursor[0]/8;
- }
-
- shape->Unlock( shape );
- }
- else {
- /* Invisible cursor */
- shape->Clear( shape, 0, 0, 0, 0 );
- }
-
- g_current->window->SetCursorShape( g_current->window, shape,
- cursor ? cursor[1] : 0,
- cursor ? cursor[2] : 0 );
- g_current->cursor = type;
-
- shape->Release( shape );
-}
-
-
-void GLUTAPIENTRY
-glutWarpPointer( int x, int y )
-{
- if (g_current) {
- if (!g_game) {
- int wx, wy;
- g_current->window->GetPosition( g_current->window, &wx, &wy );
- primary->WarpCursor( primary, wx+x, wy+y );
- }
- else {
- g_current->cx = x;
- g_current->cy = y;
- }
- }
-}
-
-
diff --git a/src/glut/directfb/cursors.h b/src/glut/directfb/cursors.h
deleted file mode 100644
index 30ab7c348e6..00000000000
--- a/src/glut/directfb/cursors.h
+++ /dev/null
@@ -1,306 +0,0 @@
-#ifndef __GLUT_CURSORS_H__
-#define __GLUT_CURSORS_H__
-
-
-static const unsigned char cur_right_arrow[] = {
- 16, /* size */
- 1, 2, /* hotspot */
- /* data */
- 0x00, 0x00, 0x60, 0x00, 0x78, 0x00, 0x3e, 0x00,
- 0x3f, 0x80, 0x1f, 0xe0, 0x1f, 0xf8, 0x0f, 0x80,
- 0x0f, 0xc0, 0x06, 0xe0, 0x06, 0x70, 0x02, 0x38,
- 0x02, 0x1c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00,
- /* mask */
- 0xe0, 0x00, 0xf8, 0x00, 0xfe, 0x00, 0x7f, 0x80,
- 0x7f, 0xe0, 0x3f, 0xf8, 0x3f, 0xfc, 0x1f, 0xfc,
- 0x1f, 0xe0, 0x0f, 0xf0, 0x0f, 0xf8, 0x07, 0x7c,
- 0x07, 0x3e, 0x02, 0x1f, 0x00, 0x0e, 0x00, 0x04,
-};
-
-static const unsigned char cur_left_arrow[] = {
- 16, /* size */
- 1, 15, /* hotspot */
- /* data */
- 0x00, 0x00, 0x80, 0x06, 0x00, 0x1e, 0x00, 0x7c,
- 0x01, 0xfc, 0x07, 0xf8, 0x1f, 0xf8, 0x01, 0xf0,
- 0x01, 0xf0, 0x02, 0x60, 0x04, 0x60, 0x08, 0x40,
- 0x10, 0x40, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00,
- /* mask */
- 0x00, 0x07, 0x00, 0x1f, 0x00, 0x7f, 0x01, 0xfe,
- 0x07, 0xfe, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8,
- 0x03, 0xf8, 0x07, 0xf0, 0x0e, 0xf0, 0x1c, 0xe0,
- 0x38, 0xe0, 0x70, 0xe0, 0xe0, 0x00, 0xc0, 0x00,
-};
-
-static const unsigned char cur_info[] = {
- 16, /* size */
- 0, 2, /* hotspot */
- /* data */
- 0x30, 0x00, 0x3c, 0x00, 0x0f, 0x00, 0x07, 0x80,
- 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x07, 0xf4,
- 0x0f, 0xfe, 0x0f, 0xfa, 0x07, 0xe0, 0x03, 0xe0,
- 0x00, 0x52, 0x00, 0x46, 0x00, 0x2c, 0x00, 0x18,
- /* mask */
- 0xb8, 0x00, 0x3e, 0x00, 0x1f, 0x80, 0x0f, 0xc0,
- 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xfc, 0x1f, 0xfe,
- 0x1f, 0xfe, 0x1f, 0xfe, 0x0f, 0xfe, 0x07, 0xfe,
- 0x03, 0xfe, 0x00, 0xfe, 0x00, 0x7e, 0x00, 0x3c,
-};
-
-static const unsigned char cur_destroy[] = {
- 16, /* size */
- 12, 8, /* hotspot */
- /* data */
- 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0c, 0xcc,
- 0x0c, 0xcc, 0x07, 0xf8, 0x03, 0xf0, 0x01, 0xe0,
- 0x21, 0xe1, 0x61, 0xe1, 0x10, 0xc2, 0x0e, 0x1c,
- 0x01, 0xe0, 0x47, 0xf8, 0x7c, 0x0f, 0x20, 0x01,
- /* mask */
- 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0xfc, 0x1f, 0xfe,
- 0x1f, 0xfe, 0x0f, 0xfc, 0x07, 0xf8, 0x83, 0xf1,
- 0xe3, 0xf1, 0xf3, 0xf3, 0x39, 0xef, 0x1e, 0x1e,
- 0x01, 0xe0, 0xc7, 0xfe, 0xff, 0xff, 0x7c, 0x0f,
-};
-
-static const unsigned char cur_help[] = {
- 16, /* size */
- 7, 8, /* hotspot */
- /* data */
- 0x83, 0xe0, 0x07, 0xf0, 0x0e, 0x38, 0x0c, 0x18,
- 0x0c, 0x38, 0x0e, 0x30, 0x07, 0x00, 0x03, 0xc0,
- 0x01, 0xc0, 0x01, 0x40, 0x01, 0x40, 0x07, 0x70,
- 0x03, 0x60, 0x01, 0xc0, 0x00, 0x80, 0x00, 0x00,
- /* mask */
- 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc,
- 0x1e, 0x3c, 0x1e, 0x7c, 0x1f, 0x78, 0x0f, 0xf0,
- 0x07, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x07, 0xf0,
- 0x0f, 0xf8, 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0,
-};
-
-static const unsigned char cur_cycle[] = {
- 16, /* size */
- 7, 9, /* hotspot */
- /* data */
- 0x00, 0x00, 0x07, 0xe2, 0x0f, 0xf6, 0x18, 0x3e,
- 0x10, 0x12, 0x00, 0x32, 0x00, 0x7e, 0x00, 0x00,
- 0x00, 0x00, 0x7e, 0x00, 0x4c, 0x00, 0x48, 0x08,
- 0x7c, 0x18, 0x6f, 0xf0, 0x47, 0xe0, 0x00, 0x00,
- /* mask */
- 0x07, 0xe3, 0x0f, 0xf7, 0x1f, 0xff, 0x3f, 0xff,
- 0x38, 0x3f, 0x30, 0xff, 0x00, 0xff, 0x00, 0xff,
- 0xff, 0x00, 0xff, 0x00, 0xfe, 0x0c, 0xfc, 0x1c,
- 0xff, 0xfc, 0xff, 0xf8, 0xef, 0xf0, 0xc7, 0xe0,
-};
-
-static const unsigned char cur_spray[] = {
- 16, /* size */
- 2, 4, /* hotspot */
- /* data */
- 0x98, 0x00, 0x02, 0x00, 0x18, 0xb0, 0x02, 0x78,
- 0x18, 0x58, 0x00, 0xfc, 0x00, 0x84, 0x00, 0x9c,
- 0x00, 0x94, 0x00, 0x9c, 0x00, 0x94, 0x00, 0x9c,
- 0x00, 0x9c, 0x00, 0x84, 0x00, 0x84, 0x00, 0xfc,
- /* mask */
- 0x30, 0x00, 0x34, 0x60, 0x35, 0xf0, 0x35, 0xf0,
- 0x35, 0xf8, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc,
- 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc,
- 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc,
-};
-
-static const unsigned char cur_wait[] = {
- 16, /* size */
- 9, 1, /* hotspot */
- /* data */
- 0x07, 0xf8, 0x07, 0xf8, 0x07, 0xf8, 0x0f, 0xfc,
- 0x18, 0x86, 0x30, 0x83, 0xe0, 0x81, 0xe1, 0xc1,
- 0xe1, 0xc1, 0xe0, 0x21, 0x30, 0x13, 0x18, 0x06,
- 0x0f, 0xfc, 0x07, 0xf8, 0x07, 0xf8, 0x07, 0xf8,
- /* mask */
- 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x1f, 0xfe,
- 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff,
- 0x1f, 0xfe, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc,
-};
-
-static const unsigned char cur_text[] = {
- 16, /* size */
- 8, 8, /* hotspot */
- /* data */
- 0x00, 0x00, 0x0f, 0x70, 0x09, 0xc0, 0x00, 0x80,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
- 0x00, 0x80, 0x01, 0xc0, 0x07, 0x70, 0x00, 0x00,
- /* mask */
- 0x0f, 0x78, 0x0f, 0xf8, 0x0f, 0xf8, 0x03, 0xe0,
- 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
- 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
- 0x03, 0xe0, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0x78,
-};
-
-static const unsigned char cur_crosshair[] = {
- 16, /* size */
- 7, 9, /* hotspot */
- /* data */
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0xff, 0x7f,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
- /* mask */
- 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
- 0x01, 0xc0, 0x01, 0xc0, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
- 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
-};
-
-static const unsigned char cur_up_down[] = {
- 16, /* size */
- 7, 8, /* hotspot */
- /* data */
- 0x00, 0x80, 0x09, 0xc0, 0x03, 0xe0, 0x07, 0xf0,
- 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40,
- 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x07, 0xf0,
- 0x03, 0xe0, 0x01, 0xc0, 0x00, 0x80, 0x00, 0x00,
- /* mask */
- 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8,
- 0x0f, 0xf8, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0,
- 0x03, 0xe0, 0x03, 0xe0, 0x0f, 0xf8, 0x0f, 0xf8,
- 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0, 0x00, 0x00,
-};
-
-static const unsigned char cur_left_right[] = {
- 16, /* size */
- 7, 8, /* hotspot */
- /* data */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x08, 0x18, 0x0c, 0x3f, 0xfe, 0x78, 0x0f,
- 0x3f, 0xfe, 0x18, 0x0c, 0x08, 0x08, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* mask */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x18,
- 0x1c, 0x1c, 0x3f, 0xfe, 0x7f, 0xff, 0x7f, 0xff,
- 0x7f, 0xff, 0x3f, 0xfe, 0x1c, 0x1c, 0x0c, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char cur_top_side[] = {
- 16, /* size */
- 1, 8, /* hotspot */
- /* data */
- 0x00, 0x00, 0xff, 0xfe, 0x3f, 0xfe, 0x00, 0x00,
- 0x00, 0x80, 0x01, 0xc0, 0x02, 0xa0, 0x04, 0x90,
- 0x08, 0x88, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
- /* mask */
- 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff,
- 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8,
- 0x1d, 0xdc, 0x19, 0xcc, 0x01, 0xc0, 0x01, 0xc0,
- 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
-};
-
-static const unsigned char cur_bottom_side[] = {
- 16, /* size */
- 14, 8, /* hotspot */
- /* data */
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x08, 0x88,
- 0x04, 0x90, 0x02, 0xa0, 0x01, 0xc0, 0x00, 0x80,
- 0x00, 0x00, 0x3f, 0xfe, 0x3f, 0xfe, 0x00, 0x00,
- /* mask */
- 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
- 0x01, 0xc0, 0x01, 0xc0, 0x19, 0xcc, 0x1d, 0xdc,
- 0x0f, 0xf8, 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0,
- 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff,
-};
-
-static const unsigned char cur_left_side[] = {
- 16, /* size */
- 7, 15, /* hotspot */
- /* data */
- 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x01, 0x06,
- 0x00, 0x86, 0x00, 0x46, 0x00, 0x26, 0x7f, 0xf6,
- 0x00, 0x26, 0x00, 0x46, 0x00, 0x86, 0x01, 0x06,
- 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
- /* mask */
- 0x00, 0x0f, 0x00, 0x0f, 0x03, 0x0f, 0x03, 0x8f,
- 0x01, 0xcf, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x00, 0xef, 0x01, 0xcf, 0x03, 0x8f,
- 0x03, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x00,
-};
-
-static const unsigned char cur_right_side[] = {
- 16, /* size */
- 7, 2, /* hotspot */
- /* data */
- 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x80,
- 0x61, 0x00, 0x62, 0x00, 0x64, 0x00, 0x6f, 0xfe,
- 0x64, 0x00, 0x62, 0x00, 0x61, 0x00, 0x60, 0x80,
- 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* mask */
- 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0xc0, 0xf1, 0xc0,
- 0xf3, 0x80, 0xf7, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xf7, 0x00, 0xf3, 0x80, 0xf1, 0xc0,
- 0xf0, 0xc0, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char cur_top_left[] = {
- 16, /* size */
- 1, 15, /* hotspot */
- /* data */
- 0x00, 0x00, 0xff, 0xfe, 0x7f, 0xfe, 0x00, 0x06,
- 0x00, 0x06, 0x00, 0x06, 0x1f, 0xc6, 0x00, 0xc6,
- 0x01, 0x46, 0x02, 0x46, 0x04, 0x46, 0x08, 0x46,
- 0x10, 0x46, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00,
- /* mask */
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x0f, 0x3f, 0xef, 0x3f, 0xef, 0x3f, 0xef,
- 0x03, 0xef, 0x07, 0xef, 0x0e, 0xef, 0x1c, 0xef,
- 0x38, 0xef, 0x30, 0xef, 0x00, 0x0f, 0x00, 0x0f,
-};
-
-static const unsigned char cur_top_right[] = {
- 16, /* size */
- 1, 2, /* hotspot */
- /* data */
- 0x00, 0x00, 0xff, 0xfe, 0x7f, 0xfe, 0x60, 0x00,
- 0x60, 0x00, 0x60, 0x00, 0x63, 0xf8, 0x63, 0x00,
- 0x62, 0x80, 0x62, 0x40, 0x62, 0x20, 0x62, 0x10,
- 0x62, 0x08, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00,
- /* mask */
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xf0, 0x00, 0xf7, 0xfc, 0xf7, 0xfc, 0xf7, 0xfc,
- 0xf7, 0xc0, 0xf7, 0xe0, 0xf7, 0x70, 0xf7, 0x38,
- 0xf7, 0x1c, 0xf7, 0x0c, 0xf0, 0x00, 0xf0, 0x00,
-};
-
-static const unsigned char cur_bottom_right[] = {
- 16, /* size */
- 14, 2, /* hotspot */
- /* data */
- 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x62, 0x08,
- 0x62, 0x10, 0x62, 0x20, 0x62, 0x40, 0x62, 0x80,
- 0x63, 0x00, 0x63, 0xf8, 0x60, 0x00, 0x60, 0x00,
- 0x60, 0x00, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00,
- /* mask */
- 0xf0, 0x00, 0xf0, 0x00, 0xf7, 0x0c, 0xf7, 0x1c,
- 0xf7, 0x38, 0xf7, 0x70, 0xf7, 0xe0, 0xf7, 0xc0,
- 0xf7, 0xfc, 0xf7, 0xfc, 0xf7, 0xfc, 0xf0, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-};
-
-static const unsigned char cur_bottom_left[] = {
- 16, /* size */
- 14, 15, /* hotspot */
- /* data */
- 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x10, 0x46,
- 0x08, 0x46, 0x04, 0x46, 0x02, 0x46, 0x01, 0x46,
- 0x00, 0xc6, 0x1f, 0xc6, 0x00, 0x06, 0x00, 0x06,
- 0x00, 0x06, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00,
- /* mask */
- 0x00, 0x0f, 0x00, 0x0f, 0x30, 0xef, 0x38, 0xef,
- 0x1c, 0xef, 0x0e, 0xef, 0x07, 0xef, 0x03, 0xef,
- 0x3f, 0xef, 0x3f, 0xef, 0x3f, 0xef, 0x00, 0x0f,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-};
-
-
-#endif /* __GLUT_CURSORS_H__ */
diff --git a/src/glut/directfb/events.c b/src/glut/directfb/events.c
deleted file mode 100644
index 4c474710abe..00000000000
--- a/src/glut/directfb/events.c
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "internal.h"
-
-
-/*****************************************************************************/
-
-static int g_ignore_key_repeat = 0;
-
-/*****************************************************************************/
-
-
-int GLUTAPIENTRY
-glutDeviceGet( GLenum type )
-{
- switch (type) {
- case GLUT_HAS_KEYBOARD:
- return (keyboard != NULL);
- case GLUT_HAS_MOUSE:
- return (mouse != NULL);
- case GLUT_NUM_MOUSE_BUTTONS:
- if (mouse) {
- DFBInputDeviceDescription dsc;
- mouse->GetDescription( mouse, &dsc );
- return dsc.max_button+1;
- }
- break;
- case GLUT_DEVICE_IGNORE_KEY_REPEAT:
- return g_ignore_key_repeat;
- case GLUT_DEVICE_KEY_REPEAT:
- return (g_ignore_key_repeat) ? GLUT_KEY_REPEAT_OFF
- : GLUT_KEY_REPEAT_ON;
- case GLUT_HAS_JOYSTICK:
- case GLUT_OWNS_JOYSTICK:
- return (g_game && joystick); /* only available in game mode */
- case GLUT_JOYSTICK_BUTTONS:
- if (joystick) {
- DFBInputDeviceDescription dsc;
- joystick->GetDescription( joystick, &dsc );
- return dsc.max_button+1;
- }
- break;
- case GLUT_JOYSTICK_AXES:
- if (joystick) {
- DFBInputDeviceDescription dsc;
- joystick->GetDescription( joystick, &dsc );
- return dsc.max_axis+1;
- }
- break;
- case GLUT_JOYSTICK_POLL_RATE:
- if (joystick)
- return 1; /* hack */
- break;
- default:
- break;
- }
-
- return 0;
-}
-
-
-int GLUTAPIENTRY
-glutGetModifiers( void )
-{
- if (g_current)
- return g_current->modifiers;
- return 0;
-}
-
-
-void GLUTAPIENTRY
-glutIgnoreKeyRepeat( int ignore )
-{
- g_ignore_key_repeat = ignore;
-}
-
-
-void GLUTAPIENTRY
-glutSetKeyRepeat( int mode )
-{
- g_ignore_key_repeat = (mode == GLUT_KEY_REPEAT_OFF);
-}
-
-
-void GLUTAPIENTRY
-glutForceJoystickFunc( void )
-{
- if (g_game && joystick && joystick_func) {
- joystick_func( g_game->buttons,
- g_game->jx, g_game->jy, g_game->jz );
- }
-}
-
-
-static int
-__glutSpecialKey( DFBInputDeviceKeySymbol key )
-{
- switch (key) {
- case DIKS_F1:
- return GLUT_KEY_F1;
- case DIKS_F2:
- return GLUT_KEY_F2;
- case DIKS_F3:
- return GLUT_KEY_F3;
- case DIKS_F4:
- return GLUT_KEY_F4;
- case DIKS_F5:
- return GLUT_KEY_F5;
- case DIKS_F6:
- return GLUT_KEY_F6;
- case DIKS_F7:
- return GLUT_KEY_F7;
- case DIKS_F8:
- return GLUT_KEY_F8;
- case DIKS_F9:
- return GLUT_KEY_F9;
- case DIKS_F10:
- return GLUT_KEY_F10;
- case DIKS_F11:
- return GLUT_KEY_F11;
- case DIKS_F12:
- return GLUT_KEY_F12;
- case DIKS_CURSOR_LEFT:
- return GLUT_KEY_LEFT;
- case DIKS_CURSOR_UP:
- return GLUT_KEY_UP;
- case DIKS_CURSOR_RIGHT:
- return GLUT_KEY_RIGHT;
- case DIKS_CURSOR_DOWN:
- return GLUT_KEY_DOWN;
- case DIKS_PAGE_UP:
- return GLUT_KEY_PAGE_UP;
- case DIKS_PAGE_DOWN:
- return GLUT_KEY_PAGE_DOWN;
- case DIKS_HOME:
- return GLUT_KEY_HOME;
- case DIKS_END:
- return GLUT_KEY_END;
- case DIKS_INSERT:
- return GLUT_KEY_INSERT;
- default:
- break;
- }
-
- return 0;
-}
-
-
-static int
-__glutButton( DFBInputDeviceButtonIdentifier button )
-{
- switch (button) {
- case DIBI_LEFT:
- return GLUT_LEFT_BUTTON;
- case DIBI_MIDDLE:
- return GLUT_MIDDLE_BUTTON;
- case DIBI_RIGHT:
- return GLUT_RIGHT_BUTTON;
- default:
- break;
- }
-
- return 0;
-}
-
-
-static int
-__glutModifiers( DFBInputDeviceModifierMask mask )
-{
- return ((mask & DIMM_SHIFT) ? GLUT_ACTIVE_SHIFT : 0) |
- ((mask & DIMM_CONTROL) ? GLUT_ACTIVE_CTRL : 0) |
- ((mask & DIMM_ALT) ? GLUT_ACTIVE_ALT : 0);
-}
-
-
-static void
-__glutWindowEvent( DFBWindowEvent *e, DFBWindowEvent *p )
-{
- __GlutWindow *window;
-
- window = __glutFindWindow( e->window_id );
- if (!window) /* window was destroyed */
- return;
-
- switch (e->type) {
- case DWET_KEYDOWN:
- window->modifiers = __glutModifiers( e->modifiers );
- if (g_ignore_key_repeat && p) {
- if (p->type == DWET_KEYDOWN &&
- p->window_id == e->window_id &&
- p->key_symbol == e->key_symbol)
- break;
- }
- if (DFB_KEY_IS_ASCII( e->key_symbol )) {
- if (keyboard_func) {
- __glutSetWindow( window );
- keyboard_func( e->key_symbol, e->x, e->y );
- }
- }
- else {
- int key = __glutSpecialKey( e->key_symbol );
- if (key && special_func) {
- __glutSetWindow( window );
- special_func( key, e->x, e->y );
- }
- }
- break;
- case DWET_KEYUP:
- window->modifiers = __glutModifiers( e->modifiers );
- if (DFB_KEY_IS_ASCII( e->key_symbol )) {
- if (keyboard_up_func) {
- __glutSetWindow( window );
- keyboard_up_func( e->key_symbol, e->x, e->y );
- }
- }
- else {
- int key = __glutSpecialKey( e->key_symbol );
- if (key && special_up_func) {
- __glutSetWindow( window );
- special_up_func( key, e->x, e->y );
- }
- }
- break;
- case DWET_BUTTONDOWN:
- if (mouse_func) {
- __glutSetWindow( window );
- mouse_func( __glutButton( e->button ), GLUT_DOWN, e->x, e->y );
- }
- break;
- case DWET_BUTTONUP:
- if (mouse_func) {
- __glutSetWindow( window );
- mouse_func( __glutButton( e->button ), GLUT_UP, e->x, e->y );
- }
- break;
- case DWET_MOTION:
- if (e->buttons) {
- if (motion_func) {
- __glutSetWindow( window );
- motion_func( e->cx, e->cy );
- }
- }
- else {
- if (passive_motion_func) {
- __glutSetWindow( window );
- passive_motion_func( e->cx, e->cy );
- }
- }
- break;
- case DWET_ENTER:
- if (entry_func) {
- __glutSetWindow( window );
- entry_func( GLUT_ENTERED );
- }
- break;
- case DWET_LEAVE:
- if (entry_func) {
- __glutSetWindow( window );
- entry_func( GLUT_LEFT );
- }
- break;
- case DWET_SIZE:
- window->reshape = GL_TRUE;
- window->redisplay = GL_TRUE;
- break;
- default:
- break;
- }
-}
-
-
-static void
-__glutInputEvent( DFBInputEvent *e, DFBInputEvent *p )
-{
- __glutAssert( g_game != NULL );
-
- switch (e->type) {
- case DIET_KEYPRESS:
- g_game->modifiers = __glutModifiers( e->modifiers );
- if (g_ignore_key_repeat && p) {
- if (p->type == DIET_KEYPRESS &&
- p->key_symbol == e->key_symbol)
- break;
- }
- if (DFB_KEY_IS_ASCII( e->key_symbol )) {
- if (keyboard_func) {
- __glutSetWindow( g_game );
- keyboard_func( e->key_symbol, g_game->cx, g_game->cy );
- }
- }
- else {
- int key = __glutSpecialKey( e->key_symbol );
- if (key && special_func) {
- __glutSetWindow( g_game );
- special_func( key, g_game->cx, g_game->cy );
- }
- }
- break;
- case DIET_KEYRELEASE:
- g_game->modifiers = __glutModifiers( e->modifiers );
- if (DFB_KEY_IS_ASCII( e->key_symbol )) {
- if (keyboard_up_func) {
- __glutSetWindow( g_game );
- keyboard_up_func( e->key_symbol, g_game->cx, g_game->cy );
- }
- }
- else {
- int key = __glutSpecialKey( e->key_symbol );
- if (key && special_up_func) {
- __glutSetWindow( g_game );
- special_up_func( key, g_game->cx, g_game->cy );
- }
- }
- break;
- case DIET_BUTTONPRESS:
- if (e->device_id == DIDID_JOYSTICK) {
- g_game->buttons = e->buttons;
- if (joystick_func) {
- __glutSetWindow( g_game );
- joystick_func( g_game->buttons,
- g_game->jx, g_game->jy, g_game->jz );
- }
- }
- else {
- if (mouse_func) {
- __glutSetWindow( g_game );
- mouse_func( __glutButton( e->button ),
- GLUT_DOWN, g_game->cx, g_game->cy );
- }
- }
- break;
- case DIET_BUTTONRELEASE:
- if (e->device_id == DIDID_JOYSTICK) {
- g_game->buttons = e->buttons;
- if (joystick_func) {
- __glutSetWindow( g_game );
- joystick_func( g_game->buttons,
- g_game->jx, g_game->jy, g_game->jz );
- }
- }
- else {
- if (mouse_func) {
- __glutSetWindow( g_game );
- mouse_func( __glutButton( e->button ),
- GLUT_UP, g_game->cx, g_game->cy );
- }
- }
- break;
- case DIET_AXISMOTION:
- if (e->device_id == DIDID_JOYSTICK) {
- switch (e->axis) {
- case DIAI_X:
- if (e->flags & DIEF_AXISABS)
- g_game->jx = e->axisabs;
- else if (e->flags & DIEF_AXISREL)
- g_game->jx += e->axisrel;
- break;
- case DIAI_Y:
- if (e->flags & DIEF_AXISABS)
- g_game->jy = e->axisabs;
- else if (e->flags & DIEF_AXISREL)
- g_game->jy += e->axisrel;
- break;
- case DIAI_Z:
- if (e->flags & DIEF_AXISABS)
- g_game->jz = e->axisabs;
- else if (e->flags & DIEF_AXISREL)
- g_game->jz += e->axisrel;
- break;
- default:
- break;
- }
- if (joystick_func) {
- __glutSetWindow( g_game );
- joystick_func( g_game->buttons,
- g_game->jx, g_game->jy, g_game->jz );
- }
- }
- else {
- switch (e->axis) {
- case DIAI_X:
- if (e->flags & DIEF_AXISABS)
- g_game->cx = e->axisabs;
- else if (e->flags & DIEF_AXISREL)
- g_game->cx += e->axisrel;
- break;
- case DIAI_Y:
- if (e->flags & DIEF_AXISABS)
- g_game->cy = e->axisabs;
- else if (e->flags & DIEF_AXISREL)
- g_game->cy += e->axisrel;
- break;
- default:
- return;
- }
- if (e->buttons && motion_func) {
- __glutSetWindow( g_game );
- motion_func( g_game->cx, g_game->cy );
- }
- else if (!e->buttons && passive_motion_func) {
- __glutSetWindow( g_game );
- passive_motion_func( g_game->cx, g_game->cy );
- }
- }
- break;
- default:
- break;
- }
-}
-
-
-void GLUTAPIENTRY
-glutMainLoop( void )
-{
- __glutAssert( events != NULL );
-
- while (GL_TRUE) {
- DFBEvent evt, prev;
-
- g_idle = GL_TRUE;
-
- __glutHandleTimers();
- __glutHandleWindows();
-
- prev.clazz = DFEC_NONE;
-
- while (events->GetEvent( events, &evt ) == DFB_OK) {
- g_idle = GL_FALSE;
-
- switch (evt.clazz) {
- case DFEC_WINDOW:
- if (prev.clazz == DFEC_WINDOW)
- __glutWindowEvent( &evt.window, &prev.window );
- else
- __glutWindowEvent( &evt.window, NULL );
- break;
- case DFEC_INPUT:
- if (prev.clazz == DFEC_INPUT)
- __glutInputEvent( &evt.input, &prev.input );
- else
- __glutInputEvent( &evt.input, NULL );
- break;
- default:
- __glutWarning( "unexpected event class %d!\n", evt.clazz );
- break;
- }
-
- prev = evt;
-
- __glutHandleTimers();
- }
-
- if (g_idle) {
- if (idle_func) {
- idle_func();
- }
- else {
- __glutSetWindow( NULL );
- usleep( 500 );
- }
- }
- }
-}
-
diff --git a/src/glut/directfb/ext.c b/src/glut/directfb/ext.c
deleted file mode 100644
index d7338ce5f7b..00000000000
--- a/src/glut/directfb/ext.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "internal.h"
-
-
-static const struct {
- const char *name;
- const GLUTproc address;
-} glut_functions[] = {
- { "glutInit", (const GLUTproc) glutInit },
- { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode },
- { "glutInitDisplayString", (const GLUTproc) glutInitDisplayString },
- { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition },
- { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize },
- { "glutMainLoop", (const GLUTproc) glutMainLoop },
- { "glutCreateWindow", (const GLUTproc) glutCreateWindow },
- { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow },
- { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow },
- { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay },
- { "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay },
- { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers },
- { "glutGetWindow", (const GLUTproc) glutGetWindow },
- { "glutSetWindow", (const GLUTproc) glutSetWindow },
- { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle },
- { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle },
- { "glutPositionWindow", (const GLUTproc) glutPositionWindow },
- { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow },
- { "glutPopWindow", (const GLUTproc) glutPopWindow },
- { "glutPushWindow", (const GLUTproc) glutPushWindow },
- { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow },
- { "glutShowWindow", (const GLUTproc) glutShowWindow },
- { "glutHideWindow", (const GLUTproc) glutHideWindow },
- { "glutFullScreen", (const GLUTproc) glutFullScreen },
- { "glutSetCursor", (const GLUTproc) glutSetCursor },
- { "glutWarpPointer", (const GLUTproc) glutWarpPointer },
- { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay },
- { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay },
- { "glutUseLayer", (const GLUTproc) glutUseLayer },
- { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay },
- { "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay },
- { "glutShowOverlay", (const GLUTproc) glutShowOverlay },
- { "glutHideOverlay", (const GLUTproc) glutHideOverlay },
- { "glutCreateMenu", (const GLUTproc) glutCreateMenu },
- { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu },
- { "glutGetMenu", (const GLUTproc) glutGetMenu },
- { "glutSetMenu", (const GLUTproc) glutSetMenu },
- { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry },
- { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu },
- { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry },
- { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu },
- { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem },
- { "glutAttachMenu", (const GLUTproc) glutAttachMenu },
- { "glutDetachMenu", (const GLUTproc) glutDetachMenu },
- { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc },
- { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc },
- { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc },
- { "glutMouseFunc", (const GLUTproc) glutMouseFunc },
- { "glutMotionFunc", (const GLUTproc) glutMotionFunc },
- { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc },
- { "glutEntryFunc", (const GLUTproc) glutEntryFunc },
- { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc },
- { "glutIdleFunc", (const GLUTproc) glutIdleFunc },
- { "glutTimerFunc", (const GLUTproc) glutTimerFunc },
- { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc },
- { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc },
- { "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc },
- { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc },
- { "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc },
- { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc },
- { "glutDialsFunc", (const GLUTproc) glutDialsFunc },
- { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc },
- { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc },
- { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc },
- { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc },
- { "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc },
- { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc },
- { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc },
- { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc },
- { "glutSetColor", (const GLUTproc) glutSetColor },
- { "glutGetColor", (const GLUTproc) glutGetColor },
- { "glutCopyColormap", (const GLUTproc) glutCopyColormap },
- { "glutGet", (const GLUTproc) glutGet },
- { "glutDeviceGet", (const GLUTproc) glutDeviceGet },
- { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported },
- { "glutGetModifiers", (const GLUTproc) glutGetModifiers },
- { "glutLayerGet", (const GLUTproc) glutLayerGet },
- { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress },
- { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter },
- { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth },
- { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter },
- { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth },
- { "glutBitmapLength", (const GLUTproc) glutBitmapLength },
- { "glutStrokeLength", (const GLUTproc) glutStrokeLength },
- { "glutWireSphere", (const GLUTproc) glutWireSphere },
- { "glutSolidSphere", (const GLUTproc) glutSolidSphere },
- { "glutWireCone", (const GLUTproc) glutWireCone },
- { "glutSolidCone", (const GLUTproc) glutSolidCone },
- { "glutWireCube", (const GLUTproc) glutWireCube },
- { "glutSolidCube", (const GLUTproc) glutSolidCube },
- { "glutWireTorus", (const GLUTproc) glutWireTorus },
- { "glutSolidTorus", (const GLUTproc) glutSolidTorus },
- { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron },
- { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron },
- { "glutWireTeapot", (const GLUTproc) glutWireTeapot },
- { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot },
- { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron },
- { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron },
- { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron },
- { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron },
- { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron },
- { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron },
-// { "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet },
-// { "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing },
-// { "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing },
-// { "glutVideoResize", (const GLUTproc) glutVideoResize },
-// { "glutVideoPan", (const GLUTproc) glutVideoPan },
- { "glutReportErrors", (const GLUTproc) glutReportErrors },
- { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat },
- { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat },
- { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc },
- { "glutGameModeString", (const GLUTproc) glutGameModeString },
- { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode },
- { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode },
- { "glutGameModeGet", (const GLUTproc) glutGameModeGet },
-};
-
-
-GLUTproc GLUTAPIENTRY
-glutGetProcAddress( const char *name )
-{
- int i;
-
- for (i = 0; i < sizeof(glut_functions)/sizeof(glut_functions[0]); i++) {
- if (!strcmp( name, glut_functions[i].name ))
- return glut_functions[i].address;
- }
-
- return NULL;
-}
-
-
-int GLUTAPIENTRY
-glutExtensionSupported( const char *name )
-{
- GLubyte *extensions;
- int length;
-
- if (!name || !*name)
- return 0;
-
- length = strlen( name );
- extensions = (GLubyte*) glGetString( GL_EXTENSIONS );
-
- while (extensions && *extensions) {
- GLubyte *next;
-
- next = strchr( extensions, ' ' );
- if (next) {
- if (length == (int)(next - extensions)) {
- if (!strncmp( extensions, name, length ))
- return 1;
- }
- extensions = next+1;
- }
- else {
- if (!strcmp( extensions, name ))
- return 1;
- break;
- }
- }
-
- return 0;
-}
-
diff --git a/src/glut/directfb/font.c b/src/glut/directfb/font.c
deleted file mode 100644
index 0139cddbecd..00000000000
--- a/src/glut/directfb/font.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* Copyright (c) Mark J. Kilgard, 1994, 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 "internal.h"
-#include "font.h"
-
-
-#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
-
-static inline void*
-__glutFont( void *font )
-{
- switch((long)font) {
- case (long)GLUT_STROKE_ROMAN:
- return &glutStrokeRoman;
- case (long)GLUT_STROKE_MONO_ROMAN:
- return &glutStrokeMonoRoman;
- case (long)GLUT_BITMAP_9_BY_15:
- return &glutBitmap9By15;
- case (long)GLUT_BITMAP_8_BY_13:
- return &glutBitmap8By13;
- case (long)GLUT_BITMAP_TIMES_ROMAN_10:
- return &glutBitmapTimesRoman10;
- case (long)GLUT_BITMAP_TIMES_ROMAN_24:
- return &glutBitmapTimesRoman24;
- case (long)GLUT_BITMAP_HELVETICA_10:
- return &glutBitmapHelvetica10;
- case (long)GLUT_BITMAP_HELVETICA_12:
- return &glutBitmapHelvetica12;
- case (long)GLUT_BITMAP_HELVETICA_18:
- return &glutBitmapHelvetica18;
- }
-
- return NULL;
-}
-
-#else
-
-static inline void*
-__glutFont( void *font )
-{
- return font;
-}
-
-#endif
-
-
-void GLUTAPIENTRY
-glutBitmapCharacter( GLUTbitmapFont font, int c )
-{
- const BitmapCharRec *ch;
- BitmapFontPtr fontinfo;
- GLint swapbytes, lsbfirst, rowlength;
- GLint skiprows, skippixels, alignment;
-
- fontinfo = (BitmapFontPtr) __glutFont( font );
-
- if (!fontinfo || c < fontinfo->first ||
- c >= fontinfo->first + fontinfo->num_chars)
- return;
-
- ch = fontinfo->ch[c - fontinfo->first];
- if (ch) {
- /* Save current modes. */
- 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);
- /* Little endian machines (DEC Alpha for example) could
- benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
- instead of GL_FALSE, but this would require changing the
- generated bitmaps too. */
- 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);
- glBitmap(ch->width, ch->height, ch->xorig, ch->yorig,
- ch->advance, 0, ch->bitmap);
- /* Restore saved 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);
- }
-}
-
-
-int GLUTAPIENTRY
-glutBitmapWidth( GLUTbitmapFont font, int c )
-{
- BitmapFontPtr fontinfo;
- const BitmapCharRec *ch;
-
- fontinfo = (BitmapFontPtr) __glutFont( font );
-
- if (!fontinfo || c < fontinfo->first ||
- c >= fontinfo->first + fontinfo->num_chars)
- return 0;
-
- ch = fontinfo->ch[c - fontinfo->first];
- if (ch)
- return ch->advance;
-
- return 0;
-}
-
-
-int GLUTAPIENTRY
-glutBitmapLength( GLUTbitmapFont font, const unsigned char *string )
-{
- int c, length;
- BitmapFontPtr fontinfo;
- const BitmapCharRec *ch;
-
- fontinfo = (BitmapFontPtr) __glutFont( font );
- if (!fontinfo)
- return 0;
-
- for (length = 0; *string != '\0'; string++) {
- c = *string;
- if (c >= fontinfo->first &&
- c < fontinfo->first + fontinfo->num_chars) {
- ch = fontinfo->ch[c - fontinfo->first];
- if (ch)
- length += ch->advance;
- }
- }
-
- return length;
-}
-
-
-void GLUTAPIENTRY
-glutStrokeCharacter( GLUTstrokeFont font, int c )
-{
- const StrokeCharRec *ch;
- const StrokeRec *stroke;
- const CoordRec *coord;
- StrokeFontPtr fontinfo;
- int i, j;
-
- fontinfo = (StrokeFontPtr) __glutFont( font );
-
- if (!fontinfo || c < 0 || c >= fontinfo->num_chars)
- return;
-
- ch = &(fontinfo->ch[c]);
- if (ch) {
- for (i = ch->num_strokes, stroke = ch->stroke;
- i > 0; i--, stroke++) {
- glBegin(GL_LINE_STRIP);
- for (j = stroke->num_coords, coord = stroke->coord;
- j > 0; j--, coord++) {
- glVertex2f(coord->x, coord->y);
- }
- glEnd();
- }
- glTranslatef(ch->right, 0.0, 0.0);
- }
-}
-
-
-int GLUTAPIENTRY
-glutStrokeWidth( GLUTstrokeFont font, int c )
-{
- StrokeFontPtr fontinfo;
- const StrokeCharRec *ch;
-
- fontinfo = (StrokeFontPtr) __glutFont( font );
-
- if (!fontinfo || c < 0 || c >= fontinfo->num_chars)
- return 0;
-
- ch = &(fontinfo->ch[c]);
- if (ch)
- return ch->right;
-
- return 0;
-}
-
-
-int GLUTAPIENTRY
-glutStrokeLength( GLUTstrokeFont font, const unsigned char *string )
-{
- int c, length;
- StrokeFontPtr fontinfo;
- const StrokeCharRec *ch;
-
- fontinfo = (StrokeFontPtr) __glutFont( font );
- if (!fontinfo)
- return 0;
-
- for (length = 0; *string != '\0'; string++) {
- c = *string;
- if (c >= 0 && c < fontinfo->num_chars) {
- ch = &(fontinfo->ch[c]);
- if (ch)
- length += ch->right;
- }
- }
-
- return length;
-}
-
diff --git a/src/glut/directfb/font.h b/src/glut/directfb/font.h
deleted file mode 100644
index b1e76838a0f..00000000000
--- a/src/glut/directfb/font.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (c) Mark J. Kilgard, 1994, 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 __GLUT_FONT_H__
-#define __GLUT_FONT_H__
-
-
-typedef struct {
- const GLsizei width;
- const GLsizei height;
- const GLfloat xorig;
- const GLfloat yorig;
- const GLfloat advance;
- const GLubyte *bitmap;
-} BitmapCharRec, *BitmapCharPtr;
-
-typedef struct {
- const char *name;
- const int num_chars;
- const int first;
- const BitmapCharRec * const *ch;
-} BitmapFontRec, *BitmapFontPtr;
-
-typedef void *GLUTbitmapFont;
-
-
-typedef struct {
- float x;
- float y;
-} CoordRec, *CoordPtr;
-
-typedef struct {
- int num_coords;
- const CoordRec *coord;
-} StrokeRec, *StrokePtr;
-
-typedef struct {
- int num_strokes;
- const StrokeRec *stroke;
- float center;
- float right;
-} StrokeCharRec, *StrokeCharPtr;
-
-typedef struct {
- const char *name;
- int num_chars;
- const StrokeCharRec *ch;
- float top;
- float bottom;
-} StrokeFontRec, *StrokeFontPtr;
-
-typedef void *GLUTstrokeFont;
-
-
-#endif /* __GLUT_FONT_H__ */
diff --git a/src/glut/directfb/game.c b/src/glut/directfb/game.c
deleted file mode 100644
index 4c027a68f65..00000000000
--- a/src/glut/directfb/game.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "internal.h"
-
-
-/*****************************************************************************/
-
-static int g_display_changed = 0;
-
-/*****************************************************************************/
-
-
-void GLUTAPIENTRY
-glutGameModeString( const char *string )
-{
- int x, y, bpp;
- char *tmp;
-
- if (!string)
- return;
-
- tmp = strchr( string, 'x' );
- if (tmp) {
- x = strtol( string, NULL, 10 );
- y = strtol( tmp+1, NULL, 10 );
-
- if (x > 0 && y > 0) {
- g_width = x;
- g_height = y;
- }
- }
-
- tmp = strchr( string, ':' );
- if (tmp) {
- bpp = strtol( tmp+1, NULL, 10 );
-
- if (bpp > 0)
- g_bpp = bpp;
- }
-}
-
-
-int GLUTAPIENTRY
-glutEnterGameMode( void )
-{
- DFBDisplayLayerConfig prev, cur;
-
- glutInit( NULL, NULL );
-
- primary->GetConfiguration( primary, &prev );
- primary->SetCooperativeLevel( primary, DLSCL_EXCLUSIVE );
-
- if (g_game)
- __glutDestroyWindow( g_game );
-
- g_game = __glutCreateWindow( GL_TRUE );
- if (!g_game)
- return 0;
-
- __glutSetWindow( g_game );
- g_game->cursor = GLUT_CURSOR_NONE;
-
- primary->GetConfiguration( primary, &cur );
- g_display_changed = (cur.width != prev.width ||
- cur.height != prev.height ||
- cur.pixelformat != prev.pixelformat);
-
- return g_game->id;
-}
-
-
-void GLUTAPIENTRY
-glutLeaveGameMode( void )
-{
- if (g_game)
- __glutDestroyWindow( g_game );
-
- primary->SetCooperativeLevel( primary, DLSCL_ADMINISTRATIVE );
-}
-
-
-int GLUTAPIENTRY
-glutGameModeGet( GLenum type )
-{
- switch (type) {
- case GLUT_GAME_MODE_ACTIVE:
- return (g_game != NULL);
- case GLUT_GAME_MODE_POSSIBLE:
- if (primary) {
- DFBDisplayLayerConfig c;
- c.flags = DLCONF_WIDTH | DLCONF_HEIGHT;
- c.width = g_width;
- c.height = g_height;
- /* XXX: bpp */
- if (primary->TestConfiguration( primary, &c, 0 ) == DFB_OK)
- return 1;
- }
- break;
- case GLUT_GAME_MODE_WIDTH:
- if (g_game) {
- int w;
- g_game->surface->GetSize( g_game->surface, &w, 0 );
- return w;
- }
- break;
- case GLUT_GAME_MODE_HEIGHT:
- if (g_game) {
- int h;
- g_game->surface->GetSize( g_game->surface, 0, &h );
- return h;
- }
- break;
- case GLUT_GAME_MODE_PIXEL_DEPTH:
- if (g_game) {
- DFBSurfacePixelFormat f;
- g_game->surface->GetPixelFormat( g_game->surface, &f );
- return DFB_COLOR_BITS_PER_PIXEL( f );
- }
- break;
- case GLUT_GAME_MODE_REFRESH_RATE:
- return 60; /* assume 60hz */
- case GLUT_GAME_MODE_DISPLAY_CHANGED:
- return g_display_changed;
- default:
- break;
- }
-
- return 0;
-}
-
-
-
diff --git a/src/glut/directfb/globals.c b/src/glut/directfb/globals.c
deleted file mode 100644
index 2a5291137e2..00000000000
--- a/src/glut/directfb/globals.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include "internal.h"
-
-IDirectFB *dfb = NULL;
-IDirectFBDisplayLayer *primary = NULL;
-IDirectFBEventBuffer *events = NULL;
-IDirectFBInputDevice *keyboard = NULL;
-IDirectFBInputDevice *mouse = NULL;
-IDirectFBInputDevice *joystick = NULL;
-
-GLenum g_display_mode = 0;
-GLuint g_width = DEFAULT_WIDTH;
-GLuint g_height = DEFAULT_HEIGHT;
-GLint g_xpos = 0;
-GLint g_ypos = 0;
-GLint g_bpp = 0;
-GLboolean g_idle = GL_TRUE;
-__GlutWindow *g_current = NULL;
-__GlutWindow *g_game = NULL;
-
-
-void (GLUTCALLBACK *display_func) (void) = 0;
-void (GLUTCALLBACK *reshape_func) (int width, int height) = 0;
-void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y) = 0;
-void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y) = 0;
-void (GLUTCALLBACK *motion_func) (int x, int y) = 0;
-void (GLUTCALLBACK *passive_motion_func) (int x, int y) = 0;
-void (GLUTCALLBACK *entry_func) (int state) = 0;
-void (GLUTCALLBACK *visibility_func) (int state) = 0;
-void (GLUTCALLBACK *idle_func) (void) = 0;
-void (GLUTCALLBACK *menu_state_func) (int state) = 0;
-void (GLUTCALLBACK *special_func) (int key, int x, int y) = 0;
-void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z) = 0;
-void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z) = 0;
-void (GLUTCALLBACK *spaceball_button_func) (int button, int state) = 0;
-void (GLUTCALLBACK *button_box_func) (int button, int state) = 0;
-void (GLUTCALLBACK *dials_func) (int dial, int value) = 0;
-void (GLUTCALLBACK *tablet_motion_func) (int x, int y) = 0;
-void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y) = 0;
-void (GLUTCALLBACK *menu_status_func) (int status, int x, int y) = 0;
-void (GLUTCALLBACK *overlay_display_func) (void) = 0;
-void (GLUTCALLBACK *window_status_func) (int state) = 0;
-void (GLUTCALLBACK *keyboard_up_func) (unsigned char key, int x, int y) = 0;
-void (GLUTCALLBACK *special_up_func) (int key, int x, int y) = 0;
-void (GLUTCALLBACK *joystick_func) (unsigned int buttons, int x, int y, int z) = 0;
diff --git a/src/glut/directfb/init.c b/src/glut/directfb/init.c
deleted file mode 100644
index ba1a49adf2c..00000000000
--- a/src/glut/directfb/init.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "internal.h"
-
-
-static void
-__glutExit( void )
-{
- __glutFreeTimers();
- __glutDestroyWindows();
-
- if (events) {
- events->Release( events );
- events = NULL;
- }
-
- if (joystick) {
- joystick->Release( joystick );
- joystick = NULL;
- }
-
- if (mouse) {
- mouse->Release( mouse );
- mouse = NULL;
- }
-
- if (keyboard) {
- keyboard->Release( keyboard );
- keyboard = NULL;
- }
-
- if (primary) {
- primary->Release( primary );
- primary = NULL;
- }
-
- if (dfb) {
- dfb->Release( dfb );
- dfb = NULL;
- }
-}
-
-
-void GLUTAPIENTRY
-glutInit( int *argcp, char **argv )
-{
- DFBResult ret;
-
- if (dfb)
- return;
-
- glutGet( GLUT_ELAPSED_TIME );
-
- ret = DirectFBInit( argcp, argv ? &argv : NULL );
- if (ret)
- DirectFBErrorFatal( "DirectFBInit()", ret );
-
- ret = DirectFBCreate( &dfb );
- if (ret)
- DirectFBErrorFatal( "DirectFBCreate()", ret );
-
- ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &primary );
- if (ret)
- DirectFBErrorFatal( "IDirectFB::GetDisplayLayer()", ret );
-
- ret = dfb->CreateEventBuffer( dfb, &events );
- if (ret)
- DirectFBErrorFatal( "IDirectFB::CreateEventBuffer()", ret );
-
- dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard );
- dfb->GetInputDevice( dfb, DIDID_MOUSE, &mouse );
- dfb->GetInputDevice( dfb, DIDID_JOYSTICK, &joystick );
-
- primary->SetCooperativeLevel( primary, DLSCL_ADMINISTRATIVE );
-
- atexit( __glutExit );
-}
-
-
-void GLUTAPIENTRY
-glutInitDisplayMode( unsigned int mode )
-{
- g_display_mode = mode;
-}
-
-
-void GLUTAPIENTRY
-glutInitWindowPosition( int x, int y )
-{
- g_xpos = x;
- g_ypos = y;
-}
-
-
-void GLUTAPIENTRY
-glutInitWindowSize( int width, int height )
-{
- g_width = width;
- g_height = height;
-}
-
-
-void GLUTAPIENTRY
-glutInitDisplayString( const char *string )
-{
-}
-
diff --git a/src/glut/directfb/internal.h b/src/glut/directfb/internal.h
deleted file mode 100644
index 2e986c9f286..00000000000
--- a/src/glut/directfb/internal.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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 __GLUT_INTERNAL_H__
-#define __GLUT_INTERNAL_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <directfb.h>
-#include <directfb_version.h>
-
-#include "GL/glut.h"
-#include "GL/directfbgl.h"
-
-
-#define VERSION_CODE( M, m, r ) (((M) << 16) | ((m) << 8) | ((r)))
-
-#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \
- DIRECTFB_MINOR_VERSION, \
- DIRECTFB_MICRO_VERSION )
-
-
-#define DEFAULT_WIDTH 640
-#define DEFAULT_HEIGHT 480
-
-/*
- * Window request flags
- */
-#define WINDOW_REQUEST_POSITION 0x00000001
-#define WINDOW_REQUEST_RESIZE 0x00000002
-#define WINDOW_REQUEST_RESTACK 0x00000004
-#define WINDOW_REQUEST_SHOW 0x00000008
-#define WINDOW_REQUEST_HIDE 0x00000010
-#define WINDOW_REQUEST_DESTROY 0x00000020
-
-/*
- * GLUT Window implementation
- */
-typedef struct __GlutWindow_s {
- int id;
- DFBWindowID wid;
-
- IDirectFBWindow *window; /* NULL = fullscreen (game mode) */
- IDirectFBSurface *surface;
- IDirectFBGL *gl;
-
- /* cursor position in fullscreen mode */
- int cx;
- int cy;
- /* joystick position */
- int jx;
- int jy;
- int jz;
- /* pressed modifiers */
- int modifiers;
- /* pressed buttons */
- int buttons;
- /* current cursor shape */
- int cursor;
-
- struct {
- int flags;
- int x;
- int y;
- int w;
- int h;
- int z;
- } req;
-
- GLboolean visible;
- GLboolean redisplay;
- GLboolean reshape;
- GLboolean visibility;
-
- struct __GlutWindow_s *next;
- struct __GlutWindow_s *prev;
-} __GlutWindow;
-
-
-/* Global Vars */
-extern IDirectFB *dfb;
-extern IDirectFBDisplayLayer *primary;
-extern IDirectFBEventBuffer *events;
-extern IDirectFBInputDevice *keyboard;
-extern IDirectFBInputDevice *mouse;
-extern IDirectFBInputDevice *joystick;
-
-extern GLenum g_display_mode;
-extern GLuint g_width;
-extern GLuint g_height;
-extern GLint g_xpos;
-extern GLint g_ypos;
-extern GLint g_bpp;
-extern GLboolean g_idle;
-extern __GlutWindow *g_current;
-extern __GlutWindow *g_game;
-
-
-/* Global Funcs */
-/* window.c */
-extern __GlutWindow* __glutCreateWindow( GLboolean fullscreen );
-extern __GlutWindow* __glutFindWindow( DFBWindowID id );
-extern void __glutSetWindow( __GlutWindow *window );
-extern void __glutHandleWindows( void );
-extern void __glutDestroyWindow( __GlutWindow *window );
-extern void __glutDestroyWindows( void );
-/* callback.c */
-extern void __glutHandleTimers( void );
-extern void __glutFreeTimers( void );
-
-
-/* Global Callbacks */
-extern void (GLUTCALLBACK *display_func) (void);
-extern void (GLUTCALLBACK *reshape_func) (int width, int height);
-extern void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y);
-extern void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y);
-extern void (GLUTCALLBACK *motion_func) (int x, int y);
-extern void (GLUTCALLBACK *passive_motion_func) (int x, int y);
-extern void (GLUTCALLBACK *entry_func) (int state);
-extern void (GLUTCALLBACK *visibility_func) (int state);
-extern void (GLUTCALLBACK *idle_func) (void);
-extern void (GLUTCALLBACK *menu_state_func) (int state);
-extern void (GLUTCALLBACK *special_func) (int key, int x, int y);
-extern void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z);
-extern void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z);
-extern void (GLUTCALLBACK *spaceball_button_func) (int button, int state);
-extern void (GLUTCALLBACK *button_box_func) (int button, int state);
-extern void (GLUTCALLBACK *dials_func) (int dial, int value);
-extern void (GLUTCALLBACK *tablet_motion_func) (int x, int y);
-extern void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y);
-extern void (GLUTCALLBACK *menu_status_func) (int status, int x, int y);
-extern void (GLUTCALLBACK *overlay_display_func) (void);
-extern void (GLUTCALLBACK *window_status_func) (int state);
-extern void (GLUTCALLBACK *keyboard_up_func) (unsigned char key, int x, int y);
-extern void (GLUTCALLBACK *special_up_func) (int key, int x, int y);
-extern void (GLUTCALLBACK *joystick_func) (unsigned int buttons, int x, int y, int z);
-
-
-#ifdef DEBUG
-# define __glutAssert( exp ) {\
- if (!(exp)) {\
- fprintf( stderr, "(!!) *** Assertion [%s] failed in %s() ***\n",\
- #exp, __FUNCTION__ );
- fflush( stderr );\
- exit( -1 );\
- }\
- }
-#else
-# define __glutAssert( exp )
-#endif
-
-#define __glutWarning( format, ... ) {\
- fprintf( stderr, "(!) GLUT: " format "!\n", ## __VA_ARGS__ );\
- fflush( stderr );\
-}
-
-#define __glutFatalError( format, ... ) {\
- fprintf( stderr, "(!) GLUT: " format "!\n", ## __VA_ARGS__ );\
- fprintf( stderr, "\t-> from %s() at line %d\n", __FUNCTION__, __LINE__ );\
- fflush( stderr );\
- exit( -1 );\
-}
-
-
-#endif /* __GLUT_INTERNAL_H__ */
-
diff --git a/src/glut/directfb/menu.c b/src/glut/directfb/menu.c
deleted file mode 100644
index 400e966bbbe..00000000000
--- a/src/glut/directfb/menu.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include "internal.h"
-
-
-int GLUTAPIENTRY
-glutCreateMenu( void (GLUTCALLBACK *func) (int) )
-{
- return 0;
-}
-
-void GLUTAPIENTRY
-glutDestroyMenu( int menu )
-{
-}
-
-
-int GLUTAPIENTRY
-glutGetMenu( void )
-{
- return 0;
-}
-
-
-void GLUTAPIENTRY
-glutSetMenu( int menu )
-{
-}
-
-
-void GLUTAPIENTRY
-glutAddMenuEntry( const char *label, int value )
-{
-}
-
-
-void GLUTAPIENTRY
-glutAddSubMenu( const char *label, int submenu )
-{
-}
-
-
-void GLUTAPIENTRY
-glutChangeToMenuEntry( int item, const char *label, int value )
-{
-}
-
-
-void GLUTAPIENTRY
-glutChangeToSubMenu( int item, const char *label, int submenu )
-{
-}
-
-
-void GLUTAPIENTRY
-glutRemoveMenuItem( int item )
-{
-}
-
-
-void GLUTAPIENTRY
-glutAttachMenu( int button )
-{
-}
-
-
-void GLUTAPIENTRY
-glutDetachMenu( int button )
-{
-}
diff --git a/src/glut/directfb/models.c b/src/glut/directfb/models.c
deleted file mode 100644
index d96a8f50776..00000000000
--- a/src/glut/directfb/models.c
+++ /dev/null
@@ -1,599 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
-
-/**
-(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.
-*/
-
-#include <math.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-#include "internal.h"
-
-/* Some <math.h> files do not define M_PI... */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-static GLUquadricObj *quadObj;
-
-#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); }
-
-static void
-initQuadObj(void)
-{
- quadObj = gluNewQuadric();
- if (!quadObj)
- __glutFatalError("out of memory");
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_LINE);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluSphere(quadObj, radius, slices, stacks);
-}
-
-void GLUTAPIENTRY
-glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_FILL);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluSphere(quadObj, radius, slices, stacks);
-}
-
-void GLUTAPIENTRY
-glutWireCone(GLdouble base, GLdouble height,
- GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_LINE);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluCylinder(quadObj, base, 0.0, height, slices, stacks);
-}
-
-void GLUTAPIENTRY
-glutSolidCone(GLdouble base, GLdouble height,
- GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_FILL);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluCylinder(quadObj, base, 0.0, height, slices, stacks);
-}
-
-/* ENDCENTRY */
-
-static void
-drawBox(GLfloat size, GLenum type)
-{
- static GLfloat n[6][3] =
- {
- {-1.0, 0.0, 0.0},
- {0.0, 1.0, 0.0},
- {1.0, 0.0, 0.0},
- {0.0, -1.0, 0.0},
- {0.0, 0.0, 1.0},
- {0.0, 0.0, -1.0}
- };
- static GLint faces[6][4] =
- {
- {0, 1, 2, 3},
- {3, 2, 6, 7},
- {7, 6, 5, 4},
- {4, 5, 1, 0},
- {5, 6, 2, 1},
- {7, 4, 0, 3}
- };
- GLfloat v[8][3];
- GLint i;
-
- v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
- v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
- v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
- v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
- v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
- v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
-
- for (i = 5; i >= 0; i--) {
- glBegin(type);
-/* glNormal3fv(&n[i][0]); */
- glVertex3fv(&v[faces[i][0]][0]);
- glVertex3fv(&v[faces[i][1]][0]);
- glVertex3fv(&v[faces[i][2]][0]);
- glVertex3fv(&v[faces[i][3]][0]);
- glEnd();
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireCube(GLdouble size)
-{
- drawBox(size, GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidCube(GLdouble size)
-{
- drawBox(size, GL_QUADS);
-}
-
-/* ENDCENTRY */
-
-static void
-doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
-{
- int i, j;
- GLfloat theta, phi, theta1;
- GLfloat cosTheta, sinTheta;
- GLfloat cosTheta1, sinTheta1;
- GLfloat ringDelta, sideDelta;
-
- ringDelta = 2.0 * M_PI / rings;
- sideDelta = 2.0 * M_PI / nsides;
-
- theta = 0.0;
- cosTheta = 1.0;
- sinTheta = 0.0;
- for (i = rings - 1; i >= 0; i--) {
- theta1 = theta + ringDelta;
- cosTheta1 = cos(theta1);
- sinTheta1 = sin(theta1);
- glBegin(GL_QUAD_STRIP);
- phi = 0.0;
- for (j = nsides; j >= 0; j--) {
- GLfloat cosPhi, sinPhi, dist;
-
- phi += sideDelta;
- cosPhi = cos(phi);
- sinPhi = sin(phi);
- dist = R + r * cosPhi;
-
-/* glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); */
- glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
-/* glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); */
- glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
- }
- glEnd();
- theta = theta1;
- cosTheta = cosTheta1;
- sinTheta = sinTheta1;
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireTorus(GLdouble innerRadius, GLdouble outerRadius,
- GLint nsides, GLint rings)
-{
-/* glPushAttrib(GL_POLYGON_BIT); */
-/* glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); */
- doughnut(innerRadius, outerRadius, nsides, rings);
-/* glPopAttrib(); */
-}
-
-void GLUTAPIENTRY
-glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius,
- GLint nsides, GLint rings)
-{
- doughnut(innerRadius, outerRadius, nsides, rings);
-}
-
-/* ENDCENTRY */
-
-static GLfloat dodec[20][3];
-
-static void
-initDodecahedron(void)
-{
- GLfloat alpha, beta;
-
- alpha = sqrt(2.0 / (3.0 + sqrt(5.0)));
- beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) -
- 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0))));
- /* *INDENT-OFF* */
- dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta;
- dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta;
- dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1;
- dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1;
- dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1;
- dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1;
- dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1;
- dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1;
- dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1;
- dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1;
- dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0;
- dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0;
- dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0;
- dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0;
- dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta;
- dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta;
- dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha;
- dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha;
- dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha;
- dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha;
- /* *INDENT-ON* */
-
-}
-
-#define DIFF3(_a,_b,_c) { \
- (_c)[0] = (_a)[0] - (_b)[0]; \
- (_c)[1] = (_a)[1] - (_b)[1]; \
- (_c)[2] = (_a)[2] - (_b)[2]; \
-}
-
-static void
-crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3])
-{
- GLfloat p[3]; /* in case prod == v1 or v2 */
-
- p[0] = v1[1] * v2[2] - v2[1] * v1[2];
- p[1] = v1[2] * v2[0] - v2[2] * v1[0];
- p[2] = v1[0] * v2[1] - v2[0] * v1[1];
- prod[0] = p[0];
- prod[1] = p[1];
- prod[2] = p[2];
-}
-
-static void
-normalize(GLfloat v[3])
-{
- GLfloat d;
-
- d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
- if (d == 0.0) {
-/* __glutWarning("normalize: zero length vector"); */
- v[0] = d = 1.0;
- }
- d = 1 / d;
- v[0] *= d;
- v[1] *= d;
- v[2] *= d;
-}
-
-static void
-pentagon(int a, int b, int c, int d, int e, GLenum shadeType)
-{
- GLfloat n0[3], d1[3], d2[3];
-
- DIFF3(dodec[a], dodec[b], d1);
- DIFF3(dodec[b], dodec[c], d2);
- crossprod(d1, d2, n0);
- normalize(n0);
-
- glBegin(shadeType);
-/* glNormal3fv(n0); */
- glVertex3fv(&dodec[a][0]);
- glVertex3fv(&dodec[b][0]);
- glVertex3fv(&dodec[c][0]);
- glVertex3fv(&dodec[d][0]);
- glVertex3fv(&dodec[e][0]);
- glEnd();
-}
-
-static void
-dodecahedron(GLenum type)
-{
- static int inited = 0;
-
- if (inited == 0) {
- inited = 1;
- initDodecahedron();
- }
- pentagon(0, 1, 9, 16, 5, type);
- pentagon(1, 0, 3, 18, 7, type);
- pentagon(1, 7, 11, 10, 9, type);
- pentagon(11, 7, 18, 19, 6, type);
- pentagon(8, 17, 16, 9, 10, type);
- pentagon(2, 14, 15, 6, 19, type);
- pentagon(2, 13, 12, 4, 14, type);
- pentagon(2, 19, 18, 3, 13, type);
- pentagon(3, 0, 5, 12, 13, type);
- pentagon(6, 15, 8, 10, 11, type);
- pentagon(4, 17, 8, 15, 14, type);
- pentagon(4, 12, 5, 16, 17, type);
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireDodecahedron(void)
-{
- dodecahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidDodecahedron(void)
-{
- dodecahedron(GL_TRIANGLE_FAN);
-}
-
-/* ENDCENTRY */
-
-static void
-recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3,
- GLenum shadeType)
-{
- GLfloat q0[3], q1[3];
-
- DIFF3(n1, n2, q0);
- DIFF3(n2, n3, q1);
- crossprod(q0, q1, q1);
- normalize(q1);
-
- glBegin(shadeType);
-/* glNormal3fv(q1); */
- glVertex3fv(n1);
- glVertex3fv(n2);
- glVertex3fv(n3);
- glEnd();
-}
-
-static void
-subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2,
- GLenum shadeType)
-{
- int depth;
- GLfloat w0[3], w1[3], w2[3];
- GLfloat l;
- int i, j, k, n;
-
- depth = 1;
- for (i = 0; i < depth; i++) {
- for (j = 0; i + j < depth; j++) {
- k = depth - i - j;
- for (n = 0; n < 3; n++) {
- w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth;
- w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n])
- / depth;
- w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n])
- / depth;
- }
- l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]);
- w0[0] /= l;
- w0[1] /= l;
- w0[2] /= l;
- l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]);
- w1[0] /= l;
- w1[1] /= l;
- w1[2] /= l;
- l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]);
- w2[0] /= l;
- w2[1] /= l;
- w2[2] /= l;
- recorditem(w1, w0, w2, shadeType);
- }
- }
-}
-
-static void
-drawtriangle(int i, GLfloat data[][3], int ndx[][3],
- GLenum shadeType)
-{
- GLfloat *x0, *x1, *x2;
-
- x0 = data[ndx[i][0]];
- x1 = data[ndx[i][1]];
- x2 = data[ndx[i][2]];
- subdivide(x0, x1, x2, shadeType);
-}
-
-/* octahedron data: The octahedron produced is centered at the
- origin and has radius 1.0 */
-static GLfloat odata[6][3] =
-{
- {1.0, 0.0, 0.0},
- {-1.0, 0.0, 0.0},
- {0.0, 1.0, 0.0},
- {0.0, -1.0, 0.0},
- {0.0, 0.0, 1.0},
- {0.0, 0.0, -1.0}
-};
-
-static int ondex[8][3] =
-{
- {0, 4, 2},
- {1, 2, 4},
- {0, 3, 4},
- {1, 4, 3},
- {0, 2, 5},
- {1, 5, 2},
- {0, 5, 3},
- {1, 3, 5}
-};
-
-static void
-octahedron(GLenum shadeType)
-{
- int i;
-
- for (i = 7; i >= 0; i--) {
- drawtriangle(i, odata, ondex, shadeType);
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireOctahedron(void)
-{
- octahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidOctahedron(void)
-{
- octahedron(GL_TRIANGLES);
-}
-
-/* ENDCENTRY */
-
-/* icosahedron data: These numbers are rigged to make an
- icosahedron of radius 1.0 */
-
-#define X .525731112119133606
-#define Z .850650808352039932
-
-static GLfloat idata[12][3] =
-{
- {-X, 0, Z},
- {X, 0, Z},
- {-X, 0, -Z},
- {X, 0, -Z},
- {0, Z, X},
- {0, Z, -X},
- {0, -Z, X},
- {0, -Z, -X},
- {Z, X, 0},
- {-Z, X, 0},
- {Z, -X, 0},
- {-Z, -X, 0}
-};
-
-static int index[20][3] =
-{
- {0, 4, 1},
- {0, 9, 4},
- {9, 5, 4},
- {4, 5, 8},
- {4, 8, 1},
- {8, 10, 1},
- {8, 3, 10},
- {5, 3, 8},
- {5, 2, 3},
- {2, 7, 3},
- {7, 10, 3},
- {7, 6, 10},
- {7, 11, 6},
- {11, 0, 6},
- {0, 1, 6},
- {6, 1, 10},
- {9, 0, 11},
- {9, 11, 2},
- {9, 2, 5},
- {7, 2, 11},
-};
-
-static void
-icosahedron(GLenum shadeType)
-{
- int i;
-
- for (i = 19; i >= 0; i--) {
- drawtriangle(i, idata, index, shadeType);
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireIcosahedron(void)
-{
- icosahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidIcosahedron(void)
-{
- icosahedron(GL_TRIANGLES);
-}
-
-/* ENDCENTRY */
-
-/* tetrahedron data: */
-
-#define T 1.73205080756887729
-
-static GLfloat tdata[4][3] =
-{
- {T, T, T},
- {T, -T, -T},
- {-T, T, -T},
- {-T, -T, T}
-};
-
-static int tndex[4][3] =
-{
- {0, 1, 3},
- {2, 1, 0},
- {3, 2, 0},
- {1, 2, 3}
-};
-
-static void
-tetrahedron(GLenum shadeType)
-{
- int i;
-
- for (i = 3; i >= 0; i--)
- drawtriangle(i, tdata, tndex, shadeType);
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireTetrahedron(void)
-{
- tetrahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidTetrahedron(void)
-{
- tetrahedron(GL_TRIANGLES);
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/directfb/overlay.c b/src/glut/directfb/overlay.c
deleted file mode 100644
index 714be5f1a28..00000000000
--- a/src/glut/directfb/overlay.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include "internal.h"
-
-
-void GLUTAPIENTRY
-glutEstablishOverlay( void )
-{
-}
-
-
-void GLUTAPIENTRY
-glutRemoveOverlay( void )
-{
-}
-
-
-void GLUTAPIENTRY
-glutUseLayer( GLenum layer )
-{
-}
-
-
-void GLUTAPIENTRY
-glutPostOverlayRedisplay( void )
-{
-}
-
-
-void GLUTAPIENTRY
-glutPostWindowOverlayRedisplay( int win )
-{
-}
-
-
-void GLUTAPIENTRY
-glutShowOverlay( void )
-{
-}
-
-
-void GLUTAPIENTRY
-glutHideOverlay( void )
-{
-}
diff --git a/src/glut/directfb/state.c b/src/glut/directfb/state.c
deleted file mode 100644
index 194d5bbb626..00000000000
--- a/src/glut/directfb/state.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/time.h>
-
-#include "GL/glu.h"
-
-#include "internal.h"
-
-
-int GLUTAPIENTRY
-glutGet( GLenum type )
-{
- switch (type) {
- case GLUT_WINDOW_X:
- if (g_current && g_current->window) {
- int x;
- g_current->window->GetPosition( g_current->window, &x, 0 );
- return x;
- }
- break;
- case GLUT_WINDOW_Y:
- if (g_current && g_current->window) {
- int y;
- g_current->window->GetPosition( g_current->window, 0, &y );
- return y;
- }
- break;
-
- case GLUT_WINDOW_WIDTH:
- if (g_current) {
- int w;
- g_current->surface->GetSize( g_current->surface, &w, 0 );
- return w;
- }
- break;
- case GLUT_WINDOW_HEIGHT:
- if (g_current) {
- int h;
- g_current->surface->GetSize( g_current->surface, 0, &h );
- return h;
- }
- break;
-
- case GLUT_WINDOW_BUFFER_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.buffer_size;
- }
- break;
- case GLUT_WINDOW_STENCIL_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.stencil_size;
- }
- break;
- case GLUT_WINDOW_DEPTH_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.depth_size;
- }
- break;
- case GLUT_WINDOW_RED_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.red_size;
- }
- break;
- case GLUT_WINDOW_GREEN_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.green_size;
- }
- break;
- case GLUT_WINDOW_BLUE_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.blue_size;
- }
- break;
- case GLUT_WINDOW_ALPHA_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.alpha_size;
- }
- break;
- case GLUT_WINDOW_ACCUM_RED_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.accum_red_size;
- }
- break;
- case GLUT_WINDOW_ACCUM_GREEN_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.accum_green_size;
- }
- break;
- case GLUT_WINDOW_ACCUM_BLUE_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.accum_blue_size;
- }
- break;
- case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.accum_alpha_size;
- }
- break;
- case GLUT_WINDOW_DOUBLEBUFFER:
- if (g_current) {
- DFBGLAttributes a;
- g_current->gl->GetAttributes( g_current->gl, &a );
- return a.double_buffer;
- }
- break;
-
- case GLUT_WINDOW_RGBA:
- return 1;
-
- case GLUT_WINDOW_CURSOR:
- if (g_current)
- return g_current->cursor;
- break;
-
- case GLUT_SCREEN_WIDTH:
- if (primary) {
- DFBDisplayLayerConfig c;
- primary->GetConfiguration( primary, &c );
- return c.width;
- }
- break;
- case GLUT_SCREEN_HEIGHT:
- if (primary) {
- DFBDisplayLayerConfig c;
- primary->GetConfiguration( primary, &c );
- return c.height;
- }
- break;
-
- case GLUT_INIT_DISPLAY_MODE:
- return g_display_mode;
- case GLUT_INIT_WINDOW_X:
- return g_xpos;
- case GLUT_INIT_WINDOW_Y:
- return g_ypos;
- case GLUT_INIT_WINDOW_WIDTH:
- return g_width;
- case GLUT_INIT_WINDOW_HEIGHT:
- return g_height;
-
- case GLUT_ELAPSED_TIME:
- {
- static long long start = -1;
- struct timeval t;
-
- gettimeofday( &t, NULL );
- if (start == -1) {
- start = t.tv_sec * 1000ll + t.tv_usec / 1000ll;
- return 0;
- }
- return (t.tv_sec * 1000ll + t.tv_usec / 1000ll - start);
- }
- break;
-
- default:
- break;
- }
-
- return 0;
-}
-
-
-int GLUTAPIENTRY
-glutLayerGet( GLenum type )
-{
- return 0;
-}
-
-void GLUTAPIENTRY
-glutReportErrors( void )
-{
- GLenum error;
-
- while ((error = glGetError()) != GL_NO_ERROR)
- __glutWarning( "**OpenGL Error** %s", gluErrorString( error ) );
-}
-
-
diff --git a/src/glut/directfb/teapot.c b/src/glut/directfb/teapot.c
deleted file mode 100644
index e7f1ee812fa..00000000000
--- a/src/glut/directfb/teapot.c
+++ /dev/null
@@ -1,212 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/**
-(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.
-*/
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include "GL/glut.h"
-
-/* Rim, body, lid, and bottom data must be reflected in x and
- y; handle and spout data across the y axis only. */
-
-static int patchdata[][16] =
-{
- /* rim */
- {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15},
- /* body */
- {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27},
- {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40},
- /* lid */
- {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101,
- 101, 0, 1, 2, 3,},
- {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117},
- /* bottom */
- {118, 118, 118, 118, 124, 122, 119, 121, 123, 126,
- 125, 120, 40, 39, 38, 37},
- /* handle */
- {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56},
- {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 28, 65, 66, 67},
- /* spout */
- {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83},
- {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95}
-};
-/* *INDENT-OFF* */
-
-static float cpdata[][3] =
-{
- {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0,
- -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125},
- {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375,
- 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375,
- 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84,
- 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875},
- {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75,
- 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35},
- {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2,
- 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12,
- 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225},
- {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225},
- {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0,
- -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5,
- -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3,
- 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0,
- 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0,
- 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8},
- {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3,
- -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3,
- 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2,
- -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0,
- 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0,
- 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66,
- 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1},
- {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7,
- -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0,
- 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375},
- {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475},
- {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4},
- {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0,
- 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8,
- 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4,
- -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0,
- 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4,
- 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3,
- 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4},
- {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425,
- -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425,
- 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075},
- {0.84, -1.5, 0.075}
-};
-
-static float tex[2][2][2] =
-{
- { {0, 0},
- {1, 0}},
- { {0, 1},
- {1, 1}}
-};
-
-/* *INDENT-ON* */
-
-static void
-teapot(GLint grid, GLdouble scale, GLenum type)
-{
- float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
- long i, j, k, l;
-
- glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT);
- glEnable(GL_AUTO_NORMAL);
- glEnable(GL_NORMALIZE);
- glEnable(GL_MAP2_VERTEX_3);
- glEnable(GL_MAP2_TEXTURE_COORD_2);
- glPushMatrix();
- glRotatef(270.0, 1.0, 0.0, 0.0);
- glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale);
- glTranslatef(0.0, 0.0, -1.5);
- for (i = 0; i < 10; i++) {
- for (j = 0; j < 4; j++) {
- for (k = 0; k < 4; k++) {
- for (l = 0; l < 3; l++) {
- p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
- q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
- if (l == 1)
- q[j][k][l] *= -1.0;
- if (i < 6) {
- r[j][k][l] =
- cpdata[patchdata[i][j * 4 + (3 - k)]][l];
- if (l == 0)
- r[j][k][l] *= -1.0;
- s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
- if (l == 0)
- s[j][k][l] *= -1.0;
- if (l == 1)
- s[j][k][l] *= -1.0;
- }
- }
- }
- }
- glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2,
- &tex[0][0][0]);
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &p[0][0][0]);
- glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0);
- glEvalMesh2(type, 0, grid, 0, grid);
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &q[0][0][0]);
- glEvalMesh2(type, 0, grid, 0, grid);
- if (i < 6) {
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &r[0][0][0]);
- glEvalMesh2(type, 0, grid, 0, grid);
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &s[0][0][0]);
- glEvalMesh2(type, 0, grid, 0, grid);
- }
- }
- glPopMatrix();
- glPopAttrib();
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutSolidTeapot(GLdouble scale)
-{
- teapot(7, scale, GL_FILL);
-}
-
-void GLUTAPIENTRY
-glutWireTeapot(GLdouble scale)
-{
- teapot(10, scale, GL_LINE);
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/directfb/window.c b/src/glut/directfb/window.c
deleted file mode 100644
index c8174d795e7..00000000000
--- a/src/glut/directfb/window.c
+++ /dev/null
@@ -1,581 +0,0 @@
-/*
- * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
- *
- * 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
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "internal.h"
-
-
-/*****************************************************************************/
-
-static __GlutWindow *g_stack = NULL;
-
-/*****************************************************************************/
-
-
-__GlutWindow*
-__glutCreateWindow( GLboolean fullscreen )
-{
- __GlutWindow *new;
- DFBResult ret;
- static int curid = 1;
-
- new = calloc( 1, sizeof(__GlutWindow) );
- if (!new)
- __glutFatalError( "out of memory" );
-
- new->id = curid++;
-
- if (fullscreen) {
- DFBDisplayLayerConfig config;
- DFBDisplayLayerConfigFlags fail = 0;
-
- config.flags = DLCONF_WIDTH | DLCONF_HEIGHT |
- DLCONF_BUFFERMODE;
- config.width = g_width;
- config.height = g_height;
-
- if (g_display_mode & GLUT_DOUBLE)
- config.buffermode = DLBM_BACKVIDEO;
- else
- config.buffermode = DLBM_FRONTONLY;
-
- if (g_bpp) {
- config.flags |= DLCONF_PIXELFORMAT;
-
- switch (g_bpp) {
- case 8:
- config.pixelformat = DSPF_RGB332;
- break;
- case 15:
- config.pixelformat = DSPF_ARGB1555;
- break;
- case 16:
- config.pixelformat = DSPF_RGB16;
- break;
- case 24:
- case 32:
- config.pixelformat = DSPF_RGB32;
- break;
- default:
- config.flags &= ~DLCONF_PIXELFORMAT;
- break;
- }
- }
-
- primary->TestConfiguration( primary, &config, &fail );
- config.flags &= ~fail;
- primary->SetConfiguration( primary, &config );
-
- ret = primary->GetSurface( primary, &new->surface );
- if (ret) {
- DirectFBError( "IDirectFBDisplayLayer::GetSurface()", ret );
- free( new );
- return NULL;
- }
-
- ret = new->surface->GetGL( new->surface, &new->gl );
- if (ret) {
- DirectFBError( "IDirectFBSurface::GetGL()", ret );
- new->surface->Release( new->surface );
- free( new );
- return NULL;
- }
-
- events->Reset( events );
- if (keyboard)
- keyboard->AttachEventBuffer( keyboard, events );
- if (mouse)
- mouse->AttachEventBuffer( mouse, events );
- if (joystick)
- joystick->AttachEventBuffer( joystick, events );
-
- new->visible = GL_TRUE;
- }
- else {
- DFBWindowDescription dsc;
-
- dsc.flags = DWDESC_CAPS | DWDESC_POSX | DWDESC_POSY |
- DWDESC_WIDTH | DWDESC_HEIGHT;
- dsc.caps = DWCAPS_NONE;
- dsc.posx = g_xpos;
- dsc.posy = g_ypos;
- dsc.width = g_width;
- dsc.height = g_height;
-
- if (g_display_mode & GLUT_DOUBLE)
- dsc.caps |= DWCAPS_DOUBLEBUFFER;
- if (g_display_mode & GLUT_ALPHA)
- dsc.caps |= DWCAPS_ALPHACHANNEL;
-
- ret = primary->CreateWindow( primary, &dsc, &new->window );
- if (ret) {
- DirectFBError( "IDirectFBDisplayLayer::CreateWindow()", ret );
- free( new );
- return NULL;
- }
-
- new->window->GetID( new->window, &new->wid );
-
- ret = new->window->GetSurface( new->window, &new->surface );
- if (ret) {
- DirectFBError( "IDirectFBWindow::GetSurface()", ret );
- new->window->Release( new->window );
- free( new );
- return NULL;
- }
-
- ret = new->surface->GetGL( new->surface, &new->gl );
- if (ret) {
- DirectFBError( "IDirectFBSurface::GetGl()", ret );
- new->surface->Release( new->surface );
- new->window->Release( new->window );
- free( new );
- return NULL;
- }
-
- new->window->AttachEventBuffer( new->window, events );
- /* enable only handled events */
- new->window->DisableEvents( new->window, DWET_ALL );
- new->window->EnableEvents( new->window, DWET_KEYDOWN | DWET_KEYUP |
- DWET_BUTTONDOWN | DWET_BUTTONUP |
- DWET_ENTER | DWET_LEAVE |
- DWET_MOTION | DWET_SIZE );
-
-
- new->req.flags |= WINDOW_REQUEST_SHOW;
- }
-
- new->reshape = GL_TRUE;
- new->visibility = GL_TRUE;
- new->redisplay = GL_TRUE;
-
- if (g_stack) {
- new->prev = g_stack->prev;
- g_stack->prev->next = new;
- g_stack->prev = new;
- }
- else {
- new->prev = new;
- g_stack = new;
- }
-
- return new;
-}
-
-
-__GlutWindow*
-__glutFindWindow( DFBWindowID id )
-{
- __GlutWindow *cur;
-
- for (cur = g_stack; cur; cur = cur->next) {
- if (cur->wid == id)
- return cur;
- }
-
- __glutFatalError( "Window %d not found", id );
-
- return NULL;
-}
-
-
-void
-__glutSetWindow( __GlutWindow *window )
-{
- if (g_current) {
- if (g_current == window)
- return;
- g_current->gl->Unlock( g_current->gl );
- }
-
- if (window)
- window->gl->Lock( window->gl );
- g_current = window;
-}
-
-
-void
-__glutHandleWindows( void )
-{
- __GlutWindow *cur = g_stack;
-
- while (cur) {
- __GlutWindow *next = cur->next;
-
- if (cur->window && cur->req.flags) {
- if (cur == g_current)
- cur->gl->Unlock( cur->gl );
-
- if (cur->req.flags & WINDOW_REQUEST_DESTROY) {
- __glutDestroyWindow( cur );
- cur = next;
- continue;
- }
-
- if (cur->req.flags & WINDOW_REQUEST_POSITION) {
- cur->window->MoveTo( cur->window,
- cur->req.x, cur->req.y );
- }
-
- if (cur->req.flags & WINDOW_REQUEST_RESIZE) {
- cur->window->Resize( cur->window,
- cur->req.w, cur->req.h );
- cur->reshape = GL_TRUE;
- cur->redisplay = GL_TRUE;
- }
-
- if (cur->req.flags & WINDOW_REQUEST_RESTACK) {
- while (cur->req.z > 0) {
- if (cur->req.z >= +1000) {
- cur->window->RaiseToTop( cur->window );
- cur->req.z = 0;
- break;
- }
-
- cur->window->Raise( cur->window );
- cur->req.z--;
- }
-
- while (cur->req.z < 0) {
- if (cur->req.z <= -1000) {
- cur->window->LowerToBottom( cur->window );
- cur->req.z = 0;
- break;
- }
-
- cur->window->Lower( cur->window );
- cur->req.z++;
- }
- }
-
- if (cur->req.flags & WINDOW_REQUEST_SHOW) {
- cur->window->SetOpacity( cur->window, 0xff );
- cur->visible = GL_TRUE;
- cur->visibility = GL_TRUE;
- }
- else if (cur->req.flags & WINDOW_REQUEST_HIDE) {
- cur->window->SetOpacity( cur->window, 0x00 );
- cur->visible = GL_FALSE;
- cur->visibility = GL_TRUE;
- }
-
- cur->req.flags = 0;
-
- if (cur == g_current)
- cur->gl->Lock( cur->gl );
- }
-
- if (cur->reshape && reshape_func) {
- int w, h;
- g_idle = GL_FALSE;
- cur->surface->GetSize( cur->surface, &w, &h );
- __glutSetWindow( cur );
- reshape_func( w, h );
- }
-
- if (cur->visibility && visibility_func) {
- g_idle = GL_FALSE;
- __glutSetWindow( cur );
- visibility_func( cur->visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE );
- }
-
- if (cur->redisplay && display_func) {
- g_idle = GL_FALSE;
- __glutSetWindow( cur );
- display_func();
- }
-
- cur->reshape = GL_FALSE;
- cur->visibility = GL_FALSE;
- cur->redisplay = GL_FALSE;
-
- cur = next;
- }
-}
-
-
-void
-__glutDestroyWindow( __GlutWindow *window )
-{
- __GlutWindow *next = window->next;
- __GlutWindow *prev = window->prev;
-
- __glutAssert( window != NULL );
-
- if (window == g_current)
- g_current = NULL;
- if (window == g_game)
- g_game = NULL;
-
- window->gl->Unlock( window->gl );
- window->gl->Release( window->gl );
- window->surface->Release( window->surface );
-
- if (window->window) {
-#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,26)
- window->window->DetachEventBuffer( window->window, events );
-#else
- window->window->Destroy( window->window );
-#endif
- window->window->Release( window->window );
- }
- else {
-#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,26)
- if (joystick)
- joystick->DetachEventBuffer( joystick, events );
- if (mouse)
- mouse->DetachEventBuffer( mouse, events );
- if (keyboard)
- keyboard->DetachEventBuffer( keyboard, events );
-#endif
- events->Reset( events );
- }
-
- free( window );
-
- if (next)
- next->prev = prev;
- else
- g_stack->prev = prev;
-
- if (window == g_stack)
- g_stack = next;
- else
- prev->next = next;
-}
-
-
-void
-__glutDestroyWindows( void )
-{
- __GlutWindow *cur = g_stack;
-
- while (cur) {
- __GlutWindow *next = cur->next;
- __glutDestroyWindow( cur );
- cur = next;
- }
-}
-
-
-int GLUTAPIENTRY
-glutCreateWindow( const char *title )
-{
- __GlutWindow *window;
-
- if (getenv( "__GLUT_GAME_MODE" ))
- return glutEnterGameMode();
-
- glutInit( NULL, NULL );
-
- window = __glutCreateWindow( GL_FALSE );
- if (!window)
- return 0;
-
- __glutSetWindow( window );
- glutSetCursor( GLUT_CURSOR_INHERIT );
-
- return window->id;
-}
-
-
-int GLUTAPIENTRY
-glutCreateSubWindow( int win, int x, int y, int width, int height )
-{
- return GL_FALSE;
-}
-
-
-void GLUTAPIENTRY
-glutDestroyWindow( int win )
-{
- __GlutWindow *cur;
-
- for (cur = g_stack; cur; cur = cur->next) {
- if (cur->id == win) {
- if (cur->window)
- cur->window->Destroy( cur->window );
-
- cur->req.flags |= WINDOW_REQUEST_DESTROY;
- break;
- }
- }
-}
-
-
-void GLUTAPIENTRY
-glutPostRedisplay( void )
-{
- if (g_current)
- g_current->redisplay = GL_TRUE;
-}
-
-
-void GLUTAPIENTRY
-glutPostWindowRedisplay( int win )
-{
- __GlutWindow *cur;
-
- for (cur = g_stack; cur; cur = cur->next) {
- if (cur->id == win) {
- cur->redisplay = GL_TRUE;
- break;
- }
- }
-}
-
-
-void GLUTAPIENTRY
-glutSwapBuffers( void )
-{
- if (g_current) {
- g_current->gl->Unlock( g_current->gl );
- g_current->surface->Flip( g_current->surface, NULL, 0 );
- g_current->gl->Lock( g_current->gl );
- }
-}
-
-
-int GLUTAPIENTRY
-glutGetWindow( void )
-{
- return (g_current) ? g_current->id : 0;
-}
-
-
-void GLUTAPIENTRY
-glutSetWindow( int win )
-{
- __GlutWindow *cur;
-
- if (g_current && g_current->id == win)
- return;
-
- for (cur = g_stack; cur; cur = cur->next) {
- if (cur->id == win) {
- __glutSetWindow( cur );
- break;
- }
- }
-}
-
-
-void GLUTAPIENTRY
-glutSetWindowTitle( const char *title )
-{
-}
-
-
-void GLUTAPIENTRY
-glutSetIconTitle( const char *title )
-{
-}
-
-
-void GLUTAPIENTRY
-glutFullScreen( void )
-{
- if (g_current && !g_game) {
- DFBDisplayLayerConfig config;
-
- primary->GetConfiguration( primary, &config );
-
- g_current->req.flags |= WINDOW_REQUEST_POSITION |
- WINDOW_REQUEST_RESIZE |
- WINDOW_REQUEST_RESTACK;
- g_current->req.x = 0;
- g_current->req.y = 0;
- g_current->req.w = config.width;
- g_current->req.h = config.height;
- g_current->req.z = 1000;
- }
-}
-
-
-void GLUTAPIENTRY
-glutPositionWindow( int x, int y )
-{
- if (g_current && !g_game) {
- g_current->req.flags |= WINDOW_REQUEST_POSITION;
- g_current->req.x = x;
- g_current->req.y = y;
- }
-}
-
-
-void GLUTAPIENTRY
-glutReshapeWindow( int width, int height )
-{
- if (g_current && !g_game) {
- g_current->req.flags |= WINDOW_REQUEST_RESIZE;
- g_current->req.w = width;
- g_current->req.h = height;
- }
-}
-
-
-void GLUTAPIENTRY
-glutPopWindow( void )
-{
- if (g_current && !g_game) {
- g_current->req.flags |= WINDOW_REQUEST_RESTACK;
- g_current->req.z--;
- }
-}
-
-
-void GLUTAPIENTRY
-glutPushWindow( void )
-{
- if (g_current && !g_game) {
- g_current->req.flags |= WINDOW_REQUEST_RESTACK;
- g_current->req.z++;
- }
-}
-
-
-void GLUTAPIENTRY
-glutIconifyWindow( void )
-{
-}
-
-
-void GLUTAPIENTRY
-glutShowWindow( void )
-{
- if (g_current && !g_game) {
- g_current->req.flags |= WINDOW_REQUEST_SHOW;
- g_current->req.flags &= ~WINDOW_REQUEST_HIDE;
- }
-}
-
-
-void GLUTAPIENTRY
-glutHideWindow( void )
-{
- if (g_current && !g_game) {
- g_current->req.flags |= WINDOW_REQUEST_HIDE;
- g_current->req.flags &= ~WINDOW_REQUEST_SHOW;
- }
-}
-
diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile
index 11d95665adb..254ff8c098f 100644
--- a/src/glut/fbdev/Makefile
+++ b/src/glut/fbdev/Makefile
@@ -72,7 +72,7 @@ install:
$(INSTALL) -d $(INSTALL_DIR)/include/GL
$(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(INSTALL_DIR)/include/GL
- $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR)
# Run 'make -f Makefile.solo dep' to update the dependencies if you change
# what's included by any source file.
diff --git a/src/glut/fbdev/callback.c b/src/glut/fbdev/callback.c
index 37373672d36..8c039f530be 100644
--- a/src/glut/fbdev/callback.c
+++ b/src/glut/fbdev/callback.c
@@ -24,6 +24,8 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdlib.h>
+
#include <GL/glut.h>
#include "internal.h"
@@ -72,19 +74,16 @@ void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y))
void glutMouseFunc(void (*func)(int button, int state, int x, int y))
{
- MouseEnabled = 1;
MouseFunc = func;
}
void glutMotionFunc(void (*func)(int x, int y))
{
- MouseEnabled = 1;
MotionFunc = func;
}
void glutPassiveMotionFunc(void (*func)(int x, int y))
{
- MouseEnabled = 1;
PassiveMotionFunc = func;
}
diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c
index 89556ef4a5c..3e72a7b0513 100644
--- a/src/glut/fbdev/colormap.c
+++ b/src/glut/fbdev/colormap.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdio.h>
#include <stdlib.h>
#include <linux/fb.h>
@@ -37,7 +38,7 @@
#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1))
#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1)
-static struct fb_cmap ColorMap;
+static struct fb_cmap ColorMap, OriginalColorMap;
unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256];
@@ -91,12 +92,18 @@ static void FillReverseColorMap(void)
void RestoreColorMap(void)
{
+ if(FixedInfo.visual == FB_VISUAL_TRUECOLOR)
+ return;
+
if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0)
sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n");
}
void LoadColorMap(void)
{
+ if(FixedInfo.visual == FB_VISUAL_TRUECOLOR)
+ return;
+
ColorMap.start = 0;
ColorMap.red = RedColorMap;
ColorMap.green = GreenColorMap;
diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c
index 9254e125593..4bb2b7fba01 100644
--- a/src/glut/fbdev/cursor.c
+++ b/src/glut/fbdev/cursor.c
@@ -28,8 +28,10 @@
to render the cursor, this is faster, it would be good to use a hardware
cursor if it exists instead */
+#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
+#include <string.h>
#include <linux/fb.h>
@@ -64,6 +66,9 @@ void EraseCursor(void)
unsigned char *src = MouseBuffer;
+ if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS)
+ return;
+
for(i = 0; i<CURSOR_HEIGHT; i++) {
memcpy(BackBuffer + off, src, stride);
src += stride;
@@ -108,7 +113,7 @@ void DrawCursor(void)
unsigned char *c;
const unsigned char *d;
- if(CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS)
+ if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS)
return;
px = MouseX - CursorsXOffset[CurrentCursor];
@@ -210,10 +215,12 @@ void SwapCursor(void)
int miny = MIN(py, LastMouseY);
int sizey = abs(py - LastMouseY);
- DrawCursor();
- /* now update the portion of the screen that has changed */
+ if(MouseVisible)
+ DrawCursor();
- if(DisplayMode & GLUT_DOUBLE && (sizex || sizey)) {
+ /* now update the portion of the screen that has changed, this is also
+ used to hide the mouse if MouseVisible is 0 */
+ if(DisplayMode & GLUT_DOUBLE && ((sizex || sizey) || !MouseVisible)) {
int off, stride, i;
if(minx < 0)
minx = 0;
@@ -228,7 +235,7 @@ void SwapCursor(void)
+ minx * VarInfo.bits_per_pixel / 8;
stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8;
- for(i = 0; i< sizey + CURSOR_HEIGHT; i++) {
+ for(i = 0; i < sizey + CURSOR_HEIGHT; i++) {
memcpy(FrameBuffer+off, BackBuffer+off, stride);
off += FixedInfo.line_length;
}
@@ -257,8 +264,9 @@ void glutSetCursor(int cursor)
{
if(cursor == GLUT_CURSOR_FULL_CROSSHAIR)
cursor = GLUT_CURSOR_CROSSHAIR;
- CurrentCursor = cursor;
- MouseEnabled = 1;
+
EraseCursor();
+ MouseVisible = 1;
+ CurrentCursor = cursor;
SwapCursor();
}
diff --git a/src/glut/fbdev/ext.c b/src/glut/fbdev/ext.c
index 4a3c185a16d..65953e705b9 100644
--- a/src/glut/fbdev/ext.c
+++ b/src/glut/fbdev/ext.c
@@ -24,6 +24,8 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdio.h>
+
#include <GL/gl.h>
#include <GL/glut.h>
diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c
index 1c6cea0434e..3b63cd70ea1 100644
--- a/src/glut/fbdev/fbdev.c
+++ b/src/glut/fbdev/fbdev.c
@@ -74,6 +74,7 @@ int Redisplay;
int Visible;
int VisibleSwitch;
int Active;
+static int Resized;
/* we have to poll to see if we are visible
on a framebuffer that is not active */
int VisiblePoll;
@@ -103,6 +104,9 @@ void TestVisible(void) {
static void Cleanup(void)
{
+ /* do not handle this signal when cleaning up */
+ signal(SIGWINCH, SIG_IGN);
+
if(GameMode)
glutLeaveGameMode();
@@ -124,8 +128,10 @@ static void Cleanup(void)
fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
strerror(errno));
- munmap(FrameBuffer, FixedInfo.smem_len);
+ if(FrameBuffer)
+ munmap(FrameBuffer, FixedInfo.smem_len);
close(FrameBufferFD);
+
}
/* free allocated back buffer */
@@ -236,6 +242,7 @@ void glutInit (int *argcp, char **argv)
signal(SIGSEGV, CrashHandler);
signal(SIGINT, CrashHandler);
signal(SIGTERM, CrashHandler);
+ signal(SIGABRT, CrashHandler);
if(nomouse == 0)
InitializeMouse();
@@ -271,7 +278,7 @@ void glutInit (int *argcp, char **argv)
exit(0);
}
- /* Get the fixed screen info */
+ /* get the fixed screen info */
if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) {
sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
strerror(errno));
@@ -410,16 +417,18 @@ void glutInitWindowSize (int width, int height)
static void ProcessTimers(void)
{
- if(GlutTimers && GlutTimers->time < glutGet(GLUT_ELAPSED_TIME)) {
+ while(GlutTimers && GlutTimers->time <= glutGet(GLUT_ELAPSED_TIME)) {
struct GlutTimer *timer = GlutTimers;
- timer->func(timer->value);
GlutTimers = timer->next;
+ timer->func(timer->value);
free(timer);
}
}
void glutMainLoop(void)
{
+ int idleiters;
+
if(ReshapeFunc)
ReshapeFunc(VarInfo.xres, VarInfo.yres);
@@ -436,8 +445,6 @@ void glutMainLoop(void)
else
if(VisiblePoll)
TestVisible();
- else
- usleep(1);
if(IdleFunc)
IdleFunc();
@@ -448,17 +455,48 @@ void glutMainLoop(void)
VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE);
}
+ if(Resized) {
+ SetVideoMode();
+ CreateBuffer();
+
+ if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) {
+ sprintf(exiterror, "Failure to Make Current\n");
+ exit(0);
+ }
+
+ InitializeMenus();
+
+ if(ReshapeFunc)
+ ReshapeFunc(VarInfo.xres, VarInfo.yres);
+
+ Redisplay = 1;
+ Resized = 0;
+ }
+
if(Visible && Redisplay) {
Redisplay = 0;
- if(MouseEnabled)
- EraseCursor();
+ EraseCursor();
DisplayFunc();
if(!(DisplayMode & GLUT_DOUBLE)) {
if(ActiveMenu)
DrawMenus();
- if(MouseEnabled)
- DrawCursor();
+ DrawCursor();
}
+ idleiters = 0;
+ } else {
+ /* we sleep if not receiving redisplays, and
+ the main loop is running faster than 2khz */
+
+ static int lasttime;
+ int time = glutGet(GLUT_ELAPSED_TIME);
+ if(time > lasttime) {
+ if(idleiters >= 2)
+ usleep(100);
+
+ idleiters = 0;
+ lasttime = time;
+ }
+ idleiters++;
}
}
}
@@ -532,17 +570,16 @@ int ParseFBModes(int minw, int maxw, int minh, int maxh, int minf, int maxf)
return 0;
}
-/* ---------- Window Management ----------*/
void SetVideoMode(void)
{
/* set new variable screen info */
if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) {
- sprintf(exiterror, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
- strerror(errno));
+ sprintf(exiterror, "FBIOPUT_VSCREENINFO failed: %s\n", strerror(errno));
+ strcat(exiterror, "Perhaps the device does not support the selected mode\n");
exit(0);
}
- /* reload the screen info to update offsets */
+ /* reload the screen info to update rgb bits */
if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) {
sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
strerror(errno));
@@ -570,7 +607,7 @@ void SetVideoMode(void)
LoadColorMap();
}
-void CreateBuffer()
+void CreateBuffer(void)
{
int size = VarInfo.xres_virtual * VarInfo.yres_virtual
* VarInfo.bits_per_pixel / 8;
@@ -669,6 +706,30 @@ void CreateVisual(void)
}
}
+static void SignalWinch(int arg)
+{
+ /* we can't change bitdepth without destroying the visual */
+ int bits_per_pixel = VarInfo.bits_per_pixel;
+ struct fb_bitfield red = VarInfo.red, green = VarInfo.green,
+ blue = VarInfo.blue, transp = VarInfo.transp;
+
+ /* get the variable screen info */
+ if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) {
+ sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
+ strerror(errno));
+ exit(0);
+ }
+
+ /* restore bitdepth and color masks only */
+ VarInfo.bits_per_pixel = bits_per_pixel;
+ VarInfo.red = red;
+ VarInfo.green = green;
+ VarInfo.blue = blue;
+ VarInfo.transp = transp;
+
+ Resized = 1;
+}
+
int glutCreateWindow (const char *title)
{
if(Initialized == 0) {
@@ -713,6 +774,8 @@ int glutCreateWindow (const char *title)
glutSetWindowTitle(title);
+ signal(SIGWINCH, SignalWinch);
+
Visible = 1;
VisibleSwitch = 1;
Redisplay = 1;
@@ -739,6 +802,7 @@ void glutDestroyWindow(int win)
glFBDevDestroyContext(Context);
glFBDevDestroyBuffer(Buffer);
glFBDevDestroyVisual(Visual);
+
Visual = NULL;
}
@@ -756,12 +820,14 @@ void glutSwapBuffers(void)
{
glFlush();
+ if(!(DisplayMode & GLUT_DOUBLE))
+ return;
+
if(ActiveMenu)
DrawMenus();
- if(MouseEnabled)
- DrawCursor();
+ DrawCursor();
- if(DisplayMode & GLUT_DOUBLE && Visible) {
+ if(Visible) {
Swapping = 1;
glFBDevSwapBuffers(Buffer);
Swapping = 0;
@@ -787,19 +853,11 @@ void glutReshapeWindow(int width, int height)
if(!ParseFBModes(width, width, height, height, 0, MAX_VSYNC))
return;
- SetVideoMode();
- CreateBuffer();
-
- if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) {
- sprintf(exiterror, "Failure to Make Current\n");
- exit(0);
- }
-
- InitializeMenus();
+ signal(SIGWINCH, SIG_IGN);
- if(ReshapeFunc)
- ReshapeFunc(VarInfo.xres, VarInfo.yres);
- Redisplay = 1;
+ SetVideoMode();
+ signal(SIGWINCH, SignalWinch);
+ Resized = 1;
}
void glutFullScreen(void)
@@ -836,6 +894,9 @@ static void UnIconifyWindow(int sig)
strerror(errno));
exit(0);
}
+
+ RestoreColorMap();
+
Redisplay = 1;
VisibleSwitch = 1;
Visible = 1;
@@ -848,6 +909,7 @@ void glutIconifyWindow(void)
if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo))
fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
strerror(errno));
+
raise(SIGSTOP);
}
diff --git a/src/glut/fbdev/gamemode.c b/src/glut/fbdev/gamemode.c
index f6d6e4044ef..30be36af7af 100644
--- a/src/glut/fbdev/gamemode.c
+++ b/src/glut/fbdev/gamemode.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -263,7 +264,6 @@ void glutLeaveGameMode(void)
KeyboardFunc = KeyFuncs[0];
KeyboardUpFunc = KeyFuncs[1];
-
DisplayFunc = NormFuncs[0];
ReshapeFunc = NormFuncs[1];
MouseFunc = NormFuncs[2];
diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c
index b1362245f2f..044aa50fd86 100644
--- a/src/glut/fbdev/input.c
+++ b/src/glut/fbdev/input.c
@@ -53,7 +53,7 @@
int GpmMouse;
#endif
-int CurrentVT;
+int CurrentVT = 0;
int ConsoleFD = -1;
int KeyboardModifiers;
@@ -65,8 +65,8 @@ double MouseSpeed = 0;
int KeyRepeatMode = GLUT_KEY_REPEAT_DEFAULT;
-/* only display the mouse if there is a registered callback for it */
-int MouseEnabled = 0;
+int MouseVisible = 0;
+int LastMouseTime = 0;
static int OldKDMode = -1;
static int OldMode = KD_TEXT;
@@ -79,6 +79,8 @@ static int MouseFD;
static int kbdpipe[2];
+static int LastStdinKeyTime, LastStdinSpecialKey = -1, LastStdinCode = -1;
+
#define MODIFIER(mod) \
KeyboardModifiers = release ? KeyboardModifiers & ~mod \
: KeyboardModifiers | mod;
@@ -90,66 +92,66 @@ static int kbdpipe[2];
vts and kill it without Alt-SysRq hack */
static void KeyboardHandler(int sig)
{
- int release, labelval;
unsigned char code;
- struct kbentry entry;
- static int lalt; /* only left alt does vt switch */
-
- if(read(ConsoleFD, &code, 1) != 1)
- return;
-
- release = code & 0x80;
-
- entry.kb_index = code & 0x7F;
- entry.kb_table = 0;
-
- if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) {
- sprintf(exiterror, "ioctl(KDGKBENT) failed.\n");
- exit(0);
- }
-
- labelval = entry.kb_value;
-
- switch(labelval) {
- case K_SHIFT:
- case K_SHIFTL:
- MODIFIER(GLUT_ACTIVE_SHIFT);
- return;
- case K_CTRL:
- MODIFIER(GLUT_ACTIVE_CTRL);
- return;
- case K_ALT:
- lalt = !release;
- case K_ALTGR:
- MODIFIER(GLUT_ACTIVE_ALT);
- return;
- }
- if(lalt && !release) {
- /* VT switch, we must do it */
- int vt = -1;
- struct vt_stat st;
- if(labelval >= K_F1 && labelval <= K_F12)
- vt = labelval - K_F1 + 1;
-
- if(labelval == K_LEFT)
- if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0)
- vt = st.v_active - 1;
+ while(read(ConsoleFD, &code, 1) == 1) {
+ int release, labelval;
+ struct kbentry entry;
+ static int lalt; /* only left alt does vt switch */
+
+ release = code & 0x80;
+
+ entry.kb_index = code & 0x7F;
+ entry.kb_table = 0;
+
+ if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) {
+ sprintf(exiterror, "ioctl(KDGKBENT) failed.\n");
+ exit(0);
+ }
- if(labelval == K_RIGHT)
- if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0)
- vt = st.v_active + 1;
+ labelval = entry.kb_value;
+
+ switch(labelval) {
+ case K_SHIFT:
+ case K_SHIFTL:
+ MODIFIER(GLUT_ACTIVE_SHIFT);
+ continue;
+ case K_CTRL:
+ MODIFIER(GLUT_ACTIVE_CTRL);
+ continue;
+ case K_ALT:
+ lalt = !release;
+ case K_ALTGR:
+ MODIFIER(GLUT_ACTIVE_ALT);
+ continue;
+ }
- if(vt != -1) {
- if(Swapping)
- VTSwitch = vt;
- else
- if(ioctl(ConsoleFD, VT_ACTIVATE, vt) < 0)
- sprintf(exiterror, "Error switching console\n");
- return;
+ if(lalt && !release) {
+ /* VT switch, we must do it */
+ int vt = -1;
+ struct vt_stat st;
+ if(labelval >= K_F1 && labelval <= K_F12)
+ vt = labelval - K_F1 + 1;
+
+ if(labelval == K_LEFT)
+ if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0)
+ vt = st.v_active - 1;
+
+ if(labelval == K_RIGHT)
+ if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0)
+ vt = st.v_active + 1;
+
+ if(vt != -1) {
+ if(Swapping)
+ VTSwitch = vt;
+ else
+ if(ioctl(ConsoleFD, VT_ACTIVATE, vt) < 0)
+ sprintf(exiterror, "Error switching console\n");
+ continue;
+ }
}
+ write(kbdpipe[1], &code, 1);
}
- write(kbdpipe[1], &code, 1);
}
static void LedModifier(int led, int release)
@@ -162,10 +164,47 @@ static void LedModifier(int led, int release)
KeyboardLedState ^= led;
releaseflag &= ~led;
}
+
ioctl(ConsoleFD, KDSKBLED, KeyboardLedState);
ioctl(ConsoleFD, KDSETLED, 0x80);
}
+static void HandleKeyPress(unsigned char key, int up)
+{
+ if(up) {
+ if(KeyboardUpFunc)
+ KeyboardUpFunc(key, MouseX, MouseY);
+ } else
+ if(KeyboardFunc)
+ KeyboardFunc(key, MouseX, MouseY);
+
+ /* there was no keyboard handler to provide a way to exit the program */
+ if(key == 27)
+ exit(0);
+}
+
+static void HandleSpecialPress(int key, int up)
+{
+ if(up) {
+ if(SpecialUpFunc)
+ SpecialUpFunc(key, MouseX, MouseY);
+ } else
+ if(SpecialFunc)
+ SpecialFunc(key, MouseX, MouseY);
+}
+
+static void ReleaseStdinKey(void)
+{
+ if(LastStdinSpecialKey != -1) {
+ HandleSpecialPress(LastStdinSpecialKey, 1);
+ LastStdinSpecialKey = -1;
+ }
+ if(LastStdinCode != -1) {
+ HandleKeyPress(LastStdinCode, 1);
+ LastStdinCode = -1;
+ }
+}
+
#define READKEY read(kbdpipe[0], &code, 1)
static int ReadKey(void)
{
@@ -174,8 +213,14 @@ static int ReadKey(void)
int specialkey = 0;
struct kbentry entry;
- if(READKEY != 1)
+ if(READKEY != 1) {
+ /* if we are reading from stdin, we detect key releases when the key
+ does not repeat after a given timeout */
+ if(ConsoleFD == 0 && LastStdinKeyTime + 100 < glutGet(GLUT_ELAPSED_TIME))
+ ReleaseStdinKey();
return 0;
+ }
+
if(code == 0)
return 0;
@@ -184,65 +229,82 @@ static int ReadKey(void)
KeyboardModifiers = 0;
altset:
if(code == 27 && READKEY == 1) {
- switch(code) {
- case 79: /* function key */
- READKEY;
- if(code == 50) {
- READKEY;
- shiftfunc:
- KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
- specialkey = GLUT_KEY_F1 + code - 53;
- READKEY;
- } else {
- READKEY;
- specialkey = GLUT_KEY_F1 + code - 80;
- }
- break;
- case 91:
- READKEY;
- switch(code) {
- case 68:
- specialkey = GLUT_KEY_LEFT; break;
- case 65:
- specialkey = GLUT_KEY_UP; break;
- case 67:
- specialkey = GLUT_KEY_RIGHT; break;
- case 66:
- specialkey = GLUT_KEY_DOWN; break;
- case 53:
- specialkey = GLUT_KEY_PAGE_UP; READKEY; break;
- case 54:
- specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break;
- case 49:
- specialkey = GLUT_KEY_HOME; READKEY; break;
- case 52:
- specialkey = GLUT_KEY_END; READKEY; break;
- case 50:
- READKEY;
- if(code != 126)
- goto shiftfunc;
- specialkey = GLUT_KEY_INSERT;
- break;
- case 51:
- code = '\b';
- goto stdkey;
- case 91:
- READKEY;
- specialkey = GLUT_KEY_F1 + code - 65;
- break;
- default:
- return 0;
- }
- break;
- default:
+ if(code != 91) {
KeyboardModifiers |= GLUT_ACTIVE_ALT;
goto altset;
}
+ READKEY;
+ switch(code) {
+ case 68:
+ specialkey = GLUT_KEY_LEFT; break;
+ case 65:
+ specialkey = GLUT_KEY_UP; break;
+ case 67:
+ specialkey = GLUT_KEY_RIGHT; break;
+ case 66:
+ specialkey = GLUT_KEY_DOWN; break;
+ case 52:
+ specialkey = GLUT_KEY_END; READKEY; break;
+ case 53:
+ specialkey = GLUT_KEY_PAGE_UP; READKEY; break;
+ case 54:
+ specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break;
+ case 49:
+ READKEY;
+ if(code == 126)
+ specialkey = GLUT_KEY_HOME;
+ else {
+ specialkey = GLUT_KEY_F1 + code - 50;
+ READKEY;
+ }
+ break;
+ case 50:
+ READKEY;
+ if(code == 126)
+ specialkey = GLUT_KEY_INSERT;
+ else {
+ if(code > '1')
+ code--;
+ if(code > '6')
+ code--;
+ if(code > '3') {
+ KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
+ code -= 12;
+ }
+ specialkey = GLUT_KEY_F1 + code - 40;
+ READKEY;
+ }
+ break;
+ case 51:
+ READKEY;
+ if(code == 126) {
+ code = '\b';
+ goto stdkey;
+ }
+ KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
+ specialkey = GLUT_KEY_F1 + code - 45;
+ READKEY;
+ break;
+ case 91:
+ READKEY;
+ specialkey = GLUT_KEY_F1 + code - 65;
+ break;
+ default:
+ return 0;
+ }
}
- stdkey:
+
if(specialkey) {
- if(SpecialFunc)
- SpecialFunc(specialkey, MouseX, MouseY);
+ LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME);
+
+ if(LastStdinSpecialKey != specialkey) {
+ ReleaseStdinKey();
+ HandleSpecialPress(specialkey, 0);
+ LastStdinSpecialKey = specialkey;
+ LastStdinKeyTime += 200; /* initial repeat */
+ } else
+ if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF)
+ HandleSpecialPress(specialkey, 0);
} else {
if(code >= 1 && code <= 26 && code != '\r') {
KeyboardModifiers |= GLUT_ACTIVE_CTRL;
@@ -253,8 +315,16 @@ static int ReadKey(void)
|| (code == 95) || (code >= 123 && code <= 126))
KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
- if(KeyboardFunc)
- KeyboardFunc(code, MouseX, MouseY);
+ stdkey:
+ LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME);
+ if(LastStdinCode != code) {
+ ReleaseStdinKey();
+ HandleKeyPress(code, 0);
+ LastStdinCode = code;
+ LastStdinKeyTime += 200; /* initial repeat */
+ } else
+ if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF)
+ HandleSpecialPress(code, 0);
}
return 1;
}
@@ -341,17 +411,12 @@ static int ReadKey(void)
break;
case K_ENTER:
case K_ENTER - 1: /* keypad enter */
- labelval = '\n'; break;
+ labelval = '\r'; break;
}
/* dispatch callback */
if(specialkey) {
- if(release) {
- if(SpecialUpFunc)
- SpecialUpFunc(specialkey, MouseX, MouseY);
- } else
- if(SpecialFunc)
- SpecialFunc(specialkey, MouseX, MouseY);
+ HandleSpecialPress(specialkey, release);
} else {
char c = labelval;
@@ -362,12 +427,7 @@ static int ReadKey(void)
if(c >= 'a' && c <= 'z')
c += 'A' - 'a';
}
- if(release) {
- if(KeyboardUpFunc)
- KeyboardUpFunc(c, MouseX, MouseY);
- } else
- if(KeyboardFunc)
- KeyboardFunc(c, MouseX, MouseY);
+ HandleKeyPress(c, release);
}
return 1;
}
@@ -430,28 +490,22 @@ static int ReadMouse(void)
dy = event.dy;
} else
#endif
- {
- char data[4];
-
- if(MouseFD == -1)
- return 0;
+ {
+ char data[4];
- if(fcntl(MouseFD, F_SETFL, O_NONBLOCK) == -1) {
- close(MouseFD);
- MouseFD = -1;
- return 0;
- }
+ if(MouseFD == -1)
+ return 0;
- if(read(MouseFD, data, 4) != 4)
- return 0;
+ if(read(MouseFD, data, 4) != 4)
+ return 0;
- l = ((data[0] & 0x20) >> 3);
- m = ((data[3] & 0x10) >> 3);
- r = ((data[0] & 0x10) >> 4);
+ l = ((data[0] & 0x20) >> 3);
+ m = ((data[3] & 0x10) >> 3);
+ r = ((data[0] & 0x10) >> 4);
- dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F));
- dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F));
- }
+ dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F));
+ dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F));
+ }
MouseX += dx * MouseSpeed;
if(MouseX < 0)
@@ -476,7 +530,7 @@ static int ReadMouse(void)
ll = l, lm = m, lr = r;
- if(dx || dy) {
+ if(dx || dy || !MouseVisible) {
if(l || m || r) {
if(MotionFunc)
MotionFunc(MouseX, MouseY);
@@ -486,12 +540,16 @@ static int ReadMouse(void)
EraseCursor();
+ MouseVisible = 1;
+
if(ActiveMenu)
Redisplay = 1;
else
SwapCursor();
}
+ LastMouseTime = glutGet(GLUT_ELAPSED_TIME);
+
return 1;
}
@@ -500,8 +558,14 @@ void ReceiveInput(void)
if(ConsoleFD != -1)
while(ReadKey());
- if(MouseEnabled)
- while(ReadMouse());
+ while(ReadMouse());
+
+ /* implement a 2 second timeout on the mouse */
+ if(MouseVisible && glutGet(GLUT_ELAPSED_TIME) - LastMouseTime > 2000) {
+ EraseCursor();
+ MouseVisible = 0;
+ SwapCursor();
+ }
}
static void VTSwitchHandler(int sig)
@@ -524,9 +588,6 @@ static void VTSwitchHandler(int sig)
if(st.v_active)
ioctl(ConsoleFD, VT_RELDISP, VT_ACKACQ);
- /* this is a hack to turn the cursor off */
- ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo);
-
RestoreColorMap();
Active = 1;
@@ -534,7 +595,6 @@ static void VTSwitchHandler(int sig)
VisibleSwitch = 1;
Redisplay = 1;
-
break;
}
}
@@ -568,11 +628,6 @@ void InitializeVT(int usestdin)
exit(0);
}
- if(fcntl(0, F_SETFL, O_NONBLOCK | O_ASYNC) < 0) {
- sprintf(exiterror, "Failed to set keyboard to non-blocking\n");
- exit(0);
- }
-
Active = 1;
if(usestdin) {
@@ -580,6 +635,12 @@ void InitializeVT(int usestdin)
return;
}
+ /* enable sigio for input */
+ if(fcntl(0, F_SETFL, O_ASYNC) < 0) {
+ sprintf(exiterror, "Failed to set O_ASYNC mode on fd 0\n");
+ exit(0);
+ }
+
/* detect the current vt if it was not specified */
if(CurrentVT == 0) {
int fd = open("/dev/tty", O_RDWR | O_NDELAY, 0);
@@ -588,18 +649,23 @@ void InitializeVT(int usestdin)
sprintf(exiterror, "Failed to open /dev/tty\n");
exit(0);
}
+
if(ioctl(fd, VT_GETSTATE, &st) == -1) {
fprintf(stderr, "Could not detect current vt, specify with -vt\n");
fprintf(stderr, "Defaulting to stdin input\n");
ConsoleFD = 0;
close(fd);
return;
- } else
- CurrentVT = st.v_active;
+ }
+ CurrentVT = st.v_active;
close(fd);
}
+ /* if we close with the modifier set in glutIconifyWindow, we won't
+ get the signal when they are released, so set to zero here */
+ KeyboardModifiers = 0;
+
/* open the console tty */
sprintf(console, "/dev/tty%d", CurrentVT);
ConsoleFD = open(console, O_RDWR | O_NDELAY, 0);
@@ -660,13 +726,13 @@ void InitializeVT(int usestdin)
if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0)
sprintf(exiterror,"Warning: Failed to set terminal to graphics\n");
- if (ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) {
+ if(ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) {
sprintf(exiterror, "ioctl KDSKBMODE failed!\n");
tcsetattr(0, TCSANOW, &OldTermios);
exit(0);
}
- if( ioctl(ConsoleFD, KDGKBLED, &KeyboardLedState) < 0) {
+ if(ioctl(ConsoleFD, KDGKBLED, &KeyboardLedState) < 0) {
sprintf(exiterror, "ioctl KDGKBLED failed!\n");
exit(0);
}
@@ -680,16 +746,14 @@ void RestoreVT(void)
if (tcsetattr(0, TCSANOW, &OldTermios) < 0)
fprintf(stderr, "tcsetattr failed\n");
- /* setting the mode to text from graphics restores the colormap*/
+ /* setting the mode to text from graphics restores the colormap */
if(
#ifdef HAVE_GPM
- GpmMouse ||
+ !GpmMouse ||
#endif
ConsoleFD == 0)
- if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) {
- sprintf(exiterror,"Warning: Failed to set terminal to graphics\n");
+ if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0)
goto skipioctl; /* no need to fail twice */
- }
if(ioctl(ConsoleFD, KDSETMODE, OldMode) < 0)
fprintf(stderr, "ioctl KDSETMODE failed!\n");
@@ -707,6 +771,9 @@ void RestoreVT(void)
fprintf(stderr, "ioctl KDSKBMODE failed!\n");
close(ConsoleFD);
+
+ close(kbdpipe[0]);
+ close(kbdpipe[1]);
}
void InitializeMouse(void)
@@ -718,11 +785,11 @@ void InitializeMouse(void)
const char *mousedev = getenv("MOUSE");
if(!mousedev)
mousedev = MOUSEDEV;
- if((MouseFD = open(mousedev, O_RDONLY)) >= 0) {
- if(!MouseSpeed)
- MouseSpeed = 1;
- NumMouseButtons = 3;
- return;
+ if((MouseFD = open(mousedev, O_RDONLY | O_NONBLOCK)) >= 0) {
+ if(!MouseSpeed)
+ MouseSpeed = 1;
+ NumMouseButtons = 3;
+ return;
}
}
#ifdef HAVE_GPM
diff --git a/src/glut/fbdev/internal.h b/src/glut/fbdev/internal.h
index 082cd4f6f3a..0a159d96b0a 100644
--- a/src/glut/fbdev/internal.h
+++ b/src/glut/fbdev/internal.h
@@ -51,6 +51,8 @@ extern int Swapping, VTSwitch;
void TestVisible(void);
int ParseFBModes(int, int, int, int, int, int);
+void SetVideoMode(void);
+void CreateBuffer(void);
void CreateVisual(void);
extern int FrameBufferFD;
@@ -72,20 +74,20 @@ extern GLFBDevVisualPtr Visual;
#define REVERSECMAPSIZE (1<<REVERSECMAPSIZELOG)
extern unsigned short RedColorMap[256],
- GreenColorMap[256],
- BlueColorMap[256];
+ GreenColorMap[256],
+ BlueColorMap[256];
extern unsigned char ReverseColorMap[REVERSECMAPSIZE]
[REVERSECMAPSIZE]
[REVERSECMAPSIZE];
-void LoadOldColorMap(void);
+
void LoadColorMap(void);
-void UnloadColorMap(void);
void RestoreColorMap(void);
/* --- mouse --- */
extern int MouseX, MouseY;
extern int CurrentCursor;
-extern int MouseEnabled;
+extern int MouseVisible;
+extern int LastMouseTime;
extern int NumMouseButtons;
void InitializeCursor(void);
diff --git a/src/glut/fbdev/menu.c b/src/glut/fbdev/menu.c
index f5a5ef75434..4ab4eb30d46 100644
--- a/src/glut/fbdev/menu.c
+++ b/src/glut/fbdev/menu.c
@@ -25,6 +25,8 @@
*/
#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
#include <linux/fb.h>
@@ -69,6 +71,7 @@ void FreeMenus(void)
free(Menus[i].Items[j].name);
free(Menus[i].Items);
}
+
free(Menus);
}
@@ -204,7 +207,6 @@ void CloseMenu(void)
int glutCreateMenu(void (*func)(int value))
{
- MouseEnabled = 1;
CurrentMenu = NumMenus;
NumMenus++;
Menus = realloc(Menus, sizeof(*Menus) * NumMenus);
diff --git a/src/glut/fbdev/overlay.c b/src/glut/fbdev/overlay.c
index 8bd207155c0..374cf30e7df 100644
--- a/src/glut/fbdev/overlay.c
+++ b/src/glut/fbdev/overlay.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdlib.h>
#include <GL/gl.h>
void glutEstablishOverlay(void)
diff --git a/src/glut/fbdev/state.c b/src/glut/fbdev/state.c
index bca675c52c4..212a04aa028 100644
--- a/src/glut/fbdev/state.c
+++ b/src/glut/fbdev/state.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <string.h>
#include <sys/time.h>
#include <linux/fb.h>
diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile
index 6fac92fa0cb..7e1d56b3278 100644
--- a/src/glut/glx/Makefile
+++ b/src/glut/glx/Makefile
@@ -100,7 +100,7 @@ install:
$(INSTALL) -d $(INSTALL_DIR)/include/GL
$(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(INSTALL_DIR)/include/GL
- $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR)
clean:
diff --git a/src/glut/glx/glut_cmap.c b/src/glut/glx/glut_cmap.c
index 1c496ad66da..e8d9e1f01bf 100644
--- a/src/glut/glx/glut_cmap.c
+++ b/src/glut/glx/glut_cmap.c
@@ -177,7 +177,6 @@ __glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap)
}
break;
case TrueColor:
- case DirectColor:
*colormap = NULL; /* NULL if RGBA */
/* Hewlett-Packard supports a feature called "HP Color
@@ -250,10 +249,31 @@ __glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap)
private one. */
/* XXX Should do a better job of internal sharing for
privately allocated TrueColor colormaps. */
- /* XXX DirectColor probably needs ramps hand initialized! */
*cmap = XCreateColormap(__glutDisplay, __glutRoot,
vi->visual, AllocNone);
break;
+ case DirectColor:
+ *colormap = NULL; /* NULL if RGBA */
+ *cmap = XCreateColormap(__glutDisplay, __glutRoot,
+ vi->visual, AllocAll);
+ if (vi->depth == 24) {
+ /* init the red, green, blue maps to linear ramps */
+ XColor xc[256];
+ int i;
+ for (i = 0; i < 256; i++) {
+ xc[i].pixel = (i << 16) | (i << 8) | i;
+ xc[i].red = (i << 8) | i;
+ xc[i].green = (i << 8) | i;
+ xc[i].blue = (i << 8) | i;
+ xc[i].flags = DoRed | DoGreen | DoBlue;
+ }
+ XStoreColors(__glutDisplay, *cmap, xc, 256);
+ }
+ else {
+ fprintf(stderr, "GLUT Error: DirectColor visuals other than 24-bits "
+ "not fully supported.\n");
+ }
+ break;
case StaticColor:
case StaticGray:
case GrayScale:
diff --git a/src/glut/glx/glut_win.c b/src/glut/glx/glut_win.c
index 9b9e6e30225..0f48e0ba339 100644
--- a/src/glut/glx/glut_win.c
+++ b/src/glut/glx/glut_win.c
@@ -349,13 +349,30 @@ getVisualInfoRGB(unsigned int mode)
__glutScreen, list);
}
+static XVisualInfo *
+getVisualInfoID(int id)
+{
+ XVisualInfo temp;
+ int count;
+ temp.visualid = id;
+ return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count);
+}
+
+
XVisualInfo *
__glutGetVisualInfo(unsigned int mode)
{
+ char *visStr;
/* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */
if (GLUT_WIND_IS_LUMINANCE(mode))
return NULL;
+ visStr = getenv("GLUT_FORCE_VISUAL");
+ if (visStr) {
+ int id = atoi(visStr);
+ return getVisualInfoID(id);
+ }
+
if (GLUT_WIND_IS_RGB(mode))
return getVisualInfoRGB(mode);
else
diff --git a/src/glut/mini/models.c b/src/glut/mini/models.c
index 57f45a262ce..3f955b88ff6 100644
--- a/src/glut/mini/models.c
+++ b/src/glut/mini/models.c
@@ -152,7 +152,7 @@ drawBox(GLfloat size, GLenum type)
for (i = 5; i >= 0; i--) {
glBegin(type);
-/* glNormal3fv(&n[i][0]); */
+ glNormal3fv(&n[i][0]);
glVertex3fv(&v[faces[i][0]][0]);
glVertex3fv(&v[faces[i][1]][0]);
glVertex3fv(&v[faces[i][2]][0]);
@@ -205,9 +205,9 @@ doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
sinPhi = sin(phi);
dist = R + r * cosPhi;
-/* glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); */
+ glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
-/* glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); */
+ glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
}
glEnd();
@@ -222,10 +222,10 @@ void APIENTRY
glutWireTorus(GLdouble innerRadius, GLdouble outerRadius,
GLint nsides, GLint rings)
{
-/* glPushAttrib(GL_POLYGON_BIT); */
-/* glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); */
+ glPushAttrib(GL_POLYGON_BIT);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
doughnut(innerRadius, outerRadius, nsides, rings);
-/* glPopAttrib(); */
+ glPopAttrib();
}
void APIENTRY
@@ -318,7 +318,7 @@ pentagon(int a, int b, int c, int d, int e, GLenum shadeType)
normalize(n0);
glBegin(shadeType);
-/* glNormal3fv(n0); */
+ glNormal3fv(n0);
glVertex3fv(&dodec[a][0]);
glVertex3fv(&dodec[b][0]);
glVertex3fv(&dodec[c][0]);
@@ -377,7 +377,7 @@ recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3,
normalize(q1);
glBegin(shadeType);
-/* glNormal3fv(q1); */
+ glNormal3fv(q1);
glVertex3fv(n1);
glVertex3fv(n2);
glVertex3fv(n3);
diff --git a/src/glut/os2/Makefile b/src/glut/os2/Makefile
deleted file mode 100644
index 56ad4e4c47f..00000000000
--- a/src/glut/os2/Makefile
+++ /dev/null
@@ -1,420 +0,0 @@
-# Makefile
-# Created by IBM WorkFrame/2 MakeMake at 12:46:25 on 3 June 2003
-#
-# The actions included in this make file are:
-# Compile::C++ Compiler
-# Link::Linker
-# Lib::Import Lib
-
-.SUFFIXES:
-
-.SUFFIXES: \
- .LIB .cpp .dll .obj
-
-.cpp.obj:
- @echo " Compile::C++ Compiler "
- icc.exe /I..\ /I..\X86 /I..\GL /I..\swrast /I..\swrast_setup /Ss /Wcmpcndcnscnvcpydclenuextgeninilanobsordparporppcprorearettrdtruund /Tx /O /Gm /Ge- /G5 /Gf /Gi /Oi /C %s
-
-{G:\EVGEN\MESA5\src-glut.os2pm}.cpp.obj:
- @echo " Compile::C++ Compiler "
- icc.exe /I..\ /I..\X86 /I..\GL /I..\swrast /I..\swrast_setup /Ss /Wcmpcndcnscnvcpydclenuextgeninilanobsordparporppcprorearettrdtruund /Tx /O /Gm /Ge- /G5 /Gf /Gi /Oi /C %s
-
-.dll.LIB:
- @echo " Lib::Import Lib "
- implib.exe %|dpfF.LIB %s
-
-{G:\EVGEN\MESA5\src-glut.os2pm}.dll.LIB:
- @echo " Lib::Import Lib "
- implib.exe %|dpfF.LIB %s
-
-all: \
- .\libGlut.LIB
-
-.\libGlut.dll: \
- .\os2_winproc.obj \
- .\WarpWin.obj \
- .\glutOverlay.obj \
- .\glut_8x13.obj \
- .\glut_9x15.obj \
- .\glut_bitmap.obj \
- .\glut_cindex.obj \
- .\glut_cmap.obj \
- .\glut_cursor.obj \
- .\glut_event.obj \
- .\glut_ext.obj \
- .\glut_fullscrn.obj \
- .\glut_gamemode.obj \
- .\glut_get.obj \
- .\glut_hel10.obj \
- .\glut_hel12.obj \
- .\glut_hel18.obj \
- .\glut_init.obj \
- .\glut_input.obj \
- .\glut_key.obj \
- .\glut_keyctrl.obj \
- .\glut_keyup.obj \
- .\glut_mesa.obj \
- .\glut_modifier.obj \
- .\glut_roman.obj \
- .\glut_shapes.obj \
- .\glut_stroke.obj \
- .\glut_swap.obj \
- .\glut_teapot.obj \
- .\glut_tr24.obj \
- .\glut_util.obj \
- .\glut_vidresize.obj \
- .\glut_warp.obj \
- .\glut_win.obj \
- .\glut_winmisc.obj \
- .\os2_glx.obj \
- .\os2_menu.obj \
- ..\si-glu\libGLU.lib \
- ..\MesaDll\MesaGL2.lib \
- ..\drv\DrvLoad\MesaDrvLoad.lib \
- {$(LIB)}libGlut.DEF
- @echo " Link::Linker "
- icc.exe @<<
- /B" /dbgpack /exepack:2 /st:200000 /packd /optfunc"
- /FelibGlut.dll
- ..\si-glu\libGLU.lib
- ..\MesaDll\MesaGL2.lib
- ..\drv\DrvLoad\MesaDrvLoad.lib
- libGlut.DEF
- .\os2_winproc.obj
- .\WarpWin.obj
- .\glutOverlay.obj
- .\glut_8x13.obj
- .\glut_9x15.obj
- .\glut_bitmap.obj
- .\glut_cindex.obj
- .\glut_cmap.obj
- .\glut_cursor.obj
- .\glut_event.obj
- .\glut_ext.obj
- .\glut_fullscrn.obj
- .\glut_gamemode.obj
- .\glut_get.obj
- .\glut_hel10.obj
- .\glut_hel12.obj
- .\glut_hel18.obj
- .\glut_init.obj
- .\glut_input.obj
- .\glut_key.obj
- .\glut_keyctrl.obj
- .\glut_keyup.obj
- .\glut_mesa.obj
- .\glut_modifier.obj
- .\glut_roman.obj
- .\glut_shapes.obj
- .\glut_stroke.obj
- .\glut_swap.obj
- .\glut_teapot.obj
- .\glut_tr24.obj
- .\glut_util.obj
- .\glut_vidresize.obj
- .\glut_warp.obj
- .\glut_win.obj
- .\glut_winmisc.obj
- .\os2_glx.obj
- .\os2_menu.obj
-<<
-
-.\os2_winproc.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\os2_winproc.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \
- gl\os2mesa.h \
- gl\gl.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2mesadef.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}context.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glapi.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}mtypes.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glheader.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}config.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glapitable.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glthread.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}math/m_matrix.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}Trace/tr_context.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}dd.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}conf.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_config.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/glext.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}Xthreads.h
-
-.\os2_menu.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\os2_menu.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\os2_glx.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\os2_glx.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- gl\os2mesa.h \
- gl\gl.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h
-
-.\glut_winmisc.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_winmisc.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_win.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_win.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutos2.h \
- gl\os2mesa.h \
- gl\gl.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h
-
-.\glut_warp.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_warp.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_vidresize.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_vidresize.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_util.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_util.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_tr24.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_tr24.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h
-
-.\glut_teapot.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_teapot.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_swap.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_swap.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_stroke.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_stroke.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_shapes.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_shapes.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_roman.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_roman.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h
-
-.\glut_modifier.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_modifier.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_mesa.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_mesa.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_keyup.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_keyup.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_keyctrl.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_keyctrl.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_key.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_key.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_input.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_input.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_init.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_init.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_hel18.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_hel18.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h
-
-.\glut_hel12.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_hel12.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h
-
-.\glut_hel10.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_hel10.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h
-
-.\glut_get.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_get.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_gamemode.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_gamemode.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_fullscrn.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_fullscrn.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_ext.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_ext.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_event.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_event.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_cursor.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_cursor.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_cmap.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_cmap.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}layerutil.h
-
-.\glut_cindex.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_cindex.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_bitmap.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_bitmap.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\glut_9x15.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_9x15.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h
-
-.\glut_8x13.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glut_8x13.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h
-
-.\glutOverlay.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\glutOverlay.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h
-
-.\WarpWin.obj: \
- G:\EVGEN\MESA5\src-glut.os2pm\WarpWin.cpp \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpWin.h \
- {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h
-
-.\libGlut.LIB: \
- .\libGlut.dll
diff --git a/src/glut/os2/WarpWin.cpp b/src/glut/os2/WarpWin.cpp
deleted file mode 100644
index ee746ecc764..00000000000
--- a/src/glut/os2/WarpWin.cpp
+++ /dev/null
@@ -1,420 +0,0 @@
-/* WarpWin.c */
-/* glut for Warp */
-#include <stdio.h>
-#include <string.h>
-
-#include "WarpWin.h"
-#include "WarpGL.h"
-
-#define POKA 0
-
-/* global variables that must be set for some functions to operate
- correctly. */
-HDC XHDC;
-HWND XHWND;
-
-
-void
-XStoreColor(Display* display, Colormap colormap, XColor* color)
-{
- /* KLUDGE: set XHDC to 0 if the palette should NOT be realized after
- setting the color. set XHDC to the correct HDC if it should. */
-
- LONG pe;
- ULONG cclr;
- int r,g,b;
- /* X11 stores color from 0-65535, Win32 expects them to be 0-256, so
- twiddle the bits ( / 256). */
- r = color->red / 256;
- g = color->green / 256;
- b = color->blue / 256;
- pe = LONGFromRGB(r,g,b);
- /* make sure we use this flag, otherwise the colors might get mapped
- to another place in the colormap, and when we glIndex() that
- color, it may have moved (argh!!) */
- pe |= (PC_NOCOLLAPSE<<24);
-/* This function changes the entries in a palette. */
-#if POKA
-OS2:
- rc = GpiSetPaletteEntries(colormap,LCOLF_CONSECRGB, color->pixel, 1, &pe);
- GpiSelectPalette(hps,colormap);
- WinRealizePalette(hwnd,hps,&cclr);
-source Win:
- if (XHDC) {
- UnrealizeObject(colormap);
- SelectPalette(XHDC, colormap, FALSE);
- RealizePalette(XHDC);
-
- }
-#endif
-}
-
-void
-XSetWindowColormap(Display* display, Window window, Colormap colormap)
-{
-#if POKA
- HDC hdc = GetDC(window);
-
- /* if the third parameter is FALSE, the logical colormap is copied
- into the device palette when the application is in the
- foreground, if it is TRUE, the colors are mapped into the current
- palette in the best possible way. */
- SelectPalette(hdc, colormap, FALSE);
- RealizePalette(hdc);
-
- /* note that we don't have to release the DC, since our window class
- uses the WC_OWNDC flag! */
-#endif
-}
-
-
-/* display, root and visual - don't used at all */
-Colormap
-XCreateColormap(Display* display, Window root, Visual* visual, int alloc)
-{
- /* KLUDGE: this function needs XHDC to be set to the HDC currently
- being operated on before it is invoked! */
-
- HPAL palette;
- int n;
-#if POKA
- PIXELFORMATDESCRIPTOR pfd;
- LOGPALETTE *logical;
-
- /* grab the pixel format */
- memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
- DescribePixelFormat(XHDC, GetPixelFormat(XHDC),
- sizeof(PIXELFORMATDESCRIPTOR), &pfd);
-
- if (!(pfd.dwFlags & PFD_NEED_PALETTE ||
- pfd.iPixelType == PFD_TYPE_COLORINDEX))
- {
- return 0;
- }
-
- n = 1 << pfd.cColorBits;
-
- /* allocate a bunch of memory for the logical palette (assume 256
- colors in a Win32 palette */
- logical = (LOGPALETTE*)malloc(sizeof(LOGPALETTE) +
- sizeof(PALETTEENTRY) * n);
- memset(logical, 0, sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * n);
-
- /* set the entries in the logical palette */
- logical->palVersion = 0x300;
- logical->palNumEntries = n;
-
- /* start with a copy of the current system palette */
- GetSystemPaletteEntries(XHDC, 0, 256, &logical->palPalEntry[0]);
-
- if (pfd.iPixelType == PFD_TYPE_RGBA) {
- int redMask = (1 << pfd.cRedBits) - 1;
- int greenMask = (1 << pfd.cGreenBits) - 1;
- int blueMask = (1 << pfd.cBlueBits) - 1;
- int i;
-
- /* fill in an RGBA color palette */
- for (i = 0; i < n; ++i) {
- logical->palPalEntry[i].peRed =
- (((i >> pfd.cRedShift) & redMask) * 255) / redMask;
- logical->palPalEntry[i].peGreen =
- (((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask;
- logical->palPalEntry[i].peBlue =
- (((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask;
- logical->palPalEntry[i].peFlags = 0;
- }
- }
-
- palette = CreatePalette(logical);
- free(logical);
-
- SelectPalette(XHDC, palette, FALSE);
- RealizePalette(XHDC);
-#endif /* POKA */
-
- return palette;
-}
-
-
-
-int GetSystemMetrics( int mode)
-{ RECTL rect;
-
- switch(mode)
- { case SM_CXSCREEN:
- WinQueryWindowRect(HWND_DESKTOP,&rect);
- return (rect.xRight-rect.xLeft);
- break;
- case SM_CYSCREEN:
- WinQueryWindowRect(HWND_DESKTOP,&rect);
- return (rect.yTop-rect.yBottom);
- break;
- default: ;
- }
- return 0;
-}
-/*
- * XParseGeometry parses strings of the form
- * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
- * width, height, xoffset, and yoffset are unsigned integers.
- * Example: "=80x24+300-49"
- * The equal sign is optional.
- * It returns a bitmask that indicates which of the four values
- * were actually found in the string. For each value found,
- * the corresponding argument is updated; for each value
- * not found, the corresponding argument is left unchanged.
- */
-
-static int
-ReadInteger(char *string, char **NextString)
-{
- register int Result = 0;
- int Sign = 1;
-
- if (*string == '+')
- string++;
- else if (*string == '-')
- {
- string++;
- Sign = -1;
- }
- for (; (*string >= '0') && (*string <= '9'); string++)
- {
- Result = (Result * 10) + (*string - '0');
- }
- *NextString = string;
- if (Sign >= 0)
- return (Result);
- else
- return (-Result);
-}
-
-int XParseGeometry(char *string, int *x, int *y, unsigned int *width, unsigned int *height)
-{
- int mask = NoValue;
- register char *strind;
- unsigned int tempWidth, tempHeight;
- int tempX, tempY;
- char *nextCharacter;
-
- if ( (string == NULL) || (*string == '\0')) return(mask);
- if (*string == '=')
- string++; /* ignore possible '=' at beg of geometry spec */
-
- strind = (char *)string;
- if (*strind != '+' && *strind != '-' && *strind != 'x') {
- tempWidth = ReadInteger(strind, &nextCharacter);
- if (strind == nextCharacter)
- return (0);
- strind = nextCharacter;
- mask |= WidthValue;
- }
-
- if (*strind == 'x' || *strind == 'X') {
- strind++;
- tempHeight = ReadInteger(strind, &nextCharacter);
- if (strind == nextCharacter)
- return (0);
- strind = nextCharacter;
- mask |= HeightValue;
- }
-
- if ((*strind == '+') || (*strind == '-')) {
- if (*strind == '-') {
- strind++;
- tempX = -ReadInteger(strind, &nextCharacter);
- if (strind == nextCharacter)
- return (0);
- strind = nextCharacter;
- mask |= XNegative;
-
- }
- else
- { strind++;
- tempX = ReadInteger(strind, &nextCharacter);
- if (strind == nextCharacter)
- return(0);
- strind = nextCharacter;
- }
- mask |= XValue;
- if ((*strind == '+') || (*strind == '-')) {
- if (*strind == '-') {
- strind++;
- tempY = -ReadInteger(strind, &nextCharacter);
- if (strind == nextCharacter)
- return(0);
- strind = nextCharacter;
- mask |= YNegative;
-
- }
- else
- {
- strind++;
- tempY = ReadInteger(strind, &nextCharacter);
- if (strind == nextCharacter)
- return(0);
- strind = nextCharacter;
- }
- mask |= YValue;
- }
- }
-
- /* If strind isn't at the end of the string the it's an invalid
- geometry specification. */
-
- if (*strind != '\0') return (0);
-
- if (mask & XValue)
- *x = tempX;
- if (mask & YValue)
- *y = tempY;
- if (mask & WidthValue)
- *width = tempWidth;
- if (mask & HeightValue)
- *height = tempHeight;
- return (mask);
-}
-
-int gettimeofday(struct timeval* tp, void* tzp)
-{
- DATETIME DateTime;
- APIRET ulrc; /* Return Code. */
-
- ulrc = DosGetDateTime(&DateTime);
- tp->tv_sec = 60 * (60*DateTime.hours + DateTime.minutes) + DateTime.seconds;
- tp->tv_usec = DateTime.hundredths * 10000;
- return 0;
-}
-
-
-int
-XPending(Display* display)
-{
- /* similar functionality...I don't think that it is exact, but this
- will have to do. */
- QMSG msg;
- extern HAB hab; /* PM anchor block handle */
-
-//?? WinPeekMsg(hab
- return WinPeekMsg(hab, &msg, NULLHANDLE, 0, 0, PM_NOREMOVE);
-}
-
-void
-__glutAdjustCoords(Window parent, int* x, int* y, int* width, int* height)
-{
- RECTL rect;
-
- /* adjust the window rectangle because Win32 thinks that the x, y,
- width & height are the WHOLE window (including decorations),
- whereas GLUT treats the x, y, width & height as only the CLIENT
- area of the window. */
- rect.xLeft = *x; rect.yTop = *y;
- rect.xRight = *x + *width; rect.yBottom = *y + *height;
-
- /* must adjust the coordinates according to the correct style
- because depending on the style, there may or may not be
- borders. */
-//?? AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
-//?? (parent ? WS_CHILD : WS_OVERLAPPEDWINDOW),
-//?? FALSE);
- /* FALSE in the third parameter = window has no menu bar */
-
- /* readjust if the x and y are offscreen */
- if(rect.xLeft < 0) {
- *x = 0;
- } else {
- *x = rect.xLeft;
- }
-
- if(rect.yTop < 0) {
- *y = 0;
- } else {
- *y = rect.yTop;
- }
-
- *width = rect.xRight - rect.xLeft; /* adjusted width */
- *height = -(rect.yBottom - rect.yTop); /* adjusted height */
-}
-
-
-int
-__glutGetTransparentPixel(Display * dpy, XVisualInfo * vinfo)
-{
- /* the transparent pixel on Win32 is always index number 0. So if
- we put this routine in this file, we can avoid compiling the
- whole of layerutil.c which is where this routine normally comes
- from. */
- return 0;
-}
-
-/* Translate point coordinates src_x and src_y from src to dst */
-
-Bool
-XTranslateCoordinates(Display *display, Window src, Window dst,
- int src_x, int src_y,
- int* dest_x_return, int* dest_y_return,
- Window* child_return)
-{
- SWP swp_src,swp_dst;
-
- WinQueryWindowPos(src,&swp_src);
- WinQueryWindowPos(dst,&swp_dst);
-
- *dest_x_return = src_x + swp_src.x - swp_dst.x;
- *dest_y_return = src_y + swp_src.y - swp_dst.y;
-
- /* just to make compilers happy...we don't use the return value. */
- return True;
-}
-
-Status
-XGetGeometry(Display* display, Window window, Window* root_return,
- int* x_return, int* y_return,
- unsigned int* width_return, unsigned int* height_return,
- unsigned int *border_width_return, unsigned int* depth_return)
-{
- /* KLUDGE: doesn't return the border_width or depth or root, x & y
- are in screen coordinates. */
- SWP swp_src;
- WinQueryWindowPos(window,&swp_src);
-
- *x_return = swp_src.x;
- *y_return = swp_src.y;
- *width_return = swp_src.cx;
- *height_return = swp_src.cy;
-
- /* just to make compilers happy...we don't use the return value. */
- return 1;
-}
-
-/* Get Display Width in millimeters */
-int
-DisplayWidthMM(Display* display, int screen)
-{
- int width;
- LONG *pVC_Caps;
- pVC_Caps = GetVideoConfig(NULLHANDLE);
- width = (int)( 0.001 * pVC_Caps[CAPS_WIDTH] / pVC_Caps[CAPS_HORIZONTAL_RESOLUTION]);/* mm */
- return width;
-}
-
-/* Get Display Height in millimeters */
-int
-DisplayHeightMM(Display* display, int screen)
-{
- int height;
- LONG *pVC_Caps;
- pVC_Caps = GetVideoConfig(NULLHANDLE);
- height = (int)( 0.001 * pVC_Caps[CAPS_HEIGHT] / pVC_Caps[CAPS_VERTICAL_RESOLUTION]); /* mm */
- return height;
-}
-
-void ScreenToClient( HWND hwnd, POINTL *point)
-{
- SWP swp_src;
- WinQueryWindowPos(hwnd,&swp_src);
- point->x -= swp_src.x;
- point->y -= swp_src.y;
-}
-
- \ No newline at end of file
diff --git a/src/glut/os2/glutOverlay.cpp b/src/glut/os2/glutOverlay.cpp
deleted file mode 100644
index 563708de2db..00000000000
--- a/src/glut/os2/glutOverlay.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/***********************************************************
- * Copyright (C) 1997, Be Inc. All rights reserved.
- *
- * FILE: glutOverlay.cpp
- *
- * DESCRIPTION: we don't support overlays, so this code is
- * really simple
- ***********************************************************/
-
-/***********************************************************
- * Headers
- ***********************************************************/
-#include <GL/glut.h>
-#include "glutint.h"
-#include "glutbitmap.h"
-#include "glutstroke.h"
-
-GLUTAPI void GLUTAPIENTRY
-glutEstablishOverlay(void)
-{
- __glutFatalError("OS2PM lacks overlay support.");
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutUseLayer(GLenum layer) {
- // ignore
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutRemoveOverlay(void) {
- // ignore
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutPostOverlayRedisplay(void) {
- // ignore
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutShowOverlay(void) {
- // ignore
-}
-
-GLUTAPI void GLUTAPIENTRY glutHideOverlay(void)
-{
- // ignore
-}
-
-int GLUTAPIENTRY
-glutLayerGet(GLenum param)
-{
- // ignore
-}
-
-/***********************************************************
- * Unsupported callbacks
- ***********************************************************/
-GLUTAPI void GLUTAPIENTRY
-glutOverlayDisplayFunc(GLUTdisplayCB displayFunc)
-{
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc)
-{
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc)
-{
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc)
-{
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc)
-{
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutDialsFunc(GLUTdialsCB dialsFunc)
-{
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc)
-{
-}
-
-GLUTAPI void GLUTAPIENTRY
-glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc)
-{
-}
-GLUTAPI void GLUTAPIENTRY
-glutPostWindowOverlayRedisplay(int win)
-{ //
-}
-
-void GLUTAPIENTRY
-glutInitDisplayString(const char *string)
-{ //
-}
-void GLUTAPIENTRY
-glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval)
-{ //
-}
-
-void GLUTAPIENTRY
-glutForceJoystickFunc(void)
-{ //
-}
-
-
-int GLUTAPIENTRY
-glutBitmapWidth(GLUTbitmapFont font, int c)
-{ return 0;
-}
-int GLUTAPIENTRY
-glutBitmapLength(GLUTbitmapFont font, const unsigned char *string)
-{ //
- return 0;
-}
-int GLUTAPIENTRY
-glutStrokeWidth(GLUTstrokeFont font, int c)
-{ return 0;
-}
-int GLUTAPIENTRY
-glutStrokeLength(GLUTstrokeFont font, const unsigned char *string)
-{ return 0;
-}
diff --git a/src/glut/os2/glut_8x13.cpp b/src/glut/os2/glut_8x13.cpp
deleted file mode 100644
index e361e17cbfd..00000000000
--- a/src/glut/os2/glut_8x13.cpp
+++ /dev/null
@@ -1,2076 +0,0 @@
-
-/* GENERATED FILE -- DO NOT MODIFY */
-
-#define glutBitmap8By13 XXX
-#include "glutbitmap.h"
-#undef glutBitmap8By13
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch0data[] = { 0x0 };
-static const BitmapCharRec ch0 = {1,1,0,0,8,ch0data};
-#else
-static const BitmapCharRec ch0 = {0,0,0,0,8,0};
-#endif
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch32data[] = { 0x0 };
-static const BitmapCharRec ch32 = {1,1,0,0,8,ch32data};
-#else
-static const BitmapCharRec ch32 = {0,0,0,0,8,0};
-#endif
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch127data[] = { 0x0 };
-static const BitmapCharRec ch127 = {1,1,0,0,8,ch127data};
-#else
-static const BitmapCharRec ch127 = {0,0,0,0,8,0};
-#endif
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch160data[] = { 0x0 };
-static const BitmapCharRec ch160 = {1,1,0,0,8,ch160data};
-#else
-static const BitmapCharRec ch160 = {0,0,0,0,8,0};
-#endif
-
-/* char: 0xff */
-
-static const GLubyte ch255data[] = {
-0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch255 = {6,12,-1,2,8,ch255data};
-
-/* char: 0xfe */
-
-static const GLubyte ch254data[] = {
-0x80,0x80,0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80,
-};
-
-static const BitmapCharRec ch254 = {6,10,-1,2,8,ch254data};
-
-/* char: 0xfd */
-
-static const GLubyte ch253data[] = {
-0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch253 = {6,12,-1,2,8,ch253data};
-
-/* char: 0xfc */
-
-static const GLubyte ch252data[] = {
-0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch252 = {6,10,-1,0,8,ch252data};
-
-/* char: 0xfb */
-
-static const GLubyte ch251data[] = {
-0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch251 = {6,10,-1,0,8,ch251data};
-
-/* char: 0xfa */
-
-static const GLubyte ch250data[] = {
-0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch250 = {6,10,-1,0,8,ch250data};
-
-/* char: 0xf9 */
-
-static const GLubyte ch249data[] = {
-0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch249 = {6,10,-1,0,8,ch249data};
-
-/* char: 0xf8 */
-
-static const GLubyte ch248data[] = {
-0x80,0x78,0xc4,0xa4,0x94,0x8c,0x78,0x4,
-};
-
-static const BitmapCharRec ch248 = {6,8,-1,1,8,ch248data};
-
-/* char: 0xf7 */
-
-static const GLubyte ch247data[] = {
-0x20,0x20,0x0,0xf8,0x0,0x20,0x20,
-};
-
-static const BitmapCharRec ch247 = {5,7,-1,-1,8,ch247data};
-
-/* char: 0xf6 */
-
-static const GLubyte ch246data[] = {
-0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch246 = {6,10,-1,0,8,ch246data};
-
-/* char: 0xf5 */
-
-static const GLubyte ch245data[] = {
-0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch245 = {6,10,-1,0,8,ch245data};
-
-/* char: 0xf4 */
-
-static const GLubyte ch244data[] = {
-0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch244 = {6,10,-1,0,8,ch244data};
-
-/* char: 0xf3 */
-
-static const GLubyte ch243data[] = {
-0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch243 = {6,10,-1,0,8,ch243data};
-
-/* char: 0xf2 */
-
-static const GLubyte ch242data[] = {
-0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch242 = {6,10,-1,0,8,ch242data};
-
-/* char: 0xf1 */
-
-static const GLubyte ch241data[] = {
-0x84,0x84,0x84,0x84,0xc4,0xb8,0x0,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch241 = {6,10,-1,0,8,ch241data};
-
-/* char: 0xf0 */
-
-static const GLubyte ch240data[] = {
-0x78,0x84,0x84,0x84,0x84,0x78,0x8,0x50,0x30,0x48,
-};
-
-static const BitmapCharRec ch240 = {6,10,-1,0,8,ch240data};
-
-/* char: 0xef */
-
-static const GLubyte ch239data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x50,0x50,
-};
-
-static const BitmapCharRec ch239 = {5,10,-1,0,8,ch239data};
-
-/* char: 0xee */
-
-static const GLubyte ch238data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x90,0x60,
-};
-
-static const BitmapCharRec ch238 = {5,10,-1,0,8,ch238data};
-
-/* char: 0xed */
-
-static const GLubyte ch237data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x40,0x20,
-};
-
-static const BitmapCharRec ch237 = {5,10,-1,0,8,ch237data};
-
-/* char: 0xec */
-
-static const GLubyte ch236data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch236 = {5,10,-1,0,8,ch236data};
-
-/* char: 0xeb */
-
-static const GLubyte ch235data[] = {
-0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch235 = {6,10,-1,0,8,ch235data};
-
-/* char: 0xea */
-
-static const GLubyte ch234data[] = {
-0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch234 = {6,10,-1,0,8,ch234data};
-
-/* char: 0xe9 */
-
-static const GLubyte ch233data[] = {
-0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch233 = {6,10,-1,0,8,ch233data};
-
-/* char: 0xe8 */
-
-static const GLubyte ch232data[] = {
-0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch232 = {6,10,-1,0,8,ch232data};
-
-/* char: 0xe7 */
-
-static const GLubyte ch231data[] = {
-0x20,0x10,0x78,0x84,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch231 = {6,8,-1,2,8,ch231data};
-
-/* char: 0xe6 */
-
-static const GLubyte ch230data[] = {
-0x6c,0x92,0x90,0x7c,0x12,0x6c,
-};
-
-static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data};
-
-/* char: 0xe5 */
-
-static const GLubyte ch229data[] = {
-0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x30,0x48,0x30,
-};
-
-static const BitmapCharRec ch229 = {6,10,-1,0,8,ch229data};
-
-/* char: 0xe4 */
-
-static const GLubyte ch228data[] = {
-0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch228 = {6,10,-1,0,8,ch228data};
-
-/* char: 0xe3 */
-
-static const GLubyte ch227data[] = {
-0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch227 = {6,10,-1,0,8,ch227data};
-
-/* char: 0xe2 */
-
-static const GLubyte ch226data[] = {
-0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch226 = {6,10,-1,0,8,ch226data};
-
-/* char: 0xe1 */
-
-static const GLubyte ch225data[] = {
-0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch225 = {6,10,-1,0,8,ch225data};
-
-/* char: 0xe0 */
-
-static const GLubyte ch224data[] = {
-0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch224 = {6,10,-1,0,8,ch224data};
-
-/* char: 0xdf */
-
-static const GLubyte ch223data[] = {
-0x80,0xb8,0xc4,0x84,0x84,0xf8,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch223 = {6,9,-1,1,8,ch223data};
-
-/* char: 0xde */
-
-static const GLubyte ch222data[] = {
-0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,
-};
-
-static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data};
-
-/* char: 0xdd */
-
-static const GLubyte ch221data[] = {
-0x20,0x20,0x20,0x20,0x50,0x88,0x88,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch221 = {5,10,-1,0,8,ch221data};
-
-/* char: 0xdc */
-
-static const GLubyte ch220data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data};
-
-/* char: 0xdb */
-
-static const GLubyte ch219data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch219 = {6,10,-1,0,8,ch219data};
-
-/* char: 0xda */
-
-static const GLubyte ch218data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch218 = {6,10,-1,0,8,ch218data};
-
-/* char: 0xd9 */
-
-static const GLubyte ch217data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch217 = {6,10,-1,0,8,ch217data};
-
-/* char: 0xd8 */
-
-static const GLubyte ch216data[] = {
-0x80,0x78,0xc4,0xa4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4,
-};
-
-static const BitmapCharRec ch216 = {6,11,-1,1,8,ch216data};
-
-/* char: 0xd7 */
-
-static const GLubyte ch215data[] = {
-0x84,0x48,0x30,0x30,0x48,0x84,
-};
-
-static const BitmapCharRec ch215 = {6,6,-1,-1,8,ch215data};
-
-/* char: 0xd6 */
-
-static const GLubyte ch214data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch214 = {7,10,0,0,8,ch214data};
-
-/* char: 0xd5 */
-
-static const GLubyte ch213data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x14,
-};
-
-static const BitmapCharRec ch213 = {7,10,0,0,8,ch213data};
-
-/* char: 0xd4 */
-
-static const GLubyte ch212data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x24,0x18,
-};
-
-static const BitmapCharRec ch212 = {7,10,0,0,8,ch212data};
-
-/* char: 0xd3 */
-
-static const GLubyte ch211data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch211 = {7,10,0,0,8,ch211data};
-
-/* char: 0xd2 */
-
-static const GLubyte ch210data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x8,0x10,
-};
-
-static const BitmapCharRec ch210 = {7,10,0,0,8,ch210data};
-
-/* char: 0xd1 */
-
-static const GLubyte ch209data[] = {
-0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x0,0x28,0x14,
-};
-
-static const BitmapCharRec ch209 = {7,10,0,0,8,ch209data};
-
-/* char: 0xd0 */
-
-static const GLubyte ch208data[] = {
-0xfc,0x42,0x42,0x42,0xe2,0x42,0x42,0x42,0xfc,
-};
-
-static const BitmapCharRec ch208 = {7,9,0,0,8,ch208data};
-
-/* char: 0xcf */
-
-static const GLubyte ch207data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50,
-};
-
-static const BitmapCharRec ch207 = {5,10,-1,0,8,ch207data};
-
-/* char: 0xce */
-
-static const GLubyte ch206data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch206 = {5,10,-1,0,8,ch206data};
-
-/* char: 0xcd */
-
-static const GLubyte ch205data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch205 = {5,10,-1,0,8,ch205data};
-
-/* char: 0xcc */
-
-static const GLubyte ch204data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch204 = {5,10,-1,0,8,ch204data};
-
-/* char: 0xcb */
-
-static const GLubyte ch203data[] = {
-0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch203 = {6,10,-1,0,8,ch203data};
-
-/* char: 0xca */
-
-static const GLubyte ch202data[] = {
-0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch202 = {6,10,-1,0,8,ch202data};
-
-/* char: 0xc9 */
-
-static const GLubyte ch201data[] = {
-0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch201 = {6,10,-1,0,8,ch201data};
-
-/* char: 0xc8 */
-
-static const GLubyte ch200data[] = {
-0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch200 = {6,10,-1,0,8,ch200data};
-
-/* char: 0xc7 */
-
-static const GLubyte ch199data[] = {
-0x20,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch199 = {6,11,-1,2,8,ch199data};
-
-/* char: 0xc6 */
-
-static const GLubyte ch198data[] = {
-0x9e,0x90,0x90,0xf0,0x9c,0x90,0x90,0x90,0x6e,
-};
-
-static const BitmapCharRec ch198 = {7,9,0,0,8,ch198data};
-
-/* char: 0xc5 */
-
-static const GLubyte ch197data[] = {
-0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x30,0x48,0x30,
-};
-
-static const BitmapCharRec ch197 = {6,10,-1,0,8,ch197data};
-
-/* char: 0xc4 */
-
-static const GLubyte ch196data[] = {
-0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x48,
-};
-
-static const BitmapCharRec ch196 = {6,10,-1,0,8,ch196data};
-
-/* char: 0xc3 */
-
-static const GLubyte ch195data[] = {
-0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch195 = {6,10,-1,0,8,ch195data};
-
-/* char: 0xc2 */
-
-static const GLubyte ch194data[] = {
-0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x30,
-};
-
-static const BitmapCharRec ch194 = {6,10,-1,0,8,ch194data};
-
-/* char: 0xc1 */
-
-static const GLubyte ch193data[] = {
-0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch193 = {6,10,-1,0,8,ch193data};
-
-/* char: 0xc0 */
-
-static const GLubyte ch192data[] = {
-0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch192 = {6,10,-1,0,8,ch192data};
-
-/* char: 0xbf */
-
-static const GLubyte ch191data[] = {
-0x78,0x84,0x84,0x80,0x40,0x20,0x20,0x0,0x20,
-};
-
-static const BitmapCharRec ch191 = {6,9,-1,0,8,ch191data};
-
-/* char: 0xbe */
-
-static const GLubyte ch190data[] = {
-0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60,
-};
-
-static const BitmapCharRec ch190 = {7,10,0,0,8,ch190data};
-
-/* char: 0xbd */
-
-static const GLubyte ch189data[] = {
-0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch189 = {7,10,0,0,8,ch189data};
-
-/* char: 0xbc */
-
-static const GLubyte ch188data[] = {
-0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch188 = {7,10,0,0,8,ch188data};
-
-/* char: 0xbb */
-
-static const GLubyte ch187data[] = {
-0x90,0x48,0x24,0x12,0x24,0x48,0x90,
-};
-
-static const BitmapCharRec ch187 = {7,7,0,-1,8,ch187data};
-
-/* char: 0xba */
-
-static const GLubyte ch186data[] = {
-0xf0,0x0,0x60,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch186 = {4,6,-1,-3,8,ch186data};
-
-/* char: 0xb9 */
-
-static const GLubyte ch185data[] = {
-0xe0,0x40,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch185 = {3,6,-1,-4,8,ch185data};
-
-/* char: 0xb8 */
-
-static const GLubyte ch184data[] = {
-0xc0,0x40,
-};
-
-static const BitmapCharRec ch184 = {2,2,-3,2,8,ch184data};
-
-/* char: 0xb7 */
-
-static const GLubyte ch183data[] = {
-0xc0,
-};
-
-static const BitmapCharRec ch183 = {2,1,-3,-4,8,ch183data};
-
-/* char: 0xb6 */
-
-static const GLubyte ch182data[] = {
-0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c,
-};
-
-static const BitmapCharRec ch182 = {6,9,-1,0,8,ch182data};
-
-/* char: 0xb5 */
-
-static const GLubyte ch181data[] = {
-0x80,0xb4,0xcc,0x84,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch181 = {6,7,-1,1,8,ch181data};
-
-/* char: 0xb4 */
-
-static const GLubyte ch180data[] = {
-0x80,0x40,
-};
-
-static const BitmapCharRec ch180 = {2,2,-3,-8,8,ch180data};
-
-/* char: 0xb3 */
-
-static const GLubyte ch179data[] = {
-0x60,0x90,0x10,0x20,0x90,0x60,
-};
-
-static const BitmapCharRec ch179 = {4,6,-1,-4,8,ch179data};
-
-/* char: 0xb2 */
-
-static const GLubyte ch178data[] = {
-0xf0,0x80,0x60,0x10,0x90,0x60,
-};
-
-static const BitmapCharRec ch178 = {4,6,-1,-4,8,ch178data};
-
-/* char: 0xb1 */
-
-static const GLubyte ch177data[] = {
-0xf8,0x0,0x20,0x20,0xf8,0x20,0x20,
-};
-
-static const BitmapCharRec ch177 = {5,7,-1,-1,8,ch177data};
-
-/* char: 0xb0 */
-
-static const GLubyte ch176data[] = {
-0x60,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch176 = {4,4,-2,-5,8,ch176data};
-
-/* char: 0xaf */
-
-static const GLubyte ch175data[] = {
-0xfc,
-};
-
-static const BitmapCharRec ch175 = {6,1,-1,-8,8,ch175data};
-
-/* char: 0xae */
-
-static const GLubyte ch174data[] = {
-0x38,0x44,0xaa,0xb2,0xaa,0xaa,0x92,0x44,0x38,
-};
-
-static const BitmapCharRec ch174 = {7,9,0,-1,8,ch174data};
-
-/* char: 0xad */
-
-static const GLubyte ch173data[] = {
-0xfc,
-};
-
-static const BitmapCharRec ch173 = {6,1,-1,-4,8,ch173data};
-
-/* char: 0xac */
-
-static const GLubyte ch172data[] = {
-0x4,0x4,0x4,0xfc,
-};
-
-static const BitmapCharRec ch172 = {6,4,-1,-1,8,ch172data};
-
-/* char: 0xab */
-
-static const GLubyte ch171data[] = {
-0x12,0x24,0x48,0x90,0x48,0x24,0x12,
-};
-
-static const BitmapCharRec ch171 = {7,7,0,-1,8,ch171data};
-
-/* char: 0xaa */
-
-static const GLubyte ch170data[] = {
-0xf8,0x0,0x78,0x88,0x78,0x8,0x70,
-};
-
-static const BitmapCharRec ch170 = {5,7,-1,-2,8,ch170data};
-
-/* char: 0xa9 */
-
-static const GLubyte ch169data[] = {
-0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,0x38,
-};
-
-static const BitmapCharRec ch169 = {7,9,0,-1,8,ch169data};
-
-/* char: 0xa8 */
-
-static const GLubyte ch168data[] = {
-0xd8,
-};
-
-static const BitmapCharRec ch168 = {5,1,-1,-8,8,ch168data};
-
-/* char: 0xa7 */
-
-static const GLubyte ch167data[] = {
-0x60,0x90,0x10,0x60,0x90,0x90,0x60,0x80,0x90,0x60,
-};
-
-static const BitmapCharRec ch167 = {4,10,-2,0,8,ch167data};
-
-/* char: 0xa6 */
-
-static const GLubyte ch166data[] = {
-0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch166 = {1,9,-3,0,8,ch166data};
-
-/* char: 0xa5 */
-
-static const GLubyte ch165data[] = {
-0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch165 = {7,9,0,0,8,ch165data};
-
-/* char: 0xa4 */
-
-static const GLubyte ch164data[] = {
-0x84,0x78,0x48,0x48,0x78,0x84,
-};
-
-static const BitmapCharRec ch164 = {6,6,-1,-1,8,ch164data};
-
-/* char: 0xa3 */
-
-static const GLubyte ch163data[] = {
-0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c,
-};
-
-static const BitmapCharRec ch163 = {7,9,0,0,8,ch163data};
-
-/* char: 0xa2 */
-
-static const GLubyte ch162data[] = {
-0x20,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x20,
-};
-
-static const BitmapCharRec ch162 = {5,8,-1,-1,8,ch162data};
-
-/* char: 0xa1 */
-
-static const GLubyte ch161data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,
-};
-
-static const BitmapCharRec ch161 = {1,9,-3,0,8,ch161data};
-
-/* char: 0x7e '~' */
-
-static const GLubyte ch126data[] = {
-0x90,0xa8,0x48,
-};
-
-static const BitmapCharRec ch126 = {5,3,-1,-6,8,ch126data};
-
-/* char: 0x7d '}' */
-
-static const GLubyte ch125data[] = {
-0xe0,0x10,0x10,0x20,0x18,0x20,0x10,0x10,0xe0,
-};
-
-static const BitmapCharRec ch125 = {5,9,-1,0,8,ch125data};
-
-/* char: 0x7c '|' */
-
-static const GLubyte ch124data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch124 = {1,9,-3,0,8,ch124data};
-
-/* char: 0x7b '{' */
-
-static const GLubyte ch123data[] = {
-0x38,0x40,0x40,0x20,0xc0,0x20,0x40,0x40,0x38,
-};
-
-static const BitmapCharRec ch123 = {5,9,-2,0,8,ch123data};
-
-/* char: 0x7a 'z' */
-
-static const GLubyte ch122data[] = {
-0xfc,0x40,0x20,0x10,0x8,0xfc,
-};
-
-static const BitmapCharRec ch122 = {6,6,-1,0,8,ch122data};
-
-/* char: 0x79 'y' */
-
-static const GLubyte ch121data[] = {
-0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch121 = {6,8,-1,2,8,ch121data};
-
-/* char: 0x78 'x' */
-
-static const GLubyte ch120data[] = {
-0x84,0x48,0x30,0x30,0x48,0x84,
-};
-
-static const BitmapCharRec ch120 = {6,6,-1,0,8,ch120data};
-
-/* char: 0x77 'w' */
-
-static const GLubyte ch119data[] = {
-0x44,0xaa,0x92,0x92,0x82,0x82,
-};
-
-static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data};
-
-/* char: 0x76 'v' */
-
-static const GLubyte ch118data[] = {
-0x20,0x50,0x50,0x88,0x88,0x88,
-};
-
-static const BitmapCharRec ch118 = {5,6,-1,0,8,ch118data};
-
-/* char: 0x75 'u' */
-
-static const GLubyte ch117data[] = {
-0x74,0x88,0x88,0x88,0x88,0x88,
-};
-
-static const BitmapCharRec ch117 = {6,6,-1,0,8,ch117data};
-
-/* char: 0x74 't' */
-
-static const GLubyte ch116data[] = {
-0x38,0x44,0x40,0x40,0x40,0xf8,0x40,0x40,
-};
-
-static const BitmapCharRec ch116 = {6,8,-1,0,8,ch116data};
-
-/* char: 0x73 's' */
-
-static const GLubyte ch115data[] = {
-0x78,0x84,0x18,0x60,0x84,0x78,
-};
-
-static const BitmapCharRec ch115 = {6,6,-1,0,8,ch115data};
-
-/* char: 0x72 'r' */
-
-static const GLubyte ch114data[] = {
-0x40,0x40,0x40,0x40,0x44,0xb8,
-};
-
-static const BitmapCharRec ch114 = {6,6,-1,0,8,ch114data};
-
-/* char: 0x71 'q' */
-
-static const GLubyte ch113data[] = {
-0x4,0x4,0x4,0x74,0x8c,0x84,0x8c,0x74,
-};
-
-static const BitmapCharRec ch113 = {6,8,-1,2,8,ch113data};
-
-/* char: 0x70 'p' */
-
-static const GLubyte ch112data[] = {
-0x80,0x80,0x80,0xb8,0xc4,0x84,0xc4,0xb8,
-};
-
-static const BitmapCharRec ch112 = {6,8,-1,2,8,ch112data};
-
-/* char: 0x6f 'o' */
-
-static const GLubyte ch111data[] = {
-0x78,0x84,0x84,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch111 = {6,6,-1,0,8,ch111data};
-
-/* char: 0x6e 'n' */
-
-static const GLubyte ch110data[] = {
-0x84,0x84,0x84,0x84,0xc4,0xb8,
-};
-
-static const BitmapCharRec ch110 = {6,6,-1,0,8,ch110data};
-
-/* char: 0x6d 'm' */
-
-static const GLubyte ch109data[] = {
-0x82,0x92,0x92,0x92,0x92,0xec,
-};
-
-static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data};
-
-/* char: 0x6c 'l' */
-
-static const GLubyte ch108data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60,
-};
-
-static const BitmapCharRec ch108 = {5,9,-1,0,8,ch108data};
-
-/* char: 0x6b 'k' */
-
-static const GLubyte ch107data[] = {
-0x84,0x88,0x90,0xe0,0x90,0x88,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch107 = {6,9,-1,0,8,ch107data};
-
-/* char: 0x6a 'j' */
-
-static const GLubyte ch106data[] = {
-0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x18,0x0,0x8,
-};
-
-static const BitmapCharRec ch106 = {5,10,-1,2,8,ch106data};
-
-/* char: 0x69 'i' */
-
-static const GLubyte ch105data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x20,
-};
-
-static const BitmapCharRec ch105 = {5,8,-1,0,8,ch105data};
-
-/* char: 0x68 'h' */
-
-static const GLubyte ch104data[] = {
-0x84,0x84,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch104 = {6,9,-1,0,8,ch104data};
-
-/* char: 0x67 'g' */
-
-static const GLubyte ch103data[] = {
-0x78,0x84,0x78,0x80,0x70,0x88,0x88,0x74,
-};
-
-static const BitmapCharRec ch103 = {6,8,-1,2,8,ch103data};
-
-/* char: 0x66 'f' */
-
-static const GLubyte ch102data[] = {
-0x40,0x40,0x40,0x40,0xf8,0x40,0x40,0x44,0x38,
-};
-
-static const BitmapCharRec ch102 = {6,9,-1,0,8,ch102data};
-
-/* char: 0x65 'e' */
-
-static const GLubyte ch101data[] = {
-0x78,0x84,0x80,0xfc,0x84,0x78,
-};
-
-static const BitmapCharRec ch101 = {6,6,-1,0,8,ch101data};
-
-/* char: 0x64 'd' */
-
-static const GLubyte ch100data[] = {
-0x74,0x8c,0x84,0x84,0x8c,0x74,0x4,0x4,0x4,
-};
-
-static const BitmapCharRec ch100 = {6,9,-1,0,8,ch100data};
-
-/* char: 0x63 'c' */
-
-static const GLubyte ch99data[] = {
-0x78,0x84,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch99 = {6,6,-1,0,8,ch99data};
-
-/* char: 0x62 'b' */
-
-static const GLubyte ch98data[] = {
-0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch98 = {6,9,-1,0,8,ch98data};
-
-/* char: 0x61 'a' */
-
-static const GLubyte ch97data[] = {
-0x74,0x8c,0x84,0x7c,0x4,0x78,
-};
-
-static const BitmapCharRec ch97 = {6,6,-1,0,8,ch97data};
-
-/* char: 0x60 '`' */
-
-static const GLubyte ch96data[] = {
-0x10,0x60,0xe0,
-};
-
-static const BitmapCharRec ch96 = {4,3,-2,-6,8,ch96data};
-
-/* char: 0x5f '_' */
-
-static const GLubyte ch95data[] = {
-0xfe,
-};
-
-static const BitmapCharRec ch95 = {7,1,0,1,8,ch95data};
-
-/* char: 0x5e '^' */
-
-static const GLubyte ch94data[] = {
-0x88,0x50,0x20,
-};
-
-static const BitmapCharRec ch94 = {5,3,-1,-6,8,ch94data};
-
-/* char: 0x5d ']' */
-
-static const GLubyte ch93data[] = {
-0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0,
-};
-
-static const BitmapCharRec ch93 = {4,9,-1,0,8,ch93data};
-
-/* char: 0x5c '\' */
-
-static const GLubyte ch92data[] = {
-0x2,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x80,
-};
-
-static const BitmapCharRec ch92 = {7,9,0,0,8,ch92data};
-
-/* char: 0x5b '[' */
-
-static const GLubyte ch91data[] = {
-0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0,
-};
-
-static const BitmapCharRec ch91 = {4,9,-2,0,8,ch91data};
-
-/* char: 0x5a 'Z' */
-
-static const GLubyte ch90data[] = {
-0xfc,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0xfc,
-};
-
-static const BitmapCharRec ch90 = {6,9,-1,0,8,ch90data};
-
-/* char: 0x59 'Y' */
-
-static const GLubyte ch89data[] = {
-0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch89 = {7,9,0,0,8,ch89data};
-
-/* char: 0x58 'X' */
-
-static const GLubyte ch88data[] = {
-0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch88 = {7,9,0,0,8,ch88data};
-
-/* char: 0x57 'W' */
-
-static const GLubyte ch87data[] = {
-0x44,0xaa,0x92,0x92,0x92,0x82,0x82,0x82,0x82,
-};
-
-static const BitmapCharRec ch87 = {7,9,0,0,8,ch87data};
-
-/* char: 0x56 'V' */
-
-static const GLubyte ch86data[] = {
-0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch86 = {7,9,0,0,8,ch86data};
-
-/* char: 0x55 'U' */
-
-static const GLubyte ch85data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data};
-
-/* char: 0x54 'T' */
-
-static const GLubyte ch84data[] = {
-0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe,
-};
-
-static const BitmapCharRec ch84 = {7,9,0,0,8,ch84data};
-
-/* char: 0x53 'S' */
-
-static const GLubyte ch83data[] = {
-0x78,0x84,0x4,0x4,0x78,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data};
-
-/* char: 0x52 'R' */
-
-static const GLubyte ch82data[] = {
-0x84,0x88,0x90,0xa0,0xf8,0x84,0x84,0x84,0xf8,
-};
-
-static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data};
-
-/* char: 0x51 'Q' */
-
-static const GLubyte ch81data[] = {
-0x4,0x78,0x94,0xa4,0x84,0x84,0x84,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch81 = {6,10,-1,1,8,ch81data};
-
-/* char: 0x50 'P' */
-
-static const GLubyte ch80data[] = {
-0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,
-};
-
-static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data};
-
-/* char: 0x4f 'O' */
-
-static const GLubyte ch79data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch79 = {6,9,-1,0,8,ch79data};
-
-/* char: 0x4e 'N' */
-
-static const GLubyte ch78data[] = {
-0x84,0x84,0x84,0x8c,0x94,0xa4,0xc4,0x84,0x84,
-};
-
-static const BitmapCharRec ch78 = {6,9,-1,0,8,ch78data};
-
-/* char: 0x4d 'M' */
-
-static const GLubyte ch77data[] = {
-0x82,0x82,0x82,0x92,0x92,0xaa,0xc6,0x82,0x82,
-};
-
-static const BitmapCharRec ch77 = {7,9,0,0,8,ch77data};
-
-/* char: 0x4c 'L' */
-
-static const GLubyte ch76data[] = {
-0xfc,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch76 = {6,9,-1,0,8,ch76data};
-
-/* char: 0x4b 'K' */
-
-static const GLubyte ch75data[] = {
-0x84,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x84,
-};
-
-static const BitmapCharRec ch75 = {6,9,-1,0,8,ch75data};
-
-/* char: 0x4a 'J' */
-
-static const GLubyte ch74data[] = {
-0x70,0x88,0x8,0x8,0x8,0x8,0x8,0x8,0x3c,
-};
-
-static const BitmapCharRec ch74 = {6,9,-1,0,8,ch74data};
-
-/* char: 0x49 'I' */
-
-static const GLubyte ch73data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,
-};
-
-static const BitmapCharRec ch73 = {5,9,-1,0,8,ch73data};
-
-/* char: 0x48 'H' */
-
-static const GLubyte ch72data[] = {
-0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch72 = {6,9,-1,0,8,ch72data};
-
-/* char: 0x47 'G' */
-
-static const GLubyte ch71data[] = {
-0x74,0x8c,0x84,0x9c,0x80,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch71 = {6,9,-1,0,8,ch71data};
-
-/* char: 0x46 'F' */
-
-static const GLubyte ch70data[] = {
-0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc,
-};
-
-static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data};
-
-/* char: 0x45 'E' */
-
-static const GLubyte ch69data[] = {
-0xfc,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc,
-};
-
-static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data};
-
-/* char: 0x44 'D' */
-
-static const GLubyte ch68data[] = {
-0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc,
-};
-
-static const BitmapCharRec ch68 = {7,9,0,0,8,ch68data};
-
-/* char: 0x43 'C' */
-
-static const GLubyte ch67data[] = {
-0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch67 = {6,9,-1,0,8,ch67data};
-
-/* char: 0x42 'B' */
-
-static const GLubyte ch66data[] = {
-0xfc,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc,
-};
-
-static const BitmapCharRec ch66 = {7,9,0,0,8,ch66data};
-
-/* char: 0x41 'A' */
-
-static const GLubyte ch65data[] = {
-0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x48,0x30,
-};
-
-static const BitmapCharRec ch65 = {6,9,-1,0,8,ch65data};
-
-/* char: 0x40 '@' */
-
-static const GLubyte ch64data[] = {
-0x78,0x80,0x94,0xac,0xa4,0x9c,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch64 = {6,9,-1,0,8,ch64data};
-
-/* char: 0x3f '?' */
-
-static const GLubyte ch63data[] = {
-0x10,0x0,0x10,0x10,0x8,0x4,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch63 = {6,9,-1,0,8,ch63data};
-
-/* char: 0x3e '>' */
-
-static const GLubyte ch62data[] = {
-0x80,0x40,0x20,0x10,0x8,0x10,0x20,0x40,0x80,
-};
-
-static const BitmapCharRec ch62 = {5,9,-1,0,8,ch62data};
-
-/* char: 0x3d '=' */
-
-static const GLubyte ch61data[] = {
-0xfc,0x0,0x0,0xfc,
-};
-
-static const BitmapCharRec ch61 = {6,4,-1,-2,8,ch61data};
-
-/* char: 0x3c '<' */
-
-static const GLubyte ch60data[] = {
-0x8,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x8,
-};
-
-static const BitmapCharRec ch60 = {5,9,-2,0,8,ch60data};
-
-/* char: 0x3b ';' */
-
-static const GLubyte ch59data[] = {
-0x80,0x60,0x70,0x0,0x0,0x20,0x70,0x20,
-};
-
-static const BitmapCharRec ch59 = {4,8,-1,1,8,ch59data};
-
-/* char: 0x3a ':' */
-
-static const GLubyte ch58data[] = {
-0x40,0xe0,0x40,0x0,0x0,0x40,0xe0,0x40,
-};
-
-static const BitmapCharRec ch58 = {3,8,-2,1,8,ch58data};
-
-/* char: 0x39 '9' */
-
-static const GLubyte ch57data[] = {
-0x70,0x8,0x4,0x4,0x74,0x8c,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch57 = {6,9,-1,0,8,ch57data};
-
-/* char: 0x38 '8' */
-
-static const GLubyte ch56data[] = {
-0x78,0x84,0x84,0x84,0x78,0x84,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch56 = {6,9,-1,0,8,ch56data};
-
-/* char: 0x37 '7' */
-
-static const GLubyte ch55data[] = {
-0x40,0x40,0x20,0x20,0x10,0x10,0x8,0x4,0xfc,
-};
-
-static const BitmapCharRec ch55 = {6,9,-1,0,8,ch55data};
-
-/* char: 0x36 '6' */
-
-static const GLubyte ch54data[] = {
-0x78,0x84,0x84,0xc4,0xb8,0x80,0x80,0x40,0x38,
-};
-
-static const BitmapCharRec ch54 = {6,9,-1,0,8,ch54data};
-
-/* char: 0x35 '5' */
-
-static const GLubyte ch53data[] = {
-0x78,0x84,0x4,0x4,0xc4,0xb8,0x80,0x80,0xfc,
-};
-
-static const BitmapCharRec ch53 = {6,9,-1,0,8,ch53data};
-
-/* char: 0x34 '4' */
-
-static const GLubyte ch52data[] = {
-0x8,0x8,0xfc,0x88,0x88,0x48,0x28,0x18,0x8,
-};
-
-static const BitmapCharRec ch52 = {6,9,-1,0,8,ch52data};
-
-/* char: 0x33 '3' */
-
-static const GLubyte ch51data[] = {
-0x78,0x84,0x4,0x4,0x38,0x10,0x8,0x4,0xfc,
-};
-
-static const BitmapCharRec ch51 = {6,9,-1,0,8,ch51data};
-
-/* char: 0x32 '2' */
-
-static const GLubyte ch50data[] = {
-0xfc,0x80,0x40,0x30,0x8,0x4,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch50 = {6,9,-1,0,8,ch50data};
-
-/* char: 0x31 '1' */
-
-static const GLubyte ch49data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20,
-};
-
-static const BitmapCharRec ch49 = {5,9,-1,0,8,ch49data};
-
-/* char: 0x30 '0' */
-
-static const GLubyte ch48data[] = {
-0x30,0x48,0x84,0x84,0x84,0x84,0x84,0x48,0x30,
-};
-
-static const BitmapCharRec ch48 = {6,9,-1,0,8,ch48data};
-
-/* char: 0x2f '/' */
-
-static const GLubyte ch47data[] = {
-0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x2,
-};
-
-static const BitmapCharRec ch47 = {7,9,0,0,8,ch47data};
-
-/* char: 0x2e '.' */
-
-static const GLubyte ch46data[] = {
-0x40,0xe0,0x40,
-};
-
-static const BitmapCharRec ch46 = {3,3,-2,1,8,ch46data};
-
-/* char: 0x2d '-' */
-
-static const GLubyte ch45data[] = {
-0xfc,
-};
-
-static const BitmapCharRec ch45 = {6,1,-1,-4,8,ch45data};
-
-/* char: 0x2c ',' */
-
-static const GLubyte ch44data[] = {
-0x80,0x60,0x70,
-};
-
-static const BitmapCharRec ch44 = {4,3,-1,1,8,ch44data};
-
-/* char: 0x2b '+' */
-
-static const GLubyte ch43data[] = {
-0x20,0x20,0xf8,0x20,0x20,
-};
-
-static const BitmapCharRec ch43 = {5,5,-1,-2,8,ch43data};
-
-/* char: 0x2a '*' */
-
-static const GLubyte ch42data[] = {
-0x48,0x30,0xfc,0x30,0x48,
-};
-
-static const BitmapCharRec ch42 = {6,5,-1,-2,8,ch42data};
-
-/* char: 0x29 ')' */
-
-static const GLubyte ch41data[] = {
-0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80,
-};
-
-static const BitmapCharRec ch41 = {3,9,-2,0,8,ch41data};
-
-/* char: 0x28 '(' */
-
-static const GLubyte ch40data[] = {
-0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20,
-};
-
-static const BitmapCharRec ch40 = {3,9,-3,0,8,ch40data};
-
-/* char: 0x27 ''' */
-
-static const GLubyte ch39data[] = {
-0x80,0x60,0x70,
-};
-
-static const BitmapCharRec ch39 = {4,3,-1,-6,8,ch39data};
-
-/* char: 0x26 '&' */
-
-static const GLubyte ch38data[] = {
-0x74,0x88,0x94,0x60,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch38 = {6,7,-1,0,8,ch38data};
-
-/* char: 0x25 '%' */
-
-static const GLubyte ch37data[] = {
-0x88,0x54,0x48,0x20,0x10,0x10,0x48,0xa4,0x44,
-};
-
-static const BitmapCharRec ch37 = {6,9,-1,0,8,ch37data};
-
-/* char: 0x24 '$' */
-
-static const GLubyte ch36data[] = {
-0x20,0xf0,0x28,0x70,0xa0,0x78,0x20,
-};
-
-static const BitmapCharRec ch36 = {5,7,-1,-1,8,ch36data};
-
-/* char: 0x23 '#' */
-
-static const GLubyte ch35data[] = {
-0x48,0x48,0xfc,0x48,0xfc,0x48,0x48,
-};
-
-static const BitmapCharRec ch35 = {6,7,-1,-1,8,ch35data};
-
-/* char: 0x22 '"' */
-
-static const GLubyte ch34data[] = {
-0x90,0x90,0x90,
-};
-
-static const BitmapCharRec ch34 = {4,3,-2,-6,8,ch34data};
-
-/* char: 0x21 '!' */
-
-static const GLubyte ch33data[] = {
-0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch33 = {1,9,-3,0,8,ch33data};
-
-/* char: 0x1f */
-
-static const GLubyte ch31data[] = {
-0x80,
-};
-
-static const BitmapCharRec ch31 = {1,1,-3,-3,8,ch31data};
-
-/* char: 0x1e */
-
-static const GLubyte ch30data[] = {
-0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c,
-};
-
-static const BitmapCharRec ch30 = {7,9,0,0,8,ch30data};
-
-/* char: 0x1d */
-
-static const GLubyte ch29data[] = {
-0x80,0x40,0xfe,0x10,0xfe,0x4,0x2,
-};
-
-static const BitmapCharRec ch29 = {7,7,0,0,8,ch29data};
-
-/* char: 0x1c */
-
-static const GLubyte ch28data[] = {
-0x88,0x48,0x48,0x48,0x48,0xfc,
-};
-
-static const BitmapCharRec ch28 = {6,6,-1,0,8,ch28data};
-
-/* char: 0x1b */
-
-static const GLubyte ch27data[] = {
-0xfe,0x80,0x20,0x8,0x2,0x8,0x20,0x80,
-};
-
-static const BitmapCharRec ch27 = {7,8,0,0,8,ch27data};
-
-/* char: 0x1a */
-
-static const GLubyte ch26data[] = {
-0xfe,0x2,0x8,0x20,0x80,0x20,0x8,0x2,
-};
-
-static const BitmapCharRec ch26 = {7,8,0,0,8,ch26data};
-
-/* char: 0x19 */
-
-static const GLubyte ch25data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch25 = {1,13,-3,2,8,ch25data};
-
-/* char: 0x18 */
-
-static const GLubyte ch24data[] = {
-0x10,0x10,0x10,0x10,0x10,0xff,
-};
-
-static const BitmapCharRec ch24 = {8,6,0,2,8,ch24data};
-
-/* char: 0x17 */
-
-static const GLubyte ch23data[] = {
-0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-};
-
-static const BitmapCharRec ch23 = {8,8,0,-3,8,ch23data};
-
-/* char: 0x16 */
-
-static const GLubyte ch22data[] = {
-0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-};
-
-static const BitmapCharRec ch22 = {4,13,0,2,8,ch22data};
-
-/* char: 0x15 */
-
-static const GLubyte ch21data[] = {
-0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch21 = {5,13,-3,2,8,ch21data};
-
-/* char: 0x14 */
-
-static const GLubyte ch20data[] = {
-0xff,
-};
-
-static const BitmapCharRec ch20 = {8,1,0,1,8,ch20data};
-
-/* char: 0x13 */
-
-static const GLubyte ch19data[] = {
-0xff,
-};
-
-static const BitmapCharRec ch19 = {8,1,0,-1,8,ch19data};
-
-/* char: 0x12 */
-
-static const GLubyte ch18data[] = {
-0xff,
-};
-
-static const BitmapCharRec ch18 = {8,1,0,-3,8,ch18data};
-
-/* char: 0x11 */
-
-static const GLubyte ch17data[] = {
-0xff,
-};
-
-static const BitmapCharRec ch17 = {8,1,0,-5,8,ch17data};
-
-/* char: 0x10 */
-
-static const GLubyte ch16data[] = {
-0xff,
-};
-
-static const BitmapCharRec ch16 = {8,1,0,-7,8,ch16data};
-
-/* char: 0xf */
-
-static const GLubyte ch15data[] = {
-0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-};
-
-static const BitmapCharRec ch15 = {8,13,0,2,8,ch15data};
-
-/* char: 0xe */
-
-static const GLubyte ch14data[] = {
-0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch14 = {5,8,-3,-3,8,ch14data};
-
-/* char: 0xd */
-
-static const GLubyte ch13data[] = {
-0x80,0x80,0x80,0x80,0x80,0xf8,
-};
-
-static const BitmapCharRec ch13 = {5,6,-3,2,8,ch13data};
-
-/* char: 0xc */
-
-static const GLubyte ch12data[] = {
-0x10,0x10,0x10,0x10,0x10,0xf0,
-};
-
-static const BitmapCharRec ch12 = {4,6,0,2,8,ch12data};
-
-/* char: 0xb */
-
-static const GLubyte ch11data[] = {
-0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-};
-
-static const BitmapCharRec ch11 = {4,8,0,-3,8,ch11data};
-
-/* char: 0xa */
-
-static const GLubyte ch10data[] = {
-0x8,0x8,0x8,0x8,0x3e,0x20,0x50,0x88,0x88,
-};
-
-static const BitmapCharRec ch10 = {7,9,0,2,8,ch10data};
-
-/* char: 0x9 */
-
-static const GLubyte ch9data[] = {
-0x3e,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88,
-};
-
-static const BitmapCharRec ch9 = {7,9,0,2,8,ch9data};
-
-/* char: 0x8 */
-
-static const GLubyte ch8data[] = {
-0xfe,0x10,0x10,0xfe,0x10,0x10,
-};
-
-static const BitmapCharRec ch8 = {7,6,0,0,8,ch8data};
-
-/* char: 0x7 */
-
-static const GLubyte ch7data[] = {
-0x70,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch7 = {5,4,-1,-5,8,ch7data};
-
-/* char: 0x6 */
-
-static const GLubyte ch6data[] = {
-0x20,0x20,0x3c,0x20,0x3e,0xf8,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch6 = {7,9,0,2,8,ch6data};
-
-/* char: 0x5 */
-
-static const GLubyte ch5data[] = {
-0x22,0x22,0x3c,0x22,0x3c,0x78,0x80,0x80,0x78,
-};
-
-static const BitmapCharRec ch5 = {7,9,0,2,8,ch5data};
-
-/* char: 0x4 */
-
-static const GLubyte ch4data[] = {
-0x10,0x10,0x1c,0x10,0x9e,0x80,0xe0,0x80,0xf0,
-};
-
-static const BitmapCharRec ch4 = {7,9,0,2,8,ch4data};
-
-/* char: 0x3 */
-
-static const GLubyte ch3data[] = {
-0x8,0x8,0x8,0x3e,0x88,0x88,0xf8,0x88,0x88,
-};
-
-static const BitmapCharRec ch3 = {7,9,0,2,8,ch3data};
-
-/* char: 0x2 */
-
-static const GLubyte ch2data[] = {
-0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
-};
-
-static const BitmapCharRec ch2 = {8,12,0,2,8,ch2data};
-
-/* char: 0x1 */
-
-static const GLubyte ch1data[] = {
-0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,
-};
-
-static const BitmapCharRec ch1 = {7,7,0,-1,8,ch1data};
-
-static const BitmapCharRec * const chars[] = {
-&ch0,
-&ch1,
-&ch2,
-&ch3,
-&ch4,
-&ch5,
-&ch6,
-&ch7,
-&ch8,
-&ch9,
-&ch10,
-&ch11,
-&ch12,
-&ch13,
-&ch14,
-&ch15,
-&ch16,
-&ch17,
-&ch18,
-&ch19,
-&ch20,
-&ch21,
-&ch22,
-&ch23,
-&ch24,
-&ch25,
-&ch26,
-&ch27,
-&ch28,
-&ch29,
-&ch30,
-&ch31,
-&ch32,
-&ch33,
-&ch34,
-&ch35,
-&ch36,
-&ch37,
-&ch38,
-&ch39,
-&ch40,
-&ch41,
-&ch42,
-&ch43,
-&ch44,
-&ch45,
-&ch46,
-&ch47,
-&ch48,
-&ch49,
-&ch50,
-&ch51,
-&ch52,
-&ch53,
-&ch54,
-&ch55,
-&ch56,
-&ch57,
-&ch58,
-&ch59,
-&ch60,
-&ch61,
-&ch62,
-&ch63,
-&ch64,
-&ch65,
-&ch66,
-&ch67,
-&ch68,
-&ch69,
-&ch70,
-&ch71,
-&ch72,
-&ch73,
-&ch74,
-&ch75,
-&ch76,
-&ch77,
-&ch78,
-&ch79,
-&ch80,
-&ch81,
-&ch82,
-&ch83,
-&ch84,
-&ch85,
-&ch86,
-&ch87,
-&ch88,
-&ch89,
-&ch90,
-&ch91,
-&ch92,
-&ch93,
-&ch94,
-&ch95,
-&ch96,
-&ch97,
-&ch98,
-&ch99,
-&ch100,
-&ch101,
-&ch102,
-&ch103,
-&ch104,
-&ch105,
-&ch106,
-&ch107,
-&ch108,
-&ch109,
-&ch110,
-&ch111,
-&ch112,
-&ch113,
-&ch114,
-&ch115,
-&ch116,
-&ch117,
-&ch118,
-&ch119,
-&ch120,
-&ch121,
-&ch122,
-&ch123,
-&ch124,
-&ch125,
-&ch126,
-&ch127,
-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,
-&ch160,
-&ch161,
-&ch162,
-&ch163,
-&ch164,
-&ch165,
-&ch166,
-&ch167,
-&ch168,
-&ch169,
-&ch170,
-&ch171,
-&ch172,
-&ch173,
-&ch174,
-&ch175,
-&ch176,
-&ch177,
-&ch178,
-&ch179,
-&ch180,
-&ch181,
-&ch182,
-&ch183,
-&ch184,
-&ch185,
-&ch186,
-&ch187,
-&ch188,
-&ch189,
-&ch190,
-&ch191,
-&ch192,
-&ch193,
-&ch194,
-&ch195,
-&ch196,
-&ch197,
-&ch198,
-&ch199,
-&ch200,
-&ch201,
-&ch202,
-&ch203,
-&ch204,
-&ch205,
-&ch206,
-&ch207,
-&ch208,
-&ch209,
-&ch210,
-&ch211,
-&ch212,
-&ch213,
-&ch214,
-&ch215,
-&ch216,
-&ch217,
-&ch218,
-&ch219,
-&ch220,
-&ch221,
-&ch222,
-&ch223,
-&ch224,
-&ch225,
-&ch226,
-&ch227,
-&ch228,
-&ch229,
-&ch230,
-&ch231,
-&ch232,
-&ch233,
-&ch234,
-&ch235,
-&ch236,
-&ch237,
-&ch238,
-&ch239,
-&ch240,
-&ch241,
-&ch242,
-&ch243,
-&ch244,
-&ch245,
-&ch246,
-&ch247,
-&ch248,
-&ch249,
-&ch250,
-&ch251,
-&ch252,
-&ch253,
-&ch254,
-&ch255,
-};
-
-#if !defined(__IBMCPP__)
-const
-#endif
-BitmapFontRec glutBitmap8By13 = {
-"-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1",
-256,
-0,
-chars
-};
-
diff --git a/src/glut/os2/glut_9x15.cpp b/src/glut/os2/glut_9x15.cpp
deleted file mode 100644
index a3a02a4c5ff..00000000000
--- a/src/glut/os2/glut_9x15.cpp
+++ /dev/null
@@ -1,2077 +0,0 @@
-
-/* GENERATED FILE -- DO NOT MODIFY */
-
-#define glutBitmap9By15 XXX
-#include "glutbitmap.h"
-#undef glutBitmap9By15
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch0data[] = { 0x0 };
-static const BitmapCharRec ch0 = {1,1,0,0,9,ch0data};
-#else
-static const BitmapCharRec ch0 = {0,0,0,0,9,0};
-#endif
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch32data[] = { 0x0 };
-static const BitmapCharRec ch32 = {1,1,0,0,9,ch32data};
-#else
-static const BitmapCharRec ch32 = {0,0,0,0,9,0};
-#endif
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch127data[] = { 0x0 };
-static const BitmapCharRec ch127 = {1,1,0,0,9,ch127data};
-#else
-static const BitmapCharRec ch127 = {0,0,0,0,9,0};
-#endif
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch160data[] = { 0x0 };
-static const BitmapCharRec ch160 = {1,1,0,0,9,ch160data};
-#else
-static const BitmapCharRec ch160 = {0,0,0,0,9,0};
-#endif
-
-/* char: 0xff */
-
-static const GLubyte ch255data[] = {
-0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch255 = {6,14,-1,3,9,ch255data};
-
-/* char: 0xfe */
-
-static const GLubyte ch254data[] = {
-0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,
-};
-
-static const BitmapCharRec ch254 = {7,12,-1,3,9,ch254data};
-
-/* char: 0xfd */
-
-static const GLubyte ch253data[] = {
-0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch253 = {6,14,-1,3,9,ch253data};
-
-/* char: 0xfc */
-
-static const GLubyte ch252data[] = {
-0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch252 = {7,11,-1,0,9,ch252data};
-
-/* char: 0xfb */
-
-static const GLubyte ch251data[] = {
-0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch251 = {7,11,-1,0,9,ch251data};
-
-/* char: 0xfa */
-
-static const GLubyte ch250data[] = {
-0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch250 = {7,11,-1,0,9,ch250data};
-
-/* char: 0xf9 */
-
-static const GLubyte ch249data[] = {
-0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch249 = {7,11,-1,0,9,ch249data};
-
-/* char: 0xf8 */
-
-static const GLubyte ch248data[] = {
-0x80,0x7c,0xa2,0xa2,0x92,0x8a,0x8a,0x7c,0x2,
-};
-
-static const BitmapCharRec ch248 = {7,9,-1,1,9,ch248data};
-
-/* char: 0xf7 */
-
-static const GLubyte ch247data[] = {
-0x10,0x38,0x10,0x0,0xfe,0x0,0x10,0x38,0x10,
-};
-
-static const BitmapCharRec ch247 = {7,9,-1,0,9,ch247data};
-
-/* char: 0xf6 */
-
-static const GLubyte ch246data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch246 = {7,11,-1,0,9,ch246data};
-
-/* char: 0xf5 */
-
-static const GLubyte ch245data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch245 = {7,11,-1,0,9,ch245data};
-
-/* char: 0xf4 */
-
-static const GLubyte ch244data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch244 = {7,11,-1,0,9,ch244data};
-
-/* char: 0xf3 */
-
-static const GLubyte ch243data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch243 = {7,11,-1,0,9,ch243data};
-
-/* char: 0xf2 */
-
-static const GLubyte ch242data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch242 = {7,11,-1,0,9,ch242data};
-
-/* char: 0xf1 */
-
-static const GLubyte ch241data[] = {
-0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x0,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch241 = {7,11,-1,0,9,ch241data};
-
-/* char: 0xf0 */
-
-static const GLubyte ch240data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x8,0x50,0x30,0x48,
-};
-
-static const BitmapCharRec ch240 = {7,11,-1,0,9,ch240data};
-
-/* char: 0xef */
-
-static const GLubyte ch239data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x50,0x50,
-};
-
-static const BitmapCharRec ch239 = {5,11,-2,0,9,ch239data};
-
-/* char: 0xee */
-
-static const GLubyte ch238data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x90,0x60,
-};
-
-static const BitmapCharRec ch238 = {5,11,-2,0,9,ch238data};
-
-/* char: 0xed */
-
-static const GLubyte ch237data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60,0x10,
-};
-
-static const BitmapCharRec ch237 = {5,11,-2,0,9,ch237data};
-
-/* char: 0xec */
-
-static const GLubyte ch236data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x30,0x40,
-};
-
-static const BitmapCharRec ch236 = {5,11,-2,0,9,ch236data};
-
-/* char: 0xeb */
-
-static const GLubyte ch235data[] = {
-0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch235 = {7,11,-1,0,9,ch235data};
-
-/* char: 0xea */
-
-static const GLubyte ch234data[] = {
-0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch234 = {7,11,-1,0,9,ch234data};
-
-/* char: 0xe9 */
-
-static const GLubyte ch233data[] = {
-0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch233 = {7,11,-1,0,9,ch233data};
-
-/* char: 0xe8 */
-
-static const GLubyte ch232data[] = {
-0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch232 = {7,11,-1,0,9,ch232data};
-
-/* char: 0xe7 */
-
-static const GLubyte ch231data[] = {
-0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x82,0x7c,
-};
-
-static const BitmapCharRec ch231 = {7,10,-1,3,9,ch231data};
-
-/* char: 0xe6 */
-
-static const GLubyte ch230data[] = {
-0x6e,0x92,0x90,0x7c,0x12,0x92,0x6c,
-};
-
-static const BitmapCharRec ch230 = {7,7,-1,0,9,ch230data};
-
-/* char: 0xe5 */
-
-static const GLubyte ch229data[] = {
-0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x18,0x24,0x18,
-};
-
-static const BitmapCharRec ch229 = {7,11,-1,0,9,ch229data};
-
-/* char: 0xe4 */
-
-static const GLubyte ch228data[] = {
-0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch228 = {7,11,-1,0,9,ch228data};
-
-/* char: 0xe3 */
-
-static const GLubyte ch227data[] = {
-0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch227 = {7,11,-1,0,9,ch227data};
-
-/* char: 0xe2 */
-
-static const GLubyte ch226data[] = {
-0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch226 = {7,11,-1,0,9,ch226data};
-
-/* char: 0xe1 */
-
-static const GLubyte ch225data[] = {
-0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch225 = {7,11,-1,0,9,ch225data};
-
-/* char: 0xe0 */
-
-static const GLubyte ch224data[] = {
-0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch224 = {7,11,-1,0,9,ch224data};
-
-/* char: 0xdf */
-
-static const GLubyte ch223data[] = {
-0x80,0xbc,0xc2,0x82,0x82,0xfc,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch223 = {7,9,-1,1,9,ch223data};
-
-/* char: 0xde */
-
-static const GLubyte ch222data[] = {
-0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc,0x80,0x80,
-};
-
-static const BitmapCharRec ch222 = {7,10,-1,0,9,ch222data};
-
-/* char: 0xdd */
-
-static const GLubyte ch221data[] = {
-0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch221 = {7,11,-1,0,9,ch221data};
-
-/* char: 0xdc */
-
-static const GLubyte ch220data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch220 = {7,11,-1,0,9,ch220data};
-
-/* char: 0xdb */
-
-static const GLubyte ch219data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch219 = {7,11,-1,0,9,ch219data};
-
-/* char: 0xda */
-
-static const GLubyte ch218data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch218 = {7,11,-1,0,9,ch218data};
-
-/* char: 0xd9 */
-
-static const GLubyte ch217data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch217 = {7,11,-1,0,9,ch217data};
-
-/* char: 0xd8 */
-
-static const GLubyte ch216data[] = {
-0x80,0x7c,0xc2,0xa2,0xa2,0x92,0x92,0x8a,0x8a,0x86,0x7c,0x2,
-};
-
-static const BitmapCharRec ch216 = {7,12,-1,1,9,ch216data};
-
-/* char: 0xd7 */
-
-static const GLubyte ch215data[] = {
-0x82,0x44,0x28,0x10,0x28,0x44,0x82,
-};
-
-static const BitmapCharRec ch215 = {7,7,-1,-1,9,ch215data};
-
-/* char: 0xd6 */
-
-static const GLubyte ch214data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch214 = {7,11,-1,0,9,ch214data};
-
-/* char: 0xd5 */
-
-static const GLubyte ch213data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch213 = {7,11,-1,0,9,ch213data};
-
-/* char: 0xd4 */
-
-static const GLubyte ch212data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch212 = {7,11,-1,0,9,ch212data};
-
-/* char: 0xd3 */
-
-static const GLubyte ch211data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch211 = {7,11,-1,0,9,ch211data};
-
-/* char: 0xd2 */
-
-static const GLubyte ch210data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch210 = {7,11,-1,0,9,ch210data};
-
-/* char: 0xd1 */
-
-static const GLubyte ch209data[] = {
-0x82,0x86,0x8a,0x92,0x92,0xa2,0xc2,0x82,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch209 = {7,11,-1,0,9,ch209data};
-
-/* char: 0xd0 */
-
-static const GLubyte ch208data[] = {
-0xfc,0x42,0x42,0x42,0x42,0xf2,0x42,0x42,0x42,0xfc,
-};
-
-static const BitmapCharRec ch208 = {7,10,-1,0,9,ch208data};
-
-/* char: 0xcf */
-
-static const GLubyte ch207data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50,
-};
-
-static const BitmapCharRec ch207 = {5,11,-2,0,9,ch207data};
-
-/* char: 0xce */
-
-static const GLubyte ch206data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x88,0x70,
-};
-
-static const BitmapCharRec ch206 = {5,11,-2,0,9,ch206data};
-
-/* char: 0xcd */
-
-static const GLubyte ch205data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x60,0x10,
-};
-
-static const BitmapCharRec ch205 = {5,11,-2,0,9,ch205data};
-
-/* char: 0xcc */
-
-static const GLubyte ch204data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x30,0x40,
-};
-
-static const BitmapCharRec ch204 = {5,11,-2,0,9,ch204data};
-
-/* char: 0xcb */
-
-static const GLubyte ch203data[] = {
-0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch203 = {7,11,-1,0,9,ch203data};
-
-/* char: 0xca */
-
-static const GLubyte ch202data[] = {
-0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch202 = {7,11,-1,0,9,ch202data};
-
-/* char: 0xc9 */
-
-static const GLubyte ch201data[] = {
-0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch201 = {7,11,-1,0,9,ch201data};
-
-/* char: 0xc8 */
-
-static const GLubyte ch200data[] = {
-0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch200 = {7,11,-1,0,9,ch200data};
-
-/* char: 0xc7 */
-
-static const GLubyte ch199data[] = {
-0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c,
-};
-
-static const BitmapCharRec ch199 = {7,13,-1,3,9,ch199data};
-
-/* char: 0xc6 */
-
-static const GLubyte ch198data[] = {
-0x9e,0x90,0x90,0x90,0xfc,0x90,0x90,0x90,0x90,0x6e,
-};
-
-static const BitmapCharRec ch198 = {7,10,-1,0,9,ch198data};
-
-/* char: 0xc5 */
-
-static const GLubyte ch197data[] = {
-0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x10,0x28,0x10,
-};
-
-static const BitmapCharRec ch197 = {7,11,-1,0,9,ch197data};
-
-/* char: 0xc4 */
-
-static const GLubyte ch196data[] = {
-0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x28,0x28,
-};
-
-static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data};
-
-/* char: 0xc3 */
-
-static const GLubyte ch195data[] = {
-0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch195 = {7,11,-1,0,9,ch195data};
-
-/* char: 0xc2 */
-
-static const GLubyte ch194data[] = {
-0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x44,0x38,
-};
-
-static const BitmapCharRec ch194 = {7,11,-1,0,9,ch194data};
-
-/* char: 0xc1 */
-
-static const GLubyte ch193data[] = {
-0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x30,0x8,
-};
-
-static const BitmapCharRec ch193 = {7,11,-1,0,9,ch193data};
-
-/* char: 0xc0 */
-
-static const GLubyte ch192data[] = {
-0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x18,0x20,
-};
-
-static const BitmapCharRec ch192 = {7,11,-1,0,9,ch192data};
-
-/* char: 0xbf */
-
-static const GLubyte ch191data[] = {
-0x7c,0x82,0x82,0x80,0x40,0x20,0x10,0x10,0x0,0x10,
-};
-
-static const BitmapCharRec ch191 = {7,10,-1,0,9,ch191data};
-
-/* char: 0xbe */
-
-static const GLubyte ch190data[] = {
-0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60,
-};
-
-static const BitmapCharRec ch190 = {7,10,-1,0,9,ch190data};
-
-/* char: 0xbd */
-
-static const GLubyte ch189data[] = {
-0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch189 = {7,10,-1,0,9,ch189data};
-
-/* char: 0xbc */
-
-static const GLubyte ch188data[] = {
-0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch188 = {7,10,-1,0,9,ch188data};
-
-/* char: 0xbb */
-
-static const GLubyte ch187data[] = {
-0x90,0x48,0x24,0x12,0x12,0x24,0x48,0x90,
-};
-
-static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data};
-
-/* char: 0xba */
-
-static const GLubyte ch186data[] = {
-0xf8,0x0,0x70,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch186 = {5,6,-1,-5,9,ch186data};
-
-/* char: 0xb9 */
-
-static const GLubyte ch185data[] = {
-0xe0,0x40,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch185 = {3,6,-1,-4,9,ch185data};
-
-/* char: 0xb8 */
-
-static const GLubyte ch184data[] = {
-0x60,0x90,0x30,
-};
-
-static const BitmapCharRec ch184 = {4,3,-2,3,9,ch184data};
-
-/* char: 0xb7 */
-
-static const GLubyte ch183data[] = {
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch183 = {2,2,-4,-4,9,ch183data};
-
-/* char: 0xb6 */
-
-static const GLubyte ch182data[] = {
-0xa,0xa,0xa,0xa,0xa,0x7a,0x8a,0x8a,0x8a,0x7e,
-};
-
-static const BitmapCharRec ch182 = {7,10,-1,0,9,ch182data};
-
-/* char: 0xb5 */
-
-static const GLubyte ch181data[] = {
-0x80,0x80,0xba,0xc6,0x82,0x82,0x82,0x82,0x82,
-};
-
-static const BitmapCharRec ch181 = {7,9,-1,2,9,ch181data};
-
-/* char: 0xb4 */
-
-static const GLubyte ch180data[] = {
-0xc0,0x20,
-};
-
-static const BitmapCharRec ch180 = {3,2,-3,-9,9,ch180data};
-
-/* char: 0xb3 */
-
-static const GLubyte ch179data[] = {
-0x60,0x90,0x10,0x20,0x90,0x60,
-};
-
-static const BitmapCharRec ch179 = {4,6,-1,-4,9,ch179data};
-
-/* char: 0xb2 */
-
-static const GLubyte ch178data[] = {
-0xf0,0x80,0x60,0x10,0x90,0x60,
-};
-
-static const BitmapCharRec ch178 = {4,6,-1,-4,9,ch178data};
-
-/* char: 0xb1 */
-
-static const GLubyte ch177data[] = {
-0xfe,0x0,0x10,0x10,0x10,0xfe,0x10,0x10,0x10,
-};
-
-static const BitmapCharRec ch177 = {7,9,-1,-1,9,ch177data};
-
-/* char: 0xb0 */
-
-static const GLubyte ch176data[] = {
-0x60,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch176 = {4,4,-3,-6,9,ch176data};
-
-/* char: 0xaf */
-
-static const GLubyte ch175data[] = {
-0xfc,
-};
-
-static const BitmapCharRec ch175 = {6,1,-1,-9,9,ch175data};
-
-/* char: 0xae */
-
-static const GLubyte ch174data[] = {
-0x3c,0x42,0xa5,0xa9,0xbd,0xa5,0xb9,0x42,0x3c,
-};
-
-static const BitmapCharRec ch174 = {8,9,0,-1,9,ch174data};
-
-/* char: 0xad */
-
-static const GLubyte ch173data[] = {
-0xfc,
-};
-
-static const BitmapCharRec ch173 = {6,1,-1,-4,9,ch173data};
-
-/* char: 0xac */
-
-static const GLubyte ch172data[] = {
-0x4,0x4,0x4,0xfc,
-};
-
-static const BitmapCharRec ch172 = {6,4,-1,-2,9,ch172data};
-
-/* char: 0xab */
-
-static const GLubyte ch171data[] = {
-0x12,0x24,0x48,0x90,0x90,0x48,0x24,0x12,
-};
-
-static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data};
-
-/* char: 0xaa */
-
-static const GLubyte ch170data[] = {
-0xf8,0x0,0x78,0x90,0x70,0x90,0x60,
-};
-
-static const BitmapCharRec ch170 = {5,7,-3,-3,9,ch170data};
-
-/* char: 0xa9 */
-
-static const GLubyte ch169data[] = {
-0x3c,0x42,0x99,0xa5,0xa1,0xa5,0x99,0x42,0x3c,
-};
-
-static const BitmapCharRec ch169 = {8,9,0,-1,9,ch169data};
-
-/* char: 0xa8 */
-
-static const GLubyte ch168data[] = {
-0xa0,0xa0,
-};
-
-static const BitmapCharRec ch168 = {3,2,-3,-9,9,ch168data};
-
-/* char: 0xa7 */
-
-static const GLubyte ch167data[] = {
-0x70,0x88,0x8,0x70,0x88,0x88,0x88,0x70,0x80,0x88,0x70,
-};
-
-static const BitmapCharRec ch167 = {5,11,-2,1,9,ch167data};
-
-/* char: 0xa6 */
-
-static const GLubyte ch166data[] = {
-0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch166 = {1,11,-4,1,9,ch166data};
-
-/* char: 0xa5 */
-
-static const GLubyte ch165data[] = {
-0x10,0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch165 = {7,10,-1,0,9,ch165data};
-
-/* char: 0xa4 */
-
-static const GLubyte ch164data[] = {
-0x82,0x7c,0x44,0x44,0x7c,0x82,
-};
-
-static const BitmapCharRec ch164 = {7,6,-1,-3,9,ch164data};
-
-/* char: 0xa3 */
-
-static const GLubyte ch163data[] = {
-0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c,
-};
-
-static const BitmapCharRec ch163 = {7,10,-1,0,9,ch163data};
-
-/* char: 0xa2 */
-
-static const GLubyte ch162data[] = {
-0x40,0x78,0xa4,0xa0,0x90,0x94,0x78,0x8,
-};
-
-static const BitmapCharRec ch162 = {6,8,-1,0,9,ch162data};
-
-/* char: 0xa1 */
-
-static const GLubyte ch161data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,
-};
-
-static const BitmapCharRec ch161 = {1,11,-4,0,9,ch161data};
-
-/* char: 0x7e '~' */
-
-static const GLubyte ch126data[] = {
-0x8c,0x92,0x62,
-};
-
-static const BitmapCharRec ch126 = {7,3,-1,-7,9,ch126data};
-
-/* char: 0x7d '}' */
-
-static const GLubyte ch125data[] = {
-0xe0,0x10,0x10,0x10,0x20,0x18,0x18,0x20,0x10,0x10,0x10,0xe0,
-};
-
-static const BitmapCharRec ch125 = {5,12,-1,1,9,ch125data};
-
-/* char: 0x7c '|' */
-
-static const GLubyte ch124data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch124 = {1,12,-4,1,9,ch124data};
-
-/* char: 0x7b '{' */
-
-static const GLubyte ch123data[] = {
-0x38,0x40,0x40,0x40,0x20,0xc0,0xc0,0x20,0x40,0x40,0x40,0x38,
-};
-
-static const BitmapCharRec ch123 = {5,12,-3,1,9,ch123data};
-
-/* char: 0x7a 'z' */
-
-static const GLubyte ch122data[] = {
-0xfe,0x40,0x20,0x10,0x8,0x4,0xfe,
-};
-
-static const BitmapCharRec ch122 = {7,7,-1,0,9,ch122data};
-
-/* char: 0x79 'y' */
-
-static const GLubyte ch121data[] = {
-0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch121 = {6,10,-1,3,9,ch121data};
-
-/* char: 0x78 'x' */
-
-static const GLubyte ch120data[] = {
-0x82,0x44,0x28,0x10,0x28,0x44,0x82,
-};
-
-static const BitmapCharRec ch120 = {7,7,-1,0,9,ch120data};
-
-/* char: 0x77 'w' */
-
-static const GLubyte ch119data[] = {
-0x44,0xaa,0x92,0x92,0x92,0x82,0x82,
-};
-
-static const BitmapCharRec ch119 = {7,7,-1,0,9,ch119data};
-
-/* char: 0x76 'v' */
-
-static const GLubyte ch118data[] = {
-0x10,0x28,0x28,0x44,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch118 = {7,7,-1,0,9,ch118data};
-
-/* char: 0x75 'u' */
-
-static const GLubyte ch117data[] = {
-0x7a,0x84,0x84,0x84,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch117 = {7,7,-1,0,9,ch117data};
-
-/* char: 0x74 't' */
-
-static const GLubyte ch116data[] = {
-0x1c,0x22,0x20,0x20,0x20,0x20,0xfc,0x20,0x20,
-};
-
-static const BitmapCharRec ch116 = {7,9,-1,0,9,ch116data};
-
-/* char: 0x73 's' */
-
-static const GLubyte ch115data[] = {
-0x7c,0x82,0x2,0x7c,0x80,0x82,0x7c,
-};
-
-static const BitmapCharRec ch115 = {7,7,-1,0,9,ch115data};
-
-/* char: 0x72 'r' */
-
-static const GLubyte ch114data[] = {
-0x40,0x40,0x40,0x40,0x42,0x62,0x9c,
-};
-
-static const BitmapCharRec ch114 = {7,7,-1,0,9,ch114data};
-
-/* char: 0x71 'q' */
-
-static const GLubyte ch113data[] = {
-0x2,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x86,0x7a,
-};
-
-static const BitmapCharRec ch113 = {7,10,-1,3,9,ch113data};
-
-/* char: 0x70 'p' */
-
-static const GLubyte ch112data[] = {
-0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,
-};
-
-static const BitmapCharRec ch112 = {7,10,-1,3,9,ch112data};
-
-/* char: 0x6f 'o' */
-
-static const GLubyte ch111data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch111 = {7,7,-1,0,9,ch111data};
-
-/* char: 0x6e 'n' */
-
-static const GLubyte ch110data[] = {
-0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,
-};
-
-static const BitmapCharRec ch110 = {7,7,-1,0,9,ch110data};
-
-/* char: 0x6d 'm' */
-
-static const GLubyte ch109data[] = {
-0x82,0x92,0x92,0x92,0x92,0x92,0xec,
-};
-
-static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data};
-
-/* char: 0x6c 'l' */
-
-static const GLubyte ch108data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,
-};
-
-static const BitmapCharRec ch108 = {5,10,-2,0,9,ch108data};
-
-/* char: 0x6b 'k' */
-
-static const GLubyte ch107data[] = {
-0x82,0x8c,0xb0,0xc0,0xb0,0x8c,0x82,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch107 = {7,10,-1,0,9,ch107data};
-
-/* char: 0x6a 'j' */
-
-static const GLubyte ch106data[] = {
-0x78,0x84,0x84,0x84,0x4,0x4,0x4,0x4,0x4,0x1c,0x0,0x0,0xc,
-};
-
-static const BitmapCharRec ch106 = {6,13,-1,3,9,ch106data};
-
-/* char: 0x69 'i' */
-
-static const GLubyte ch105data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60,
-};
-
-static const BitmapCharRec ch105 = {5,10,-2,0,9,ch105data};
-
-/* char: 0x68 'h' */
-
-static const GLubyte ch104data[] = {
-0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch104 = {7,10,-1,0,9,ch104data};
-
-/* char: 0x67 'g' */
-
-static const GLubyte ch103data[] = {
-0x7c,0x82,0x82,0x7c,0x80,0x78,0x84,0x84,0x84,0x7a,
-};
-
-static const BitmapCharRec ch103 = {7,10,-1,3,9,ch103data};
-
-/* char: 0x66 'f' */
-
-static const GLubyte ch102data[] = {
-0x20,0x20,0x20,0x20,0xf8,0x20,0x20,0x22,0x22,0x1c,
-};
-
-static const BitmapCharRec ch102 = {7,10,-1,0,9,ch102data};
-
-/* char: 0x65 'e' */
-
-static const GLubyte ch101data[] = {
-0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch101 = {7,7,-1,0,9,ch101data};
-
-/* char: 0x64 'd' */
-
-static const GLubyte ch100data[] = {
-0x7a,0x86,0x82,0x82,0x82,0x86,0x7a,0x2,0x2,0x2,
-};
-
-static const BitmapCharRec ch100 = {7,10,-1,0,9,ch100data};
-
-/* char: 0x63 'c' */
-
-static const GLubyte ch99data[] = {
-0x7c,0x82,0x80,0x80,0x80,0x82,0x7c,
-};
-
-static const BitmapCharRec ch99 = {7,7,-1,0,9,ch99data};
-
-/* char: 0x62 'b' */
-
-static const GLubyte ch98data[] = {
-0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch98 = {7,10,-1,0,9,ch98data};
-
-/* char: 0x61 'a' */
-
-static const GLubyte ch97data[] = {
-0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,
-};
-
-static const BitmapCharRec ch97 = {7,7,-1,0,9,ch97data};
-
-/* char: 0x60 '`' */
-
-static const GLubyte ch96data[] = {
-0x10,0x20,0x40,0xc0,
-};
-
-static const BitmapCharRec ch96 = {4,4,-3,-6,9,ch96data};
-
-/* char: 0x5f '_' */
-
-static const GLubyte ch95data[] = {
-0xff,
-};
-
-static const BitmapCharRec ch95 = {8,1,0,1,9,ch95data};
-
-/* char: 0x5e '^' */
-
-static const GLubyte ch94data[] = {
-0x82,0x44,0x28,0x10,
-};
-
-static const BitmapCharRec ch94 = {7,4,-1,-6,9,ch94data};
-
-/* char: 0x5d ']' */
-
-static const GLubyte ch93data[] = {
-0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0,
-};
-
-static const BitmapCharRec ch93 = {4,12,-2,1,9,ch93data};
-
-/* char: 0x5c '\' */
-
-static const GLubyte ch92data[] = {
-0x2,0x4,0x4,0x8,0x10,0x10,0x20,0x40,0x40,0x80,
-};
-
-static const BitmapCharRec ch92 = {7,10,-1,0,9,ch92data};
-
-/* char: 0x5b '[' */
-
-static const GLubyte ch91data[] = {
-0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0,
-};
-
-static const BitmapCharRec ch91 = {4,12,-3,1,9,ch91data};
-
-/* char: 0x5a 'Z' */
-
-static const GLubyte ch90data[] = {
-0xfe,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe,
-};
-
-static const BitmapCharRec ch90 = {7,10,-1,0,9,ch90data};
-
-/* char: 0x59 'Y' */
-
-static const GLubyte ch89data[] = {
-0x10,0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch89 = {7,10,-1,0,9,ch89data};
-
-/* char: 0x58 'X' */
-
-static const GLubyte ch88data[] = {
-0x82,0x82,0x44,0x28,0x10,0x10,0x28,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch88 = {7,10,-1,0,9,ch88data};
-
-/* char: 0x57 'W' */
-
-static const GLubyte ch87data[] = {
-0x44,0xaa,0x92,0x92,0x92,0x92,0x82,0x82,0x82,0x82,
-};
-
-static const BitmapCharRec ch87 = {7,10,-1,0,9,ch87data};
-
-/* char: 0x56 'V' */
-
-static const GLubyte ch86data[] = {
-0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,0x82,
-};
-
-static const BitmapCharRec ch86 = {7,10,-1,0,9,ch86data};
-
-/* char: 0x55 'U' */
-
-static const GLubyte ch85data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,
-};
-
-static const BitmapCharRec ch85 = {7,10,-1,0,9,ch85data};
-
-/* char: 0x54 'T' */
-
-static const GLubyte ch84data[] = {
-0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe,
-};
-
-static const BitmapCharRec ch84 = {7,10,-1,0,9,ch84data};
-
-/* char: 0x53 'S' */
-
-static const GLubyte ch83data[] = {
-0x7c,0x82,0x82,0x2,0xc,0x70,0x80,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch83 = {7,10,-1,0,9,ch83data};
-
-/* char: 0x52 'R' */
-
-static const GLubyte ch82data[] = {
-0x82,0x82,0x84,0x88,0x90,0xfc,0x82,0x82,0x82,0xfc,
-};
-
-static const BitmapCharRec ch82 = {7,10,-1,0,9,ch82data};
-
-/* char: 0x51 'Q' */
-
-static const GLubyte ch81data[] = {
-0x6,0x8,0x7c,0x92,0xa2,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch81 = {7,12,-1,2,9,ch81data};
-
-/* char: 0x50 'P' */
-
-static const GLubyte ch80data[] = {
-0x80,0x80,0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc,
-};
-
-static const BitmapCharRec ch80 = {7,10,-1,0,9,ch80data};
-
-/* char: 0x4f 'O' */
-
-static const GLubyte ch79data[] = {
-0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch79 = {7,10,-1,0,9,ch79data};
-
-/* char: 0x4e 'N' */
-
-static const GLubyte ch78data[] = {
-0x82,0x82,0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x82,
-};
-
-static const BitmapCharRec ch78 = {7,10,-1,0,9,ch78data};
-
-/* char: 0x4d 'M' */
-
-static const GLubyte ch77data[] = {
-0x82,0x82,0x82,0x92,0x92,0xaa,0xaa,0xc6,0x82,0x82,
-};
-
-static const BitmapCharRec ch77 = {7,10,-1,0,9,ch77data};
-
-/* char: 0x4c 'L' */
-
-static const GLubyte ch76data[] = {
-0xfe,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch76 = {7,10,-1,0,9,ch76data};
-
-/* char: 0x4b 'K' */
-
-static const GLubyte ch75data[] = {
-0x82,0x84,0x88,0x90,0xa0,0xe0,0x90,0x88,0x84,0x82,
-};
-
-static const BitmapCharRec ch75 = {7,10,-1,0,9,ch75data};
-
-/* char: 0x4a 'J' */
-
-static const GLubyte ch74data[] = {
-0x78,0x84,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x1e,
-};
-
-static const BitmapCharRec ch74 = {7,10,-1,0,9,ch74data};
-
-/* char: 0x49 'I' */
-
-static const GLubyte ch73data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,
-};
-
-static const BitmapCharRec ch73 = {5,10,-2,0,9,ch73data};
-
-/* char: 0x48 'H' */
-
-static const GLubyte ch72data[] = {
-0x82,0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82,
-};
-
-static const BitmapCharRec ch72 = {7,10,-1,0,9,ch72data};
-
-/* char: 0x47 'G' */
-
-static const GLubyte ch71data[] = {
-0x7c,0x82,0x82,0x82,0x8e,0x80,0x80,0x80,0x82,0x7c,
-};
-
-static const BitmapCharRec ch71 = {7,10,-1,0,9,ch71data};
-
-/* char: 0x46 'F' */
-
-static const GLubyte ch70data[] = {
-0x40,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe,
-};
-
-static const BitmapCharRec ch70 = {7,10,-1,0,9,ch70data};
-
-/* char: 0x45 'E' */
-
-static const GLubyte ch69data[] = {
-0xfe,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe,
-};
-
-static const BitmapCharRec ch69 = {7,10,-1,0,9,ch69data};
-
-/* char: 0x44 'D' */
-
-static const GLubyte ch68data[] = {
-0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc,
-};
-
-static const BitmapCharRec ch68 = {7,10,-1,0,9,ch68data};
-
-/* char: 0x43 'C' */
-
-static const GLubyte ch67data[] = {
-0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c,
-};
-
-static const BitmapCharRec ch67 = {7,10,-1,0,9,ch67data};
-
-/* char: 0x42 'B' */
-
-static const GLubyte ch66data[] = {
-0xfc,0x42,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc,
-};
-
-static const BitmapCharRec ch66 = {7,10,-1,0,9,ch66data};
-
-/* char: 0x41 'A' */
-
-static const GLubyte ch65data[] = {
-0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x44,0x28,0x10,
-};
-
-static const BitmapCharRec ch65 = {7,10,-1,0,9,ch65data};
-
-/* char: 0x40 '@' */
-
-static const GLubyte ch64data[] = {
-0x7c,0x80,0x80,0x9a,0xa6,0xa2,0x9e,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch64 = {7,10,-1,0,9,ch64data};
-
-/* char: 0x3f '?' */
-
-static const GLubyte ch63data[] = {
-0x10,0x0,0x10,0x10,0x8,0x4,0x2,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch63 = {7,10,-1,0,9,ch63data};
-
-/* char: 0x3e '>' */
-
-static const GLubyte ch62data[] = {
-0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80,
-};
-
-static const BitmapCharRec ch62 = {5,10,-2,0,9,ch62data};
-
-/* char: 0x3d '=' */
-
-static const GLubyte ch61data[] = {
-0xfe,0x0,0x0,0xfe,
-};
-
-static const BitmapCharRec ch61 = {7,4,-1,-2,9,ch61data};
-
-/* char: 0x3c '<' */
-
-static const GLubyte ch60data[] = {
-0x8,0x10,0x20,0x40,0x80,0x80,0x40,0x20,0x10,0x8,
-};
-
-static const BitmapCharRec ch60 = {5,10,-2,0,9,ch60data};
-
-/* char: 0x3b ';' */
-
-static const GLubyte ch59data[] = {
-0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch59 = {2,10,-4,3,9,ch59data};
-
-/* char: 0x3a ':' */
-
-static const GLubyte ch58data[] = {
-0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch58 = {2,7,-4,0,9,ch58data};
-
-/* char: 0x39 '9' */
-
-static const GLubyte ch57data[] = {
-0x78,0x4,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch57 = {7,10,-1,0,9,ch57data};
-
-/* char: 0x38 '8' */
-
-static const GLubyte ch56data[] = {
-0x38,0x44,0x82,0x82,0x44,0x38,0x44,0x82,0x44,0x38,
-};
-
-static const BitmapCharRec ch56 = {7,10,-1,0,9,ch56data};
-
-/* char: 0x37 '7' */
-
-static const GLubyte ch55data[] = {
-0x40,0x40,0x20,0x20,0x10,0x8,0x4,0x2,0x2,0xfe,
-};
-
-static const BitmapCharRec ch55 = {7,10,-1,0,9,ch55data};
-
-/* char: 0x36 '6' */
-
-static const GLubyte ch54data[] = {
-0x7c,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x40,0x3c,
-};
-
-static const BitmapCharRec ch54 = {7,10,-1,0,9,ch54data};
-
-/* char: 0x35 '5' */
-
-static const GLubyte ch53data[] = {
-0x7c,0x82,0x2,0x2,0x2,0xc2,0xbc,0x80,0x80,0xfe,
-};
-
-static const BitmapCharRec ch53 = {7,10,-1,0,9,ch53data};
-
-/* char: 0x34 '4' */
-
-static const GLubyte ch52data[] = {
-0x4,0x4,0x4,0xfe,0x84,0x44,0x24,0x14,0xc,0x4,
-};
-
-static const BitmapCharRec ch52 = {7,10,-1,0,9,ch52data};
-
-/* char: 0x33 '3' */
-
-static const GLubyte ch51data[] = {
-0x7c,0x82,0x2,0x2,0x2,0x1c,0x8,0x4,0x2,0xfe,
-};
-
-static const BitmapCharRec ch51 = {7,10,-1,0,9,ch51data};
-
-/* char: 0x32 '2' */
-
-static const GLubyte ch50data[] = {
-0xfe,0x80,0x40,0x30,0x8,0x4,0x2,0x82,0x82,0x7c,
-};
-
-static const BitmapCharRec ch50 = {7,10,-1,0,9,ch50data};
-
-/* char: 0x31 '1' */
-
-static const GLubyte ch49data[] = {
-0xfe,0x10,0x10,0x10,0x10,0x10,0x90,0x50,0x30,0x10,
-};
-
-static const BitmapCharRec ch49 = {7,10,-1,0,9,ch49data};
-
-/* char: 0x30 '0' */
-
-static const GLubyte ch48data[] = {
-0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,
-};
-
-static const BitmapCharRec ch48 = {7,10,-1,0,9,ch48data};
-
-/* char: 0x2f '/' */
-
-static const GLubyte ch47data[] = {
-0x80,0x40,0x40,0x20,0x10,0x10,0x8,0x4,0x4,0x2,
-};
-
-static const BitmapCharRec ch47 = {7,10,-1,0,9,ch47data};
-
-/* char: 0x2e '.' */
-
-static const GLubyte ch46data[] = {
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch46 = {2,2,-4,0,9,ch46data};
-
-/* char: 0x2d '-' */
-
-static const GLubyte ch45data[] = {
-0xfe,
-};
-
-static const BitmapCharRec ch45 = {7,1,-1,-4,9,ch45data};
-
-/* char: 0x2c ',' */
-
-static const GLubyte ch44data[] = {
-0x80,0x40,0x40,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch44 = {2,5,-4,3,9,ch44data};
-
-/* char: 0x2b '+' */
-
-static const GLubyte ch43data[] = {
-0x10,0x10,0x10,0xfe,0x10,0x10,0x10,
-};
-
-static const BitmapCharRec ch43 = {7,7,-1,-1,9,ch43data};
-
-/* char: 0x2a '*' */
-
-static const GLubyte ch42data[] = {
-0x10,0x92,0x54,0x38,0x54,0x92,0x10,
-};
-
-static const BitmapCharRec ch42 = {7,7,-1,-1,9,ch42data};
-
-/* char: 0x29 ')' */
-
-static const GLubyte ch41data[] = {
-0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80,
-};
-
-static const BitmapCharRec ch41 = {3,12,-3,1,9,ch41data};
-
-/* char: 0x28 '(' */
-
-static const GLubyte ch40data[] = {
-0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20,
-};
-
-static const BitmapCharRec ch40 = {3,12,-3,1,9,ch40data};
-
-/* char: 0x27 ''' */
-
-static const GLubyte ch39data[] = {
-0x80,0x40,0x20,0x30,
-};
-
-static const BitmapCharRec ch39 = {4,4,-3,-6,9,ch39data};
-
-/* char: 0x26 '&' */
-
-static const GLubyte ch38data[] = {
-0x62,0x94,0x88,0x94,0x62,0x60,0x90,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch38 = {7,10,-1,0,9,ch38data};
-
-/* char: 0x25 '%' */
-
-static const GLubyte ch37data[] = {
-0x84,0x4a,0x4a,0x24,0x10,0x10,0x48,0xa4,0xa4,0x42,
-};
-
-static const BitmapCharRec ch37 = {7,10,-1,0,9,ch37data};
-
-/* char: 0x24 '$' */
-
-static const GLubyte ch36data[] = {
-0x10,0x7c,0x92,0x12,0x12,0x14,0x38,0x50,0x90,0x92,0x7c,0x10,
-};
-
-static const BitmapCharRec ch36 = {7,12,-1,1,9,ch36data};
-
-/* char: 0x23 '#' */
-
-static const GLubyte ch35data[] = {
-0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48,
-};
-
-static const BitmapCharRec ch35 = {6,8,-1,-1,9,ch35data};
-
-/* char: 0x22 '"' */
-
-static const GLubyte ch34data[] = {
-0x90,0x90,0x90,
-};
-
-static const BitmapCharRec ch34 = {4,3,-3,-7,9,ch34data};
-
-/* char: 0x21 '!' */
-
-static const GLubyte ch33data[] = {
-0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch33 = {1,11,-4,0,9,ch33data};
-
-/* char: 0x1f */
-
-static const GLubyte ch31data[] = {
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch31 = {2,2,-4,-2,9,ch31data};
-
-/* char: 0x1e */
-
-static const GLubyte ch30data[] = {
-0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c,
-};
-
-static const BitmapCharRec ch30 = {7,10,-1,0,9,ch30data};
-
-/* char: 0x1d */
-
-static const GLubyte ch29data[] = {
-0x80,0x40,0xfe,0x10,0xfe,0x4,0x2,
-};
-
-static const BitmapCharRec ch29 = {7,7,-1,0,9,ch29data};
-
-/* char: 0x1c */
-
-static const GLubyte ch28data[] = {
-0x44,0x24,0x24,0x24,0x24,0x24,0xfe,
-};
-
-static const BitmapCharRec ch28 = {7,7,-1,0,9,ch28data};
-
-/* char: 0x1b */
-
-static const GLubyte ch27data[] = {
-0xfe,0x0,0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80,
-};
-
-static const BitmapCharRec ch27 = {7,12,-1,2,9,ch27data};
-
-/* char: 0x1a */
-
-static const GLubyte ch26data[] = {
-0xfc,0x0,0x4,0x8,0x10,0x20,0x40,0x40,0x20,0x10,0x8,0x4,
-};
-
-static const BitmapCharRec ch26 = {6,12,-2,2,9,ch26data};
-
-/* char: 0x19 */
-
-static const GLubyte ch25data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch25 = {1,15,-4,3,9,ch25data};
-
-/* char: 0x18 */
-
-static const GLubyte ch24data[] = {
-0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,
-};
-
-static const BitmapCharRec ch24 = {9,7,0,3,9,ch24data};
-
-/* char: 0x17 */
-
-static const GLubyte ch23data[] = {
-0xff,0x80,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,
-0x8,0x0,
-};
-
-static const BitmapCharRec ch23 = {9,9,0,-3,9,ch23data};
-
-/* char: 0x16 */
-
-static const GLubyte ch22data[] = {
-0x8,0x8,0x8,0x8,0x8,0x8,0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
-};
-
-static const BitmapCharRec ch22 = {5,15,0,3,9,ch22data};
-
-/* char: 0x15 */
-
-static const GLubyte ch21data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch21 = {5,15,-4,3,9,ch21data};
-
-/* char: 0x14 */
-
-static const GLubyte ch20data[] = {
-0xff,0x80,
-};
-
-static const BitmapCharRec ch20 = {9,1,0,1,9,ch20data};
-
-/* char: 0x13 */
-
-static const GLubyte ch19data[] = {
-0xff,0x80,
-};
-
-static const BitmapCharRec ch19 = {9,1,0,-1,9,ch19data};
-
-/* char: 0x12 */
-
-static const GLubyte ch18data[] = {
-0xff,0x80,
-};
-
-static const BitmapCharRec ch18 = {9,1,0,-3,9,ch18data};
-
-/* char: 0x11 */
-
-static const GLubyte ch17data[] = {
-0xff,0x80,
-};
-
-static const BitmapCharRec ch17 = {9,1,0,-5,9,ch17data};
-
-/* char: 0x10 */
-
-static const GLubyte ch16data[] = {
-0xff,0x80,
-};
-
-static const BitmapCharRec ch16 = {9,1,0,-7,9,ch16data};
-
-/* char: 0xf */
-
-static const GLubyte ch15data[] = {
-0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0,
-0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,
-};
-
-static const BitmapCharRec ch15 = {9,15,0,3,9,ch15data};
-
-/* char: 0xe */
-
-static const GLubyte ch14data[] = {
-0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch14 = {5,9,-4,-3,9,ch14data};
-
-/* char: 0xd */
-
-static const GLubyte ch13data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0xf8,
-};
-
-static const BitmapCharRec ch13 = {5,7,-4,3,9,ch13data};
-
-/* char: 0xc */
-
-static const GLubyte ch12data[] = {
-0x8,0x8,0x8,0x8,0x8,0x8,0xf8,
-};
-
-static const BitmapCharRec ch12 = {5,7,0,3,9,ch12data};
-
-/* char: 0xb */
-
-static const GLubyte ch11data[] = {
-0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
-};
-
-static const BitmapCharRec ch11 = {5,9,0,-3,9,ch11data};
-
-/* char: 0xa */
-
-static const GLubyte ch10data[] = {
-0x8,0x8,0x8,0x8,0x3e,0x0,0x20,0x50,0x88,0x88,
-};
-
-static const BitmapCharRec ch10 = {7,10,-1,2,9,ch10data};
-
-/* char: 0x9 */
-
-static const GLubyte ch9data[] = {
-0x3e,0x20,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88,
-};
-
-static const BitmapCharRec ch9 = {7,10,-1,2,9,ch9data};
-
-/* char: 0x8 */
-
-static const GLubyte ch8data[] = {
-0xfe,0x10,0x10,0xfe,0x10,0x10,
-};
-
-static const BitmapCharRec ch8 = {7,6,-1,0,9,ch8data};
-
-/* char: 0x7 */
-
-static const GLubyte ch7data[] = {
-0x70,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch7 = {5,4,-2,-6,9,ch7data};
-
-/* char: 0x6 */
-
-static const GLubyte ch6data[] = {
-0x20,0x20,0x3c,0x20,0x3e,0x0,0xf8,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch6 = {7,10,-1,2,9,ch6data};
-
-/* char: 0x5 */
-
-static const GLubyte ch5data[] = {
-0x22,0x22,0x3c,0x22,0x3c,0x0,0x78,0x80,0x80,0x78,
-};
-
-static const BitmapCharRec ch5 = {7,10,-1,2,9,ch5data};
-
-/* char: 0x4 */
-
-static const GLubyte ch4data[] = {
-0x10,0x10,0x1c,0x10,0x1e,0x80,0x80,0xe0,0x80,0xf0,
-};
-
-static const BitmapCharRec ch4 = {7,10,-1,2,9,ch4data};
-
-/* char: 0x3 */
-
-static const GLubyte ch3data[] = {
-0x8,0x8,0x8,0x3e,0x0,0x88,0x88,0xf8,0x88,0x88,
-};
-
-static const BitmapCharRec ch3 = {7,10,-1,2,9,ch3data};
-
-/* char: 0x2 */
-
-static const GLubyte ch2data[] = {
-0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
-};
-
-static const BitmapCharRec ch2 = {8,14,0,3,9,ch2data};
-
-/* char: 0x1 */
-
-static const GLubyte ch1data[] = {
-0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,
-};
-
-static const BitmapCharRec ch1 = {7,7,-1,0,9,ch1data};
-
-static const BitmapCharRec * const chars[] = {
-&ch0,
-&ch1,
-&ch2,
-&ch3,
-&ch4,
-&ch5,
-&ch6,
-&ch7,
-&ch8,
-&ch9,
-&ch10,
-&ch11,
-&ch12,
-&ch13,
-&ch14,
-&ch15,
-&ch16,
-&ch17,
-&ch18,
-&ch19,
-&ch20,
-&ch21,
-&ch22,
-&ch23,
-&ch24,
-&ch25,
-&ch26,
-&ch27,
-&ch28,
-&ch29,
-&ch30,
-&ch31,
-&ch32,
-&ch33,
-&ch34,
-&ch35,
-&ch36,
-&ch37,
-&ch38,
-&ch39,
-&ch40,
-&ch41,
-&ch42,
-&ch43,
-&ch44,
-&ch45,
-&ch46,
-&ch47,
-&ch48,
-&ch49,
-&ch50,
-&ch51,
-&ch52,
-&ch53,
-&ch54,
-&ch55,
-&ch56,
-&ch57,
-&ch58,
-&ch59,
-&ch60,
-&ch61,
-&ch62,
-&ch63,
-&ch64,
-&ch65,
-&ch66,
-&ch67,
-&ch68,
-&ch69,
-&ch70,
-&ch71,
-&ch72,
-&ch73,
-&ch74,
-&ch75,
-&ch76,
-&ch77,
-&ch78,
-&ch79,
-&ch80,
-&ch81,
-&ch82,
-&ch83,
-&ch84,
-&ch85,
-&ch86,
-&ch87,
-&ch88,
-&ch89,
-&ch90,
-&ch91,
-&ch92,
-&ch93,
-&ch94,
-&ch95,
-&ch96,
-&ch97,
-&ch98,
-&ch99,
-&ch100,
-&ch101,
-&ch102,
-&ch103,
-&ch104,
-&ch105,
-&ch106,
-&ch107,
-&ch108,
-&ch109,
-&ch110,
-&ch111,
-&ch112,
-&ch113,
-&ch114,
-&ch115,
-&ch116,
-&ch117,
-&ch118,
-&ch119,
-&ch120,
-&ch121,
-&ch122,
-&ch123,
-&ch124,
-&ch125,
-&ch126,
-&ch127,
-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,
-&ch160,
-&ch161,
-&ch162,
-&ch163,
-&ch164,
-&ch165,
-&ch166,
-&ch167,
-&ch168,
-&ch169,
-&ch170,
-&ch171,
-&ch172,
-&ch173,
-&ch174,
-&ch175,
-&ch176,
-&ch177,
-&ch178,
-&ch179,
-&ch180,
-&ch181,
-&ch182,
-&ch183,
-&ch184,
-&ch185,
-&ch186,
-&ch187,
-&ch188,
-&ch189,
-&ch190,
-&ch191,
-&ch192,
-&ch193,
-&ch194,
-&ch195,
-&ch196,
-&ch197,
-&ch198,
-&ch199,
-&ch200,
-&ch201,
-&ch202,
-&ch203,
-&ch204,
-&ch205,
-&ch206,
-&ch207,
-&ch208,
-&ch209,
-&ch210,
-&ch211,
-&ch212,
-&ch213,
-&ch214,
-&ch215,
-&ch216,
-&ch217,
-&ch218,
-&ch219,
-&ch220,
-&ch221,
-&ch222,
-&ch223,
-&ch224,
-&ch225,
-&ch226,
-&ch227,
-&ch228,
-&ch229,
-&ch230,
-&ch231,
-&ch232,
-&ch233,
-&ch234,
-&ch235,
-&ch236,
-&ch237,
-&ch238,
-&ch239,
-&ch240,
-&ch241,
-&ch242,
-&ch243,
-&ch244,
-&ch245,
-&ch246,
-&ch247,
-&ch248,
-&ch249,
-&ch250,
-&ch251,
-&ch252,
-&ch253,
-&ch254,
-&ch255,
-};
-#if !defined(__IBMCPP__)
-const
-#endif
- BitmapFontRec glutBitmap9By15 = {
-"-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1",
-256,
-0,
-chars
-};
-
diff --git a/src/glut/os2/glut_bitmap.cpp b/src/glut/os2/glut_bitmap.cpp
deleted file mode 100644
index 789a89ae73e..00000000000
--- a/src/glut/os2/glut_bitmap.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/* 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 "glutint.h"
-#include "glutbitmap.h"
-
-void GLUTAPIENTRY
-glutBitmapCharacter(GLUTbitmapFont font, int c)
-{
- const BitmapCharRec *ch;
- BitmapFontPtr fontinfo;
- GLint swapbytes, lsbfirst, rowlength;
- GLint skiprows, skippixels, alignment;
-
-#if defined(_WIN32)
- fontinfo = (BitmapFontPtr) __glutFont(font);
-#else
- fontinfo = (BitmapFontPtr) font;
-#endif
-
- if (c < fontinfo->first ||
- c >= fontinfo->first + fontinfo->num_chars)
- return;
- ch = fontinfo->ch[c - fontinfo->first];
- if (ch) {
- /* Save current modes. */
- 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);
- /* Little endian machines (DEC Alpha for example) could
- benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
- instead of GL_FALSE, but this would require changing the
- generated bitmaps too. */
- 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);
- glBitmap(ch->width, ch->height, ch->xorig, ch->yorig,
- ch->advance, 0, ch->bitmap);
- /* Restore saved 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/src/glut/os2/glut_cindex.cpp b/src/glut/os2/glut_cindex.cpp
deleted file mode 100644
index 0897a3cf85c..00000000000
--- a/src/glut/os2/glut_cindex.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */
-
-/* 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 <stdlib.h>
-#include "glutint.h"
-
-#if defined(__OS2PM__)
- #define IsWindowVisible WinIsWindowVisible
-#endif
-
-#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i)))
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue)
-{
- GLUTcolormap *cmap, *newcmap;
- XVisualInfo *vis;
- XColor color;
- int i;
-
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
- cmap = __glutCurrentWindow->colormap;
- vis = __glutCurrentWindow->vis;
- } else {
- cmap = __glutCurrentWindow->overlay->colormap;
- vis = __glutCurrentWindow->overlay->vis;
- if (ndx == __glutCurrentWindow->overlay->transparentPixel) {
- __glutWarning(
- "glutSetColor: cannot set color of overlay transparent index %d\n",
- ndx);
- return;
- }
- }
-
- if (!cmap) {
- __glutWarning("glutSetColor: current window is RGBA");
- return;
- }
-#if defined(_WIN32) || defined(__OS2PM__)
- if (ndx >= 256 || /* always assume 256 colors on Win32 */
-#else
- if (ndx >= vis->visual->map_entries ||
-#endif
- ndx < 0) {
- __glutWarning("glutSetColor: index %d out of range", ndx);
- return;
- }
- if (cmap->refcnt > 1) {
- newcmap = __glutAssociateNewColormap(vis);
- cmap->refcnt--;
- /* Wouldn't it be nice if XCopyColormapAndFree could be
- told not to free the old colormap's entries! */
- for (i = cmap->size - 1; i >= 0; i--) {
- if (i == ndx) {
- /* We are going to set this cell shortly! */
- continue;
- }
- if (cmap->cells[i].component[GLUT_RED] >= 0.0) {
- color.pixel = i;
- newcmap->cells[i].component[GLUT_RED] =
- cmap->cells[i].component[GLUT_RED];
- color.red = (GLfloat) 0xffff *
- cmap->cells[i].component[GLUT_RED];
- newcmap->cells[i].component[GLUT_GREEN] =
- cmap->cells[i].component[GLUT_GREEN];
- color.green = (GLfloat) 0xffff *
- cmap->cells[i].component[GLUT_GREEN];
- newcmap->cells[i].component[GLUT_BLUE] =
- cmap->cells[i].component[GLUT_BLUE];
- color.blue = (GLfloat) 0xffff *
- cmap->cells[i].component[GLUT_BLUE];
- color.flags = DoRed | DoGreen | DoBlue;
-#if defined(_WIN32) || defined(__OS2PM__)
- if (IsWindowVisible(__glutCurrentWindow->win)) {
- XHDC = __glutCurrentWindow->hdc;
- } else {
- XHDC = 0;
- }
-#endif
- XStoreColor(__glutDisplay, newcmap->cmap, &color);
- } else {
- /* Leave unallocated entries unallocated. */
- }
- }
- cmap = newcmap;
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
- __glutCurrentWindow->colormap = cmap;
- __glutCurrentWindow->cmap = cmap->cmap;
- } else {
- __glutCurrentWindow->overlay->colormap = cmap;
- __glutCurrentWindow->overlay->cmap = cmap->cmap;
- }
- XSetWindowColormap(__glutDisplay,
- __glutCurrentWindow->renderWin, cmap->cmap);
-
-#if !defined(_WIN32) && !defined(__OS2PM__)
- {
- GLUTwindow *toplevel;
-
- toplevel = __glutToplevelOf(__glutCurrentWindow);
- if (toplevel->cmap != cmap->cmap) {
- __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK);
- }
- }
-#endif
- }
- color.pixel = ndx;
- red = CLAMP(red);
- cmap->cells[ndx].component[GLUT_RED] = red;
- color.red = (GLfloat) 0xffff *red;
- green = CLAMP(green);
- cmap->cells[ndx].component[GLUT_GREEN] = green;
- color.green = (GLfloat) 0xffff *green;
- blue = CLAMP(blue);
- cmap->cells[ndx].component[GLUT_BLUE] = blue;
- color.blue = (GLfloat) 0xffff *blue;
- color.flags = DoRed | DoGreen | DoBlue;
-#if defined(_WIN32) || defined(__OS2PM__)
- if (IsWindowVisible(__glutCurrentWindow->win)) {
- XHDC = __glutCurrentWindow->hdc;
- } else {
- XHDC = 0;
- }
-#endif
- XStoreColor(__glutDisplay, cmap->cmap, &color);
-}
-
-GLfloat GLUTAPIENTRY
-glutGetColor(int ndx, int comp)
-{
- GLUTcolormap *colormap;
- XVisualInfo *vis;
-
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
- colormap = __glutCurrentWindow->colormap;
- vis = __glutCurrentWindow->vis;
- } else {
- colormap = __glutCurrentWindow->overlay->colormap;
- vis = __glutCurrentWindow->overlay->vis;
- if (ndx == __glutCurrentWindow->overlay->transparentPixel) {
- __glutWarning("glutGetColor: requesting overlay transparent index %d\n",
- ndx);
- return -1.0;
- }
- }
-
- if (!colormap) {
- __glutWarning("glutGetColor: current window is RGBA");
- return -1.0;
- }
-#if defined(_WIN32) || defined(__OS2PM__)
-#define OUT_OF_RANGE_NDX(ndx) (ndx >= 256 || ndx < 0)
-#else
-#define OUT_OF_RANGE_NDX(ndx) (ndx >= vis->visual->map_entries || ndx < 0)
-#endif
- if (OUT_OF_RANGE_NDX(ndx)) {
- __glutWarning("glutGetColor: index %d out of range", ndx);
- return -1.0;
- }
- return colormap->cells[ndx].component[comp];
-}
-
-void GLUTAPIENTRY
-glutCopyColormap(int winnum)
-{
- GLUTwindow *window = __glutWindowList[winnum - 1];
- GLUTcolormap *oldcmap, *newcmap;
- XVisualInfo *dstvis;
-
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
- oldcmap = __glutCurrentWindow->colormap;
- dstvis = __glutCurrentWindow->vis;
- newcmap = window->colormap;
- } else {
- oldcmap = __glutCurrentWindow->overlay->colormap;
- dstvis = __glutCurrentWindow->overlay->vis;
- if (!window->overlay) {
- __glutWarning("glutCopyColormap: window %d has no overlay", winnum);
- return;
- }
- newcmap = window->overlay->colormap;
- }
-
- if (!oldcmap) {
- __glutWarning("glutCopyColormap: destination colormap must be color index");
- return;
- }
- if (!newcmap) {
- __glutWarning(
- "glutCopyColormap: source colormap of window %d must be color index",
- winnum);
- return;
- }
- if (newcmap == oldcmap) {
- /* Source and destination are the same; now copy needed. */
- return;
- }
-#if !defined(_WIN32) && !defined(__OS2PM__)
- /* Play safe: compare visual IDs, not Visual*'s. */
- if (newcmap->visual->visualid == oldcmap->visual->visualid) {
-#endif
- /* Visuals match! "Copy" by reference... */
- __glutFreeColormap(oldcmap);
- newcmap->refcnt++;
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
- __glutCurrentWindow->colormap = newcmap;
- __glutCurrentWindow->cmap = newcmap->cmap;
- } else {
- __glutCurrentWindow->overlay->colormap = newcmap;
- __glutCurrentWindow->overlay->cmap = newcmap->cmap;
- }
- XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin,
- newcmap->cmap);
-#if !defined(_WIN32) && !defined(__OS2PM__)
- __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK);
-bla bla bla
-
- } else {
- GLUTcolormap *copycmap;
- XColor color;
- int i, last;
-
- /* Visuals different - need a distinct X colormap! */
- copycmap = __glutAssociateNewColormap(dstvis);
- /* Wouldn't it be nice if XCopyColormapAndFree could be
- told not to free the old colormap's entries! */
- last = newcmap->size;
- if (last > copycmap->size) {
- last = copycmap->size;
- }
- for (i = last - 1; i >= 0; i--) {
- if (newcmap->cells[i].component[GLUT_RED] >= 0.0) {
- color.pixel = i;
- copycmap->cells[i].component[GLUT_RED] =
- newcmap->cells[i].component[GLUT_RED];
- color.red = (GLfloat) 0xffff *
- newcmap->cells[i].component[GLUT_RED];
- copycmap->cells[i].component[GLUT_GREEN] =
- newcmap->cells[i].component[GLUT_GREEN];
- color.green = (GLfloat) 0xffff *
- newcmap->cells[i].component[GLUT_GREEN];
- copycmap->cells[i].component[GLUT_BLUE] =
- newcmap->cells[i].component[GLUT_BLUE];
- color.blue = (GLfloat) 0xffff *
- newcmap->cells[i].component[GLUT_BLUE];
- color.flags = DoRed | DoGreen | DoBlue;
- XStoreColor(__glutDisplay, copycmap->cmap, &color);
- }
- }
- }
-#endif
-}
-/* ENDCENTRY */
- \ No newline at end of file
diff --git a/src/glut/os2/glut_cmap.cpp b/src/glut/os2/glut_cmap.cpp
deleted file mode 100644
index d5b8d436a5d..00000000000
--- a/src/glut/os2/glut_cmap.cpp
+++ /dev/null
@@ -1,399 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */
-
-/* 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. */
-
-#ifdef __VMS
-//EK#include <GL/vms_x_fix.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h> /* SunOS multithreaded assert() needs <stdio.h>. Lame. */
-#include <assert.h>
-#if !defined(_WIN32) && !defined(__OS2__)
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <X11/Xatom.h> /* for XA_RGB_DEFAULT_MAP atom */
- #if defined(__vms)
- #include <Xmu/StdCmap.h> /* for XmuLookupStandardColormap */
- #else
- #include <X11/Xmu/StdCmap.h> /* for XmuLookupStandardColormap */
- #endif
-#endif
-
-/* SGI optimization introduced in IRIX 6.3 to avoid X server
- round trips for interning common X atoms. */
-#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS)
-#include <X11/SGIFastAtom.h>
-#else
-#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how)
-#endif
-
-#include "glutint.h"
-#include "layerutil.h"
-
-GLUTcolormap *__glutColormapList = NULL;
-
-GLUTcolormap *
-__glutAssociateNewColormap(XVisualInfo * vis)
-{
- GLUTcolormap *cmap;
- int transparentPixel, i;
- unsigned long pixels[255];
-
- cmap = (GLUTcolormap *) malloc(sizeof(GLUTcolormap));
- if (!cmap)
- __glutFatalError("out of memory.");
-#if defined(_WIN32) || defined(__OS2__)
- pixels[0] = 0; /* avoid compilation warnings on win32 */
- cmap->visual = 0;
- cmap->size = 256; /* always assume 256 on Win32 */
-#else
- cmap->visual = vis->visual;
- cmap->size = vis->visual->map_entries;
-#endif
- cmap->refcnt = 1;
- cmap->cells = (GLUTcolorcell *)
- malloc(sizeof(GLUTcolorcell) * cmap->size);
- if (!cmap->cells)
- __glutFatalError("out of memory.");
- /* make all color cell entries be invalid */
- for (i = cmap->size - 1; i >= 0; i--) {
- cmap->cells[i].component[GLUT_RED] = -1.0;
- cmap->cells[i].component[GLUT_GREEN] = -1.0;
- cmap->cells[i].component[GLUT_BLUE] = -1.0;
- }
- transparentPixel = __glutGetTransparentPixel(__glutDisplay, vis);
- if (transparentPixel == -1 || transparentPixel >= cmap->size) {
-
- /* If there is no transparent pixel or if the transparent
- pixel is outside the range of valid colormap cells (HP
- can implement their overlays this smart way since their
- transparent pixel is 255), we can AllocAll the colormap.
- See note below. */
-
- cmap->cmap = XCreateColormap(__glutDisplay,
- __glutRoot, cmap->visual, AllocAll);
- } else {
-
- /* On machines where zero (or some other value in the range
- of 0 through map_entries-1), BadAlloc may be generated
- when an AllocAll overlay colormap is allocated since the
- transparent pixel precludes all the cells in the colormap
- being allocated (the transparent pixel is pre-allocated).
- So in this case, use XAllocColorCells to allocate
- map_entries-1 pixels (that is, all but the transparent
- pixel. */
-
-#if defined(_WIN32) || defined(__OS2__)
- cmap->cmap = XCreateColormap(__glutDisplay,
- __glutRoot, 0, AllocNone);
-#else
- cmap->cmap = XCreateColormap(__glutDisplay,
- __glutRoot, vis->visual, AllocNone);
- XAllocColorCells(__glutDisplay, cmap->cmap, False, 0, 0,
- pixels, cmap->size - 1);
-#endif
- }
- cmap->next = __glutColormapList;
- __glutColormapList = cmap;
- return cmap;
-}
-
-static GLUTcolormap *
-associateColormap(XVisualInfo * vis)
-{
-#if !defined(_WIN32) && !defined(__OS2__)
- GLUTcolormap *cmap = __glutColormapList;
-
- while (cmap != NULL) {
- /* Play safe: compare visual IDs, not Visual*'s. */
- if (cmap->visual->visualid == vis->visual->visualid) {
- /* Already have created colormap for the visual. */
- cmap->refcnt++;
- return cmap;
- }
- cmap = cmap->next;
- }
-#endif
- return __glutAssociateNewColormap(vis);
-}
-
-void
-__glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap)
-{
-#if defined(_WIN32) || defined(__OS2__)
- if (vi->dwFlags & PFD_NEED_PALETTE || vi->iPixelType == PFD_TYPE_COLORINDEX) {
- *colormap = associateColormap(vi);
- *cmap = (*colormap)->cmap;
- } else {
- *colormap = NULL;
- *cmap = 0;
- }
-#else
- Status status;
- XStandardColormap *standardCmaps;
- int i, numCmaps;
- static Atom hpColorRecoveryAtom = -1;
- int isRGB, visualClass, rc;
-
-#if defined(__cplusplus) || defined(c_plusplus)
- visualClass = vi->c_class;
-#else
- visualClass = vi->class;
-#endif
- switch (visualClass) {
- case PseudoColor:
- /* Mesa might return a PseudoColor visual for RGB mode. */
- rc = glXGetConfig(__glutDisplay, vi, GLX_RGBA, &isRGB);
- if (rc == 0 && isRGB) {
- /* Must be Mesa. */
- *colormap = NULL;
- if (MaxCmapsOfScreen(DefaultScreenOfDisplay(__glutDisplay)) == 1
- && vi->visual == DefaultVisual(__glutDisplay, __glutScreen)) {
- char *privateCmap = getenv("MESA_PRIVATE_CMAP");
-
- if (privateCmap) {
- /* User doesn't want to share colormaps. */
- *cmap = XCreateColormap(__glutDisplay, __glutRoot,
- vi->visual, AllocNone);
- } else {
- /* Share the root colormap. */
- *cmap = DefaultColormap(__glutDisplay, __glutScreen);
- }
- } else {
- /* Get our own PseudoColor colormap. */
- *cmap = XCreateColormap(__glutDisplay, __glutRoot,
- vi->visual, AllocNone);
- }
- } else {
- /* CI mode, real GLX never returns a PseudoColor visual
- for RGB mode. */
- *colormap = associateColormap(vi);
- *cmap = (*colormap)->cmap;
- }
- break;
- case TrueColor:
- case DirectColor:
- *colormap = NULL; /* NULL if RGBA */
-
- /* Hewlett-Packard supports a feature called "HP Color
- Recovery". Mesa has code to use HP Color Recovery. For
- Mesa to use this feature, the atom
- _HP_RGB_SMOOTH_MAP_LIST must be defined on the root
- window AND the colormap obtainable by XGetRGBColormaps
- for that atom must be set on the window. If that
- colormap is not set, the output will look stripy. */
-
- if (hpColorRecoveryAtom == -1) {
- char *xvendor;
-
-#define VENDOR_HP "Hewlett-Packard"
-
- /* Only makes sense to make XInternAtom round-trip if we
- know that we are connected to an HP X server. */
- xvendor = ServerVendor(__glutDisplay);
- if (!strncmp(xvendor, VENDOR_HP, sizeof(VENDOR_HP) - 1)) {
- hpColorRecoveryAtom = XInternAtom(__glutDisplay, "_HP_RGB_SMOOTH_MAP_LIST", True);
- } else {
- hpColorRecoveryAtom = None;
- }
- }
- if (hpColorRecoveryAtom != None) {
- status = XGetRGBColormaps(__glutDisplay, __glutRoot,
- &standardCmaps, &numCmaps, hpColorRecoveryAtom);
- if (status == 1) {
- for (i = 0; i < numCmaps; i++) {
- if (standardCmaps[i].visualid == vi->visualid) {
- *cmap = standardCmaps[i].colormap;
- XFree(standardCmaps);
- return;
- }
- }
- XFree(standardCmaps);
- }
- }
-#ifndef SOLARIS_2_4_BUG
- /* Solaris 2.4 and 2.5 have a bug in their
- XmuLookupStandardColormap implementations. Please
- compile your Solaris 2.4 or 2.5 version of GLUT with
- -DSOLARIS_2_4_BUG to work around this bug. The symptom
- of the bug is that programs will get a BadMatch error
- from X_CreateWindow when creating a GLUT window because
- Solaris 2.4 and 2.5 create a corrupted RGB_DEFAULT_MAP
- property. Note that this workaround prevents Colormap
- sharing between applications, perhaps leading
- unnecessary colormap installations or colormap flashing.
- Sun fixed this bug in Solaris 2.6. */
- status = XmuLookupStandardColormap(__glutDisplay,
- vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP,
- /* replace */ False, /* retain */ True);
- if (status == 1) {
- status = XGetRGBColormaps(__glutDisplay, __glutRoot,
- &standardCmaps, &numCmaps, XA_RGB_DEFAULT_MAP);
- if (status == 1) {
- for (i = 0; i < numCmaps; i++) {
- if (standardCmaps[i].visualid == vi->visualid) {
- *cmap = standardCmaps[i].colormap;
- XFree(standardCmaps);
- return;
- }
- }
- XFree(standardCmaps);
- }
- }
-#endif
- /* If no standard colormap but TrueColor, just make a
- private one. */
- /* XXX Should do a better job of internal sharing for
- privately allocated TrueColor colormaps. */
- /* XXX DirectColor probably needs ramps hand initialized! */
- *cmap = XCreateColormap(__glutDisplay, __glutRoot,
- vi->visual, AllocNone);
- break;
- case StaticColor:
- case StaticGray:
- case GrayScale:
- /* Mesa supports these visuals */
- *colormap = NULL;
- *cmap = XCreateColormap(__glutDisplay, __glutRoot,
- vi->visual, AllocNone);
- break;
- default:
- __glutFatalError(
- "could not allocate colormap for visual type: %d.",
- visualClass);
- }
- return;
-#endif
-}
-
-#if !defined(_WIN32) && !defined(__OS2__)
-static int
-findColormaps(GLUTwindow * window,
- Window * winlist, Colormap * cmaplist, int num, int max)
-{
- GLUTwindow *child;
- int i;
-
- /* Do not allow more entries that maximum number of
- colormaps! */
- if (num >= max)
- return num;
- /* Is cmap for this window already on the list? */
- for (i = 0; i < num; i++) {
- if (cmaplist[i] == window->cmap)
- goto normalColormapAlreadyListed;
- }
- /* Not found on the list; add colormap and window. */
- winlist[num] = window->win;
- cmaplist[num] = window->cmap;
- num++;
-
-normalColormapAlreadyListed:
-
- /* Repeat above but for the overlay colormap if there one. */
- if (window->overlay) {
- if (num >= max)
- return num;
- for (i = 0; i < num; i++) {
- if (cmaplist[i] == window->overlay->cmap)
- goto overlayColormapAlreadyListed;
- }
- winlist[num] = window->overlay->win;
- cmaplist[num] = window->overlay->cmap;
- num++;
- }
-overlayColormapAlreadyListed:
-
- /* Recursively search children. */
- child = window->children;
- while (child) {
- num = findColormaps(child, winlist, cmaplist, num, max);
- child = child->siblings;
- }
- return num;
-}
-
-void
-__glutEstablishColormapsProperty(GLUTwindow * window)
-{
- /* this routine is strictly X. Win32 doesn't need to do
- anything of this sort (but has to do other wacky stuff
- later). */
- static Atom wmColormapWindows = None;
- Window *winlist;
- Colormap *cmaplist;
- Status status;
- int maxcmaps, num;
-
- assert(!window->parent);
- maxcmaps = MaxCmapsOfScreen(ScreenOfDisplay(__glutDisplay,
- __glutScreen));
- /* For portability reasons we don't use alloca for winlist
- and cmaplist, but we could. */
- winlist = (Window *) malloc(maxcmaps * sizeof(Window));
- cmaplist = (Colormap *) malloc(maxcmaps * sizeof(Colormap));
- num = findColormaps(window, winlist, cmaplist, 0, maxcmaps);
- if (num < 2) {
- /* Property no longer needed; remove it. */
- wmColormapWindows = XSGIFastInternAtom(__glutDisplay,
- "WM_COLORMAP_WINDOWS", SGI_XA_WM_COLORMAP_WINDOWS, False);
- if (wmColormapWindows == None) {
- __glutWarning("Could not intern X atom for WM_COLORMAP_WINDOWS.");
- return;
- }
- XDeleteProperty(__glutDisplay, window->win, wmColormapWindows);
- } else {
- status = XSetWMColormapWindows(__glutDisplay, window->win,
- winlist, num);
- /* XSetWMColormapWindows should always work unless the
- WM_COLORMAP_WINDOWS property cannot be intern'ed. We
- check to be safe. */
- if (status == False)
- __glutFatalError("XSetWMColormapWindows returned False.");
- }
- /* For portability reasons we don't use alloca for winlist
- and cmaplist, but we could. */
- free(winlist);
- free(cmaplist);
-}
-
-GLUTwindow *
-__glutToplevelOf(GLUTwindow * window)
-{
- while (window->parent) {
- window = window->parent;
- }
- return window;
-}
-#endif
-
-void
-__glutFreeColormap(GLUTcolormap * cmap)
-{
- GLUTcolormap *cur, **prev;
-
- cmap->refcnt--;
- if (cmap->refcnt == 0) {
- /* remove from colormap list */
- cur = __glutColormapList;
- prev = &__glutColormapList;
- while (cur) {
- if (cur == cmap) {
- *prev = cmap->next;
- break;
- }
- prev = &(cur->next);
- cur = cur->next;
- }
- /* actually free colormap */
- XFreeColormap(__glutDisplay, cmap->cmap);
- free(cmap->cells);
- free(cmap);
- }
-}
-
diff --git a/src/glut/os2/glut_cursor.cpp b/src/glut/os2/glut_cursor.cpp
deleted file mode 100644
index 9784e9b6226..00000000000
--- a/src/glut/os2/glut_cursor.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1995, 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 "glutint.h"
-
-#if !defined(_WIN32) && !defined(__OS2PM__)
-#include <X11/Xatom.h> /* For XA_CURSOR */
-#include <X11/cursorfont.h>
-#endif
-
-typedef struct _CursorTable {
-#if defined(_WIN32)
- char* glyph;
-#else
- int glyph;
-#endif
- Cursor cursor;
-} CursorTable;
-/* *INDENT-OFF* */
-
-static CursorTable cursorTable[] = {
- {XC_arrow, None}, /* GLUT_CURSOR_RIGHT_ARROW */
- {XC_top_left_arrow, None}, /* GLUT_CURSOR_LEFT_ARROW */
- {XC_hand1, None}, /* GLUT_CURSOR_INFO */
- {XC_pirate, None}, /* GLUT_CURSOR_DESTROY */
- {XC_question_arrow, None}, /* GLUT_CURSOR_HELP */
- {XC_exchange, None}, /* GLUT_CURSOR_CYCLE */
- {XC_spraycan, None}, /* GLUT_CURSOR_SPRAY */
- {XC_watch, None}, /* GLUT_CURSOR_WAIT */
- {XC_xterm, None}, /* GLUT_CURSOR_TEXT */
- {XC_crosshair, None}, /* GLUT_CURSOR_CROSSHAIR */
- {XC_sb_v_double_arrow, None}, /* GLUT_CURSOR_UP_DOWN */
- {XC_sb_h_double_arrow, None}, /* GLUT_CURSOR_LEFT_RIGHT */
- {XC_top_side, None}, /* GLUT_CURSOR_TOP_SIDE */
- {XC_bottom_side, None}, /* GLUT_CURSOR_BOTTOM_SIDE */
- {XC_left_side, None}, /* GLUT_CURSOR_LEFT_SIDE */
- {XC_right_side, None}, /* GLUT_CURSOR_RIGHT_SIDE */
- {XC_top_left_corner, None}, /* GLUT_CURSOR_TOP_LEFT_CORNER */
- {XC_top_right_corner, None}, /* GLUT_CURSOR_TOP_RIGHT_CORNER */
- {XC_bottom_right_corner, None}, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */
- {XC_bottom_left_corner, None}, /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */
-};
-/* *INDENT-ON* */
-
-#if !defined(_WIN32) && !defined(__OS2PM__)
-static Cursor blankCursor = None;
-static Cursor fullCrosshairCusor = None;
-
-/* SGI X server's support a special property called the
- _SGI_CROSSHAIR_CURSOR that when installed as a window's
- cursor, becomes a full screen crosshair cursor. SGI
- has special cursor generation hardware for this case. */
-static Cursor
-getFullCrosshairCursor(void)
-{
- Cursor cursor;
- Atom crosshairAtom, actualType;
- int rc, actualFormat;
- unsigned long n, left;
- unsigned long *value;
-
- if (fullCrosshairCusor == None) {
- crosshairAtom = XInternAtom(__glutDisplay,
- "_SGI_CROSSHAIR_CURSOR", True);
- if (crosshairAtom != None) {
- value = 0; /* Make compiler happy. */
- rc = XGetWindowProperty(__glutDisplay, __glutRoot,
- crosshairAtom, 0, 1, False, XA_CURSOR, &actualType,
- &actualFormat, &n, &left, (unsigned char **) &value);
- if (rc == Success && actualFormat == 32 && n >= 1) {
- cursor = value[0];
- XFree(value);
- return cursor;
- }
- }
- }
- return XCreateFontCursor(__glutDisplay, XC_crosshair);
-}
-
-/* X11 forces you to create a blank cursor if you want
- to disable the cursor. */
-static Cursor
-makeBlankCursor(void)
-{
- static char data[1] =
- {0};
- Cursor cursor;
- Pixmap blank;
- XColor dummy;
-
- blank = XCreateBitmapFromData(__glutDisplay, __glutRoot,
- data, 1, 1);
- if (blank == None)
- __glutFatalError("out of memory.");
- cursor = XCreatePixmapCursor(__glutDisplay, blank, blank,
- &dummy, &dummy, 0, 0);
- XFreePixmap(__glutDisplay, blank);
-
- return cursor;
-}
-#endif /* !_WIN32 && !__OS2PM__*/
-
-/* Win32 and X11 use this same function to accomplish
- fairly different tasks. X11 lets you just define the
- cursor for a window and the window system takes care
- of making sure that the window's cursor is installed
- when the mouse is in the window. Win32 requires the
- application to handle a WM_SETCURSOR message to install
- the right cursor when windows are entered. Think of
- the Win32 __glutSetCursor (called from __glutWindowProc)
- as "install cursor". Think of the X11 __glutSetCursor
- (called from glutSetCursor) as "define cursor". */
-void
-__glutSetCursor(GLUTwindow *window)
-{
- int cursor = window->cursor;
- Cursor xcursor = 0;
-
- if (cursor >= 0 &&
- cursor < sizeof(cursorTable) / sizeof(cursorTable[0])) {
- if (cursorTable[cursor].cursor == None) {
- cursorTable[cursor].cursor = XCreateFontCursor(__glutDisplay,
- cursorTable[cursor].glyph);
- }
- xcursor = cursorTable[cursor].cursor;
- } else {
- /* Special cases. */
- switch (cursor) {
- case GLUT_CURSOR_INHERIT:
-#if defined(_WIN32)
- while (window->parent) {
- window = window->parent;
- if (window->cursor != GLUT_CURSOR_INHERIT) {
- __glutSetCursor(window);
- return;
- }
- }
- /* XXX Default to an arrow cursor. Is this
- right or should we be letting the default
- window proc be installing some system cursor? */
- xcursor = cursorTable[0].cursor;
- if (xcursor == NULL) {
- xcursor =
- cursorTable[0].cursor =
- LoadCursor(NULL, cursorTable[0].glyph);
- }
-
-#elif defined(__OS2PM__)
-//todo
- xcursor = None;
-
-#else
- xcursor = None;
-#endif
- break;
- case GLUT_CURSOR_NONE:
-#if defined(_WIN32) || defined(__OS2PM__)
- xcursor = NULL;
-#else
- if (blankCursor == None) {
- blankCursor = makeBlankCursor();
- }
- xcursor = blankCursor;
-#endif
- break;
- case GLUT_CURSOR_FULL_CROSSHAIR:
-#if defined(_WIN32)
- xcursor = (HICON) IDC_CROSS;
-#elif defined(__OS2PM__)
-//todo
-#else
- if (fullCrosshairCusor == None) {
- fullCrosshairCusor = getFullCrosshairCursor();
- }
- xcursor = fullCrosshairCusor;
-#endif
- break;
- }
- }
- XDefineCursor(__glutDisplay,
- window->win, xcursor);
- XFlush(__glutDisplay);
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutSetCursor(int cursor)
-{
-#ifdef _WIN32
- POINT point;
-
- __glutCurrentWindow->cursor = cursor;
- /* Are we in the window right now? If so,
- install the cursor. */
- GetCursorPos(&point);
- if (__glutCurrentWindow->win == WindowFromPoint(point)) {
- __glutSetCursor(__glutCurrentWindow);
- }
-#elif defined(__OS2PM__)
-//todo
-#else
- __glutCurrentWindow->cursor = cursor;
- __glutSetCursor(__glutCurrentWindow);
-#endif
-}
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_event.cpp b/src/glut/os2/glut_event.cpp
deleted file mode 100644
index c556ef28265..00000000000
--- a/src/glut/os2/glut_event.cpp
+++ /dev/null
@@ -1,1399 +0,0 @@
-/* glut_event.c */
-/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1997, 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. */
-
-#ifdef __VMS
-#include <GL/vms_x_fix.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-#include <string.h> /* Some FD_ZERO macros use memset without
- prototyping memset. */
-
-/* Much of the following #ifdef logic to include the proper
- prototypes for the select system call is based on logic
- from the X11R6.3 version of <X11/Xpoll.h>. */
-
-#if !defined(_WIN32)
-# ifdef __sgi
-# include <bstring.h> /* prototype for bzero used by FD_ZERO */
-# endif
-# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
-# include <sys/select.h> /* select system call interface */
-# ifdef luna
-# include <sysent.h>
-# endif
-# endif
- /* AIX 4.2 fubar-ed <sys/select.h>, so go to heroic measures to get it */
-# if defined(AIXV4) && !defined(NFDBITS)
-# include <sys/select.h>
-# endif
-#endif /* !_WIN32 */
-
-#include <sys/types.h>
-
-#if defined(__OS2__)
-//??? ­ ä¨£  ?? # include <sys/time.h>
-#elif !defined(_WIN32)
-# if defined(__vms) && ( __VMS_VER < 70000000 )
-# include <sys/time.h>
-# else
-# ifndef __vms
-# include <sys/time.h>
-# endif
-# endif
-# include <unistd.h>
-# include <X11/Xlib.h>
-# include <X11/keysym.h>
-#else
-# ifdef __CYGWIN32__
-# include <sys/time.h>
-# else
-# include <sys/timeb.h>
-# endif
-# ifdef __hpux
- /* XXX Bert Gijsbers <bert@mc.bio.uva.nl> reports that HP-UX
- needs different keysyms for the End, Insert, and Delete keys
- to work on an HP 715. It would be better if HP generated
- standard keysyms for standard keys. */
-# include <X11/HPkeysym.h>
-# endif
-#endif /* !_WIN32 */
-
-#include "glutint.h"
-
-#if defined(__vms) && ( __VMS_VER < 70000000 )
-#include <ssdef.h>
-#include <psldef.h>
-extern int SYS$CLREF(int efn);
-extern int SYS$SETIMR(unsigned int efn, struct timeval6 *timeout, void *ast,
- unsigned int request_id, unsigned int flags);
-extern int SYS$WFLOR(unsigned int efn, unsigned int mask);
-extern int SYS$CANTIM(unsigned int request_id, unsigned int mode);
-#endif /* __vms, VMs 6.2 or earlier */
-
-static GLUTtimer *freeTimerList = NULL;
-
-GLUTidleCB __glutIdleFunc = NULL;
-GLUTtimer *__glutTimerList = NULL;
-#ifdef SUPPORT_FORTRAN
-GLUTtimer *__glutNewTimer;
-#endif
-GLUTwindow *__glutWindowWorkList = NULL;
-GLUTmenu *__glutMappedMenu;
-GLUTmenu *__glutCurrentMenu = NULL;
-
-void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *);
-#if !defined(_WIN32) && !defined(__OS2__)
-void (*__glutMenuItemEnterOrLeave)(GLUTmenuItem * item, int num, int type) = NULL;
-void (*__glutFinishMenu)(Window win, int x, int y);
-void (*__glutPaintMenu)(GLUTmenu * menu);
-void (*__glutStartMenu)(GLUTmenu * menu, GLUTwindow * window, int x, int y, int x_win, int y_win);
-GLUTmenu * (*__glutGetMenuByNum)(int menunum);
-GLUTmenuItem * (*__glutGetMenuItem)(GLUTmenu * menu, Window win, int *which);
-GLUTmenu * (*__glutGetMenu)(Window win);
-#endif
-
-Atom __glutMotifHints = None;
-/* Modifier mask of ~0 implies not in core input callback. */
-unsigned int __glutModifierMask = (unsigned int) ~0;
-int __glutWindowDamaged = 0;
-
-void GLUTAPIENTRY
-glutIdleFunc(GLUTidleCB idleFunc)
-{
- __glutIdleFunc = idleFunc;
-}
-
-void GLUTAPIENTRY
-glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value)
-{
- GLUTtimer *timer, *other;
- GLUTtimer **prevptr;
-#ifdef OLD_VMS
- struct timeval6 now;
-#else
- struct timeval now;
-#endif
-
- if (!timerFunc)
- return;
-
- if (freeTimerList) {
- timer = freeTimerList;
- freeTimerList = timer->next;
- } else {
- timer = (GLUTtimer *) malloc(sizeof(GLUTtimer));
- if (!timer)
- __glutFatalError("out of memory.");
- }
-
- timer->func = timerFunc;
-#if defined(__vms) && ( __VMS_VER < 70000000 )
- /* VMS time is expressed in units of 100 ns */
- timer->timeout.val = interval * TICKS_PER_MILLISECOND;
-#else
- timer->timeout.tv_sec = (int) interval / 1000;
- timer->timeout.tv_usec = (int) (interval % 1000) * 1000;
-#endif
- timer->value = value;
- timer->next = NULL;
- GETTIMEOFDAY(&now);
- ADD_TIME(timer->timeout, timer->timeout, now);
- prevptr = &__glutTimerList;
- other = *prevptr;
- while (other && IS_AFTER(other->timeout, timer->timeout)) {
- prevptr = &other->next;
- other = *prevptr;
- }
- timer->next = other;
-#ifdef SUPPORT_FORTRAN
- __glutNewTimer = timer; /* for Fortran binding! */
-#endif
- *prevptr = timer;
-}
-
-void
-handleTimeouts(void)
-{
-#ifdef OLD_VMS
- struct timeval6 now;
-#else
- struct timeval now;
-#endif
- GLUTtimer *timer;
-
- /* Assumption is that __glutTimerList is already determined
- to be non-NULL. */
- GETTIMEOFDAY(&now);
- while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) {
- timer = __glutTimerList;
- timer->func(timer->value);
- __glutTimerList = timer->next;
- timer->next = freeTimerList;
- freeTimerList = timer;
- if (!__glutTimerList)
- break;
- }
-}
-
-void
-__glutPutOnWorkList(GLUTwindow * window, int workMask)
-{
- if (window->workMask) {
- /* Already on list; just OR in new workMask. */
- window->workMask |= workMask;
- } else {
- /* Update work mask and add to window work list. */
- window->workMask = workMask;
- /* Assert that if the window does not have a
- workMask already, the window should definitely
- not be the head of the work list. */
- assert(window != __glutWindowWorkList);
- window->prevWorkWin = __glutWindowWorkList;
- __glutWindowWorkList = window;
- }
-}
-
-void
-__glutPostRedisplay(GLUTwindow * window, int layerMask)
-{
- int shown = (layerMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) ?
- window->shownState : window->overlay->shownState;
-
- /* Post a redisplay if the window is visible (or the
- visibility of the window is unknown, ie. window->visState
- == -1) _and_ the layer is known to be shown. */
- if (window->visState != GLUT_HIDDEN
- && window->visState != GLUT_FULLY_COVERED && shown) {
- __glutPutOnWorkList(window, layerMask);
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutPostRedisplay(void)
-{
- __glutPostRedisplay(__glutCurrentWindow, GLUT_REDISPLAY_WORK);
-}
-
-/* The advantage of this routine is that it saves the cost of a
- glutSetWindow call (entailing an expensive OpenGL context switch),
- particularly useful when multiple windows need redisplays posted at
- the same times. See also glutPostWindowOverlayRedisplay. */
-void GLUTAPIENTRY
-glutPostWindowRedisplay(int win)
-{
- __glutPostRedisplay(__glutWindowList[win - 1], GLUT_REDISPLAY_WORK);
-}
-
-/* ENDCENTRY */
-static GLUTeventParser *eventParserList = NULL;
-
-/* __glutRegisterEventParser allows another module to register
- to intercept X events types not otherwise acted on by the
- GLUT processEventsAndTimeouts routine. The X Input
- extension support code uses an event parser for handling X
- Input extension events. */
-
-void
-__glutRegisterEventParser(GLUTeventParser * parser)
-{
- parser->next = eventParserList;
- eventParserList = parser;
-}
-
-static void
-markWindowHidden(GLUTwindow * window)
-{
- if (GLUT_HIDDEN != window->visState) {
- GLUTwindow *child;
-
- if (window->windowStatus) {
- window->visState = GLUT_HIDDEN;
- __glutSetWindow(window);
- window->windowStatus(GLUT_HIDDEN);
- }
- /* An unmap is only reported on a single window; its
- descendents need to know they are no longer visible. */
- child = window->children;
- while (child) {
- markWindowHidden(child);
- child = child->siblings;
- }
- }
-}
-
-#if !defined(_WIN32) && !defined(__OS2__)
-
-static void
-purgeStaleWindow(Window win)
-{
- GLUTstale **pEntry = &__glutStaleWindowList;
- GLUTstale *entry = __glutStaleWindowList;
-
- /* Tranverse singly-linked stale window list look for the
- window ID. */
- while (entry) {
- if (entry->win == win) {
- /* Found it; delete it. */
- *pEntry = entry->next;
- free(entry);
- return;
- } else {
- pEntry = &entry->next;
- entry = *pEntry;
- }
- }
-}
-
-/* Unlike XNextEvent, if a signal arrives,
- interruptibleXNextEvent will return (with a zero return
- value). This helps GLUT drop out of XNextEvent if a signal
- is delivered. The intent is so that a GLUT program can call
- glutIdleFunc in a signal handler to register an idle func
- and then immediately get dropped into the idle func (after
- returning from the signal handler). The idea is to make
- GLUT's main loop reliably interruptible by signals. */
-static int
-interruptibleXNextEvent(Display * dpy, XEvent * event)
-{
- fd_set fds;
- int rc;
-
- /* Flush X protocol since XPending does not do this
- implicitly. */
- XFlush(__glutDisplay);
- for (;;) {
- if (XPending(__glutDisplay)) {
- XNextEvent(dpy, event);
- return 1;
- }
-#ifndef VMS
- /* the combination ConectionNumber-select is buggy on VMS. Sometimes it
- * fails. This part of the code hangs the program on VMS7.2. But even
- * without it the program seems to run correctly.
- * Note that this is a bug in the VMS/DECWindows run-time-libraries.
- * Compaq engeneering does not want or is not able to make a fix.
- * (last sentence is a quotation from Compaq when I reported the
- * problem January 2000) */
- FD_ZERO(&fds);
- FD_SET(__glutConnectionFD, &fds);
- rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, NULL);
- if (rc < 0) {
- if (errno == EINTR) {
- return 0;
- } else {
- __glutFatalError("select error.");
- }
- }
-#endif
- }
-}
-
-#endif
-
-static void
-processEventsAndTimeouts(void)
-{
- do {
-#if defined(__OS2__)
- QMSG qmsg; /* message from message queue */
- extern HAB hab; /* PM anchor block handle */
-
- if(! WinGetMsg( hab, &qmsg, 0UL, 0UL, 0UL ) )
- exit(0);
- WinDispatchMsg( hab, /* PM anchor block handle */
- &qmsg ); /* pointer to message */
-
-#elif defined(_WIN32)
- MSG event;
-
- if(!GetMessage(&event, NULL, 0, 0)) /* bail if no more messages */
- exit(0);
- TranslateMessage(&event); /* translate virtual-key messages */
- DispatchMessage(&event); /* call the window proc */
- /* see win32_event.c for event (message) processing procedures */
-#else
- static int mappedMenuButton;
- GLUTeventParser *parser;
- XEvent event, ahead;
- GLUTwindow *window;
- GLUTkeyboardCB keyboard;
- GLUTspecialCB special;
- int gotEvent, width, height;
-
- gotEvent = interruptibleXNextEvent(__glutDisplay, &event);
- if (gotEvent) {
- switch (event.type) {
- case MappingNotify:
- XRefreshKeyboardMapping((XMappingEvent *) & event);
- break;
- case ConfigureNotify:
- window = __glutGetWindow(event.xconfigure.window);
- if (window) {
- if (window->win != event.xconfigure.window) {
- /* Ignore ConfigureNotify sent to the overlay
- planes. GLUT could get here because overlays
- select for StructureNotify events to receive
- DestroyNotify. */
- break;
- }
- width = event.xconfigure.width;
- height = event.xconfigure.height;
- if (width != window->width || height != window->height) {
- if (window->overlay) {
- XResizeWindow(__glutDisplay, window->overlay->win, width, height);
- }
- window->width = width;
- window->height = height;
- __glutSetWindow(window);
- /* Do not execute OpenGL out of sequence with
- respect to the XResizeWindow request! */
- glXWaitX();
- window->reshape(width, height);
- window->forceReshape = False;
- /* A reshape should be considered like posting a
- repair; this is necessary for the "Mesa
- glXSwapBuffers to repair damage" hack to operate
- correctly. Without it, there's not an initial
- back buffer render from which to blit from when
- damage happens to the window. */
- __glutPostRedisplay(window, GLUT_REPAIR_WORK);
- }
- }
- break;
- case Expose:
- /* compress expose events */
- while (XEventsQueued(__glutDisplay, QueuedAfterReading)
- > 0) {
- XPeekEvent(__glutDisplay, &ahead);
- if (ahead.type != Expose ||
- ahead.xexpose.window != event.xexpose.window) {
- break;
- }
- XNextEvent(__glutDisplay, &event);
- }
- if (event.xexpose.count == 0) {
- GLUTmenu *menu;
-
- if (__glutMappedMenu &&
- (menu = __glutGetMenu(event.xexpose.window))) {
- __glutPaintMenu(menu);
- } else {
- window = __glutGetWindow(event.xexpose.window);
- if (window) {
- if (window->win == event.xexpose.window) {
- __glutPostRedisplay(window, GLUT_REPAIR_WORK);
- } else if (window->overlay && window->overlay->win == event.xexpose.window) {
- __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK);
- }
- }
- }
- } else {
- /* there are more exposes to read; wait to redisplay */
- }
- break;
- case ButtonPress:
- case ButtonRelease:
- if (__glutMappedMenu && event.type == ButtonRelease
- && mappedMenuButton == event.xbutton.button) {
- /* Menu is currently popped up and its button is
- released. */
- __glutFinishMenu(event.xbutton.window, event.xbutton.x, event.xbutton.y);
- } else {
- window = __glutGetWindow(event.xbutton.window);
- if (window) {
- GLUTmenu *menu;
- int menuNum;
-
- menuNum = window->menu[event.xbutton.button - 1];
- /* Make sure that __glutGetMenuByNum is only called if there
- really is a menu present. */
- if ((menuNum > 0) && (menu = __glutGetMenuByNum(menuNum))) {
- if (event.type == ButtonPress && !__glutMappedMenu) {
- __glutStartMenu(menu, window,
- event.xbutton.x_root, event.xbutton.y_root,
- event.xbutton.x, event.xbutton.y);
- mappedMenuButton = event.xbutton.button;
- } else {
- /* Ignore a release of a button with a menu
- attatched to it when no menu is popped up,
- or ignore a press when another menu is
- already popped up. */
- }
- } else if (window->mouse) {
- __glutSetWindow(window);
- __glutModifierMask = event.xbutton.state;
- window->mouse(event.xbutton.button - 1,
- event.type == ButtonRelease ?
- GLUT_UP : GLUT_DOWN,
- event.xbutton.x, event.xbutton.y);
- __glutModifierMask = ~0;
- } else {
- /* Stray mouse events. Ignore. */
- }
- } else {
- /* Window might have been destroyed and all the
- events for the window may not yet be received. */
- }
- }
- break;
- case MotionNotify:
- if (!__glutMappedMenu) {
- window = __glutGetWindow(event.xmotion.window);
- if (window) {
- /* If motion function registered _and_ buttons held
- * down, call motion function... */
- if (window->motion && event.xmotion.state &
- (Button1Mask | Button2Mask | Button3Mask)) {
- __glutSetWindow(window);
- window->motion(event.xmotion.x, event.xmotion.y);
- }
- /* If passive motion function registered _and_
- buttons not held down, call passive motion
- function... */
- else if (window->passive &&
- ((event.xmotion.state &
- (Button1Mask | Button2Mask | Button3Mask)) ==
- 0)) {
- __glutSetWindow(window);
- window->passive(event.xmotion.x,
- event.xmotion.y);
- }
- }
- } else {
- /* Motion events are thrown away when a pop up menu
- is active. */
- }
- break;
- case KeyPress:
- case KeyRelease:
- window = __glutGetWindow(event.xkey.window);
- if (!window) {
- break;
- }
- if (event.type == KeyPress) {
- keyboard = window->keyboard;
- } else {
-
- /* If we are ignoring auto repeated keys for this window,
- check if the next event in the X event queue is a KeyPress
- for the exact same key (and at the exact same time) as the
- key being released. The X11 protocol will send auto
- repeated keys as such KeyRelease/KeyPress pairs. */
-
- if (window->ignoreKeyRepeat) {
- if (XEventsQueued(__glutDisplay, QueuedAfterReading)) {
- XPeekEvent(__glutDisplay, &ahead);
- if (ahead.type == KeyPress
- && ahead.xkey.window == event.xkey.window
- && ahead.xkey.keycode == event.xkey.keycode
- && ahead.xkey.time == event.xkey.time) {
- /* Pop off the repeated KeyPress and ignore
- the auto repeated KeyRelease/KeyPress pair. */
- XNextEvent(__glutDisplay, &event);
- break;
- }
- }
- }
- keyboard = window->keyboardUp;
- }
- if (keyboard) {
- char tmp[1];
- int rc;
-
- rc = XLookupString(&event.xkey, tmp, sizeof(tmp),
- NULL, NULL);
- if (rc) {
- __glutSetWindow(window);
- __glutModifierMask = event.xkey.state;
- keyboard(tmp[0],
- event.xkey.x, event.xkey.y);
- __glutModifierMask = ~0;
- break;
- }
- }
- if (event.type == KeyPress) {
- special = window->special;
- } else {
- special = window->specialUp;
- }
- if (special) {
- KeySym ks;
- int key;
-
-/* Introduced in X11R6: (Partial list of) Keypad Functions. Define
- in place in case compiling against an older pre-X11R6
- X11/keysymdef.h file. */
-#ifndef XK_KP_Home
-#define XK_KP_Home 0xFF95
-#endif
-#ifndef XK_KP_Left
-#define XK_KP_Left 0xFF96
-#endif
-#ifndef XK_KP_Up
-#define XK_KP_Up 0xFF97
-#endif
-#ifndef XK_KP_Right
-#define XK_KP_Right 0xFF98
-#endif
-#ifndef XK_KP_Down
-#define XK_KP_Down 0xFF99
-#endif
-#ifndef XK_KP_Prior
-#define XK_KP_Prior 0xFF9A
-#endif
-#ifndef XK_KP_Next
-#define XK_KP_Next 0xFF9B
-#endif
-#ifndef XK_KP_End
-#define XK_KP_End 0xFF9C
-#endif
-#ifndef XK_KP_Insert
-#define XK_KP_Insert 0xFF9E
-#endif
-#ifndef XK_KP_Delete
-#define XK_KP_Delete 0xFF9F
-#endif
-
- ks = XLookupKeysym((XKeyEvent *) & event, 0);
- /* XXX Verbose, but makes no assumptions about keysym
- layout. */
- switch (ks) {
-/* *INDENT-OFF* */
- /* function keys */
- case XK_F1: key = GLUT_KEY_F1; break;
- case XK_F2: key = GLUT_KEY_F2; break;
- case XK_F3: key = GLUT_KEY_F3; break;
- case XK_F4: key = GLUT_KEY_F4; break;
- case XK_F5: key = GLUT_KEY_F5; break;
- case XK_F6: key = GLUT_KEY_F6; break;
- case XK_F7: key = GLUT_KEY_F7; break;
- case XK_F8: key = GLUT_KEY_F8; break;
- case XK_F9: key = GLUT_KEY_F9; break;
- case XK_F10: key = GLUT_KEY_F10; break;
- case XK_F11: key = GLUT_KEY_F11; break;
- case XK_F12: key = GLUT_KEY_F12; break;
- /* directional keys */
- case XK_KP_Left:
- case XK_Left: key = GLUT_KEY_LEFT; break;
- case XK_KP_Up: /* Introduced in X11R6. */
- case XK_Up: key = GLUT_KEY_UP; break;
- case XK_KP_Right: /* Introduced in X11R6. */
- case XK_Right: key = GLUT_KEY_RIGHT; break;
- case XK_KP_Down: /* Introduced in X11R6. */
- case XK_Down: key = GLUT_KEY_DOWN; break;
-/* *INDENT-ON* */
-
- case XK_KP_Prior: /* Introduced in X11R6. */
- case XK_Prior:
- /* XK_Prior same as X11R6's XK_Page_Up */
- key = GLUT_KEY_PAGE_UP;
- break;
- case XK_KP_Next: /* Introduced in X11R6. */
- case XK_Next:
- /* XK_Next same as X11R6's XK_Page_Down */
- key = GLUT_KEY_PAGE_DOWN;
- break;
- case XK_KP_Home: /* Introduced in X11R6. */
- case XK_Home:
- key = GLUT_KEY_HOME;
- break;
-#ifdef __hpux
- case XK_Select:
-#endif
- case XK_KP_End: /* Introduced in X11R6. */
- case XK_End:
- key = GLUT_KEY_END;
- break;
-#ifdef __hpux
- case XK_InsertChar:
-#endif
- case XK_KP_Insert: /* Introduced in X11R6. */
- case XK_Insert:
- key = GLUT_KEY_INSERT;
- break;
-#ifdef __hpux
- case XK_DeleteChar:
-#endif
- case XK_KP_Delete: /* Introduced in X11R6. */
- /* The Delete character is really an ASCII key. */
- __glutSetWindow(window);
- keyboard(127, /* ASCII Delete character. */
- event.xkey.x, event.xkey.y);
- goto skip;
- default:
- goto skip;
- }
- __glutSetWindow(window);
- __glutModifierMask = event.xkey.state;
- special(key, event.xkey.x, event.xkey.y);
- __glutModifierMask = ~0;
- skip:;
- }
- break;
- case EnterNotify:
- case LeaveNotify:
- if (event.xcrossing.mode != NotifyNormal ||
- event.xcrossing.detail == NotifyNonlinearVirtual ||
- event.xcrossing.detail == NotifyVirtual) {
-
- /* Careful to ignore Enter/LeaveNotify events that
- come from the pop-up menu pointer grab and ungrab.
- Also, ignore "virtual" Enter/LeaveNotify events
- since they represent the pointer passing through
- the window hierarchy without actually entering or
- leaving the actual real estate of a window. */
-
- break;
- }
- if (__glutMappedMenu) {
- GLUTmenuItem *item;
- int num;
-
- item = __glutGetMenuItem(__glutMappedMenu,
- event.xcrossing.window, &num);
- if (item) {
- __glutMenuItemEnterOrLeave(item, num, event.type);
- break;
- }
- }
- window = __glutGetWindow(event.xcrossing.window);
- if (window) {
- if (window->entry) {
- if (event.type == EnterNotify) {
-
- /* With overlays established, X can report two
- enter events for both the overlay and normal
- plane window. Do not generate a second enter
- callback if we reported one without an
- intervening leave. */
-
- if (window->entryState != EnterNotify) {
- int num = window->num;
- Window xid = window->win;
-
- window->entryState = EnterNotify;
- __glutSetWindow(window);
- window->entry(GLUT_ENTERED);
-
- if (__glutMappedMenu) {
-
- /* Do not generate any passive motion events
- when menus are in use. */
-
- } else {
-
- /* An EnterNotify event can result in a
- "compound" callback if a passive motion
- callback is also registered. In this case,
- be a little paranoid about the possibility
- the window could have been destroyed in the
- entry callback. */
-
- window = __glutWindowList[num];
- if (window && window->passive && window->win == xid) {
- __glutSetWindow(window);
- window->passive(event.xcrossing.x, event.xcrossing.y);
- }
- }
- }
- } else {
- if (window->entryState != LeaveNotify) {
-
- /* When an overlay is established for a window
- already mapped and with the pointer in it,
- the X server will generate a leave/enter
- event pair as the pointer leaves (without
- moving) from the normal plane X window to
- the newly mapped overlay X window (or vice
- versa). This enter/leave pair should not be
- reported to the GLUT program since the pair
- is a consequence of creating (or destroying)
- the overlay, not an actual leave from the
- GLUT window. */
-
- if (XEventsQueued(__glutDisplay, QueuedAfterReading)) {
- XPeekEvent(__glutDisplay, &ahead);
- if (ahead.type == EnterNotify &&
- __glutGetWindow(ahead.xcrossing.window) == window) {
- XNextEvent(__glutDisplay, &event);
- break;
- }
- }
- window->entryState = LeaveNotify;
- __glutSetWindow(window);
- window->entry(GLUT_LEFT);
- }
- }
- } else if (window->passive) {
- __glutSetWindow(window);
- window->passive(event.xcrossing.x, event.xcrossing.y);
- }
- }
- break;
- case UnmapNotify:
- /* MapNotify events are not needed to maintain
- visibility state since VisibilityNotify events will
- be delivered when a window becomes visible from
- mapping. However, VisibilityNotify events are not
- delivered when a window is unmapped (for the window
- or its children). */
- window = __glutGetWindow(event.xunmap.window);
- if (window) {
- if (window->win != event.xconfigure.window) {
- /* Ignore UnmapNotify sent to the overlay planes.
- GLUT could get here because overlays select for
- StructureNotify events to receive DestroyNotify.
- */
- break;
- }
- markWindowHidden(window);
- }
- break;
- case VisibilityNotify:
- window = __glutGetWindow(event.xvisibility.window);
- if (window) {
- /* VisibilityUnobscured+1 = GLUT_FULLY_RETAINED,
- VisibilityPartiallyObscured+1 =
- GLUT_PARTIALLY_RETAINED, VisibilityFullyObscured+1
- = GLUT_FULLY_COVERED. */
- int visState = event.xvisibility.state + 1;
-
- if (visState != window->visState) {
- if (window->windowStatus) {
- window->visState = visState;
- __glutSetWindow(window);
- window->windowStatus(visState);
- }
- }
- }
- break;
- case ClientMessage:
- if (event.xclient.data.l[0] == __glutWMDeleteWindow)
- exit(0);
- break;
- case DestroyNotify:
- purgeStaleWindow(event.xdestroywindow.window);
- break;
- case CirculateNotify:
- case CreateNotify:
- case GravityNotify:
- case ReparentNotify:
- /* Uninteresting to GLUT (but possible for GLUT to
- receive). */
- break;
- default:
- /* Pass events not directly handled by the GLUT main
- event loop to any event parsers that have been
- registered. In this way, X Input extension events
- are passed to the correct handler without forcing
- all GLUT programs to support X Input event handling.
- */
- parser = eventParserList;
- while (parser) {
- if (parser->func(&event))
- break;
- parser = parser->next;
- }
- break;
- }
- }
-#endif /* _WIN32 */
- if (__glutTimerList) {
- handleTimeouts();
- }
- }
- while (XPending(__glutDisplay));
-}
-
-static void
-waitForSomething(void)
-{
-#if defined(__vms) && ( __VMS_VER < 70000000 )
- static struct timeval6 zerotime =
- {0};
- unsigned int timer_efn;
-#define timer_id 'glut' /* random :-) number */
- unsigned int wait_mask;
-#else
- static struct timeval zerotime =
- {0, 0};
-#if defined(__OS2__)
-
-#elif !defined(_WIN32)
- fd_set fds;
-#endif
-#endif
-#ifdef OLD_VMS
- struct timeval6 now, timeout, waittime;
-#else
- struct timeval now, timeout, waittime;
-#endif
-#if !defined(_WIN32)
- int rc;
-#endif
-
- /* Flush X protocol since XPending does not do this
- implicitly. */
- XFlush(__glutDisplay);
- if (XPending(__glutDisplay)) {
- /* It is possible (but quite rare) that XFlush may have
- needed to wait for a writable X connection file
- descriptor, and in the process, may have had to read off
- X protocol from the file descriptor. If XPending is true,
- this case occured and we should avoid waiting in select
- since X protocol buffered within Xlib is due to be
- processed and potentially no more X protocol is on the
- file descriptor, so we would risk waiting improperly in
- select. */
- goto immediatelyHandleXinput;
- }
-#if defined(__vms) && ( __VMS_VER < 70000000 )
- timeout = __glutTimerList->timeout;
- GETTIMEOFDAY(&now);
- wait_mask = 1 << (__glutConnectionFD & 31);
- if (IS_AFTER(now, timeout)) {
- /* We need an event flag for the timer. */
- /* XXX The `right' way to do this is to use LIB$GET_EF, but
- since it needs to be in the same cluster as the EFN for
- the display, we will have hack it. */
- timer_efn = __glutConnectionFD - 1;
- if ((timer_efn / 32) != (__glutConnectionFD / 32)) {
- timer_efn = __glutConnectionFD + 1;
- }
- rc = SYS$CLREF(timer_efn);
- rc = SYS$SETIMR(timer_efn, &timeout, NULL, timer_id, 0);
- wait_mask |= 1 << (timer_efn & 31);
- } else {
- timer_efn = 0;
- }
- rc = SYS$WFLOR(__glutConnectionFD, wait_mask);
- if (timer_efn != 0 && SYS$CLREF(timer_efn) == SS$_WASCLR) {
- rc = SYS$CANTIM(timer_id, PSL$C_USER);
- }
- /* XXX There does not seem to be checking of "rc" in the code
- above. Can any of the SYS$ routines above fail? */
-#else /* not vms6.2 or lower */
-#if defined(__OS2__)
-
-#elif !defined(_WIN32)
- FD_ZERO(&fds);
- FD_SET(__glutConnectionFD, &fds);
-#endif
- timeout = __glutTimerList->timeout;
- GETTIMEOFDAY(&now);
- if (IS_AFTER(now, timeout)) {
- TIMEDELTA(waittime, timeout, now);
- } else {
- waittime = zerotime;
- }
-
-#if defined(__OS2__)
- DosSleep(0);
-#elif !defined(_WIN32)
- rc = select(__glutConnectionFD + 1, &fds,
- NULL, NULL, &waittime);
- if (rc < 0 && errno != EINTR)
- __glutFatalError("select error.");
-#else
-
- MsgWaitForMultipleObjects(0, NULL, FALSE,
- waittime.tv_sec*1000 + waittime.tv_usec/1000, QS_ALLINPUT);
-
-#endif
-#endif /* not vms6.2 or lower */
- /* Without considering the cause of select unblocking, check
- for pending X events and handle any timeouts (by calling
- processEventsAndTimeouts). We always look for X events
- even if select returned with 0 (indicating a timeout);
- otherwise we risk starving X event processing by continous
- timeouts. */
- if (XPending(__glutDisplay)) {
- immediatelyHandleXinput:
- processEventsAndTimeouts();
- } else {
- if (__glutTimerList)
- handleTimeouts();
- }
-}
-
-static void
-idleWait(void)
-{
- if (XPending(__glutDisplay)) {
- processEventsAndTimeouts();
- } else {
- if (__glutTimerList) {
- handleTimeouts();
- }
- }
- /* Make sure idle func still exists! */
- if (__glutIdleFunc) {
- __glutIdleFunc();
- }
-}
-
-static GLUTwindow **beforeEnd;
-
-static GLUTwindow *
-processWindowWorkList(GLUTwindow * window)
-{
- int workMask;
-
- if (window->prevWorkWin) {
- window->prevWorkWin = processWindowWorkList(window->prevWorkWin);
- } else {
- beforeEnd = &window->prevWorkWin;
- }
-
- /* Capture work mask for work that needs to be done to this
- window, then clear the window's work mask (excepting the
- dummy work bit, see below). Then, process the captured
- work mask. This allows callbacks in the processing the
- captured work mask to set the window's work mask for
- subsequent processing. */
-
- workMask = window->workMask;
- assert((workMask & GLUT_DUMMY_WORK) == 0);
-
- /* Set the dummy work bit, clearing all other bits, to
- indicate that the window is currently on the window work
- list _and_ that the window's work mask is currently being
- processed. This convinces __glutPutOnWorkList that this
- window is on the work list still. */
- window->workMask = GLUT_DUMMY_WORK;
-
- /* Optimization: most of the time, the work to do is a
- redisplay and not these other types of work. Check for
- the following cases as a group to before checking each one
- individually one by one. This saves about 25 MIPS
- instructions in the common redisplay only case. */
- if (workMask & (GLUT_EVENT_MASK_WORK | GLUT_DEVICE_MASK_WORK |
- GLUT_CONFIGURE_WORK | GLUT_COLORMAP_WORK | GLUT_MAP_WORK)) {
-
-#if !defined(_WIN32) && !defined(__OS2__)
- /* Be sure to set event mask BEFORE map window is done. */
- if (workMask & GLUT_EVENT_MASK_WORK) {
- long eventMask;
-
- /* Make sure children are not propogating events this
- window is selecting for. Be sure to do this before
- enabling events on the children's parent. */
- if (window->children) {
- GLUTwindow *child = window->children;
- unsigned long attribMask = CWDontPropagate;
- XSetWindowAttributes wa;
-
- wa.do_not_propagate_mask = window->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK;
- if (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) {
- wa.event_mask = child->eventMask | (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK);
- attribMask |= CWEventMask;
- }
- do {
- XChangeWindowAttributes(__glutDisplay, child->win,
- attribMask, &wa);
- child = child->siblings;
- } while (child);
- }
- eventMask = window->eventMask;
- if (window->parent && window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK)
- eventMask |= (window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK);
- XSelectInput(__glutDisplay, window->win, eventMask);
- if (window->overlay)
- XSelectInput(__glutDisplay, window->overlay->win,
- window->eventMask & GLUT_OVERLAY_EVENT_FILTER_MASK);
- }
-#endif /* !_WIN32 */
- /* Be sure to set device mask BEFORE map window is done. */
- if (workMask & GLUT_DEVICE_MASK_WORK) {
- __glutUpdateInputDeviceMaskFunc(window);
- }
- /* Be sure to configure window BEFORE map window is done. */
- if (workMask & GLUT_CONFIGURE_WORK) {
-#if defined(__OS2__)
- RECTL changes;
-
-#elif defined(_WIN32)
- RECT changes;
- POINT point;
- UINT flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER
- | SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER;
-
- GetClientRect(window->win, &changes);
-
- /* If this window is a toplevel window, translate the 0,0 client
- coordinate into a screen coordinate for proper placement. */
- if (!window->parent) {
- point.x = 0;
- point.y = 0;
- ClientToScreen(window->win, &point);
- changes.left = point.x;
- changes.top = point.y;
- }
- if (window->desiredConfMask & (CWX | CWY)) {
- changes.left = window->desiredX;
- changes.top = window->desiredY;
- flags &= ~SWP_NOMOVE;
- }
- if (window->desiredConfMask & (CWWidth | CWHeight)) {
- changes.right = changes.left + window->desiredWidth;
- changes.bottom = changes.top + window->desiredHeight;
- flags &= ~SWP_NOSIZE;
- /* XXX If overlay exists, resize the overlay here, ie.
- if (window->overlay) ... */
- }
- if (window->desiredConfMask & CWStackMode) {
- flags &= ~SWP_NOZORDER;
- /* XXX Overlay support might require something special here. */
- }
-
- /* Adjust the window rectangle because Win32 thinks that the x, y,
- width & height are the WHOLE window (including decorations),
- whereas GLUT treats the x, y, width & height as only the CLIENT
- area of the window. Only do this to top level windows
- that are not in game mode (since game mode windows do
- not have any decorations). */
- if (!window->parent && window != __glutGameModeWindow) {
- AdjustWindowRect(&changes,
- WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
- FALSE);
- }
-
- /* Do the repositioning, moving, and push/pop. */
- SetWindowPos(window->win,
- window->desiredStack == Above ? HWND_TOP : HWND_NOTOPMOST,
- changes.left, changes.top,
- changes.right - changes.left, changes.bottom - changes.top,
- flags);
-
- /* Zero out the mask. */
- window->desiredConfMask = 0;
-
- /* This hack causes the window to go back to the right position
- when it is taken out of fullscreen mode. */
- if (workMask & GLUT_FULL_SCREEN_WORK) {
- window->desiredConfMask |= CWX | CWY;
- window->desiredX = point.x;
- window->desiredY = point.y;
- }
-#else /* !_WIN32 */
- XWindowChanges changes;
-
- changes.x = window->desiredX;
- changes.y = window->desiredY;
- if (window->desiredConfMask & (CWWidth | CWHeight)) {
- changes.width = window->desiredWidth;
- changes.height = window->desiredHeight;
- if (window->overlay)
- XResizeWindow(__glutDisplay, window->overlay->win,
- window->desiredWidth, window->desiredHeight);
- if (__glutMotifHints != None) {
- if (workMask & GLUT_FULL_SCREEN_WORK) {
- MotifWmHints hints;
-
- hints.flags = MWM_HINTS_DECORATIONS;
- hints.decorations = 0; /* Absolutely no
- decorations. */
- XChangeProperty(__glutDisplay, window->win,
- __glutMotifHints, __glutMotifHints, 32,
- PropModeReplace, (unsigned char *) &hints, 4);
- if (workMask & GLUT_MAP_WORK) {
- /* Handle case where glutFullScreen is called
- before the first time that the window is
- mapped. Some window managers will randomly or
- interactively position the window the first
- time it is mapped if the window's
- WM_NORMAL_HINTS property does not request an
- explicit position. We don't want any such
- window manager interaction when going
- fullscreen. Overwrite the WM_NORMAL_HINTS
- property installed by glutCreateWindow's
- XSetWMProperties property with one explicitly
- requesting a fullscreen window. */
- XSizeHints hints;
-
- hints.flags = USPosition | USSize;
- hints.x = 0;
- hints.y = 0;
- hints.width = window->desiredWidth;
- hints.height = window->desiredHeight;
- XSetWMNormalHints(__glutDisplay, window->win, &hints);
- }
- } else {
- XDeleteProperty(__glutDisplay, window->win, __glutMotifHints);
- }
- }
- }
- if (window->desiredConfMask & CWStackMode) {
- changes.stack_mode = window->desiredStack;
- /* Do not let glutPushWindow push window beneath the
- underlay. */
- if (window->parent && window->parent->overlay
- && window->desiredStack == Below) {
- changes.stack_mode = Above;
- changes.sibling = window->parent->overlay->win;
- window->desiredConfMask |= CWSibling;
- }
- }
- XConfigureWindow(__glutDisplay, window->win,
- window->desiredConfMask, &changes);
- window->desiredConfMask = 0;
-#endif
- }
-#if !defined(_WIN32) && !defined(__OS2__)
- /* Be sure to establish the colormaps BEFORE map window is
- done. */
- if (workMask & GLUT_COLORMAP_WORK) {
- __glutEstablishColormapsProperty(window);
- }
-#endif
- if (workMask & GLUT_MAP_WORK) {
- switch (window->desiredMapState) {
- case WithdrawnState:
- if (window->parent) {
- XUnmapWindow(__glutDisplay, window->win);
- } else {
- XWithdrawWindow(__glutDisplay, window->win,
- __glutScreen);
- }
- window->shownState = 0;
- break;
- case NormalState:
- XMapWindow(__glutDisplay, window->win);
- window->shownState = 1;
- break;
-#ifdef _WIN32
- case GameModeState: /* Not an Xlib value. */
- ShowWindow(window->win, SW_SHOW);
- window->shownState = 1;
- break;
-#endif
- case IconicState:
- XIconifyWindow(__glutDisplay, window->win, __glutScreen);
- window->shownState = 0;
- break;
- }
- }
- }
- if (workMask & (GLUT_REDISPLAY_WORK | GLUT_OVERLAY_REDISPLAY_WORK | GLUT_REPAIR_WORK | GLUT_OVERLAY_REPAIR_WORK)) {
- if (window->forceReshape) {
- /* Guarantee that before a display callback is generated
- for a window, a reshape callback must be generated. */
- __glutSetWindow(window);
- window->reshape(window->width, window->height);
- window->forceReshape = False;
-
- /* Setting the redisplay bit on the first reshape is
- necessary to make the "Mesa glXSwapBuffers to repair
- damage" hack operate correctly. Without indicating a
- redisplay is necessary, there's not an initial back
- buffer render from which to blit from when damage
- happens to the window. */
- workMask |= GLUT_REDISPLAY_WORK;
- }
- /* The code below is more involved than otherwise necessary
- because it is paranoid about the overlay or entire window
- being removed or destroyed in the course of the callbacks.
- Notice how the global __glutWindowDamaged is used to record
- the layers' damage status. See the code in glutLayerGet for
- how __glutWindowDamaged is used. The point is to not have to
- update the "damaged" field after the callback since the
- window (or overlay) may be destroyed (or removed) when the
- callback returns. */
-
- if (window->overlay && window->overlay->display) {
- int num = window->num;
- Window xid = window->overlay ? window->overlay->win : None;
-
- /* If an overlay display callback is registered, we
- differentiate between a redisplay needed for the
- overlay and/or normal plane. If there is no overlay
- display callback registered, we simply use the
- standard display callback. */
-
- if (workMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) {
- if (__glutMesaSwapHackSupport) {
- if (window->usedSwapBuffers) {
- if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) {
- SWAP_BUFFERS_WINDOW(window);
- goto skippedDisplayCallback1;
- }
- }
- }
- /* Render to normal plane. */
-#ifdef _WIN32
- window->renderDc = window->hdc;
-#endif
- window->renderWin = window->win;
- window->renderCtx = window->ctx;
- __glutWindowDamaged = (workMask & GLUT_REPAIR_WORK);
- __glutSetWindow(window);
- window->usedSwapBuffers = 0;
- window->display();
- __glutWindowDamaged = 0;
-
- skippedDisplayCallback1:;
- }
- if (workMask & (GLUT_OVERLAY_REDISPLAY_WORK | GLUT_OVERLAY_REPAIR_WORK)) {
- window = __glutWindowList[num];
- if (window && window->overlay &&
- window->overlay->win == xid && window->overlay->display) {
-
- /* Render to overlay. */
-#ifdef _WIN32
- window->renderDc = window->overlay->hdc;
-#endif
- window->renderWin = window->overlay->win;
- window->renderCtx = window->overlay->ctx;
- __glutWindowDamaged = (workMask & GLUT_OVERLAY_REPAIR_WORK);
- __glutSetWindow(window);
- window->overlay->display();
- __glutWindowDamaged = 0;
- } else {
- /* Overlay may have since been destroyed or the
- overlay callback may have been disabled during
- normal display callback. */
- }
- }
- } else {
- if (__glutMesaSwapHackSupport) {
- if (!window->overlay && window->usedSwapBuffers) {
- if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) {
- SWAP_BUFFERS_WINDOW(window);
- goto skippedDisplayCallback2;
- }
- }
- }
- /* Render to normal plane (and possibly overlay). */
- __glutWindowDamaged = (workMask & (GLUT_OVERLAY_REPAIR_WORK | GLUT_REPAIR_WORK));
- __glutSetWindow(window);
- window->usedSwapBuffers = 0;
- window->display();
- __glutWindowDamaged = 0;
-
- skippedDisplayCallback2:;
- }
- }
- /* Combine workMask with window->workMask to determine what
- finish and debug work there is. */
- workMask |= window->workMask;
-
- if (workMask & GLUT_FINISH_WORK) {
- /* Finish work makes sure a glFinish gets done to indirect
- rendering contexts. Indirect contexts tend to have much
- longer latency because lots of OpenGL extension requests
- can queue up in the X protocol stream. __glutSetWindow
- is where the finish works gets queued for indirect
- contexts. */
- __glutSetWindow(window);
- glFinish();
- }
- if (workMask & GLUT_DEBUG_WORK) {
- __glutSetWindow(window);
- glutReportErrors();
- }
- /* Strip out dummy, finish, and debug work bits. */
- window->workMask &= ~(GLUT_DUMMY_WORK | GLUT_FINISH_WORK | GLUT_DEBUG_WORK);
- if (window->workMask) {
- /* Leave on work list. */
- return window;
- } else {
- /* Remove current window from work list. */
- return window->prevWorkWin;
- }
-}
-
-#ifndef _WIN32
-static /* X11 implementations do not need this global. */
-#endif
-void
-__glutProcessWindowWorkLists(void)
-{
- if (__glutWindowWorkList) {
- GLUTwindow *remainder, *work;
-
- work = __glutWindowWorkList;
- __glutWindowWorkList = NULL;
- if (work) {
- remainder = processWindowWorkList(work);
- if (remainder) {
- *beforeEnd = __glutWindowWorkList;
- __glutWindowWorkList = remainder;
- }
- }
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutMainLoop(void)
-{
-#if !defined(_WIN32)
- if (!__glutDisplay)
- __glutFatalUsage("main loop entered with out proper initialization.");
-#endif
- if (!__glutWindowListSize)
- __glutFatalUsage(
- "main loop entered with no windows created.");
- for (;;) {
- __glutProcessWindowWorkLists();
- if (__glutIdleFunc || __glutWindowWorkList) {
- idleWait();
- } else {
- if (__glutTimerList) {
- waitForSomething();
- } else {
- processEventsAndTimeouts();
- }
- }
- }
-}
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_ext.cpp b/src/glut/os2/glut_ext.cpp
deleted file mode 100644
index feb6fbfa20b..00000000000
--- a/src/glut/os2/glut_ext.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
-
-/* 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 <stdlib.h>
-#include <string.h>
-
-#include "glutint.h"
-
-/* CENTRY */
-int GLUTAPIENTRY
-glutExtensionSupported(const char *extension)
-{
- static const GLubyte *extensions = NULL;
- const GLubyte *start;
- GLubyte *where, *terminator;
-
- /* Extension names should not have spaces. */
- where = (GLubyte *) strchr(extension, ' ');
- if (where || *extension == '\0')
- return 0;
-
- if (!extensions) {
- extensions = glGetString(GL_EXTENSIONS);
- }
- /* It takes a bit of care to be fool-proof about parsing the
- OpenGL extensions string. Don't be fooled by sub-strings,
- etc. */
- start = extensions;
- for (;;) {
- /* If your application crashes in the strstr routine below,
- you are probably calling glutExtensionSupported without
- having a current window. Calling glGetString without
- a current OpenGL context has unpredictable results.
- Please fix your program. */
- where = (GLubyte *) strstr((const char *) start, extension);
- if (!where)
- break;
- terminator = where + strlen(extension);
- if (where == start || *(where - 1) == ' ') {
- if (*terminator == ' ' || *terminator == '\0') {
- return 1;
- }
- }
- start = terminator;
- }
- return 0;
-}
-
-
-struct name_address_pair {
- const char *name;
- const void *address;
-};
-
-static struct name_address_pair glut_functions[] = {
- { "glutInit", (const void *) glutInit },
- { "glutInitDisplayMode", (const void *) glutInitDisplayMode },
- { "glutInitDisplayString", (const void *) glutInitDisplayString },
- { "glutInitWindowPosition", (const void *) glutInitWindowPosition },
- { "glutInitWindowSize", (const void *) glutInitWindowSize },
- { "glutMainLoop", (const void *) glutMainLoop },
- { "glutCreateWindow", (const void *) glutCreateWindow },
- { "glutCreateSubWindow", (const void *) glutCreateSubWindow },
- { "glutDestroyWindow", (const void *) glutDestroyWindow },
- { "glutPostRedisplay", (const void *) glutPostRedisplay },
- { "glutPostWindowRedisplay", (const void *) glutPostWindowRedisplay },
- { "glutSwapBuffers", (const void *) glutSwapBuffers },
- { "glutGetWindow", (const void *) glutGetWindow },
- { "glutSetWindow", (const void *) glutSetWindow },
- { "glutSetWindowTitle", (const void *) glutSetWindowTitle },
- { "glutSetIconTitle", (const void *) glutSetIconTitle },
- { "glutPositionWindow", (const void *) glutPositionWindow },
- { "glutReshapeWindow", (const void *) glutReshapeWindow },
- { "glutPopWindow", (const void *) glutPopWindow },
- { "glutPushWindow", (const void *) glutPushWindow },
- { "glutIconifyWindow", (const void *) glutIconifyWindow },
- { "glutShowWindow", (const void *) glutShowWindow },
- { "glutHideWindow", (const void *) glutHideWindow },
- { "glutFullScreen", (const void *) glutFullScreen },
- { "glutSetCursor", (const void *) glutSetCursor },
- { "glutWarpPointer", (const void *) glutWarpPointer },
- { "glutEstablishOverlay", (const void *) glutEstablishOverlay },
- { "glutRemoveOverlay", (const void *) glutRemoveOverlay },
- { "glutUseLayer", (const void *) glutUseLayer },
- { "glutPostOverlayRedisplay", (const void *) glutPostOverlayRedisplay },
- { "glutPostWindowOverlayRedisplay", (const void *) glutPostWindowOverlayRedisplay },
- { "glutShowOverlay", (const void *) glutShowOverlay },
- { "glutHideOverlay", (const void *) glutHideOverlay },
- { "glutCreateMenu", (const void *) glutCreateMenu },
- { "glutDestroyMenu", (const void *) glutDestroyMenu },
- { "glutGetMenu", (const void *) glutGetMenu },
- { "glutSetMenu", (const void *) glutSetMenu },
- { "glutAddMenuEntry", (const void *) glutAddMenuEntry },
- { "glutAddSubMenu", (const void *) glutAddSubMenu },
- { "glutChangeToMenuEntry", (const void *) glutChangeToMenuEntry },
- { "glutChangeToSubMenu", (const void *) glutChangeToSubMenu },
- { "glutRemoveMenuItem", (const void *) glutRemoveMenuItem },
- { "glutAttachMenu", (const void *) glutAttachMenu },
- { "glutDetachMenu", (const void *) glutDetachMenu },
- { "glutDisplayFunc", (const void *) glutDisplayFunc },
- { "glutReshapeFunc", (const void *) glutReshapeFunc },
- { "glutKeyboardFunc", (const void *) glutKeyboardFunc },
- { "glutMouseFunc", (const void *) glutMouseFunc },
- { "glutMotionFunc", (const void *) glutMotionFunc },
- { "glutPassiveMotionFunc", (const void *) glutPassiveMotionFunc },
- { "glutEntryFunc", (const void *) glutEntryFunc },
- { "glutVisibilityFunc", (const void *) glutVisibilityFunc },
- { "glutIdleFunc", (const void *) glutIdleFunc },
- { "glutTimerFunc", (const void *) glutTimerFunc },
- { "glutMenuStateFunc", (const void *) glutMenuStateFunc },
- { "glutSpecialFunc", (const void *) glutSpecialFunc },
- { "glutSpaceballMotionFunc", (const void *) glutSpaceballMotionFunc },
- { "glutSpaceballRotateFunc", (const void *) glutSpaceballRotateFunc },
- { "glutSpaceballButtonFunc", (const void *) glutSpaceballButtonFunc },
- { "glutButtonBoxFunc", (const void *) glutButtonBoxFunc },
- { "glutDialsFunc", (const void *) glutDialsFunc },
- { "glutTabletMotionFunc", (const void *) glutTabletMotionFunc },
- { "glutTabletButtonFunc", (const void *) glutTabletButtonFunc },
- { "glutMenuStatusFunc", (const void *) glutMenuStatusFunc },
- { "glutOverlayDisplayFunc", (const void *) glutOverlayDisplayFunc },
- { "glutWindowStatusFunc", (const void *) glutWindowStatusFunc },
- { "glutKeyboardUpFunc", (const void *) glutKeyboardUpFunc },
- { "glutSpecialUpFunc", (const void *) glutSpecialUpFunc },
- { "glutJoystickFunc", (const void *) glutJoystickFunc },
- { "glutSetColor", (const void *) glutSetColor },
- { "glutGetColor", (const void *) glutGetColor },
- { "glutCopyColormap", (const void *) glutCopyColormap },
- { "glutGet", (const void *) glutGet },
- { "glutDeviceGet", (const void *) glutDeviceGet },
- { "glutExtensionSupported", (const void *) glutExtensionSupported },
- { "glutGetModifiers", (const void *) glutGetModifiers },
- { "glutLayerGet", (const void *) glutLayerGet },
- { "glutGetProcAddress", (const void *) glutGetProcAddress },
- { "glutBitmapCharacter", (const void *) glutBitmapCharacter },
- { "glutBitmapWidth", (const void *) glutBitmapWidth },
- { "glutStrokeCharacter", (const void *) glutStrokeCharacter },
- { "glutStrokeWidth", (const void *) glutStrokeWidth },
- { "glutBitmapLength", (const void *) glutBitmapLength },
- { "glutStrokeLength", (const void *) glutStrokeLength },
- { "glutWireSphere", (const void *) glutWireSphere },
- { "glutSolidSphere", (const void *) glutSolidSphere },
- { "glutWireCone", (const void *) glutWireCone },
- { "glutSolidCone", (const void *) glutSolidCone },
- { "glutWireCube", (const void *) glutWireCube },
- { "glutSolidCube", (const void *) glutSolidCube },
- { "glutWireTorus", (const void *) glutWireTorus },
- { "glutSolidTorus", (const void *) glutSolidTorus },
- { "glutWireDodecahedron", (const void *) glutWireDodecahedron },
- { "glutSolidDodecahedron", (const void *) glutSolidDodecahedron },
- { "glutWireTeapot", (const void *) glutWireTeapot },
- { "glutSolidTeapot", (const void *) glutSolidTeapot },
- { "glutWireOctahedron", (const void *) glutWireOctahedron },
- { "glutSolidOctahedron", (const void *) glutSolidOctahedron },
- { "glutWireTetrahedron", (const void *) glutWireTetrahedron },
- { "glutSolidTetrahedron", (const void *) glutSolidTetrahedron },
- { "glutWireIcosahedron", (const void *) glutWireIcosahedron },
- { "glutSolidIcosahedron", (const void *) glutSolidIcosahedron },
- { "glutVideoResizeGet", (const void *) glutVideoResizeGet },
- { "glutSetupVideoResizing", (const void *) glutSetupVideoResizing },
- { "glutStopVideoResizing", (const void *) glutStopVideoResizing },
- { "glutVideoResize", (const void *) glutVideoResize },
- { "glutVideoPan", (const void *) glutVideoPan },
- { "glutReportErrors", (const void *) glutReportErrors },
- { "glutIgnoreKeyRepeat", (const void *) glutIgnoreKeyRepeat },
- { "glutSetKeyRepeat", (const void *) glutSetKeyRepeat },
- { "glutForceJoystickFunc", (const void *) glutForceJoystickFunc },
- { "glutGameModeString", (const void *) glutGameModeString },
- { "glutEnterGameMode", (const void *) glutEnterGameMode },
- { "glutLeaveGameMode", (const void *) glutLeaveGameMode },
- { "glutGameModeGet", (const void *) glutGameModeGet },
- { NULL, NULL }
-};
-
-
-/* XXX This isn't an official GLUT function, yet */
-void * GLUTAPIENTRY
-glutGetProcAddress(const char *procName)
-{
- /* Try GLUT functions first */
- int i;
- for (i = 0; glut_functions[i].name; i++) {
- if (strcmp(glut_functions[i].name, procName) == 0)
- return (void *) glut_functions[i].address;
- }
-
- /* Try core GL functions */
-#if defined(_WIN32)
- return (void *) wglGetProcAddress((LPCSTR) procName);
-
-#elif defined(__OS2PM__)
- return (void *) wglGetProcAddress((char *) procName);
-#elif defined(GLX_ARB_get_proc_address)
- return (void *) glXGetProcAddressARB((const GLubyte *) procName);
-#else
- return NULL;
-#endif
-}
-
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_fullscrn.cpp b/src/glut/os2/glut_fullscrn.cpp
deleted file mode 100644
index d6efb68b3a5..00000000000
--- a/src/glut/os2/glut_fullscrn.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1995, 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 <assert.h>
-
-#include "glutint.h"
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutFullScreen(void)
-{
- assert(!__glutCurrentWindow->parent);
- IGNORE_IN_GAME_MODE();
-#if !defined(_WIN32) && !defined(__OS2PM__)
- if (__glutMotifHints == None) {
- __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS",
- SGI_XA__MOTIF_WM_HINTS, 0);
- if (__glutMotifHints == None) {
- __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS.");
- }
- }
-#endif
-
- __glutCurrentWindow->desiredX = 0;
- __glutCurrentWindow->desiredY = 0;
- __glutCurrentWindow->desiredWidth = __glutScreenWidth;
- __glutCurrentWindow->desiredHeight = __glutScreenHeight;
- __glutCurrentWindow->desiredConfMask |= CWX | CWY | CWWidth | CWHeight;
-
- __glutPutOnWorkList(__glutCurrentWindow,
- GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK);
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_gamemode.cpp b/src/glut/os2/glut_gamemode.cpp
deleted file mode 100644
index 50185d7b9d4..00000000000
--- a/src/glut/os2/glut_gamemode.cpp
+++ /dev/null
@@ -1,680 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 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 <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "glutint.h"
-
-#if !defined(_WIN32) && !defined(__OS2__)
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-/* SGI optimization introduced in IRIX 6.3 to avoid X server
- round trips for interning common X atoms. */
-#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS)
-#include <X11/SGIFastAtom.h>
-#else
-#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how)
-#endif
-#endif /* not _WIN32 */
-
-int __glutDisplaySettingsChanged = 0;
-static DisplayMode *dmodes, *currentDm = NULL;
-static int ndmodes = -1;
-GLUTwindow *__glutGameModeWindow = NULL;
-
-#ifdef TEST
-static char *compstr[] =
-{
- "none", "=", "!=", "<=", ">=", ">", "<", "~"
-};
-static char *capstr[] =
-{
- "width", "height", "bpp", "hertz", "num"
-};
-#endif
-
-#if defined(__OS2__)
-void
-#else
-void __cdecl
-#endif
-__glutCloseDownGameMode(void)
-{
- if (__glutDisplaySettingsChanged) {
-#ifdef _WIN32
- /* Assumes that display settings have been changed, that
- is __glutDisplaySettingsChanged is true. */
- ChangeDisplaySettings(NULL, 0);
-#endif
- __glutDisplaySettingsChanged = 0;
- }
- __glutGameModeWindow = NULL;
-}
-
-void GLUTAPIENTRY
-glutLeaveGameMode(void)
-{
- if (__glutGameModeWindow == NULL) {
- __glutWarning("not in game mode so cannot leave game mode");
- return;
- }
- __glutDestroyWindow(__glutGameModeWindow,
- __glutGameModeWindow);
- XFlush(__glutDisplay);
- __glutGameModeWindow = NULL;
-}
-
-#ifdef _WIN32
-
-/* Same values as from MSDN's SetDisp.c example. */
-#define MIN_WIDTH 400
-#define MIN_FREQUENCY 60
-
-static void
-initGameModeSupport(void)
-{
- DEVMODE dm;
- DWORD mode;
- int i;
-
- if (ndmodes >= 0) {
- /* ndmodes is initially -1 to indicate no
- dmodes allocated yet. */
- return;
- }
-
- /* Determine how many display modes there are. */
- ndmodes = 0;
- mode = 0;
- while (EnumDisplaySettings(NULL, mode, &dm)) {
- if (dm.dmPelsWidth >= MIN_WIDTH &&
- (dm.dmDisplayFrequency == 0 ||
- dm.dmDisplayFrequency >= MIN_FREQUENCY)) {
- ndmodes++;
- }
- mode++;
- }
-
- /* Allocate memory for a list of all the display modes. */
- dmodes = (DisplayMode*)
- malloc(ndmodes * sizeof(DisplayMode));
-
- /* Now that we know how many display modes to expect,
- enumerate them again and save the information in
- the list we allocated above. */
- i = 0;
- mode = 0;
- while (EnumDisplaySettings(NULL, mode, &dm)) {
- /* Try to reject any display settings that seem unplausible. */
- if (dm.dmPelsWidth >= MIN_WIDTH &&
- (dm.dmDisplayFrequency == 0 ||
- dm.dmDisplayFrequency >= MIN_FREQUENCY)) {
- dmodes[i].devmode = dm;
- dmodes[i].valid = 1; /* XXX Not used for now. */
- dmodes[i].cap[DM_WIDTH] = dm.dmPelsWidth;
- dmodes[i].cap[DM_HEIGHT] = dm.dmPelsHeight;
- dmodes[i].cap[DM_PIXEL_DEPTH] = dm.dmBitsPerPel;
- if (dm.dmDisplayFrequency == 0) {
- /* Guess a reasonable guess. */
- /* Lame Windows 95 version of EnumDisplaySettings. */
- dmodes[i].cap[DM_HERTZ] = 60;
- } else {
- dmodes[i].cap[DM_HERTZ] = dm.dmDisplayFrequency;
- }
- i++;
- }
- mode++;
- }
-
- assert(i == ndmodes);
-}
-
-#else
-
-/* X Windows version of initGameModeSupport. */
-static void
-initGameModeSupport(void)
-{
- if (ndmodes >= 0) {
- /* ndmodes is initially -1 to indicate no
- dmodes allocated yet. */
- return;
- }
-
- /* Determine how many display modes there are. */
- ndmodes = 0;
-}
-
-#endif
-
-/* This routine is based on similiar code in glut_dstr.c */
-static DisplayMode *
-findMatch(DisplayMode * dmodes, int ndmodes,
- Criterion * criteria, int ncriteria)
-{
- DisplayMode *found;
- int *bestScore, *thisScore;
- int i, j, numok, result = 0, worse, better;
-
- found = NULL;
- numok = 1; /* "num" capability is indexed from 1,
- not 0. */
-
- /* XXX alloca canidate. */
- bestScore = (int *) malloc(ncriteria * sizeof(int));
- if (!bestScore) {
- __glutFatalError("out of memory.");
- }
- for (j = 0; j < ncriteria; j++) {
- /* Very negative number. */
- bestScore[j] = -32768;
- }
-
- /* XXX alloca canidate. */
- thisScore = (int *) malloc(ncriteria * sizeof(int));
- if (!thisScore) {
- __glutFatalError("out of memory.");
- }
-
- for (i = 0; i < ndmodes; i++) {
- if (dmodes[i].valid) {
- worse = 0;
- better = 0;
-
- for (j = 0; j < ncriteria; j++) {
- int cap, cvalue, dvalue;
-
- cap = criteria[j].capability;
- cvalue = criteria[j].value;
- if (cap == NUM) {
- dvalue = numok;
- } else {
- dvalue = dmodes[i].cap[cap];
- }
-#ifdef TEST
- if (verbose)
- printf(" %s %s %d to %d\n",
- capstr[cap], compstr[criteria[j].comparison], cvalue, dvalue);
-#endif
- switch (criteria[j].comparison) {
- case EQ:
- result = cvalue == dvalue;
- thisScore[j] = 1;
- break;
- case NEQ:
- result = cvalue != dvalue;
- thisScore[j] = 1;
- break;
- case LT:
- result = dvalue < cvalue;
- thisScore[j] = dvalue - cvalue;
- break;
- case GT:
- result = dvalue > cvalue;
- thisScore[j] = dvalue - cvalue;
- break;
- case LTE:
- result = dvalue <= cvalue;
- thisScore[j] = dvalue - cvalue;
- break;
- case GTE:
- result = (dvalue >= cvalue);
- thisScore[j] = dvalue - cvalue;
- break;
- case MIN:
- result = dvalue >= cvalue;
- thisScore[j] = cvalue - dvalue;
- break;
- }
-
-#ifdef TEST
- if (verbose)
- printf(" result=%d score=%d bestScore=%d\n", result, thisScore[j], bestScore[j]);
-#endif
-
- if (result) {
- if (better || thisScore[j] > bestScore[j]) {
- better = 1;
- } else if (thisScore[j] == bestScore[j]) {
- /* Keep looking. */
- } else {
- goto nextDM;
- }
- } else {
- if (cap == NUM) {
- worse = 1;
- } else {
- goto nextDM;
- }
- }
-
- }
-
- if (better && !worse) {
- found = &dmodes[i];
- for (j = 0; j < ncriteria; j++) {
- bestScore[j] = thisScore[j];
- }
- }
- numok++;
-
- nextDM:;
-
- }
- }
- free(bestScore);
- free(thisScore);
- return found;
-}
-
-/**
- * Parses strings in the form of:
- * 800x600
- * 800x600:16
- * 800x600@60
- * 800x600:16@60
- * @60
- * :16
- * :16@60
- * NOTE that @ before : is not parsed.
- */
-static int
-specialCaseParse(char *word, Criterion * criterion, int mask)
-{
- char *xstr, *response;
- int got;
- int width, height, bpp, hertz;
-
- switch(word[0]) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- /* The WWWxHHH case. */
- if (mask & (1 << DM_WIDTH)) {
- return -1;
- }
- xstr = strpbrk(&word[1], "x");
- if (xstr) {
- width = (int) strtol(word, &response, 0);
- if (response == word || response[0] != 'x') {
- /* Not a valid number OR needs to be followed by 'x'. */
- return -1;
- }
- height = (int) strtol(&xstr[1], &response, 0);
- if (response == &xstr[1]) {
- /* Not a valid number. */
- return -1;
- }
- criterion[0].capability = DM_WIDTH;
- criterion[0].comparison = EQ;
- criterion[0].value = width;
- criterion[1].capability = DM_HEIGHT;
- criterion[1].comparison = EQ;
- criterion[1].value = height;
- got = specialCaseParse(response,
- &criterion[2], 1 << DM_WIDTH);
- if (got >= 0) {
- return got + 2;
- } else {
- return -1;
- }
- }
- return -1;
- case ':':
- /* The :BPP case. */
- if (mask & (1 << DM_PIXEL_DEPTH)) {
- return -1;
- }
- bpp = (int) strtol(&word[1], &response, 0);
- if (response == &word[1]) {
- /* Not a valid number. */
- return -1;
- }
- criterion[0].capability = DM_PIXEL_DEPTH;
- criterion[0].comparison = EQ;
- criterion[0].value = bpp;
- got = specialCaseParse(response,
- &criterion[1], (1 << DM_WIDTH) | (1 << DM_PIXEL_DEPTH));
- if (got >= 0) {
- return got + 1;
- } else {
- return -1;
- }
- case '@':
- /* The @HZ case. */
- if (mask & (1 << DM_HERTZ)) {
- return -1;
- }
- hertz = (int) strtol(&word[1], &response, 0);
- if (response == &word[1]) {
- /* Not a valid number. */
- return -1;
- }
- criterion[0].capability = DM_HERTZ;
- criterion[0].comparison = EQ;
- criterion[0].value = hertz;
- got = specialCaseParse(response,
- &criterion[1], ~DM_HERTZ);
- if (got >= 0) {
- return got + 1;
- } else {
- return -1;
- }
- case '\0':
- return 0;
- }
- return -1;
-}
-
-/* This routine is based on similiar code in glut_dstr.c */
-static int
-parseCriteria(char *word, Criterion * criterion)
-{
- char *cstr, *vstr, *response;
- int comparator, value = 0;
-
- cstr = strpbrk(word, "=><!~");
- if (cstr) {
- switch (cstr[0]) {
- case '=':
- comparator = EQ;
- vstr = &cstr[1];
- break;
- case '~':
- comparator = MIN;
- vstr = &cstr[1];
- break;
- case '>':
- if (cstr[1] == '=') {
- comparator = GTE;
- vstr = &cstr[2];
- } else {
- comparator = GT;
- vstr = &cstr[1];
- }
- break;
- case '<':
- if (cstr[1] == '=') {
- comparator = LTE;
- vstr = &cstr[2];
- } else {
- comparator = LT;
- vstr = &cstr[1];
- }
- break;
- case '!':
- if (cstr[1] == '=') {
- comparator = NEQ;
- vstr = &cstr[2];
- } else {
- return -1;
- }
- break;
- default:
- return -1;
- }
- value = (int) strtol(vstr, &response, 0);
- if (response == vstr) {
- /* Not a valid number. */
- return -1;
- }
- *cstr = '\0';
- } else {
- comparator = NONE;
- }
- switch (word[0]) {
- case 'b':
- if (!strcmp(word, "bpp")) {
- criterion[0].capability = DM_PIXEL_DEPTH;
- if (comparator == NONE) {
- return -1;
- } else {
- criterion[0].comparison = comparator;
- criterion[0].value = value;
- return 1;
- }
- }
- return -1;
- case 'h':
- if (!strcmp(word, "height")) {
- criterion[0].capability = DM_HEIGHT;
- if (comparator == NONE) {
- return -1;
- } else {
- criterion[0].comparison = comparator;
- criterion[0].value = value;
- return 1;
- }
- }
- if (!strcmp(word, "hertz")) {
- criterion[0].capability = DM_HERTZ;
- if (comparator == NONE) {
- return -1;
- } else {
- criterion[0].comparison = comparator;
- criterion[0].value = value;
- return 1;
- }
- }
- return -1;
- case 'n':
- if (!strcmp(word, "num")) {
- criterion[0].capability = DM_NUM;
- if (comparator == NONE) {
- return -1;
- } else {
- criterion[0].comparison = comparator;
- criterion[0].value = value;
- return 1;
- }
- }
- return -1;
- case 'w':
- if (!strcmp(word, "width")) {
- criterion[0].capability = DM_WIDTH;
- if (comparator == NONE) {
- return -1;
- } else {
- criterion[0].comparison = comparator;
- criterion[0].value = value;
- return 1;
- }
- }
- return -1;
- }
- if (comparator == NONE) {
- return specialCaseParse(word, criterion, 0);
- }
- return -1;
-}
-
-/* This routine is based on similiar code in glut_dstr.c */
-static Criterion *
-parseDisplayString(const char *display, int *ncriteria)
-{
- Criterion *criteria = NULL;
- int n, parsed;
- char *copy, *word;
-
- copy = __glutStrdup(display);
- /* Attempt to estimate how many criteria entries should be
- needed. */
- n = 0;
- word = strtok(copy, " \t");
- while (word) {
- n++;
- word = strtok(NULL, " \t");
- }
- /* Allocate number of words of criteria. A word
- could contain as many as four criteria in the
- worst case. Example: 800x600:16@60 */
- criteria = (Criterion *) malloc(4 * n * sizeof(Criterion));
- if (!criteria) {
- __glutFatalError("out of memory.");
- }
-
- /* Re-copy the copy of the display string. */
- strcpy(copy, display);
-
- n = 0;
- word = strtok(copy, " \t");
- while (word) {
- parsed = parseCriteria(word, &criteria[n]);
- if (parsed >= 0) {
- n += parsed;
- } else {
- __glutWarning("Unrecognized game mode string word: %s (ignoring)\n", word);
- }
- word = strtok(NULL, " \t");
- }
-
- free(copy);
- *ncriteria = n;
- return criteria;
-}
-
-void GLUTAPIENTRY
-glutGameModeString(const char *string)
-{
- Criterion *criteria;
- int ncriteria;
-
- initGameModeSupport();
- criteria = parseDisplayString(string, &ncriteria);
- currentDm = findMatch(dmodes, ndmodes, criteria, ncriteria);
- free(criteria);
-}
-
-int GLUTAPIENTRY
-glutEnterGameMode(void)
-{
- GLUTwindow *window;
- int width, height;
- Window win;
-
- if (__glutMappedMenu) {
- __glutFatalUsage("entering game mode not allowed while menus in use");
- }
- if (__glutGameModeWindow) {
- /* Already in game mode, so blow away game mode
- window so apps can change resolutions. */
- window = __glutGameModeWindow;
- /* Setting the game mode window to NULL tricks
- the window destroy code into not undoing the
- screen display change since we plan on immediately
- doing another mode change. */
- __glutGameModeWindow = NULL;
- __glutDestroyWindow(window, window);
- }
-
- /* Assume default screen size until we find out if we
- can actually change the display settings. */
- width = __glutScreenWidth;
- height = __glutScreenHeight;
-
- if (currentDm) {
-#ifdef _WIN32
- LONG status;
- static int registered = 0;
-
- status = ChangeDisplaySettings(&currentDm->devmode,
- CDS_FULLSCREEN);
- if (status == DISP_CHANGE_SUCCESSFUL) {
- __glutDisplaySettingsChanged = 1;
- width = currentDm->cap[DM_WIDTH];
- height = currentDm->cap[DM_HEIGHT];
- if (!registered) {
- atexit(__glutCloseDownGameMode);
- registered = 1;
- }
- } else {
- /* Switch back to default resolution. */
- ChangeDisplaySettings(NULL, 0);
- }
-#endif
- }
-
- window = __glutCreateWindow(NULL, 0, 0,
- width, height, /* game mode */ 1);
- win = window->win;
-
-#if !defined(_WIN32) && !defined(__OS2__)
- if (__glutMotifHints == None) {
- __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS",
- SGI_XA__MOTIF_WM_HINTS, 0);
- if (__glutMotifHints == None) {
- __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS.");
- }
- }
-
- /* Game mode window is a toplevel window. */
- XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1);
-#endif
-
- /* Schedule the fullscreen property to be added and to
- make sure the window is configured right. Win32
- doesn't need this. */
- window->desiredX = 0;
- window->desiredY = 0;
- window->desiredWidth = width;
- window->desiredHeight = height;
- window->desiredConfMask |= CWX | CWY | CWWidth | CWHeight;
-#ifdef _WIN32
- /* Win32 does not want to use GLUT_FULL_SCREEN_WORK
- for game mode because we need to be maximizing
- the window in game mode, not just sizing it to
- take up the full screen. The Win32-ness of game
- mode happens when you pass 1 in the gameMode parameter
- to __glutCreateWindow above. A gameMode of creates
- a WS_POPUP window, not a standard WS_OVERLAPPEDWINDOW
- window. WS_POPUP ensures the taskbar is hidden. */
- __glutPutOnWorkList(window,
- GLUT_CONFIGURE_WORK);
-#else
- __glutPutOnWorkList(window,
- GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK);
-#endif
-
- __glutGameModeWindow = window;
- return window->num + 1;
-}
-
-int GLUTAPIENTRY
-glutGameModeGet(GLenum mode)
-{
- switch (mode) {
- case GLUT_GAME_MODE_ACTIVE:
- return __glutGameModeWindow != NULL;
- case GLUT_GAME_MODE_POSSIBLE:
- return currentDm != NULL;
- case GLUT_GAME_MODE_WIDTH:
- return currentDm ? currentDm->cap[DM_WIDTH] : -1;
- case GLUT_GAME_MODE_HEIGHT:
- return currentDm ? currentDm->cap[DM_HEIGHT] : -1;
- case GLUT_GAME_MODE_PIXEL_DEPTH:
- return currentDm ? currentDm->cap[DM_PIXEL_DEPTH] : -1;
- case GLUT_GAME_MODE_REFRESH_RATE:
- return currentDm ? currentDm->cap[DM_HERTZ] : -1;
- case GLUT_GAME_MODE_DISPLAY_CHANGED:
- return __glutDisplaySettingsChanged;
- default:
- return -1;
- }
-}
- \ No newline at end of file
diff --git a/src/glut/os2/glut_get.cpp b/src/glut/os2/glut_get.cpp
deleted file mode 100644
index c846f486582..00000000000
--- a/src/glut/os2/glut_get.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997, 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 <assert.h>
-#include <stdlib.h> /* SunOS 4 needs NULL defined for GETTIMEOFDAY macro. */
-#include "glutint.h"
-
-/* CENTRY */
-int GLUTAPIENTRY
-glutGet(GLenum param)
-{
- Window win, root;
- int x, y, value;
- unsigned int width, height, border, depth;
-
- switch (param) {
- case GLUT_INIT_WINDOW_X:
- return __glutInitX;
- case GLUT_INIT_WINDOW_Y:
- return __glutInitY;
- case GLUT_INIT_WINDOW_WIDTH:
- return __glutInitWidth;
- case GLUT_INIT_WINDOW_HEIGHT:
- return __glutInitHeight;
- case GLUT_INIT_DISPLAY_MODE:
- return __glutDisplayMode;
- case GLUT_WINDOW_X:
- XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win,
- __glutRoot, 0, 0, &x, &y, &win);
- return x;
- case GLUT_WINDOW_Y:
- XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win,
- __glutRoot, 0, 0, &x, &y, &win);
- return y;
- case GLUT_WINDOW_WIDTH:
- if (!__glutCurrentWindow->reshape) {
- XGetGeometry(__glutDisplay, __glutCurrentWindow->win,
- &root, &x, &y,
- &width, &height, &border, &depth);
- return width;
- }
- return __glutCurrentWindow->width;
- case GLUT_WINDOW_HEIGHT:
- if (!__glutCurrentWindow->reshape) {
- XGetGeometry(__glutDisplay, __glutCurrentWindow->win,
- &root, &x, &y,
- &width, &height, &border, &depth);
- return height;
- }
- return __glutCurrentWindow->height;
-#ifdef __OS2__
- #define GET_CONFIG(attrib) \
- { if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) \
- glXGetConfig( __glutCurrentWindow->vis, attrib, &value); \
- else \
- glXGetConfig(__glutCurrentWindow->overlay->vis, attrib, &value); \
- } \
-
-#else
-
-#define GET_CONFIG(attrib) { \
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { \
- glXGetConfig(__glutDisplay, __glutCurrentWindow->vis, \
- attrib, &value); \
- } else { \
- glXGetConfig(__glutDisplay, __glutCurrentWindow->overlay->vis, \
- attrib, &value); \
- } \
-}
-#endif
-
- case GLUT_WINDOW_BUFFER_SIZE:
- GET_CONFIG(GLX_BUFFER_SIZE);
- return value;
- case GLUT_WINDOW_STENCIL_SIZE:
- GET_CONFIG(GLX_STENCIL_SIZE);
- return value;
- case GLUT_WINDOW_DEPTH_SIZE:
- GET_CONFIG(GLX_DEPTH_SIZE);
- return value;
- case GLUT_WINDOW_RED_SIZE:
- GET_CONFIG(GLX_RED_SIZE);
- return value;
- case GLUT_WINDOW_GREEN_SIZE:
- GET_CONFIG(GLX_GREEN_SIZE);
- return value;
- case GLUT_WINDOW_BLUE_SIZE:
- GET_CONFIG(GLX_BLUE_SIZE);
- return value;
- case GLUT_WINDOW_ALPHA_SIZE:
- GET_CONFIG(GLX_ALPHA_SIZE);
- return value;
- case GLUT_WINDOW_ACCUM_RED_SIZE:
- GET_CONFIG(GLX_ACCUM_RED_SIZE);
- return value;
- case GLUT_WINDOW_ACCUM_GREEN_SIZE:
- GET_CONFIG(GLX_ACCUM_GREEN_SIZE);
- return value;
- case GLUT_WINDOW_ACCUM_BLUE_SIZE:
- GET_CONFIG(GLX_ACCUM_BLUE_SIZE);
- return value;
- case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
- GET_CONFIG(GLX_ACCUM_ALPHA_SIZE);
- return value;
- case GLUT_WINDOW_DOUBLEBUFFER:
- GET_CONFIG(GLX_DOUBLEBUFFER);
- return value;
- case GLUT_WINDOW_RGBA:
- GET_CONFIG(GLX_RGBA);
- return value;
- case GLUT_WINDOW_COLORMAP_SIZE:
- GET_CONFIG(GLX_RGBA);
- if (value) {
- return 0;
- } else {
-#if defined(_WIN32) || defined(__OS2__)
- /* KLUDGE: we always assume 256 colors in CI mode on
- Win32 */
- return 256;
-#else
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
- return __glutCurrentWindow->vis->visual->map_entries;
- } else {
- return __glutCurrentWindow->overlay->vis->visual->map_entries;
- }
-#endif /* _WIN32 */
- }
- case GLUT_WINDOW_PARENT:
- return __glutCurrentWindow->parent ?
- __glutCurrentWindow->parent->num + 1 : 0;
- case GLUT_WINDOW_NUM_CHILDREN:
- {
- int num = 0;
- GLUTwindow *children = __glutCurrentWindow->children;
-
- while (children) {
- num++;
- children = children->siblings;
- }
- return num;
- }
- case GLUT_WINDOW_NUM_SAMPLES:
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample)
- if (__glutIsSupportedByGLX("GLX_SGIS_multisample")) {
- GET_CONFIG(GLX_SAMPLES_SGIS);
- return value;
- } else {
- return 0;
- }
-#else
- /* Independent of GLX server support, multisampling not
- supported by GLX client-side. */
- return 0;
-#endif
- case GLUT_WINDOW_STEREO:
- GET_CONFIG(GLX_STEREO);
- return value;
- case GLUT_WINDOW_CURSOR:
- return __glutCurrentWindow->cursor;
- case GLUT_SCREEN_WIDTH:
- return DisplayWidth(__glutDisplay, __glutScreen);
- case GLUT_SCREEN_HEIGHT:
- return DisplayHeight(__glutDisplay, __glutScreen);
- case GLUT_SCREEN_WIDTH_MM:
- return DisplayWidthMM(__glutDisplay, __glutScreen);
- case GLUT_SCREEN_HEIGHT_MM:
- return DisplayHeightMM(__glutDisplay, __glutScreen);
- case GLUT_MENU_NUM_ITEMS:
- return __glutCurrentMenu->num;
- case GLUT_DISPLAY_MODE_POSSIBLE:
- {
- XVisualInfo *vi;
- Bool dummy, visAlloced;
- void *fbc;
-
-#if defined(_WIN32)
- /* Our fake glXChooseVisual (which is called by
- __glutDetermineVisual) needs an HDC to work with, so grab one
- from the "root" window. */
- XHDC = GetDC(GetDesktopWindow());
-#endif
- vi = __glutDetermineWindowVisual(&dummy, &visAlloced, &fbc);
-#if defined(_WIN32)
- ReleaseDC(GetDesktopWindow(), XHDC);
-#endif
- if (vi) {
- if (visAlloced)
- XFree(vi);
- return 1;
- }
- return 0;
- }
- case GLUT_ELAPSED_TIME:
- {
-#ifdef OLD_VMS
- struct timeval6 elapsed, beginning, now;
-#else
- struct timeval elapsed, beginning, now;
-#endif
-
- __glutInitTime(&beginning);
- GETTIMEOFDAY(&now);
- TIMEDELTA(elapsed, now, beginning);
- /* Return elapsed milliseconds. */
-#if defined(__vms) && ( __VMS_VER < 70000000 )
- return (int) (elapsed.val / TICKS_PER_MILLISECOND);
-#else
- return (int) ((elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000));
-#endif
- }
- case GLUT_WINDOW_FORMAT_ID:
-#if defined(__OS2__)
- return wglGetPixelFormat(__glutCurrentWindow->hdc);
-#elif defined(_WIN32)
- return GetPixelFormat(__glutCurrentWindow->hdc);
-#else
- if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
- return (int) __glutCurrentWindow->vis->visualid;
- } else {
- return (int) __glutCurrentWindow->overlay->vis->visualid;
- }
-#endif
- default:
- __glutWarning("invalid glutGet parameter: %d", param);
- return -1;
- }
-}
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_hel10.cpp b/src/glut/os2/glut_hel10.cpp
deleted file mode 100644
index 6409f6181a3..00000000000
--- a/src/glut/os2/glut_hel10.cpp
+++ /dev/null
@@ -1,1781 +0,0 @@
-
-/* GENERATED FILE -- DO NOT MODIFY */
-
-#define glutBitmapHelvetica10 XXX
-#include "glutbitmap.h"
-#undef glutBitmapHelvetica10
-
-/* char: 0xff */
-
-static const GLubyte ch255data[] = {
-0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x50,
-};
-
-static const BitmapCharRec ch255 = {4,10,0,2,5,ch255data};
-
-/* char: 0xfe */
-
-static const GLubyte ch254data[] = {
-0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80,
-};
-
-static const BitmapCharRec ch254 = {5,10,0,2,6,ch254data};
-
-/* char: 0xfd */
-
-static const GLubyte ch253data[] = {
-0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch253 = {4,11,0,2,5,ch253data};
-
-/* char: 0xfc */
-
-static const GLubyte ch252data[] = {
-0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,
-};
-
-static const BitmapCharRec ch252 = {4,8,0,0,5,ch252data};
-
-/* char: 0xfb */
-
-static const GLubyte ch251data[] = {
-0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch251 = {4,9,0,0,5,ch251data};
-
-/* char: 0xfa */
-
-static const GLubyte ch250data[] = {
-0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x40,0x20,
-};
-
-static const BitmapCharRec ch250 = {4,9,0,0,5,ch250data};
-
-/* char: 0xf9 */
-
-static const GLubyte ch249data[] = {
-0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch249 = {4,9,0,0,5,ch249data};
-
-/* char: 0xf8 */
-
-static const GLubyte ch248data[] = {
-0x70,0x88,0xc8,0xa8,0x98,0x74,
-};
-
-static const BitmapCharRec ch248 = {6,6,0,0,6,ch248data};
-
-/* char: 0xf7 */
-
-static const GLubyte ch247data[] = {
-0x20,0x0,0xf8,0x0,0x20,
-};
-
-static const BitmapCharRec ch247 = {5,5,0,-1,6,ch247data};
-
-/* char: 0xf6 */
-
-static const GLubyte ch246data[] = {
-0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,
-};
-
-static const BitmapCharRec ch246 = {5,8,0,0,6,ch246data};
-
-/* char: 0xf5 */
-
-static const GLubyte ch245data[] = {
-0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch245 = {5,9,0,0,6,ch245data};
-
-/* char: 0xf4 */
-
-static const GLubyte ch244data[] = {
-0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch244 = {5,9,0,0,6,ch244data};
-
-/* char: 0xf3 */
-
-static const GLubyte ch243data[] = {
-0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch243 = {5,9,0,0,6,ch243data};
-
-/* char: 0xf2 */
-
-static const GLubyte ch242data[] = {
-0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch242 = {5,9,0,0,6,ch242data};
-
-/* char: 0xf1 */
-
-static const GLubyte ch241data[] = {
-0x90,0x90,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50,
-};
-
-static const BitmapCharRec ch241 = {4,9,0,0,5,ch241data};
-
-/* char: 0xf0 */
-
-static const GLubyte ch240data[] = {
-0x70,0x88,0x88,0x88,0x88,0x78,0x90,0x60,0x50,
-};
-
-static const BitmapCharRec ch240 = {5,9,0,0,6,ch240data};
-
-/* char: 0xef */
-
-static const GLubyte ch239data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,
-};
-
-static const BitmapCharRec ch239 = {3,8,0,0,2,ch239data};
-
-/* char: 0xee */
-
-static const GLubyte ch238data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40,
-};
-
-static const BitmapCharRec ch238 = {3,9,1,0,2,ch238data};
-
-/* char: 0xed */
-
-static const GLubyte ch237data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40,
-};
-
-static const BitmapCharRec ch237 = {2,9,0,0,2,ch237data};
-
-/* char: 0xec */
-
-static const GLubyte ch236data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80,
-};
-
-static const BitmapCharRec ch236 = {2,9,1,0,2,ch236data};
-
-/* char: 0xeb */
-
-static const GLubyte ch235data[] = {
-0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,
-};
-
-static const BitmapCharRec ch235 = {4,8,0,0,5,ch235data};
-
-/* char: 0xea */
-
-static const GLubyte ch234data[] = {
-0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch234 = {4,9,0,0,5,ch234data};
-
-/* char: 0xe9 */
-
-static const GLubyte ch233data[] = {
-0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x40,0x20,
-};
-
-static const BitmapCharRec ch233 = {4,9,0,0,5,ch233data};
-
-/* char: 0xe8 */
-
-static const GLubyte ch232data[] = {
-0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch232 = {4,9,0,0,5,ch232data};
-
-/* char: 0xe7 */
-
-static const GLubyte ch231data[] = {
-0x60,0x20,0x60,0x90,0x80,0x80,0x90,0x60,
-};
-
-static const BitmapCharRec ch231 = {4,8,0,2,5,ch231data};
-
-/* char: 0xe6 */
-
-static const GLubyte ch230data[] = {
-0x6c,0x92,0x90,0x7e,0x12,0xec,
-};
-
-static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data};
-
-/* char: 0xe5 */
-
-static const GLubyte ch229data[] = {
-0x68,0x90,0x90,0x70,0x10,0xe0,0x20,0x50,0x20,
-};
-
-static const BitmapCharRec ch229 = {5,9,0,0,5,ch229data};
-
-/* char: 0xe4 */
-
-static const GLubyte ch228data[] = {
-0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,
-};
-
-static const BitmapCharRec ch228 = {5,8,0,0,5,ch228data};
-
-/* char: 0xe3 */
-
-static const GLubyte ch227data[] = {
-0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0xa0,0x50,
-};
-
-static const BitmapCharRec ch227 = {5,9,0,0,5,ch227data};
-
-/* char: 0xe2 */
-
-static const GLubyte ch226data[] = {
-0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch226 = {5,9,0,0,5,ch226data};
-
-/* char: 0xe1 */
-
-static const GLubyte ch225data[] = {
-0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch225 = {5,9,0,0,5,ch225data};
-
-/* char: 0xe0 */
-
-static const GLubyte ch224data[] = {
-0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch224 = {5,9,0,0,5,ch224data};
-
-/* char: 0xdf */
-
-static const GLubyte ch223data[] = {
-0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch223 = {4,8,0,0,5,ch223data};
-
-/* char: 0xde */
-
-static const GLubyte ch222data[] = {
-0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,0x80,
-};
-
-static const BitmapCharRec ch222 = {5,8,-1,0,7,ch222data};
-
-/* char: 0xdd */
-
-static const GLubyte ch221data[] = {
-0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch221 = {7,11,0,0,7,ch221data};
-
-/* char: 0xdc */
-
-static const GLubyte ch220data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,
-};
-
-static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data};
-
-/* char: 0xdb */
-
-static const GLubyte ch219data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10,
-};
-
-static const BitmapCharRec ch219 = {6,11,-1,0,8,ch219data};
-
-/* char: 0xda */
-
-static const GLubyte ch218data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch218 = {6,11,-1,0,8,ch218data};
-
-/* char: 0xd9 */
-
-static const GLubyte ch217data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch217 = {6,11,-1,0,8,ch217data};
-
-/* char: 0xd8 */
-
-static const GLubyte ch216data[] = {
-0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4,
-};
-
-static const BitmapCharRec ch216 = {6,10,-1,1,8,ch216data};
-
-/* char: 0xd7 */
-
-static const GLubyte ch215data[] = {
-0x88,0x50,0x20,0x50,0x88,
-};
-
-static const BitmapCharRec ch215 = {5,5,0,-1,6,ch215data};
-
-/* char: 0xd6 */
-
-static const GLubyte ch214data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x48,
-};
-
-static const BitmapCharRec ch214 = {6,10,-1,0,8,ch214data};
-
-/* char: 0xd5 */
-
-static const GLubyte ch213data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch213 = {6,11,-1,0,8,ch213data};
-
-/* char: 0xd4 */
-
-static const GLubyte ch212data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x28,0x10,
-};
-
-static const BitmapCharRec ch212 = {6,11,-1,0,8,ch212data};
-
-/* char: 0xd3 */
-
-static const GLubyte ch211data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch211 = {6,11,-1,0,8,ch211data};
-
-/* char: 0xd2 */
-
-static const GLubyte ch210data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch210 = {6,11,-1,0,8,ch210data};
-
-/* char: 0xd1 */
-
-static const GLubyte ch209data[] = {
-0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch209 = {6,11,-1,0,8,ch209data};
-
-/* char: 0xd0 */
-
-static const GLubyte ch208data[] = {
-0x78,0x44,0x42,0x42,0xf2,0x42,0x44,0x78,
-};
-
-static const BitmapCharRec ch208 = {7,8,0,0,8,ch208data};
-
-/* char: 0xcf */
-
-static const GLubyte ch207data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,
-};
-
-static const BitmapCharRec ch207 = {3,10,0,0,3,ch207data};
-
-/* char: 0xce */
-
-static const GLubyte ch206data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40,
-};
-
-static const BitmapCharRec ch206 = {3,11,0,0,3,ch206data};
-
-/* char: 0xcd */
-
-static const GLubyte ch205data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40,
-};
-
-static const BitmapCharRec ch205 = {2,11,-1,0,3,ch205data};
-
-/* char: 0xcc */
-
-static const GLubyte ch204data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80,
-};
-
-static const BitmapCharRec ch204 = {2,11,0,0,3,ch204data};
-
-/* char: 0xcb */
-
-static const GLubyte ch203data[] = {
-0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x50,
-};
-
-static const BitmapCharRec ch203 = {5,10,-1,0,7,ch203data};
-
-/* char: 0xca */
-
-static const GLubyte ch202data[] = {
-0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch202 = {5,11,-1,0,7,ch202data};
-
-/* char: 0xc9 */
-
-static const GLubyte ch201data[] = {
-0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch201 = {5,11,-1,0,7,ch201data};
-
-/* char: 0xc8 */
-
-static const GLubyte ch200data[] = {
-0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch200 = {5,11,-1,0,7,ch200data};
-
-/* char: 0xc7 */
-
-static const GLubyte ch199data[] = {
-0x30,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch199 = {6,10,-1,2,8,ch199data};
-
-/* char: 0xc6 */
-
-static const GLubyte ch198data[] = {
-0x8f,0x80,0x88,0x0,0x78,0x0,0x48,0x0,0x2f,0x80,0x28,0x0,0x18,0x0,0x1f,0x80,
-};
-
-static const BitmapCharRec ch198 = {9,8,0,0,10,ch198data};
-
-/* char: 0xc5 */
-
-static const GLubyte ch197data[] = {
-0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x10,0x28,0x10,
-};
-
-static const BitmapCharRec ch197 = {7,11,0,0,7,ch197data};
-
-/* char: 0xc4 */
-
-static const GLubyte ch196data[] = {
-0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,
-};
-
-static const BitmapCharRec ch196 = {7,10,0,0,7,ch196data};
-
-/* char: 0xc3 */
-
-static const GLubyte ch195data[] = {
-0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x14,
-};
-
-static const BitmapCharRec ch195 = {7,11,0,0,7,ch195data};
-
-/* char: 0xc2 */
-
-static const GLubyte ch194data[] = {
-0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x10,
-};
-
-static const BitmapCharRec ch194 = {7,11,0,0,7,ch194data};
-
-/* char: 0xc1 */
-
-static const GLubyte ch193data[] = {
-0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch193 = {7,11,0,0,7,ch193data};
-
-/* char: 0xc0 */
-
-static const GLubyte ch192data[] = {
-0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch192 = {7,11,0,0,7,ch192data};
-
-/* char: 0xbf */
-
-static const GLubyte ch191data[] = {
-0x60,0x90,0x80,0x40,0x20,0x20,0x0,0x20,
-};
-
-static const BitmapCharRec ch191 = {4,8,-1,2,6,ch191data};
-
-/* char: 0xbe */
-
-static const GLubyte ch190data[] = {
-0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0xc8,0x0,0x24,0x0,0x44,0x0,0xe2,0x0,
-};
-
-static const BitmapCharRec ch190 = {9,8,0,0,9,ch190data};
-
-/* char: 0xbd */
-
-static const GLubyte ch189data[] = {
-0x27,0x12,0x15,0xb,0x48,0x44,0xc4,0x42,
-};
-
-static const BitmapCharRec ch189 = {8,8,0,0,9,ch189data};
-
-/* char: 0xbc */
-
-static const GLubyte ch188data[] = {
-0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0x48,0x0,0x44,0x0,0xc4,0x0,0x42,0x0,
-};
-
-static const BitmapCharRec ch188 = {9,8,0,0,9,ch188data};
-
-/* char: 0xbb */
-
-static const GLubyte ch187data[] = {
-0xa0,0x50,0x28,0x50,0xa0,
-};
-
-static const BitmapCharRec ch187 = {5,5,0,0,6,ch187data};
-
-/* char: 0xba */
-
-static const GLubyte ch186data[] = {
-0xe0,0x0,0xe0,0xa0,0xe0,
-};
-
-static const BitmapCharRec ch186 = {3,5,0,-3,4,ch186data};
-
-/* char: 0xb9 */
-
-static const GLubyte ch185data[] = {
-0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch185 = {2,4,0,-3,3,ch185data};
-
-/* char: 0xb8 */
-
-static const GLubyte ch184data[] = {
-0xc0,0x40,
-};
-
-static const BitmapCharRec ch184 = {2,2,0,2,3,ch184data};
-
-/* char: 0xb7 */
-
-static const GLubyte ch183data[] = {
-0xc0,
-};
-
-static const BitmapCharRec ch183 = {2,1,0,-3,3,ch183data};
-
-/* char: 0xb6 */
-
-static const GLubyte ch182data[] = {
-0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c,
-};
-
-static const BitmapCharRec ch182 = {6,10,0,2,6,ch182data};
-
-/* char: 0xb5 */
-
-static const GLubyte ch181data[] = {
-0x80,0x80,0xf0,0x90,0x90,0x90,0x90,0x90,
-};
-
-static const BitmapCharRec ch181 = {4,8,0,2,5,ch181data};
-
-/* char: 0xb4 */
-
-static const GLubyte ch180data[] = {
-0x80,0x40,
-};
-
-static const BitmapCharRec ch180 = {2,2,0,-6,3,ch180data};
-
-/* char: 0xb3 */
-
-static const GLubyte ch179data[] = {
-0xc0,0x20,0x40,0xe0,
-};
-
-static const BitmapCharRec ch179 = {3,4,0,-3,3,ch179data};
-
-/* char: 0xb2 */
-
-static const GLubyte ch178data[] = {
-0xe0,0x40,0xa0,0x60,
-};
-
-static const BitmapCharRec ch178 = {3,4,0,-3,3,ch178data};
-
-/* char: 0xb1 */
-
-static const GLubyte ch177data[] = {
-0xf8,0x0,0x20,0x20,0xf8,0x20,0x20,
-};
-
-static const BitmapCharRec ch177 = {5,7,0,0,6,ch177data};
-
-/* char: 0xb0 */
-
-static const GLubyte ch176data[] = {
-0x60,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch176 = {4,4,0,-3,4,ch176data};
-
-/* char: 0xaf */
-
-static const GLubyte ch175data[] = {
-0xe0,
-};
-
-static const BitmapCharRec ch175 = {3,1,0,-7,3,ch175data};
-
-/* char: 0xae */
-
-static const GLubyte ch174data[] = {
-0x38,0x44,0xaa,0xb2,0xba,0x44,0x38,
-};
-
-static const BitmapCharRec ch174 = {7,7,-1,0,9,ch174data};
-
-/* char: 0xad */
-
-static const GLubyte ch173data[] = {
-0xe0,
-};
-
-static const BitmapCharRec ch173 = {3,1,0,-3,4,ch173data};
-
-/* char: 0xac */
-
-static const GLubyte ch172data[] = {
-0x8,0x8,0xf8,
-};
-
-static const BitmapCharRec ch172 = {5,3,-1,-2,7,ch172data};
-
-/* char: 0xab */
-
-static const GLubyte ch171data[] = {
-0x28,0x50,0xa0,0x50,0x28,
-};
-
-static const BitmapCharRec ch171 = {5,5,0,0,6,ch171data};
-
-/* char: 0xaa */
-
-static const GLubyte ch170data[] = {
-0xe0,0x0,0xa0,0x20,0xe0,
-};
-
-static const BitmapCharRec ch170 = {3,5,0,-3,4,ch170data};
-
-/* char: 0xa9 */
-
-static const GLubyte ch169data[] = {
-0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38,
-};
-
-static const BitmapCharRec ch169 = {7,7,-1,0,9,ch169data};
-
-/* char: 0xa8 */
-
-static const GLubyte ch168data[] = {
-0xa0,
-};
-
-static const BitmapCharRec ch168 = {3,1,0,-7,3,ch168data};
-
-/* char: 0xa7 */
-
-static const GLubyte ch167data[] = {
-0x70,0x88,0x18,0x70,0xc8,0x98,0x70,0xc0,0x88,0x70,
-};
-
-static const BitmapCharRec ch167 = {5,10,0,2,6,ch167data};
-
-/* char: 0xa6 */
-
-static const GLubyte ch166data[] = {
-0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch166 = {1,10,-1,2,3,ch166data};
-
-/* char: 0xa5 */
-
-static const GLubyte ch165data[] = {
-0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88,
-};
-
-static const BitmapCharRec ch165 = {5,8,0,0,6,ch165data};
-
-/* char: 0xa4 */
-
-static const GLubyte ch164data[] = {
-0x90,0x60,0x90,0x90,0x60,0x90,
-};
-
-static const BitmapCharRec ch164 = {4,6,0,-1,5,ch164data};
-
-/* char: 0xa3 */
-
-static const GLubyte ch163data[] = {
-0xb0,0x48,0x40,0x40,0xe0,0x40,0x48,0x30,
-};
-
-static const BitmapCharRec ch163 = {5,8,0,0,6,ch163data};
-
-/* char: 0xa2 */
-
-static const GLubyte ch162data[] = {
-0x40,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x10,
-};
-
-static const BitmapCharRec ch162 = {5,8,0,1,6,ch162data};
-
-/* char: 0xa1 */
-
-static const GLubyte ch161data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,
-};
-
-static const BitmapCharRec ch161 = {1,8,-1,2,3,ch161data};
-
-/* char: 0xa0 */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch160data[] = { 0x0 };
-static const BitmapCharRec ch160 = {1,1,0,0,3,ch160data};
-#else
-static const BitmapCharRec ch160 = {0,0,0,0,3,0};
-#endif
-
-/* char: 0x7e '~' */
-
-static const GLubyte ch126data[] = {
-0x98,0x64,
-};
-
-static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data};
-
-/* char: 0x7d '}' */
-
-static const GLubyte ch125data[] = {
-0x80,0x40,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80,
-};
-
-static const BitmapCharRec ch125 = {3,10,0,2,3,ch125data};
-
-/* char: 0x7c '|' */
-
-static const GLubyte ch124data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch124 = {1,10,-1,2,3,ch124data};
-
-/* char: 0x7b '{' */
-
-static const GLubyte ch123data[] = {
-0x20,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20,
-};
-
-static const BitmapCharRec ch123 = {3,10,0,2,3,ch123data};
-
-/* char: 0x7a 'z' */
-
-static const GLubyte ch122data[] = {
-0xf0,0x80,0x40,0x20,0x10,0xf0,
-};
-
-static const BitmapCharRec ch122 = {4,6,0,0,5,ch122data};
-
-/* char: 0x79 'y' */
-
-static const GLubyte ch121data[] = {
-0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,
-};
-
-static const BitmapCharRec ch121 = {4,8,0,2,5,ch121data};
-
-/* char: 0x78 'x' */
-
-static const GLubyte ch120data[] = {
-0x88,0x88,0x50,0x20,0x50,0x88,
-};
-
-static const BitmapCharRec ch120 = {5,6,0,0,6,ch120data};
-
-/* char: 0x77 'w' */
-
-static const GLubyte ch119data[] = {
-0x28,0x28,0x54,0x54,0x92,0x92,
-};
-
-static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data};
-
-/* char: 0x76 'v' */
-
-static const GLubyte ch118data[] = {
-0x20,0x20,0x50,0x50,0x88,0x88,
-};
-
-static const BitmapCharRec ch118 = {5,6,0,0,6,ch118data};
-
-/* char: 0x75 'u' */
-
-static const GLubyte ch117data[] = {
-0x70,0x90,0x90,0x90,0x90,0x90,
-};
-
-static const BitmapCharRec ch117 = {4,6,0,0,5,ch117data};
-
-/* char: 0x74 't' */
-
-static const GLubyte ch116data[] = {
-0x60,0x40,0x40,0x40,0x40,0xe0,0x40,0x40,
-};
-
-static const BitmapCharRec ch116 = {3,8,0,0,4,ch116data};
-
-/* char: 0x73 's' */
-
-static const GLubyte ch115data[] = {
-0x60,0x90,0x10,0x60,0x90,0x60,
-};
-
-static const BitmapCharRec ch115 = {4,6,0,0,5,ch115data};
-
-/* char: 0x72 'r' */
-
-static const GLubyte ch114data[] = {
-0x80,0x80,0x80,0x80,0xc0,0xa0,
-};
-
-static const BitmapCharRec ch114 = {3,6,0,0,4,ch114data};
-
-/* char: 0x71 'q' */
-
-static const GLubyte ch113data[] = {
-0x8,0x8,0x68,0x98,0x88,0x88,0x98,0x68,
-};
-
-static const BitmapCharRec ch113 = {5,8,0,2,6,ch113data};
-
-/* char: 0x70 'p' */
-
-static const GLubyte ch112data[] = {
-0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,
-};
-
-static const BitmapCharRec ch112 = {5,8,0,2,6,ch112data};
-
-/* char: 0x6f 'o' */
-
-static const GLubyte ch111data[] = {
-0x70,0x88,0x88,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch111 = {5,6,0,0,6,ch111data};
-
-/* char: 0x6e 'n' */
-
-static const GLubyte ch110data[] = {
-0x88,0x88,0x88,0x88,0xc8,0xb0,
-};
-
-static const BitmapCharRec ch110 = {5,6,0,0,6,ch110data};
-
-/* char: 0x6d 'm' */
-
-static const GLubyte ch109data[] = {
-0x92,0x92,0x92,0x92,0x92,0xec,
-};
-
-static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data};
-
-/* char: 0x6c 'l' */
-
-static const GLubyte ch108data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch108 = {1,8,0,0,2,ch108data};
-
-/* char: 0x6b 'k' */
-
-static const GLubyte ch107data[] = {
-0x90,0x90,0xa0,0xc0,0xa0,0x90,0x80,0x80,
-};
-
-static const BitmapCharRec ch107 = {4,8,0,0,5,ch107data};
-
-/* char: 0x6a 'j' */
-
-static const GLubyte ch106data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,
-};
-
-static const BitmapCharRec ch106 = {1,9,0,1,2,ch106data};
-
-/* char: 0x69 'i' */
-
-static const GLubyte ch105data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,
-};
-
-static const BitmapCharRec ch105 = {1,8,0,0,2,ch105data};
-
-/* char: 0x68 'h' */
-
-static const GLubyte ch104data[] = {
-0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80,
-};
-
-static const BitmapCharRec ch104 = {5,8,0,0,6,ch104data};
-
-/* char: 0x67 'g' */
-
-static const GLubyte ch103data[] = {
-0x70,0x8,0x68,0x98,0x88,0x88,0x98,0x68,
-};
-
-static const BitmapCharRec ch103 = {5,8,0,2,6,ch103data};
-
-/* char: 0x66 'f' */
-
-static const GLubyte ch102data[] = {
-0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30,
-};
-
-static const BitmapCharRec ch102 = {4,8,0,0,4,ch102data};
-
-/* char: 0x65 'e' */
-
-static const GLubyte ch101data[] = {
-0x60,0x90,0x80,0xf0,0x90,0x60,
-};
-
-static const BitmapCharRec ch101 = {4,6,0,0,5,ch101data};
-
-/* char: 0x64 'd' */
-
-static const GLubyte ch100data[] = {
-0x68,0x98,0x88,0x88,0x98,0x68,0x8,0x8,
-};
-
-static const BitmapCharRec ch100 = {5,8,0,0,6,ch100data};
-
-/* char: 0x63 'c' */
-
-static const GLubyte ch99data[] = {
-0x60,0x90,0x80,0x80,0x90,0x60,
-};
-
-static const BitmapCharRec ch99 = {4,6,0,0,5,ch99data};
-
-/* char: 0x62 'b' */
-
-static const GLubyte ch98data[] = {
-0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80,
-};
-
-static const BitmapCharRec ch98 = {5,8,0,0,6,ch98data};
-
-/* char: 0x61 'a' */
-
-static const GLubyte ch97data[] = {
-0x68,0x90,0x90,0x70,0x10,0xe0,
-};
-
-static const BitmapCharRec ch97 = {5,6,0,0,5,ch97data};
-
-/* char: 0x60 '`' */
-
-static const GLubyte ch96data[] = {
-0x80,0x80,0x40,
-};
-
-static const BitmapCharRec ch96 = {2,3,0,-5,3,ch96data};
-
-/* char: 0x5f '_' */
-
-static const GLubyte ch95data[] = {
-0xfc,
-};
-
-static const BitmapCharRec ch95 = {6,1,0,2,6,ch95data};
-
-/* char: 0x5e '^' */
-
-static const GLubyte ch94data[] = {
-0x88,0x50,0x50,0x20,0x20,
-};
-
-static const BitmapCharRec ch94 = {5,5,0,-3,6,ch94data};
-
-/* char: 0x5d ']' */
-
-static const GLubyte ch93data[] = {
-0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0,
-};
-
-static const BitmapCharRec ch93 = {2,10,0,2,3,ch93data};
-
-/* char: 0x5c '\' */
-
-static const GLubyte ch92data[] = {
-0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80,
-};
-
-static const BitmapCharRec ch92 = {3,8,0,0,3,ch92data};
-
-/* char: 0x5b '[' */
-
-static const GLubyte ch91data[] = {
-0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0,
-};
-
-static const BitmapCharRec ch91 = {2,10,-1,2,3,ch91data};
-
-/* char: 0x5a 'Z' */
-
-static const GLubyte ch90data[] = {
-0xf8,0x80,0x40,0x20,0x20,0x10,0x8,0xf8,
-};
-
-static const BitmapCharRec ch90 = {5,8,-1,0,7,ch90data};
-
-/* char: 0x59 'Y' */
-
-static const GLubyte ch89data[] = {
-0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,
-};
-
-static const BitmapCharRec ch89 = {7,8,0,0,7,ch89data};
-
-/* char: 0x58 'X' */
-
-static const GLubyte ch88data[] = {
-0x88,0x88,0x50,0x50,0x20,0x50,0x88,0x88,
-};
-
-static const BitmapCharRec ch88 = {5,8,-1,0,7,ch88data};
-
-/* char: 0x57 'W' */
-
-static const GLubyte ch87data[] = {
-0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80,
-};
-
-static const BitmapCharRec ch87 = {9,8,0,0,9,ch87data};
-
-/* char: 0x56 'V' */
-
-static const GLubyte ch86data[] = {
-0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch86 = {7,8,0,0,7,ch86data};
-
-/* char: 0x55 'U' */
-
-static const GLubyte ch85data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch85 = {6,8,-1,0,8,ch85data};
-
-/* char: 0x54 'T' */
-
-static const GLubyte ch84data[] = {
-0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,
-};
-
-static const BitmapCharRec ch84 = {5,8,0,0,5,ch84data};
-
-/* char: 0x53 'S' */
-
-static const GLubyte ch83data[] = {
-0x70,0x88,0x88,0x8,0x70,0x80,0x88,0x70,
-};
-
-static const BitmapCharRec ch83 = {5,8,-1,0,7,ch83data};
-
-/* char: 0x52 'R' */
-
-static const GLubyte ch82data[] = {
-0x88,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0,
-};
-
-static const BitmapCharRec ch82 = {5,8,-1,0,7,ch82data};
-
-/* char: 0x51 'Q' */
-
-static const GLubyte ch81data[] = {
-0x2,0x7c,0x8c,0x94,0x84,0x84,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch81 = {7,9,-1,1,8,ch81data};
-
-/* char: 0x50 'P' */
-
-static const GLubyte ch80data[] = {
-0x80,0x80,0x80,0x80,0xf0,0x88,0x88,0xf0,
-};
-
-static const BitmapCharRec ch80 = {5,8,-1,0,7,ch80data};
-
-/* char: 0x4f 'O' */
-
-static const GLubyte ch79data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,
-};
-
-static const BitmapCharRec ch79 = {6,8,-1,0,8,ch79data};
-
-/* char: 0x4e 'N' */
-
-static const GLubyte ch78data[] = {
-0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,
-};
-
-static const BitmapCharRec ch78 = {6,8,-1,0,8,ch78data};
-
-/* char: 0x4d 'M' */
-
-static const GLubyte ch77data[] = {
-0x92,0x92,0x92,0xaa,0xaa,0xc6,0xc6,0x82,
-};
-
-static const BitmapCharRec ch77 = {7,8,-1,0,9,ch77data};
-
-/* char: 0x4c 'L' */
-
-static const GLubyte ch76data[] = {
-0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch76 = {4,8,-1,0,6,ch76data};
-
-/* char: 0x4b 'K' */
-
-static const GLubyte ch75data[] = {
-0x88,0x88,0x90,0x90,0xe0,0xa0,0x90,0x88,
-};
-
-static const BitmapCharRec ch75 = {5,8,-1,0,7,ch75data};
-
-/* char: 0x4a 'J' */
-
-static const GLubyte ch74data[] = {
-0x60,0x90,0x10,0x10,0x10,0x10,0x10,0x10,
-};
-
-static const BitmapCharRec ch74 = {4,8,0,0,5,ch74data};
-
-/* char: 0x49 'I' */
-
-static const GLubyte ch73data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch73 = {1,8,-1,0,3,ch73data};
-
-/* char: 0x48 'H' */
-
-static const GLubyte ch72data[] = {
-0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch72 = {6,8,-1,0,8,ch72data};
-
-/* char: 0x47 'G' */
-
-static const GLubyte ch71data[] = {
-0x74,0x8c,0x84,0x8c,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch71 = {6,8,-1,0,8,ch71data};
-
-/* char: 0x46 'F' */
-
-static const GLubyte ch70data[] = {
-0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8,
-};
-
-static const BitmapCharRec ch70 = {5,8,-1,0,6,ch70data};
-
-/* char: 0x45 'E' */
-
-static const GLubyte ch69data[] = {
-0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,
-};
-
-static const BitmapCharRec ch69 = {5,8,-1,0,7,ch69data};
-
-/* char: 0x44 'D' */
-
-static const GLubyte ch68data[] = {
-0xf0,0x88,0x84,0x84,0x84,0x84,0x88,0xf0,
-};
-
-static const BitmapCharRec ch68 = {6,8,-1,0,8,ch68data};
-
-/* char: 0x43 'C' */
-
-static const GLubyte ch67data[] = {
-0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch67 = {6,8,-1,0,8,ch67data};
-
-/* char: 0x42 'B' */
-
-static const GLubyte ch66data[] = {
-0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0,
-};
-
-static const BitmapCharRec ch66 = {5,8,-1,0,7,ch66data};
-
-/* char: 0x41 'A' */
-
-static const GLubyte ch65data[] = {
-0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,
-};
-
-static const BitmapCharRec ch65 = {7,8,0,0,7,ch65data};
-
-/* char: 0x40 '@' */
-
-static const GLubyte ch64data[] = {
-0x3e,0x0,0x40,0x0,0x9b,0x0,0xa4,0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,0x40,
-0x20,0x80,0x1f,0x0,
-};
-
-static const BitmapCharRec ch64 = {10,10,0,2,11,ch64data};
-
-/* char: 0x3f '?' */
-
-static const GLubyte ch63data[] = {
-0x40,0x0,0x40,0x40,0x20,0x10,0x90,0x60,
-};
-
-static const BitmapCharRec ch63 = {4,8,-1,0,6,ch63data};
-
-/* char: 0x3e '>' */
-
-static const GLubyte ch62data[] = {
-0x80,0x40,0x20,0x40,0x80,
-};
-
-static const BitmapCharRec ch62 = {3,5,-1,-1,6,ch62data};
-
-/* char: 0x3d '=' */
-
-static const GLubyte ch61data[] = {
-0xf0,0x0,0xf0,
-};
-
-static const BitmapCharRec ch61 = {4,3,0,-2,5,ch61data};
-
-/* char: 0x3c '<' */
-
-static const GLubyte ch60data[] = {
-0x20,0x40,0x80,0x40,0x20,
-};
-
-static const BitmapCharRec ch60 = {3,5,-1,-1,6,ch60data};
-
-/* char: 0x3b ';' */
-
-static const GLubyte ch59data[] = {
-0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40,
-};
-
-static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data};
-
-/* char: 0x3a ':' */
-
-static const GLubyte ch58data[] = {
-0x80,0x0,0x0,0x0,0x0,0x80,
-};
-
-static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data};
-
-/* char: 0x39 '9' */
-
-static const GLubyte ch57data[] = {
-0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch57 = {5,8,0,0,6,ch57data};
-
-/* char: 0x38 '8' */
-
-static const GLubyte ch56data[] = {
-0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch56 = {5,8,0,0,6,ch56data};
-
-/* char: 0x37 '7' */
-
-static const GLubyte ch55data[] = {
-0x40,0x40,0x20,0x20,0x10,0x10,0x8,0xf8,
-};
-
-static const BitmapCharRec ch55 = {5,8,0,0,6,ch55data};
-
-/* char: 0x36 '6' */
-
-static const GLubyte ch54data[] = {
-0x70,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70,
-};
-
-static const BitmapCharRec ch54 = {5,8,0,0,6,ch54data};
-
-/* char: 0x35 '5' */
-
-static const GLubyte ch53data[] = {
-0x70,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8,
-};
-
-static const BitmapCharRec ch53 = {5,8,0,0,6,ch53data};
-
-/* char: 0x34 '4' */
-
-static const GLubyte ch52data[] = {
-0x10,0x10,0xf8,0x90,0x50,0x50,0x30,0x10,
-};
-
-static const BitmapCharRec ch52 = {5,8,0,0,6,ch52data};
-
-/* char: 0x33 '3' */
-
-static const GLubyte ch51data[] = {
-0x70,0x88,0x8,0x8,0x30,0x8,0x88,0x70,
-};
-
-static const BitmapCharRec ch51 = {5,8,0,0,6,ch51data};
-
-/* char: 0x32 '2' */
-
-static const GLubyte ch50data[] = {
-0xf8,0x80,0x40,0x30,0x8,0x8,0x88,0x70,
-};
-
-static const BitmapCharRec ch50 = {5,8,0,0,6,ch50data};
-
-/* char: 0x31 '1' */
-
-static const GLubyte ch49data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch49 = {2,8,-1,0,6,ch49data};
-
-/* char: 0x30 '0' */
-
-static const GLubyte ch48data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch48 = {5,8,0,0,6,ch48data};
-
-/* char: 0x2f '/' */
-
-static const GLubyte ch47data[] = {
-0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20,
-};
-
-static const BitmapCharRec ch47 = {3,8,0,0,3,ch47data};
-
-/* char: 0x2e '.' */
-
-static const GLubyte ch46data[] = {
-0x80,
-};
-
-static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data};
-
-/* char: 0x2d '-' */
-
-static const GLubyte ch45data[] = {
-0xf8,
-};
-
-static const BitmapCharRec ch45 = {5,1,-1,-3,7,ch45data};
-
-/* char: 0x2c ',' */
-
-static const GLubyte ch44data[] = {
-0x80,0x40,0x40,
-};
-
-static const BitmapCharRec ch44 = {2,3,0,2,3,ch44data};
-
-/* char: 0x2b '+' */
-
-static const GLubyte ch43data[] = {
-0x20,0x20,0xf8,0x20,0x20,
-};
-
-static const BitmapCharRec ch43 = {5,5,0,-1,6,ch43data};
-
-/* char: 0x2a '*' */
-
-static const GLubyte ch42data[] = {
-0xa0,0x40,0xa0,
-};
-
-static const BitmapCharRec ch42 = {3,3,0,-5,4,ch42data};
-
-/* char: 0x29 ')' */
-
-static const GLubyte ch41data[] = {
-0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,0x80,
-};
-
-static const BitmapCharRec ch41 = {3,10,-1,2,4,ch41data};
-
-/* char: 0x28 '(' */
-
-static const GLubyte ch40data[] = {
-0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x40,0x40,0x20,
-};
-
-static const BitmapCharRec ch40 = {3,10,0,2,4,ch40data};
-
-/* char: 0x27 ''' */
-
-static const GLubyte ch39data[] = {
-0x80,0x40,0x40,
-};
-
-static const BitmapCharRec ch39 = {2,3,-1,-5,3,ch39data};
-
-/* char: 0x26 '&' */
-
-static const GLubyte ch38data[] = {
-0x64,0x98,0x98,0xa4,0x60,0x50,0x50,0x20,
-};
-
-static const BitmapCharRec ch38 = {6,8,-1,0,8,ch38data};
-
-/* char: 0x25 '%' */
-
-static const GLubyte ch37data[] = {
-0x26,0x29,0x16,0x10,0x8,0x68,0x94,0x64,
-};
-
-static const BitmapCharRec ch37 = {8,8,0,0,9,ch37data};
-
-/* char: 0x24 '$' */
-
-static const GLubyte ch36data[] = {
-0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20,
-};
-
-static const BitmapCharRec ch36 = {5,9,0,1,6,ch36data};
-
-/* char: 0x23 '#' */
-
-static const GLubyte ch35data[] = {
-0x50,0x50,0xf8,0x28,0x7c,0x28,0x28,
-};
-
-static const BitmapCharRec ch35 = {6,7,0,0,6,ch35data};
-
-/* char: 0x22 '"' */
-
-static const GLubyte ch34data[] = {
-0xa0,0xa0,
-};
-
-static const BitmapCharRec ch34 = {3,2,-1,-6,4,ch34data};
-
-/* char: 0x21 '!' */
-
-static const GLubyte ch33data[] = {
-0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch33 = {1,8,-1,0,3,ch33data};
-
-/* char: 0x20 ' ' */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch32data[] = { 0x0 };
-static const BitmapCharRec ch32 = {0,0,0,0,3,ch32data};
-#else
-static const BitmapCharRec ch32 = {0,0,0,0,3,0};
-#endif
-
-static const BitmapCharRec * const chars[] = {
-&ch32,
-&ch33,
-&ch34,
-&ch35,
-&ch36,
-&ch37,
-&ch38,
-&ch39,
-&ch40,
-&ch41,
-&ch42,
-&ch43,
-&ch44,
-&ch45,
-&ch46,
-&ch47,
-&ch48,
-&ch49,
-&ch50,
-&ch51,
-&ch52,
-&ch53,
-&ch54,
-&ch55,
-&ch56,
-&ch57,
-&ch58,
-&ch59,
-&ch60,
-&ch61,
-&ch62,
-&ch63,
-&ch64,
-&ch65,
-&ch66,
-&ch67,
-&ch68,
-&ch69,
-&ch70,
-&ch71,
-&ch72,
-&ch73,
-&ch74,
-&ch75,
-&ch76,
-&ch77,
-&ch78,
-&ch79,
-&ch80,
-&ch81,
-&ch82,
-&ch83,
-&ch84,
-&ch85,
-&ch86,
-&ch87,
-&ch88,
-&ch89,
-&ch90,
-&ch91,
-&ch92,
-&ch93,
-&ch94,
-&ch95,
-&ch96,
-&ch97,
-&ch98,
-&ch99,
-&ch100,
-&ch101,
-&ch102,
-&ch103,
-&ch104,
-&ch105,
-&ch106,
-&ch107,
-&ch108,
-&ch109,
-&ch110,
-&ch111,
-&ch112,
-&ch113,
-&ch114,
-&ch115,
-&ch116,
-&ch117,
-&ch118,
-&ch119,
-&ch120,
-&ch121,
-&ch122,
-&ch123,
-&ch124,
-&ch125,
-&ch126,
-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,
-&ch160,
-&ch161,
-&ch162,
-&ch163,
-&ch164,
-&ch165,
-&ch166,
-&ch167,
-&ch168,
-&ch169,
-&ch170,
-&ch171,
-&ch172,
-&ch173,
-&ch174,
-&ch175,
-&ch176,
-&ch177,
-&ch178,
-&ch179,
-&ch180,
-&ch181,
-&ch182,
-&ch183,
-&ch184,
-&ch185,
-&ch186,
-&ch187,
-&ch188,
-&ch189,
-&ch190,
-&ch191,
-&ch192,
-&ch193,
-&ch194,
-&ch195,
-&ch196,
-&ch197,
-&ch198,
-&ch199,
-&ch200,
-&ch201,
-&ch202,
-&ch203,
-&ch204,
-&ch205,
-&ch206,
-&ch207,
-&ch208,
-&ch209,
-&ch210,
-&ch211,
-&ch212,
-&ch213,
-&ch214,
-&ch215,
-&ch216,
-&ch217,
-&ch218,
-&ch219,
-&ch220,
-&ch221,
-&ch222,
-&ch223,
-&ch224,
-&ch225,
-&ch226,
-&ch227,
-&ch228,
-&ch229,
-&ch230,
-&ch231,
-&ch232,
-&ch233,
-&ch234,
-&ch235,
-&ch236,
-&ch237,
-&ch238,
-&ch239,
-&ch240,
-&ch241,
-&ch242,
-&ch243,
-&ch244,
-&ch245,
-&ch246,
-&ch247,
-&ch248,
-&ch249,
-&ch250,
-&ch251,
-&ch252,
-&ch253,
-&ch254,
-&ch255,
-};
-
-#if !defined(__IBMCPP__)
-const
-#endif
-BitmapFontRec glutBitmapHelvetica10 = {
-"-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1",
-224,
-32,
-chars
-};
-
diff --git a/src/glut/os2/glut_hel12.cpp b/src/glut/os2/glut_hel12.cpp
deleted file mode 100644
index cbd0548b930..00000000000
--- a/src/glut/os2/glut_hel12.cpp
+++ /dev/null
@@ -1,1791 +0,0 @@
-
-/* GENERATED FILE -- DO NOT MODIFY */
-
-#define glutBitmapHelvetica12 XXX
-#include "glutbitmap.h"
-#undef glutBitmapHelvetica12
-
-/* char: 0xff */
-
-static const GLubyte ch255data[] = {
-0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,0x88,0x88,0x0,0x50,
-};
-
-static const BitmapCharRec ch255 = {5,12,-1,3,7,ch255data};
-
-/* char: 0xfe */
-
-static const GLubyte ch254data[] = {
-0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80,
-};
-
-static const BitmapCharRec ch254 = {5,12,-1,3,7,ch254data};
-
-/* char: 0xfd */
-
-static const GLubyte ch253data[] = {
-0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch253 = {5,13,-1,3,7,ch253data};
-
-/* char: 0xfc */
-
-static const GLubyte ch252data[] = {
-0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,
-};
-
-static const BitmapCharRec ch252 = {5,9,-1,0,7,ch252data};
-
-/* char: 0xfb */
-
-static const GLubyte ch251data[] = {
-0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch251 = {5,10,-1,0,7,ch251data};
-
-/* char: 0xfa */
-
-static const GLubyte ch250data[] = {
-0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch250 = {5,10,-1,0,7,ch250data};
-
-/* char: 0xf9 */
-
-static const GLubyte ch249data[] = {
-0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch249 = {5,10,-1,0,7,ch249data};
-
-/* char: 0xf8 */
-
-static const GLubyte ch248data[] = {
-0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a,
-};
-
-static const BitmapCharRec ch248 = {7,7,0,0,7,ch248data};
-
-/* char: 0xf7 */
-
-static const GLubyte ch247data[] = {
-0x20,0x0,0xf8,0x0,0x20,
-};
-
-static const BitmapCharRec ch247 = {5,5,-1,-1,7,ch247data};
-
-/* char: 0xf6 */
-
-static const GLubyte ch246data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,
-};
-
-static const BitmapCharRec ch246 = {5,9,-1,0,7,ch246data};
-
-/* char: 0xf5 */
-
-static const GLubyte ch245data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch245 = {5,10,-1,0,7,ch245data};
-
-/* char: 0xf4 */
-
-static const GLubyte ch244data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch244 = {5,10,-1,0,7,ch244data};
-
-/* char: 0xf3 */
-
-static const GLubyte ch243data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch243 = {5,10,-1,0,7,ch243data};
-
-/* char: 0xf2 */
-
-static const GLubyte ch242data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch242 = {5,10,-1,0,7,ch242data};
-
-/* char: 0xf1 */
-
-static const GLubyte ch241data[] = {
-0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch241 = {5,10,-1,0,7,ch241data};
-
-/* char: 0xf0 */
-
-static const GLubyte ch240data[] = {
-0x70,0x88,0x88,0x88,0x88,0x78,0x8,0x50,0x30,0x68,
-};
-
-static const BitmapCharRec ch240 = {5,10,-1,0,7,ch240data};
-
-/* char: 0xef */
-
-static const GLubyte ch239data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,
-};
-
-static const BitmapCharRec ch239 = {3,9,0,0,3,ch239data};
-
-/* char: 0xee */
-
-static const GLubyte ch238data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40,
-};
-
-static const BitmapCharRec ch238 = {3,10,0,0,3,ch238data};
-
-/* char: 0xed */
-
-static const GLubyte ch237data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40,
-};
-
-static const BitmapCharRec ch237 = {2,10,-1,0,3,ch237data};
-
-/* char: 0xec */
-
-static const GLubyte ch236data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80,
-};
-
-static const BitmapCharRec ch236 = {2,10,0,0,3,ch236data};
-
-/* char: 0xeb */
-
-static const GLubyte ch235data[] = {
-0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,
-};
-
-static const BitmapCharRec ch235 = {5,9,-1,0,7,ch235data};
-
-/* char: 0xea */
-
-static const GLubyte ch234data[] = {
-0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch234 = {5,10,-1,0,7,ch234data};
-
-/* char: 0xe9 */
-
-static const GLubyte ch233data[] = {
-0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch233 = {5,10,-1,0,7,ch233data};
-
-/* char: 0xe8 */
-
-static const GLubyte ch232data[] = {
-0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x40,
-};
-
-static const BitmapCharRec ch232 = {5,10,-1,0,7,ch232data};
-
-/* char: 0xe7 */
-
-static const GLubyte ch231data[] = {
-0x60,0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,0x70,
-};
-
-static const BitmapCharRec ch231 = {5,10,-1,3,7,ch231data};
-
-/* char: 0xe6 */
-
-static const GLubyte ch230data[] = {
-0x77,0x0,0x88,0x80,0x88,0x0,0x7f,0x80,0x8,0x80,0x88,0x80,0x77,0x0,
-};
-
-static const BitmapCharRec ch230 = {9,7,-1,0,11,ch230data};
-
-/* char: 0xe5 */
-
-static const GLubyte ch229data[] = {
-0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x30,0x48,0x30,
-};
-
-static const BitmapCharRec ch229 = {6,10,-1,0,7,ch229data};
-
-/* char: 0xe4 */
-
-static const GLubyte ch228data[] = {
-0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,
-};
-
-static const BitmapCharRec ch228 = {6,9,-1,0,7,ch228data};
-
-/* char: 0xe3 */
-
-static const GLubyte ch227data[] = {
-0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x28,
-};
-
-static const BitmapCharRec ch227 = {6,10,-1,0,7,ch227data};
-
-/* char: 0xe2 */
-
-static const GLubyte ch226data[] = {
-0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x20,
-};
-
-static const BitmapCharRec ch226 = {6,10,-1,0,7,ch226data};
-
-/* char: 0xe1 */
-
-static const GLubyte ch225data[] = {
-0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x20,0x10,
-};
-
-static const BitmapCharRec ch225 = {6,10,-1,0,7,ch225data};
-
-/* char: 0xe0 */
-
-static const GLubyte ch224data[] = {
-0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch224 = {6,10,-1,0,7,ch224data};
-
-/* char: 0xdf */
-
-static const GLubyte ch223data[] = {
-0xb0,0x88,0x88,0x88,0xb0,0x88,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch223 = {5,9,-1,0,7,ch223data};
-
-/* char: 0xde */
-
-static const GLubyte ch222data[] = {
-0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,0x80,
-};
-
-static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data};
-
-/* char: 0xdd */
-
-static const GLubyte ch221data[] = {
-0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch221 = {7,12,-1,0,9,ch221data};
-
-/* char: 0xdc */
-
-static const GLubyte ch220data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,
-};
-
-static const BitmapCharRec ch220 = {6,11,-1,0,8,ch220data};
-
-/* char: 0xdb */
-
-static const GLubyte ch219data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10,
-};
-
-static const BitmapCharRec ch219 = {6,12,-1,0,8,ch219data};
-
-/* char: 0xda */
-
-static const GLubyte ch218data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch218 = {6,12,-1,0,8,ch218data};
-
-/* char: 0xd9 */
-
-static const GLubyte ch217data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch217 = {6,12,-1,0,8,ch217data};
-
-/* char: 0xd8 */
-
-static const GLubyte ch216data[] = {
-0x80,0x0,0x5e,0x0,0x21,0x0,0x50,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80,
-0x21,0x0,0x1e,0x80,0x0,0x40,
-};
-
-static const BitmapCharRec ch216 = {10,11,0,1,10,ch216data};
-
-/* char: 0xd7 */
-
-static const GLubyte ch215data[] = {
-0x88,0x50,0x20,0x50,0x88,
-};
-
-static const BitmapCharRec ch215 = {5,5,-1,-1,7,ch215data};
-
-/* char: 0xd6 */
-
-static const GLubyte ch214data[] = {
-0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x24,
-};
-
-static const BitmapCharRec ch214 = {8,11,-1,0,10,ch214data};
-
-/* char: 0xd5 */
-
-static const GLubyte ch213data[] = {
-0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x28,0x14,
-};
-
-static const BitmapCharRec ch213 = {8,12,-1,0,10,ch213data};
-
-/* char: 0xd4 */
-
-static const GLubyte ch212data[] = {
-0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x14,0x8,
-};
-
-static const BitmapCharRec ch212 = {8,12,-1,0,10,ch212data};
-
-/* char: 0xd3 */
-
-static const GLubyte ch211data[] = {
-0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x4,
-};
-
-static const BitmapCharRec ch211 = {8,12,-1,0,10,ch211data};
-
-/* char: 0xd2 */
-
-static const GLubyte ch210data[] = {
-0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x10,
-};
-
-static const BitmapCharRec ch210 = {8,12,-1,0,10,ch210data};
-
-/* char: 0xd1 */
-
-static const GLubyte ch209data[] = {
-0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,0x0,0x28,0x14,
-};
-
-static const BitmapCharRec ch209 = {7,12,-1,0,9,ch209data};
-
-/* char: 0xd0 */
-
-static const GLubyte ch208data[] = {
-0x7c,0x42,0x41,0x41,0xf1,0x41,0x41,0x42,0x7c,
-};
-
-static const BitmapCharRec ch208 = {8,9,0,0,9,ch208data};
-
-/* char: 0xcf */
-
-static const GLubyte ch207data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,
-};
-
-static const BitmapCharRec ch207 = {3,11,0,0,3,ch207data};
-
-/* char: 0xce */
-
-static const GLubyte ch206data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40,
-};
-
-static const BitmapCharRec ch206 = {3,12,0,0,3,ch206data};
-
-/* char: 0xcd */
-
-static const GLubyte ch205data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40,
-};
-
-static const BitmapCharRec ch205 = {2,12,-1,0,3,ch205data};
-
-/* char: 0xcc */
-
-static const GLubyte ch204data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80,
-};
-
-static const BitmapCharRec ch204 = {2,12,0,0,3,ch204data};
-
-/* char: 0xcb */
-
-static const GLubyte ch203data[] = {
-0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,
-};
-
-static const BitmapCharRec ch203 = {6,11,-1,0,8,ch203data};
-
-/* char: 0xca */
-
-static const GLubyte ch202data[] = {
-0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,0x10,
-};
-
-static const BitmapCharRec ch202 = {6,12,-1,0,8,ch202data};
-
-/* char: 0xc9 */
-
-static const GLubyte ch201data[] = {
-0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch201 = {6,12,-1,0,8,ch201data};
-
-/* char: 0xc8 */
-
-static const GLubyte ch200data[] = {
-0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch200 = {6,12,-1,0,8,ch200data};
-
-/* char: 0xc7 */
-
-static const GLubyte ch199data[] = {
-0x30,0x8,0x8,0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c,
-};
-
-static const BitmapCharRec ch199 = {7,12,-1,3,9,ch199data};
-
-/* char: 0xc6 */
-
-static const GLubyte ch198data[] = {
-0x8f,0x80,0x88,0x0,0x88,0x0,0x78,0x0,0x4f,0x80,0x48,0x0,0x28,0x0,0x28,0x0,
-0x1f,0x80,
-};
-
-static const BitmapCharRec ch198 = {9,9,-1,0,11,ch198data};
-
-/* char: 0xc5 */
-
-static const GLubyte ch197data[] = {
-0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,0x28,0x10,
-};
-
-static const BitmapCharRec ch197 = {7,12,-1,0,9,ch197data};
-
-/* char: 0xc4 */
-
-static const GLubyte ch196data[] = {
-0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,
-};
-
-static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data};
-
-/* char: 0xc3 */
-
-static const GLubyte ch195data[] = {
-0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x14,
-};
-
-static const BitmapCharRec ch195 = {7,12,-1,0,9,ch195data};
-
-/* char: 0xc2 */
-
-static const GLubyte ch194data[] = {
-0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x10,
-};
-
-static const BitmapCharRec ch194 = {7,12,-1,0,9,ch194data};
-
-/* char: 0xc1 */
-
-static const GLubyte ch193data[] = {
-0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x8,
-};
-
-static const BitmapCharRec ch193 = {7,12,-1,0,9,ch193data};
-
-/* char: 0xc0 */
-
-static const GLubyte ch192data[] = {
-0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x20,
-};
-
-static const BitmapCharRec ch192 = {7,12,-1,0,9,ch192data};
-
-/* char: 0xbf */
-
-static const GLubyte ch191data[] = {
-0x70,0x88,0x88,0x40,0x40,0x20,0x20,0x0,0x20,
-};
-
-static const BitmapCharRec ch191 = {5,9,-1,3,7,ch191data};
-
-/* char: 0xbe */
-
-static const GLubyte ch190data[] = {
-0x21,0x0,0x17,0x80,0x15,0x0,0xb,0x0,0xc9,0x0,0x24,0x0,0x44,0x0,0x22,0x0,
-0xe1,0x0,
-};
-
-static const BitmapCharRec ch190 = {9,9,0,0,10,ch190data};
-
-/* char: 0xbd */
-
-static const GLubyte ch189data[] = {
-0x47,0x80,0x22,0x0,0x11,0x0,0x14,0x80,0x4b,0x0,0x48,0x0,0x44,0x0,0xc2,0x0,
-0x41,0x0,
-};
-
-static const BitmapCharRec ch189 = {9,9,0,0,10,ch189data};
-
-/* char: 0xbc */
-
-static const GLubyte ch188data[] = {
-0x41,0x0,0x27,0x80,0x15,0x0,0x13,0x0,0x49,0x0,0x44,0x0,0x44,0x0,0xc2,0x0,
-0x41,0x0,
-};
-
-static const BitmapCharRec ch188 = {9,9,0,0,10,ch188data};
-
-/* char: 0xbb */
-
-static const GLubyte ch187data[] = {
-0xa0,0x50,0x28,0x50,0xa0,
-};
-
-static const BitmapCharRec ch187 = {5,5,-1,-1,7,ch187data};
-
-/* char: 0xba */
-
-static const GLubyte ch186data[] = {
-0xe0,0x0,0xe0,0xa0,0xe0,
-};
-
-static const BitmapCharRec ch186 = {3,5,-1,-4,5,ch186data};
-
-/* char: 0xb9 */
-
-static const GLubyte ch185data[] = {
-0x40,0x40,0x40,0xc0,0x40,
-};
-
-static const BitmapCharRec ch185 = {2,5,-1,-3,4,ch185data};
-
-/* char: 0xb8 */
-
-static const GLubyte ch184data[] = {
-0xc0,0x20,0x20,0x40,
-};
-
-static const BitmapCharRec ch184 = {3,4,0,3,3,ch184data};
-
-/* char: 0xb7 */
-
-static const GLubyte ch183data[] = {
-0x80,
-};
-
-static const BitmapCharRec ch183 = {1,1,-1,-3,3,ch183data};
-
-/* char: 0xb6 */
-
-static const GLubyte ch182data[] = {
-0x28,0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c,
-};
-
-static const BitmapCharRec ch182 = {6,12,0,3,7,ch182data};
-
-/* char: 0xb5 */
-
-static const GLubyte ch181data[] = {
-0x80,0x80,0x80,0xe8,0x98,0x88,0x88,0x88,0x88,0x88,
-};
-
-static const BitmapCharRec ch181 = {5,10,-1,3,7,ch181data};
-
-/* char: 0xb4 */
-
-static const GLubyte ch180data[] = {
-0x80,0x40,
-};
-
-static const BitmapCharRec ch180 = {2,2,0,-8,2,ch180data};
-
-/* char: 0xb3 */
-
-static const GLubyte ch179data[] = {
-0xc0,0x20,0x40,0x20,0xe0,
-};
-
-static const BitmapCharRec ch179 = {3,5,0,-3,4,ch179data};
-
-/* char: 0xb2 */
-
-static const GLubyte ch178data[] = {
-0xf0,0x40,0x20,0x90,0x60,
-};
-
-static const BitmapCharRec ch178 = {4,5,0,-3,4,ch178data};
-
-/* char: 0xb1 */
-
-static const GLubyte ch177data[] = {
-0xf8,0x0,0x20,0x20,0xf8,0x20,0x20,
-};
-
-static const BitmapCharRec ch177 = {5,7,-1,0,7,ch177data};
-
-/* char: 0xb0 */
-
-static const GLubyte ch176data[] = {
-0x60,0x90,0x90,0x60,
-};
-
-static const BitmapCharRec ch176 = {4,4,0,-4,5,ch176data};
-
-/* char: 0xaf */
-
-static const GLubyte ch175data[] = {
-0xf0,
-};
-
-static const BitmapCharRec ch175 = {4,1,0,-8,4,ch175data};
-
-/* char: 0xae */
-
-static const GLubyte ch174data[] = {
-0x3e,0x0,0x41,0x0,0x94,0x80,0x94,0x80,0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x0,
-0x3e,0x0,
-};
-
-static const BitmapCharRec ch174 = {9,9,-1,0,11,ch174data};
-
-/* char: 0xad */
-
-static const GLubyte ch173data[] = {
-0xf0,
-};
-
-static const BitmapCharRec ch173 = {4,1,0,-3,5,ch173data};
-
-/* char: 0xac */
-
-static const GLubyte ch172data[] = {
-0x4,0x4,0x4,0xfc,
-};
-
-static const BitmapCharRec ch172 = {6,4,-1,-2,8,ch172data};
-
-/* char: 0xab */
-
-static const GLubyte ch171data[] = {
-0x28,0x50,0xa0,0x50,0x28,
-};
-
-static const BitmapCharRec ch171 = {5,5,-1,-1,7,ch171data};
-
-/* char: 0xaa */
-
-static const GLubyte ch170data[] = {
-0xe0,0x0,0xa0,0x20,0xe0,
-};
-
-static const BitmapCharRec ch170 = {3,5,-1,-4,5,ch170data};
-
-/* char: 0xa9 */
-
-static const GLubyte ch169data[] = {
-0x3e,0x0,0x41,0x0,0x9c,0x80,0xa2,0x80,0xa0,0x80,0xa2,0x80,0x9c,0x80,0x41,0x0,
-0x3e,0x0,
-};
-
-static const BitmapCharRec ch169 = {9,9,-1,0,11,ch169data};
-
-/* char: 0xa8 */
-
-static const GLubyte ch168data[] = {
-0xa0,
-};
-
-static const BitmapCharRec ch168 = {3,1,0,-8,3,ch168data};
-
-/* char: 0xa7 */
-
-static const GLubyte ch167data[] = {
-0x70,0x88,0x8,0x30,0x48,0x88,0x88,0x90,0x60,0x80,0x88,0x70,
-};
-
-static const BitmapCharRec ch167 = {5,12,0,3,6,ch167data};
-
-/* char: 0xa6 */
-
-static const GLubyte ch166data[] = {
-0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch166 = {1,11,-1,2,3,ch166data};
-
-/* char: 0xa5 */
-
-static const GLubyte ch165data[] = {
-0x20,0x20,0xf8,0x20,0xf8,0x20,0x50,0x88,0x88,
-};
-
-static const BitmapCharRec ch165 = {5,9,-1,0,7,ch165data};
-
-/* char: 0xa4 */
-
-static const GLubyte ch164data[] = {
-0x84,0x78,0x48,0x48,0x78,0x84,
-};
-
-static const BitmapCharRec ch164 = {6,6,0,-1,7,ch164data};
-
-/* char: 0xa3 */
-
-static const GLubyte ch163data[] = {
-0xb0,0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30,
-};
-
-static const BitmapCharRec ch163 = {5,9,-1,0,7,ch163data};
-
-/* char: 0xa2 */
-
-static const GLubyte ch162data[] = {
-0x40,0x70,0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10,
-};
-
-static const BitmapCharRec ch162 = {5,9,-1,1,7,ch162data};
-
-/* char: 0xa1 */
-
-static const GLubyte ch161data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,
-};
-
-static const BitmapCharRec ch161 = {1,10,-1,3,3,ch161data};
-
-/* char: 0xa0 */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch160data[] = { 0x0 };
-static const BitmapCharRec ch160 = {1,1,0,0,4,ch160data};
-#else
-static const BitmapCharRec ch160 = {0,0,0,0,4,0};
-#endif
-
-/* char: 0x7e '~' */
-
-static const GLubyte ch126data[] = {
-0x98,0x64,
-};
-
-static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data};
-
-/* char: 0x7d '}' */
-
-static const GLubyte ch125data[] = {
-0xc0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xc0,
-};
-
-static const BitmapCharRec ch125 = {4,12,0,3,4,ch125data};
-
-/* char: 0x7c '|' */
-
-static const GLubyte ch124data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch124 = {1,12,-1,3,3,ch124data};
-
-/* char: 0x7b '{' */
-
-static const GLubyte ch123data[] = {
-0x30,0x40,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30,
-};
-
-static const BitmapCharRec ch123 = {4,12,0,3,4,ch123data};
-
-/* char: 0x7a 'z' */
-
-static const GLubyte ch122data[] = {
-0xf0,0x80,0x40,0x40,0x20,0x10,0xf0,
-};
-
-static const BitmapCharRec ch122 = {4,7,-1,0,6,ch122data};
-
-/* char: 0x79 'y' */
-
-static const GLubyte ch121data[] = {
-0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,
-};
-
-static const BitmapCharRec ch121 = {5,10,-1,3,7,ch121data};
-
-/* char: 0x78 'x' */
-
-static const GLubyte ch120data[] = {
-0x84,0x84,0x48,0x30,0x30,0x48,0x84,
-};
-
-static const BitmapCharRec ch120 = {6,7,0,0,6,ch120data};
-
-/* char: 0x77 'w' */
-
-static const GLubyte ch119data[] = {
-0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80,
-};
-
-static const BitmapCharRec ch119 = {9,7,0,0,9,ch119data};
-
-/* char: 0x76 'v' */
-
-static const GLubyte ch118data[] = {
-0x20,0x20,0x50,0x50,0x88,0x88,0x88,
-};
-
-static const BitmapCharRec ch118 = {5,7,-1,0,7,ch118data};
-
-/* char: 0x75 'u' */
-
-static const GLubyte ch117data[] = {
-0x68,0x98,0x88,0x88,0x88,0x88,0x88,
-};
-
-static const BitmapCharRec ch117 = {5,7,-1,0,7,ch117data};
-
-/* char: 0x74 't' */
-
-static const GLubyte ch116data[] = {
-0x60,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x40,
-};
-
-static const BitmapCharRec ch116 = {3,9,0,0,3,ch116data};
-
-/* char: 0x73 's' */
-
-static const GLubyte ch115data[] = {
-0x60,0x90,0x10,0x60,0x80,0x90,0x60,
-};
-
-static const BitmapCharRec ch115 = {4,7,-1,0,6,ch115data};
-
-/* char: 0x72 'r' */
-
-static const GLubyte ch114data[] = {
-0x80,0x80,0x80,0x80,0x80,0xc0,0xa0,
-};
-
-static const BitmapCharRec ch114 = {3,7,-1,0,4,ch114data};
-
-/* char: 0x71 'q' */
-
-static const GLubyte ch113data[] = {
-0x8,0x8,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68,
-};
-
-static const BitmapCharRec ch113 = {5,10,-1,3,7,ch113data};
-
-/* char: 0x70 'p' */
-
-static const GLubyte ch112data[] = {
-0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,
-};
-
-static const BitmapCharRec ch112 = {5,10,-1,3,7,ch112data};
-
-/* char: 0x6f 'o' */
-
-static const GLubyte ch111data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch111 = {5,7,-1,0,7,ch111data};
-
-/* char: 0x6e 'n' */
-
-static const GLubyte ch110data[] = {
-0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,
-};
-
-static const BitmapCharRec ch110 = {5,7,-1,0,7,ch110data};
-
-/* char: 0x6d 'm' */
-
-static const GLubyte ch109data[] = {
-0x92,0x92,0x92,0x92,0x92,0xda,0xa4,
-};
-
-static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data};
-
-/* char: 0x6c 'l' */
-
-static const GLubyte ch108data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch108 = {1,9,-1,0,3,ch108data};
-
-/* char: 0x6b 'k' */
-
-static const GLubyte ch107data[] = {
-0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,0x80,
-};
-
-static const BitmapCharRec ch107 = {5,9,-1,0,6,ch107data};
-
-/* char: 0x6a 'j' */
-
-static const GLubyte ch106data[] = {
-0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,
-};
-
-static const BitmapCharRec ch106 = {2,12,0,3,3,ch106data};
-
-/* char: 0x69 'i' */
-
-static const GLubyte ch105data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,
-};
-
-static const BitmapCharRec ch105 = {1,9,-1,0,3,ch105data};
-
-/* char: 0x68 'h' */
-
-static const GLubyte ch104data[] = {
-0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80,
-};
-
-static const BitmapCharRec ch104 = {5,9,-1,0,7,ch104data};
-
-/* char: 0x67 'g' */
-
-static const GLubyte ch103data[] = {
-0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68,
-};
-
-static const BitmapCharRec ch103 = {5,10,-1,3,7,ch103data};
-
-/* char: 0x66 'f' */
-
-static const GLubyte ch102data[] = {
-0x40,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30,
-};
-
-static const BitmapCharRec ch102 = {4,9,0,0,3,ch102data};
-
-/* char: 0x65 'e' */
-
-static const GLubyte ch101data[] = {
-0x70,0x88,0x80,0xf8,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch101 = {5,7,-1,0,7,ch101data};
-
-/* char: 0x64 'd' */
-
-static const GLubyte ch100data[] = {
-0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x8,0x8,
-};
-
-static const BitmapCharRec ch100 = {5,9,-1,0,7,ch100data};
-
-/* char: 0x63 'c' */
-
-static const GLubyte ch99data[] = {
-0x70,0x88,0x80,0x80,0x80,0x88,0x70,
-};
-
-static const BitmapCharRec ch99 = {5,7,-1,0,7,ch99data};
-
-/* char: 0x62 'b' */
-
-static const GLubyte ch98data[] = {
-0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80,
-};
-
-static const BitmapCharRec ch98 = {5,9,-1,0,7,ch98data};
-
-/* char: 0x61 'a' */
-
-static const GLubyte ch97data[] = {
-0x74,0x88,0x88,0x78,0x8,0x88,0x70,
-};
-
-static const BitmapCharRec ch97 = {6,7,-1,0,7,ch97data};
-
-/* char: 0x60 '`' */
-
-static const GLubyte ch96data[] = {
-0xc0,0x80,0x40,
-};
-
-static const BitmapCharRec ch96 = {2,3,0,-6,3,ch96data};
-
-/* char: 0x5f '_' */
-
-static const GLubyte ch95data[] = {
-0xfe,
-};
-
-static const BitmapCharRec ch95 = {7,1,0,2,7,ch95data};
-
-/* char: 0x5e '^' */
-
-static const GLubyte ch94data[] = {
-0x88,0x50,0x20,
-};
-
-static const BitmapCharRec ch94 = {5,3,0,-5,6,ch94data};
-
-/* char: 0x5d ']' */
-
-static const GLubyte ch93data[] = {
-0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0,
-};
-
-static const BitmapCharRec ch93 = {2,12,0,3,3,ch93data};
-
-/* char: 0x5c '\' */
-
-static const GLubyte ch92data[] = {
-0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80,
-};
-
-static const BitmapCharRec ch92 = {4,9,0,0,4,ch92data};
-
-/* char: 0x5b '[' */
-
-static const GLubyte ch91data[] = {
-0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0,
-};
-
-static const BitmapCharRec ch91 = {2,12,-1,3,3,ch91data};
-
-/* char: 0x5a 'Z' */
-
-static const GLubyte ch90data[] = {
-0xfe,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe,
-};
-
-static const BitmapCharRec ch90 = {7,9,-1,0,9,ch90data};
-
-/* char: 0x59 'Y' */
-
-static const GLubyte ch89data[] = {
-0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch89 = {7,9,-1,0,9,ch89data};
-
-/* char: 0x58 'X' */
-
-static const GLubyte ch88data[] = {
-0x82,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x82,
-};
-
-static const BitmapCharRec ch88 = {7,9,-1,0,9,ch88data};
-
-/* char: 0x57 'W' */
-
-static const GLubyte ch87data[] = {
-0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0x49,0x0,0x88,0x80,0x88,0x80,
-0x88,0x80,
-};
-
-static const BitmapCharRec ch87 = {9,9,-1,0,11,ch87data};
-
-/* char: 0x56 'V' */
-
-static const GLubyte ch86data[] = {
-0x10,0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82,
-};
-
-static const BitmapCharRec ch86 = {7,9,-1,0,9,ch86data};
-
-/* char: 0x55 'U' */
-
-static const GLubyte ch85data[] = {
-0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,
-};
-
-static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data};
-
-/* char: 0x54 'T' */
-
-static const GLubyte ch84data[] = {
-0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe,
-};
-
-static const BitmapCharRec ch84 = {7,9,0,0,7,ch84data};
-
-/* char: 0x53 'S' */
-
-static const GLubyte ch83data[] = {
-0x78,0x84,0x84,0x4,0x18,0x60,0x80,0x84,0x78,
-};
-
-static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data};
-
-/* char: 0x52 'R' */
-
-static const GLubyte ch82data[] = {
-0x84,0x84,0x84,0x88,0xf8,0x84,0x84,0x84,0xf8,
-};
-
-static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data};
-
-/* char: 0x51 'Q' */
-
-static const GLubyte ch81data[] = {
-0x3d,0x42,0x85,0x89,0x81,0x81,0x81,0x42,0x3c,
-};
-
-static const BitmapCharRec ch81 = {8,9,-1,0,10,ch81data};
-
-/* char: 0x50 'P' */
-
-static const GLubyte ch80data[] = {
-0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,
-};
-
-static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data};
-
-/* char: 0x4f 'O' */
-
-static const GLubyte ch79data[] = {
-0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,
-};
-
-static const BitmapCharRec ch79 = {8,9,-1,0,10,ch79data};
-
-/* char: 0x4e 'N' */
-
-static const GLubyte ch78data[] = {
-0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,
-};
-
-static const BitmapCharRec ch78 = {7,9,-1,0,9,ch78data};
-
-/* char: 0x4d 'M' */
-
-static const GLubyte ch77data[] = {
-0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80,
-0x80,0x80,
-};
-
-static const BitmapCharRec ch77 = {9,9,-1,0,11,ch77data};
-
-/* char: 0x4c 'L' */
-
-static const GLubyte ch76data[] = {
-0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch76 = {5,9,-1,0,7,ch76data};
-
-/* char: 0x4b 'K' */
-
-static const GLubyte ch75data[] = {
-0x82,0x84,0x88,0x90,0xe0,0xa0,0x90,0x88,0x84,
-};
-
-static const BitmapCharRec ch75 = {7,9,-1,0,8,ch75data};
-
-/* char: 0x4a 'J' */
-
-static const GLubyte ch74data[] = {
-0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x8,0x8,
-};
-
-static const BitmapCharRec ch74 = {5,9,-1,0,7,ch74data};
-
-/* char: 0x49 'I' */
-
-static const GLubyte ch73data[] = {
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch73 = {1,9,-1,0,3,ch73data};
-
-/* char: 0x48 'H' */
-
-static const GLubyte ch72data[] = {
-0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82,
-};
-
-static const BitmapCharRec ch72 = {7,9,-1,0,9,ch72data};
-
-/* char: 0x47 'G' */
-
-static const GLubyte ch71data[] = {
-0x3a,0x46,0x82,0x82,0x8e,0x80,0x80,0x42,0x3c,
-};
-
-static const BitmapCharRec ch71 = {7,9,-1,0,9,ch71data};
-
-/* char: 0x46 'F' */
-
-static const GLubyte ch70data[] = {
-0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0xfc,
-};
-
-static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data};
-
-/* char: 0x45 'E' */
-
-static const GLubyte ch69data[] = {
-0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,
-};
-
-static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data};
-
-/* char: 0x44 'D' */
-
-static const GLubyte ch68data[] = {
-0xf8,0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8,
-};
-
-static const BitmapCharRec ch68 = {7,9,-1,0,9,ch68data};
-
-/* char: 0x43 'C' */
-
-static const GLubyte ch67data[] = {
-0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c,
-};
-
-static const BitmapCharRec ch67 = {7,9,-1,0,9,ch67data};
-
-/* char: 0x42 'B' */
-
-static const GLubyte ch66data[] = {
-0xf8,0x84,0x84,0x84,0xf8,0x84,0x84,0x84,0xf8,
-};
-
-static const BitmapCharRec ch66 = {6,9,-1,0,8,ch66data};
-
-/* char: 0x41 'A' */
-
-static const GLubyte ch65data[] = {
-0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x28,0x10,
-};
-
-static const BitmapCharRec ch65 = {7,9,-1,0,9,ch65data};
-
-/* char: 0x40 '@' */
-
-static const GLubyte ch64data[] = {
-0x3e,0x0,0x40,0x0,0x9b,0x0,0xa6,0x80,0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40,
-0x60,0x80,0x1f,0x0,
-};
-
-static const BitmapCharRec ch64 = {10,10,-1,1,12,ch64data};
-
-/* char: 0x3f '?' */
-
-static const GLubyte ch63data[] = {
-0x20,0x0,0x20,0x20,0x10,0x10,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch63 = {5,9,-1,0,7,ch63data};
-
-/* char: 0x3e '>' */
-
-static const GLubyte ch62data[] = {
-0xc0,0x30,0xc,0x30,0xc0,
-};
-
-static const BitmapCharRec ch62 = {6,5,-1,-1,7,ch62data};
-
-/* char: 0x3d '=' */
-
-static const GLubyte ch61data[] = {
-0xf8,0x0,0xf8,
-};
-
-static const BitmapCharRec ch61 = {5,3,-1,-2,7,ch61data};
-
-/* char: 0x3c '<' */
-
-static const GLubyte ch60data[] = {
-0xc,0x30,0xc0,0x30,0xc,
-};
-
-static const BitmapCharRec ch60 = {6,5,0,-1,7,ch60data};
-
-/* char: 0x3b ';' */
-
-static const GLubyte ch59data[] = {
-0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40,
-};
-
-static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data};
-
-/* char: 0x3a ':' */
-
-static const GLubyte ch58data[] = {
-0x80,0x0,0x0,0x0,0x0,0x80,
-};
-
-static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data};
-
-/* char: 0x39 '9' */
-
-static const GLubyte ch57data[] = {
-0x70,0x88,0x8,0x8,0x78,0x88,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch57 = {5,9,-1,0,7,ch57data};
-
-/* char: 0x38 '8' */
-
-static const GLubyte ch56data[] = {
-0x70,0x88,0x88,0x88,0x88,0x70,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch56 = {5,9,-1,0,7,ch56data};
-
-/* char: 0x37 '7' */
-
-static const GLubyte ch55data[] = {
-0x40,0x40,0x20,0x20,0x20,0x10,0x10,0x8,0xf8,
-};
-
-static const BitmapCharRec ch55 = {5,9,-1,0,7,ch55data};
-
-/* char: 0x36 '6' */
-
-static const GLubyte ch54data[] = {
-0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70,
-};
-
-static const BitmapCharRec ch54 = {5,9,-1,0,7,ch54data};
-
-/* char: 0x35 '5' */
-
-static const GLubyte ch53data[] = {
-0x70,0x88,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8,
-};
-
-static const BitmapCharRec ch53 = {5,9,-1,0,7,ch53data};
-
-/* char: 0x34 '4' */
-
-static const GLubyte ch52data[] = {
-0x8,0x8,0xfc,0x88,0x48,0x28,0x28,0x18,0x8,
-};
-
-static const BitmapCharRec ch52 = {6,9,0,0,7,ch52data};
-
-/* char: 0x33 '3' */
-
-static const GLubyte ch51data[] = {
-0x70,0x88,0x88,0x8,0x8,0x30,0x8,0x88,0x70,
-};
-
-static const BitmapCharRec ch51 = {5,9,-1,0,7,ch51data};
-
-/* char: 0x32 '2' */
-
-static const GLubyte ch50data[] = {
-0xf8,0x80,0x80,0x40,0x20,0x10,0x8,0x88,0x70,
-};
-
-static const BitmapCharRec ch50 = {5,9,-1,0,7,ch50data};
-
-/* char: 0x31 '1' */
-
-static const GLubyte ch49data[] = {
-0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x20,
-};
-
-static const BitmapCharRec ch49 = {3,9,-1,0,7,ch49data};
-
-/* char: 0x30 '0' */
-
-static const GLubyte ch48data[] = {
-0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70,
-};
-
-static const BitmapCharRec ch48 = {5,9,-1,0,7,ch48data};
-
-/* char: 0x2f '/' */
-
-static const GLubyte ch47data[] = {
-0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10,
-};
-
-static const BitmapCharRec ch47 = {4,9,0,0,4,ch47data};
-
-/* char: 0x2e '.' */
-
-static const GLubyte ch46data[] = {
-0x80,
-};
-
-static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data};
-
-/* char: 0x2d '-' */
-
-static const GLubyte ch45data[] = {
-0xf8,
-};
-
-static const BitmapCharRec ch45 = {5,1,-1,-3,8,ch45data};
-
-/* char: 0x2c ',' */
-
-static const GLubyte ch44data[] = {
-0x80,0x40,0x40,
-};
-
-static const BitmapCharRec ch44 = {2,3,-1,2,4,ch44data};
-
-/* char: 0x2b '+' */
-
-static const GLubyte ch43data[] = {
-0x20,0x20,0xf8,0x20,0x20,
-};
-
-static const BitmapCharRec ch43 = {5,5,-1,-1,7,ch43data};
-
-/* char: 0x2a '*' */
-
-static const GLubyte ch42data[] = {
-0xa0,0x40,0xa0,
-};
-
-static const BitmapCharRec ch42 = {3,3,-1,-6,5,ch42data};
-
-/* char: 0x29 ')' */
-
-static const GLubyte ch41data[] = {
-0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80,
-};
-
-static const BitmapCharRec ch41 = {3,12,0,3,4,ch41data};
-
-/* char: 0x28 '(' */
-
-static const GLubyte ch40data[] = {
-0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20,
-};
-
-static const BitmapCharRec ch40 = {3,12,-1,3,4,ch40data};
-
-/* char: 0x27 ''' */
-
-static const GLubyte ch39data[] = {
-0x80,0x40,0xc0,
-};
-
-static const BitmapCharRec ch39 = {2,3,-1,-6,3,ch39data};
-
-/* char: 0x26 '&' */
-
-static const GLubyte ch38data[] = {
-0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,0x30,
-};
-
-static const BitmapCharRec ch38 = {7,9,-1,0,9,ch38data};
-
-/* char: 0x25 '%' */
-
-static const GLubyte ch37data[] = {
-0x23,0x0,0x14,0x80,0x14,0x80,0x13,0x0,0x8,0x0,0x68,0x0,0x94,0x0,0x94,0x0,
-0x62,0x0,
-};
-
-static const BitmapCharRec ch37 = {9,9,-1,0,11,ch37data};
-
-/* char: 0x24 '$' */
-
-static const GLubyte ch36data[] = {
-0x20,0x70,0xa8,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20,
-};
-
-static const BitmapCharRec ch36 = {5,10,-1,1,7,ch36data};
-
-/* char: 0x23 '#' */
-
-static const GLubyte ch35data[] = {
-0x50,0x50,0x50,0xfc,0x28,0xfc,0x28,0x28,
-};
-
-static const BitmapCharRec ch35 = {6,8,0,0,7,ch35data};
-
-/* char: 0x22 '"' */
-
-static const GLubyte ch34data[] = {
-0xa0,0xa0,0xa0,
-};
-
-static const BitmapCharRec ch34 = {3,3,-1,-6,5,ch34data};
-
-/* char: 0x21 '!' */
-
-static const GLubyte ch33data[] = {
-0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-};
-
-static const BitmapCharRec ch33 = {1,9,-1,0,3,ch33data};
-
-/* char: 0x20 ' ' */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch32data[] = { 0x0 };
-static const BitmapCharRec ch32 = {1,1,0,0,4,ch32data};
-#else
-static const BitmapCharRec ch32 = {0,0,0,0,4,0};
-#endif
-
-static const BitmapCharRec * const chars[] = {
-&ch32,
-&ch33,
-&ch34,
-&ch35,
-&ch36,
-&ch37,
-&ch38,
-&ch39,
-&ch40,
-&ch41,
-&ch42,
-&ch43,
-&ch44,
-&ch45,
-&ch46,
-&ch47,
-&ch48,
-&ch49,
-&ch50,
-&ch51,
-&ch52,
-&ch53,
-&ch54,
-&ch55,
-&ch56,
-&ch57,
-&ch58,
-&ch59,
-&ch60,
-&ch61,
-&ch62,
-&ch63,
-&ch64,
-&ch65,
-&ch66,
-&ch67,
-&ch68,
-&ch69,
-&ch70,
-&ch71,
-&ch72,
-&ch73,
-&ch74,
-&ch75,
-&ch76,
-&ch77,
-&ch78,
-&ch79,
-&ch80,
-&ch81,
-&ch82,
-&ch83,
-&ch84,
-&ch85,
-&ch86,
-&ch87,
-&ch88,
-&ch89,
-&ch90,
-&ch91,
-&ch92,
-&ch93,
-&ch94,
-&ch95,
-&ch96,
-&ch97,
-&ch98,
-&ch99,
-&ch100,
-&ch101,
-&ch102,
-&ch103,
-&ch104,
-&ch105,
-&ch106,
-&ch107,
-&ch108,
-&ch109,
-&ch110,
-&ch111,
-&ch112,
-&ch113,
-&ch114,
-&ch115,
-&ch116,
-&ch117,
-&ch118,
-&ch119,
-&ch120,
-&ch121,
-&ch122,
-&ch123,
-&ch124,
-&ch125,
-&ch126,
-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,
-&ch160,
-&ch161,
-&ch162,
-&ch163,
-&ch164,
-&ch165,
-&ch166,
-&ch167,
-&ch168,
-&ch169,
-&ch170,
-&ch171,
-&ch172,
-&ch173,
-&ch174,
-&ch175,
-&ch176,
-&ch177,
-&ch178,
-&ch179,
-&ch180,
-&ch181,
-&ch182,
-&ch183,
-&ch184,
-&ch185,
-&ch186,
-&ch187,
-&ch188,
-&ch189,
-&ch190,
-&ch191,
-&ch192,
-&ch193,
-&ch194,
-&ch195,
-&ch196,
-&ch197,
-&ch198,
-&ch199,
-&ch200,
-&ch201,
-&ch202,
-&ch203,
-&ch204,
-&ch205,
-&ch206,
-&ch207,
-&ch208,
-&ch209,
-&ch210,
-&ch211,
-&ch212,
-&ch213,
-&ch214,
-&ch215,
-&ch216,
-&ch217,
-&ch218,
-&ch219,
-&ch220,
-&ch221,
-&ch222,
-&ch223,
-&ch224,
-&ch225,
-&ch226,
-&ch227,
-&ch228,
-&ch229,
-&ch230,
-&ch231,
-&ch232,
-&ch233,
-&ch234,
-&ch235,
-&ch236,
-&ch237,
-&ch238,
-&ch239,
-&ch240,
-&ch241,
-&ch242,
-&ch243,
-&ch244,
-&ch245,
-&ch246,
-&ch247,
-&ch248,
-&ch249,
-&ch250,
-&ch251,
-&ch252,
-&ch253,
-&ch254,
-&ch255,
-};
-
-#if !defined(__IBMCPP__)
-const
-#endif
-BitmapFontRec glutBitmapHelvetica12 = {
-"-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1",
-224,
-32,
-chars
-};
-
diff --git a/src/glut/os2/glut_hel18.cpp b/src/glut/os2/glut_hel18.cpp
deleted file mode 100644
index 26f88ec505d..00000000000
--- a/src/glut/os2/glut_hel18.cpp
+++ /dev/null
@@ -1,1900 +0,0 @@
-
-/* GENERATED FILE -- DO NOT MODIFY */
-
-#define glutBitmapHelvetica18 XXX
-#include "glutbitmap.h"
-#undef glutBitmapHelvetica18
-
-/* char: 0xff */
-
-static const GLubyte ch255data[] = {
-0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x66,
-0x66,
-};
-
-static const BitmapCharRec ch255 = {8,17,-1,4,10,ch255data};
-
-/* char: 0xfe */
-
-static const GLubyte ch254data[] = {
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,
-0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,
-0xc0,0x0,0xc0,0x0,
-};
-
-static const BitmapCharRec ch254 = {9,18,-1,4,11,ch254data};
-
-/* char: 0xfd */
-
-static const GLubyte ch253data[] = {
-0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x18,
-0xc,0x6,
-};
-
-static const BitmapCharRec ch253 = {8,18,-1,4,10,ch253data};
-
-/* char: 0xfc */
-
-static const GLubyte ch252data[] = {
-0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x66,
-};
-
-static const BitmapCharRec ch252 = {8,13,-1,0,10,ch252data};
-
-/* char: 0xfb */
-
-static const GLubyte ch251data[] = {
-0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x3c,0x18,
-};
-
-static const BitmapCharRec ch251 = {8,14,-1,0,10,ch251data};
-
-/* char: 0xfa */
-
-static const GLubyte ch250data[] = {
-0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x18,0xc,0x6,
-};
-
-static const BitmapCharRec ch250 = {8,14,-1,0,10,ch250data};
-
-/* char: 0xf9 */
-
-static const GLubyte ch249data[] = {
-0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0xc,0x18,0x30,
-};
-
-static const BitmapCharRec ch249 = {8,14,-1,0,10,ch249data};
-
-/* char: 0xf8 */
-
-static const GLubyte ch248data[] = {
-0xce,0x0,0x7f,0x80,0x31,0x80,0x78,0xc0,0x6c,0xc0,0x66,0xc0,0x63,0xc0,0x31,0x80,
-0x3f,0xc0,0xe,0x60,
-};
-
-static const BitmapCharRec ch248 = {11,10,0,0,11,ch248data};
-
-/* char: 0xf7 */
-
-static const GLubyte ch247data[] = {
-0x18,0x18,0x0,0xff,0xff,0x0,0x18,0x18,
-};
-
-static const BitmapCharRec ch247 = {8,8,-1,-1,10,ch247data};
-
-/* char: 0xf6 */
-
-static const GLubyte ch246data[] = {
-0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0,
-0x7f,0x0,0x3e,0x0,0x0,0x0,0x36,0x0,0x36,0x0,
-};
-
-static const BitmapCharRec ch246 = {9,13,-1,0,11,ch246data};
-
-/* char: 0xf5 */
-
-static const GLubyte ch245data[] = {
-0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0,
-0x7f,0x0,0x3e,0x0,0x0,0x0,0x26,0x0,0x2d,0x0,0x19,0x0,
-};
-
-static const BitmapCharRec ch245 = {9,14,-1,0,11,ch245data};
-
-/* char: 0xf4 */
-
-static const GLubyte ch244data[] = {
-0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0,
-0x7f,0x0,0x3e,0x0,0x0,0x0,0x33,0x0,0x1e,0x0,0xc,0x0,
-};
-
-static const BitmapCharRec ch244 = {9,14,-1,0,11,ch244data};
-
-/* char: 0xf3 */
-
-static const GLubyte ch243data[] = {
-0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0,
-0x7f,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0xc,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch243 = {9,14,-1,0,11,ch243data};
-
-/* char: 0xf2 */
-
-static const GLubyte ch242data[] = {
-0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0,
-0x7f,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x18,0x0,0x30,0x0,
-};
-
-static const BitmapCharRec ch242 = {9,14,-1,0,11,ch242data};
-
-/* char: 0xf1 */
-
-static const GLubyte ch241data[] = {
-0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0x0,0x4c,0x5a,0x32,
-};
-
-static const BitmapCharRec ch241 = {8,14,-1,0,10,ch241data};
-
-/* char: 0xf0 */
-
-static const GLubyte ch240data[] = {
-0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0,
-0x7f,0x0,0x3e,0x0,0x4c,0x0,0x38,0x0,0x36,0x0,0x60,0x0,
-};
-
-static const BitmapCharRec ch240 = {9,14,-1,0,11,ch240data};
-
-/* char: 0xef */
-
-static const GLubyte ch239data[] = {
-0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xd8,0xd8,
-};
-
-static const BitmapCharRec ch239 = {5,13,0,0,4,ch239data};
-
-/* char: 0xee */
-
-static const GLubyte ch238data[] = {
-0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,0x78,0x30,
-};
-
-static const BitmapCharRec ch238 = {6,14,1,0,4,ch238data};
-
-/* char: 0xed */
-
-static const GLubyte ch237data[] = {
-0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xc0,0x60,0x30,
-};
-
-static const BitmapCharRec ch237 = {4,14,0,0,4,ch237data};
-
-/* char: 0xec */
-
-static const GLubyte ch236data[] = {
-0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0x30,0x60,0xc0,
-};
-
-static const BitmapCharRec ch236 = {4,14,0,0,4,ch236data};
-
-/* char: 0xeb */
-
-static const GLubyte ch235data[] = {
-0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x36,0x36,
-};
-
-static const BitmapCharRec ch235 = {8,13,-1,0,10,ch235data};
-
-/* char: 0xea */
-
-static const GLubyte ch234data[] = {
-0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x66,0x3c,0x18,
-};
-
-static const BitmapCharRec ch234 = {8,14,-1,0,10,ch234data};
-
-/* char: 0xe9 */
-
-static const GLubyte ch233data[] = {
-0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0xc,0x6,
-};
-
-static const BitmapCharRec ch233 = {8,14,-1,0,10,ch233data};
-
-/* char: 0xe8 */
-
-static const GLubyte ch232data[] = {
-0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0x30,0x60,
-};
-
-static const BitmapCharRec ch232 = {8,14,-1,0,10,ch232data};
-
-/* char: 0xe7 */
-
-static const GLubyte ch231data[] = {
-0x78,0x6c,0xc,0x38,0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e,
-};
-
-static const BitmapCharRec ch231 = {8,14,-1,4,10,ch231data};
-
-/* char: 0xe6 */
-
-static const GLubyte ch230data[] = {
-0x75,0xe0,0xef,0xf8,0xc7,0x18,0xc6,0x0,0xe6,0x0,0x7f,0xf8,0xe,0x18,0xc6,0x18,
-0xef,0xf0,0x7d,0xe0,
-};
-
-static const BitmapCharRec ch230 = {13,10,-1,0,15,ch230data};
-
-/* char: 0xe5 */
-
-static const GLubyte ch229data[] = {
-0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x38,0x6c,0x6c,0x38,
-};
-
-static const BitmapCharRec ch229 = {7,14,-1,0,9,ch229data};
-
-/* char: 0xe4 */
-
-static const GLubyte ch228data[] = {
-0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x6c,0x6c,
-};
-
-static const BitmapCharRec ch228 = {7,13,-1,0,9,ch228data};
-
-/* char: 0xe3 */
-
-static const GLubyte ch227data[] = {
-0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x4c,0x5a,0x32,
-};
-
-static const BitmapCharRec ch227 = {7,14,-1,0,9,ch227data};
-
-/* char: 0xe2 */
-
-static const GLubyte ch226data[] = {
-0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x66,0x3c,0x18,
-};
-
-static const BitmapCharRec ch226 = {7,14,-1,0,9,ch226data};
-
-/* char: 0xe1 */
-
-static const GLubyte ch225data[] = {
-0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x30,0x18,0xc,
-};
-
-static const BitmapCharRec ch225 = {7,14,-1,0,9,ch225data};
-
-/* char: 0xe0 */
-
-static const GLubyte ch224data[] = {
-0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x18,0x30,0x60,
-};
-
-static const BitmapCharRec ch224 = {7,14,-1,0,9,ch224data};
-
-/* char: 0xdf */
-
-static const GLubyte ch223data[] = {
-0xdc,0xde,0xc6,0xc6,0xc6,0xc6,0xdc,0xdc,0xc6,0xc6,0xc6,0xc6,0x7c,0x38,
-};
-
-static const BitmapCharRec ch223 = {7,14,-1,0,9,ch223data};
-
-/* char: 0xde */
-
-static const GLubyte ch222data[] = {
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc1,0xc0,0xff,0x80,0xff,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,
-};
-
-static const BitmapCharRec ch222 = {10,14,-1,0,12,ch222data};
-
-/* char: 0xdd */
-
-static const GLubyte ch221data[] = {
-0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80,
-0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,0x0,0x0,0x6,0x0,
-0x3,0x0,0x1,0x80,
-};
-
-static const BitmapCharRec ch221 = {12,18,-1,0,14,ch221data};
-
-/* char: 0xdc */
-
-static const GLubyte ch220data[] = {
-0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80,
-0x19,0x80,
-};
-
-static const BitmapCharRec ch220 = {11,17,-1,0,13,ch220data};
-
-/* char: 0xdb */
-
-static const GLubyte ch219data[] = {
-0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80,
-0xf,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch219 = {11,18,-1,0,13,ch219data};
-
-/* char: 0xda */
-
-static const GLubyte ch218data[] = {
-0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0xc,0x0,
-0x6,0x0,0x3,0x0,
-};
-
-static const BitmapCharRec ch218 = {11,18,-1,0,13,ch218data};
-
-/* char: 0xd9 */
-
-static const GLubyte ch217data[] = {
-0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x6,0x0,
-0xc,0x0,0x18,0x0,
-};
-
-static const BitmapCharRec ch217 = {11,18,-1,0,13,ch217data};
-
-/* char: 0xd8 */
-
-static const GLubyte ch216data[] = {
-0xc7,0xc0,0xff,0xf0,0x78,0x38,0x38,0x18,0x6c,0x1c,0x6e,0xc,0x67,0xc,0x63,0x8c,
-0x61,0xcc,0x70,0xdc,0x30,0x78,0x38,0x38,0x1f,0xfc,0x7,0xcc,
-};
-
-static const BitmapCharRec ch216 = {14,14,0,0,15,ch216data};
-
-/* char: 0xd7 */
-
-static const GLubyte ch215data[] = {
-0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch215 = {10,9,0,0,10,ch215data};
-
-/* char: 0xd6 */
-
-static const GLubyte ch214data[] = {
-0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18,
-0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xd,0x80,
-0xd,0x80,
-};
-
-static const BitmapCharRec ch214 = {13,17,-1,0,15,ch214data};
-
-/* char: 0xd5 */
-
-static const GLubyte ch213data[] = {
-0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18,
-0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x9,0x80,
-0xb,0x40,0x6,0x40,
-};
-
-static const BitmapCharRec ch213 = {13,18,-1,0,15,ch213data};
-
-/* char: 0xd4 */
-
-static const GLubyte ch212data[] = {
-0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18,
-0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xc,0xc0,
-0x7,0x80,0x3,0x0,
-};
-
-static const BitmapCharRec ch212 = {13,18,-1,0,15,ch212data};
-
-/* char: 0xd3 */
-
-static const GLubyte ch211data[] = {
-0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18,
-0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0,
-0x1,0x80,0x0,0xc0,
-};
-
-static const BitmapCharRec ch211 = {13,18,-1,0,15,ch211data};
-
-/* char: 0xd2 */
-
-static const GLubyte ch210data[] = {
-0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18,
-0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0,
-0x6,0x0,0xc,0x0,
-};
-
-static const BitmapCharRec ch210 = {13,18,-1,0,15,ch210data};
-
-/* char: 0xd1 */
-
-static const GLubyte ch209data[] = {
-0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60,
-0xcc,0x60,0xd8,0x60,0xd8,0x60,0xf0,0x60,0xe0,0x60,0xe0,0x60,0x0,0x0,0x13,0x0,
-0x16,0x80,0xc,0x80,
-};
-
-static const BitmapCharRec ch209 = {11,18,-1,0,13,ch209data};
-
-/* char: 0xd0 */
-
-static const GLubyte ch208data[] = {
-0x7f,0x80,0x7f,0xc0,0x60,0xe0,0x60,0x60,0x60,0x30,0x60,0x30,0xfc,0x30,0xfc,0x30,
-0x60,0x30,0x60,0x30,0x60,0x60,0x60,0xe0,0x7f,0xc0,0x7f,0x80,
-};
-
-static const BitmapCharRec ch208 = {12,14,0,0,13,ch208data};
-
-/* char: 0xcf */
-
-static const GLubyte ch207data[] = {
-0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,
-0xcc,
-};
-
-static const BitmapCharRec ch207 = {6,17,0,0,6,ch207data};
-
-/* char: 0xce */
-
-static const GLubyte ch206data[] = {
-0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,
-0x78,0x30,
-};
-
-static const BitmapCharRec ch206 = {6,18,0,0,6,ch206data};
-
-/* char: 0xcd */
-
-static const GLubyte ch205data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0xc0,
-0x60,0x30,
-};
-
-static const BitmapCharRec ch205 = {4,18,-2,0,6,ch205data};
-
-/* char: 0xcc */
-
-static const GLubyte ch204data[] = {
-0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x30,
-0x60,0xc0,
-};
-
-static const BitmapCharRec ch204 = {4,18,0,0,6,ch204data};
-
-/* char: 0xcb */
-
-static const GLubyte ch203data[] = {
-0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0,
-0x33,0x0,
-};
-
-static const BitmapCharRec ch203 = {9,17,-1,0,11,ch203data};
-
-/* char: 0xca */
-
-static const GLubyte ch202data[] = {
-0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0,
-0x1e,0x0,0xc,0x0,
-};
-
-static const BitmapCharRec ch202 = {9,18,-1,0,11,ch202data};
-
-/* char: 0xc9 */
-
-static const GLubyte ch201data[] = {
-0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0,
-0x6,0x0,0x3,0x0,
-};
-
-static const BitmapCharRec ch201 = {9,18,-1,0,11,ch201data};
-
-/* char: 0xc8 */
-
-static const GLubyte ch200data[] = {
-0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0,
-0x18,0x0,0x30,0x0,
-};
-
-static const BitmapCharRec ch200 = {9,18,-1,0,11,ch200data};
-
-/* char: 0xc7 */
-
-static const GLubyte ch199data[] = {
-0x1e,0x0,0x1b,0x0,0x3,0x0,0xe,0x0,0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,
-0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,
-0x3f,0xe0,0xf,0x80,
-};
-
-static const BitmapCharRec ch199 = {12,18,-1,4,14,ch199data};
-
-/* char: 0xc6 */
-
-static const GLubyte ch198data[] = {
-0xc1,0xff,0xc1,0xff,0x61,0x80,0x61,0x80,0x7f,0x80,0x3f,0x80,0x31,0xfe,0x31,0xfe,
-0x19,0x80,0x19,0x80,0xd,0x80,0xd,0x80,0x7,0xff,0x7,0xff,
-};
-
-static const BitmapCharRec ch198 = {16,14,-1,0,18,ch198data};
-
-/* char: 0xc5 */
-
-static const GLubyte ch197data[] = {
-0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0,
-0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80,
-0x19,0x80,0xf,0x0,
-};
-
-static const BitmapCharRec ch197 = {12,18,0,0,12,ch197data};
-
-/* char: 0xc4 */
-
-static const GLubyte ch196data[] = {
-0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0,
-0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80,
-0x19,0x80,
-};
-
-static const BitmapCharRec ch196 = {12,17,0,0,12,ch196data};
-
-/* char: 0xc3 */
-
-static const GLubyte ch195data[] = {
-0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0,
-0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x13,0x0,
-0x16,0x80,0xc,0x80,
-};
-
-static const BitmapCharRec ch195 = {12,18,0,0,12,ch195data};
-
-/* char: 0xc2 */
-
-static const GLubyte ch194data[] = {
-0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0,
-0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80,
-0xf,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch194 = {12,18,0,0,12,ch194data};
-
-/* char: 0xc1 */
-
-static const GLubyte ch193data[] = {
-0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0,
-0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0,
-0x3,0x0,0x1,0x80,
-};
-
-static const BitmapCharRec ch193 = {12,18,0,0,12,ch193data};
-
-/* char: 0xc0 */
-
-static const GLubyte ch192data[] = {
-0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0,
-0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0,
-0xc,0x0,0x18,0x0,
-};
-
-static const BitmapCharRec ch192 = {12,18,0,0,12,ch192data};
-
-/* char: 0xbf */
-
-static const GLubyte ch191data[] = {
-0x7c,0xfe,0xc6,0xc6,0xe0,0x70,0x38,0x18,0x18,0x18,0x0,0x0,0x18,0x18,
-};
-
-static const BitmapCharRec ch191 = {7,14,-1,4,10,ch191data};
-
-/* char: 0xbe */
-
-static const GLubyte ch190data[] = {
-0x18,0x18,0x18,0x18,0xc,0xfc,0x6,0xd8,0x6,0x78,0x73,0x38,0xf9,0x18,0x99,0x88,
-0x30,0xc0,0x30,0xc0,0x98,0x60,0xf8,0x30,0x70,0x30,
-};
-
-static const BitmapCharRec ch190 = {14,13,0,0,15,ch190data};
-
-/* char: 0xbd */
-
-static const GLubyte ch189data[] = {
-0x30,0xf8,0x30,0xf8,0x18,0x60,0xc,0x30,0xc,0x18,0x66,0x98,0x62,0xf8,0x63,0x70,
-0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60,
-};
-
-static const BitmapCharRec ch189 = {13,13,-1,0,15,ch189data};
-
-/* char: 0xbc */
-
-static const GLubyte ch188data[] = {
-0x30,0x30,0x30,0x30,0x19,0xf8,0xd,0xb0,0xc,0xf0,0x66,0x70,0x62,0x30,0x63,0x10,
-0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60,
-};
-
-static const BitmapCharRec ch188 = {13,13,-1,0,15,ch188data};
-
-/* char: 0xbb */
-
-static const GLubyte ch187data[] = {
-0x90,0xd8,0x6c,0x36,0x36,0x6c,0xd8,0x90,
-};
-
-static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data};
-
-/* char: 0xba */
-
-static const GLubyte ch186data[] = {
-0xf8,0x0,0x70,0xd8,0x88,0x88,0xd8,0x70,
-};
-
-static const BitmapCharRec ch186 = {5,8,-1,-6,7,ch186data};
-
-/* char: 0xb9 */
-
-static const GLubyte ch185data[] = {
-0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60,
-};
-
-static const BitmapCharRec ch185 = {3,8,-1,-5,6,ch185data};
-
-/* char: 0xb8 */
-
-static const GLubyte ch184data[] = {
-0xf0,0xd8,0x18,0x70,0x60,
-};
-
-static const BitmapCharRec ch184 = {5,5,0,4,5,ch184data};
-
-/* char: 0xb7 */
-
-static const GLubyte ch183data[] = {
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch183 = {2,2,-1,-4,4,ch183data};
-
-/* char: 0xb6 */
-
-static const GLubyte ch182data[] = {
-0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x32,0x72,0xf2,0xf2,0xf2,0xf2,
-0x72,0x3f,
-};
-
-static const BitmapCharRec ch182 = {8,18,-1,4,10,ch182data};
-
-/* char: 0xb5 */
-
-static const GLubyte ch181data[] = {
-0xc0,0xc0,0xc0,0xc0,0xdb,0xff,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,
-};
-
-static const BitmapCharRec ch181 = {8,14,-1,4,10,ch181data};
-
-/* char: 0xb4 */
-
-static const GLubyte ch180data[] = {
-0xc0,0x60,0x30,
-};
-
-static const BitmapCharRec ch180 = {4,3,0,-11,4,ch180data};
-
-/* char: 0xb3 */
-
-static const GLubyte ch179data[] = {
-0x70,0xf8,0x98,0x30,0x30,0x98,0xf8,0x70,
-};
-
-static const BitmapCharRec ch179 = {5,8,0,-5,6,ch179data};
-
-/* char: 0xb2 */
-
-static const GLubyte ch178data[] = {
-0xf8,0xf8,0x60,0x30,0x18,0x98,0xf8,0x70,
-};
-
-static const BitmapCharRec ch178 = {5,8,0,-5,6,ch178data};
-
-/* char: 0xb1 */
-
-static const GLubyte ch177data[] = {
-0xff,0xff,0x0,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,
-};
-
-static const BitmapCharRec ch177 = {8,11,-1,0,10,ch177data};
-
-/* char: 0xb0 */
-
-static const GLubyte ch176data[] = {
-0x70,0xd8,0x88,0xd8,0x70,
-};
-
-static const BitmapCharRec ch176 = {5,5,-1,-8,7,ch176data};
-
-/* char: 0xaf */
-
-static const GLubyte ch175data[] = {
-0xf8,
-};
-
-static const BitmapCharRec ch175 = {5,1,0,-12,5,ch175data};
-
-/* char: 0xae */
-
-static const GLubyte ch174data[] = {
-0xf,0x80,0x30,0x60,0x40,0x10,0x48,0x50,0x88,0x88,0x89,0x8,0x8f,0x88,0x88,0x48,
-0x88,0x48,0x4f,0x90,0x40,0x10,0x30,0x60,0xf,0x80,
-};
-
-static const BitmapCharRec ch174 = {13,13,-1,0,14,ch174data};
-
-/* char: 0xad */
-
-static const GLubyte ch173data[] = {
-0xf8,0xf8,
-};
-
-static const BitmapCharRec ch173 = {5,2,-1,-4,7,ch173data};
-
-/* char: 0xac */
-
-static const GLubyte ch172data[] = {
-0x1,0x80,0x1,0x80,0x1,0x80,0xff,0x80,0xff,0x80,
-};
-
-static const BitmapCharRec ch172 = {9,5,-1,-3,11,ch172data};
-
-/* char: 0xab */
-
-static const GLubyte ch171data[] = {
-0x12,0x36,0x6c,0xd8,0xd8,0x6c,0x36,0x12,
-};
-
-static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data};
-
-/* char: 0xaa */
-
-static const GLubyte ch170data[] = {
-0xf8,0x0,0x68,0xd8,0x48,0x38,0xc8,0x70,
-};
-
-static const BitmapCharRec ch170 = {5,8,-1,-6,7,ch170data};
-
-/* char: 0xa9 */
-
-static const GLubyte ch169data[] = {
-0xf,0x80,0x30,0x60,0x40,0x10,0x47,0x10,0x88,0x88,0x90,0x8,0x90,0x8,0x90,0x8,
-0x88,0x88,0x47,0x10,0x40,0x10,0x30,0x60,0xf,0x80,
-};
-
-static const BitmapCharRec ch169 = {13,13,-1,0,15,ch169data};
-
-/* char: 0xa8 */
-
-static const GLubyte ch168data[] = {
-0xd8,0xd8,
-};
-
-static const BitmapCharRec ch168 = {5,2,0,-11,6,ch168data};
-
-/* char: 0xa7 */
-
-static const GLubyte ch167data[] = {
-0x3c,0x7e,0xc3,0xc3,0x7,0xe,0x3e,0x73,0xe3,0xc3,0xc7,0x6e,0x7c,0xf0,0xc3,0xc3,
-0x7e,0x3c,
-};
-
-static const BitmapCharRec ch167 = {8,18,-1,4,10,ch167data};
-
-/* char: 0xa6 */
-
-static const GLubyte ch166data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,
-};
-
-static const BitmapCharRec ch166 = {2,17,-1,3,4,ch166data};
-
-/* char: 0xa5 */
-
-static const GLubyte ch165data[] = {
-0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x3c,0x66,0x66,0x66,0xc3,0xc3,
-};
-
-static const BitmapCharRec ch165 = {8,13,-1,0,10,ch165data};
-
-/* char: 0xa4 */
-
-static const GLubyte ch164data[] = {
-0xc3,0xff,0x66,0x66,0x66,0xff,0xc3,
-};
-
-static const BitmapCharRec ch164 = {8,7,-1,-3,10,ch164data};
-
-/* char: 0xa3 */
-
-static const GLubyte ch163data[] = {
-0xdf,0x0,0xff,0x80,0x60,0x80,0x30,0x0,0x18,0x0,0x18,0x0,0x7e,0x0,0x30,0x0,
-0x60,0x0,0x61,0x80,0x61,0x80,0x3f,0x0,0x1e,0x0,
-};
-
-static const BitmapCharRec ch163 = {9,13,0,0,10,ch163data};
-
-/* char: 0xa2 */
-
-static const GLubyte ch162data[] = {
-0x10,0x10,0x3e,0x7f,0x6b,0xc8,0xc8,0xc8,0xc8,0x6b,0x7f,0x3e,0x4,0x4,
-};
-
-static const BitmapCharRec ch162 = {8,14,-1,2,10,ch162data};
-
-/* char: 0xa1 */
-
-static const GLubyte ch161data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch161 = {2,14,-2,4,6,ch161data};
-
-/* char: 0xa0 */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch160data[] = { 0x0 };
-static const BitmapCharRec ch160 = {1,1,0,0,5,ch160data};
-#else
-static const BitmapCharRec ch160 = {0,0,0,0,5,0};
-#endif
-
-/* char: 0x7e '~' */
-
-static const GLubyte ch126data[] = {
-0xcc,0x7e,0x33,
-};
-
-static const BitmapCharRec ch126 = {8,3,-1,-4,10,ch126data};
-
-/* char: 0x7d '}' */
-
-static const GLubyte ch125data[] = {
-0xc0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0xc,0x18,0x30,0x30,0x30,0x30,0x30,
-0x60,0xc0,
-};
-
-static const BitmapCharRec ch125 = {6,18,0,4,6,ch125data};
-
-/* char: 0x7c '|' */
-
-static const GLubyte ch124data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch124 = {2,18,-1,4,4,ch124data};
-
-/* char: 0x7b '{' */
-
-static const GLubyte ch123data[] = {
-0xc,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x30,0x30,0x30,
-0x18,0xc,
-};
-
-static const BitmapCharRec ch123 = {6,18,0,4,6,ch123data};
-
-/* char: 0x7a 'z' */
-
-static const GLubyte ch122data[] = {
-0xfe,0xfe,0xc0,0x60,0x30,0x18,0xc,0x6,0xfe,0xfe,
-};
-
-static const BitmapCharRec ch122 = {7,10,-1,0,9,ch122data};
-
-/* char: 0x79 'y' */
-
-static const GLubyte ch121data[] = {
-0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,
-};
-
-static const BitmapCharRec ch121 = {8,14,-1,4,10,ch121data};
-
-/* char: 0x78 'x' */
-
-static const GLubyte ch120data[] = {
-0xc3,0xe7,0x66,0x3c,0x18,0x18,0x3c,0x66,0xe7,0xc3,
-};
-
-static const BitmapCharRec ch120 = {8,10,-1,0,10,ch120data};
-
-/* char: 0x77 'w' */
-
-static const GLubyte ch119data[] = {
-0x19,0x80,0x19,0x80,0x39,0xc0,0x29,0x40,0x69,0x60,0x66,0x60,0x66,0x60,0xc6,0x30,
-0xc6,0x30,0xc6,0x30,
-};
-
-static const BitmapCharRec ch119 = {12,10,-1,0,14,ch119data};
-
-/* char: 0x76 'v' */
-
-static const GLubyte ch118data[] = {
-0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,
-};
-
-static const BitmapCharRec ch118 = {8,10,-1,0,10,ch118data};
-
-/* char: 0x75 'u' */
-
-static const GLubyte ch117data[] = {
-0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,
-};
-
-static const BitmapCharRec ch117 = {8,10,-1,0,10,ch117data};
-
-/* char: 0x74 't' */
-
-static const GLubyte ch116data[] = {
-0x18,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x30,
-};
-
-static const BitmapCharRec ch116 = {6,13,0,0,6,ch116data};
-
-/* char: 0x73 's' */
-
-static const GLubyte ch115data[] = {
-0x78,0xfc,0xc6,0x6,0x3e,0xfc,0xc0,0xc6,0x7e,0x3c,
-};
-
-static const BitmapCharRec ch115 = {7,10,-1,0,9,ch115data};
-
-/* char: 0x72 'r' */
-
-static const GLubyte ch114data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xd8,0xd8,
-};
-
-static const BitmapCharRec ch114 = {5,10,-1,0,6,ch114data};
-
-/* char: 0x71 'q' */
-
-static const GLubyte ch113data[] = {
-0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,
-0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,0x7f,0x80,0x3d,0x80,
-};
-
-static const BitmapCharRec ch113 = {9,14,-1,4,11,ch113data};
-
-/* char: 0x70 'p' */
-
-static const GLubyte ch112data[] = {
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,
-0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,
-};
-
-static const BitmapCharRec ch112 = {9,14,-1,4,11,ch112data};
-
-/* char: 0x6f 'o' */
-
-static const GLubyte ch111data[] = {
-0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0,
-0x7f,0x0,0x3e,0x0,
-};
-
-static const BitmapCharRec ch111 = {9,10,-1,0,11,ch111data};
-
-/* char: 0x6e 'n' */
-
-static const GLubyte ch110data[] = {
-0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,
-};
-
-static const BitmapCharRec ch110 = {8,10,-1,0,10,ch110data};
-
-/* char: 0x6d 'm' */
-
-static const GLubyte ch109data[] = {
-0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xe7,0x30,
-0xde,0xf0,0xcc,0x60,
-};
-
-static const BitmapCharRec ch109 = {12,10,-1,0,14,ch109data};
-
-/* char: 0x6c 'l' */
-
-static const GLubyte ch108data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch108 = {2,14,-1,0,4,ch108data};
-
-/* char: 0x6b 'k' */
-
-static const GLubyte ch107data[] = {
-0xc7,0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xd8,0xcc,0xc6,0xc0,0xc0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch107 = {8,14,-1,0,9,ch107data};
-
-/* char: 0x6a 'j' */
-
-static const GLubyte ch106data[] = {
-0xe0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x0,
-0x30,0x30,
-};
-
-static const BitmapCharRec ch106 = {4,18,1,4,4,ch106data};
-
-/* char: 0x69 'i' */
-
-static const GLubyte ch105data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch105 = {2,14,-1,0,4,ch105data};
-
-/* char: 0x68 'h' */
-
-static const GLubyte ch104data[] = {
-0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0xc0,0xc0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch104 = {8,14,-1,0,10,ch104data};
-
-/* char: 0x67 'g' */
-
-static const GLubyte ch103data[] = {
-0x1c,0x0,0x7f,0x0,0x63,0x0,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,
-0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x7f,0x80,0x3d,0x80,
-};
-
-static const BitmapCharRec ch103 = {9,14,-1,4,11,ch103data};
-
-/* char: 0x66 'f' */
-
-static const GLubyte ch102data[] = {
-0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x3c,0x1c,
-};
-
-static const BitmapCharRec ch102 = {6,14,0,0,6,ch102data};
-
-/* char: 0x65 'e' */
-
-static const GLubyte ch101data[] = {
-0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,
-};
-
-static const BitmapCharRec ch101 = {8,10,-1,0,10,ch101data};
-
-/* char: 0x64 'd' */
-
-static const GLubyte ch100data[] = {
-0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,
-0x7f,0x80,0x3d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,
-};
-
-static const BitmapCharRec ch100 = {9,14,-1,0,11,ch100data};
-
-/* char: 0x63 'c' */
-
-static const GLubyte ch99data[] = {
-0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e,
-};
-
-static const BitmapCharRec ch99 = {8,10,-1,0,10,ch99data};
-
-/* char: 0x62 'b' */
-
-static const GLubyte ch98data[] = {
-0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,
-0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,
-};
-
-static const BitmapCharRec ch98 = {9,14,-1,0,11,ch98data};
-
-/* char: 0x61 'a' */
-
-static const GLubyte ch97data[] = {
-0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,
-};
-
-static const BitmapCharRec ch97 = {7,10,-1,0,9,ch97data};
-
-/* char: 0x60 '`' */
-
-static const GLubyte ch96data[] = {
-0xc0,0xc0,0x80,0x80,0x40,
-};
-
-static const BitmapCharRec ch96 = {2,5,-1,-9,4,ch96data};
-
-/* char: 0x5f '_' */
-
-static const GLubyte ch95data[] = {
-0xff,0xc0,0xff,0xc0,
-};
-
-static const BitmapCharRec ch95 = {10,2,0,4,10,ch95data};
-
-/* char: 0x5e '^' */
-
-static const GLubyte ch94data[] = {
-0x82,0xc6,0x6c,0x38,0x10,
-};
-
-static const BitmapCharRec ch94 = {7,5,-1,-8,9,ch94data};
-
-/* char: 0x5d ']' */
-
-static const GLubyte ch93data[] = {
-0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
-0xf0,0xf0,
-};
-
-static const BitmapCharRec ch93 = {4,18,0,4,5,ch93data};
-
-/* char: 0x5c '\' */
-
-static const GLubyte ch92data[] = {
-0x18,0x18,0x10,0x10,0x30,0x30,0x20,0x20,0x60,0x60,0x40,0x40,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch92 = {5,14,0,0,5,ch92data};
-
-/* char: 0x5b '[' */
-
-static const GLubyte ch91data[] = {
-0xf0,0xf0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xf0,0xf0,
-};
-
-static const BitmapCharRec ch91 = {4,18,-1,4,5,ch91data};
-
-/* char: 0x5a 'Z' */
-
-static const GLubyte ch90data[] = {
-0xff,0xc0,0xff,0xc0,0xc0,0x0,0x60,0x0,0x30,0x0,0x18,0x0,0x1c,0x0,0xc,0x0,
-0x6,0x0,0x3,0x0,0x1,0x80,0x0,0xc0,0xff,0xc0,0xff,0xc0,
-};
-
-static const BitmapCharRec ch90 = {10,14,-1,0,12,ch90data};
-
-/* char: 0x59 'Y' */
-
-static const GLubyte ch89data[] = {
-0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80,
-0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,
-};
-
-static const BitmapCharRec ch89 = {12,14,-1,0,14,ch89data};
-
-/* char: 0x58 'X' */
-
-static const GLubyte ch88data[] = {
-0xc0,0x60,0xe0,0xe0,0x60,0xc0,0x71,0xc0,0x31,0x80,0x1b,0x0,0xe,0x0,0xe,0x0,
-0x1b,0x0,0x31,0x80,0x71,0xc0,0x60,0xc0,0xe0,0xe0,0xc0,0x60,
-};
-
-static const BitmapCharRec ch88 = {11,14,-1,0,13,ch88data};
-
-/* char: 0x57 'W' */
-
-static const GLubyte ch87data[] = {
-0x18,0x18,0x18,0x18,0x1c,0x38,0x34,0x2c,0x36,0x6c,0x36,0x6c,0x66,0x66,0x66,0x66,
-0x62,0x46,0x63,0xc6,0xc3,0xc3,0xc1,0x83,0xc1,0x83,0xc1,0x83,
-};
-
-static const BitmapCharRec ch87 = {16,14,-1,0,18,ch87data};
-
-/* char: 0x56 'V' */
-
-static const GLubyte ch86data[] = {
-0x6,0x0,0xf,0x0,0xf,0x0,0x19,0x80,0x19,0x80,0x19,0x80,0x30,0xc0,0x30,0xc0,
-0x30,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,
-};
-
-static const BitmapCharRec ch86 = {12,14,-1,0,14,ch86data};
-
-/* char: 0x55 'U' */
-
-static const GLubyte ch85data[] = {
-0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-};
-
-static const BitmapCharRec ch85 = {11,14,-1,0,13,ch85data};
-
-/* char: 0x54 'T' */
-
-static const GLubyte ch84data[] = {
-0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,
-0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xff,0xc0,0xff,0xc0,
-};
-
-static const BitmapCharRec ch84 = {10,14,-1,0,12,ch84data};
-
-/* char: 0x53 'S' */
-
-static const GLubyte ch83data[] = {
-0x3f,0x0,0x7f,0xc0,0xe0,0xe0,0xc0,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,0x1f,0x0,
-0x7c,0x0,0xe0,0x0,0xc0,0x60,0xe0,0xe0,0x7f,0xc0,0x1f,0x0,
-};
-
-static const BitmapCharRec ch83 = {11,14,-1,0,13,ch83data};
-
-/* char: 0x52 'R' */
-
-static const GLubyte ch82data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0x80,0xc1,0x80,0xff,0x0,0xff,0x80,
-0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0,
-};
-
-static const BitmapCharRec ch82 = {10,14,-1,0,12,ch82data};
-
-/* char: 0x51 'Q' */
-
-static const GLubyte ch81data[] = {
-0x0,0x30,0xf,0xb0,0x3f,0xe0,0x70,0xf0,0x61,0xb0,0xe1,0xb8,0xc0,0x18,0xc0,0x18,
-0xc0,0x18,0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,
-};
-
-static const BitmapCharRec ch81 = {13,15,-1,1,15,ch81data};
-
-/* char: 0x50 'P' */
-
-static const GLubyte ch80data[] = {
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,
-0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0,
-};
-
-static const BitmapCharRec ch80 = {10,14,-1,0,12,ch80data};
-
-/* char: 0x4f 'O' */
-
-static const GLubyte ch79data[] = {
-0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18,
-0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,
-};
-
-static const BitmapCharRec ch79 = {13,14,-1,0,15,ch79data};
-
-/* char: 0x4e 'N' */
-
-static const GLubyte ch78data[] = {
-0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60,
-0xcc,0x60,0xd8,0x60,0xf0,0x60,0xf0,0x60,0xe0,0x60,0xc0,0x60,
-};
-
-static const BitmapCharRec ch78 = {11,14,-1,0,13,ch78data};
-
-/* char: 0x4d 'M' */
-
-static const GLubyte ch77data[] = {
-0xc3,0xc,0xc3,0xc,0xc7,0x8c,0xc4,0x8c,0xcc,0xcc,0xcc,0xcc,0xd8,0x6c,0xd8,0x6c,
-0xf0,0x3c,0xf0,0x3c,0xe0,0x1c,0xe0,0x1c,0xc0,0xc,0xc0,0xc,
-};
-
-static const BitmapCharRec ch77 = {14,14,-1,0,16,ch77data};
-
-/* char: 0x4c 'L' */
-
-static const GLubyte ch76data[] = {
-0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch76 = {8,14,-1,0,10,ch76data};
-
-/* char: 0x4b 'K' */
-
-static const GLubyte ch75data[] = {
-0xc0,0x70,0xc0,0xe0,0xc1,0xc0,0xc3,0x80,0xc7,0x0,0xce,0x0,0xfc,0x0,0xf8,0x0,
-0xdc,0x0,0xce,0x0,0xc7,0x0,0xc3,0x80,0xc1,0xc0,0xc0,0xe0,
-};
-
-static const BitmapCharRec ch75 = {12,14,-1,0,13,ch75data};
-
-/* char: 0x4a 'J' */
-
-static const GLubyte ch74data[] = {
-0x3c,0x7e,0xe7,0xc3,0xc3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,
-};
-
-static const BitmapCharRec ch74 = {8,14,-1,0,10,ch74data};
-
-/* char: 0x49 'I' */
-
-static const GLubyte ch73data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch73 = {2,14,-2,0,6,ch73data};
-
-/* char: 0x48 'H' */
-
-static const GLubyte ch72data[] = {
-0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xff,0xe0,0xff,0xe0,
-0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-};
-
-static const BitmapCharRec ch72 = {11,14,-1,0,13,ch72data};
-
-/* char: 0x47 'G' */
-
-static const GLubyte ch71data[] = {
-0xf,0xb0,0x3f,0xf0,0x70,0x70,0x60,0x30,0xe0,0x30,0xc1,0xf0,0xc1,0xf0,0xc0,0x0,
-0xc0,0x0,0xe0,0x30,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,
-};
-
-static const BitmapCharRec ch71 = {12,14,-1,0,14,ch71data};
-
-/* char: 0x46 'F' */
-
-static const GLubyte ch70data[] = {
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,
-};
-
-static const BitmapCharRec ch70 = {9,14,-1,0,11,ch70data};
-
-/* char: 0x45 'E' */
-
-static const GLubyte ch69data[] = {
-0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,
-};
-
-static const BitmapCharRec ch69 = {9,14,-1,0,11,ch69data};
-
-/* char: 0x44 'D' */
-
-static const GLubyte ch68data[] = {
-0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,
-0xc0,0x60,0xc0,0x60,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0,
-};
-
-static const BitmapCharRec ch68 = {11,14,-1,0,13,ch68data};
-
-/* char: 0x43 'C' */
-
-static const GLubyte ch67data[] = {
-0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,
-0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,
-};
-
-static const BitmapCharRec ch67 = {12,14,-1,0,14,ch67data};
-
-/* char: 0x42 'B' */
-
-static const GLubyte ch66data[] = {
-0xff,0x80,0xff,0xc0,0xc0,0xe0,0xc0,0x60,0xc0,0x60,0xc0,0xe0,0xff,0xc0,0xff,0x80,
-0xc1,0x80,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0,
-};
-
-static const BitmapCharRec ch66 = {11,14,-1,0,13,ch66data};
-
-/* char: 0x41 'A' */
-
-static const GLubyte ch65data[] = {
-0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0,
-0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch65 = {12,14,0,0,12,ch65data};
-
-/* char: 0x40 '@' */
-
-static const GLubyte ch64data[] = {
-0x7,0xe0,0x1f,0xf0,0x38,0x0,0x70,0x0,0x67,0x70,0xcf,0xf8,0xcc,0xcc,0xcc,0x66,
-0xcc,0x66,0xcc,0x63,0xc6,0x33,0x67,0x73,0x63,0xb3,0x30,0x6,0x1c,0xe,0xf,0xfc,
-0x3,0xf0,
-};
-
-static const BitmapCharRec ch64 = {16,17,-1,3,18,ch64data};
-
-/* char: 0x3f '?' */
-
-static const GLubyte ch63data[] = {
-0x30,0x30,0x0,0x0,0x30,0x30,0x30,0x38,0x1c,0xe,0xc6,0xc6,0xfe,0x7c,
-};
-
-static const BitmapCharRec ch63 = {7,14,-1,0,10,ch63data};
-
-/* char: 0x3e '>' */
-
-static const GLubyte ch62data[] = {
-0xc0,0xf0,0x3c,0xe,0x3,0xe,0x3c,0xf0,0xc0,
-};
-
-static const BitmapCharRec ch62 = {8,9,-1,0,10,ch62data};
-
-/* char: 0x3d '=' */
-
-static const GLubyte ch61data[] = {
-0xfe,0xfe,0x0,0x0,0xfe,0xfe,
-};
-
-static const BitmapCharRec ch61 = {7,6,-2,-2,11,ch61data};
-
-/* char: 0x3c '<' */
-
-static const GLubyte ch60data[] = {
-0x3,0xf,0x3c,0x70,0xc0,0x70,0x3c,0xf,0x3,
-};
-
-static const BitmapCharRec ch60 = {8,9,-1,0,10,ch60data};
-
-/* char: 0x3b ';' */
-
-static const GLubyte ch59data[] = {
-0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch59 = {2,13,-1,3,5,ch59data};
-
-/* char: 0x3a ':' */
-
-static const GLubyte ch58data[] = {
-0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch58 = {2,10,-1,0,5,ch58data};
-
-/* char: 0x39 '9' */
-
-static const GLubyte ch57data[] = {
-0x7c,0xfe,0xc6,0x3,0x3,0x3b,0x7f,0xc3,0xc3,0xc3,0xc7,0x7e,0x3c,
-};
-
-static const BitmapCharRec ch57 = {8,13,-1,0,10,ch57data};
-
-/* char: 0x38 '8' */
-
-static const GLubyte ch56data[] = {
-0x3c,0x7e,0xe7,0xc3,0xc3,0x66,0x7e,0x66,0xc3,0xc3,0xe7,0x7e,0x3c,
-};
-
-static const BitmapCharRec ch56 = {8,13,-1,0,10,ch56data};
-
-/* char: 0x37 '7' */
-
-static const GLubyte ch55data[] = {
-0x60,0x60,0x30,0x30,0x30,0x18,0x18,0xc,0xc,0x6,0x3,0xff,0xff,
-};
-
-static const BitmapCharRec ch55 = {8,13,-1,0,10,ch55data};
-
-/* char: 0x36 '6' */
-
-static const GLubyte ch54data[] = {
-0x3c,0x7e,0xe3,0xc3,0xc3,0xc3,0xfe,0xdc,0xc0,0xc0,0x63,0x7f,0x3c,
-};
-
-static const BitmapCharRec ch54 = {8,13,-1,0,10,ch54data};
-
-/* char: 0x35 '5' */
-
-static const GLubyte ch53data[] = {
-0x7c,0xfe,0xc7,0xc3,0x3,0x3,0xc7,0xfe,0xfc,0xc0,0xc0,0xfe,0xfe,
-};
-
-static const BitmapCharRec ch53 = {8,13,-1,0,10,ch53data};
-
-/* char: 0x34 '4' */
-
-static const GLubyte ch52data[] = {
-0x3,0x0,0x3,0x0,0x3,0x0,0xff,0x80,0xff,0x80,0xc3,0x0,0x63,0x0,0x33,0x0,
-0x33,0x0,0x1b,0x0,0xf,0x0,0x7,0x0,0x3,0x0,
-};
-
-static const BitmapCharRec ch52 = {9,13,-1,0,10,ch52data};
-
-/* char: 0x33 '3' */
-
-static const GLubyte ch51data[] = {
-0x3c,0x7e,0xc7,0xc3,0x3,0x7,0x1e,0x1c,0x6,0xc3,0xc3,0x7e,0x3c,
-};
-
-static const BitmapCharRec ch51 = {8,13,-1,0,10,ch51data};
-
-/* char: 0x32 '2' */
-
-static const GLubyte ch50data[] = {
-0xff,0xff,0xc0,0xe0,0x70,0x38,0x1c,0xe,0x7,0x3,0xc3,0xfe,0x3c,
-};
-
-static const BitmapCharRec ch50 = {8,13,-1,0,10,ch50data};
-
-/* char: 0x31 '1' */
-
-static const GLubyte ch49data[] = {
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0xf8,0x18,
-};
-
-static const BitmapCharRec ch49 = {5,13,-2,0,10,ch49data};
-
-/* char: 0x30 '0' */
-
-static const GLubyte ch48data[] = {
-0x3c,0x7e,0x66,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x7e,0x3c,
-};
-
-static const BitmapCharRec ch48 = {8,13,-1,0,10,ch48data};
-
-/* char: 0x2f '/' */
-
-static const GLubyte ch47data[] = {
-0xc0,0xc0,0x40,0x40,0x60,0x60,0x20,0x20,0x30,0x30,0x10,0x10,0x18,0x18,
-};
-
-static const BitmapCharRec ch47 = {5,14,0,0,5,ch47data};
-
-/* char: 0x2e '.' */
-
-static const GLubyte ch46data[] = {
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch46 = {2,2,-1,0,5,ch46data};
-
-/* char: 0x2d '-' */
-
-static const GLubyte ch45data[] = {
-0xff,0xff,
-};
-
-static const BitmapCharRec ch45 = {8,2,-1,-4,11,ch45data};
-
-/* char: 0x2c ',' */
-
-static const GLubyte ch44data[] = {
-0x80,0x40,0x40,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch44 = {2,5,-1,3,5,ch44data};
-
-/* char: 0x2b '+' */
-
-static const GLubyte ch43data[] = {
-0x18,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,0x18,
-};
-
-static const BitmapCharRec ch43 = {8,10,-1,0,10,ch43data};
-
-/* char: 0x2a '*' */
-
-static const GLubyte ch42data[] = {
-0x88,0x70,0x70,0xf8,0x20,0x20,
-};
-
-static const BitmapCharRec ch42 = {5,6,-1,-8,7,ch42data};
-
-/* char: 0x29 ')' */
-
-static const GLubyte ch41data[] = {
-0x80,0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60,
-0xc0,0x80,
-};
-
-static const BitmapCharRec ch41 = {4,18,-1,4,6,ch41data};
-
-/* char: 0x28 '(' */
-
-static const GLubyte ch40data[] = {
-0x10,0x30,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60,
-0x30,0x10,
-};
-
-static const BitmapCharRec ch40 = {4,18,-1,4,6,ch40data};
-
-/* char: 0x27 ''' */
-
-static const GLubyte ch39data[] = {
-0x80,0x40,0x40,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch39 = {2,5,-1,-9,4,ch39data};
-
-/* char: 0x26 '&' */
-
-static const GLubyte ch38data[] = {
-0x3c,0x70,0x7e,0xe0,0xe7,0xc0,0xc3,0x80,0xc3,0xc0,0xc6,0xc0,0xee,0xc0,0x7c,0x0,
-0x3c,0x0,0x66,0x0,0x66,0x0,0x7e,0x0,0x3c,0x0,
-};
-
-static const BitmapCharRec ch38 = {12,13,-1,0,13,ch38data};
-
-/* char: 0x25 '%' */
-
-static const GLubyte ch37data[] = {
-0x18,0x78,0x18,0xfc,0xc,0xcc,0xc,0xcc,0x6,0xfc,0x6,0x78,0x3,0x0,0x7b,0x0,
-0xfd,0x80,0xcd,0x80,0xcc,0xc0,0xfc,0xc0,0x78,0x60,
-};
-
-static const BitmapCharRec ch37 = {14,13,-1,0,16,ch37data};
-
-/* char: 0x24 '$' */
-
-static const GLubyte ch36data[] = {
-0x8,0x0,0x8,0x0,0x3e,0x0,0x7f,0x0,0xeb,0x80,0xc9,0x80,0x9,0x80,0xf,0x0,
-0x3e,0x0,0x78,0x0,0xe8,0x0,0xc8,0x0,0xcb,0x0,0x7f,0x0,0x3e,0x0,0x8,0x0,
-};
-
-static const BitmapCharRec ch36 = {9,16,-1,2,10,ch36data};
-
-/* char: 0x23 '#' */
-
-static const GLubyte ch35data[] = {
-0x24,0x0,0x24,0x0,0x24,0x0,0xff,0x80,0xff,0x80,0x12,0x0,0x12,0x0,0x12,0x0,
-0x7f,0xc0,0x7f,0xc0,0x9,0x0,0x9,0x0,0x9,0x0,
-};
-
-static const BitmapCharRec ch35 = {10,13,0,0,10,ch35data};
-
-/* char: 0x22 '"' */
-
-static const GLubyte ch34data[] = {
-0x90,0x90,0xd8,0xd8,0xd8,
-};
-
-static const BitmapCharRec ch34 = {5,5,0,-9,5,ch34data};
-
-/* char: 0x21 '!' */
-
-static const GLubyte ch33data[] = {
-0xc0,0xc0,0x0,0x0,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch33 = {2,14,-2,0,6,ch33data};
-
-/* char: 0x20 ' ' */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch32data[] = { 0x0 };
-static const BitmapCharRec ch32 = {1,1,0,0,5,ch32data};
-#else
-static const BitmapCharRec ch32 = {0,0,0,0,5,0};
-#endif
-
-static const BitmapCharRec * const chars[] = {
-&ch32,
-&ch33,
-&ch34,
-&ch35,
-&ch36,
-&ch37,
-&ch38,
-&ch39,
-&ch40,
-&ch41,
-&ch42,
-&ch43,
-&ch44,
-&ch45,
-&ch46,
-&ch47,
-&ch48,
-&ch49,
-&ch50,
-&ch51,
-&ch52,
-&ch53,
-&ch54,
-&ch55,
-&ch56,
-&ch57,
-&ch58,
-&ch59,
-&ch60,
-&ch61,
-&ch62,
-&ch63,
-&ch64,
-&ch65,
-&ch66,
-&ch67,
-&ch68,
-&ch69,
-&ch70,
-&ch71,
-&ch72,
-&ch73,
-&ch74,
-&ch75,
-&ch76,
-&ch77,
-&ch78,
-&ch79,
-&ch80,
-&ch81,
-&ch82,
-&ch83,
-&ch84,
-&ch85,
-&ch86,
-&ch87,
-&ch88,
-&ch89,
-&ch90,
-&ch91,
-&ch92,
-&ch93,
-&ch94,
-&ch95,
-&ch96,
-&ch97,
-&ch98,
-&ch99,
-&ch100,
-&ch101,
-&ch102,
-&ch103,
-&ch104,
-&ch105,
-&ch106,
-&ch107,
-&ch108,
-&ch109,
-&ch110,
-&ch111,
-&ch112,
-&ch113,
-&ch114,
-&ch115,
-&ch116,
-&ch117,
-&ch118,
-&ch119,
-&ch120,
-&ch121,
-&ch122,
-&ch123,
-&ch124,
-&ch125,
-&ch126,
-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,
-&ch160,
-&ch161,
-&ch162,
-&ch163,
-&ch164,
-&ch165,
-&ch166,
-&ch167,
-&ch168,
-&ch169,
-&ch170,
-&ch171,
-&ch172,
-&ch173,
-&ch174,
-&ch175,
-&ch176,
-&ch177,
-&ch178,
-&ch179,
-&ch180,
-&ch181,
-&ch182,
-&ch183,
-&ch184,
-&ch185,
-&ch186,
-&ch187,
-&ch188,
-&ch189,
-&ch190,
-&ch191,
-&ch192,
-&ch193,
-&ch194,
-&ch195,
-&ch196,
-&ch197,
-&ch198,
-&ch199,
-&ch200,
-&ch201,
-&ch202,
-&ch203,
-&ch204,
-&ch205,
-&ch206,
-&ch207,
-&ch208,
-&ch209,
-&ch210,
-&ch211,
-&ch212,
-&ch213,
-&ch214,
-&ch215,
-&ch216,
-&ch217,
-&ch218,
-&ch219,
-&ch220,
-&ch221,
-&ch222,
-&ch223,
-&ch224,
-&ch225,
-&ch226,
-&ch227,
-&ch228,
-&ch229,
-&ch230,
-&ch231,
-&ch232,
-&ch233,
-&ch234,
-&ch235,
-&ch236,
-&ch237,
-&ch238,
-&ch239,
-&ch240,
-&ch241,
-&ch242,
-&ch243,
-&ch244,
-&ch245,
-&ch246,
-&ch247,
-&ch248,
-&ch249,
-&ch250,
-&ch251,
-&ch252,
-&ch253,
-&ch254,
-&ch255,
-};
-
-#if !defined(__IBMCPP__)
-const
-#endif
-BitmapFontRec glutBitmapHelvetica18 = {
-"-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1",
-224,
-32,
-chars
-};
-
diff --git a/src/glut/os2/glut_init.cpp b/src/glut/os2/glut_init.cpp
deleted file mode 100644
index da5d0735e29..00000000000
--- a/src/glut/os2/glut_init.cpp
+++ /dev/null
@@ -1,451 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
-
-/* 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. */
-
-#ifdef __VMS
-#include <GL/vms_x_fix.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#if !defined(_WIN32) && !defined(__OS2__)
- #include <X11/Xlib.h>
- #include <X11/Xatom.h>
-#endif
-
-/* SGI optimization introduced in IRIX 6.3 to avoid X server
- round trips for interning common X atoms. */
-#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS)
-#include <X11/SGIFastAtom.h>
-#else
-#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how)
-#endif
-
-#include "glutint.h"
-
-/* GLUT inter-file variables */
-/* *INDENT-OFF* */
-char *__glutProgramName = NULL;
-int __glutArgc = 0;
-char **__glutArgv = NULL;
-char *__glutGeometry = NULL;
-Display *__glutDisplay = NULL;
-int __glutScreen;
-Window __glutRoot;
-int __glutScreenHeight;
-int __glutScreenWidth;
-GLboolean __glutIconic = GL_FALSE;
-GLboolean __glutDebug = GL_FALSE;
-unsigned int __glutDisplayMode =
- GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH;
-char *__glutDisplayString = NULL;
-int __glutConnectionFD;
-XSizeHints __glutSizeHints = {0};
-int __glutInitWidth = 300, __glutInitHeight = 300;
-int __glutInitX = -1, __glutInitY = -1;
-GLboolean __glutForceDirect = GL_FALSE,
- __glutTryDirect = GL_TRUE;
-Atom __glutWMDeleteWindow;
-/* *INDENT-ON* */
-
-#ifdef _WIN32
-void (__cdecl *__glutExitFunc)(int retval) = NULL;
-#endif
-
-static Bool synchronize = False;
-
-#if defined(__OS2__)
-
-MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
-MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
-
-
-void __glutOpenOS2Connection(char* display)
-{
- static char *classname=NULL;
-extern HAB hab; /* PM anchor block handle */
-ERRORID erridErrorCode;/* last error id code */
-int ii;
-
- /* Make sure we register the window only once. */
- if(classname)
- return;
-
- classname = "GLUT";
-
- if ( !WinRegisterClass( hab, /* PM anchor block handle */
- classname,/* window class name */
- GlutWindowProc,/* address of window procedure*/
- CS_SIZEREDRAW, /* |CS_SYNCPAINT size changes cause redrawing */
- 0UL ) ) /* window data */
- { erridErrorCode = WinGetLastError(hab);
- ii = erridErrorCode;
- return;
- }
-
- classname = "GLUTCHILD";
-
- if ( !WinRegisterClass( hab, /* PM anchor block handle */
- classname,/* window class name */
- GlutWindowChildProc,/* address of window procedure*/
- CS_SIZEREDRAW, /* size changes cause redrawing */
- 0UL ) ) /* window data */
- { erridErrorCode = WinGetLastError(hab);
- ii = erridErrorCode;
- return;
- }
-
- __glutScreenWidth = GetSystemMetrics(SM_CXSCREEN);
- __glutScreenHeight = GetSystemMetrics(SM_CYSCREEN);
-
- /* Set the root window to NULL because windows creates a top-level
- window when the parent is NULL. X creates a top-level window
- when the parent is the root window. */
- __glutRoot = NULLHANDLE;
-
- /* Set the display to 1 -- we shouldn't be using this anywhere
- (except as an argument to X calls). */
- __glutDisplay = (Display*)1;
-
- /* There isn't any concept of multiple screens in Win32, therefore,
- we don't need to keep track of the screen we're on... it's always
- the same one. */
- __glutScreen = 0;
-}
-
-#elif defined(_WIN32)
-
-#ifdef __BORLANDC__
-#include <float.h> /* For masking floating point exceptions. */
-#endif
-
-void
-__glutOpenWin32Connection(char* display)
-{
- static char *classname;
- WNDCLASS wc;
- HINSTANCE hInstance = GetModuleHandle(NULL);
-
- /* Make sure we register the window only once. */
- if(classname)
- return;
-
-#ifdef __BORLANDC__
- /* Under certain conditions (e.g. while rendering solid surfaces with
- lighting enabled) Microsoft OpenGL libraries cause some illegal
- operations like floating point overflow or division by zero. The
- default behaviour of Microsoft compilers is to mask (ignore)
- floating point exceptions, while Borland compilers do not. The
- following function of Borland RTL allows to mask exceptions.
- Advice from Pier Giorgio Esposito (mc2172@mclink.it). */
- _control87(MCW_EM,MCW_EM);
-#endif
-
- classname = "GLUT";
-
- /* Clear (important!) and then fill in the window class structure. */
- memset(&wc, 0, sizeof(WNDCLASS));
- wc.style = CS_OWNDC;
- wc.lpfnWndProc = (WNDPROC)__glutWindowProc;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(hInstance, "GLUT_ICON");
- wc.hCursor = LoadCursor(hInstance, IDC_ARROW);
- wc.hbrBackground = NULL;
- wc.lpszMenuName = NULL;
- wc.lpszClassName = classname;
-
- /* Fill in a default icon if one isn't specified as a resource. */
- if(!wc.hIcon)
- wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
-
- if(!RegisterClass(&wc)) {
- __glutFatalError("RegisterClass() failed:"
- "Cannot register GLUT window class.");
- }
-
- __glutScreenWidth = GetSystemMetrics(SM_CXSCREEN);
- __glutScreenHeight = GetSystemMetrics(SM_CYSCREEN);
-
- /* Set the root window to NULL because windows creates a top-level
- window when the parent is NULL. X creates a top-level window
- when the parent is the root window. */
- __glutRoot = NULL;
-
- /* Set the display to 1 -- we shouldn't be using this anywhere
- (except as an argument to X calls). */
- __glutDisplay = (Display*)1;
-
- /* There isn't any concept of multiple screens in Win32, therefore,
- we don't need to keep track of the screen we're on... it's always
- the same one. */
- __glutScreen = 0;
-}
-#else /* !_WIN32 */
-void
-__glutOpenXConnection(char *display)
-{
- int errorBase, eventBase;
-
- __glutDisplay = XOpenDisplay(display);
- if (!__glutDisplay)
- __glutFatalError("could not open display: %s",
- XDisplayName(display));
- if (synchronize)
- XSynchronize(__glutDisplay, True);
- if (!glXQueryExtension(__glutDisplay, &errorBase, &eventBase))
- __glutFatalError(
- "OpenGL GLX extension not supported by display: %s",
- XDisplayName(display));
- __glutScreen = DefaultScreen(__glutDisplay);
- __glutRoot = RootWindow(__glutDisplay, __glutScreen);
- __glutScreenWidth = DisplayWidth(__glutDisplay, __glutScreen);
- __glutScreenHeight = DisplayHeight(__glutDisplay,
- __glutScreen);
- __glutConnectionFD = ConnectionNumber(__glutDisplay);
- __glutWMDeleteWindow = XSGIFastInternAtom(__glutDisplay,
- "WM_DELETE_WINDOW", SGI_XA_WM_DELETE_WINDOW, False);
-}
-#endif /* _WIN32 */
-
-void
-#ifdef OLD_VMS
- __glutInitTime(struct timeval6 *beginning)
-#else
- __glutInitTime(struct timeval *beginning)
-#endif
-{
- static int beenhere = 0;
-#ifdef OLD_VMS
- static struct timeval6 genesis;
-#else
- static struct timeval genesis;
-#endif
-
- if (!beenhere) {
- GETTIMEOFDAY(&genesis);
- beenhere = 1;
- }
- *beginning = genesis;
-}
-
-static void
-removeArgs(int *argcp, char **argv, int numToRemove)
-{
- int i, j;
-
- for (i = 0, j = numToRemove; argv[j]; i++, j++) {
- argv[i] = argv[j];
- }
- argv[i] = NULL;
- *argcp -= numToRemove;
-}
-
-void GLUTAPIENTRY
-glutInit(int *argcp, char **argv)
-{
- char *display = NULL;
- char *str, *geometry = NULL;
-#ifdef OLD_VMS
- struct timeval6 unused;
-#else
- struct timeval unused;
-#endif
- int i;
-
- if (__glutDisplay) {
- __glutWarning("glutInit being called a second time.");
- return;
- }
- /* Determine temporary program name. */
- str = strrchr(argv[0], '/');
- if (str == NULL) {
- __glutProgramName = argv[0];
- } else {
- __glutProgramName = str + 1;
- }
-
- /* Make private copy of command line arguments. */
- __glutArgc = *argcp;
- __glutArgv = (char **) malloc(__glutArgc * sizeof(char *));
- if (!__glutArgv)
- __glutFatalError("out of memory.");
- for (i = 0; i < __glutArgc; i++) {
- __glutArgv[i] = __glutStrdup(argv[i]);
- if (!__glutArgv[i])
- __glutFatalError("out of memory.");
- }
-
- /* determine permanent program name */
- str = strrchr(__glutArgv[0], '/');
- if (str == NULL) {
- __glutProgramName = __glutArgv[0];
- } else {
- __glutProgramName = str + 1;
- }
-
- /* parse arguments for standard options */
- for (i = 1; i < __glutArgc; i++) {
- if (!strcmp(__glutArgv[i], "-display")) {
-#if defined(_WIN32)
- __glutWarning("-display option not supported by Win32 GLUT.");
-#endif
- if (++i >= __glutArgc) {
- __glutFatalError(
- "follow -display option with X display name.");
- }
- display = __glutArgv[i];
- removeArgs(argcp, &argv[1], 2);
- } else if (!strcmp(__glutArgv[i], "-geometry")) {
- if (++i >= __glutArgc) {
- __glutFatalError(
- "follow -geometry option with geometry parameter.");
- }
- geometry = __glutArgv[i];
- removeArgs(argcp, &argv[1], 2);
- } else if (!strcmp(__glutArgv[i], "-direct")) {
-#if defined(_WIN32)
- __glutWarning("-direct option not supported by Win32 GLUT.");
-#endif
- if (!__glutTryDirect)
- __glutFatalError(
- "cannot force both direct and indirect rendering.");
- __glutForceDirect = GL_TRUE;
- removeArgs(argcp, &argv[1], 1);
- } else if (!strcmp(__glutArgv[i], "-indirect")) {
-#if defined(_WIN32)
- __glutWarning("-indirect option not supported by Win32 GLUT.");
-#endif
- if (__glutForceDirect)
- __glutFatalError(
- "cannot force both direct and indirect rendering.");
- __glutTryDirect = GL_FALSE;
- removeArgs(argcp, &argv[1], 1);
- } else if (!strcmp(__glutArgv[i], "-iconic")) {
- __glutIconic = GL_TRUE;
- removeArgs(argcp, &argv[1], 1);
- } else if (!strcmp(__glutArgv[i], "-gldebug")) {
- __glutDebug = GL_TRUE;
- removeArgs(argcp, &argv[1], 1);
- } else if (!strcmp(__glutArgv[i], "-sync")) {
-#if defined(_WIN32)
- __glutWarning("-sync option not supported by Win32 GLUT.");
-#endif
- synchronize = GL_TRUE;
- removeArgs(argcp, &argv[1], 1);
- } else {
- /* Once unknown option encountered, stop command line
- processing. */
- break;
- }
- }
-#if defined(__OS2__)
- __glutOpenOS2Connection(display);
-#elif defined(_WIN32)
- __glutOpenWin32Connection(display);
-#else
- __glutOpenXConnection(display);
-#endif
- if (geometry) {
- int flags, x, y, width, height;
-
- /* Fix bogus "{width|height} may be used before set"
- warning */
- width = 0;
- height = 0;
-
- flags = XParseGeometry(geometry, &x, &y,
- (unsigned int *) &width, (unsigned int *) &height);
- if (WidthValue & flags) {
- /* Careful because X does not allow zero or negative
- width windows */
- if (width > 0)
- __glutInitWidth = width;
- }
- if (HeightValue & flags) {
- /* Careful because X does not allow zero or negative
- height windows */
- if (height > 0)
- __glutInitHeight = height;
- }
- glutInitWindowSize(__glutInitWidth, __glutInitHeight);
- if (XValue & flags) {
- if (XNegative & flags)
- x = DisplayWidth(__glutDisplay, __glutScreen) +
- x - __glutSizeHints.width;
- /* Play safe: reject negative X locations */
- if (x >= 0)
- __glutInitX = x;
- }
- if (YValue & flags) {
- if (YNegative & flags)
- y = DisplayHeight(__glutDisplay, __glutScreen) +
- y - __glutSizeHints.height;
- /* Play safe: reject negative Y locations */
- if (y >= 0)
- __glutInitY = y;
- }
- glutInitWindowPosition(__glutInitX, __glutInitY);
- }
- __glutInitTime(&unused);
-
- /* check if GLUT_FPS env var is set */
- {
- const char *fps = getenv("GLUT_FPS");
- if (fps) {
- sscanf(fps, "%d", &__glutFPS);
- if (__glutFPS <= 0)
- __glutFPS = 5000; /* 5000 milliseconds */
- }
- }
-}
-
-#ifdef _WIN32
-void APIENTRY
-__glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int))
-{
- __glutExitFunc = exitfunc;
- glutInit(argcp, argv);
-}
-#endif
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutInitWindowPosition(int x, int y)
-{
- __glutInitX = x;
- __glutInitY = y;
- if (x >= 0 && y >= 0) {
- __glutSizeHints.x = x;
- __glutSizeHints.y = y;
- __glutSizeHints.flags |= USPosition;
- } else {
- __glutSizeHints.flags &= ~USPosition;
- }
-}
-
-void GLUTAPIENTRY
-glutInitWindowSize(int width, int height)
-{
- __glutInitWidth = width;
- __glutInitHeight = height;
- if (width > 0 && height > 0) {
- __glutSizeHints.width = width;
- __glutSizeHints.height = height;
- __glutSizeHints.flags |= USSize;
- } else {
- __glutSizeHints.flags &= ~USSize;
- }
-}
-
-void GLUTAPIENTRY
-glutInitDisplayMode(unsigned int mask)
-{
- __glutDisplayMode = mask;
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_input.cpp b/src/glut/os2/glut_input.cpp
deleted file mode 100644
index c517fe12490..00000000000
--- a/src/glut/os2/glut_input.cpp
+++ /dev/null
@@ -1,628 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997, 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 <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "glutint.h"
-#define POFIG 0
-#if POFIG
-
-int __glutNumDials = 0;
-int __glutNumSpaceballButtons = 0;
-int __glutNumButtonBoxButtons = 0;
-int __glutNumTabletButtons = 0;
-int __glutNumMouseButtons = 3; /* Good guess. */
-XDevice *__glutTablet = NULL;
-XDevice *__glutDials = NULL;
-XDevice *__glutSpaceball = NULL;
-
-int __glutHasJoystick = 0;
-int __glutNumJoystickButtons = 0;
-int __glutNumJoystickAxes = 0;
-
-#if !defined(_WIN32)
-typedef struct _Range {
- int min;
- int range;
-} Range;
-
-#define NUM_SPACEBALL_AXIS 6
-#define NUM_TABLET_AXIS 2
-#define NUM_DIALS_AXIS 8
-
-Range __glutSpaceballRange[NUM_SPACEBALL_AXIS];
-Range __glutTabletRange[NUM_TABLET_AXIS];
-int *__glutDialsResolution;
-
-/* Safely assumes 0 is an illegal event type for X Input
- extension events. */
-int __glutDeviceMotionNotify = 0;
-int __glutDeviceButtonPress = 0;
-int __glutDeviceButtonPressGrab = 0;
-int __glutDeviceButtonRelease = 0;
-int __glutDeviceStateNotify = 0;
-
-static int
-normalizeTabletPos(int axis, int rawValue)
-{
- assert(rawValue >= __glutTabletRange[axis].min);
- assert(rawValue <= __glutTabletRange[axis].min
- + __glutTabletRange[axis].range);
- /* Normalize rawValue to between 0 and 4000. */
- return ((rawValue - __glutTabletRange[axis].min) * 4000) /
- __glutTabletRange[axis].range;
-}
-
-static int
-normalizeDialAngle(int axis, int rawValue)
-{
- /* XXX Assumption made that the resolution of the device is
- number of clicks for one complete dial revolution. This
- is true for SGI's dial & button box. */
- return (rawValue * 360.0) / __glutDialsResolution[axis];
-}
-
-static int
-normalizeSpaceballAngle(int axis, int rawValue)
-{
- assert(rawValue >= __glutSpaceballRange[axis].min);
- assert(rawValue <= __glutSpaceballRange[axis].min +
- __glutSpaceballRange[axis].range);
- /* Normalize rawValue to between -1800 and 1800. */
- return ((rawValue - __glutSpaceballRange[axis].min) * 3600) /
- __glutSpaceballRange[axis].range - 1800;
-}
-
-static int
-normalizeSpaceballDelta(int axis, int rawValue)
-{
- assert(rawValue >= __glutSpaceballRange[axis].min);
- assert(rawValue <= __glutSpaceballRange[axis].min +
- __glutSpaceballRange[axis].range);
- /* Normalize rawValue to between -1000 and 1000. */
- return ((rawValue - __glutSpaceballRange[axis].min) * 2000) /
- __glutSpaceballRange[axis].range - 1000;
-}
-
-static void
-queryTabletPos(GLUTwindow * window)
-{
- XDeviceState *state;
- XInputClass *any;
- XValuatorState *v;
- int i;
-
- state = XQueryDeviceState(__glutDisplay, __glutTablet);
- any = state->data;
- for (i = 0; i < state->num_classes; i++) {
-#if defined(__cplusplus) || defined(c_plusplus)
- switch (any->c_class) {
-#else
- switch (any->class) {
-#endif
- case ValuatorClass:
- v = (XValuatorState *) any;
- if (v->num_valuators < 2)
- goto end;
- if (window->tabletPos[0] == -1)
- window->tabletPos[0] = normalizeTabletPos(0, v->valuators[0]);
- if (window->tabletPos[1] == -1)
- window->tabletPos[1] = normalizeTabletPos(1, v->valuators[1]);
- }
- any = (XInputClass *) ((char *) any + any->length);
- }
-end:
- XFreeDeviceState(state);
-}
-
-static void
-tabletPosChange(GLUTwindow * window, int first, int count, int *data)
-{
- int i, value, genEvent = 0;
-
- for (i = first; i < first + count; i++) {
- switch (i) {
- case 0: /* X axis */
- case 1: /* Y axis */
- value = normalizeTabletPos(i, data[i - first]);
- if (value != window->tabletPos[i]) {
- window->tabletPos[i] = value;
- genEvent = 1;
- }
- break;
- }
- }
- if (window->tabletPos[0] == -1 || window->tabletPos[1] == -1)
- queryTabletPos(window);
- if (genEvent)
- window->tabletMotion(window->tabletPos[0], window->tabletPos[1]);
-}
-#endif /* !_WIN32 */
-
-static int
-__glutProcessDeviceEvents(XEvent * event)
-{
-#if !defined(_WIN32)
- GLUTwindow *window;
-
- /* XXX Ugly code fan out. */
-
- /* Can't use switch/case since X Input event types are
- dynamic. */
-
- if (__glutDeviceMotionNotify && event->type == __glutDeviceMotionNotify) {
- XDeviceMotionEvent *devmot = (XDeviceMotionEvent *) event;
-
- window = __glutGetWindow(devmot->window);
- if (window) {
- if (__glutTablet
- && devmot->deviceid == __glutTablet->device_id
- && window->tabletMotion) {
- tabletPosChange(window, devmot->first_axis, devmot->axes_count,
- devmot->axis_data);
- } else if (__glutDials
- && devmot->deviceid == __glutDials->device_id
- && window->dials) {
- int i, first = devmot->first_axis, count = devmot->axes_count;
-
- for (i = first; i < first + count; i++)
- window->dials(i + 1,
- normalizeDialAngle(i, devmot->axis_data[i - first]));
- } else if (__glutSpaceball
- && devmot->deviceid == __glutSpaceball->device_id) {
- /* XXX Assume that space ball motion events come in as
- all the first 6 axes. Assume first 3 axes are XYZ
- translations; second 3 axes are XYZ rotations. */
- if (devmot->first_axis == 0 && devmot->axes_count == 6) {
- if (window->spaceMotion)
- window->spaceMotion(
- normalizeSpaceballDelta(0, devmot->axis_data[0]),
- normalizeSpaceballDelta(1, devmot->axis_data[1]),
- normalizeSpaceballDelta(2, devmot->axis_data[2]));
- if (window->spaceRotate)
- window->spaceRotate(
- normalizeSpaceballAngle(3, devmot->axis_data[3]),
- normalizeSpaceballAngle(4, devmot->axis_data[4]),
- normalizeSpaceballAngle(5, devmot->axis_data[5]));
- }
- }
- return 1;
- }
- } else if (__glutDeviceButtonPress
- && event->type == __glutDeviceButtonPress) {
- XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event;
-
- window = __glutGetWindow(devbtn->window);
- if (window) {
- if (__glutTablet
- && devbtn->deviceid == __glutTablet->device_id
- && window->tabletButton
- && devbtn->first_axis == 0
- && devbtn->axes_count == 2) {
- tabletPosChange(window, devbtn->first_axis, devbtn->axes_count,
- devbtn->axis_data);
- window->tabletButton(devbtn->button, GLUT_DOWN,
- window->tabletPos[0], window->tabletPos[1]);
- } else if (__glutDials
- && devbtn->deviceid == __glutDials->device_id
- && window->buttonBox) {
- window->buttonBox(devbtn->button, GLUT_DOWN);
- } else if (__glutSpaceball
- && devbtn->deviceid == __glutSpaceball->device_id
- && window->spaceButton) {
- window->spaceButton(devbtn->button, GLUT_DOWN);
- }
- return 1;
- }
- } else if (__glutDeviceButtonRelease
- && event->type == __glutDeviceButtonRelease) {
- XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event;
-
- window = __glutGetWindow(devbtn->window);
- if (window) {
- if (__glutTablet
- && devbtn->deviceid == __glutTablet->device_id
- && window->tabletButton
- && devbtn->first_axis == 0
- && devbtn->axes_count == 2) {
- tabletPosChange(window, devbtn->first_axis, devbtn->axes_count,
- devbtn->axis_data);
- window->tabletButton(devbtn->button, GLUT_UP,
- window->tabletPos[0], window->tabletPos[1]);
- } else if (__glutDials
- && devbtn->deviceid == __glutDials->device_id
- && window->buttonBox) {
- window->buttonBox(devbtn->button, GLUT_UP);
- } else if (__glutSpaceball
- && devbtn->deviceid == __glutSpaceball->device_id
- && window->spaceButton) {
- window->spaceButton(devbtn->button, GLUT_UP);
- }
- return 1;
- }
- }
-#else
- {
- JOYINFOEX info;
- JOYCAPS joyCaps;
-
- memset(&info, 0, sizeof(JOYINFOEX));
- info.dwSize = sizeof(JOYINFOEX);
- info.dwFlags = JOY_RETURNALL;
-
- if (joyGetPosEx(JOYSTICKID1,&info) != JOYERR_NOERROR) {
- __glutHasJoystick = 1;
- joyGetDevCaps(JOYSTICKID1, &joyCaps, sizeof(joyCaps));
- __glutNumJoystickButtons = joyCaps.wNumButtons;
- __glutNumJoystickAxes = joyCaps.wNumAxes;
- } else {
- __glutHasJoystick = 0;
- __glutNumJoystickButtons = 0;
- __glutNumJoystickAxes = 0;
- }
- }
-#endif /* !_WIN32 */
- return 0;
-}
-
-static GLUTeventParser eventParser =
-{__glutProcessDeviceEvents, NULL};
-
-static void
-addDeviceEventParser(void)
-{
- static Bool been_here = False;
-
- if (been_here)
- return;
- been_here = True;
- __glutRegisterEventParser(&eventParser);
-}
-
-static int
-probeDevices(void)
-{
- static Bool been_here = False;
- static int support;
-#if !defined(_WIN32)
- XExtensionVersion *version;
- XDeviceInfoPtr device_info, device;
- XAnyClassPtr any;
- XButtonInfoPtr b;
- XValuatorInfoPtr v;
- XAxisInfoPtr a;
- int num_dev = 0, btns = 0, dials = 0;
- int i, j, k;
-#endif /* !_WIN32 */
-
- if (been_here) {
- return support;
- }
- been_here = True;
-
-#if !defined(_WIN32)
- version = XGetExtensionVersion(__glutDisplay, "XInputExtension");
- /* Ugh. XInput extension API forces annoying cast of a pointer
- to a long so it can be compared with the NoSuchExtension
- value (#defined to 1). */
- if (version == NULL || ((long) version) == NoSuchExtension) {
- support = 0;
- return support;
- }
- XFree(version);
- device_info = XListInputDevices(__glutDisplay, &num_dev);
- if (device_info) {
- for (i = 0; i < num_dev; i++) {
- /* XXX These are SGI names for these devices;
- unfortunately, no good standard exists for standard
- types of X input extension devices. */
-
- device = &device_info[i];
- any = (XAnyClassPtr) device->inputclassinfo;
-
- if (!__glutSpaceball && !strcmp(device->name, "spaceball")) {
- v = NULL;
- b = NULL;
- for (j = 0; j < device->num_classes; j++) {
-#if defined(__cplusplus) || defined(c_plusplus)
- switch (any->c_class) {
-#else
- switch (any->class) {
-#endif
- case ButtonClass:
- b = (XButtonInfoPtr) any;
- btns = b->num_buttons;
- break;
- case ValuatorClass:
- v = (XValuatorInfoPtr) any;
- /* Sanity check: at least 6 valuators? */
- if (v->num_axes < NUM_SPACEBALL_AXIS)
- goto skip_device;
- a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo));
- for (k = 0; k < NUM_SPACEBALL_AXIS; k++, a++) {
- __glutSpaceballRange[k].min = a->min_value;
- __glutSpaceballRange[k].range = a->max_value - a->min_value;
- }
- break;
- }
- any = (XAnyClassPtr) ((char *) any + any->length);
- }
- if (v) {
- __glutSpaceball = XOpenDevice(__glutDisplay, device->id);
- if (__glutSpaceball) {
- __glutNumSpaceballButtons = btns;
- addDeviceEventParser();
- }
- }
- } else if (!__glutDials && !strcmp(device->name, "dial+buttons")) {
- v = NULL;
- b = NULL;
- for (j = 0; j < device->num_classes; j++) {
-#if defined(__cplusplus) || defined(c_plusplus)
- switch (any->c_class) {
-#else
- switch (any->class) {
-#endif
- case ButtonClass:
- b = (XButtonInfoPtr) any;
- btns = b->num_buttons;
- break;
- case ValuatorClass:
- v = (XValuatorInfoPtr) any;
- /* Sanity check: at least 8 valuators? */
- if (v->num_axes < NUM_DIALS_AXIS)
- goto skip_device;
- dials = v->num_axes;
- __glutDialsResolution = (int *) malloc(sizeof(int) * dials);
- a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo));
- for (k = 0; k < dials; k++, a++) {
- __glutDialsResolution[k] = a->resolution;
- }
- break;
- }
- any = (XAnyClassPtr) ((char *) any + any->length);
- }
- if (v) {
- __glutDials = XOpenDevice(__glutDisplay, device->id);
- if (__glutDials) {
- __glutNumButtonBoxButtons = btns;
- __glutNumDials = dials;
- addDeviceEventParser();
- }
- }
- } else if (!__glutTablet && !strcmp(device->name, "tablet")) {
- v = NULL;
- b = NULL;
- for (j = 0; j < device->num_classes; j++) {
-#if defined(__cplusplus) || defined(c_plusplus)
- switch (any->c_class) {
-#else
- switch (any->class) {
-#endif
- case ButtonClass:
- b = (XButtonInfoPtr) any;
- btns = b->num_buttons;
- break;
- case ValuatorClass:
- v = (XValuatorInfoPtr) any;
- /* Sanity check: exactly 2 valuators? */
- if (v->num_axes != NUM_TABLET_AXIS)
- goto skip_device;
- a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo));
- for (k = 0; k < NUM_TABLET_AXIS; k++, a++) {
- __glutTabletRange[k].min = a->min_value;
- __glutTabletRange[k].range = a->max_value - a->min_value;
- }
- break;
- }
- any = (XAnyClassPtr) ((char *) any + any->length);
- }
- if (v) {
- __glutTablet = XOpenDevice(__glutDisplay, device->id);
- if (__glutTablet) {
- __glutNumTabletButtons = btns;
- addDeviceEventParser();
- }
- }
- } else if (!strcmp(device->name, "mouse")) {
- for (j = 0; j < device->num_classes; j++) {
-#if defined(__cplusplus) || defined(c_plusplus)
- if (any->c_class == ButtonClass) {
-#else
- if (any->class == ButtonClass) {
-#endif
- b = (XButtonInfoPtr) any;
- __glutNumMouseButtons = b->num_buttons;
- }
- any = (XAnyClassPtr) ((char *) any + any->length);
- }
- }
- skip_device:;
- }
- XFreeDeviceList(device_info);
- }
-#else /* _WIN32 */
- __glutNumMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS);
-#endif /* !_WIN32 */
- /* X Input extension might be supported, but only if there is
- a tablet, dials, or spaceball do we claim devices are
- supported. */
- support = __glutTablet || __glutDials || __glutSpaceball;
- return support;
-}
-
-void
-__glutUpdateInputDeviceMask(GLUTwindow * window)
-{
-#if !defined(_WIN32)
- /* 5 (dial and buttons) + 5 (tablet locator and buttons) + 5
- (Spaceball buttons and axis) = 15 */
- XEventClass eventList[15];
- int rc, numEvents;
-
- rc = probeDevices();
- if (rc) {
- numEvents = 0;
- if (__glutTablet) {
- if (window->tabletMotion) {
- DeviceMotionNotify(__glutTablet, __glutDeviceMotionNotify,
- eventList[numEvents]);
- numEvents++;
- }
- if (window->tabletButton) {
- DeviceButtonPress(__glutTablet, __glutDeviceButtonPress,
- eventList[numEvents]);
- numEvents++;
- DeviceButtonPressGrab(__glutTablet, __glutDeviceButtonPressGrab,
- eventList[numEvents]);
- numEvents++;
- DeviceButtonRelease(__glutTablet, __glutDeviceButtonRelease,
- eventList[numEvents]);
- numEvents++;
- }
- if (window->tabletMotion || window->tabletButton) {
- DeviceStateNotify(__glutTablet, __glutDeviceStateNotify,
- eventList[numEvents]);
- numEvents++;
- }
- }
- if (__glutDials) {
- if (window->dials) {
- DeviceMotionNotify(__glutDials, __glutDeviceMotionNotify,
- eventList[numEvents]);
- numEvents++;
- }
- if (window->buttonBox) {
- DeviceButtonPress(__glutDials, __glutDeviceButtonPress,
- eventList[numEvents]);
- numEvents++;
- DeviceButtonPressGrab(__glutDials, __glutDeviceButtonPressGrab,
- eventList[numEvents]);
- numEvents++;
- DeviceButtonRelease(__glutDials, __glutDeviceButtonRelease,
- eventList[numEvents]);
- numEvents++;
- }
- if (window->dials || window->buttonBox) {
- DeviceStateNotify(__glutDials, __glutDeviceStateNotify,
- eventList[numEvents]);
- numEvents++;
- }
- }
- if (__glutSpaceball) {
- if (window->spaceMotion || window->spaceRotate) {
- DeviceMotionNotify(__glutSpaceball, __glutDeviceMotionNotify,
- eventList[numEvents]);
- numEvents++;
- }
- if (window->spaceButton) {
- DeviceButtonPress(__glutSpaceball, __glutDeviceButtonPress,
- eventList[numEvents]);
- numEvents++;
- DeviceButtonPressGrab(__glutSpaceball, __glutDeviceButtonPressGrab,
- eventList[numEvents]);
- numEvents++;
- DeviceButtonRelease(__glutSpaceball, __glutDeviceButtonRelease,
- eventList[numEvents]);
- numEvents++;
- }
- if (window->spaceMotion || window->spaceRotate || window->spaceButton) {
- DeviceStateNotify(__glutSpaceball, __glutDeviceStateNotify,
- eventList[numEvents]);
- numEvents++;
- }
- }
-#if 0
- if (window->children) {
- GLUTwindow *child = window->children;
-
- do {
- XChangeDeviceDontPropagateList(__glutDisplay, child->win,
- numEvents, eventList, AddToList);
- child = child->siblings;
- } while (child);
- }
-#endif
- XSelectExtensionEvent(__glutDisplay, window->win,
- eventList, numEvents);
- if (window->overlay) {
- XSelectExtensionEvent(__glutDisplay, window->overlay->win,
- eventList, numEvents);
- }
- } else {
- /* X Input extension not supported; no chance for exotic
- input devices. */
- }
-#endif /* !_WIN32 */
-}
-
-#endif //POFIG
-
-/* CENTRY */
-int GLUTAPIENTRY
-glutDeviceGet(GLenum param)
-{
-#if POFIG
- probeDevices();
-#endif
- switch (param) {
- case GLUT_HAS_KEYBOARD:
- case GLUT_HAS_MOUSE:
- /* Assume window system always has mouse and keyboard. */
- return 1;
-#if POFIG
- case GLUT_HAS_SPACEBALL:
- return __glutSpaceball != NULL;
- case GLUT_HAS_DIAL_AND_BUTTON_BOX:
- return __glutDials != NULL;
- case GLUT_HAS_TABLET:
- return __glutTablet != NULL;
- case GLUT_NUM_MOUSE_BUTTONS:
- return __glutNumMouseButtons;
- case GLUT_NUM_SPACEBALL_BUTTONS:
- return __glutNumSpaceballButtons;
- case GLUT_NUM_BUTTON_BOX_BUTTONS:
- return __glutNumButtonBoxButtons;
- case GLUT_NUM_DIALS:
- return __glutNumDials;
- case GLUT_NUM_TABLET_BUTTONS:
- return __glutNumTabletButtons;
- case GLUT_DEVICE_IGNORE_KEY_REPEAT:
- return __glutCurrentWindow->ignoreKeyRepeat;
-#ifndef _WIN32
- case GLUT_DEVICE_KEY_REPEAT:
- {
- XKeyboardState state;
-
- XGetKeyboardControl(__glutDisplay, &state);
- return state.global_auto_repeat;
- }
- case GLUT_JOYSTICK_POLL_RATE:
- return 0;
-#else
- case GLUT_DEVICE_KEY_REPEAT:
- /* Win32 cannot globally disable key repeat. */
- return GLUT_KEY_REPEAT_ON;
- case GLUT_JOYSTICK_POLL_RATE:
- return __glutCurrentWindow->joyPollInterval;
-#endif
- case GLUT_HAS_JOYSTICK:
- return __glutHasJoystick;
- case GLUT_JOYSTICK_BUTTONS:
- return __glutNumJoystickButtons;
- case GLUT_JOYSTICK_AXES:
- return __glutNumJoystickAxes;
-#endif //POFIG
- default:
- __glutWarning("invalid glutDeviceGet parameter: %d", param);
- return -1;
- }
-}
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_key.cpp b/src/glut/os2/glut_key.cpp
deleted file mode 100644
index a1b9919abc4..00000000000
--- a/src/glut/os2/glut_key.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1997. */
-
-/* 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 <stdlib.h>
-
-#include "glutint.h"
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutKeyboardFunc(GLUTkeyboardCB keyboardFunc)
-{
- __glutChangeWindowEventMask(KeyPressMask,
- keyboardFunc != NULL || __glutCurrentWindow->special != NULL);
- __glutCurrentWindow->keyboard = keyboardFunc;
-}
-
-void GLUTAPIENTRY
-glutSpecialFunc(GLUTspecialCB specialFunc)
-{
- __glutChangeWindowEventMask(KeyPressMask,
- specialFunc != NULL || __glutCurrentWindow->keyboard != NULL);
- __glutCurrentWindow->special = specialFunc;
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_keyctrl.cpp b/src/glut/os2/glut_keyctrl.cpp
deleted file mode 100644
index b0f3a28f7d8..00000000000
--- a/src/glut/os2/glut_keyctrl.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1996, 1997. */
-
-/* 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 "glutint.h"
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutIgnoreKeyRepeat(int ignore)
-{
- __glutCurrentWindow->ignoreKeyRepeat = ignore;
-}
-
-void GLUTAPIENTRY
-glutSetKeyRepeat(int repeatMode)
-{
-#if !defined(_WIN32) && !defined(__OS2PM__)
- XKeyboardControl values;
-
- /* GLUT's repeatMode #define's match the Xlib API values. */
- values.auto_repeat_mode = repeatMode;
- XChangeKeyboardControl(__glutDisplay, KBAutoRepeatMode, &values);
-#endif
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_keyup.cpp b/src/glut/os2/glut_keyup.cpp
deleted file mode 100644
index ada758e2774..00000000000
--- a/src/glut/os2/glut_keyup.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1997. */
-
-/* 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 <stdlib.h>
-
-#include "glutint.h"
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutKeyboardUpFunc(GLUTkeyboardCB keyboardUpFunc)
-{
- __glutChangeWindowEventMask(KeyReleaseMask,
- keyboardUpFunc != NULL || __glutCurrentWindow->specialUp != NULL);
- __glutCurrentWindow->keyboardUp = keyboardUpFunc;
-}
-
-void GLUTAPIENTRY
-glutSpecialUpFunc(GLUTspecialCB specialUpFunc)
-{
- __glutChangeWindowEventMask(KeyReleaseMask,
- specialUpFunc != NULL || __glutCurrentWindow->keyboardUp != NULL);
- __glutCurrentWindow->specialUp = specialUpFunc;
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_mesa.cpp b/src/glut/os2/glut_mesa.cpp
deleted file mode 100644
index 73682a50672..00000000000
--- a/src/glut/os2/glut_mesa.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1996. */
-
-/* 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 <stdlib.h>
-#include <string.h>
-#include "glutint.h"
-
-int __glutMesaSwapHackSupport = 0; /* Not supported until
- proven otherwise. */
-
-/* Use the "Mesa swap hack" if reasonable if and only if
- MESA_SWAP_HACK is set to something whose first character is
- not "N" or "n" AND "Brian Paul" is the vendor string AND
- "Mesa X11"* (or "Mesa" for backward compatibility) is the
- renderer string.
-
- Anyone who modifies Mesa so that glXSwapBuffers does not
- simply blit the previously rendered back buffer should
- change either their vendor or renderer string to avoid
- confusing GLUT. */
-
-void
-__glutDetermineMesaSwapHackSupport(void)
-{
- static int doneAlready = 0;
- char *env, *vendor, *renderer;
-
- if (doneAlready)
- return;
- env = getenv("MESA_SWAP_HACK");
- if (env) {
- if ((env[0] != 'n') && (env[0] != 'N')) {
- vendor = (char *) glGetString(GL_VENDOR);
- renderer = (char *) glGetString(GL_RENDERER);
-
- /* Old versions of X11 Mesa uses the renderer string
- "Mesa"; Brian plans to start using "Mesa X11" to
- distinguish the X version of Mesa from other flavor
- such as Windows or 3Dfx. */
-
-#define MESA_X11 "Mesa X11"
-
- /* XXX At some point in the future, eliminate the
- backward compatibility for the old "Mesa" renderer
- string. */
-
- if (!strcmp(vendor, "Brian Paul") && (!strcmp(renderer, "Mesa") ||
- !strncmp(renderer, MESA_X11, sizeof(MESA_X11) - 1)))
- __glutMesaSwapHackSupport = 1;
- }
- }
- doneAlready = 1;
-}
diff --git a/src/glut/os2/glut_modifier.cpp b/src/glut/os2/glut_modifier.cpp
deleted file mode 100644
index 0ffa5a68010..00000000000
--- a/src/glut/os2/glut_modifier.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/* 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 "glutint.h"
-
-/* CENTRY */
-int GLUTAPIENTRY
-glutGetModifiers(void)
-{
- int modifiers;
-
- if(__glutModifierMask == (unsigned int) ~0) {
- __glutWarning(
- "glutCurrentModifiers: do not call outside core input callback.");
- return 0;
- }
- modifiers = 0;
- if(__glutModifierMask & (ShiftMask|LockMask))
- modifiers |= GLUT_ACTIVE_SHIFT;
- if(__glutModifierMask & ControlMask)
- modifiers |= GLUT_ACTIVE_CTRL;
- if(__glutModifierMask & Mod1Mask)
- modifiers |= GLUT_ACTIVE_ALT;
- return modifiers;
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_roman.cpp b/src/glut/os2/glut_roman.cpp
deleted file mode 100644
index 8e25de8ac1a..00000000000
--- a/src/glut/os2/glut_roman.cpp
+++ /dev/null
@@ -1,2451 +0,0 @@
-
-/* GENERATED FILE -- DO NOT MODIFY */
-
-#include "glutstroke.h"
-
-/* char: 33 '!' */
-
-static const CoordRec char33_stroke0[] = {
- { 13.3819, 100 },
- { 13.3819, 33.3333 },
-};
-
-static const CoordRec char33_stroke1[] = {
- { 13.3819, 9.5238 },
- { 8.62, 4.7619 },
- { 13.3819, 0 },
- { 18.1438, 4.7619 },
- { 13.3819, 9.5238 },
-};
-
-static const StrokeRec char33[] = {
- { 2, char33_stroke0 },
- { 5, char33_stroke1 },
-};
-
-/* char: 34 '"' */
-
-static const CoordRec char34_stroke0[] = {
- { 4.02, 100 },
- { 4.02, 66.6667 },
-};
-
-static const CoordRec char34_stroke1[] = {
- { 42.1152, 100 },
- { 42.1152, 66.6667 },
-};
-
-static const StrokeRec char34[] = {
- { 2, char34_stroke0 },
- { 2, char34_stroke1 },
-};
-
-/* char: 35 '#' */
-
-static const CoordRec char35_stroke0[] = {
- { 41.2952, 119.048 },
- { 7.9619, -33.3333 },
-};
-
-static const CoordRec char35_stroke1[] = {
- { 69.8667, 119.048 },
- { 36.5333, -33.3333 },
-};
-
-static const CoordRec char35_stroke2[] = {
- { 7.9619, 57.1429 },
- { 74.6286, 57.1429 },
-};
-
-static const CoordRec char35_stroke3[] = {
- { 3.2, 28.5714 },
- { 69.8667, 28.5714 },
-};
-
-static const StrokeRec char35[] = {
- { 2, char35_stroke0 },
- { 2, char35_stroke1 },
- { 2, char35_stroke2 },
- { 2, char35_stroke3 },
-};
-
-/* char: 36 '$' */
-
-static const CoordRec char36_stroke0[] = {
- { 28.6295, 119.048 },
- { 28.6295, -19.0476 },
-};
-
-static const CoordRec char36_stroke1[] = {
- { 47.6771, 119.048 },
- { 47.6771, -19.0476 },
-};
-
-static const CoordRec char36_stroke2[] = {
- { 71.4867, 85.7143 },
- { 61.9629, 95.2381 },
- { 47.6771, 100 },
- { 28.6295, 100 },
- { 14.3438, 95.2381 },
- { 4.82, 85.7143 },
- { 4.82, 76.1905 },
- { 9.5819, 66.6667 },
- { 14.3438, 61.9048 },
- { 23.8676, 57.1429 },
- { 52.439, 47.619 },
- { 61.9629, 42.8571 },
- { 66.7248, 38.0952 },
- { 71.4867, 28.5714 },
- { 71.4867, 14.2857 },
- { 61.9629, 4.7619 },
- { 47.6771, 0 },
- { 28.6295, 0 },
- { 14.3438, 4.7619 },
- { 4.82, 14.2857 },
-};
-
-static const StrokeRec char36[] = {
- { 2, char36_stroke0 },
- { 2, char36_stroke1 },
- { 20, char36_stroke2 },
-};
-
-/* char: 37 '%' */
-
-static const CoordRec char37_stroke0[] = {
- { 92.0743, 100 },
- { 6.36, 0 },
-};
-
-static const CoordRec char37_stroke1[] = {
- { 30.1695, 100 },
- { 39.6933, 90.4762 },
- { 39.6933, 80.9524 },
- { 34.9314, 71.4286 },
- { 25.4076, 66.6667 },
- { 15.8838, 66.6667 },
- { 6.36, 76.1905 },
- { 6.36, 85.7143 },
- { 11.1219, 95.2381 },
- { 20.6457, 100 },
- { 30.1695, 100 },
- { 39.6933, 95.2381 },
- { 53.979, 90.4762 },
- { 68.2648, 90.4762 },
- { 82.5505, 95.2381 },
- { 92.0743, 100 },
-};
-
-static const CoordRec char37_stroke2[] = {
- { 73.0267, 33.3333 },
- { 63.5029, 28.5714 },
- { 58.741, 19.0476 },
- { 58.741, 9.5238 },
- { 68.2648, 0 },
- { 77.7886, 0 },
- { 87.3124, 4.7619 },
- { 92.0743, 14.2857 },
- { 92.0743, 23.8095 },
- { 82.5505, 33.3333 },
- { 73.0267, 33.3333 },
-};
-
-static const StrokeRec char37[] = {
- { 2, char37_stroke0 },
- { 16, char37_stroke1 },
- { 11, char37_stroke2 },
-};
-
-/* char: 38 '&' */
-
-static const CoordRec char38_stroke0[] = {
- { 101.218, 57.1429 },
- { 101.218, 61.9048 },
- { 96.4562, 66.6667 },
- { 91.6943, 66.6667 },
- { 86.9324, 61.9048 },
- { 82.1705, 52.381 },
- { 72.6467, 28.5714 },
- { 63.1229, 14.2857 },
- { 53.599, 4.7619 },
- { 44.0752, 0 },
- { 25.0276, 0 },
- { 15.5038, 4.7619 },
- { 10.7419, 9.5238 },
- { 5.98, 19.0476 },
- { 5.98, 28.5714 },
- { 10.7419, 38.0952 },
- { 15.5038, 42.8571 },
- { 48.8371, 61.9048 },
- { 53.599, 66.6667 },
- { 58.361, 76.1905 },
- { 58.361, 85.7143 },
- { 53.599, 95.2381 },
- { 44.0752, 100 },
- { 34.5514, 95.2381 },
- { 29.7895, 85.7143 },
- { 29.7895, 76.1905 },
- { 34.5514, 61.9048 },
- { 44.0752, 47.619 },
- { 67.8848, 14.2857 },
- { 77.4086, 4.7619 },
- { 86.9324, 0 },
- { 96.4562, 0 },
- { 101.218, 4.7619 },
- { 101.218, 9.5238 },
-};
-
-static const StrokeRec char38[] = {
- { 34, char38_stroke0 },
-};
-
-/* char: 39 ''' */
-
-static const CoordRec char39_stroke0[] = {
- { 4.44, 100 },
- { 4.44, 66.6667 },
-};
-
-static const StrokeRec char39[] = {
- { 2, char39_stroke0 },
-};
-
-/* char: 40 '(' */
-
-static const CoordRec char40_stroke0[] = {
- { 40.9133, 119.048 },
- { 31.3895, 109.524 },
- { 21.8657, 95.2381 },
- { 12.3419, 76.1905 },
- { 7.58, 52.381 },
- { 7.58, 33.3333 },
- { 12.3419, 9.5238 },
- { 21.8657, -9.5238 },
- { 31.3895, -23.8095 },
- { 40.9133, -33.3333 },
-};
-
-static const StrokeRec char40[] = {
- { 10, char40_stroke0 },
-};
-
-/* char: 41 ')' */
-
-static const CoordRec char41_stroke0[] = {
- { 5.28, 119.048 },
- { 14.8038, 109.524 },
- { 24.3276, 95.2381 },
- { 33.8514, 76.1905 },
- { 38.6133, 52.381 },
- { 38.6133, 33.3333 },
- { 33.8514, 9.5238 },
- { 24.3276, -9.5238 },
- { 14.8038, -23.8095 },
- { 5.28, -33.3333 },
-};
-
-static const StrokeRec char41[] = {
- { 10, char41_stroke0 },
-};
-
-/* char: 42 '*' */
-
-static const CoordRec char42_stroke0[] = {
- { 30.7695, 71.4286 },
- { 30.7695, 14.2857 },
-};
-
-static const CoordRec char42_stroke1[] = {
- { 6.96, 57.1429 },
- { 54.579, 28.5714 },
-};
-
-static const CoordRec char42_stroke2[] = {
- { 54.579, 57.1429 },
- { 6.96, 28.5714 },
-};
-
-static const StrokeRec char42[] = {
- { 2, char42_stroke0 },
- { 2, char42_stroke1 },
- { 2, char42_stroke2 },
-};
-
-/* char: 43 '+' */
-
-static const CoordRec char43_stroke0[] = {
- { 48.8371, 85.7143 },
- { 48.8371, 0 },
-};
-
-static const CoordRec char43_stroke1[] = {
- { 5.98, 42.8571 },
- { 91.6943, 42.8571 },
-};
-
-static const StrokeRec char43[] = {
- { 2, char43_stroke0 },
- { 2, char43_stroke1 },
-};
-
-/* char: 44 ',' */
-
-static const CoordRec char44_stroke0[] = {
- { 18.2838, 4.7619 },
- { 13.5219, 0 },
- { 8.76, 4.7619 },
- { 13.5219, 9.5238 },
- { 18.2838, 4.7619 },
- { 18.2838, -4.7619 },
- { 13.5219, -14.2857 },
- { 8.76, -19.0476 },
-};
-
-static const StrokeRec char44[] = {
- { 8, char44_stroke0 },
-};
-
-/* char: 45 '-' */
-
-static const CoordRec char45_stroke0[] = {
- { 7.38, 42.8571 },
- { 93.0943, 42.8571 },
-};
-
-static const StrokeRec char45[] = {
- { 2, char45_stroke0 },
-};
-
-/* char: 46 '.' */
-
-static const CoordRec char46_stroke0[] = {
- { 13.1019, 9.5238 },
- { 8.34, 4.7619 },
- { 13.1019, 0 },
- { 17.8638, 4.7619 },
- { 13.1019, 9.5238 },
-};
-
-static const StrokeRec char46[] = {
- { 5, char46_stroke0 },
-};
-
-/* char: 47 '/' */
-
-static const CoordRec char47_stroke0[] = {
- { 7.24, -14.2857 },
- { 73.9067, 100 },
-};
-
-static const StrokeRec char47[] = {
- { 2, char47_stroke0 },
-};
-
-/* char: 48 '0' */
-
-static const CoordRec char48_stroke0[] = {
- { 33.5514, 100 },
- { 19.2657, 95.2381 },
- { 9.7419, 80.9524 },
- { 4.98, 57.1429 },
- { 4.98, 42.8571 },
- { 9.7419, 19.0476 },
- { 19.2657, 4.7619 },
- { 33.5514, 0 },
- { 43.0752, 0 },
- { 57.361, 4.7619 },
- { 66.8848, 19.0476 },
- { 71.6467, 42.8571 },
- { 71.6467, 57.1429 },
- { 66.8848, 80.9524 },
- { 57.361, 95.2381 },
- { 43.0752, 100 },
- { 33.5514, 100 },
-};
-
-static const StrokeRec char48[] = {
- { 17, char48_stroke0 },
-};
-
-/* char: 49 '1' */
-
-static const CoordRec char49_stroke0[] = {
- { 11.82, 80.9524 },
- { 21.3438, 85.7143 },
- { 35.6295, 100 },
- { 35.6295, 0 },
-};
-
-static const StrokeRec char49[] = {
- { 4, char49_stroke0 },
-};
-
-/* char: 50 '2' */
-
-static const CoordRec char50_stroke0[] = {
- { 10.1819, 76.1905 },
- { 10.1819, 80.9524 },
- { 14.9438, 90.4762 },
- { 19.7057, 95.2381 },
- { 29.2295, 100 },
- { 48.2771, 100 },
- { 57.801, 95.2381 },
- { 62.5629, 90.4762 },
- { 67.3248, 80.9524 },
- { 67.3248, 71.4286 },
- { 62.5629, 61.9048 },
- { 53.039, 47.619 },
- { 5.42, 0 },
- { 72.0867, 0 },
-};
-
-static const StrokeRec char50[] = {
- { 14, char50_stroke0 },
-};
-
-/* char: 51 '3' */
-
-static const CoordRec char51_stroke0[] = {
- { 14.5238, 100 },
- { 66.9048, 100 },
- { 38.3333, 61.9048 },
- { 52.619, 61.9048 },
- { 62.1429, 57.1429 },
- { 66.9048, 52.381 },
- { 71.6667, 38.0952 },
- { 71.6667, 28.5714 },
- { 66.9048, 14.2857 },
- { 57.381, 4.7619 },
- { 43.0952, 0 },
- { 28.8095, 0 },
- { 14.5238, 4.7619 },
- { 9.7619, 9.5238 },
- { 5, 19.0476 },
-};
-
-static const StrokeRec char51[] = {
- { 15, char51_stroke0 },
-};
-
-/* char: 52 '4' */
-
-static const CoordRec char52_stroke0[] = {
- { 51.499, 100 },
- { 3.88, 33.3333 },
- { 75.3086, 33.3333 },
-};
-
-static const CoordRec char52_stroke1[] = {
- { 51.499, 100 },
- { 51.499, 0 },
-};
-
-static const StrokeRec char52[] = {
- { 3, char52_stroke0 },
- { 2, char52_stroke1 },
-};
-
-/* char: 53 '5' */
-
-static const CoordRec char53_stroke0[] = {
- { 62.0029, 100 },
- { 14.3838, 100 },
- { 9.6219, 57.1429 },
- { 14.3838, 61.9048 },
- { 28.6695, 66.6667 },
- { 42.9552, 66.6667 },
- { 57.241, 61.9048 },
- { 66.7648, 52.381 },
- { 71.5267, 38.0952 },
- { 71.5267, 28.5714 },
- { 66.7648, 14.2857 },
- { 57.241, 4.7619 },
- { 42.9552, 0 },
- { 28.6695, 0 },
- { 14.3838, 4.7619 },
- { 9.6219, 9.5238 },
- { 4.86, 19.0476 },
-};
-
-static const StrokeRec char53[] = {
- { 17, char53_stroke0 },
-};
-
-/* char: 54 '6' */
-
-static const CoordRec char54_stroke0[] = {
- { 62.7229, 85.7143 },
- { 57.961, 95.2381 },
- { 43.6752, 100 },
- { 34.1514, 100 },
- { 19.8657, 95.2381 },
- { 10.3419, 80.9524 },
- { 5.58, 57.1429 },
- { 5.58, 33.3333 },
- { 10.3419, 14.2857 },
- { 19.8657, 4.7619 },
- { 34.1514, 0 },
- { 38.9133, 0 },
- { 53.199, 4.7619 },
- { 62.7229, 14.2857 },
- { 67.4848, 28.5714 },
- { 67.4848, 33.3333 },
- { 62.7229, 47.619 },
- { 53.199, 57.1429 },
- { 38.9133, 61.9048 },
- { 34.1514, 61.9048 },
- { 19.8657, 57.1429 },
- { 10.3419, 47.619 },
- { 5.58, 33.3333 },
-};
-
-static const StrokeRec char54[] = {
- { 23, char54_stroke0 },
-};
-
-/* char: 55 '7' */
-
-static const CoordRec char55_stroke0[] = {
- { 72.2267, 100 },
- { 24.6076, 0 },
-};
-
-static const CoordRec char55_stroke1[] = {
- { 5.56, 100 },
- { 72.2267, 100 },
-};
-
-static const StrokeRec char55[] = {
- { 2, char55_stroke0 },
- { 2, char55_stroke1 },
-};
-
-/* char: 56 '8' */
-
-static const CoordRec char56_stroke0[] = {
- { 29.4095, 100 },
- { 15.1238, 95.2381 },
- { 10.3619, 85.7143 },
- { 10.3619, 76.1905 },
- { 15.1238, 66.6667 },
- { 24.6476, 61.9048 },
- { 43.6952, 57.1429 },
- { 57.981, 52.381 },
- { 67.5048, 42.8571 },
- { 72.2667, 33.3333 },
- { 72.2667, 19.0476 },
- { 67.5048, 9.5238 },
- { 62.7429, 4.7619 },
- { 48.4571, 0 },
- { 29.4095, 0 },
- { 15.1238, 4.7619 },
- { 10.3619, 9.5238 },
- { 5.6, 19.0476 },
- { 5.6, 33.3333 },
- { 10.3619, 42.8571 },
- { 19.8857, 52.381 },
- { 34.1714, 57.1429 },
- { 53.219, 61.9048 },
- { 62.7429, 66.6667 },
- { 67.5048, 76.1905 },
- { 67.5048, 85.7143 },
- { 62.7429, 95.2381 },
- { 48.4571, 100 },
- { 29.4095, 100 },
-};
-
-static const StrokeRec char56[] = {
- { 29, char56_stroke0 },
-};
-
-/* char: 57 '9' */
-
-static const CoordRec char57_stroke0[] = {
- { 68.5048, 66.6667 },
- { 63.7429, 52.381 },
- { 54.219, 42.8571 },
- { 39.9333, 38.0952 },
- { 35.1714, 38.0952 },
- { 20.8857, 42.8571 },
- { 11.3619, 52.381 },
- { 6.6, 66.6667 },
- { 6.6, 71.4286 },
- { 11.3619, 85.7143 },
- { 20.8857, 95.2381 },
- { 35.1714, 100 },
- { 39.9333, 100 },
- { 54.219, 95.2381 },
- { 63.7429, 85.7143 },
- { 68.5048, 66.6667 },
- { 68.5048, 42.8571 },
- { 63.7429, 19.0476 },
- { 54.219, 4.7619 },
- { 39.9333, 0 },
- { 30.4095, 0 },
- { 16.1238, 4.7619 },
- { 11.3619, 14.2857 },
-};
-
-static const StrokeRec char57[] = {
- { 23, char57_stroke0 },
-};
-
-/* char: 58 ':' */
-
-static const CoordRec char58_stroke0[] = {
- { 14.0819, 66.6667 },
- { 9.32, 61.9048 },
- { 14.0819, 57.1429 },
- { 18.8438, 61.9048 },
- { 14.0819, 66.6667 },
-};
-
-static const CoordRec char58_stroke1[] = {
- { 14.0819, 9.5238 },
- { 9.32, 4.7619 },
- { 14.0819, 0 },
- { 18.8438, 4.7619 },
- { 14.0819, 9.5238 },
-};
-
-static const StrokeRec char58[] = {
- { 5, char58_stroke0 },
- { 5, char58_stroke1 },
-};
-
-/* char: 59 ';' */
-
-static const CoordRec char59_stroke0[] = {
- { 12.9619, 66.6667 },
- { 8.2, 61.9048 },
- { 12.9619, 57.1429 },
- { 17.7238, 61.9048 },
- { 12.9619, 66.6667 },
-};
-
-static const CoordRec char59_stroke1[] = {
- { 17.7238, 4.7619 },
- { 12.9619, 0 },
- { 8.2, 4.7619 },
- { 12.9619, 9.5238 },
- { 17.7238, 4.7619 },
- { 17.7238, -4.7619 },
- { 12.9619, -14.2857 },
- { 8.2, -19.0476 },
-};
-
-static const StrokeRec char59[] = {
- { 5, char59_stroke0 },
- { 8, char59_stroke1 },
-};
-
-/* char: 60 '<' */
-
-static const CoordRec char60_stroke0[] = {
- { 79.2505, 85.7143 },
- { 3.06, 42.8571 },
- { 79.2505, 0 },
-};
-
-static const StrokeRec char60[] = {
- { 3, char60_stroke0 },
-};
-
-/* char: 61 '=' */
-
-static const CoordRec char61_stroke0[] = {
- { 5.7, 57.1429 },
- { 91.4143, 57.1429 },
-};
-
-static const CoordRec char61_stroke1[] = {
- { 5.7, 28.5714 },
- { 91.4143, 28.5714 },
-};
-
-static const StrokeRec char61[] = {
- { 2, char61_stroke0 },
- { 2, char61_stroke1 },
-};
-
-/* char: 62 '>' */
-
-static const CoordRec char62_stroke0[] = {
- { 2.78, 85.7143 },
- { 78.9705, 42.8571 },
- { 2.78, 0 },
-};
-
-static const StrokeRec char62[] = {
- { 3, char62_stroke0 },
-};
-
-/* char: 63 '?' */
-
-static const CoordRec char63_stroke0[] = {
- { 8.42, 76.1905 },
- { 8.42, 80.9524 },
- { 13.1819, 90.4762 },
- { 17.9438, 95.2381 },
- { 27.4676, 100 },
- { 46.5152, 100 },
- { 56.039, 95.2381 },
- { 60.801, 90.4762 },
- { 65.5629, 80.9524 },
- { 65.5629, 71.4286 },
- { 60.801, 61.9048 },
- { 56.039, 57.1429 },
- { 36.9914, 47.619 },
- { 36.9914, 33.3333 },
-};
-
-static const CoordRec char63_stroke1[] = {
- { 36.9914, 9.5238 },
- { 32.2295, 4.7619 },
- { 36.9914, 0 },
- { 41.7533, 4.7619 },
- { 36.9914, 9.5238 },
-};
-
-static const StrokeRec char63[] = {
- { 14, char63_stroke0 },
- { 5, char63_stroke1 },
-};
-
-/* char: 64 '@' */
-
-static const CoordRec char64_stroke0[] = {
- { 49.2171, 52.381 },
- { 39.6933, 57.1429 },
- { 30.1695, 57.1429 },
- { 25.4076, 47.619 },
- { 25.4076, 42.8571 },
- { 30.1695, 33.3333 },
- { 39.6933, 33.3333 },
- { 49.2171, 38.0952 },
-};
-
-static const CoordRec char64_stroke1[] = {
- { 49.2171, 57.1429 },
- { 49.2171, 38.0952 },
- { 53.979, 33.3333 },
- { 63.5029, 33.3333 },
- { 68.2648, 42.8571 },
- { 68.2648, 47.619 },
- { 63.5029, 61.9048 },
- { 53.979, 71.4286 },
- { 39.6933, 76.1905 },
- { 34.9314, 76.1905 },
- { 20.6457, 71.4286 },
- { 11.1219, 61.9048 },
- { 6.36, 47.619 },
- { 6.36, 42.8571 },
- { 11.1219, 28.5714 },
- { 20.6457, 19.0476 },
- { 34.9314, 14.2857 },
- { 39.6933, 14.2857 },
- { 53.979, 19.0476 },
-};
-
-static const StrokeRec char64[] = {
- { 8, char64_stroke0 },
- { 19, char64_stroke1 },
-};
-
-/* char: 65 'A' */
-
-static const CoordRec char65_stroke0[] = {
- { 40.5952, 100 },
- { 2.5, 0 },
-};
-
-static const CoordRec char65_stroke1[] = {
- { 40.5952, 100 },
- { 78.6905, 0 },
-};
-
-static const CoordRec char65_stroke2[] = {
- { 16.7857, 33.3333 },
- { 64.4048, 33.3333 },
-};
-
-static const StrokeRec char65[] = {
- { 2, char65_stroke0 },
- { 2, char65_stroke1 },
- { 2, char65_stroke2 },
-};
-
-/* char: 66 'B' */
-
-static const CoordRec char66_stroke0[] = {
- { 11.42, 100 },
- { 11.42, 0 },
-};
-
-static const CoordRec char66_stroke1[] = {
- { 11.42, 100 },
- { 54.2771, 100 },
- { 68.5629, 95.2381 },
- { 73.3248, 90.4762 },
- { 78.0867, 80.9524 },
- { 78.0867, 71.4286 },
- { 73.3248, 61.9048 },
- { 68.5629, 57.1429 },
- { 54.2771, 52.381 },
-};
-
-static const CoordRec char66_stroke2[] = {
- { 11.42, 52.381 },
- { 54.2771, 52.381 },
- { 68.5629, 47.619 },
- { 73.3248, 42.8571 },
- { 78.0867, 33.3333 },
- { 78.0867, 19.0476 },
- { 73.3248, 9.5238 },
- { 68.5629, 4.7619 },
- { 54.2771, 0 },
- { 11.42, 0 },
-};
-
-static const StrokeRec char66[] = {
- { 2, char66_stroke0 },
- { 9, char66_stroke1 },
- { 10, char66_stroke2 },
-};
-
-/* char: 67 'C' */
-
-static const CoordRec char67_stroke0[] = {
- { 78.0886, 76.1905 },
- { 73.3267, 85.7143 },
- { 63.8029, 95.2381 },
- { 54.279, 100 },
- { 35.2314, 100 },
- { 25.7076, 95.2381 },
- { 16.1838, 85.7143 },
- { 11.4219, 76.1905 },
- { 6.66, 61.9048 },
- { 6.66, 38.0952 },
- { 11.4219, 23.8095 },
- { 16.1838, 14.2857 },
- { 25.7076, 4.7619 },
- { 35.2314, 0 },
- { 54.279, 0 },
- { 63.8029, 4.7619 },
- { 73.3267, 14.2857 },
- { 78.0886, 23.8095 },
-};
-
-static const StrokeRec char67[] = {
- { 18, char67_stroke0 },
-};
-
-/* char: 68 'D' */
-
-static const CoordRec char68_stroke0[] = {
- { 11.96, 100 },
- { 11.96, 0 },
-};
-
-static const CoordRec char68_stroke1[] = {
- { 11.96, 100 },
- { 45.2933, 100 },
- { 59.579, 95.2381 },
- { 69.1029, 85.7143 },
- { 73.8648, 76.1905 },
- { 78.6267, 61.9048 },
- { 78.6267, 38.0952 },
- { 73.8648, 23.8095 },
- { 69.1029, 14.2857 },
- { 59.579, 4.7619 },
- { 45.2933, 0 },
- { 11.96, 0 },
-};
-
-static const StrokeRec char68[] = {
- { 2, char68_stroke0 },
- { 12, char68_stroke1 },
-};
-
-/* char: 69 'E' */
-
-static const CoordRec char69_stroke0[] = {
- { 11.42, 100 },
- { 11.42, 0 },
-};
-
-static const CoordRec char69_stroke1[] = {
- { 11.42, 100 },
- { 73.3248, 100 },
-};
-
-static const CoordRec char69_stroke2[] = {
- { 11.42, 52.381 },
- { 49.5152, 52.381 },
-};
-
-static const CoordRec char69_stroke3[] = {
- { 11.42, 0 },
- { 73.3248, 0 },
-};
-
-static const StrokeRec char69[] = {
- { 2, char69_stroke0 },
- { 2, char69_stroke1 },
- { 2, char69_stroke2 },
- { 2, char69_stroke3 },
-};
-
-/* char: 70 'F' */
-
-static const CoordRec char70_stroke0[] = {
- { 11.42, 100 },
- { 11.42, 0 },
-};
-
-static const CoordRec char70_stroke1[] = {
- { 11.42, 100 },
- { 73.3248, 100 },
-};
-
-static const CoordRec char70_stroke2[] = {
- { 11.42, 52.381 },
- { 49.5152, 52.381 },
-};
-
-static const StrokeRec char70[] = {
- { 2, char70_stroke0 },
- { 2, char70_stroke1 },
- { 2, char70_stroke2 },
-};
-
-/* char: 71 'G' */
-
-static const CoordRec char71_stroke0[] = {
- { 78.4886, 76.1905 },
- { 73.7267, 85.7143 },
- { 64.2029, 95.2381 },
- { 54.679, 100 },
- { 35.6314, 100 },
- { 26.1076, 95.2381 },
- { 16.5838, 85.7143 },
- { 11.8219, 76.1905 },
- { 7.06, 61.9048 },
- { 7.06, 38.0952 },
- { 11.8219, 23.8095 },
- { 16.5838, 14.2857 },
- { 26.1076, 4.7619 },
- { 35.6314, 0 },
- { 54.679, 0 },
- { 64.2029, 4.7619 },
- { 73.7267, 14.2857 },
- { 78.4886, 23.8095 },
- { 78.4886, 38.0952 },
-};
-
-static const CoordRec char71_stroke1[] = {
- { 54.679, 38.0952 },
- { 78.4886, 38.0952 },
-};
-
-static const StrokeRec char71[] = {
- { 19, char71_stroke0 },
- { 2, char71_stroke1 },
-};
-
-/* char: 72 'H' */
-
-static const CoordRec char72_stroke0[] = {
- { 11.42, 100 },
- { 11.42, 0 },
-};
-
-static const CoordRec char72_stroke1[] = {
- { 78.0867, 100 },
- { 78.0867, 0 },
-};
-
-static const CoordRec char72_stroke2[] = {
- { 11.42, 52.381 },
- { 78.0867, 52.381 },
-};
-
-static const StrokeRec char72[] = {
- { 2, char72_stroke0 },
- { 2, char72_stroke1 },
- { 2, char72_stroke2 },
-};
-
-/* char: 73 'I' */
-
-static const CoordRec char73_stroke0[] = {
- { 10.86, 100 },
- { 10.86, 0 },
-};
-
-static const StrokeRec char73[] = {
- { 2, char73_stroke0 },
-};
-
-/* char: 74 'J' */
-
-static const CoordRec char74_stroke0[] = {
- { 50.119, 100 },
- { 50.119, 23.8095 },
- { 45.3571, 9.5238 },
- { 40.5952, 4.7619 },
- { 31.0714, 0 },
- { 21.5476, 0 },
- { 12.0238, 4.7619 },
- { 7.2619, 9.5238 },
- { 2.5, 23.8095 },
- { 2.5, 33.3333 },
-};
-
-static const StrokeRec char74[] = {
- { 10, char74_stroke0 },
-};
-
-/* char: 75 'K' */
-
-static const CoordRec char75_stroke0[] = {
- { 11.28, 100 },
- { 11.28, 0 },
-};
-
-static const CoordRec char75_stroke1[] = {
- { 77.9467, 100 },
- { 11.28, 33.3333 },
-};
-
-static const CoordRec char75_stroke2[] = {
- { 35.0895, 57.1429 },
- { 77.9467, 0 },
-};
-
-static const StrokeRec char75[] = {
- { 2, char75_stroke0 },
- { 2, char75_stroke1 },
- { 2, char75_stroke2 },
-};
-
-/* char: 76 'L' */
-
-static const CoordRec char76_stroke0[] = {
- { 11.68, 100 },
- { 11.68, 0 },
-};
-
-static const CoordRec char76_stroke1[] = {
- { 11.68, 0 },
- { 68.8229, 0 },
-};
-
-static const StrokeRec char76[] = {
- { 2, char76_stroke0 },
- { 2, char76_stroke1 },
-};
-
-/* char: 77 'M' */
-
-static const CoordRec char77_stroke0[] = {
- { 10.86, 100 },
- { 10.86, 0 },
-};
-
-static const CoordRec char77_stroke1[] = {
- { 10.86, 100 },
- { 48.9552, 0 },
-};
-
-static const CoordRec char77_stroke2[] = {
- { 87.0505, 100 },
- { 48.9552, 0 },
-};
-
-static const CoordRec char77_stroke3[] = {
- { 87.0505, 100 },
- { 87.0505, 0 },
-};
-
-static const StrokeRec char77[] = {
- { 2, char77_stroke0 },
- { 2, char77_stroke1 },
- { 2, char77_stroke2 },
- { 2, char77_stroke3 },
-};
-
-/* char: 78 'N' */
-
-static const CoordRec char78_stroke0[] = {
- { 11.14, 100 },
- { 11.14, 0 },
-};
-
-static const CoordRec char78_stroke1[] = {
- { 11.14, 100 },
- { 77.8067, 0 },
-};
-
-static const CoordRec char78_stroke2[] = {
- { 77.8067, 100 },
- { 77.8067, 0 },
-};
-
-static const StrokeRec char78[] = {
- { 2, char78_stroke0 },
- { 2, char78_stroke1 },
- { 2, char78_stroke2 },
-};
-
-/* char: 79 'O' */
-
-static const CoordRec char79_stroke0[] = {
- { 34.8114, 100 },
- { 25.2876, 95.2381 },
- { 15.7638, 85.7143 },
- { 11.0019, 76.1905 },
- { 6.24, 61.9048 },
- { 6.24, 38.0952 },
- { 11.0019, 23.8095 },
- { 15.7638, 14.2857 },
- { 25.2876, 4.7619 },
- { 34.8114, 0 },
- { 53.859, 0 },
- { 63.3829, 4.7619 },
- { 72.9067, 14.2857 },
- { 77.6686, 23.8095 },
- { 82.4305, 38.0952 },
- { 82.4305, 61.9048 },
- { 77.6686, 76.1905 },
- { 72.9067, 85.7143 },
- { 63.3829, 95.2381 },
- { 53.859, 100 },
- { 34.8114, 100 },
-};
-
-static const StrokeRec char79[] = {
- { 21, char79_stroke0 },
-};
-
-/* char: 80 'P' */
-
-static const CoordRec char80_stroke0[] = {
- { 12.1, 100 },
- { 12.1, 0 },
-};
-
-static const CoordRec char80_stroke1[] = {
- { 12.1, 100 },
- { 54.9571, 100 },
- { 69.2429, 95.2381 },
- { 74.0048, 90.4762 },
- { 78.7667, 80.9524 },
- { 78.7667, 66.6667 },
- { 74.0048, 57.1429 },
- { 69.2429, 52.381 },
- { 54.9571, 47.619 },
- { 12.1, 47.619 },
-};
-
-static const StrokeRec char80[] = {
- { 2, char80_stroke0 },
- { 10, char80_stroke1 },
-};
-
-/* char: 81 'Q' */
-
-static const CoordRec char81_stroke0[] = {
- { 33.8714, 100 },
- { 24.3476, 95.2381 },
- { 14.8238, 85.7143 },
- { 10.0619, 76.1905 },
- { 5.3, 61.9048 },
- { 5.3, 38.0952 },
- { 10.0619, 23.8095 },
- { 14.8238, 14.2857 },
- { 24.3476, 4.7619 },
- { 33.8714, 0 },
- { 52.919, 0 },
- { 62.4429, 4.7619 },
- { 71.9667, 14.2857 },
- { 76.7286, 23.8095 },
- { 81.4905, 38.0952 },
- { 81.4905, 61.9048 },
- { 76.7286, 76.1905 },
- { 71.9667, 85.7143 },
- { 62.4429, 95.2381 },
- { 52.919, 100 },
- { 33.8714, 100 },
-};
-
-static const CoordRec char81_stroke1[] = {
- { 48.1571, 19.0476 },
- { 76.7286, -9.5238 },
-};
-
-static const StrokeRec char81[] = {
- { 21, char81_stroke0 },
- { 2, char81_stroke1 },
-};
-
-/* char: 82 'R' */
-
-static const CoordRec char82_stroke0[] = {
- { 11.68, 100 },
- { 11.68, 0 },
-};
-
-static const CoordRec char82_stroke1[] = {
- { 11.68, 100 },
- { 54.5371, 100 },
- { 68.8229, 95.2381 },
- { 73.5848, 90.4762 },
- { 78.3467, 80.9524 },
- { 78.3467, 71.4286 },
- { 73.5848, 61.9048 },
- { 68.8229, 57.1429 },
- { 54.5371, 52.381 },
- { 11.68, 52.381 },
-};
-
-static const CoordRec char82_stroke2[] = {
- { 45.0133, 52.381 },
- { 78.3467, 0 },
-};
-
-static const StrokeRec char82[] = {
- { 2, char82_stroke0 },
- { 10, char82_stroke1 },
- { 2, char82_stroke2 },
-};
-
-/* char: 83 'S' */
-
-static const CoordRec char83_stroke0[] = {
- { 74.6667, 85.7143 },
- { 65.1429, 95.2381 },
- { 50.8571, 100 },
- { 31.8095, 100 },
- { 17.5238, 95.2381 },
- { 8, 85.7143 },
- { 8, 76.1905 },
- { 12.7619, 66.6667 },
- { 17.5238, 61.9048 },
- { 27.0476, 57.1429 },
- { 55.619, 47.619 },
- { 65.1429, 42.8571 },
- { 69.9048, 38.0952 },
- { 74.6667, 28.5714 },
- { 74.6667, 14.2857 },
- { 65.1429, 4.7619 },
- { 50.8571, 0 },
- { 31.8095, 0 },
- { 17.5238, 4.7619 },
- { 8, 14.2857 },
-};
-
-static const StrokeRec char83[] = {
- { 20, char83_stroke0 },
-};
-
-/* char: 84 'T' */
-
-static const CoordRec char84_stroke0[] = {
- { 35.6933, 100 },
- { 35.6933, 0 },
-};
-
-static const CoordRec char84_stroke1[] = {
- { 2.36, 100 },
- { 69.0267, 100 },
-};
-
-static const StrokeRec char84[] = {
- { 2, char84_stroke0 },
- { 2, char84_stroke1 },
-};
-
-/* char: 85 'U' */
-
-static const CoordRec char85_stroke0[] = {
- { 11.54, 100 },
- { 11.54, 28.5714 },
- { 16.3019, 14.2857 },
- { 25.8257, 4.7619 },
- { 40.1114, 0 },
- { 49.6352, 0 },
- { 63.921, 4.7619 },
- { 73.4448, 14.2857 },
- { 78.2067, 28.5714 },
- { 78.2067, 100 },
-};
-
-static const StrokeRec char85[] = {
- { 10, char85_stroke0 },
-};
-
-/* char: 86 'V' */
-
-static const CoordRec char86_stroke0[] = {
- { 2.36, 100 },
- { 40.4552, 0 },
-};
-
-static const CoordRec char86_stroke1[] = {
- { 78.5505, 100 },
- { 40.4552, 0 },
-};
-
-static const StrokeRec char86[] = {
- { 2, char86_stroke0 },
- { 2, char86_stroke1 },
-};
-
-/* char: 87 'W' */
-
-static const CoordRec char87_stroke0[] = {
- { 2.22, 100 },
- { 26.0295, 0 },
-};
-
-static const CoordRec char87_stroke1[] = {
- { 49.839, 100 },
- { 26.0295, 0 },
-};
-
-static const CoordRec char87_stroke2[] = {
- { 49.839, 100 },
- { 73.6486, 0 },
-};
-
-static const CoordRec char87_stroke3[] = {
- { 97.4581, 100 },
- { 73.6486, 0 },
-};
-
-static const StrokeRec char87[] = {
- { 2, char87_stroke0 },
- { 2, char87_stroke1 },
- { 2, char87_stroke2 },
- { 2, char87_stroke3 },
-};
-
-/* char: 88 'X' */
-
-static const CoordRec char88_stroke0[] = {
- { 2.5, 100 },
- { 69.1667, 0 },
-};
-
-static const CoordRec char88_stroke1[] = {
- { 69.1667, 100 },
- { 2.5, 0 },
-};
-
-static const StrokeRec char88[] = {
- { 2, char88_stroke0 },
- { 2, char88_stroke1 },
-};
-
-/* char: 89 'Y' */
-
-static const CoordRec char89_stroke0[] = {
- { 1.52, 100 },
- { 39.6152, 52.381 },
- { 39.6152, 0 },
-};
-
-static const CoordRec char89_stroke1[] = {
- { 77.7105, 100 },
- { 39.6152, 52.381 },
-};
-
-static const StrokeRec char89[] = {
- { 3, char89_stroke0 },
- { 2, char89_stroke1 },
-};
-
-/* char: 90 'Z' */
-
-static const CoordRec char90_stroke0[] = {
- { 69.1667, 100 },
- { 2.5, 0 },
-};
-
-static const CoordRec char90_stroke1[] = {
- { 2.5, 100 },
- { 69.1667, 100 },
-};
-
-static const CoordRec char90_stroke2[] = {
- { 2.5, 0 },
- { 69.1667, 0 },
-};
-
-static const StrokeRec char90[] = {
- { 2, char90_stroke0 },
- { 2, char90_stroke1 },
- { 2, char90_stroke2 },
-};
-
-/* char: 91 '[' */
-
-static const CoordRec char91_stroke0[] = {
- { 7.78, 119.048 },
- { 7.78, -33.3333 },
-};
-
-static const CoordRec char91_stroke1[] = {
- { 12.5419, 119.048 },
- { 12.5419, -33.3333 },
-};
-
-static const CoordRec char91_stroke2[] = {
- { 7.78, 119.048 },
- { 41.1133, 119.048 },
-};
-
-static const CoordRec char91_stroke3[] = {
- { 7.78, -33.3333 },
- { 41.1133, -33.3333 },
-};
-
-static const StrokeRec char91[] = {
- { 2, char91_stroke0 },
- { 2, char91_stroke1 },
- { 2, char91_stroke2 },
- { 2, char91_stroke3 },
-};
-
-/* char: 92 '\' */
-
-static const CoordRec char92_stroke0[] = {
- { 5.84, 100 },
- { 72.5067, -14.2857 },
-};
-
-static const StrokeRec char92[] = {
- { 2, char92_stroke0 },
-};
-
-/* char: 93 ']' */
-
-static const CoordRec char93_stroke0[] = {
- { 33.0114, 119.048 },
- { 33.0114, -33.3333 },
-};
-
-static const CoordRec char93_stroke1[] = {
- { 37.7733, 119.048 },
- { 37.7733, -33.3333 },
-};
-
-static const CoordRec char93_stroke2[] = {
- { 4.44, 119.048 },
- { 37.7733, 119.048 },
-};
-
-static const CoordRec char93_stroke3[] = {
- { 4.44, -33.3333 },
- { 37.7733, -33.3333 },
-};
-
-static const StrokeRec char93[] = {
- { 2, char93_stroke0 },
- { 2, char93_stroke1 },
- { 2, char93_stroke2 },
- { 2, char93_stroke3 },
-};
-
-/* char: 94 '^' */
-
-static const CoordRec char94_stroke0[] = {
- { 44.0752, 109.524 },
- { 5.98, 42.8571 },
-};
-
-static const CoordRec char94_stroke1[] = {
- { 44.0752, 109.524 },
- { 82.1705, 42.8571 },
-};
-
-static const StrokeRec char94[] = {
- { 2, char94_stroke0 },
- { 2, char94_stroke1 },
-};
-
-/* char: 95 '_' */
-
-static const CoordRec char95_stroke0[] = {
- { -1.1, -33.3333 },
- { 103.662, -33.3333 },
- { 103.662, -28.5714 },
- { -1.1, -28.5714 },
- { -1.1, -33.3333 },
-};
-
-static const StrokeRec char95[] = {
- { 5, char95_stroke0 },
-};
-
-/* char: 96 '`' */
-
-static const CoordRec char96_stroke0[] = {
- { 33.0219, 100 },
- { 56.8314, 71.4286 },
-};
-
-static const CoordRec char96_stroke1[] = {
- { 33.0219, 100 },
- { 28.26, 95.2381 },
- { 56.8314, 71.4286 },
-};
-
-static const StrokeRec char96[] = {
- { 2, char96_stroke0 },
- { 3, char96_stroke1 },
-};
-
-/* char: 97 'a' */
-
-static const CoordRec char97_stroke0[] = {
- { 63.8229, 66.6667 },
- { 63.8229, 0 },
-};
-
-static const CoordRec char97_stroke1[] = {
- { 63.8229, 52.381 },
- { 54.299, 61.9048 },
- { 44.7752, 66.6667 },
- { 30.4895, 66.6667 },
- { 20.9657, 61.9048 },
- { 11.4419, 52.381 },
- { 6.68, 38.0952 },
- { 6.68, 28.5714 },
- { 11.4419, 14.2857 },
- { 20.9657, 4.7619 },
- { 30.4895, 0 },
- { 44.7752, 0 },
- { 54.299, 4.7619 },
- { 63.8229, 14.2857 },
-};
-
-static const StrokeRec char97[] = {
- { 2, char97_stroke0 },
- { 14, char97_stroke1 },
-};
-
-/* char: 98 'b' */
-
-static const CoordRec char98_stroke0[] = {
- { 8.76, 100 },
- { 8.76, 0 },
-};
-
-static const CoordRec char98_stroke1[] = {
- { 8.76, 52.381 },
- { 18.2838, 61.9048 },
- { 27.8076, 66.6667 },
- { 42.0933, 66.6667 },
- { 51.6171, 61.9048 },
- { 61.141, 52.381 },
- { 65.9029, 38.0952 },
- { 65.9029, 28.5714 },
- { 61.141, 14.2857 },
- { 51.6171, 4.7619 },
- { 42.0933, 0 },
- { 27.8076, 0 },
- { 18.2838, 4.7619 },
- { 8.76, 14.2857 },
-};
-
-static const StrokeRec char98[] = {
- { 2, char98_stroke0 },
- { 14, char98_stroke1 },
-};
-
-/* char: 99 'c' */
-
-static const CoordRec char99_stroke0[] = {
- { 62.6629, 52.381 },
- { 53.139, 61.9048 },
- { 43.6152, 66.6667 },
- { 29.3295, 66.6667 },
- { 19.8057, 61.9048 },
- { 10.2819, 52.381 },
- { 5.52, 38.0952 },
- { 5.52, 28.5714 },
- { 10.2819, 14.2857 },
- { 19.8057, 4.7619 },
- { 29.3295, 0 },
- { 43.6152, 0 },
- { 53.139, 4.7619 },
- { 62.6629, 14.2857 },
-};
-
-static const StrokeRec char99[] = {
- { 14, char99_stroke0 },
-};
-
-/* char: 100 'd' */
-
-static const CoordRec char100_stroke0[] = {
- { 61.7829, 100 },
- { 61.7829, 0 },
-};
-
-static const CoordRec char100_stroke1[] = {
- { 61.7829, 52.381 },
- { 52.259, 61.9048 },
- { 42.7352, 66.6667 },
- { 28.4495, 66.6667 },
- { 18.9257, 61.9048 },
- { 9.4019, 52.381 },
- { 4.64, 38.0952 },
- { 4.64, 28.5714 },
- { 9.4019, 14.2857 },
- { 18.9257, 4.7619 },
- { 28.4495, 0 },
- { 42.7352, 0 },
- { 52.259, 4.7619 },
- { 61.7829, 14.2857 },
-};
-
-static const StrokeRec char100[] = {
- { 2, char100_stroke0 },
- { 14, char100_stroke1 },
-};
-
-/* char: 101 'e' */
-
-static const CoordRec char101_stroke0[] = {
- { 5.72, 38.0952 },
- { 62.8629, 38.0952 },
- { 62.8629, 47.619 },
- { 58.101, 57.1429 },
- { 53.339, 61.9048 },
- { 43.8152, 66.6667 },
- { 29.5295, 66.6667 },
- { 20.0057, 61.9048 },
- { 10.4819, 52.381 },
- { 5.72, 38.0952 },
- { 5.72, 28.5714 },
- { 10.4819, 14.2857 },
- { 20.0057, 4.7619 },
- { 29.5295, 0 },
- { 43.8152, 0 },
- { 53.339, 4.7619 },
- { 62.8629, 14.2857 },
-};
-
-static const StrokeRec char101[] = {
- { 17, char101_stroke0 },
-};
-
-/* char: 102 'f' */
-
-static const CoordRec char102_stroke0[] = {
- { 38.7752, 100 },
- { 29.2514, 100 },
- { 19.7276, 95.2381 },
- { 14.9657, 80.9524 },
- { 14.9657, 0 },
-};
-
-static const CoordRec char102_stroke1[] = {
- { 0.68, 66.6667 },
- { 34.0133, 66.6667 },
-};
-
-static const StrokeRec char102[] = {
- { 5, char102_stroke0 },
- { 2, char102_stroke1 },
-};
-
-/* char: 103 'g' */
-
-static const CoordRec char103_stroke0[] = {
- { 62.5029, 66.6667 },
- { 62.5029, -9.5238 },
- { 57.741, -23.8095 },
- { 52.979, -28.5714 },
- { 43.4552, -33.3333 },
- { 29.1695, -33.3333 },
- { 19.6457, -28.5714 },
-};
-
-static const CoordRec char103_stroke1[] = {
- { 62.5029, 52.381 },
- { 52.979, 61.9048 },
- { 43.4552, 66.6667 },
- { 29.1695, 66.6667 },
- { 19.6457, 61.9048 },
- { 10.1219, 52.381 },
- { 5.36, 38.0952 },
- { 5.36, 28.5714 },
- { 10.1219, 14.2857 },
- { 19.6457, 4.7619 },
- { 29.1695, 0 },
- { 43.4552, 0 },
- { 52.979, 4.7619 },
- { 62.5029, 14.2857 },
-};
-
-static const StrokeRec char103[] = {
- { 7, char103_stroke0 },
- { 14, char103_stroke1 },
-};
-
-/* char: 104 'h' */
-
-static const CoordRec char104_stroke0[] = {
- { 9.6, 100 },
- { 9.6, 0 },
-};
-
-static const CoordRec char104_stroke1[] = {
- { 9.6, 47.619 },
- { 23.8857, 61.9048 },
- { 33.4095, 66.6667 },
- { 47.6952, 66.6667 },
- { 57.219, 61.9048 },
- { 61.981, 47.619 },
- { 61.981, 0 },
-};
-
-static const StrokeRec char104[] = {
- { 2, char104_stroke0 },
- { 7, char104_stroke1 },
-};
-
-/* char: 105 'i' */
-
-static const CoordRec char105_stroke0[] = {
- { 10.02, 100 },
- { 14.7819, 95.2381 },
- { 19.5438, 100 },
- { 14.7819, 104.762 },
- { 10.02, 100 },
-};
-
-static const CoordRec char105_stroke1[] = {
- { 14.7819, 66.6667 },
- { 14.7819, 0 },
-};
-
-static const StrokeRec char105[] = {
- { 5, char105_stroke0 },
- { 2, char105_stroke1 },
-};
-
-/* char: 106 'j' */
-
-static const CoordRec char106_stroke0[] = {
- { 17.3876, 100 },
- { 22.1495, 95.2381 },
- { 26.9114, 100 },
- { 22.1495, 104.762 },
- { 17.3876, 100 },
-};
-
-static const CoordRec char106_stroke1[] = {
- { 22.1495, 66.6667 },
- { 22.1495, -14.2857 },
- { 17.3876, -28.5714 },
- { 7.8638, -33.3333 },
- { -1.66, -33.3333 },
-};
-
-static const StrokeRec char106[] = {
- { 5, char106_stroke0 },
- { 5, char106_stroke1 },
-};
-
-/* char: 107 'k' */
-
-static const CoordRec char107_stroke0[] = {
- { 9.6, 100 },
- { 9.6, 0 },
-};
-
-static const CoordRec char107_stroke1[] = {
- { 57.219, 66.6667 },
- { 9.6, 19.0476 },
-};
-
-static const CoordRec char107_stroke2[] = {
- { 28.6476, 38.0952 },
- { 61.981, 0 },
-};
-
-static const StrokeRec char107[] = {
- { 2, char107_stroke0 },
- { 2, char107_stroke1 },
- { 2, char107_stroke2 },
-};
-
-/* char: 108 'l' */
-
-static const CoordRec char108_stroke0[] = {
- { 10.02, 100 },
- { 10.02, 0 },
-};
-
-static const StrokeRec char108[] = {
- { 2, char108_stroke0 },
-};
-
-/* char: 109 'm' */
-
-static const CoordRec char109_stroke0[] = {
- { 9.6, 66.6667 },
- { 9.6, 0 },
-};
-
-static const CoordRec char109_stroke1[] = {
- { 9.6, 47.619 },
- { 23.8857, 61.9048 },
- { 33.4095, 66.6667 },
- { 47.6952, 66.6667 },
- { 57.219, 61.9048 },
- { 61.981, 47.619 },
- { 61.981, 0 },
-};
-
-static const CoordRec char109_stroke2[] = {
- { 61.981, 47.619 },
- { 76.2667, 61.9048 },
- { 85.7905, 66.6667 },
- { 100.076, 66.6667 },
- { 109.6, 61.9048 },
- { 114.362, 47.619 },
- { 114.362, 0 },
-};
-
-static const StrokeRec char109[] = {
- { 2, char109_stroke0 },
- { 7, char109_stroke1 },
- { 7, char109_stroke2 },
-};
-
-/* char: 110 'n' */
-
-static const CoordRec char110_stroke0[] = {
- { 9.18, 66.6667 },
- { 9.18, 0 },
-};
-
-static const CoordRec char110_stroke1[] = {
- { 9.18, 47.619 },
- { 23.4657, 61.9048 },
- { 32.9895, 66.6667 },
- { 47.2752, 66.6667 },
- { 56.799, 61.9048 },
- { 61.561, 47.619 },
- { 61.561, 0 },
-};
-
-static const StrokeRec char110[] = {
- { 2, char110_stroke0 },
- { 7, char110_stroke1 },
-};
-
-/* char: 111 'o' */
-
-static const CoordRec char111_stroke0[] = {
- { 28.7895, 66.6667 },
- { 19.2657, 61.9048 },
- { 9.7419, 52.381 },
- { 4.98, 38.0952 },
- { 4.98, 28.5714 },
- { 9.7419, 14.2857 },
- { 19.2657, 4.7619 },
- { 28.7895, 0 },
- { 43.0752, 0 },
- { 52.599, 4.7619 },
- { 62.1229, 14.2857 },
- { 66.8848, 28.5714 },
- { 66.8848, 38.0952 },
- { 62.1229, 52.381 },
- { 52.599, 61.9048 },
- { 43.0752, 66.6667 },
- { 28.7895, 66.6667 },
-};
-
-static const StrokeRec char111[] = {
- { 17, char111_stroke0 },
-};
-
-/* char: 112 'p' */
-
-static const CoordRec char112_stroke0[] = {
- { 9.46, 66.6667 },
- { 9.46, -33.3333 },
-};
-
-static const CoordRec char112_stroke1[] = {
- { 9.46, 52.381 },
- { 18.9838, 61.9048 },
- { 28.5076, 66.6667 },
- { 42.7933, 66.6667 },
- { 52.3171, 61.9048 },
- { 61.841, 52.381 },
- { 66.6029, 38.0952 },
- { 66.6029, 28.5714 },
- { 61.841, 14.2857 },
- { 52.3171, 4.7619 },
- { 42.7933, 0 },
- { 28.5076, 0 },
- { 18.9838, 4.7619 },
- { 9.46, 14.2857 },
-};
-
-static const StrokeRec char112[] = {
- { 2, char112_stroke0 },
- { 14, char112_stroke1 },
-};
-
-/* char: 113 'q' */
-
-static const CoordRec char113_stroke0[] = {
- { 61.9829, 66.6667 },
- { 61.9829, -33.3333 },
-};
-
-static const CoordRec char113_stroke1[] = {
- { 61.9829, 52.381 },
- { 52.459, 61.9048 },
- { 42.9352, 66.6667 },
- { 28.6495, 66.6667 },
- { 19.1257, 61.9048 },
- { 9.6019, 52.381 },
- { 4.84, 38.0952 },
- { 4.84, 28.5714 },
- { 9.6019, 14.2857 },
- { 19.1257, 4.7619 },
- { 28.6495, 0 },
- { 42.9352, 0 },
- { 52.459, 4.7619 },
- { 61.9829, 14.2857 },
-};
-
-static const StrokeRec char113[] = {
- { 2, char113_stroke0 },
- { 14, char113_stroke1 },
-};
-
-/* char: 114 'r' */
-
-static const CoordRec char114_stroke0[] = {
- { 9.46, 66.6667 },
- { 9.46, 0 },
-};
-
-static const CoordRec char114_stroke1[] = {
- { 9.46, 38.0952 },
- { 14.2219, 52.381 },
- { 23.7457, 61.9048 },
- { 33.2695, 66.6667 },
- { 47.5552, 66.6667 },
-};
-
-static const StrokeRec char114[] = {
- { 2, char114_stroke0 },
- { 5, char114_stroke1 },
-};
-
-/* char: 115 's' */
-
-static const CoordRec char115_stroke0[] = {
- { 57.081, 52.381 },
- { 52.319, 61.9048 },
- { 38.0333, 66.6667 },
- { 23.7476, 66.6667 },
- { 9.4619, 61.9048 },
- { 4.7, 52.381 },
- { 9.4619, 42.8571 },
- { 18.9857, 38.0952 },
- { 42.7952, 33.3333 },
- { 52.319, 28.5714 },
- { 57.081, 19.0476 },
- { 57.081, 14.2857 },
- { 52.319, 4.7619 },
- { 38.0333, 0 },
- { 23.7476, 0 },
- { 9.4619, 4.7619 },
- { 4.7, 14.2857 },
-};
-
-static const StrokeRec char115[] = {
- { 17, char115_stroke0 },
-};
-
-/* char: 116 't' */
-
-static const CoordRec char116_stroke0[] = {
- { 14.8257, 100 },
- { 14.8257, 19.0476 },
- { 19.5876, 4.7619 },
- { 29.1114, 0 },
- { 38.6352, 0 },
-};
-
-static const CoordRec char116_stroke1[] = {
- { 0.54, 66.6667 },
- { 33.8733, 66.6667 },
-};
-
-static const StrokeRec char116[] = {
- { 5, char116_stroke0 },
- { 2, char116_stroke1 },
-};
-
-/* char: 117 'u' */
-
-static const CoordRec char117_stroke0[] = {
- { 9.46, 66.6667 },
- { 9.46, 19.0476 },
- { 14.2219, 4.7619 },
- { 23.7457, 0 },
- { 38.0314, 0 },
- { 47.5552, 4.7619 },
- { 61.841, 19.0476 },
-};
-
-static const CoordRec char117_stroke1[] = {
- { 61.841, 66.6667 },
- { 61.841, 0 },
-};
-
-static const StrokeRec char117[] = {
- { 7, char117_stroke0 },
- { 2, char117_stroke1 },
-};
-
-/* char: 118 'v' */
-
-static const CoordRec char118_stroke0[] = {
- { 1.8, 66.6667 },
- { 30.3714, 0 },
-};
-
-static const CoordRec char118_stroke1[] = {
- { 58.9429, 66.6667 },
- { 30.3714, 0 },
-};
-
-static const StrokeRec char118[] = {
- { 2, char118_stroke0 },
- { 2, char118_stroke1 },
-};
-
-/* char: 119 'w' */
-
-static const CoordRec char119_stroke0[] = {
- { 2.5, 66.6667 },
- { 21.5476, 0 },
-};
-
-static const CoordRec char119_stroke1[] = {
- { 40.5952, 66.6667 },
- { 21.5476, 0 },
-};
-
-static const CoordRec char119_stroke2[] = {
- { 40.5952, 66.6667 },
- { 59.6429, 0 },
-};
-
-static const CoordRec char119_stroke3[] = {
- { 78.6905, 66.6667 },
- { 59.6429, 0 },
-};
-
-static const StrokeRec char119[] = {
- { 2, char119_stroke0 },
- { 2, char119_stroke1 },
- { 2, char119_stroke2 },
- { 2, char119_stroke3 },
-};
-
-/* char: 120 'x' */
-
-static const CoordRec char120_stroke0[] = {
- { 1.66, 66.6667 },
- { 54.041, 0 },
-};
-
-static const CoordRec char120_stroke1[] = {
- { 54.041, 66.6667 },
- { 1.66, 0 },
-};
-
-static const StrokeRec char120[] = {
- { 2, char120_stroke0 },
- { 2, char120_stroke1 },
-};
-
-/* char: 121 'y' */
-
-static const CoordRec char121_stroke0[] = {
- { 6.5619, 66.6667 },
- { 35.1333, 0 },
-};
-
-static const CoordRec char121_stroke1[] = {
- { 63.7048, 66.6667 },
- { 35.1333, 0 },
- { 25.6095, -19.0476 },
- { 16.0857, -28.5714 },
- { 6.5619, -33.3333 },
- { 1.8, -33.3333 },
-};
-
-static const StrokeRec char121[] = {
- { 2, char121_stroke0 },
- { 6, char121_stroke1 },
-};
-
-/* char: 122 'z' */
-
-static const CoordRec char122_stroke0[] = {
- { 56.821, 66.6667 },
- { 4.44, 0 },
-};
-
-static const CoordRec char122_stroke1[] = {
- { 4.44, 66.6667 },
- { 56.821, 66.6667 },
-};
-
-static const CoordRec char122_stroke2[] = {
- { 4.44, 0 },
- { 56.821, 0 },
-};
-
-static const StrokeRec char122[] = {
- { 2, char122_stroke0 },
- { 2, char122_stroke1 },
- { 2, char122_stroke2 },
-};
-
-/* char: 123 '{' */
-
-static const CoordRec char123_stroke0[] = {
- { 31.1895, 119.048 },
- { 21.6657, 114.286 },
- { 16.9038, 109.524 },
- { 12.1419, 100 },
- { 12.1419, 90.4762 },
- { 16.9038, 80.9524 },
- { 21.6657, 76.1905 },
- { 26.4276, 66.6667 },
- { 26.4276, 57.1429 },
- { 16.9038, 47.619 },
-};
-
-static const CoordRec char123_stroke1[] = {
- { 21.6657, 114.286 },
- { 16.9038, 104.762 },
- { 16.9038, 95.2381 },
- { 21.6657, 85.7143 },
- { 26.4276, 80.9524 },
- { 31.1895, 71.4286 },
- { 31.1895, 61.9048 },
- { 26.4276, 52.381 },
- { 7.38, 42.8571 },
- { 26.4276, 33.3333 },
- { 31.1895, 23.8095 },
- { 31.1895, 14.2857 },
- { 26.4276, 4.7619 },
- { 21.6657, 0 },
- { 16.9038, -9.5238 },
- { 16.9038, -19.0476 },
- { 21.6657, -28.5714 },
-};
-
-static const CoordRec char123_stroke2[] = {
- { 16.9038, 38.0952 },
- { 26.4276, 28.5714 },
- { 26.4276, 19.0476 },
- { 21.6657, 9.5238 },
- { 16.9038, 4.7619 },
- { 12.1419, -4.7619 },
- { 12.1419, -14.2857 },
- { 16.9038, -23.8095 },
- { 21.6657, -28.5714 },
- { 31.1895, -33.3333 },
-};
-
-static const StrokeRec char123[] = {
- { 10, char123_stroke0 },
- { 17, char123_stroke1 },
- { 10, char123_stroke2 },
-};
-
-/* char: 124 '|' */
-
-static const CoordRec char124_stroke0[] = {
- { 11.54, 119.048 },
- { 11.54, -33.3333 },
-};
-
-static const StrokeRec char124[] = {
- { 2, char124_stroke0 },
-};
-
-/* char: 125 '}' */
-
-static const CoordRec char125_stroke0[] = {
- { 9.18, 119.048 },
- { 18.7038, 114.286 },
- { 23.4657, 109.524 },
- { 28.2276, 100 },
- { 28.2276, 90.4762 },
- { 23.4657, 80.9524 },
- { 18.7038, 76.1905 },
- { 13.9419, 66.6667 },
- { 13.9419, 57.1429 },
- { 23.4657, 47.619 },
-};
-
-static const CoordRec char125_stroke1[] = {
- { 18.7038, 114.286 },
- { 23.4657, 104.762 },
- { 23.4657, 95.2381 },
- { 18.7038, 85.7143 },
- { 13.9419, 80.9524 },
- { 9.18, 71.4286 },
- { 9.18, 61.9048 },
- { 13.9419, 52.381 },
- { 32.9895, 42.8571 },
- { 13.9419, 33.3333 },
- { 9.18, 23.8095 },
- { 9.18, 14.2857 },
- { 13.9419, 4.7619 },
- { 18.7038, 0 },
- { 23.4657, -9.5238 },
- { 23.4657, -19.0476 },
- { 18.7038, -28.5714 },
-};
-
-static const CoordRec char125_stroke2[] = {
- { 23.4657, 38.0952 },
- { 13.9419, 28.5714 },
- { 13.9419, 19.0476 },
- { 18.7038, 9.5238 },
- { 23.4657, 4.7619 },
- { 28.2276, -4.7619 },
- { 28.2276, -14.2857 },
- { 23.4657, -23.8095 },
- { 18.7038, -28.5714 },
- { 9.18, -33.3333 },
-};
-
-static const StrokeRec char125[] = {
- { 10, char125_stroke0 },
- { 17, char125_stroke1 },
- { 10, char125_stroke2 },
-};
-
-/* char: 126 '~' */
-
-static const CoordRec char126_stroke0[] = {
- { 2.92, 28.5714 },
- { 2.92, 38.0952 },
- { 7.6819, 52.381 },
- { 17.2057, 57.1429 },
- { 26.7295, 57.1429 },
- { 36.2533, 52.381 },
- { 55.301, 38.0952 },
- { 64.8248, 33.3333 },
- { 74.3486, 33.3333 },
- { 83.8724, 38.0952 },
- { 88.6343, 47.619 },
-};
-
-static const CoordRec char126_stroke1[] = {
- { 2.92, 38.0952 },
- { 7.6819, 47.619 },
- { 17.2057, 52.381 },
- { 26.7295, 52.381 },
- { 36.2533, 47.619 },
- { 55.301, 33.3333 },
- { 64.8248, 28.5714 },
- { 74.3486, 28.5714 },
- { 83.8724, 33.3333 },
- { 88.6343, 47.619 },
- { 88.6343, 57.1429 },
-};
-
-static const StrokeRec char126[] = {
- { 11, char126_stroke0 },
- { 11, char126_stroke1 },
-};
-
-/* char: 127 */
-
-static const CoordRec char127_stroke0[] = {
- { 52.381, 100 },
- { 14.2857, -33.3333 },
-};
-
-static const CoordRec char127_stroke1[] = {
- { 28.5714, 66.6667 },
- { 14.2857, 61.9048 },
- { 4.7619, 52.381 },
- { 0, 38.0952 },
- { 0, 23.8095 },
- { 4.7619, 14.2857 },
- { 14.2857, 4.7619 },
- { 28.5714, 0 },
- { 38.0952, 0 },
- { 52.381, 4.7619 },
- { 61.9048, 14.2857 },
- { 66.6667, 28.5714 },
- { 66.6667, 42.8571 },
- { 61.9048, 52.381 },
- { 52.381, 61.9048 },
- { 38.0952, 66.6667 },
- { 28.5714, 66.6667 },
-};
-
-static const StrokeRec char127[] = {
- { 2, char127_stroke0 },
- { 17, char127_stroke1 },
-};
-
-static const StrokeCharRec chars[] = {
- { 0, /* char0 */ 0, 0, 0 },
- { 0, /* char1 */ 0, 0, 0 },
- { 0, /* char2 */ 0, 0, 0 },
- { 0, /* char3 */ 0, 0, 0 },
- { 0, /* char4 */ 0, 0, 0 },
- { 0, /* char5 */ 0, 0, 0 },
- { 0, /* char6 */ 0, 0, 0 },
- { 0, /* char7 */ 0, 0, 0 },
- { 0, /* char8 */ 0, 0, 0 },
- { 0, /* char9 */ 0, 0, 0 },
- { 0, /* char10 */ 0, 0, 0 },
- { 0, /* char11 */ 0, 0, 0 },
- { 0, /* char12 */ 0, 0, 0 },
- { 0, /* char13 */ 0, 0, 0 },
- { 0, /* char14 */ 0, 0, 0 },
- { 0, /* char15 */ 0, 0, 0 },
- { 0, /* char16 */ 0, 0, 0 },
- { 0, /* char17 */ 0, 0, 0 },
- { 0, /* char18 */ 0, 0, 0 },
- { 0, /* char19 */ 0, 0, 0 },
- { 0, /* char20 */ 0, 0, 0 },
- { 0, /* char21 */ 0, 0, 0 },
- { 0, /* char22 */ 0, 0, 0 },
- { 0, /* char23 */ 0, 0, 0 },
- { 0, /* char24 */ 0, 0, 0 },
- { 0, /* char25 */ 0, 0, 0 },
- { 0, /* char26 */ 0, 0, 0 },
- { 0, /* char27 */ 0, 0, 0 },
- { 0, /* char28 */ 0, 0, 0 },
- { 0, /* char29 */ 0, 0, 0 },
- { 0, /* char30 */ 0, 0, 0 },
- { 0, /* char31 */ 0, 0, 0 },
- { 0, /* char32 */ 0, 52.381, 104.762 },
- { 2, char33, 13.3819, 26.6238 },
- { 2, char34, 23.0676, 51.4352 },
- { 4, char35, 36.5333, 79.4886 },
- { 3, char36, 38.1533, 76.2067 },
- { 3, char37, 49.2171, 96.5743 },
- { 1, char38, 53.599, 101.758 },
- { 1, char39, 4.44, 13.62 },
- { 1, char40, 21.8657, 47.1733 },
- { 1, char41, 24.3276, 47.5333 },
- { 3, char42, 30.7695, 59.439 },
- { 2, char43, 48.8371, 97.2543 },
- { 1, char44, 13.5219, 26.0638 },
- { 1, char45, 50.2371, 100.754 },
- { 1, char46, 13.1019, 26.4838 },
- { 1, char47, 40.5733, 82.1067 },
- { 1, char48, 38.3133, 77.0667 },
- { 1, char49, 30.8676, 66.5295 },
- { 1, char50, 38.7533, 77.6467 },
- { 1, char51, 38.3333, 77.0467 },
- { 2, char52, 37.2133, 80.1686 },
- { 1, char53, 38.1933, 77.6867 },
- { 1, char54, 34.1514, 73.8048 },
- { 2, char55, 38.8933, 77.2267 },
- { 1, char56, 38.9333, 77.6667 },
- { 1, char57, 39.9333, 74.0648 },
- { 2, char58, 14.0819, 26.2238 },
- { 2, char59, 12.9619, 26.3038 },
- { 1, char60, 41.1552, 81.6105 },
- { 2, char61, 48.5571, 97.2543 },
- { 1, char62, 40.8752, 81.6105 },
- { 2, char63, 36.9914, 73.9029 },
- { 2, char64, 34.9314, 74.3648 },
- { 3, char65, 40.5952, 80.4905 },
- { 3, char66, 44.7533, 83.6267 },
- { 1, char67, 39.9933, 84.4886 },
- { 2, char68, 45.2933, 85.2867 },
- { 4, char69, 39.9914, 78.1848 },
- { 3, char70, 39.9914, 78.7448 },
- { 2, char71, 40.3933, 89.7686 },
- { 3, char72, 44.7533, 89.0867 },
- { 1, char73, 10.86, 21.3 },
- { 1, char74, 31.0714, 59.999 },
- { 3, char75, 44.6133, 79.3267 },
- { 2, char76, 40.2514, 71.3229 },
- { 4, char77, 48.9552, 97.2105 },
- { 3, char78, 44.4733, 88.8067 },
- { 1, char79, 44.3352, 88.8305 },
- { 2, char80, 45.4333, 85.6667 },
- { 2, char81, 43.3952, 88.0905 },
- { 3, char82, 45.0133, 82.3667 },
- { 1, char83, 41.3333, 80.8267 },
- { 2, char84, 35.6933, 71.9467 },
- { 1, char85, 44.8733, 89.4867 },
- { 2, char86, 40.4552, 81.6105 },
- { 4, char87, 49.839, 100.518 },
- { 2, char88, 35.8333, 72.3667 },
- { 2, char89, 39.6152, 79.6505 },
- { 3, char90, 35.8333, 73.7467 },
- { 4, char91, 22.0657, 46.1133 },
- { 1, char92, 39.1733, 78.2067 },
- { 4, char93, 23.4876, 46.3933 },
- { 2, char94, 44.0752, 90.2305 },
- { 1, char95, 51.281, 104.062 },
- { 2, char96, 42.5457, 83.5714 },
- { 2, char97, 35.2514, 66.6029 },
- { 2, char98, 37.3314, 70.4629 },
- { 1, char99, 34.0914, 68.9229 },
- { 2, char100, 33.2114, 70.2629 },
- { 1, char101, 34.2914, 68.5229 },
- { 2, char102, 14.9657, 38.6552 },
- { 2, char103, 33.9314, 70.9829 },
- { 2, char104, 33.4095, 71.021 },
- { 2, char105, 14.7819, 28.8638 },
- { 2, char106, 17.3876, 36.2314 },
- { 3, char107, 33.4095, 62.521 },
- { 1, char108, 10.02, 19.34 },
- { 3, char109, 61.981, 123.962 },
- { 2, char110, 32.9895, 70.881 },
- { 1, char111, 33.5514, 71.7448 },
- { 2, char112, 38.0314, 70.8029 },
- { 2, char113, 33.4114, 70.7429 },
- { 2, char114, 23.7457, 49.4952 },
- { 1, char115, 28.5095, 62.321 },
- { 2, char116, 14.8257, 39.3152 },
- { 2, char117, 33.2695, 71.161 },
- { 2, char118, 30.3714, 60.6029 },
- { 4, char119, 40.5952, 80.4905 },
- { 2, char120, 25.4695, 56.401 },
- { 2, char121, 35.1333, 66.0648 },
- { 3, char122, 28.2495, 61.821 },
- { 3, char123, 21.6657, 41.6295 },
- { 1, char124, 11.54, 23.78 },
- { 3, char125, 18.7038, 41.4695 },
- { 2, char126, 45.7771, 91.2743 },
- { 2, char127, 33.3333, 66.6667 },
-};
-
-StrokeFontRec glutStrokeRoman = { "Roman", 128, chars, 119.048, -33.3333 };
-
diff --git a/src/glut/os2/glut_shapes.cpp b/src/glut/os2/glut_shapes.cpp
deleted file mode 100644
index 76b08095114..00000000000
--- a/src/glut/os2/glut_shapes.cpp
+++ /dev/null
@@ -1,595 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
-
-/**
-(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.
-*/
-
-#include <math.h>
-#include "glutint.h"
-
-/* Some <math.h> files do not define M_PI... */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-static GLUquadricObj *quadObj;
-
-#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); }
-
-static void
-initQuadObj(void)
-{
- quadObj = gluNewQuadric();
- if (!quadObj)
- __glutFatalError("out of memory.");
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_LINE);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluSphere(quadObj, radius, slices, stacks);
-}
-
-void GLUTAPIENTRY
-glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_FILL);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluSphere(quadObj, radius, slices, stacks);
-}
-
-void GLUTAPIENTRY
-glutWireCone(GLdouble base, GLdouble height,
- GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_LINE);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluCylinder(quadObj, base, 0.0, height, slices, stacks);
-}
-
-void GLUTAPIENTRY
-glutSolidCone(GLdouble base, GLdouble height,
- GLint slices, GLint stacks)
-{
- QUAD_OBJ_INIT();
- gluQuadricDrawStyle(quadObj, GLU_FILL);
- gluQuadricNormals(quadObj, GLU_SMOOTH);
- /* If we ever changed/used the texture or orientation state
- of quadObj, we'd need to change it to the defaults here
- with gluQuadricTexture and/or gluQuadricOrientation. */
- gluCylinder(quadObj, base, 0.0, height, slices, stacks);
-}
-
-/* ENDCENTRY */
-
-static void
-drawBox(GLfloat size, GLenum type)
-{
- static GLfloat n[6][3] =
- {
- {-1.0, 0.0, 0.0},
- {0.0, 1.0, 0.0},
- {1.0, 0.0, 0.0},
- {0.0, -1.0, 0.0},
- {0.0, 0.0, 1.0},
- {0.0, 0.0, -1.0}
- };
- static GLint faces[6][4] =
- {
- {0, 1, 2, 3},
- {3, 2, 6, 7},
- {7, 6, 5, 4},
- {4, 5, 1, 0},
- {5, 6, 2, 1},
- {7, 4, 0, 3}
- };
- GLfloat v[8][3];
- GLint i;
-
- v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
- v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
- v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
- v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
- v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
- v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
-
- for (i = 5; i >= 0; i--) {
- glBegin(type);
- glNormal3fv(&n[i][0]);
- glVertex3fv(&v[faces[i][0]][0]);
- glVertex3fv(&v[faces[i][1]][0]);
- glVertex3fv(&v[faces[i][2]][0]);
- glVertex3fv(&v[faces[i][3]][0]);
- glEnd();
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireCube(GLdouble size)
-{
- drawBox(size, GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidCube(GLdouble size)
-{
- drawBox(size, GL_QUADS);
-}
-
-/* ENDCENTRY */
-
-static void
-doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
-{
- int i, j;
- GLfloat theta, phi, theta1;
- GLfloat cosTheta, sinTheta;
- GLfloat cosTheta1, sinTheta1;
- GLfloat ringDelta, sideDelta;
-
- ringDelta = 2.0 * M_PI / rings;
- sideDelta = 2.0 * M_PI / nsides;
-
- theta = 0.0;
- cosTheta = 1.0;
- sinTheta = 0.0;
- for (i = rings - 1; i >= 0; i--) {
- theta1 = theta + ringDelta;
- cosTheta1 = cos(theta1);
- sinTheta1 = sin(theta1);
- glBegin(GL_QUAD_STRIP);
- phi = 0.0;
- for (j = nsides; j >= 0; j--) {
- GLfloat cosPhi, sinPhi, dist;
-
- phi += sideDelta;
- cosPhi = cos(phi);
- sinPhi = sin(phi);
- dist = R + r * cosPhi;
-
- glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
- glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
- glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
- glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
- }
- glEnd();
- theta = theta1;
- cosTheta = cosTheta1;
- sinTheta = sinTheta1;
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireTorus(GLdouble innerRadius, GLdouble outerRadius,
- GLint nsides, GLint rings)
-{
- glPushAttrib(GL_POLYGON_BIT);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- doughnut(innerRadius, outerRadius, nsides, rings);
- glPopAttrib();
-}
-
-void GLUTAPIENTRY
-glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius,
- GLint nsides, GLint rings)
-{
- doughnut(innerRadius, outerRadius, nsides, rings);
-}
-
-/* ENDCENTRY */
-
-static GLfloat dodec[20][3];
-
-static void
-initDodecahedron(void)
-{
- GLfloat alpha, beta;
-
- alpha = sqrt(2.0 / (3.0 + sqrt(5.0)));
- beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) -
- 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0))));
- /* *INDENT-OFF* */
- dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta;
- dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta;
- dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1;
- dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1;
- dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1;
- dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1;
- dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1;
- dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1;
- dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1;
- dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1;
- dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0;
- dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0;
- dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0;
- dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0;
- dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta;
- dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta;
- dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha;
- dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha;
- dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha;
- dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha;
- /* *INDENT-ON* */
-
-}
-
-#define DIFF3(_a,_b,_c) { \
- (_c)[0] = (_a)[0] - (_b)[0]; \
- (_c)[1] = (_a)[1] - (_b)[1]; \
- (_c)[2] = (_a)[2] - (_b)[2]; \
-}
-
-static void
-crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3])
-{
- GLfloat p[3]; /* in case prod == v1 or v2 */
-
- p[0] = v1[1] * v2[2] - v2[1] * v1[2];
- p[1] = v1[2] * v2[0] - v2[2] * v1[0];
- p[2] = v1[0] * v2[1] - v2[0] * v1[1];
- prod[0] = p[0];
- prod[1] = p[1];
- prod[2] = p[2];
-}
-
-static void
-normalize(GLfloat v[3])
-{
- GLfloat d;
-
- d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
- if (d == 0.0) {
- __glutWarning("normalize: zero length vector");
- v[0] = d = 1.0;
- }
- d = 1 / d;
- v[0] *= d;
- v[1] *= d;
- v[2] *= d;
-}
-
-static void
-pentagon(int a, int b, int c, int d, int e, GLenum shadeType)
-{
- GLfloat n0[3], d1[3], d2[3];
-
- DIFF3(dodec[a], dodec[b], d1);
- DIFF3(dodec[b], dodec[c], d2);
- crossprod(d1, d2, n0);
- normalize(n0);
-
- glBegin(shadeType);
- glNormal3fv(n0);
- glVertex3fv(&dodec[a][0]);
- glVertex3fv(&dodec[b][0]);
- glVertex3fv(&dodec[c][0]);
- glVertex3fv(&dodec[d][0]);
- glVertex3fv(&dodec[e][0]);
- glEnd();
-}
-
-static void
-dodecahedron(GLenum type)
-{
- static int inited = 0;
-
- if (inited == 0) {
- inited = 1;
- initDodecahedron();
- }
- pentagon(0, 1, 9, 16, 5, type);
- pentagon(1, 0, 3, 18, 7, type);
- pentagon(1, 7, 11, 10, 9, type);
- pentagon(11, 7, 18, 19, 6, type);
- pentagon(8, 17, 16, 9, 10, type);
- pentagon(2, 14, 15, 6, 19, type);
- pentagon(2, 13, 12, 4, 14, type);
- pentagon(2, 19, 18, 3, 13, type);
- pentagon(3, 0, 5, 12, 13, type);
- pentagon(6, 15, 8, 10, 11, type);
- pentagon(4, 17, 8, 15, 14, type);
- pentagon(4, 12, 5, 16, 17, type);
-}
-
-/* CENTRY */
-void GLUTAPIENTRY glutWireDodecahedron(void)
-{
- dodecahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidDodecahedron(void)
-{
- dodecahedron(GL_TRIANGLE_FAN);
-}
-
-/* ENDCENTRY */
-
-static void
-recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3,
- GLenum shadeType)
-{
- GLfloat q0[3], q1[3];
-
- DIFF3(n1, n2, q0);
- DIFF3(n2, n3, q1);
- crossprod(q0, q1, q1);
- normalize(q1);
-
- glBegin(shadeType);
- glNormal3fv(q1);
- glVertex3fv(n1);
- glVertex3fv(n2);
- glVertex3fv(n3);
- glEnd();
-}
-
-static void
-subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2,
- GLenum shadeType)
-{
- int depth;
- GLfloat w0[3], w1[3], w2[3];
- GLfloat l;
- int i, j, k, n;
-
- depth = 1;
- for (i = 0; i < depth; i++) {
- for (j = 0; i + j < depth; j++) {
- k = depth - i - j;
- for (n = 0; n < 3; n++) {
- w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth;
- w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n])
- / depth;
- w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n])
- / depth;
- }
- l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]);
- w0[0] /= l;
- w0[1] /= l;
- w0[2] /= l;
- l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]);
- w1[0] /= l;
- w1[1] /= l;
- w1[2] /= l;
- l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]);
- w2[0] /= l;
- w2[1] /= l;
- w2[2] /= l;
- recorditem(w1, w0, w2, shadeType);
- }
- }
-}
-
-static void
-drawtriangle(int i, GLfloat data[][3], int ndx[][3],
- GLenum shadeType)
-{
- GLfloat *x0, *x1, *x2;
-
- x0 = data[ndx[i][0]];
- x1 = data[ndx[i][1]];
- x2 = data[ndx[i][2]];
- subdivide(x0, x1, x2, shadeType);
-}
-
-/* octahedron data: The octahedron produced is centered at the
- origin and has radius 1.0 */
-static GLfloat odata[6][3] =
-{
- {1.0, 0.0, 0.0},
- {-1.0, 0.0, 0.0},
- {0.0, 1.0, 0.0},
- {0.0, -1.0, 0.0},
- {0.0, 0.0, 1.0},
- {0.0, 0.0, -1.0}
-};
-
-static int ondex[8][3] =
-{
- {0, 4, 2},
- {1, 2, 4},
- {0, 3, 4},
- {1, 4, 3},
- {0, 2, 5},
- {1, 5, 2},
- {0, 5, 3},
- {1, 3, 5}
-};
-
-static void
-octahedron(GLenum shadeType)
-{
- int i;
-
- for (i = 7; i >= 0; i--) {
- drawtriangle(i, odata, ondex, shadeType);
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireOctahedron(void)
-{
- octahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidOctahedron(void)
-{
- octahedron(GL_TRIANGLES);
-}
-
-/* ENDCENTRY */
-
-/* icosahedron data: These numbers are rigged to make an
- icosahedron of radius 1.0 */
-
-#define X .525731112119133606
-#define Z .850650808352039932
-
-static GLfloat idata[12][3] =
-{
- {-X, 0, Z},
- {X, 0, Z},
- {-X, 0, -Z},
- {X, 0, -Z},
- {0, Z, X},
- {0, Z, -X},
- {0, -Z, X},
- {0, -Z, -X},
- {Z, X, 0},
- {-Z, X, 0},
- {Z, -X, 0},
- {-Z, -X, 0}
-};
-
-static int index[20][3] =
-{
- {0, 4, 1},
- {0, 9, 4},
- {9, 5, 4},
- {4, 5, 8},
- {4, 8, 1},
- {8, 10, 1},
- {8, 3, 10},
- {5, 3, 8},
- {5, 2, 3},
- {2, 7, 3},
- {7, 10, 3},
- {7, 6, 10},
- {7, 11, 6},
- {11, 0, 6},
- {0, 1, 6},
- {6, 1, 10},
- {9, 0, 11},
- {9, 11, 2},
- {9, 2, 5},
- {7, 2, 11},
-};
-
-static void
-icosahedron(GLenum shadeType)
-{
- int i;
-
- for (i = 19; i >= 0; i--) {
- drawtriangle(i, idata, index, shadeType);
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireIcosahedron(void)
-{
- icosahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidIcosahedron(void)
-{
- icosahedron(GL_TRIANGLES);
-}
-
-/* ENDCENTRY */
-
-/* tetrahedron data: */
-
-#define T 1.73205080756887729
-
-static GLfloat tdata[4][3] =
-{
- {T, T, T},
- {T, -T, -T},
- {-T, T, -T},
- {-T, -T, T}
-};
-
-static int tndex[4][3] =
-{
- {0, 1, 3},
- {2, 1, 0},
- {3, 2, 0},
- {1, 2, 3}
-};
-
-static void
-tetrahedron(GLenum shadeType)
-{
- int i;
-
- for (i = 3; i >= 0; i--)
- drawtriangle(i, tdata, tndex, shadeType);
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWireTetrahedron(void)
-{
- tetrahedron(GL_LINE_LOOP);
-}
-
-void GLUTAPIENTRY
-glutSolidTetrahedron(void)
-{
- tetrahedron(GL_TRIANGLES);
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_stroke.cpp b/src/glut/os2/glut_stroke.cpp
deleted file mode 100644
index 4823283c8c4..00000000000
--- a/src/glut/os2/glut_stroke.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/* 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 "glutint.h"
-#include "glutstroke.h"
-
-void GLUTAPIENTRY
-glutStrokeCharacter(GLUTstrokeFont font, int c)
-{
- const StrokeCharRec *ch;
- const StrokeRec *stroke;
- const CoordRec *coord;
- StrokeFontPtr fontinfo;
- int i, j;
-
-
-#if defined(_WIN32)
- fontinfo = (StrokeFontPtr) __glutFont(font);
-#else
- fontinfo = (StrokeFontPtr) font;
-#endif
-
- if (c < 0 || c >= fontinfo->num_chars)
- return;
- ch = &(fontinfo->ch[c]);
- if (ch) {
- for (i = ch->num_strokes, stroke = ch->stroke;
- i > 0; i--, stroke++) {
- glBegin(GL_LINE_STRIP);
- for (j = stroke->num_coords, coord = stroke->coord;
- j > 0; j--, coord++) {
- glVertex2f(coord->x, coord->y);
- }
- glEnd();
- }
- glTranslatef(ch->right, 0.0, 0.0);
- }
-}
diff --git a/src/glut/os2/glut_swap.cpp b/src/glut/os2/glut_swap.cpp
deleted file mode 100644
index 210a7fc37e0..00000000000
--- a/src/glut/os2/glut_swap.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
-
-/* 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 <stdio.h>
-#include "glutint.h"
-
-GLint __glutFPS = 0;
-GLint __glutSwapCount = 0;
-GLint __glutSwapTime = 0;
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutSwapBuffers(void)
-{
- GLUTwindow *window = __glutCurrentWindow;
-
- if (window->renderWin == window->win) {
- if (__glutCurrentWindow->treatAsSingle) {
- /* Pretend the double buffered window is single buffered,
- so treat glutSwapBuffers as a no-op. */
- return;
- }
- } else {
- if (__glutCurrentWindow->overlay->treatAsSingle) {
- /* Pretend the double buffered overlay is single
- buffered, so treat glutSwapBuffers as a no-op. */
- return;
- }
- }
-
- /* For the MESA_SWAP_HACK. */
- window->usedSwapBuffers = 1;
-
- SWAP_BUFFERS_LAYER(__glutCurrentWindow);
-
- /* I considered putting the window being swapped on the
- GLUT_FINISH_WORK work list because you could call
- glutSwapBuffers from an idle callback which doesn't call
- __glutSetWindow which normally adds indirect rendering
- windows to the GLUT_FINISH_WORK work list. Not being put
- on the list could lead to the buffering up of multiple
- redisplays and buffer swaps and hamper interactivity. I
- consider this an application bug due to not using
- glutPostRedisplay to trigger redraws. If
- glutPostRedisplay were used, __glutSetWindow would be
- called and a glFinish to throttle buffering would occur. */
-
- if (__glutFPS) {
- GLint t = glutGet(GLUT_ELAPSED_TIME);
- __glutSwapCount++;
- if (__glutSwapTime == 0)
- __glutSwapTime = t;
- else if (t - __glutSwapTime > __glutFPS) {
- float time = 0.001 * (t - __glutSwapTime);
- float fps = (float) __glutSwapCount / time;
- fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n",
- __glutSwapCount, time, fps);
- __glutSwapTime = t;
- __glutSwapCount = 0;
- }
- }
-}
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_teapot.cpp b/src/glut/os2/glut_teapot.cpp
deleted file mode 100644
index e2fcb53152e..00000000000
--- a/src/glut/os2/glut_teapot.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/**
-(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.
-*/
-
-#include "glutint.h"
-
-/* Rim, body, lid, and bottom data must be reflected in x and
- y; handle and spout data across the y axis only. */
-
-static int patchdata[][16] =
-{
- /* rim */
- {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15},
- /* body */
- {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27},
- {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40},
- /* lid */
- {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101,
- 101, 0, 1, 2, 3,},
- {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117},
- /* bottom */
- {118, 118, 118, 118, 124, 122, 119, 121, 123, 126,
- 125, 120, 40, 39, 38, 37},
- /* handle */
- {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56},
- {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 28, 65, 66, 67},
- /* spout */
- {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83},
- {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95}
-};
-/* *INDENT-OFF* */
-
-static float cpdata[][3] =
-{
- {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0,
- -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125},
- {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375,
- 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375,
- 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84,
- 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875},
- {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75,
- 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35},
- {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2,
- 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12,
- 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225},
- {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225},
- {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0,
- -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5,
- -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3,
- 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0,
- 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0,
- 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8},
- {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3,
- -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3,
- 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2,
- -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0,
- 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0,
- 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66,
- 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1},
- {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7,
- -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0,
- 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375},
- {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475},
- {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4},
- {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0,
- 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8,
- 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4,
- -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0,
- 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4,
- 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3,
- 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4},
- {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425,
- -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425,
- 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075},
- {0.84, -1.5, 0.075}
-};
-
-static float tex[2][2][2] =
-{
- { {0, 0},
- {1, 0}},
- { {0, 1},
- {1, 1}}
-};
-
-/* *INDENT-ON* */
-
-static void
-teapot(GLint grid, GLdouble scale, GLenum type)
-{
- float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
- long i, j, k, l;
-
- glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT);
- glEnable(GL_AUTO_NORMAL);
- glEnable(GL_NORMALIZE);
- glEnable(GL_MAP2_VERTEX_3);
- glEnable(GL_MAP2_TEXTURE_COORD_2);
- glPushMatrix();
- glRotatef(270.0, 1.0, 0.0, 0.0);
- glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale);
- glTranslatef(0.0, 0.0, -1.5);
- for (i = 0; i < 10; i++) {
- for (j = 0; j < 4; j++) {
- for (k = 0; k < 4; k++) {
- for (l = 0; l < 3; l++) {
- p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
- q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
- if (l == 1)
- q[j][k][l] *= -1.0;
- if (i < 6) {
- r[j][k][l] =
- cpdata[patchdata[i][j * 4 + (3 - k)]][l];
- if (l == 0)
- r[j][k][l] *= -1.0;
- s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
- if (l == 0)
- s[j][k][l] *= -1.0;
- if (l == 1)
- s[j][k][l] *= -1.0;
- }
- }
- }
- }
- glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2,
- &tex[0][0][0]);
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &p[0][0][0]);
- glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0);
- glEvalMesh2(type, 0, grid, 0, grid);
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &q[0][0][0]);
- glEvalMesh2(type, 0, grid, 0, grid);
- if (i < 6) {
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &r[0][0][0]);
- glEvalMesh2(type, 0, grid, 0, grid);
- glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
- &s[0][0][0]);
- glEvalMesh2(type, 0, grid, 0, grid);
- }
- }
- glPopMatrix();
- glPopAttrib();
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutSolidTeapot(GLdouble scale)
-{
- teapot(7, scale, GL_FILL);
-}
-
-void GLUTAPIENTRY
-glutWireTeapot(GLdouble scale)
-{
- teapot(10, scale, GL_LINE);
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_tr24.cpp b/src/glut/os2/glut_tr24.cpp
deleted file mode 100644
index 9e1234644d7..00000000000
--- a/src/glut/os2/glut_tr24.cpp
+++ /dev/null
@@ -1,2063 +0,0 @@
-
-/* GENERATED FILE -- DO NOT MODIFY */
-
-#define glutBitmapTimesRoman24 XXX
-#include "glutbitmap.h"
-#undef glutBitmapTimesRoman24
-
-/* char: 0xff */
-
-static const GLubyte ch255data[] = {
-0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0,
-0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0,
-0xf1,0xe0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0,
-};
-
-static const BitmapCharRec ch255 = {11,21,0,5,11,ch255data};
-
-/* char: 0xfe */
-
-static const GLubyte ch254data[] = {
-0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80,
-0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0xe0,0x0,
-};
-
-static const BitmapCharRec ch254 = {10,22,-1,5,12,ch254data};
-
-/* char: 0xfd */
-
-static const GLubyte ch253data[] = {
-0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0,
-0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0,
-0xf1,0xe0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,0x1,0x80,
-};
-
-static const BitmapCharRec ch253 = {11,22,0,5,11,ch253data};
-
-/* char: 0xfc */
-
-static const GLubyte ch252data[] = {
-0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0,
-};
-
-static const BitmapCharRec ch252 = {11,16,-1,0,13,ch252data};
-
-/* char: 0xfb */
-
-static const GLubyte ch251data[] = {
-0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0,
-0xc,0x0,
-};
-
-static const BitmapCharRec ch251 = {11,17,-1,0,13,ch251data};
-
-/* char: 0xfa */
-
-static const GLubyte ch250data[] = {
-0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,
-0x1,0x80,
-};
-
-static const BitmapCharRec ch250 = {11,17,-1,0,13,ch250data};
-
-/* char: 0xf9 */
-
-static const GLubyte ch249data[] = {
-0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0,
-0x30,0x0,
-};
-
-static const BitmapCharRec ch249 = {11,17,-1,0,13,ch249data};
-
-/* char: 0xf8 */
-
-static const GLubyte ch248data[] = {
-0xc0,0x0,0xde,0x0,0x73,0x80,0x71,0x80,0xd0,0xc0,0xd8,0xc0,0xc8,0xc0,0xcc,0xc0,
-0xc4,0xc0,0xc6,0xc0,0x63,0x80,0x73,0x80,0x1e,0xc0,0x0,0xc0,
-};
-
-static const BitmapCharRec ch248 = {10,14,-1,1,12,ch248data};
-
-/* char: 0xf7 */
-
-static const GLubyte ch247data[] = {
-0x6,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,
-0x6,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch247 = {12,10,-1,-2,14,ch247data};
-
-/* char: 0xf6 */
-
-static const GLubyte ch246data[] = {
-0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0,
-};
-
-static const BitmapCharRec ch246 = {10,16,-1,0,12,ch246data};
-
-/* char: 0xf5 */
-
-static const GLubyte ch245data[] = {
-0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80,
-};
-
-static const BitmapCharRec ch245 = {10,16,-1,0,12,ch245data};
-
-/* char: 0xf4 */
-
-static const GLubyte ch244data[] = {
-0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0,
-0xc,0x0,
-};
-
-static const BitmapCharRec ch244 = {10,17,-1,0,12,ch244data};
-
-/* char: 0xf3 */
-
-static const GLubyte ch243data[] = {
-0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,
-0x1,0x80,
-};
-
-static const BitmapCharRec ch243 = {10,17,-1,0,12,ch243data};
-
-/* char: 0xf2 */
-
-static const GLubyte ch242data[] = {
-0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0,
-0x30,0x0,
-};
-
-static const BitmapCharRec ch242 = {10,17,-1,0,12,ch242data};
-
-/* char: 0xf1 */
-
-static const GLubyte ch241data[] = {
-0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80,
-};
-
-static const BitmapCharRec ch241 = {11,16,-1,0,13,ch241data};
-
-/* char: 0xf0 */
-
-static const GLubyte ch240data[] = {
-0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0x61,0x80,0x73,0x80,0x1f,0x0,0xc6,0x0,0x3c,0x0,0x1e,0x0,0x71,0x80,
-0xc0,0x0,
-};
-
-static const BitmapCharRec ch240 = {10,17,-1,0,12,ch240data};
-
-/* char: 0xef */
-
-static const GLubyte ch239data[] = {
-0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x0,0xcc,0xcc,
-};
-
-static const BitmapCharRec ch239 = {6,16,0,0,6,ch239data};
-
-/* char: 0xee */
-
-static const GLubyte ch238data[] = {
-0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x84,0x48,0x78,
-0x30,
-};
-
-static const BitmapCharRec ch238 = {6,17,0,0,6,ch238data};
-
-/* char: 0xed */
-
-static const GLubyte ch237data[] = {
-0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x80,0x60,0x38,
-0x18,
-};
-
-static const BitmapCharRec ch237 = {5,17,-1,0,6,ch237data};
-
-/* char: 0xec */
-
-static const GLubyte ch236data[] = {
-0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x8,0x30,0xe0,
-0xc0,
-};
-
-static const BitmapCharRec ch236 = {5,17,0,0,6,ch236data};
-
-/* char: 0xeb */
-
-static const GLubyte ch235data[] = {
-0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,
-0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0,
-};
-
-static const BitmapCharRec ch235 = {9,16,-1,0,11,ch235data};
-
-/* char: 0xea */
-
-static const GLubyte ch234data[] = {
-0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,
-0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0,
-0xc,0x0,
-};
-
-static const BitmapCharRec ch234 = {9,17,-1,0,11,ch234data};
-
-/* char: 0xe9 */
-
-static const GLubyte ch233data[] = {
-0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,
-0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0,
-0x3,0x0,
-};
-
-static const BitmapCharRec ch233 = {9,17,-1,0,11,ch233data};
-
-/* char: 0xe8 */
-
-static const GLubyte ch232data[] = {
-0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,
-0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0,
-0x60,0x0,
-};
-
-static const BitmapCharRec ch232 = {9,17,-1,0,11,ch232data};
-
-/* char: 0xe7 */
-
-static const GLubyte ch231data[] = {
-0x3c,0x0,0x66,0x0,0x6,0x0,0x1e,0x0,0x18,0x0,0x8,0x0,0x1e,0x0,0x7f,0x0,
-0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x41,0x80,
-0x63,0x80,0x1f,0x0,
-};
-
-static const BitmapCharRec ch231 = {9,18,-1,6,11,ch231data};
-
-/* char: 0xe6 */
-
-static const GLubyte ch230data[] = {
-0x70,0xf0,0xfb,0xf8,0xc7,0x84,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0xfc,
-0x3,0xc,0x63,0xc,0x67,0x98,0x3c,0xf0,
-};
-
-static const BitmapCharRec ch230 = {14,12,-1,0,16,ch230data};
-
-/* char: 0xe5 */
-
-static const GLubyte ch229data[] = {
-0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0,
-0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0,
-0x1c,0x0,
-};
-
-static const BitmapCharRec ch229 = {9,17,-1,0,11,ch229data};
-
-/* char: 0xe4 */
-
-static const GLubyte ch228data[] = {
-0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0,
-0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x66,0x0,0x66,0x0,
-};
-
-static const BitmapCharRec ch228 = {9,16,-1,0,11,ch228data};
-
-/* char: 0xe3 */
-
-static const GLubyte ch227data[] = {
-0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0,
-0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x5c,0x0,0x3a,0x0,
-};
-
-static const BitmapCharRec ch227 = {9,16,-1,0,11,ch227data};
-
-/* char: 0xe2 */
-
-static const GLubyte ch226data[] = {
-0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0,
-0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x42,0x0,0x24,0x0,0x3c,0x0,
-0x18,0x0,
-};
-
-static const BitmapCharRec ch226 = {9,17,-1,0,11,ch226data};
-
-/* char: 0xe1 */
-
-static const GLubyte ch225data[] = {
-0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0,
-0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0,
-0x3,0x0,
-};
-
-static const BitmapCharRec ch225 = {9,17,-1,0,11,ch225data};
-
-/* char: 0xe0 */
-
-static const GLubyte ch224data[] = {
-0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0,
-0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0,
-0x60,0x0,
-};
-
-static const BitmapCharRec ch224 = {9,17,-1,0,11,ch224data};
-
-/* char: 0xdf */
-
-static const GLubyte ch223data[] = {
-0xe7,0x0,0x6c,0x80,0x6c,0xc0,0x60,0xc0,0x60,0xc0,0x61,0xc0,0x61,0x80,0x63,0x80,
-0x67,0x0,0x6c,0x0,0x63,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0,
-0x1e,0x0,
-};
-
-static const BitmapCharRec ch223 = {10,17,-1,0,12,ch223data};
-
-/* char: 0xde */
-
-static const GLubyte ch222data[] = {
-0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,
-0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,0x3f,0xc0,0x30,0x0,0x30,0x0,0x30,0x0,
-0xfc,0x0,
-};
-
-static const BitmapCharRec ch222 = {13,17,-1,0,15,ch222data};
-
-/* char: 0xdd */
-
-static const GLubyte ch221data[] = {
-0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0,
-0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc,
-0xfc,0x3f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30,
-};
-
-static const BitmapCharRec ch221 = {16,22,0,0,16,ch221data};
-
-/* char: 0xdc */
-
-static const GLubyte ch220data[] = {
-0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0xfc,0x1f,0x0,0x0,0x0,0x0,0x6,0x30,0x6,0x30,
-};
-
-static const BitmapCharRec ch220 = {16,21,-1,0,18,ch220data};
-
-/* char: 0xdb */
-
-static const GLubyte ch219data[] = {
-0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0xfc,0x1f,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80,
-};
-
-static const BitmapCharRec ch219 = {16,22,-1,0,18,ch219data};
-
-/* char: 0xda */
-
-static const GLubyte ch218data[] = {
-0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0xfc,0x1f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30,
-};
-
-static const BitmapCharRec ch218 = {16,22,-1,0,18,ch218data};
-
-/* char: 0xd9 */
-
-static const GLubyte ch217data[] = {
-0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0xfc,0x1f,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch217 = {16,22,-1,0,18,ch217data};
-
-/* char: 0xd8 */
-
-static const GLubyte ch216data[] = {
-0x20,0x0,0x27,0xe0,0x1c,0x38,0x38,0x1c,0x68,0x6,0x64,0x6,0xc2,0x3,0xc2,0x3,
-0xc1,0x3,0xc1,0x3,0xc0,0x83,0xc0,0x83,0xc0,0x43,0x60,0x46,0x60,0x26,0x38,0x1c,
-0x1c,0x38,0x7,0xe4,0x0,0x4,
-};
-
-static const BitmapCharRec ch216 = {16,19,-1,1,18,ch216data};
-
-/* char: 0xd7 */
-
-static const GLubyte ch215data[] = {
-0x80,0x40,0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,
-0x61,0x80,0xc0,0xc0,0x80,0x40,
-};
-
-static const BitmapCharRec ch215 = {10,11,-2,-1,14,ch215data};
-
-/* char: 0xd6 */
-
-static const GLubyte ch214data[] = {
-0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,
-0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,
-0x7,0xe0,0x0,0x0,0x0,0x0,0x6,0x60,0x6,0x60,
-};
-
-static const BitmapCharRec ch214 = {16,21,-1,0,18,ch214data};
-
-/* char: 0xd5 */
-
-static const GLubyte ch213data[] = {
-0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,
-0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,
-0x7,0xe0,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90,
-};
-
-static const BitmapCharRec ch213 = {16,21,-1,0,18,ch213data};
-
-/* char: 0xd4 */
-
-static const GLubyte ch212data[] = {
-0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,
-0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,
-0x7,0xe0,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80,
-};
-
-static const BitmapCharRec ch212 = {16,22,-1,0,18,ch212data};
-
-/* char: 0xd3 */
-
-static const GLubyte ch211data[] = {
-0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,
-0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,
-0x7,0xe0,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30,
-};
-
-static const BitmapCharRec ch211 = {16,22,-1,0,18,ch211data};
-
-/* char: 0xd2 */
-
-static const GLubyte ch210data[] = {
-0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,
-0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,
-0x7,0xe0,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch210 = {16,22,-1,0,18,ch210data};
-
-/* char: 0xd1 */
-
-static const GLubyte ch209data[] = {
-0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84,
-0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4,
-0xf0,0x1f,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90,
-};
-
-static const BitmapCharRec ch209 = {16,21,-1,0,18,ch209data};
-
-/* char: 0xd0 */
-
-static const GLubyte ch208data[] = {
-0x7f,0xe0,0x18,0x38,0x18,0x1c,0x18,0x6,0x18,0x6,0x18,0x3,0x18,0x3,0x18,0x3,
-0xff,0x3,0x18,0x3,0x18,0x3,0x18,0x3,0x18,0x6,0x18,0x6,0x18,0x1c,0x18,0x38,
-0x7f,0xe0,
-};
-
-static const BitmapCharRec ch208 = {16,17,0,0,17,ch208data};
-
-/* char: 0xcf */
-
-static const GLubyte ch207data[] = {
-0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
-0xfc,0x0,0x0,0xcc,0xcc,
-};
-
-static const BitmapCharRec ch207 = {6,21,-1,0,8,ch207data};
-
-/* char: 0xce */
-
-static const GLubyte ch206data[] = {
-0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x7e,0x0,0x81,0x66,0x3c,0x18,
-};
-
-static const BitmapCharRec ch206 = {8,22,-1,0,8,ch206data};
-
-/* char: 0xcd */
-
-static const GLubyte ch205data[] = {
-0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
-0xfc,0x0,0x40,0x30,0x1c,0xc,
-};
-
-static const BitmapCharRec ch205 = {6,22,-1,0,8,ch205data};
-
-/* char: 0xcc */
-
-static const GLubyte ch204data[] = {
-0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
-0xfc,0x0,0x8,0x30,0xe0,0xc0,
-};
-
-static const BitmapCharRec ch204 = {6,22,-1,0,8,ch204data};
-
-/* char: 0xcb */
-
-static const GLubyte ch203data[] = {
-0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40,
-0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30,
-0xff,0xf0,0x0,0x0,0x0,0x0,0x19,0x80,0x19,0x80,
-};
-
-static const BitmapCharRec ch203 = {13,21,-1,0,15,ch203data};
-
-/* char: 0xca */
-
-static const GLubyte ch202data[] = {
-0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40,
-0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30,
-0xff,0xf0,0x0,0x0,0x10,0x20,0xc,0xc0,0x7,0x80,0x3,0x0,
-};
-
-static const BitmapCharRec ch202 = {13,22,-1,0,15,ch202data};
-
-/* char: 0xc9 */
-
-static const GLubyte ch201data[] = {
-0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40,
-0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30,
-0xff,0xf0,0x0,0x0,0x4,0x0,0x3,0x0,0x1,0xc0,0x0,0xc0,
-};
-
-static const BitmapCharRec ch201 = {13,22,-1,0,15,ch201data};
-
-/* char: 0xc8 */
-
-static const GLubyte ch200data[] = {
-0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40,
-0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30,
-0xff,0xf0,0x0,0x0,0x1,0x0,0x6,0x0,0x1c,0x0,0x18,0x0,
-};
-
-static const BitmapCharRec ch200 = {13,22,-1,0,15,ch200data};
-
-/* char: 0xc7 */
-
-static const GLubyte ch199data[] = {
-0x7,0x80,0xc,0xc0,0x0,0xc0,0x3,0xc0,0x3,0x0,0x1,0x0,0x7,0xe0,0x1e,0x38,
-0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,
-0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,0x7,0xe4,
-};
-
-static const BitmapCharRec ch199 = {14,23,-1,6,16,ch199data};
-
-/* char: 0xc6 */
-
-static const GLubyte ch198data[] = {
-0xf9,0xff,0xf0,0x30,0x60,0x30,0x10,0x60,0x10,0x10,0x60,0x10,0x18,0x60,0x0,0x8,
-0x60,0x0,0xf,0xe0,0x80,0xc,0x60,0x80,0x4,0x7f,0x80,0x4,0x60,0x80,0x6,0x60,
-0x80,0x2,0x60,0x0,0x2,0x60,0x0,0x1,0x60,0x20,0x1,0x60,0x20,0x1,0xe0,0x60,
-0x3,0xff,0xe0,
-};
-
-static const BitmapCharRec ch198 = {20,17,0,0,21,ch198data};
-
-/* char: 0xc5 */
-
-static const GLubyte ch197data[] = {
-0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8,
-0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30,
-0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0,
-0x0,0x80,0x0,0x1,0xc0,0x0,0x2,0x20,0x0,0x2,0x20,0x0,0x1,0xc0,0x0,
-};
-
-static const BitmapCharRec ch197 = {17,21,0,0,17,ch197data};
-
-/* char: 0xc4 */
-
-static const GLubyte ch196data[] = {
-0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8,
-0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30,
-0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0,
-0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x30,0x0,0x6,0x30,0x0,
-};
-
-static const BitmapCharRec ch196 = {17,21,0,0,17,ch196data};
-
-/* char: 0xc3 */
-
-static const GLubyte ch195data[] = {
-0xfc,0x1f,0x80,0x30,0x7,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8,
-0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30,
-0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0,
-0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0xe0,0x0,0x3,0x90,0x0,
-};
-
-static const BitmapCharRec ch195 = {17,21,0,0,17,ch195data};
-
-/* char: 0xc2 */
-
-static const GLubyte ch194data[] = {
-0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8,
-0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30,
-0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0,
-0x0,0x80,0x0,0x0,0x0,0x0,0x8,0x10,0x0,0x6,0x60,0x0,0x3,0xc0,0x0,0x1,
-0x80,0x0,
-};
-
-static const BitmapCharRec ch194 = {17,22,0,0,17,ch194data};
-
-/* char: 0xc1 */
-
-static const GLubyte ch193data[] = {
-0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8,
-0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30,
-0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0,
-0x0,0x80,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xc0,0x0,0x0,0x70,0x0,0x0,
-0x30,0x0,
-};
-
-static const BitmapCharRec ch193 = {17,22,0,0,17,ch193data};
-
-/* char: 0xc0 */
-
-static const GLubyte ch192data[] = {
-0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8,
-0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30,
-0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0,
-0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0xc0,0x0,0x3,0x80,0x0,0x3,
-0x0,0x0,
-};
-
-static const BitmapCharRec ch192 = {17,22,0,0,17,ch192data};
-
-/* char: 0xbf */
-
-static const GLubyte ch191data[] = {
-0x3e,0x63,0xc1,0xc3,0xc3,0xe0,0x70,0x30,0x38,0x18,0x18,0x8,0x8,0x0,0x0,0xc,
-0xc,
-};
-
-static const BitmapCharRec ch191 = {8,17,-1,5,11,ch191data};
-
-/* char: 0xbe */
-
-static const GLubyte ch190data[] = {
-0x18,0x2,0x0,0x8,0x2,0x0,0xc,0x7f,0x80,0x4,0x22,0x0,0x6,0x32,0x0,0x3,
-0x12,0x0,0x1,0xa,0x0,0x71,0x8e,0x0,0x88,0x86,0x0,0x8c,0xc2,0x0,0xc,0x60,
-0x0,0x8,0x20,0x0,0x30,0x30,0x0,0x8,0x10,0x0,0x8c,0x18,0x0,0x4c,0xc,0x0,
-0x38,0x4,0x0,
-};
-
-static const BitmapCharRec ch190 = {17,17,0,0,18,ch190data};
-
-/* char: 0xbd */
-
-static const GLubyte ch189data[] = {
-0x30,0x7e,0x10,0x22,0x18,0x10,0x8,0x18,0xc,0x8,0x6,0x4,0x2,0x6,0xfb,0x46,
-0x21,0x26,0x21,0x9c,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18,
-0x20,0x8,
-};
-
-static const BitmapCharRec ch189 = {15,17,-1,0,18,ch189data};
-
-/* char: 0xbc */
-
-static const GLubyte ch188data[] = {
-0x30,0x4,0x10,0x4,0x18,0xff,0x8,0x44,0xc,0x64,0x6,0x24,0x2,0x14,0xfb,0x1c,
-0x21,0xc,0x21,0x84,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18,
-0x20,0x8,
-};
-
-static const BitmapCharRec ch188 = {16,17,-1,0,18,ch188data};
-
-/* char: 0xbb */
-
-static const GLubyte ch187data[] = {
-0x88,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,0x19,0x80,0x19,0x80,0x33,0x0,0x66,0x0,
-0xcc,0x0,0x88,0x0,
-};
-
-static const BitmapCharRec ch187 = {9,10,-2,-1,12,ch187data};
-
-/* char: 0xba */
-
-static const GLubyte ch186data[] = {
-0xfc,0x0,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,
-};
-
-static const BitmapCharRec ch186 = {6,9,-1,-8,8,ch186data};
-
-/* char: 0xb9 */
-
-static const GLubyte ch185data[] = {
-0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20,
-};
-
-static const BitmapCharRec ch185 = {5,10,-1,-7,7,ch185data};
-
-/* char: 0xb8 */
-
-static const GLubyte ch184data[] = {
-0x78,0xcc,0xc,0x3c,0x30,0x10,
-};
-
-static const BitmapCharRec ch184 = {6,6,-1,6,8,ch184data};
-
-/* char: 0xb7 */
-
-static const GLubyte ch183data[] = {
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch183 = {2,2,-2,-6,6,ch183data};
-
-/* char: 0xb6 */
-
-static const GLubyte ch182data[] = {
-0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,
-0x9,0x0,0x9,0x0,0x9,0x0,0x19,0x0,0x39,0x0,0x79,0x0,0x79,0x0,0xf9,0x0,
-0xf9,0x0,0xf9,0x0,0x79,0x0,0x79,0x0,0x39,0x0,0x1f,0x80,
-};
-
-static const BitmapCharRec ch182 = {9,22,-1,5,11,ch182data};
-
-/* char: 0xb5 */
-
-static const GLubyte ch181data[] = {
-0x40,0x0,0xe0,0x0,0xc0,0x0,0x40,0x0,0x40,0x0,0x5c,0xe0,0x7e,0xc0,0x71,0xc0,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0xe1,0xc0,
-};
-
-static const BitmapCharRec ch181 = {11,17,-1,5,13,ch181data};
-
-/* char: 0xb4 */
-
-static const GLubyte ch180data[] = {
-0x80,0x60,0x38,0x18,
-};
-
-static const BitmapCharRec ch180 = {5,4,-2,-13,8,ch180data};
-
-/* char: 0xb3 */
-
-static const GLubyte ch179data[] = {
-0x70,0x88,0x8c,0xc,0x8,0x30,0x8,0x8c,0x4c,0x38,
-};
-
-static const BitmapCharRec ch179 = {6,10,0,-7,7,ch179data};
-
-/* char: 0xb2 */
-
-static const GLubyte ch178data[] = {
-0xfc,0x44,0x20,0x30,0x10,0x8,0xc,0x8c,0x4c,0x38,
-};
-
-static const BitmapCharRec ch178 = {6,10,0,-7,7,ch178data};
-
-/* char: 0xb1 */
-
-static const GLubyte ch177data[] = {
-0xff,0xf0,0xff,0xf0,0x0,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,
-0xff,0xf0,0xff,0xf0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch177 = {12,15,-1,0,14,ch177data};
-
-/* char: 0xb0 */
-
-static const GLubyte ch176data[] = {
-0x38,0x44,0x82,0x82,0x82,0x44,0x38,
-};
-
-static const BitmapCharRec ch176 = {7,7,-1,-10,9,ch176data};
-
-/* char: 0xaf */
-
-static const GLubyte ch175data[] = {
-0xfc,0xfc,
-};
-
-static const BitmapCharRec ch175 = {6,2,-1,-14,8,ch175data};
-
-/* char: 0xae */
-
-static const GLubyte ch174data[] = {
-0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x60,0x3,0x0,0x47,0x19,0x0,0xc2,
-0x31,0x80,0x82,0x20,0x80,0x82,0x40,0x80,0x83,0xe0,0x80,0x82,0x30,0x80,0x82,0x10,
-0x80,0xc2,0x11,0x80,0x42,0x31,0x0,0x67,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0,
-0x7,0xf0,0x0,
-};
-
-static const BitmapCharRec ch174 = {17,17,-1,0,19,ch174data};
-
-/* char: 0xad */
-
-static const GLubyte ch173data[] = {
-0xfe,0xfe,
-};
-
-static const BitmapCharRec ch173 = {7,2,-1,-5,9,ch173data};
-
-/* char: 0xac */
-
-static const GLubyte ch172data[] = {
-0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0xff,0xf0,0xff,0xf0,
-};
-
-static const BitmapCharRec ch172 = {12,7,-1,-3,14,ch172data};
-
-/* char: 0xab */
-
-static const GLubyte ch171data[] = {
-0x8,0x80,0x19,0x80,0x33,0x0,0x66,0x0,0xcc,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,
-0x19,0x80,0x8,0x80,
-};
-
-static const BitmapCharRec ch171 = {9,10,-2,-1,13,ch171data};
-
-/* char: 0xaa */
-
-static const GLubyte ch170data[] = {
-0x7e,0x0,0x76,0xcc,0xcc,0x7c,0xc,0xcc,0x78,
-};
-
-static const BitmapCharRec ch170 = {7,9,0,-8,8,ch170data};
-
-/* char: 0xa9 */
-
-static const GLubyte ch169data[] = {
-0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x61,0xc3,0x0,0x47,0x71,0x0,0xc4,
-0x19,0x80,0x8c,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x8c,0x0,
-0x80,0xc4,0x19,0x80,0x47,0x31,0x0,0x61,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0,
-0x7,0xf0,0x0,
-};
-
-static const BitmapCharRec ch169 = {17,17,-1,0,19,ch169data};
-
-/* char: 0xa8 */
-
-static const GLubyte ch168data[] = {
-0xcc,0xcc,
-};
-
-static const BitmapCharRec ch168 = {6,2,-1,-14,8,ch168data};
-
-/* char: 0xa7 */
-
-static const GLubyte ch167data[] = {
-0x38,0x64,0x62,0x6,0xe,0x1c,0x38,0x74,0xe2,0xc3,0x83,0x87,0x4e,0x3c,0x38,0x70,
-0x60,0x46,0x26,0x1c,
-};
-
-static const BitmapCharRec ch167 = {8,20,-2,2,12,ch167data};
-
-/* char: 0xa6 */
-
-static const GLubyte ch166data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,
-};
-
-static const BitmapCharRec ch166 = {2,17,-2,0,6,ch166data};
-
-/* char: 0xa5 */
-
-static const GLubyte ch165data[] = {
-0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x1f,0xe0,0x3,0x0,0x1f,0xe0,
-0x3,0x0,0x7,0x80,0xc,0x80,0xc,0xc0,0x18,0x40,0x18,0x60,0x30,0x20,0x70,0x30,
-0xf8,0x7c,
-};
-
-static const BitmapCharRec ch165 = {14,17,0,0,14,ch165data};
-
-/* char: 0xa4 */
-
-static const GLubyte ch164data[] = {
-0xc0,0x60,0xee,0xe0,0x7f,0xc0,0x31,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x31,0x80,0x7f,0xc0,0xee,0xe0,0xc0,0x60,
-};
-
-static const BitmapCharRec ch164 = {11,12,-1,-3,13,ch164data};
-
-/* char: 0xa3 */
-
-static const GLubyte ch163data[] = {
-0xe7,0x80,0xbe,0xc0,0x78,0x40,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,
-0x30,0x0,0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x31,0x80,0x19,0x80,
-0xf,0x0,
-};
-
-static const BitmapCharRec ch163 = {10,17,-1,0,12,ch163data};
-
-/* char: 0xa2 */
-
-static const GLubyte ch162data[] = {
-0x40,0x0,0x40,0x0,0x3e,0x0,0x7f,0x0,0x70,0x80,0xd0,0x0,0xc8,0x0,0xc8,0x0,
-0xc8,0x0,0xc4,0x0,0xc4,0x0,0x43,0x80,0x63,0x80,0x1f,0x0,0x1,0x0,0x1,0x0,
-};
-
-static const BitmapCharRec ch162 = {9,16,-1,2,12,ch162data};
-
-/* char: 0xa1 */
-
-static const GLubyte ch161data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,
-0xc0,
-};
-
-static const BitmapCharRec ch161 = {2,17,-4,5,8,ch161data};
-
-/* char: 0xa0 */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch160data[] = { 0x0 };
-static const BitmapCharRec ch160 = {1,1,0,0,6,ch160data};
-#else
-static const BitmapCharRec ch160 = {0,0,0,0,6,0};
-#endif
-
-/* char: 0x7e '~' */
-
-static const GLubyte ch126data[] = {
-0x83,0x80,0xc7,0xc0,0x7c,0x60,0x38,0x20,
-};
-
-static const BitmapCharRec ch126 = {11,4,-1,-5,13,ch126data};
-
-/* char: 0x7d '}' */
-
-static const GLubyte ch125data[] = {
-0xe0,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x8,0xc,0x4,0x3,0x4,0xc,0x8,0x18,
-0x18,0x18,0x18,0x18,0x30,0xe0,
-};
-
-static const BitmapCharRec ch125 = {8,22,-1,5,10,ch125data};
-
-/* char: 0x7c '|' */
-
-static const GLubyte ch124data[] = {
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,
-};
-
-static const BitmapCharRec ch124 = {2,17,-2,0,6,ch124data};
-
-/* char: 0x7b '{' */
-
-static const GLubyte ch123data[] = {
-0x7,0xc,0x18,0x18,0x18,0x18,0x18,0x18,0x10,0x30,0x20,0xc0,0x20,0x30,0x10,0x18,
-0x18,0x18,0x18,0x18,0xc,0x7,
-};
-
-static const BitmapCharRec ch123 = {8,22,-1,5,10,ch123data};
-
-/* char: 0x7a 'z' */
-
-static const GLubyte ch122data[] = {
-0xff,0xc3,0x61,0x70,0x30,0x38,0x18,0x1c,0xe,0x86,0xc3,0xff,
-};
-
-static const BitmapCharRec ch122 = {8,12,-1,0,10,ch122data};
-
-/* char: 0x79 'y' */
-
-static const GLubyte ch121data[] = {
-0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0,
-0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0,
-0xf1,0xe0,
-};
-
-static const BitmapCharRec ch121 = {11,17,0,5,11,ch121data};
-
-/* char: 0x78 'x' */
-
-static const GLubyte ch120data[] = {
-0xf1,0xe0,0x60,0xc0,0x21,0x80,0x33,0x80,0x1b,0x0,0xe,0x0,0xc,0x0,0x1a,0x0,
-0x39,0x0,0x31,0x80,0x60,0xc0,0xf1,0xe0,
-};
-
-static const BitmapCharRec ch120 = {11,12,-1,0,13,ch120data};
-
-/* char: 0x77 'w' */
-
-static const GLubyte ch119data[] = {
-0x4,0x10,0x0,0xe,0x38,0x0,0xe,0x38,0x0,0x1a,0x28,0x0,0x1a,0x64,0x0,0x19,
-0x64,0x0,0x31,0x64,0x0,0x30,0xc2,0x0,0x30,0xc2,0x0,0x60,0xc2,0x0,0x60,0xc3,
-0x0,0xf1,0xe7,0x80,
-};
-
-static const BitmapCharRec ch119 = {17,12,0,0,17,ch119data};
-
-/* char: 0x76 'v' */
-
-static const GLubyte ch118data[] = {
-0x4,0x0,0xe,0x0,0xe,0x0,0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,
-0x30,0x80,0x60,0x80,0x60,0xc0,0xf1,0xe0,
-};
-
-static const BitmapCharRec ch118 = {11,12,0,0,11,ch118data};
-
-/* char: 0x75 'u' */
-
-static const GLubyte ch117data[] = {
-0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,
-};
-
-static const BitmapCharRec ch117 = {11,12,-1,0,13,ch117data};
-
-/* char: 0x74 't' */
-
-static const GLubyte ch116data[] = {
-0x1c,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x70,0x30,0x10,
-};
-
-static const BitmapCharRec ch116 = {7,15,0,0,7,ch116data};
-
-/* char: 0x73 's' */
-
-static const GLubyte ch115data[] = {
-0xf8,0xc6,0x83,0x3,0x7,0x1e,0x7c,0x70,0xe0,0xc2,0x66,0x3e,
-};
-
-static const BitmapCharRec ch115 = {8,12,-1,0,10,ch115data};
-
-/* char: 0x72 'r' */
-
-static const GLubyte ch114data[] = {
-0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x76,0x6e,0xe6,
-};
-
-static const BitmapCharRec ch114 = {7,12,-1,0,8,ch114data};
-
-/* char: 0x71 'q' */
-
-static const GLubyte ch113data[] = {
-0x3,0xc0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1d,0x80,0x73,0x80,0x61,0x80,
-0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x73,0x80,
-0x1d,0x80,
-};
-
-static const BitmapCharRec ch113 = {10,17,-1,5,12,ch113data};
-
-/* char: 0x70 'p' */
-
-static const GLubyte ch112data[] = {
-0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80,
-0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80,
-0xee,0x0,
-};
-
-static const BitmapCharRec ch112 = {10,17,-1,5,12,ch112data};
-
-/* char: 0x6f 'o' */
-
-static const GLubyte ch111data[] = {
-0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,
-};
-
-static const BitmapCharRec ch111 = {10,12,-1,0,12,ch111data};
-
-/* char: 0x6e 'n' */
-
-static const GLubyte ch110data[] = {
-0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,
-};
-
-static const BitmapCharRec ch110 = {11,12,-1,0,13,ch110data};
-
-/* char: 0x6d 'm' */
-
-static const GLubyte ch109data[] = {
-0xf1,0xe3,0xc0,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,
-0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x71,0xe3,0x80,0x6f,0x9f,
-0x0,0xe7,0xe,0x0,
-};
-
-static const BitmapCharRec ch109 = {18,12,-1,0,20,ch109data};
-
-/* char: 0x6c 'l' */
-
-static const GLubyte ch108data[] = {
-0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
-0xe0,
-};
-
-static const BitmapCharRec ch108 = {4,17,-1,0,6,ch108data};
-
-/* char: 0x6b 'k' */
-
-static const GLubyte ch107data[] = {
-0xf3,0xe0,0x61,0xc0,0x63,0x80,0x67,0x0,0x6e,0x0,0x6c,0x0,0x78,0x0,0x68,0x0,
-0x64,0x0,0x66,0x0,0x63,0x0,0x67,0xc0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,
-0xe0,0x0,
-};
-
-static const BitmapCharRec ch107 = {11,17,-1,0,12,ch107data};
-
-/* char: 0x6a 'j' */
-
-static const GLubyte ch106data[] = {
-0xc0,0xe0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
-0x70,0x0,0x0,0x0,0x30,0x30,
-};
-
-static const BitmapCharRec ch106 = {4,22,0,5,6,ch106data};
-
-/* char: 0x69 'i' */
-
-static const GLubyte ch105data[] = {
-0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x0,0x0,0x60,
-0x60,
-};
-
-static const BitmapCharRec ch105 = {4,17,-1,0,6,ch105data};
-
-/* char: 0x68 'h' */
-
-static const GLubyte ch104data[] = {
-0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x71,0xc0,0x6f,0x80,0x67,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,
-0xe0,0x0,
-};
-
-static const BitmapCharRec ch104 = {11,17,-1,0,13,ch104data};
-
-/* char: 0x67 'g' */
-
-static const GLubyte ch103data[] = {
-0x3f,0x0,0xf1,0xc0,0xc0,0x60,0xc0,0x20,0x60,0x60,0x3f,0xc0,0x7f,0x0,0x60,0x0,
-0x30,0x0,0x3e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0,
-0x1f,0xc0,
-};
-
-static const BitmapCharRec ch103 = {11,17,-1,5,12,ch103data};
-
-/* char: 0x66 'f' */
-
-static const GLubyte ch102data[] = {
-0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x30,0x30,0x30,0x16,
-0xe,
-};
-
-static const BitmapCharRec ch102 = {7,17,0,0,7,ch102data};
-
-/* char: 0x65 'e' */
-
-static const GLubyte ch101data[] = {
-0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,
-0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,
-};
-
-static const BitmapCharRec ch101 = {9,12,-1,0,11,ch101data};
-
-/* char: 0x64 'd' */
-
-static const GLubyte ch100data[] = {
-0x1e,0xc0,0x73,0x80,0x61,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,
-0xc1,0x80,0x61,0x80,0x73,0x80,0x1d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,
-0x3,0x80,
-};
-
-static const BitmapCharRec ch100 = {10,17,-1,0,12,ch100data};
-
-/* char: 0x63 'c' */
-
-static const GLubyte ch99data[] = {
-0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,
-0xc0,0x0,0x41,0x80,0x63,0x80,0x1f,0x0,
-};
-
-static const BitmapCharRec ch99 = {9,12,-1,0,11,ch99data};
-
-/* char: 0x62 'b' */
-
-static const GLubyte ch98data[] = {
-0x5e,0x0,0x73,0x80,0x61,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,
-0x60,0xc0,0x61,0x80,0x73,0x80,0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,
-0xe0,0x0,
-};
-
-static const BitmapCharRec ch98 = {10,17,-1,0,12,ch98data};
-
-/* char: 0x61 'a' */
-
-static const GLubyte ch97data[] = {
-0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0,
-0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,
-};
-
-static const BitmapCharRec ch97 = {9,12,-1,0,11,ch97data};
-
-/* char: 0x60 '`' */
-
-static const GLubyte ch96data[] = {
-0x60,0xe0,0x80,0xc0,0x60,
-};
-
-static const BitmapCharRec ch96 = {3,5,-2,-12,7,ch96data};
-
-/* char: 0x5f '_' */
-
-static const GLubyte ch95data[] = {
-0xff,0xf8,0xff,0xf8,
-};
-
-static const BitmapCharRec ch95 = {13,2,0,5,13,ch95data};
-
-/* char: 0x5e '^' */
-
-static const GLubyte ch94data[] = {
-0x80,0x80,0xc1,0x80,0x41,0x0,0x63,0x0,0x22,0x0,0x36,0x0,0x14,0x0,0x1c,0x0,
-0x8,0x0,
-};
-
-static const BitmapCharRec ch94 = {9,9,-1,-8,11,ch94data};
-
-/* char: 0x5d ']' */
-
-static const GLubyte ch93data[] = {
-0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0xf8,
-};
-
-static const BitmapCharRec ch93 = {5,21,-1,4,8,ch93data};
-
-/* char: 0x5c '\' */
-
-static const GLubyte ch92data[] = {
-0x6,0x6,0x4,0xc,0xc,0x8,0x18,0x18,0x10,0x30,0x30,0x20,0x60,0x60,0x40,0xc0,
-0xc0,
-};
-
-static const BitmapCharRec ch92 = {7,17,0,0,7,ch92data};
-
-/* char: 0x5b '[' */
-
-static const GLubyte ch91data[] = {
-0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0xc0,0xc0,0xf8,
-};
-
-static const BitmapCharRec ch91 = {5,21,-2,4,8,ch91data};
-
-/* char: 0x5a 'Z' */
-
-static const GLubyte ch90data[] = {
-0xff,0xf8,0xe0,0x18,0x70,0x8,0x30,0x8,0x38,0x0,0x18,0x0,0x1c,0x0,0xe,0x0,
-0x6,0x0,0x7,0x0,0x3,0x0,0x3,0x80,0x1,0xc0,0x80,0xc0,0x80,0xe0,0xc0,0x70,
-0xff,0xf0,
-};
-
-static const BitmapCharRec ch90 = {13,17,-1,0,15,ch90data};
-
-/* char: 0x59 'Y' */
-
-static const GLubyte ch89data[] = {
-0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0,
-0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc,
-0xfc,0x3f,
-};
-
-static const BitmapCharRec ch89 = {16,17,0,0,16,ch89data};
-
-/* char: 0x58 'X' */
-
-static const GLubyte ch88data[] = {
-0xfc,0xf,0xc0,0x30,0x3,0x80,0x18,0x7,0x0,0x8,0xe,0x0,0x4,0xc,0x0,0x6,
-0x18,0x0,0x2,0x38,0x0,0x1,0x70,0x0,0x0,0xe0,0x0,0x0,0xc0,0x0,0x1,0xc0,
-0x0,0x3,0xa0,0x0,0x3,0x10,0x0,0x6,0x8,0x0,0xe,0xc,0x0,0x1c,0x6,0x0,
-0x7e,0xf,0x80,
-};
-
-static const BitmapCharRec ch88 = {18,17,0,0,18,ch88data};
-
-/* char: 0x57 'W' */
-
-static const GLubyte ch87data[] = {
-0x1,0x83,0x0,0x1,0x83,0x0,0x1,0x83,0x80,0x3,0x87,0x80,0x3,0x46,0x80,0x3,
-0x46,0xc0,0x6,0x46,0x40,0x6,0x4c,0x40,0x6,0x4c,0x60,0xc,0x2c,0x60,0xc,0x2c,
-0x20,0x18,0x2c,0x20,0x18,0x18,0x30,0x18,0x18,0x10,0x30,0x18,0x10,0x30,0x18,0x18,
-0xfc,0x7e,0x7e,
-};
-
-static const BitmapCharRec ch87 = {23,17,0,0,23,ch87data};
-
-/* char: 0x56 'V' */
-
-static const GLubyte ch86data[] = {
-0x1,0x80,0x0,0x1,0x80,0x0,0x1,0x80,0x0,0x3,0xc0,0x0,0x3,0x40,0x0,0x3,
-0x60,0x0,0x6,0x20,0x0,0x6,0x20,0x0,0x6,0x30,0x0,0xc,0x10,0x0,0xc,0x18,
-0x0,0x18,0x8,0x0,0x18,0x8,0x0,0x18,0xc,0x0,0x30,0x4,0x0,0x30,0x6,0x0,
-0xfc,0x1f,0x80,
-};
-
-static const BitmapCharRec ch86 = {17,17,0,0,17,ch86data};
-
-/* char: 0x55 'U' */
-
-static const GLubyte ch85data[] = {
-0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,
-0xfc,0x1f,
-};
-
-static const BitmapCharRec ch85 = {16,17,-1,0,18,ch85data};
-
-/* char: 0x54 'T' */
-
-static const GLubyte ch84data[] = {
-0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,
-0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x83,0x4,0x83,0x4,0xc3,0xc,
-0xff,0xfc,
-};
-
-static const BitmapCharRec ch84 = {14,17,-1,0,16,ch84data};
-
-/* char: 0x53 'S' */
-
-static const GLubyte ch83data[] = {
-0x9e,0x0,0xf1,0x80,0xc0,0xc0,0x80,0x60,0x80,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,
-0xf,0x80,0x1e,0x0,0x78,0x0,0xe0,0x0,0xc0,0x40,0xc0,0x40,0xc0,0xc0,0x63,0xc0,
-0x1e,0x40,
-};
-
-static const BitmapCharRec ch83 = {11,17,-1,0,13,ch83data};
-
-/* char: 0x52 'R' */
-
-static const GLubyte ch82data[] = {
-0xfc,0x1e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x60,0x30,0xc0,0x31,0xc0,0x33,0x80,
-0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x38,0x30,0x18,0x30,0x38,0x30,0x30,0x30,0x70,
-0xff,0xc0,
-};
-
-static const BitmapCharRec ch82 = {15,17,-1,0,16,ch82data};
-
-/* char: 0x51 'Q' */
-
-static const GLubyte ch81data[] = {
-0x0,0xf,0x0,0x38,0x0,0x70,0x0,0xe0,0x1,0xc0,0x7,0xe0,0x1c,0x38,0x38,0x1c,
-0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,
-0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,0x7,0xe0,
-};
-
-static const BitmapCharRec ch81 = {16,22,-1,5,18,ch81data};
-
-/* char: 0x50 'P' */
-
-static const GLubyte ch80data[] = {
-0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,
-0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,
-0xff,0xc0,
-};
-
-static const BitmapCharRec ch80 = {13,17,-1,0,15,ch80data};
-
-/* char: 0x4f 'O' */
-
-static const GLubyte ch79data[] = {
-0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,
-0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,
-0x7,0xe0,
-};
-
-static const BitmapCharRec ch79 = {16,17,-1,0,18,ch79data};
-
-/* char: 0x4e 'N' */
-
-static const GLubyte ch78data[] = {
-0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84,
-0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4,
-0xf0,0x1f,
-};
-
-static const BitmapCharRec ch78 = {16,17,-1,0,18,ch78data};
-
-/* char: 0x4d 'M' */
-
-static const GLubyte ch77data[] = {
-0xf8,0x21,0xf8,0x20,0x60,0x60,0x20,0x60,0x60,0x20,0xd0,0x60,0x20,0xd0,0x60,0x21,
-0x88,0x60,0x21,0x88,0x60,0x23,0x8,0x60,0x23,0x4,0x60,0x26,0x4,0x60,0x26,0x2,
-0x60,0x2c,0x2,0x60,0x2c,0x2,0x60,0x38,0x1,0x60,0x38,0x1,0x60,0x30,0x0,0xe0,
-0xf0,0x0,0xf8,
-};
-
-static const BitmapCharRec ch77 = {21,17,-1,0,22,ch77data};
-
-/* char: 0x4c 'L' */
-
-static const GLubyte ch76data[] = {
-0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,
-0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,
-0xfc,0x0,
-};
-
-static const BitmapCharRec ch76 = {13,17,-1,0,14,ch76data};
-
-/* char: 0x4b 'K' */
-
-static const GLubyte ch75data[] = {
-0xfc,0x1f,0x30,0xe,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0xe0,0x31,0xc0,0x33,0x80,
-0x3f,0x0,0x3e,0x0,0x33,0x0,0x31,0x80,0x30,0xc0,0x30,0x60,0x30,0x30,0x30,0x18,
-0xfc,0x7e,
-};
-
-static const BitmapCharRec ch75 = {16,17,-1,0,17,ch75data};
-
-/* char: 0x4a 'J' */
-
-static const GLubyte ch74data[] = {
-0x78,0x0,0xcc,0x0,0xc6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,
-0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,
-0x1f,0x80,
-};
-
-static const BitmapCharRec ch74 = {9,17,-1,0,11,ch74data};
-
-/* char: 0x49 'I' */
-
-static const GLubyte ch73data[] = {
-0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
-0xfc,
-};
-
-static const BitmapCharRec ch73 = {6,17,-1,0,8,ch73data};
-
-/* char: 0x48 'H' */
-
-static const GLubyte ch72data[] = {
-0xfc,0x1f,0x80,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,
-0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x3f,0xfe,0x0,0x30,0x6,0x0,0x30,0x6,
-0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,
-0xfc,0x1f,0x80,
-};
-
-static const BitmapCharRec ch72 = {17,17,-1,0,19,ch72data};
-
-/* char: 0x47 'G' */
-
-static const GLubyte ch71data[] = {
-0x7,0xe0,0x1e,0x38,0x38,0x1c,0x60,0xc,0x60,0xc,0xc0,0xc,0xc0,0xc,0xc0,0x3f,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,
-0x7,0xe4,
-};
-
-static const BitmapCharRec ch71 = {16,17,-1,0,18,ch71data};
-
-/* char: 0x46 'F' */
-
-static const GLubyte ch70data[] = {
-0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x20,0x30,0x20,
-0x3f,0xe0,0x30,0x20,0x30,0x20,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30,
-0xff,0xf0,
-};
-
-static const BitmapCharRec ch70 = {12,17,-1,0,14,ch70data};
-
-/* char: 0x45 'E' */
-
-static const GLubyte ch69data[] = {
-0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40,
-0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30,
-0xff,0xf0,
-};
-
-static const BitmapCharRec ch69 = {13,17,-1,0,15,ch69data};
-
-/* char: 0x44 'D' */
-
-static const GLubyte ch68data[] = {
-0xff,0xc0,0x30,0x70,0x30,0x38,0x30,0xc,0x30,0xc,0x30,0x6,0x30,0x6,0x30,0x6,
-0x30,0x6,0x30,0x6,0x30,0x6,0x30,0x6,0x30,0xc,0x30,0xc,0x30,0x38,0x30,0x70,
-0xff,0xc0,
-};
-
-static const BitmapCharRec ch68 = {15,17,-1,0,17,ch68data};
-
-/* char: 0x43 'C' */
-
-static const GLubyte ch67data[] = {
-0x7,0xe0,0x1e,0x38,0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,
-0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,
-0x7,0xe4,
-};
-
-static const BitmapCharRec ch67 = {14,17,-1,0,16,ch67data};
-
-/* char: 0x42 'B' */
-
-static const GLubyte ch66data[] = {
-0xff,0xe0,0x30,0x78,0x30,0x18,0x30,0xc,0x30,0xc,0x30,0xc,0x30,0x18,0x30,0x38,
-0x3f,0xe0,0x30,0x40,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,
-0xff,0xc0,
-};
-
-static const BitmapCharRec ch66 = {14,17,-1,0,16,ch66data};
-
-/* char: 0x41 'A' */
-
-static const GLubyte ch65data[] = {
-0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8,
-0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30,
-0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0,
-0x0,0x80,0x0,
-};
-
-static const BitmapCharRec ch65 = {17,17,0,0,17,ch65data};
-
-/* char: 0x40 '@' */
-
-static const GLubyte ch64data[] = {
-0x3,0xf0,0x0,0xe,0xc,0x0,0x18,0x0,0x0,0x30,0x0,0x0,0x61,0xde,0x0,0x63,
-0x7b,0x0,0xc6,0x39,0x80,0xc6,0x18,0x80,0xc6,0x18,0xc0,0xc6,0x18,0x40,0xc6,0xc,
-0x40,0xc3,0xc,0x40,0xc3,0x8c,0x40,0xe1,0xfc,0x40,0x60,0xec,0xc0,0x70,0x0,0x80,
-0x38,0x1,0x80,0x1c,0x3,0x0,0xf,0xe,0x0,0x3,0xf8,0x0,
-};
-
-static const BitmapCharRec ch64 = {18,20,-2,3,22,ch64data};
-
-/* char: 0x3f '?' */
-
-static const GLubyte ch63data[] = {
-0x30,0x30,0x0,0x0,0x10,0x10,0x10,0x18,0x18,0xc,0xe,0x7,0xc3,0xc3,0x83,0xc6,
-0x7c,
-};
-
-static const BitmapCharRec ch63 = {8,17,-2,0,11,ch63data};
-
-/* char: 0x3e '>' */
-
-static const GLubyte ch62data[] = {
-0xc0,0x0,0x70,0x0,0x1c,0x0,0x7,0x0,0x1,0xc0,0x0,0x60,0x1,0xc0,0x7,0x0,
-0x1c,0x0,0x70,0x0,0xc0,0x0,
-};
-
-static const BitmapCharRec ch62 = {11,11,-1,-1,13,ch62data};
-
-/* char: 0x3d '=' */
-
-static const GLubyte ch61data[] = {
-0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,
-};
-
-static const BitmapCharRec ch61 = {12,6,-1,-4,14,ch61data};
-
-/* char: 0x3c '<' */
-
-static const GLubyte ch60data[] = {
-0x0,0x60,0x1,0xc0,0x7,0x0,0x1c,0x0,0x70,0x0,0xc0,0x0,0x70,0x0,0x1c,0x0,
-0x7,0x0,0x1,0xc0,0x0,0x60,
-};
-
-static const BitmapCharRec ch60 = {11,11,-1,-1,13,ch60data};
-
-/* char: 0x3b ';' */
-
-static const GLubyte ch59data[] = {
-0xc0,0x60,0x20,0xe0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch59 = {3,14,-2,3,7,ch59data};
-
-/* char: 0x3a ':' */
-
-static const GLubyte ch58data[] = {
-0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0,
-};
-
-static const BitmapCharRec ch58 = {2,11,-2,0,6,ch58data};
-
-/* char: 0x39 '9' */
-
-static const GLubyte ch57data[] = {
-0xf0,0x0,0x1c,0x0,0x6,0x0,0x3,0x0,0x3,0x80,0x1,0x80,0x1d,0x80,0x73,0xc0,
-0x61,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0x61,0x80,0x77,0x80,
-0x1e,0x0,
-};
-
-static const BitmapCharRec ch57 = {10,17,-1,0,12,ch57data};
-
-/* char: 0x38 '8' */
-
-static const GLubyte ch56data[] = {
-0x1e,0x0,0x73,0x80,0xe1,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x41,0xc0,0x61,0x80,
-0x37,0x0,0x1e,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0,
-0x1e,0x0,
-};
-
-static const BitmapCharRec ch56 = {10,17,-1,0,12,ch56data};
-
-/* char: 0x37 '7' */
-
-static const GLubyte ch55data[] = {
-0x18,0x0,0x18,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0x4,0x0,0x6,0x0,0x6,0x0,
-0x2,0x0,0x3,0x0,0x3,0x0,0x1,0x0,0x1,0x80,0x81,0x80,0xc0,0xc0,0xff,0xc0,
-0x7f,0xc0,
-};
-
-static const BitmapCharRec ch55 = {10,17,-1,0,12,ch55data};
-
-/* char: 0x36 '6' */
-
-static const GLubyte ch54data[] = {
-0x1e,0x0,0x7b,0x80,0x61,0x80,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc1,0x80,0xf3,0x80,0xee,0x0,0x60,0x0,0x70,0x0,0x30,0x0,0x18,0x0,0xe,0x0,
-0x3,0xc0,
-};
-
-static const BitmapCharRec ch54 = {10,17,-1,0,12,ch54data};
-
-/* char: 0x35 '5' */
-
-static const GLubyte ch53data[] = {
-0x7e,0x0,0xe3,0x80,0xc1,0x80,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x1,0xc0,
-0x3,0x80,0xf,0x80,0x7e,0x0,0x78,0x0,0x60,0x0,0x20,0x0,0x20,0x0,0x1f,0x80,
-0x1f,0xc0,
-};
-
-static const BitmapCharRec ch53 = {10,17,-1,0,12,ch53data};
-
-/* char: 0x34 '4' */
-
-static const GLubyte ch52data[] = {
-0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0xff,0xc0,0xff,0xc0,0xc3,0x0,0x43,0x0,
-0x63,0x0,0x23,0x0,0x33,0x0,0x13,0x0,0x1b,0x0,0xb,0x0,0x7,0x0,0x7,0x0,
-0x3,0x0,
-};
-
-static const BitmapCharRec ch52 = {10,17,-1,0,12,ch52data};
-
-/* char: 0x33 '3' */
-
-static const GLubyte ch51data[] = {
-0x78,0x0,0xe6,0x0,0xc3,0x0,0x1,0x0,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0x80,
-0x7,0x0,0x1e,0x0,0xc,0x0,0x6,0x0,0x83,0x0,0x83,0x0,0x47,0x0,0x7e,0x0,
-0x1c,0x0,
-};
-
-static const BitmapCharRec ch51 = {9,17,-1,0,12,ch51data};
-
-/* char: 0x32 '2' */
-
-static const GLubyte ch50data[] = {
-0xff,0x80,0xff,0xc0,0x60,0x40,0x30,0x0,0x18,0x0,0xc,0x0,0x4,0x0,0x6,0x0,
-0x3,0x0,0x3,0x0,0x1,0x80,0x1,0x80,0x81,0x80,0x81,0x80,0x43,0x80,0x7f,0x0,
-0x1c,0x0,
-};
-
-static const BitmapCharRec ch50 = {10,17,-1,0,12,ch50data};
-
-/* char: 0x31 '1' */
-
-static const GLubyte ch49data[] = {
-0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x18,
-0x8,
-};
-
-static const BitmapCharRec ch49 = {8,17,-2,0,12,ch49data};
-
-/* char: 0x30 '0' */
-
-static const GLubyte ch48data[] = {
-0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0xe1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x61,0x80,0x61,0x80,0x33,0x0,
-0x1e,0x0,
-};
-
-static const BitmapCharRec ch48 = {10,17,-1,0,12,ch48data};
-
-/* char: 0x2f '/' */
-
-static const GLubyte ch47data[] = {
-0xc0,0xc0,0xc0,0x60,0x60,0x20,0x30,0x30,0x10,0x18,0x18,0x8,0xc,0xc,0x4,0x6,
-0x6,0x3,0x3,0x3,
-};
-
-static const BitmapCharRec ch47 = {8,20,1,3,7,ch47data};
-
-/* char: 0x2e '.' */
-
-static const GLubyte ch46data[] = {
-0xc0,0xc0,
-};
-
-static const BitmapCharRec ch46 = {2,2,-2,0,6,ch46data};
-
-/* char: 0x2d '-' */
-
-static const GLubyte ch45data[] = {
-0xff,0xf0,0xff,0xf0,
-};
-
-static const BitmapCharRec ch45 = {12,2,-1,-6,14,ch45data};
-
-/* char: 0x2c ',' */
-
-static const GLubyte ch44data[] = {
-0xc0,0x60,0x20,0xe0,0xc0,
-};
-
-static const BitmapCharRec ch44 = {3,5,-2,3,7,ch44data};
-
-/* char: 0x2b '+' */
-
-static const GLubyte ch43data[] = {
-0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xff,0xf0,0xff,0xf0,0x6,0x0,
-0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,
-};
-
-static const BitmapCharRec ch43 = {12,12,-1,-1,14,ch43data};
-
-/* char: 0x2a '*' */
-
-static const GLubyte ch42data[] = {
-0x8,0x0,0x1c,0x0,0xc9,0x80,0xeb,0x80,0x1c,0x0,0xeb,0x80,0xc9,0x80,0x1c,0x0,
-0x8,0x0,
-};
-
-static const BitmapCharRec ch42 = {9,9,-2,-8,12,ch42data};
-
-/* char: 0x29 ')' */
-
-static const GLubyte ch41data[] = {
-0x80,0x40,0x20,0x30,0x10,0x18,0x18,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x18,
-0x18,0x10,0x30,0x20,0x40,0x80,
-};
-
-static const BitmapCharRec ch41 = {6,22,-1,5,8,ch41data};
-
-/* char: 0x28 '(' */
-
-static const GLubyte ch40data[] = {
-0x4,0x8,0x10,0x30,0x20,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,
-0x60,0x20,0x30,0x10,0x8,0x4,
-};
-
-static const BitmapCharRec ch40 = {6,22,-1,5,8,ch40data};
-
-/* char: 0x27 ''' */
-
-static const GLubyte ch39data[] = {
-0xc0,0x60,0x20,0xe0,0xc0,
-};
-
-static const BitmapCharRec ch39 = {3,5,-3,-12,8,ch39data};
-
-/* char: 0x26 '&' */
-
-static const GLubyte ch38data[] = {
-0x3c,0x3c,0x7f,0x7e,0xe1,0xe1,0xc0,0xc0,0xc1,0xc0,0xc1,0xa0,0x63,0x20,0x37,0x10,
-0x1e,0x18,0xe,0x3e,0xf,0x0,0x1d,0x80,0x18,0xc0,0x18,0x40,0x18,0x40,0xc,0xc0,
-0x7,0x80,
-};
-
-static const BitmapCharRec ch38 = {16,17,-1,0,18,ch38data};
-
-/* char: 0x25 '%' */
-
-static const GLubyte ch37data[] = {
-0x30,0x3c,0x0,0x18,0x72,0x0,0xc,0x61,0x0,0x4,0x60,0x80,0x6,0x60,0x80,0x3,
-0x30,0x80,0x1,0x19,0x80,0x1,0x8f,0x0,0x78,0xc0,0x0,0xe4,0x40,0x0,0xc2,0x60,
-0x0,0xc1,0x30,0x0,0xc1,0x10,0x0,0x61,0x18,0x0,0x33,0xfc,0x0,0x1e,0xc,0x0,
-};
-
-static const BitmapCharRec ch37 = {17,16,-1,0,19,ch37data};
-
-/* char: 0x24 '$' */
-
-static const GLubyte ch36data[] = {
-0x4,0x0,0x4,0x0,0x3f,0x0,0xe5,0xc0,0xc4,0xc0,0x84,0x60,0x84,0x60,0x4,0x60,
-0x4,0xe0,0x7,0xc0,0x7,0x80,0x1e,0x0,0x3c,0x0,0x74,0x0,0x64,0x0,0x64,0x20,
-0x64,0x60,0x34,0xe0,0x1f,0x80,0x4,0x0,0x4,0x0,
-};
-
-static const BitmapCharRec ch36 = {11,21,0,2,12,ch36data};
-
-/* char: 0x23 '#' */
-
-static const GLubyte ch35data[] = {
-0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0xff,0xc0,0xff,0xc0,0x11,0x0,
-0x11,0x0,0x11,0x0,0x7f,0xe0,0x7f,0xe0,0x8,0x80,0x8,0x80,0x8,0x80,0x8,0x80,
-0x8,0x80,
-};
-
-static const BitmapCharRec ch35 = {11,17,-1,0,13,ch35data};
-
-/* char: 0x22 '"' */
-
-static const GLubyte ch34data[] = {
-0x88,0xcc,0xcc,0xcc,0xcc,
-};
-
-static const BitmapCharRec ch34 = {6,5,-1,-12,10,ch34data};
-
-/* char: 0x21 '!' */
-
-static const GLubyte ch33data[] = {
-0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
-0xc0,
-};
-
-static const BitmapCharRec ch33 = {2,17,-3,0,8,ch33data};
-
-/* char: 0x20 ' ' */
-
-#ifdef _WIN32
-/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with
- a height or width of zero does not advance the raster position
- as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */
-static const GLubyte ch32data[] = { 0x0 };
-static const BitmapCharRec ch32 = {1,1,0,0,6,ch32data};
-#else
-static const BitmapCharRec ch32 = {0,0,0,0,6,0};
-#endif
-
-static const BitmapCharRec * const chars[] = {
-&ch32,
-&ch33,
-&ch34,
-&ch35,
-&ch36,
-&ch37,
-&ch38,
-&ch39,
-&ch40,
-&ch41,
-&ch42,
-&ch43,
-&ch44,
-&ch45,
-&ch46,
-&ch47,
-&ch48,
-&ch49,
-&ch50,
-&ch51,
-&ch52,
-&ch53,
-&ch54,
-&ch55,
-&ch56,
-&ch57,
-&ch58,
-&ch59,
-&ch60,
-&ch61,
-&ch62,
-&ch63,
-&ch64,
-&ch65,
-&ch66,
-&ch67,
-&ch68,
-&ch69,
-&ch70,
-&ch71,
-&ch72,
-&ch73,
-&ch74,
-&ch75,
-&ch76,
-&ch77,
-&ch78,
-&ch79,
-&ch80,
-&ch81,
-&ch82,
-&ch83,
-&ch84,
-&ch85,
-&ch86,
-&ch87,
-&ch88,
-&ch89,
-&ch90,
-&ch91,
-&ch92,
-&ch93,
-&ch94,
-&ch95,
-&ch96,
-&ch97,
-&ch98,
-&ch99,
-&ch100,
-&ch101,
-&ch102,
-&ch103,
-&ch104,
-&ch105,
-&ch106,
-&ch107,
-&ch108,
-&ch109,
-&ch110,
-&ch111,
-&ch112,
-&ch113,
-&ch114,
-&ch115,
-&ch116,
-&ch117,
-&ch118,
-&ch119,
-&ch120,
-&ch121,
-&ch122,
-&ch123,
-&ch124,
-&ch125,
-&ch126,
-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,
-&ch160,
-&ch161,
-&ch162,
-&ch163,
-&ch164,
-&ch165,
-&ch166,
-&ch167,
-&ch168,
-&ch169,
-&ch170,
-&ch171,
-&ch172,
-&ch173,
-&ch174,
-&ch175,
-&ch176,
-&ch177,
-&ch178,
-&ch179,
-&ch180,
-&ch181,
-&ch182,
-&ch183,
-&ch184,
-&ch185,
-&ch186,
-&ch187,
-&ch188,
-&ch189,
-&ch190,
-&ch191,
-&ch192,
-&ch193,
-&ch194,
-&ch195,
-&ch196,
-&ch197,
-&ch198,
-&ch199,
-&ch200,
-&ch201,
-&ch202,
-&ch203,
-&ch204,
-&ch205,
-&ch206,
-&ch207,
-&ch208,
-&ch209,
-&ch210,
-&ch211,
-&ch212,
-&ch213,
-&ch214,
-&ch215,
-&ch216,
-&ch217,
-&ch218,
-&ch219,
-&ch220,
-&ch221,
-&ch222,
-&ch223,
-&ch224,
-&ch225,
-&ch226,
-&ch227,
-&ch228,
-&ch229,
-&ch230,
-&ch231,
-&ch232,
-&ch233,
-&ch234,
-&ch235,
-&ch236,
-&ch237,
-&ch238,
-&ch239,
-&ch240,
-&ch241,
-&ch242,
-&ch243,
-&ch244,
-&ch245,
-&ch246,
-&ch247,
-&ch248,
-&ch249,
-&ch250,
-&ch251,
-&ch252,
-&ch253,
-&ch254,
-&ch255,
-};
-
-#if !defined(__IBMCPP__)
-const
-#endif
-BitmapFontRec glutBitmapTimesRoman24 = {
-"-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1",
-224,
-32,
-chars
-};
-
diff --git a/src/glut/os2/glut_util.cpp b/src/glut/os2/glut_util.cpp
deleted file mode 100644
index 76f25020aff..00000000000
--- a/src/glut/os2/glut_util.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/* 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 <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "glutint.h"
-
-#if !defined(__OS2__)
-
-/* strdup is actually not a standard ANSI C or POSIX routine
- so implement a private one for GLUT. OpenVMS does not have a
- strdup; Linux's standard libc doesn't declare strdup by default
- (unless BSD or SVID interfaces are requested). */
-char *
-__glutStrdup(const char *string)
-{
- char *copy;
-
- copy = (char*) malloc(strlen(string) + 1);
- if (copy == NULL)
- return NULL;
- strcpy(copy, string);
- return copy;
-}
-#endif
-
-void
-__glutWarning(char *format,...)
-{
- va_list args;
-
- va_start(args, format);
- fprintf(stderr, "GLUT: Warning in %s: ",
- __glutProgramName ? __glutProgramName : "(unamed)");
- vfprintf(stderr, format, args);
- va_end(args);
- putc('\n', stderr);
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutReportErrors(void)
-{
- GLenum error;
-
- while ((error = glGetError()) != GL_NO_ERROR)
- __glutWarning("GL error: %s", gluErrorString(error));
-}
-/* ENDCENTRY */
-
-void
-__glutFatalError(char *format,...)
-{
- va_list args;
-
- va_start(args, format);
- fprintf(stderr, "GLUT: Fatal Error in %s: ",
- __glutProgramName ? __glutProgramName : "(unamed)");
- vfprintf(stderr, format, args);
- va_end(args);
- putc('\n', stderr);
-/* || defined(__OS2__) */
-#if defined(_WIN32)
- if (__glutExitFunc) {
- __glutExitFunc(1);
- }
-#endif
- exit(1);
-}
-
-void
-__glutFatalUsage(char *format,...)
-{
- va_list args;
-
- va_start(args, format);
- fprintf(stderr, "GLUT: Fatal API Usage in %s: ",
- __glutProgramName ? __glutProgramName : "(unamed)");
- vfprintf(stderr, format, args);
- va_end(args);
- putc('\n', stderr);
- abort();
-}
diff --git a/src/glut/os2/glut_vidresize.cpp b/src/glut/os2/glut_vidresize.cpp
deleted file mode 100644
index f9d345dcf52..00000000000
--- a/src/glut/os2/glut_vidresize.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1996. */
-
-/* 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 <stdlib.h>
-
-#ifdef __sgi
-#include <dlfcn.h>
-#endif
-
-#include "glutint.h"
-
-/* Grumble. The IRIX 6.3 and early IRIX 6.4 OpenGL headers
- support the video resize extension, but failed to define
- GLX_SGIX_video_resize. */
-#if 0
-#ifdef GLX_SYNC_FRAME_SGIX
-#define GLX_SGIX_video_resize 1
-#endif
-#endif
-
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
-static int canVideoResize = -1;
-static int videoResizeChannel;
-#else
-static int canVideoResize = 0;
-#endif
-static int videoResizeInUse = 0;
-static int dx = -1, dy = -1, dw = -1, dh = -1;
-
-/* XXX Note that IRIX 6.2, 6.3, and some 6.4 versions have a
- bug where programs seg-fault when they attempt video
- resizing from an indirect OpenGL context (either local or
- over a network). */
-
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
-
-static volatile int errorCaught;
-
-/* ARGSUSED */
-static int
-catchXSGIvcErrors(Display * dpy, XErrorEvent * event)
-{
- errorCaught = 1;
- return 0;
-}
-#endif
-
-/* CENTRY */
-
-int GLUTAPIENTRY
-glutVideoResizeGet(GLenum param)
-{
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
- if (canVideoResize < 0) {
- canVideoResize = __glutIsSupportedByGLX("GLX_SGIX_video_resize");
- if (canVideoResize) {
-#if defined(__sgi) && __sgi
- /* This is a hack because IRIX 6.2, 6.3, and some 6.4
- versions were released with GLX_SGIX_video_resize
- being advertised by the X server though the video
- resize extension is not actually supported. We try to
- determine if the libGL.so we are using actually has a
- video resize entrypoint before we try to use the
- feature. */
- void (*func) (void);
- void *glxDso = dlopen("libGL.so", RTLD_LAZY);
-
- func = (void (*)(void)) dlsym(glxDso, "glXQueryChannelDeltasSGIX");
- if (!func) {
- canVideoResize = 0;
- } else
-#endif
- {
- char *channelString;
- int (*handler) (Display *, XErrorEvent *);
-
- channelString = getenv("GLUT_VIDEO_RESIZE_CHANNEL");
- videoResizeChannel = channelString ? atoi(channelString) : 0;
-
- /* Work around another annoying problem with SGI's
- GLX_SGIX_video_resize implementation. Early IRIX
- 6.4 OpenGL's advertise the extension and have the
- video resize API, but an XSGIvc X protocol errors
- result trying to use the API. Set up an error
- handler to intercept what would otherwise be a fatal
- error. If an error was recieved, do not report that
- video resize is possible. */
- handler = XSetErrorHandler(catchXSGIvcErrors);
-
- errorCaught = 0;
-
-#if defined(GLX_GLXEXT_PROTOTYPES)
-#endif
-
- __glut_glXQueryChannelDeltasSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, &dx, &dy, &dw, &dh);
-
- /* glXQueryChannelDeltasSGIX is an inherent X server
- round-trip so we know we will have gotten either the
- correct reply or and error by this time. */
- XSetErrorHandler(handler);
-
- /* Still yet another work around. In IRIX 6.4 betas,
- glXQueryChannelDeltasSGIX will return as if it
- succeeded, but the values are filled with junk.
- Watch to make sure the delta variables really make
- sense. */
- if (errorCaught ||
- dx < 0 || dy < 0 || dw < 0 || dh < 0 ||
- dx > 2048 || dy > 2048 || dw > 2048 || dh > 2048) {
- canVideoResize = 0;
- }
- }
- }
- }
-#endif /* GLX_SGIX_video_resize */
-
- switch (param) {
- case GLUT_VIDEO_RESIZE_POSSIBLE:
- return canVideoResize;
- case GLUT_VIDEO_RESIZE_IN_USE:
- return videoResizeInUse;
- case GLUT_VIDEO_RESIZE_X_DELTA:
- return dx;
- case GLUT_VIDEO_RESIZE_Y_DELTA:
- return dy;
- case GLUT_VIDEO_RESIZE_WIDTH_DELTA:
- return dw;
- case GLUT_VIDEO_RESIZE_HEIGHT_DELTA:
- return dh;
- case GLUT_VIDEO_RESIZE_X:
- case GLUT_VIDEO_RESIZE_Y:
- case GLUT_VIDEO_RESIZE_WIDTH:
- case GLUT_VIDEO_RESIZE_HEIGHT:
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
- if (videoResizeInUse) {
- int x, y, width, height;
-
- __glut_glXQueryChannelRectSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, &x, &y, &width, &height);
- switch (param) {
- case GLUT_VIDEO_RESIZE_X:
- return x;
- case GLUT_VIDEO_RESIZE_Y:
- return y;
- case GLUT_VIDEO_RESIZE_WIDTH:
- return width;
- case GLUT_VIDEO_RESIZE_HEIGHT:
- return height;
- }
- }
-#endif
- return -1;
- default:
- __glutWarning("invalid glutVideoResizeGet parameter: %d", param);
- return -1;
- }
-}
-
-void GLUTAPIENTRY
-glutSetupVideoResizing(void)
-{
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
- if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) {
- __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, __glutCurrentWindow->win);
- videoResizeInUse = 1;
- } else
-#endif
- __glutFatalError("glutEstablishVideoResizing: video resizing not possible.\n");
-}
-
-void GLUTAPIENTRY
-glutStopVideoResizing(void)
-{
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
- if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) {
- if (videoResizeInUse) {
- __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, None);
- videoResizeInUse = 0;
- }
- }
-#endif
-}
-
-/* ARGSUSED */
-void GLUTAPIENTRY
-glutVideoResize(int x, int y, int width, int height)
-{
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
- if (videoResizeInUse) {
-#ifdef GLX_SYNC_SWAP_SGIX
- /* glXChannelRectSyncSGIX introduced in a patch to IRIX
- 6.2; the original unpatched IRIX 6.2 behavior is always
- GLX_SYNC_SWAP_SGIX. */
- __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, GLX_SYNC_SWAP_SGIX);
-#endif
- __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, x, y, width, height);
- }
-#endif
-}
-
-/* ARGSUSED */
-void GLUTAPIENTRY
-glutVideoPan(int x, int y, int width, int height)
-{
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
- if (videoResizeInUse) {
-#ifdef GLX_SYNC_FRAME_SGIX
- /* glXChannelRectSyncSGIX introduced in a patch to IRIX
- 6.2; the original unpatched IRIX 6.2 behavior is always
- GLX_SYNC_SWAP_SGIX. We just ignore that we cannot
- accomplish GLX_SYNC_FRAME_SGIX on IRIX unpatched 6.2;
- this means you'd need a glutSwapBuffers to actually
- realize the video resize. */
- __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, GLX_SYNC_FRAME_SGIX);
-#endif
- __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen,
- videoResizeChannel, x, y, width, height);
- }
-#endif
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_warp.cpp b/src/glut/os2/glut_warp.cpp
deleted file mode 100644
index 885e169d3f1..00000000000
--- a/src/glut/os2/glut_warp.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1996, 1997. */
-
-/* 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 <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "glutint.h"
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutWarpPointer(int x, int y)
-{
-// XWarpPointer(__glutDisplay, None, __glutCurrentWindow->win,
-// 0, 0, 0, 0, x, y);
- POINTL point;
- point.x = x;
- point.y = y;
- WinMapWindowPoints(__glutCurrentWindow->win,HWND_DESKTOP,&point,1);
- WinSetPointerPos(HWND_DESKTOP, point.x, point.y);
-
- XFlush(__glutDisplay);
-}
-
-/* ENDCENTRY */
diff --git a/src/glut/os2/glut_win.cpp b/src/glut/os2/glut_win.cpp
deleted file mode 100644
index 82abba87e48..00000000000
--- a/src/glut/os2/glut_win.cpp
+++ /dev/null
@@ -1,1221 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
-
-/* 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. */
-
-#ifdef __VMS
-#include <GL/vms_x_fix.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#if defined(__OS2__)
-#define POKA 0
- #include "WarpGL.h"
- #include "glutos2.h"
- #include "glutint.h"
-
- #include "gl\os2mesa.h"
-
-//
-//define for resource id for main GLUT window, in samples it is defined in GL_TEST.h
- #define ID_WINDOW 256
-
- int evglSetPixelFormat(int iPixelFormat);
- HPS hpsCurrent;
-
-#elif !defined(_WIN32)
-
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#endif
-
-#include "glutint.h"
-
-GLUTwindow *__glutCurrentWindow = NULL;
-GLUTwindow **__glutWindowList = NULL;
-int __glutWindowListSize = 0;
-#if !defined(_WIN32) && !defined(__OS2__)
-GLUTstale *__glutStaleWindowList = NULL;
-#endif
-GLUTwindow *__glutMenuWindow = NULL;
-
-void (*__glutFreeOverlayFunc) (GLUToverlay *);
-XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle,
- Criterion * requiredCriteria, int nRequired, int requiredMask, void** fbc) = NULL;
-
-static Criterion requiredWindowCriteria[] =
-{
- {LEVEL, EQ, 0},
- {TRANSPARENT, EQ, 0}
-};
-static int numRequiredWindowCriteria = sizeof(requiredWindowCriteria) / sizeof(Criterion);
-static int requiredWindowCriteriaMask = (1 << LEVEL) | (1 << TRANSPARENT);
-
-static void
-cleanWindowWorkList(GLUTwindow * window)
-{
- GLUTwindow **pEntry = &__glutWindowWorkList;
- GLUTwindow *entry = __glutWindowWorkList;
-
- /* Tranverse singly-linked window work list look for the
- window. */
- while (entry) {
- if (entry == window) {
- /* Found it; delete it. */
- *pEntry = entry->prevWorkWin;
- return;
- } else {
- pEntry = &entry->prevWorkWin;
- entry = *pEntry;
- }
- }
-}
-
-#if !defined(_WIN32) && !defined(__OS2PM__)
-
-static void
-cleanStaleWindowList(GLUTwindow * window)
-{
- GLUTstale **pEntry = &__glutStaleWindowList;
- GLUTstale *entry = __glutStaleWindowList;
-
- /* Tranverse singly-linked stale window list look for the
- window ID. */
- while (entry) {
- if (entry->window == window) {
- /* Found it; delete it. */
- *pEntry = entry->next;
- free(entry);
- return;
- } else {
- pEntry = &entry->next;
- entry = *pEntry;
- }
- }
-}
-
-#endif
-
-static GLUTwindow *__glutWindowCache = NULL;
-
-GLUTwindow *
-__glutGetWindow(Window win)
-{
- int i;
-
- /* Does win belong to the last window ID looked up? */
- if (__glutWindowCache && (win == __glutWindowCache->win ||
- (__glutWindowCache->overlay && win ==
- __glutWindowCache->overlay->win))) {
- return
- __glutWindowCache;
- }
- /* Otherwise scan the window list looking for the window ID. */
- for (i = 0; i < __glutWindowListSize; i++) {
- if (__glutWindowList[i]) {
- if (win == __glutWindowList[i]->win) {
- __glutWindowCache = __glutWindowList[i];
- return __glutWindowCache;
- }
- if (__glutWindowList[i]->overlay) {
- if (win == __glutWindowList[i]->overlay->win) {
- __glutWindowCache = __glutWindowList[i];
- return __glutWindowCache;
- }
- }
- }
- }
-#if !defined(_WIN32) && !defined(__OS2PM__)
- {
- GLUTstale *entry;
-
- /* Scan through destroyed overlay window IDs for which no
- DestroyNotify has yet been received. */
- for (entry = __glutStaleWindowList; entry; entry = entry->next) {
- if (entry->win == win)
- return entry->window;
- }
- }
-#endif
- return NULL;
-}
-
-/* CENTRY */
-int GLUTAPIENTRY
-glutGetWindow(void)
-{
- if (__glutCurrentWindow) {
- return __glutCurrentWindow->num + 1;
- } else {
- return 0;
- }
-}
-/* ENDCENTRY */
-
-void
-__glutSetWindow(GLUTwindow * window)
-{
- /* It is tempting to try to short-circuit the call to
- glXMakeCurrent if we "know" we are going to make current
- to a window we are already current to. In fact, this
- assumption breaks when GLUT is expected to integrated with
- other OpenGL windowing APIs that also make current to
- OpenGL contexts. Since glXMakeCurrent short-circuits the
- "already bound" case, GLUT avoids the temptation to do so
- too. */
- __glutCurrentWindow = window;
-
- MAKE_CURRENT_LAYER(__glutCurrentWindow);
-
-#if !defined(_WIN32) && !defined(__OS2__)
- /* We should be careful to force a finish between each
- iteration through the GLUT main loop if indirect OpenGL
- contexts are in use; indirect contexts tend to have much
- longer latency because lots of OpenGL extension requests
- can queue up in the X protocol stream. We accomplish this
- by posting GLUT_FINISH_WORK to be done. */
- if (!__glutCurrentWindow->isDirect)
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_FINISH_WORK);
-#endif
-
- /* If debugging is enabled, we'll want to check this window
- for any OpenGL errors every iteration through the GLUT
- main loop. To accomplish this, we post the
- GLUT_DEBUG_WORK to be done on this window. */
- if (__glutDebug) {
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_DEBUG_WORK);
- }
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutSetWindow(int win)
-{
- GLUTwindow *window;
-
- if (win < 1 || win > __glutWindowListSize) {
- __glutWarning("glutSetWindow attempted on bogus window.");
- return;
- }
- window = __glutWindowList[win - 1];
- if (!window) {
- __glutWarning("glutSetWindow attempted on bogus window.");
- return;
- }
- __glutSetWindow(window);
-}
-/* ENDCENTRY */
-
-static int
-getUnusedWindowSlot(void)
-{
- int i;
-
- /* Look for allocated, unused slot. */
- for (i = 0; i < __glutWindowListSize; i++) {
- if (!__glutWindowList[i]) {
- return i;
- }
- }
- /* Allocate a new slot. */
- __glutWindowListSize++;
- if (__glutWindowList) {
- __glutWindowList = (GLUTwindow **)
- realloc(__glutWindowList,
- __glutWindowListSize * sizeof(GLUTwindow *));
- } else {
- /* XXX Some realloc's do not correctly perform a malloc
- when asked to perform a realloc on a NULL pointer,
- though the ANSI C library spec requires this. */
- __glutWindowList = (GLUTwindow **)
- malloc(sizeof(GLUTwindow *));
- }
- if (!__glutWindowList)
- __glutFatalError("out of memory.");
- __glutWindowList[__glutWindowListSize - 1] = NULL;
- return __glutWindowListSize - 1;
-}
-
-static XVisualInfo *
-getVisualInfoCI(unsigned int mode)
-{
-#if POKA
- static int bufSizeList[] =
- {16, 12, 8, 4, 2, 1, 0};
- XVisualInfo *vi;
- int list[32];
- int i, n = 0;
-
- /* Should not be looking at display mode mask if
- __glutDisplayString is non-NULL. */
- assert(!__glutDisplayString);
-
- list[n++] = GLX_BUFFER_SIZE;
- list[n++] = 1;
- if (GLUT_WIND_IS_DOUBLE(mode)) {
- list[n++] = GLX_DOUBLEBUFFER;
- }
- if (GLUT_WIND_IS_STEREO(mode)) {
- list[n++] = GLX_STEREO;
- }
- if (GLUT_WIND_HAS_DEPTH(mode)) {
- list[n++] = GLX_DEPTH_SIZE;
- list[n++] = 1;
- }
- if (GLUT_WIND_HAS_STENCIL(mode)) {
- list[n++] = GLX_STENCIL_SIZE;
- list[n++] = 1;
- }
- list[n] = (int) None; /* terminate list */
-
- /* glXChooseVisual specify GLX_BUFFER_SIZE prefers the
- "smallest index buffer of at least the specified size".
- This would be reasonable if GLUT allowed the user to
- specify the required buffe size, but GLUT's display mode
- is too simplistic (easy to use?). GLUT should try to find
- the "largest". So start with a large buffer size and
- shrink until we find a matching one that exists. */
-
- for (i = 0; bufSizeList[i]; i++) {
- /* XXX Assumes list[1] is where GLX_BUFFER_SIZE parameter
- is. */
- list[1] = bufSizeList[i];
- vi = glXChooseVisual(__glutDisplay,
- __glutScreen, list);
- if (vi)
- return vi;
- }
- return NULL;
-#else
- return
- glXChooseVisual(mode);
-
-#endif
-}
-
-static XVisualInfo *
-getVisualInfoRGB(unsigned int mode)
-{
-#if POKA
- int list[32];
- int n = 0;
-
- /* Should not be looking at display mode mask if
- __glutDisplayString is non-NULL. */
- assert(!__glutDisplayString);
-
- /* XXX Would a caching mechanism to minize the calls to
- glXChooseVisual? You'd have to reference count
- XVisualInfo* pointers. Would also have to properly
- interact with glutInitDisplayString. */
-
- list[n++] = GLX_RGBA;
- list[n++] = GLX_RED_SIZE;
- list[n++] = 1;
- list[n++] = GLX_GREEN_SIZE;
- list[n++] = 1;
- list[n++] = GLX_BLUE_SIZE;
- list[n++] = 1;
- if (GLUT_WIND_HAS_ALPHA(mode)) {
- list[n++] = GLX_ALPHA_SIZE;
- list[n++] = 1;
- }
- if (GLUT_WIND_IS_DOUBLE(mode)) {
- list[n++] = GLX_DOUBLEBUFFER;
- }
- if (GLUT_WIND_IS_STEREO(mode)) {
- list[n++] = GLX_STEREO;
- }
- if (GLUT_WIND_HAS_DEPTH(mode)) {
- list[n++] = GLX_DEPTH_SIZE;
- list[n++] = 1;
- }
- if (GLUT_WIND_HAS_STENCIL(mode)) {
- list[n++] = GLX_STENCIL_SIZE;
- list[n++] = 1;
- }
- if (GLUT_WIND_HAS_ACCUM(mode)) {
- list[n++] = GLX_ACCUM_RED_SIZE;
- list[n++] = 1;
- list[n++] = GLX_ACCUM_GREEN_SIZE;
- list[n++] = 1;
- list[n++] = GLX_ACCUM_BLUE_SIZE;
- list[n++] = 1;
- if (GLUT_WIND_HAS_ALPHA(mode)) {
- list[n++] = GLX_ACCUM_ALPHA_SIZE;
- list[n++] = 1;
- }
- }
-#if defined(GLX_VERSION_1_1) && (defined(GLX_SGIS_multisample) || defined(GLX_ARB_multisample))
- if (GLUT_WIND_IS_MULTISAMPLE(mode)) {
- if (!__glutIsSupportedByGLX("GLX_SGIS_multisample") &&
- !__glutIsSupportedByGLX("GLX_ARB_multisample"))
- return NULL;
-#if defined(GLX_ARB_multisample)
- list[n++] = GLX_SAMPLES_ARB;
-#elif defined(GLX_SGIS_multisample)
- list[n++] = GLX_SAMPLES_SGIS;
-#endif
- /* XXX Is 4 a reasonable minimum acceptable number of
- samples? */
- list[n++] = 4;
- }
-#endif
- list[n] = (int) None; /* terminate list */
-
- return glXChooseVisual(__glutDisplay,
- __glutScreen, list);
-#else /* POKA */
-
- return
- glXChooseVisual(mode);
-
-#endif
-}
-
-XVisualInfo *
-__glutGetVisualInfo(unsigned int mode)
-{
- /* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */
- if (GLUT_WIND_IS_LUMINANCE(mode))
- return NULL;
-
- if (GLUT_WIND_IS_RGB(mode))
- return getVisualInfoRGB(mode);
- else
- return getVisualInfoCI(mode);
-}
-
-XVisualInfo *
-__glutDetermineVisual(
- unsigned int displayMode,
- Bool * treatAsSingle,
- XVisualInfo * (getVisualInfo) (unsigned int))
-{
- XVisualInfo *vis;
-
- /* Should not be looking at display mode mask if
- __glutDisplayString is non-NULL. */
- assert(!__glutDisplayString);
-
- *treatAsSingle = GLUT_WIND_IS_SINGLE(displayMode);
- vis = getVisualInfo(displayMode);
- if (!vis) {
- /* Fallback cases when can't get exactly what was asked
- for... */
- if (GLUT_WIND_IS_SINGLE(displayMode)) {
- /* If we can't find a single buffered visual, try looking
- for a double buffered visual. We can treat a double
- buffered visual as a single buffer visual by changing
- the draw buffer to GL_FRONT and treating any swap
- buffers as no-ops. */
- displayMode |= GLUT_DOUBLE;
- vis = getVisualInfo(displayMode);
- *treatAsSingle = True;
- }
- if (!vis && GLUT_WIND_IS_MULTISAMPLE(displayMode)) {
- /* If we can't seem to get multisampling (ie, not Reality
- Engine class graphics!), go without multisampling. It
- is up to the application to query how many multisamples
- were allocated (0 equals no multisampling) if the
- application is going to use multisampling for more than
- just antialiasing. */
- displayMode &= ~GLUT_MULTISAMPLE;
- vis = getVisualInfo(displayMode);
- }
- }
- return vis;
-}
-
-static void GLUTCALLBACK
-__glutDefaultDisplay(void)
-{
- /* XXX Remove the warning after GLUT 3.0. */
- __glutWarning("The following is a new check for GLUT 3.0; update your code.");
- __glutFatalError(
- "redisplay needed for window %d, but no display callback.",
- __glutCurrentWindow->num + 1);
-}
-
-void GLUTCALLBACK
-__glutDefaultReshape(int width, int height)
-{
- GLUToverlay *overlay;
-
- /* Adjust the viewport of the window (and overlay if one
- exists). */
- MAKE_CURRENT_WINDOW(__glutCurrentWindow);
- glViewport(0, 0, (GLsizei) width, (GLsizei) height);
- overlay = __glutCurrentWindow->overlay;
- if (overlay) {
- MAKE_CURRENT_OVERLAY(overlay);
- glViewport(0, 0, (GLsizei) width, (GLsizei) height);
- }
- /* Make sure we are current to the current layer (application
- should be able to count on the current layer not changing
- unless the application explicitly calls glutUseLayer). */
- MAKE_CURRENT_LAYER(__glutCurrentWindow);
-}
-
-XVisualInfo *
-__glutDetermineWindowVisual(Bool * treatAsSingle, Bool * visAlloced, void **fbc)
-{
- if (__glutDisplayString) {
-
- /* __glutDisplayString should be NULL except if
- glutInitDisplayString has been called to register a
- different display string. Calling glutInitDisplayString
- means using a string instead of an integer mask determine
- the visual to use. Using the function pointer variable
- __glutDetermineVisualFromString below avoids linking in
- the code for implementing glutInitDisplayString (ie,
- glut_dstr.o) unless glutInitDisplayString gets called by
- the application. */
-
- assert(__glutDetermineVisualFromString);
- *visAlloced = False;
- *fbc = NULL;
- return __glutDetermineVisualFromString(__glutDisplayString, treatAsSingle,
- requiredWindowCriteria, numRequiredWindowCriteria, requiredWindowCriteriaMask, fbc);
- } else {
- *visAlloced = True;
- *fbc = NULL;
- return __glutDetermineVisual(__glutDisplayMode,
- treatAsSingle, __glutGetVisualInfo);
- }
-}
-
-/* ARGSUSED5 */ /* Only Win32 uses gameMode parameter. */
-GLUTwindow *
-__glutCreateWindow(GLUTwindow * parent,
- int x, int y, int width, int height, int gameMode)
-{
- GLUTwindow *window;
- XSetWindowAttributes wa;
- unsigned long attribMask;
- int winnum;
- int i;
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
- GLXFBConfigSGIX fbc;
-#else
- void *fbc;
-#endif
-
-#if defined(__OS2PM__)
- {
- extern HAB hab; /* PM anchor block handle */
- CLASSINFO classinfo;
-
- if(!WinQueryClassInfo(hab,"GLUT", &classinfo) )
- __glutOpenOS2Connection(NULL);
- }
-#elif defined(_WIN32)
- WNDCLASS wc;
- int style;
-
- if (!GetClassInfo(GetModuleHandle(NULL), "GLUT", &wc)) {
- __glutOpenWin32Connection(NULL);
- }
-#else
- if (!__glutDisplay) {
- __glutOpenXConnection(NULL);
- }
-#endif
-
-#ifndef __OS2PM__
- if (__glutGameModeWindow) {
- __glutFatalError("cannot create windows in game mode.");
- }
-#endif
-
- winnum = getUnusedWindowSlot();
- window = (GLUTwindow *) malloc(sizeof(GLUTwindow));
- if (!window) {
- __glutFatalError("out of memory.");
- }
- window->num = winnum;
-
-#if defined(__OS2PM__)
- /* Add this new window to the window list. */
- __glutWindowList[winnum] = window;
- window->shownState = -1;
-#endif
-
-#if !defined(_WIN32) && !defined(__OS2PM__)
- window->vis = __glutDetermineWindowVisual(&window->treatAsSingle,
- &window->visAlloced, (void**) &fbc);
- if (!window->vis) {
- __glutFatalError(
- "visual with necessary capabilities not found.");
- }
- __glutSetupColormap(window->vis, &window->colormap, &window->cmap);
-#endif
- window->eventMask = StructureNotifyMask | ExposureMask;
-
- attribMask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask;
- wa.background_pixmap = None;
- wa.border_pixel = 0;
- wa.colormap = window->cmap;
- wa.event_mask = window->eventMask;
- if (parent) {
- if (parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK)
- wa.event_mask |= GLUT_HACK_STOP_PROPAGATE_MASK;
- attribMask |= CWDontPropagate;
- wa.do_not_propagate_mask = parent->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK;
- } else {
- wa.do_not_propagate_mask = 0;
- }
-
- /* Stash width and height before Win32's __glutAdjustCoords
- possibly overwrites the values. */
- window->width = width;
- window->height = height;
- window->forceReshape = True;
- window->ignoreKeyRepeat = False;
-
-#if defined(__OS2PM__)
-
- { ULONG flStyle=0;
- int ii;
- ERRORID erridErrorCode;/* last error id code */
- extern HAB hab; /* PM anchor block handle */
-
- if (parent) {
- flStyle = WS_CLIPCHILDREN|WS_VISIBLE;
- } else {
- if (gameMode) {
- /* Game mode window should be a WS_POPUP window to
- ensure that the taskbar is hidden by it. A standard
- WS_OVERLAPPEDWINDOW does not hide the task bar. */
- flStyle = FCF_STANDARD | WS_MAXIMIZED;
- } else {
- /* A standard toplevel window with borders and such. */
- flStyle = FCF_STANDARD | WS_CLIPCHILDREN;
-// flStyle = WS_OVERLAPPEDWINDOW;
- }
- }
-{
- HWND hwnd; /* Window */
- ULONG ListBoxId; /* Window id */
- /* (supplied by application) */
-
-
- HWND hwndClient; /* handle to the client */
- HWND hwndFrame; /* handle to the frame */
- PFNWP GenericWndProc;
- FRAMECDATA fcd;
- RECTL rect; /* Boundary rectangle */
-
-
-
-/************************************************/
-// flCreate = (FCF_STANDARD) & ~FCF_TASKLIST;
-/**********************************/
- if (parent)
- { window->frame = NULL;
-
- hwnd = WinCreateWindow(parent->win, /* Parent window */
- "GLUTCHILD", /* Class name */
- "", /* Window text */
- flStyle, /* Window style */
- x, y, /* Position (x,y) */
- width, height, /* Size (width,height) */
- parent->win, /* Owner window */
- HWND_TOP, /* Sibling window */
- 0, /* Window id */
- NULL, /* Control data */
- NULL); /* Pres parameters */
-
- erridErrorCode = WinGetLastError(hab);
- window->win = hwnd;
-
- window->hdc = WinOpenWindowDC(window->win);
- window->hpsBuffer = hpsCurrent;
-
-
- rect.xLeft = x;
- rect.xRight = x+width;
- rect.yBottom = y;
- rect.yTop = y + height;
-
-/***** else parent *****************************/
- } else {
- hwnd = WinCreateStdWindow(HWND_DESKTOP,
- 0, /* WS_VISIBLE frame-window style */
- &flStyle, /* window style */
- "GLUT", /* class name */
- "GLUT",/* window title */
- 0L, /* default client style */
- NULLHANDLE, /* resource in executable file */
- ID_WINDOW, /* resource id */
- &hwndClient); /* receives client window handle */
-
- erridErrorCode = WinGetLastError(hab);
- window->win = hwndClient;
- window->frame = hwnd;
- window->hdc = WinOpenWindowDC(window->win);
-
- window->hpsBuffer = hpsCurrent;
-
-
-/* converts a client window's boundaries into an equivalent frame rectangle */
- rect.xLeft = x;
- rect.xRight = x+width;
- rect.yBottom = y;
- rect.yTop = y + height;
-
- /* calculate equivalent frame boundary from boundary data */
- WinCalcFrameRect(window->frame, &rect, FALSE);
- }
-/***** endof if(parent) *****************************/
-
- /* Must set the XHDC for fake glXChooseVisual & fake
- glXCreateContext & fake XAllocColorCells. */
- XHDC = window->hdc;
- XHWND = window->win;
- window->vis = __glutDetermineWindowVisual(&window->treatAsSingle,
- &window->visAlloced, &fbc);
- if (!window->vis)
- { __glutFatalError(
- "pixel format with necessary capabilities not found.");
- }
- { int rc;
- rc = wglChoosePixelFormat(window->hdc, window->vis),
-
-// evglSetPixelFormat(2); /* int iPixelFormat 1 - doublebuffer/2 - single buffer ??*/
- wglSetPixelFormat(window->hdc,rc,window->vis);
- }
- __glutSetupColormap(window->vis, &window->colormap, &window->cmap);
-
- window->ctx = glXCreateContext(window->hpsBuffer, window->vis,
- None, __glutTryDirect);
-
- WinSetWindowPos(hwnd,
- HWND_TOP,rect.xLeft,rect.yBottom,
- rect.xRight-rect.xLeft, rect.yTop-rect.yBottom,
- SWP_ACTIVATE | SWP_MOVE | SWP_SIZE | SWP_SHOW|SWP_ZORDER); /* flags*/
-
- /* Make sure subwindows get a windowStatus callback. */
- if (parent)
- WinPostMsg(parent->win, WM_ACTIVATE, 0, 0);
-
- }
-}
-
-#elif defined(_WIN32)
-
- __glutAdjustCoords(parent ? parent->win : NULL,
- &x, &y, &width, &height);
- if (parent) {
- style = WS_CHILD;
- } else {
- if (gameMode) {
- /* Game mode window should be a WS_POPUP window to
- ensure that the taskbar is hidden by it. A standard
- WS_OVERLAPPEDWINDOW does not hide the task bar. */
- style = WS_POPUP | WS_MAXIMIZE;
- } else {
- /* A standard toplevel window with borders and such. */
- style = WS_OVERLAPPEDWINDOW;
- }
- }
- window->win = CreateWindow("GLUT", "GLUT",
- WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style,
- x, y, width, height, parent ? parent->win : __glutRoot,
- NULL, GetModuleHandle(NULL), 0);
- window->hdc = GetDC(window->win);
- /* Must set the XHDC for fake glXChooseVisual & fake
- glXCreateContext & fake XAllocColorCells. */
- XHDC = window->hdc;
- window->vis = __glutDetermineWindowVisual(&window->treatAsSingle,
- &window->visAlloced, &fbc);
- if (!window->vis) {
- __glutFatalError(
- "pixel format with necessary capabilities not found.");
- }
- if (!SetPixelFormat(window->hdc,
- ChoosePixelFormat(window->hdc, window->vis),
- window->vis)) {
- __glutFatalError("SetPixelFormat failed during window create.");
- }
- __glutSetupColormap(window->vis, &window->colormap, &window->cmap);
- /* Make sure subwindows get a windowStatus callback. */
- if (parent) {
- PostMessage(parent->win, WM_ACTIVATE, 0, 0);
- }
- window->renderDc = window->hdc;
-#else
- window->win = XCreateWindow(__glutDisplay,
- parent == NULL ? __glutRoot : parent->win,
- x, y, width, height, 0,
- window->vis->depth, InputOutput, window->vis->visual,
- attribMask, &wa);
-#endif
- window->renderWin = window->win;
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
- if (fbc) {
- window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
- GLX_RGBA_TYPE_SGIX, None, __glutTryDirect);
- } else
-#endif
-#if defined(__OS2PM__)
-// window->ctx = glXCreateContext(window->hpsBuffer, window->vis,
-// None, __glutTryDirect);
-#else
- window->ctx = glXCreateContext(__glutDisplay, window->vis,
- None, __glutTryDirect);
-#endif
- if (!window->ctx) {
- __glutFatalError(
- "failed to create OpenGL rendering context.");
- }
- window->renderCtx = window->ctx;
-#if !defined(_WIN32) && !defined(__OS2PM__)
- window->isDirect = glXIsDirect(__glutDisplay, window->ctx);
- if (__glutForceDirect) {
- if (!window->isDirect)
- __glutFatalError("direct rendering not possible.");
- }
-#endif
-
- window->parent = parent;
- if (parent) {
- window->siblings = parent->children;
- parent->children = window;
- } else {
- window->siblings = NULL;
- }
- window->overlay = NULL;
- window->children = NULL;
- window->display = __glutDefaultDisplay;
- window->reshape = __glutDefaultReshape;
- window->mouse = NULL;
- window->motion = NULL;
- window->passive = NULL;
- window->entry = NULL;
- window->keyboard = NULL;
- window->keyboardUp = NULL;
- window->windowStatus = NULL;
- window->visibility = NULL;
- window->special = NULL;
- window->specialUp = NULL;
- window->buttonBox = NULL;
- window->dials = NULL;
- window->spaceMotion = NULL;
- window->spaceRotate = NULL;
- window->spaceButton = NULL;
- window->tabletMotion = NULL;
- window->tabletButton = NULL;
-#ifdef _WIN32
- window->joystick = NULL;
- window->joyPollInterval = 0;
-#endif
-
-#if defined(__OS2PM__)
- window->wm_command = NULL;
-#endif
-
- window->tabletPos[0] = -1;
- window->tabletPos[1] = -1;
-#if defined(__OS2PM__)
- if(window->shownState == -1)
- window->shownState = 0;
- window->visState = window->shownState;
-#else
- window->shownState = 0;
- window->visState = -1; /* not VisibilityUnobscured,
- VisibilityPartiallyObscured, or
- VisibilityFullyObscured */
-#endif
- window->entryState = -1; /* not EnterNotify or LeaveNotify */
-
- window->desiredConfMask = 0;
- window->buttonUses = 0;
- window->cursor = GLUT_CURSOR_INHERIT;
-
- /* Setup window to be mapped when glutMainLoop starts. */
- window->workMask = GLUT_MAP_WORK;
-#ifdef _WIN32
- if (gameMode) {
- /* When mapping a game mode window, just show
- the window. We have already created the game
- mode window with a maximize flag at creation
- time. Doing a ShowWindow(window->win, SW_SHOWNORMAL)
- would be wrong for a game mode window since it
- would unmaximize the window. */
- window->desiredMapState = GameModeState;
- } else {
- window->desiredMapState = NormalState;
- }
-#else
- window->desiredMapState = NormalState;
-#endif
- window->prevWorkWin = __glutWindowWorkList;
- __glutWindowWorkList = window;
-
- /* Initially, no menus attached. */
- for (i = 0; i < GLUT_MAX_MENUS; i++) {
- window->menu[i] = 0;
- }
-
- /* Add this new window to the window list. */
- __glutWindowList[winnum] = window;
-
- /* Make the new window the current window. */
- __glutSetWindow(window);
-
- __glutDetermineMesaSwapHackSupport();
-
- if (window->treatAsSingle) {
- /* We do this because either the window really is single
- buffered (in which case this is redundant, but harmless,
- because this is the initial single-buffered context
- state); or we are treating a double buffered window as a
- single-buffered window because the system does not appear
- to export any suitable single- buffered visuals (in which
- the following are necessary). */
- glDrawBuffer(GL_FRONT);
- glReadBuffer(GL_FRONT);
- }
- return window;
-}
-
-/* CENTRY */
-int GLUTAPIENTRY
-glutCreateWindow(const char *title)
-{
- static int firstWindow = 1;
- GLUTwindow *window;
-#if !defined(_WIN32) && !defined(__OS2__)
- XWMHints *wmHints;
-#endif
- Window win;
- XTextProperty textprop;
-
- if (__glutGameModeWindow) {
- __glutFatalError("cannot create windows in game mode.");
- }
- window = __glutCreateWindow(NULL,
- __glutSizeHints.x, __glutSizeHints.y,
- __glutInitWidth, __glutInitHeight,
- /* not game mode */ 0);
- win = window->win;
- /* Setup ICCCM properties. */
- textprop.value = (unsigned char *) title;
- textprop.encoding = XA_STRING;
- textprop.format = 8;
- textprop.nitems = strlen(title);
-#if defined(__OS2__)
- WinSetWindowText(window->frame, (PCSZ)title);
- if (__glutIconic) {
- window->desiredMapState = IconicState;
- }
-#elif defined(_WIN32)
- SetWindowText(win, title);
- if (__glutIconic) {
- window->desiredMapState = IconicState;
- }
-#else
- wmHints = XAllocWMHints();
- wmHints->initial_state =
- __glutIconic ? IconicState : NormalState;
- wmHints->flags = StateHint;
- XSetWMProperties(__glutDisplay, win, &textprop, &textprop,
- /* Only put WM_COMMAND property on first window. */
- firstWindow ? __glutArgv : NULL,
- firstWindow ? __glutArgc : 0,
- &__glutSizeHints, wmHints, NULL);
- XFree(wmHints);
- XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1);
-#endif
- firstWindow = 0;
- return window->num + 1;
-}
-
-#ifdef _WIN32
-int GLUTAPIENTRY
-__glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int))
-{
- __glutExitFunc = exitfunc;
- return glutCreateWindow(title);
-}
-#endif
-
-int GLUTAPIENTRY
-glutCreateSubWindow(int win, int x, int y, int width, int height)
-{
- GLUTwindow *window;
-
- window = __glutCreateWindow(__glutWindowList[win - 1],
- x, y, width, height, /* not game mode */ 0);
-#if !defined(_WIN32) && !defined(__OS2__)
- {
- GLUTwindow *toplevel;
-
- toplevel = __glutToplevelOf(window);
- if (toplevel->cmap != window->cmap) {
- __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK);
- }
- }
-#endif
- return window->num + 1;
-}
-/* ENDCENTRY */
-
-void
-__glutDestroyWindow(GLUTwindow * window,
- GLUTwindow * initialWindow)
-{
- GLUTwindow **prev, *cur, *parent, *siblings;
-
- /* Recursively destroy any children. */
- cur = window->children;
- while (cur) {
- siblings = cur->siblings;
- __glutDestroyWindow(cur, initialWindow);
- cur = siblings;
- }
- /* Remove from parent's children list (only necessary for
- non-initial windows and subwindows!). */
- parent = window->parent;
- if (parent && parent == initialWindow->parent) {
- prev = &parent->children;
- cur = parent->children;
- while (cur) {
- if (cur == window) {
- *prev = cur->siblings;
- break;
- }
- prev = &(cur->siblings);
- cur = cur->siblings;
- }
- }
- /* Unbind if bound to this window. */
- if (window == __glutCurrentWindow) {
- UNMAKE_CURRENT();
- __glutCurrentWindow = NULL;
- }
- /* Begin tearing down window itself. */
- if (window->overlay) {
- __glutFreeOverlayFunc(window->overlay);
- }
- XDestroyWindow(__glutDisplay, window->win);
- glXDestroyContext(__glutDisplay, window->ctx);
- if (window->colormap) {
- /* Only color index windows have colormap data structure. */
- __glutFreeColormap(window->colormap);
- }
- /* NULLing the __glutWindowList helps detect is a window
- instance has been destroyed, given a window number. */
- __glutWindowList[window->num] = NULL;
-
- /* Cleanup data structures that might contain window. */
- cleanWindowWorkList(window);
-#if !defined(_WIN32) && !defined(__OS2__)
- cleanStaleWindowList(window);
-#endif
- /* Remove window from the "get window cache" if it is there. */
- if (__glutWindowCache == window)
- __glutWindowCache = NULL;
-
- if (window->visAlloced) {
- /* Only free XVisualInfo* gotten from glXChooseVisual. */
- XFree(window->vis);
- }
-
- if (window == __glutGameModeWindow) {
- /* Destroying the game mode window should implicitly
- have GLUT leave game mode. */
- __glutCloseDownGameMode();
- }
-
- free(window);
-}
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutDestroyWindow(int win)
-{
- GLUTwindow *window = __glutWindowList[win - 1];
-
- if (__glutMappedMenu && __glutMenuWindow == window) {
- __glutFatalUsage("destroying menu window not allowed while menus in use");
- }
-#if !defined(_WIN32) && !defined(__OS2__)
- /* If not a toplevel window... */
- if (window->parent) {
- /* Destroying subwindows may change colormap requirements;
- recalculate toplevel window's WM_COLORMAP_WINDOWS
- property. */
- __glutPutOnWorkList(__glutToplevelOf(window->parent),
- GLUT_COLORMAP_WORK);
- }
-#endif
- __glutDestroyWindow(window, window);
- XFlush(__glutDisplay);
-}
-/* ENDCENTRY */
-
-void
-__glutChangeWindowEventMask(long eventMask, Bool add)
-{
- if (add) {
- /* Add eventMask to window's event mask. */
- if ((__glutCurrentWindow->eventMask & eventMask) !=
- eventMask) {
- __glutCurrentWindow->eventMask |= eventMask;
- __glutPutOnWorkList(__glutCurrentWindow,
- GLUT_EVENT_MASK_WORK);
- }
- } else {
- /* Remove eventMask from window's event mask. */
- if (__glutCurrentWindow->eventMask & eventMask) {
- __glutCurrentWindow->eventMask &= ~eventMask;
- __glutPutOnWorkList(__glutCurrentWindow,
- GLUT_EVENT_MASK_WORK);
- }
- }
-}
-
-void GLUTAPIENTRY
-glutDisplayFunc(GLUTdisplayCB displayFunc)
-{
- /* XXX Remove the warning after GLUT 3.0. */
- if (!displayFunc)
- __glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code.");
- __glutCurrentWindow->display = displayFunc;
-}
-
-void GLUTAPIENTRY
-glutMouseFunc(GLUTmouseCB mouseFunc)
-{
- if (__glutCurrentWindow->mouse) {
- if (!mouseFunc) {
- /* Previous mouseFunc being disabled. */
- __glutCurrentWindow->buttonUses--;
- __glutChangeWindowEventMask(
- ButtonPressMask | ButtonReleaseMask,
- __glutCurrentWindow->buttonUses > 0);
- }
- } else {
- if (mouseFunc) {
- /* Previously no mouseFunc, new one being installed. */
- __glutCurrentWindow->buttonUses++;
- __glutChangeWindowEventMask(
- ButtonPressMask | ButtonReleaseMask, True);
- }
- }
- __glutCurrentWindow->mouse = mouseFunc;
-}
-
-void GLUTAPIENTRY
-glutMotionFunc(GLUTmotionCB motionFunc)
-{
- /* Hack. Some window managers (4Dwm by default) will mask
- motion events if the client is not selecting for button
- press and release events. So we select for press and
- release events too (being careful to use reference
- counting). */
- if (__glutCurrentWindow->motion) {
- if (!motionFunc) {
- /* previous mouseFunc being disabled */
- __glutCurrentWindow->buttonUses--;
- __glutChangeWindowEventMask(
- ButtonPressMask | ButtonReleaseMask,
- __glutCurrentWindow->buttonUses > 0);
- }
- } else {
- if (motionFunc) {
- /* Previously no mouseFunc, new one being installed. */
- __glutCurrentWindow->buttonUses++;
- __glutChangeWindowEventMask(
- ButtonPressMask | ButtonReleaseMask, True);
- }
- }
- /* Real work of selecting for passive mouse motion. */
- __glutChangeWindowEventMask(
- Button1MotionMask | Button2MotionMask | Button3MotionMask,
- motionFunc != NULL);
- __glutCurrentWindow->motion = motionFunc;
-}
-
-void GLUTAPIENTRY
-glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc)
-{
- __glutChangeWindowEventMask(PointerMotionMask,
- passiveMotionFunc != NULL);
-
- /* Passive motion also requires watching enters and leaves so
- that a fake passive motion event can be generated on an
- enter. */
- __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask,
- __glutCurrentWindow->entry != NULL || passiveMotionFunc != NULL);
-
- __glutCurrentWindow->passive = passiveMotionFunc;
-}
-
-void GLUTAPIENTRY
-glutEntryFunc(GLUTentryCB entryFunc)
-{
- __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask,
- entryFunc != NULL || __glutCurrentWindow->passive);
- __glutCurrentWindow->entry = entryFunc;
- if (!entryFunc) {
- __glutCurrentWindow->entryState = -1;
- }
-}
-
-void GLUTAPIENTRY
-glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc)
-{
- __glutChangeWindowEventMask(VisibilityChangeMask,
- windowStatusFunc != NULL);
- __glutCurrentWindow->windowStatus = windowStatusFunc;
- if (!windowStatusFunc) {
- /* Make state invalid. */
- __glutCurrentWindow->visState = -1;
- }
-}
-
-static void GLUTCALLBACK
-visibilityHelper(int status)
-{
- if (status == GLUT_HIDDEN || status == GLUT_FULLY_COVERED)
- __glutCurrentWindow->visibility(GLUT_NOT_VISIBLE);
- else
- __glutCurrentWindow->visibility(GLUT_VISIBLE);
-}
-
-
-void GLUTAPIENTRY
-glutVisibilityFunc(GLUTvisibilityCB visibilityFunc)
-{
- __glutCurrentWindow->visibility = visibilityFunc;
-
- if (visibilityFunc)
- { glutWindowStatusFunc(visibilityHelper);
-#if defined(__OS2PM__)
- if(__glutCurrentWindow->shownState >= 0)
- { visibilityHelper(__glutCurrentWindow->shownState);
- }
-#endif
- }
- else
- glutWindowStatusFunc(NULL);
-}
-
-void GLUTAPIENTRY
-glutReshapeFunc(GLUTreshapeCB reshapeFunc)
-{
- if (reshapeFunc) {
- __glutCurrentWindow->reshape = reshapeFunc;
- } else {
- __glutCurrentWindow->reshape = __glutDefaultReshape;
- }
-}
- \ No newline at end of file
diff --git a/src/glut/os2/glut_winmisc.cpp b/src/glut/os2/glut_winmisc.cpp
deleted file mode 100644
index ffa31c021c0..00000000000
--- a/src/glut/os2/glut_winmisc.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/* 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 <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-#include "glutint.h"
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutSetWindowTitle(const char *title)
-{
-#if defined(__OS2PM__)
- __glutSetWindowText(__glutCurrentWindow->win, (char *)title);
-
-#else
- XTextProperty textprop;
-
- assert(!__glutCurrentWindow->parent);
- IGNORE_IN_GAME_MODE();
- textprop.value = (unsigned char *) title;
- textprop.encoding = XA_STRING;
- textprop.format = 8;
- textprop.nitems = strlen(title);
- XSetWMName(__glutDisplay,
- __glutCurrentWindow->win, &textprop);
- XFlush(__glutDisplay);
-#endif
-}
-
-void GLUTAPIENTRY
-glutSetIconTitle(const char *title)
-{
-#if defined(__OS2PM__)
-//todo ?
-#else
-
- XTextProperty textprop;
-
- assert(!__glutCurrentWindow->parent);
- IGNORE_IN_GAME_MODE();
- textprop.value = (unsigned char *) title;
- textprop.encoding = XA_STRING;
- textprop.format = 8;
- textprop.nitems = strlen(title);
- XSetWMIconName(__glutDisplay,
- __glutCurrentWindow->win, &textprop);
- XFlush(__glutDisplay);
-#endif
-}
-
-void GLUTAPIENTRY
-glutPositionWindow(int x, int y)
-{
- IGNORE_IN_GAME_MODE();
- __glutCurrentWindow->desiredX = x;
- __glutCurrentWindow->desiredY = y;
- __glutCurrentWindow->desiredConfMask |= CWX | CWY;
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
-}
-
-void GLUTAPIENTRY
-glutReshapeWindow(int w, int h)
-{
- IGNORE_IN_GAME_MODE();
- if (w <= 0 || h <= 0)
- __glutWarning("glutReshapeWindow: non-positive width or height not allowed");
-
- __glutCurrentWindow->desiredWidth = w;
- __glutCurrentWindow->desiredHeight = h;
- __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight;
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
-}
-
-void GLUTAPIENTRY
-glutPopWindow(void)
-{
- IGNORE_IN_GAME_MODE();
- __glutCurrentWindow->desiredStack = Above;
- __glutCurrentWindow->desiredConfMask |= CWStackMode;
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
-}
-
-void GLUTAPIENTRY
-glutPushWindow(void)
-{
- IGNORE_IN_GAME_MODE();
- __glutCurrentWindow->desiredStack = Below;
- __glutCurrentWindow->desiredConfMask |= CWStackMode;
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
-}
-
-void GLUTAPIENTRY
-glutIconifyWindow(void)
-{
- IGNORE_IN_GAME_MODE();
- assert(!__glutCurrentWindow->parent);
- __glutCurrentWindow->desiredMapState = IconicState;
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
-}
-
-void GLUTAPIENTRY
-glutShowWindow(void)
-{
- IGNORE_IN_GAME_MODE();
- __glutCurrentWindow->desiredMapState = NormalState;
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
-}
-
-void GLUTAPIENTRY
-glutHideWindow(void)
-{
- IGNORE_IN_GAME_MODE();
- __glutCurrentWindow->desiredMapState = WithdrawnState;
- __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
-}
-
-/* ENDCENTRY */
- \ No newline at end of file
diff --git a/src/glut/os2/glutbitmap.h b/src/glut/os2/glutbitmap.h
deleted file mode 100644
index dc1b61af195..00000000000
--- a/src/glut/os2/glutbitmap.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __glutbitmap_h__
-#define __glutbitmap_h__
-
-/* Copyright (c) Mark J. Kilgard, 1994, 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. */
-
-#define GLUT_NO_LIB_PRAGMA /* Avoid auto library linking when building
- the GLUT library itself. */
-#include <GL/glut.h>
-
-typedef struct {
- const GLsizei width;
- const GLsizei height;
- const GLfloat xorig;
- const GLfloat yorig;
- const GLfloat advance;
- const GLubyte *bitmap;
-} BitmapCharRec, *BitmapCharPtr;
-
-typedef struct {
- const char *name;
- const int num_chars;
- const int first;
- const BitmapCharRec * const *ch;
-} BitmapFontRec, *BitmapFontPtr;
-
-typedef void *GLUTbitmapFont;
-
-#endif /* __glutbitmap_h__ */
diff --git a/src/glut/os2/glutos2.h b/src/glut/os2/glutos2.h
deleted file mode 100644
index 533a78011e2..00000000000
--- a/src/glut/os2/glutos2.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef __glutos2_h__
-#define __glutos2_h__
-
-
-/* Win32 "equivalent" cursors - eventually, the X glyphs should be
- converted to Win32 cursors -- then they will look the same */
-#define XC_arrow IDC_ARROW
-#define XC_top_left_arrow IDC_ARROW
-#define XC_hand1 IDC_SIZEALL
-#define XC_pirate IDC_NO
-#define XC_question_arrow IDC_HELP
-#define XC_exchange IDC_NO
-#define XC_spraycan IDC_SIZEALL
-#define XC_watch IDC_WAIT
-#define XC_xterm IDC_IBEAM
-#define XC_crosshair IDC_CROSS
-#define XC_sb_v_double_arrow IDC_SIZENS
-#define XC_sb_h_double_arrow IDC_SIZEWE
-#define XC_top_side IDC_UPARROW
-#define XC_bottom_side IDC_SIZENS
-#define XC_left_side IDC_SIZEWE
-#define XC_right_side IDC_SIZEWE
-#define XC_top_left_corner IDC_SIZENWSE
-#define XC_top_right_corner IDC_SIZENESW
-#define XC_bottom_right_corner IDC_SIZENWSE
-#define XC_bottom_left_corner IDC_SIZENESW
-
-#define XA_STRING 0
-
-/* Private routines from win32_util.c */
-extern int gettimeofday(struct timeval* tp, void* tzp);
-//extern void *__glutFont(void *font);
-extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo);
-extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height);
-
-#endif /* __glutos2_h__ */
diff --git a/src/glut/os2/glutstroke.h b/src/glut/os2/glutstroke.h
deleted file mode 100644
index fbbc70d6cc0..00000000000
--- a/src/glut/os2/glutstroke.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __glutstroke_h__
-#define __glutstroke_h__
-
-/* Copyright (c) Mark J. Kilgard, 1994. */
-
-/* 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. */
-
-#if defined(_WIN32)
-#pragma warning (disable:4244) /* disable bogus conversion warnings */
-#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
-#endif
-
-typedef struct {
- float x;
- float y;
-} CoordRec, *CoordPtr;
-
-typedef struct {
- int num_coords;
- const CoordRec *coord;
-} StrokeRec, *StrokePtr;
-
-typedef struct {
- int num_strokes;
- const StrokeRec *stroke;
- float center;
- float right;
-} StrokeCharRec, *StrokeCharPtr;
-
-typedef struct {
- const char *name;
- int num_chars;
- const StrokeCharRec *ch;
- float top;
- float bottom;
-} StrokeFontRec, *StrokeFontPtr;
-
-typedef void *GLUTstrokeFont;
-
-#endif /* __glutstroke_h__ */
diff --git a/src/glut/os2/layerutil.h b/src/glut/os2/layerutil.h
deleted file mode 100644
index 3786c4d871c..00000000000
--- a/src/glut/os2/layerutil.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef __layerutil_h__
-#define __layerutil_h__
-
-/* Copyright (c) Mark J. Kilgard, 1993, 1994. */
-
-/* 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. */
-
-/* Based on XLayerUtil.h: Revision: 1.3 */
-
-#ifdef __VMS
-#include <GL/vms_x_fix.h>
-#endif
-
-#if !defined(_WIN32) && !defined(__OS2__)
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xmd.h>
-#endif /* !_WIN32 */
-
-/* Transparent type values */
-/* None 0 */
-#define TransparentPixel 1
-#define TransparentMask 2
-
-/* layered visual info template flags */
-#define VisualLayerMask 0x200
-#define VisualTransparentType 0x400
-#define VisualTransparentValue 0x800
-#define VisualAllLayerMask 0xFFF
-
-/* layered visual info structure */
-typedef struct _XLayerVisualInfo {
- XVisualInfo vinfo;
- long layer;
- long type;
- unsigned long value;
-} XLayerVisualInfo;
-
-/* SERVER_OVERLAY_VISUALS property element */
-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. */
- long overlay_visual;
- long transparent_type;
- long value;
- long layer;
-} OverlayInfo;
-
-extern int __glutGetTransparentPixel(Display *, XVisualInfo *);
-extern XLayerVisualInfo *__glutXGetLayerVisualInfo(Display *,
- long, XLayerVisualInfo *, int *);
-extern Status __glutXMatchLayerVisualInfo(Display *,
- int, int, int, int, XLayerVisualInfo *);
-
-#endif /* __layerutil_h__ */
diff --git a/src/glut/os2/libGlut.DEF b/src/glut/os2/libGlut.DEF
deleted file mode 100644
index fb92544ab80..00000000000
--- a/src/glut/os2/libGlut.DEF
+++ /dev/null
@@ -1,94 +0,0 @@
-
-;-----------------------------------------------------
-; def Module definition file for the DLL
-;-----------------------------------------------------
-
-LIBRARY libGlut INITINSTANCE TERMINSTANCE
-PROTMODE
-DATA MULTIPLE NONSHARED READWRITE LOADONCALL
-CODE LOADONCALL
-EXPORTS ; Names of exported functions and data
-
-;*********************************
-;MesaGLUT
- glutCommandFunc @3001
- glutCreateWindow @3002
- glutCreateSubWindow @3003
- glutDestroyWindow @3004
- glutDisplayFunc @3005
- glutEntryFunc @3006
- glutExtensionSupported @3007
- glutIdleFunc @3008
- glutInit @3009
- glutInitDisplayMode @3010
- glutInitWindowPosition @3011
- glutInitWindowSize @3012
- glutMainLoop @3013
- glutGet @3014
- glutGetColor @3015
- glutGetWindow @3016
- glutKeyboardFunc @3017
- glutMouseFunc @3018
- glutSpecialFunc @3019
- glutStrokeCharacter @3020
- glutSetColor @3021
- glutSetIconTitle @3022
- glutSetWindow @3023
- glutSetWindowTitle @3024
-
- glutReshapeFunc @3025
- glutReshapeWindow @3026
-
-
- glutSwapBuffers @3027
- glutPostRedisplay @3028
- glutPositionWindow @3029
- glutVisibilityFunc @3030
- glutTimerFunc @3031
- glutMotionFunc @3032
-
- glutCreateMenu @3033
- glutAttachMenu @3034
- glutDestroyMenu @3035
- glutAddMenuEntry @3036
- glutPassiveMotionFunc @3037
-
- glutSolidCone @3038
- glutSolidCube @3039
- glutSolidDodecahedron @3040
- glutSolidOctahedron @3041
- glutSolidIcosahedron @3042
- glutSolidSphere @3043
- glutSolidTeapot @3044
- glutSolidTetrahedron @3045
- glutSolidTorus @3046
-
- glutWireCone @3047
- glutWireCube @3048
- glutWireDodecahedron @3049
- glutWireIcosahedron @3050
- glutWireOctahedron @3051
- glutWireSphere @3052
- glutWireTetrahedron @3053
- glutWireTorus @3054
- glutWireTeapot @3055
-
-;GL_GLEXT_PROTOTYPES
- glutBitmapCharacter @3101
- glutBitmap9By15 @3102
- glutBitmapHelvetica10 @3103
- glutBitmapHelvetica12 @3104
- glutBitmapHelvetica18 @3105
- glutBitmapTimesRoman24 @3106
- glutStrokeRoman @3107
- glutBitmap8By13 @3108
-
-;Global constants
-; hab @12001
-; /* PM anchor block handle */
-; hpsCurrent @12002
- XHDC @12004
- XHWND @12005
-
-
-
diff --git a/src/glut/os2/os2_glx.cpp b/src/glut/os2/os2_glx.cpp
deleted file mode 100644
index ca345ea05b5..00000000000
--- a/src/glut/os2/os2_glx.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/* os2_glx.c */
-
-#include <stdio.h>
-#include <string.h>
-#include <malloc.h>
-#include "gl/gl.h"
-#include "WarpGL.h"
-#include "GL/os2mesa.h"
-
-#define POKA 0
-/* global current HDC */
-
-XVisualInfo *wglDescribePixelFormat(int iPixelFormat);
-
-extern HDC XHDC;
-extern HWND XHWND;
-//extern HPS hpsCurrent;
-extern HAB hab; /* PM anchor block handle */
-
-GLXContext
-glXCreateContext(HPS hps, XVisualInfo * visinfo,
- GLXContext share, Bool direct)
-{
- /* KLUDGE: GLX really expects a display pointer to be passed
- in as the first parameter, but Win32 needs an HDC instead,
- so BE SURE that the global XHDC is set before calling this
- routine. */
- HGLRC context;
-
- context = wglCreateContext(XHDC,hps,hab);
-
-
- /* Since direct rendering is implicit, the direct flag is
- ignored. */
-
- return context;
-}
-
-
-int
-glXGetConfig(XVisualInfo * visual, int attrib, int *value)
-{
- if (!visual)
- return GLX_BAD_VISUAL;
-
- switch (attrib) {
- case GLX_USE_GL:
- if (visual->dwFlags & (PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW)) {
- /* XXX Brad's Matrix Millenium II has problems creating
- color index windows in 24-bit mode (lead to GDI crash)
- and 32-bit mode (lead to black window). The cColorBits
- filed of the PIXELFORMATDESCRIPTOR returned claims to
- have 24 and 32 bits respectively of color indices. 2^24
- and 2^32 are ridiculously huge writable colormaps.
- Assume that if we get back a color index
- PIXELFORMATDESCRIPTOR with 24 or more bits, the
- PIXELFORMATDESCRIPTOR doesn't really work and skip it.
- -mjk */
- if (visual->iPixelType == PFD_TYPE_COLORINDEX
- && visual->cColorBits >= 24) {
- *value = 0;
- } else {
- *value = 1;
- }
- } else {
- *value = 0;
- }
- break;
- case GLX_BUFFER_SIZE:
- /* KLUDGE: if we're RGBA, return the number of bits/pixel,
- otherwise, return 8 (we guessed at 256 colors in CI
- mode). */
- if (visual->iPixelType == PFD_TYPE_RGBA)
- *value = visual->cColorBits;
- else
- *value = 8;
- break;
- case GLX_LEVEL:
- /* The bReserved flag of the pfd contains the
- overlay/underlay info. */
- *value = visual->bReserved;
- break;
- case GLX_RGBA:
- *value = visual->iPixelType == PFD_TYPE_RGBA;
- break;
- case GLX_DOUBLEBUFFER:
- *value = visual->dwFlags & PFD_DOUBLEBUFFER;
- break;
- case GLX_STEREO:
- *value = visual->dwFlags & PFD_STEREO;
- break;
- case GLX_AUX_BUFFERS:
- *value = visual->cAuxBuffers;
- break;
- case GLX_RED_SIZE:
- *value = visual->cRedBits;
- break;
- case GLX_GREEN_SIZE:
- *value = visual->cGreenBits;
- break;
- case GLX_BLUE_SIZE:
- *value = visual->cBlueBits;
- break;
- case GLX_ALPHA_SIZE:
- *value = visual->cAlphaBits;
- break;
- case GLX_DEPTH_SIZE:
- *value = visual->cDepthBits;
- break;
- case GLX_STENCIL_SIZE:
- *value = visual->cStencilBits;
- break;
- case GLX_ACCUM_RED_SIZE:
- *value = visual->cAccumRedBits;
- break;
- case GLX_ACCUM_GREEN_SIZE:
- *value = visual->cAccumGreenBits;
- break;
- case GLX_ACCUM_BLUE_SIZE:
- *value = visual->cAccumBlueBits;
- break;
- case GLX_ACCUM_ALPHA_SIZE:
- *value = visual->cAccumAlphaBits;
- break;
-#if POKA == 100
-#endif /* POKA == 100 */
- default:
- return GLX_BAD_ATTRIB;
- }
- return 0;
-}
-
-
-XVisualInfo * glXChooseVisual(int mode)
-{ int imode = 2;
- if(mode & GLUT_DOUBLE)
- imode = 1;
- return
- wglDescribePixelFormat(imode);
-}
-
-
-#if POKA
-#endif /* POKA */
-
- \ No newline at end of file
diff --git a/src/glut/os2/os2_menu.cpp b/src/glut/os2/os2_menu.cpp
deleted file mode 100644
index 4eef308e5a9..00000000000
--- a/src/glut/os2/os2_menu.cpp
+++ /dev/null
@@ -1,533 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */
-/* Copyright (c) Nate Robins, 1997. */
-
-/* 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 file completely re-implements glut_menu.c and glut_menu2.c
- for Win32. Note that neither glut_menu.c nor glut_menu2.c are
- compiled into Win32 GLUT. */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "glutint.h"
-
-void (GLUTCALLBACK *__glutMenuStatusFunc) (int, int, int);
-//GLUTmenu *__glutMappedMenu;
-//GLUTwindow *__glutMenuWindow;
-GLUTmenuItem *__glutItemSelected;
-unsigned __glutMenuButton;
-
-static GLUTmenu **menuList = NULL;
-static int menuListSize = 0;
-static UINT uniqueMenuHandler = 1;
-
-/* DEPRICATED, use glutMenuStatusFunc instead. */
-void GLUTAPIENTRY
-glutMenuStateFunc(GLUTmenuStateCB menuStateFunc)
-{
- __glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc;
-}
-
-void GLUTAPIENTRY
-glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc)
-{
- __glutMenuStatusFunc = menuStatusFunc;
-}
-
-void
-__glutSetMenu(GLUTmenu * menu)
-{
- __glutCurrentMenu = menu;
-}
-
-static void
-unmapMenu(GLUTmenu * menu)
-{
- if (menu->cascade) {
- unmapMenu(menu->cascade);
- menu->cascade = NULL;
- }
- menu->anchor = NULL;
- menu->highlighted = NULL;
-}
-
-void
-__glutFinishMenu(Window win, int x, int y)
-{
-
- unmapMenu(__glutMappedMenu);
-
- /* XXX Put in a GdiFlush just in case. Probably unnecessary. -mjk */
-// GdiFlush();
-
- if (__glutMenuStatusFunc) {
- __glutSetWindow(__glutMenuWindow);
- __glutSetMenu(__glutMappedMenu);
-
- /* Setting __glutMappedMenu to NULL permits operations that
- change menus or destroy the menu window again. */
- __glutMappedMenu = NULL;
-
- __glutMenuStatusFunc(GLUT_MENU_NOT_IN_USE, x, y);
- }
- /* Setting __glutMappedMenu to NULL permits operations that
- change menus or destroy the menu window again. */
- __glutMappedMenu = NULL;
-
- /* If an item is selected and it is not a submenu trigger,
- generate menu callback. */
- if (__glutItemSelected && !__glutItemSelected->isTrigger) {
- __glutSetWindow(__glutMenuWindow);
- /* When menu callback is triggered, current menu should be
- set to the callback menu. */
- __glutSetMenu(__glutItemSelected->menu);
- __glutItemSelected->menu->select(__glutItemSelected->value);
- }
- __glutMenuWindow = NULL;
-}
-
-static void
-mapMenu(GLUTmenu * menu, int x, int y)
-{
-//todo
-// TrackPopupMenu((HMENU) menu->win, TPM_LEFTALIGN |
-// (__glutMenuButton == TPM_RIGHTBUTTON) ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON,
-// x, y, 0, __glutCurrentWindow->win, NULL);
-}
-
-void
-__glutStartMenu(GLUTmenu * menu, GLUTwindow * window,
- int x, int y, int x_win, int y_win)
-{
- assert(__glutMappedMenu == NULL);
- __glutMappedMenu = menu;
- __glutMenuWindow = window;
- __glutItemSelected = NULL;
- if (__glutMenuStatusFunc) {
- __glutSetMenu(menu);
- __glutSetWindow(window);
- __glutMenuStatusFunc(GLUT_MENU_IN_USE, x_win, y_win);
- }
- mapMenu(menu, x, y);
-}
-
-GLUTmenuItem *
-__glutGetUniqueMenuItem(GLUTmenu * menu, UINT unique)
-{
- GLUTmenuItem *item;
- int i;
-
- i = menu->num;
- item = menu->list;
- while (item) {
- if (item->unique == unique) {
- return item;
- }
- if (item->isTrigger) {
- GLUTmenuItem *subitem;
- subitem = __glutGetUniqueMenuItem(menuList[item->value], unique);
- if (subitem) {
- return subitem;
- }
- }
- i--;
- item = item->next;
- }
- return NULL;
-}
-
-GLUTmenuItem *
-__glutGetMenuItem(GLUTmenu * menu, Window win, int *which)
-{
- GLUTmenuItem *item;
- int i;
-
- i = menu->num;
- item = menu->list;
- while (item) {
- if (item->win == win) {
- *which = i;
- return item;
- }
- if (item->isTrigger) {
- GLUTmenuItem *subitem;
-
- subitem = __glutGetMenuItem(menuList[item->value],
- win, which);
- if (subitem) {
- return subitem;
- }
- }
- i--;
- item = item->next;
- }
- return NULL;
-}
-
-GLUTmenu *
-__glutGetMenu(Window win)
-{
- GLUTmenu *menu;
-
- menu = __glutMappedMenu;
- while (menu) {
- if (win == menu->win) {
- return menu;
- }
- menu = menu->cascade;
- }
- return NULL;
-}
-
-GLUTmenu *
-__glutGetMenuByNum(int menunum)
-{
- if (menunum < 1 || menunum > menuListSize) {
- return NULL;
- }
- return menuList[menunum - 1];
-}
-
-static int
-getUnusedMenuSlot(void)
-{
- int i;
-
- /* Look for allocated, unused slot. */
- for (i = 0; i < menuListSize; i++) {
- if (!menuList[i]) {
- return i;
- }
- }
- /* Allocate a new slot. */
- menuListSize++;
- if (menuList) {
- menuList = (GLUTmenu **)
- realloc(menuList, menuListSize * sizeof(GLUTmenu *));
- } else {
- /* XXX Some realloc's do not correctly perform a malloc
- when asked to perform a realloc on a NULL pointer,
- though the ANSI C library spec requires this. */
- menuList = (GLUTmenu **) malloc(sizeof(GLUTmenu *));
- }
- if (!menuList) {
- __glutFatalError("out of memory.");
- }
- menuList[menuListSize - 1] = NULL;
- return menuListSize - 1;
-}
-
-static void
-menuModificationError(void)
-{
- /* XXX Remove the warning after GLUT 3.0. */
- __glutWarning("The following is a new check for GLUT 3.0; update your code.");
- __glutFatalError("menu manipulation not allowed while menus in use.");
-}
-
-int GLUTAPIENTRY
-glutCreateMenu(GLUTselectCB selectFunc)
-{
- GLUTmenu *menu;
- int menuid;
-
- if (__glutMappedMenu) {
- menuModificationError();
- }
- menuid = getUnusedMenuSlot();
- menu = (GLUTmenu *) malloc(sizeof(GLUTmenu));
- if (!menu) {
- __glutFatalError("out of memory.");
- }
- menu->id = menuid;
- menu->num = 0;
- menu->submenus = 0;
- menu->select = selectFunc;
- menu->list = NULL;
- menu->cascade = NULL;
- menu->highlighted = NULL;
- menu->anchor = NULL;
-//todo
-// menu->win = (HWND) CreatePopupMenu();
- menuList[menuid] = menu;
- __glutSetMenu(menu);
- return menuid + 1;
-}
-
-
-void GLUTAPIENTRY
-glutDestroyMenu(int menunum)
-{
- GLUTmenu *menu = __glutGetMenuByNum(menunum);
- GLUTmenuItem *item, *next;
-
- if (__glutMappedMenu) {
- menuModificationError();
- }
- assert(menu->id == menunum - 1);
-//todo DestroyMenu( (HMENU) menu->win);
- menuList[menunum - 1] = NULL;
- /* free all menu entries */
- item = menu->list;
- while (item) {
- assert(item->menu == menu);
- next = item->next;
- free(item->label);
- free(item);
- item = next;
- }
- if (__glutCurrentMenu == menu) {
- __glutCurrentMenu = NULL;
- }
- free(menu);
-}
-
-int GLUTAPIENTRY
-glutGetMenu(void)
-{
- if (__glutCurrentMenu) {
- return __glutCurrentMenu->id + 1;
- } else {
- return 0;
- }
-}
-
-void GLUTAPIENTRY
-glutSetMenu(int menuid)
-{
- GLUTmenu *menu;
-
- if (menuid < 1 || menuid > menuListSize) {
- __glutWarning("glutSetMenu attempted on bogus menu.");
- return;
- }
- menu = menuList[menuid - 1];
- if (!menu) {
- __glutWarning("glutSetMenu attempted on bogus menu.");
- return;
- }
- __glutSetMenu(menu);
-}
-
-static void
-setMenuItem(GLUTmenuItem * item, const char *label,
- int value, Bool isTrigger)
-{
- GLUTmenu *menu;
-
- menu = item->menu;
- item->label = __glutStrdup(label);
- if (!item->label) {
- __glutFatalError("out of memory.");
- }
- item->isTrigger = isTrigger;
- item->len = (int) strlen(label);
- item->value = value;
- item->unique = uniqueMenuHandler++;
-//todo
-// if (isTrigger) {
-// AppendMenu((HMENU) menu->win, MF_POPUP, (UINT)item->win, label);
-// } else {
-// AppendMenu((HMENU) menu->win, MF_STRING, item->unique, label);
-// }
-}
-
-void GLUTAPIENTRY
-glutAddMenuEntry(const char *label, int value)
-{
- GLUTmenuItem *entry;
-
- if (__glutMappedMenu) {
- menuModificationError();
- }
- entry = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem));
- if (!entry) {
- __glutFatalError("out of memory.");
- }
- entry->menu = __glutCurrentMenu;
- setMenuItem(entry, label, value, FALSE);
- __glutCurrentMenu->num++;
- entry->next = __glutCurrentMenu->list;
- __glutCurrentMenu->list = entry;
-}
-
-void GLUTAPIENTRY
-glutAddSubMenu(const char *label, int menu)
-{
- GLUTmenuItem *submenu;
- GLUTmenu *popupmenu;
-
- if (__glutMappedMenu) {
- menuModificationError();
- }
- submenu = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem));
- if (!submenu) {
- __glutFatalError("out of memory.");
- }
- __glutCurrentMenu->submenus++;
- submenu->menu = __glutCurrentMenu;
- popupmenu = __glutGetMenuByNum(menu);
- if (popupmenu) {
- submenu->win = popupmenu->win;
- }
- setMenuItem(submenu, label, /* base 0 */ menu - 1, TRUE);
- __glutCurrentMenu->num++;
- submenu->next = __glutCurrentMenu->list;
- __glutCurrentMenu->list = submenu;
-}
-
-void GLUTAPIENTRY
-glutChangeToMenuEntry(int num, const char *label, int value)
-{
- GLUTmenuItem *item;
- int i;
-
- if (__glutMappedMenu) {
- menuModificationError();
- }
- i = __glutCurrentMenu->num;
- item = __glutCurrentMenu->list;
- while (item) {
- if (i == num) {
- if (item->isTrigger) {
- /* If changing a submenu trigger to a menu entry, we
- need to account for submenus. */
- item->menu->submenus--;
- /* Nuke the Win32 menu. */
-//todo
-// DestroyMenu((HMENU) item->win);
- }
- free(item->label);
-
- item->label = strdup(label);
- if (!item->label)
- __glutFatalError("out of memory");
- item->isTrigger = FALSE;
- item->len = (int) strlen(label);
- item->value = value;
- item->unique = uniqueMenuHandler++;
-//todo
-// ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1,
-// MF_BYPOSITION | MFT_STRING, item->unique, label);
-
- return;
- }
- i--;
- item = item->next;
- }
- __glutWarning("Current menu has no %d item.", num);
-}
-
-void GLUTAPIENTRY
-glutChangeToSubMenu(int num, const char *label, int menu)
-{
- GLUTmenu *popupmenu;
- GLUTmenuItem *item;
- int i;
-
- if (__glutMappedMenu) {
- menuModificationError();
- }
- i = __glutCurrentMenu->num;
- item = __glutCurrentMenu->list;
- while (item) {
- if (i == num) {
- if (!item->isTrigger) {
- /* If changing a menu entry to as submenu trigger, we
- need to account for submenus. */
- item->menu->submenus++;
-//todo
-// item->win = (HWND) CreatePopupMenu();
- }
- free(item->label);
-
- item->label = strdup(label);
- if (!item->label)
- __glutFatalError("out of memory");
- item->isTrigger = TRUE;
- item->len = (int) strlen(label);
- item->value = menu - 1;
- item->unique = uniqueMenuHandler++;
- popupmenu = __glutGetMenuByNum(menu);
- if (popupmenu)
- item->win = popupmenu->win;
-//todo
-// ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1,
-// MF_BYPOSITION | MF_POPUP, (UINT) item->win, label);
- return;
- }
- i--;
- item = item->next;
- }
- __glutWarning("Current menu has no %d item.", num);
-}
-
-void GLUTAPIENTRY
-glutRemoveMenuItem(int num)
-{
- GLUTmenuItem *item, **prev;
- int i;
-
- if (__glutMappedMenu) {
- menuModificationError();
- }
- i = __glutCurrentMenu->num;
- prev = &__glutCurrentMenu->list;
- item = __glutCurrentMenu->list;
- while (item) {
- if (i == num) {
- /* Found the menu item in list to remove. */
- __glutCurrentMenu->num--;
-
- /* Patch up menu's item list. */
- *prev = item->next;
-//todo
-// RemoveMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, MF_BYPOSITION);
-
- free(item->label);
- free(item);
- return;
- }
- i--;
- prev = &item->next;
- item = item->next;
- }
- __glutWarning("Current menu has no %d item.", num);
-}
-
-void GLUTAPIENTRY
-glutAttachMenu(int button)
-{
- if (__glutCurrentWindow == __glutGameModeWindow) {
- __glutWarning("cannot attach menus in game mode.");
- return;
- }
- if (__glutMappedMenu) {
- menuModificationError();
- }
- if (__glutCurrentWindow->menu[button] < 1) {
- __glutCurrentWindow->buttonUses++;
- }
- __glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1;
-}
-
-void GLUTAPIENTRY
-glutDetachMenu(int button)
-{
- if (__glutMappedMenu) {
- menuModificationError();
- }
- if (__glutCurrentWindow->menu[button] > 0) {
- __glutCurrentWindow->buttonUses--;
- __glutCurrentWindow->menu[button] = 0;
- }
-}
-
- \ No newline at end of file
diff --git a/src/glut/os2/os2_winproc.cpp b/src/glut/os2/os2_winproc.cpp
deleted file mode 100644
index e2d4ba9d550..00000000000
--- a/src/glut/os2/os2_winproc.cpp
+++ /dev/null
@@ -1,1297 +0,0 @@
-/* os2_winproc.c */
-
-
-#define INCL_DEV
-#include "WarpGL.h"
-#include "GL/os2mesa.h"
-
-
-#define _MEERROR_H_
-#include <mmioos2.h> /* It is from MMPM toolkit */
-#include <dive.h>
-#include <fourcc.h>
-
-
-#include "os2mesadef.h"
-#include "glutint.h"
-
-
-#define POKA 0
-
-#if POKA
-
-extern unsigned __glutMenuButton;
-extern GLUTidleCB __glutIdleFunc;
-extern GLUTtimer *__glutTimerList;
-extern void handleTimeouts(void);
-extern GLUTmenuItem *__glutGetUniqueMenuItem(GLUTmenu * menu, int unique);
-static HMENU __glutHMenu;
-
-#endif
-
-extern void _mesa_ResizeBuffersMESA( void );
-
-
-MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
-MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
-void updateWindowState(GLUTwindow *window, int visState);
-
-volatile extern HAB hab; /* PM anchor block handle */
-volatile extern HPS hpsCurrent;
-
-RECTL rCtls[52];
-ULONG ulNumRcls;
-
-MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
-{ MRESULT rc;
- rc = GlutWindowProc(hwnd, msg, mp1, mp2 );
- return rc;
-}
-
-MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
-{
- HPS hps = NULLHANDLE; /* presentation space handle */
- GLUTwindow* window; /* GLUT window associated with message. */
- GLUTmenu* menu; /* GLUT menu associated with message. */
- RECTL rclClient;
- POINTL point;
- int button = -1,rc,key;
-
-
-/* Process the message. */
-
- switch( msg )
- {
- case WM_CREATE:
- {
- SIZEL sizl = { 0L, 0L };
- LONG *alCaps;
- HDC hdc;
-
- /*+-----------------------------------------------------------------+*/
- /*| The client window is being created. Create the semaphore to |*/
- /*| control access to the presentation space. Then create the |*/
- /*| thread that will draw the lines. |*/
- /*+-----------------------------------------------------------------+*/
- // DosCreateMutexSem( (PSZ)NULL, &hmtxPS, 0UL, FALSE );
-
- hdc = WinOpenWindowDC(hwnd);
-
- /*+-----------------------------------------------------------------+*/
- /*| Create a non-cached presentation space. We will not release |*/
- /*| this PS, as we will be Selecting a Palette to this PS and then |*/
- /*| animating the palette. Upon releasing a PS the palette is no |*/
- /*| longer selected for obvious reasons. |*/
- /*+-----------------------------------------------------------------+*/
- hpsCurrent = GpiCreatePS( hab,
- hdc,
- &sizl,
- PU_PELS | GPIF_DEFAULT |
- GPIT_MICRO | GPIA_ASSOC );
-// DevQueryCaps( hdc, lStart, lCount, alCaps );
-// fPaletteCaps = alCaps[CAPS_ADDITIONAL_GRAPHICS] & CAPS_PALETTE_MANAGER;
-// PaletteInit(3);
- /* ¯¥p¥¢®¤ hpsBuffer ¢ p¥¦¨¬ RGB color table */
-
- GpiCreateLogColorTable(hpsCurrent,0 ,LCOLF_RGB,0,0,NULL);
- GpiSetPattern(hpsCurrent,PATSYM_SOLID);
- GpiSetPatternSet(hpsCurrent,LCID_DEFAULT);
-
- }
- break;
-
- return 0;
- case WM_CLOSE:
- WinPostMsg( hwnd, WM_QUIT, NULL, NULL );
-
- return 0;
-
- case WM_PAINT:
- window = __glutGetWindow(hwnd);
- if (window)
- {
- PWMC ctx;
-// hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient);
- hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient);
- // blit Dive buffer to screen.
-
- {
- SWP swp; // Window position
- POINTL pointl; // Point to offset from Desktop
-
- // Convert the point to offset from desktop lower left.
- pointl.x = 0;
- pointl.y = 0;
- WinMapWindowPoints ( hwnd, HWND_DESKTOP, &pointl, 1 );
-
-
-// ctx = window->ctx;
-// ctx->xDiveScr = pointl.x;
-// ctx->yDiveScr = pointl.y;
- }
-// rc = DiveBlitImage (ctx->hDive,
-// ctx->ulDiveBufferNumber,
-// DIVE_BUFFER_SCREEN );
-//
-
- if (window->win == hwnd) {
- __glutPostRedisplay(window, GLUT_REPAIR_WORK);
- } else if (window->overlay && window->overlay->win == hwnd) {
- __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK);
- }
- WinEndPaint(hps);
- } else {
-
- hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient);
- WinFillRect(hps, &rclClient, CLR_WHITE);
- WinEndPaint(hps);
- }
- break;
-
- case WM_VRNDISABLED:
-
-// pwinData->fDataInProcess = TRUE;
-// DiveSetupBlitter ( pwinData->hDive, 0 );
-// pwinData->fVrnDisabled = TRUE;
- break;
-
- case WM_VRNENABLED:
- { HRGN hrgn; /* Region handle */
- RGNRECT rgnCtl; /* Processing control structure */
-// RECTL rCtls[52];
-// ULONG ulNumRcls;
-
-// pwinData->fDataInProcess = TRUE;
- hps = WinGetPS ( hwnd );
- if ( !hps )
- break;
- hrgn = GpiCreateRegion ( hps, 0L, NULL );
- if ( hrgn )
- { /* NOTE: If mp1 is zero, then this was just a move message.
- ** Illustrate the visible region on a WM_VRNENABLE.
- */
- WinQueryVisibleRegion ( hwnd, hrgn );
- rgnCtl.ircStart = 0;
- rgnCtl.crc = 50;
- rgnCtl.ulDirection = 1;
-
- /* Get the all ORed rectangles */
- if ( GpiQueryRegionRects ( hps, hrgn, NULL,
- &rgnCtl, rCtls) )
- {
- ulNumRcls = rgnCtl.crcReturned;
-
- /* Now find the window position and size, relative to parent.
- */
-// WinQueryWindowPos ( pwinData->hwndClient, &pwinData->swp );
-
-// rcl.xLeft = 0;
-// rcl.yBottom = 0;
-
- /* Convert the point to offset from desktop lower left.
- */
-// pointl.x = pwinData->swp.x;
-// pointl.y = pwinData->swp.y;
-
-// WinMapWindowPoints ( pwinData->hwndFrame,
-// HWND_DESKTOP, &pointl, 1 );
-
-// pwinData->cxWindowPos = pointl.x;
-// pwinData->cyWindowPos = pointl.y;
-
- }
- GpiDestroyRegion( hps, hrgn );
- }
- WinReleasePS( hps );
-
- }
- break;
-
- case WM_SIZE:
- window = __glutGetWindow(hwnd);
- if (window)
- { int width,height;
- width = SHORT1FROMMP(mp2);
- height = SHORT2FROMMP(mp2);
- if (width != window->width || height != window->height) {
-#if 0 /* Win32 GLUT does not support overlays for now. */
- if (window->overlay) {
- XResizeWindow(__glutDisplay, window->overlay->win, width, height);
- }
-#endif
- window->width = width;
- window->height = height;
- __glutSetWindow(window);
- if(width <= 0 || height <= 0)
- break;
- _mesa_ResizeBuffersMESA();
-
- /* Do not execute OpenGL out of sequence with respect
- to the SetWindowPos request! */
- window->reshape(width, height);
- window->forceReshape = FALSE;
- /* A reshape should be considered like posting a
- repair request. */
- __glutPostRedisplay(window, GLUT_REPAIR_WORK);
- }
- }
- return 0;
- case WM_SHOW:
- window = __glutGetWindow(hwnd);
- if (window) {
- int visState;
- visState = SHORT1FROMMP( mp1 );
- updateWindowState(window, visState);
- }
- return 0;
-
- case WM_ACTIVATE:
- window = __glutGetWindow(hwnd);
-// /* Make sure we re-select the correct palette if needed. */
-// if (LOWORD(wParam)) {
-// PostMessage(hwnd, WM_PALETTECHANGED, 0, 0);
-// }
- if (window) {
- int visState;
- visState = SHORT1FROMMP( mp1 );
- updateWindowState(window, visState);
- }
- return 0;
-
- case WM_CHAR:
- { USHORT fsflags;
- window = __glutGetWindow(hwnd);
- if (!window) {
- break;
- }
- fsflags = SHORT1FROMMP(mp1);
-/* ?? */
- if((fsflags & KC_KEYUP) ) /* ¨£­®p¨p㥬 ®â¦ â¨¥ ª­®¯ª¨, p¥ £¨p㥬 ⮫쪮 ­  ­ ¦ â¨¥ */
- break;
-///////////////////////////////////////////////////
- if(!(fsflags & KC_CHAR) )
- {
- if (!(fsflags & KC_VIRTUALKEY))
- break;
- key = 0;
- /* Get the virtual key from mp2. */
- switch (SHORT2FROMMP(mp2))
- {
-/* directional keys */
- case VK_LEFT: key = GLUT_KEY_LEFT; break;
- case VK_UP: key = GLUT_KEY_UP; break;
- case VK_RIGHT: key = GLUT_KEY_RIGHT; break;
- case VK_DOWN: key = GLUT_KEY_DOWN; break;
-
- case VK_PAGEUP: key = GLUT_KEY_PAGE_UP; break;
- case VK_PAGEDOWN:key = GLUT_KEY_PAGE_DOWN; break;
- case VK_HOME: key = GLUT_KEY_HOME;break;
- case VK_END: key = GLUT_KEY_END; break;
- case VK_INSERT: key = GLUT_KEY_INSERT; break;
-
-/* function keys */
- case VK_F1 : key = GLUT_KEY_F1; break;
- case VK_F2 : key = GLUT_KEY_F2; break;
- case VK_F3 : key = GLUT_KEY_F3; break;
- case VK_F4 : key = GLUT_KEY_F4; break;
- case VK_F5 : key = GLUT_KEY_F5; break;
- case VK_F6 : key = GLUT_KEY_F6; break;
- case VK_F7 : key = GLUT_KEY_F7; break;
- case VK_F8 : key = GLUT_KEY_F8; break;
- case VK_F9 : key = GLUT_KEY_F9; break;
- case VK_F10: key = GLUT_KEY_F10;break;
- case VK_F11: key = GLUT_KEY_F11; break;
- case VK_F12: key = GLUT_KEY_F12; break;
- case VK_ESC: key = -1; break; /* Character codes */
- case VK_SPACE: key = -1; break;
- case VK_TAB: key = -1; break;
- }
- if(!key)
- { break; /* Key Not implemented */
- }
- if(key > 0)
- { if (!window->special) /* ­¥ ãáâ ­®¢«¥­® ®¡à ¡®â稪  */
- break;
-
- WinQueryPointerPos(HWND_DESKTOP,&point);
- ScreenToClient(window->win, &point);
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if(WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* high order bit is on */
- __glutModifierMask |= ShiftMask;
- if(WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000)
- __glutModifierMask |= ControlMask;
- if(WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000)
- __glutModifierMask |= Mod1Mask;
- window->special(key, point.x, point.y);
- __glutModifierMask = (unsigned int) ~0;
- return 0;
- }
-
- }
-/////////////////////////////////////////////////////
- /* If we are ignoring auto repeated key strokes for the window, bail. */
- if (window->ignoreKeyRepeat && (CHAR3FROMMP(mp1)) )
- break;
- if(!((unsigned char)SHORT1FROMMP(mp2)) ) /* ¨£­®p¨p㥬 ­¥á¨¬¢®«ì­ë¥ ª®¤ë */
- break;
- if (window->keyboard) {
- WinQueryPointerPos(HWND_DESKTOP,&point);
-
- ScreenToClient(window->win, &point);
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if(WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* high order bit is on */
- __glutModifierMask |= ShiftMask;
- if(WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000)
- __glutModifierMask |= ControlMask;
- if(WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000)
- __glutModifierMask |= Mod1Mask;
- window->keyboard((unsigned char)SHORT1FROMMP(mp2), point.x, point.y);
- __glutModifierMask = (unsigned int) ~0;
- }
- return 0;
- } /* endof case WM_CHAR: */
-////////////////////////////////////////////////
- case WM_BUTTON1DOWN:
- button = GLUT_LEFT_BUTTON;
- case WM_BUTTON3DOWN:
- if (button < 0)
- button = GLUT_MIDDLE_BUTTON;
- case WM_BUTTON2DOWN:
- if (button < 0)
- button = GLUT_RIGHT_BUTTON;
- { POINTS psh;
- psh = *((POINTS *)&mp1);
- point.x = psh.x;
- point.y = psh.y;
- }
- /* finish the menu if we get a button down message (user must have
- cancelled the menu). */
- if (__glutMappedMenu) {
- /* TODO: take this out once the menu on middle mouse stuff works
- properly. */
- if (button == GLUT_MIDDLE_BUTTON)
- return 0;
- /* get current mouse pointer position */
-// WinQueryPointerPos(HWND_DESKTOP,&point);
- /* map from desktop to client window */
-// WinMapWindowPoints(HWND_DESKTOP, hwnd, &point, 1);
- __glutItemSelected = NULL;
- __glutFinishMenu(hwnd, point.x, point.y);
- return 0;
- }
- window = __glutGetWindow(hwnd);
- if (window) {
- window->buttonDownState = button+1;
- menu = __glutGetMenuByNum(window->menu[button]);
- if (menu) {
-//todo
-// __glutMenuButton = button == GLUT_RIGHT_BUTTON ? TPM_RIGHTBUTTON :
-// button == GLUT_LEFT_BUTTON ? TPM_LEFTBUTTON :
-// 0x0001;
-// __glutStartMenu(menu, window, point.x, point.y, x, y);
- } else if (window->mouse) {
-
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* < 0 = high order bit is on. */
- __glutModifierMask |= ShiftMask;
- if (WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000)
- __glutModifierMask |= ControlMask;
- if (WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000)
- __glutModifierMask |= Mod1Mask;
- window->mouse(button, GLUT_DOWN, point.x, point.y);
- __glutModifierMask = (unsigned int)~0;
- } else {
- /* Stray mouse events. Ignore. */
- }
- }
- return 0;
-
- break;
-/********************************************/
- case WM_BUTTON1UP:
- button = GLUT_LEFT_BUTTON;
- case WM_BUTTON3UP:
- if (button < 0)
- button = GLUT_MIDDLE_BUTTON;
- case WM_BUTTON2UP:
- if (button < 0)
- button = GLUT_RIGHT_BUTTON;
- { POINTS psh;
- psh = *((POINTS *)&mp1);
- point.x = psh.x;
- point.y = psh.y;
- }
- /* Bail out if we're processing a menu. */
- /* Bail out = ¢ë¡à®á¨âìáï á ¯ à èã⮬ */
- if (__glutMappedMenu) {
- WinQueryPointerPos(HWND_DESKTOP,&point);
- WinMapWindowPoints(HWND_DESKTOP, hwnd, &point, 1);
- /* if we're getting the middle button up signal, then something
- on the menu was selected. */
- if (button == GLUT_MIDDLE_BUTTON) {
- return 0;
- /* For some reason, the code below always returns -1 even
- though the point IS IN THE ITEM! Therefore, just bail out if
- we get a middle mouse up. The user must select using the
- left mouse button. Stupid Win32. */
-#if 0
- int item = MenuItemFromPoint(hwnd, __glutHMenu, point);
- if (item != -1)
- __glutItemSelected = (GLUTmenuItem*)GetMenuItemID(__glutHMenu, item);
- else
- __glutItemSelected = NULL;
- __glutFinishMenu(hwnd, point.x, point.y);
-#endif
- } else {
- __glutItemSelected = NULL;
- __glutFinishMenu(hwnd, point.x, point.y);
- }
- return 0;
- }
-
- window = __glutGetWindow(hwnd);
- if(window)
- window->buttonDownState = 0;
-
- if (window && window->mouse) {
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* < 0 = high order bit is on */
- __glutModifierMask |= ShiftMask;
- if (WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000)
- __glutModifierMask |= ControlMask;
- if (WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000)
- __glutModifierMask |= Mod1Mask;
- window->mouse(button, GLUT_UP, point.x, point.y);
-
- __glutModifierMask = (unsigned int)~0;
- } else {
- /* Window might have been destroyed and all the
- events for the window may not yet be received. */
- }
- return 0;
-
-
- break;
-//////////////////////////////////////////////////
- case WM_COMMAND:
- window = __glutGetWindow(hwnd);
- if (window)
- { if (window->wm_command)
- window->wm_command(hwnd,mp1,mp2);
- }
- break;
-
- case WM_MOUSEMOVE:
- if (!__glutMappedMenu) {
- window = __glutGetWindow(hwnd);
- if (window) {
- /* If motion function registered _and_ buttons held *
- down, call motion function... */
- { POINTS psh;
- psh = *((POINTS *)&mp1);
- point.x = psh.x;
- point.y = psh.y;
- }
-
- if (window->motion && window->buttonDownState) {
- __glutSetWindow(window);
- window->motion(point.x, point.y);
- }
- /* If passive motion function registered _and_
- buttons not held down, call passive motion
- function... */
- else if (window->passive && !window->buttonDownState) {
- __glutSetWindow(window);
- window->passive(point.x, point.y);
- }
- }
- } else {
- /* Motion events are thrown away when a pop up menu is
- active. */
- }
- return 0;
-
-
- default:
- /* For all other messages, let the default window procedure process them. */
- return ( WinDefWindowProc( hwnd, msg, mp1, mp2 ) );
-
- } //endof switch( msg )
- return ( WinDefWindowProc( hwnd, msg, mp1, mp2 ) );
-// return NULL;
-}
-
-void APIENTRY glutCommandFunc(GLUTcommandCB Func)
-{
-extern GLUTwindow *__glutCurrentWindow;
- __glutCurrentWindow->wm_command = Func;
-}
-
-
-
-
-void
-updateWindowState(GLUTwindow *window, int visState)
-{
- GLUTwindow* child;
-
- /* XXX shownState and visState are the same in Win32. */
- window->shownState = visState;
- if (visState != window->visState) {
- if (window->windowStatus) {
- window->visState = visState;
- __glutSetWindow(window);
- window->windowStatus(visState);
- }
- }
- /* Since Win32 only sends an activate for the toplevel window,
- update the visibility for all the child windows. */
- child = window->children;
- while (child) {
- updateWindowState(child, visState);
- child = child->siblings;
- }
-}
-
-#if POKA
-
-LONG WINAPI
-__glutWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- POINT point; /* Point structure. */
- PAINTSTRUCT ps; /* Paint structure. */
- LPMINMAXINFO minmax; /* Minimum/maximum info structure. */
- GLUTwindow* window; /* GLUT window associated with message. */
- GLUTmenu* menu; /* GLUT menu associated with message. */
- int x, y, width, height, key;
- int button = -1;
-
- switch(msg) {
- case WM_CREATE:
- return 0;
- case WM_CLOSE:
- PostQuitMessage(0);
- return 0;
-#if 0
- case WM_DESTROY:
- /* XXX NVidia's NT OpenGL can have problems closing down
- its OpenGL internal data structures if we just allow
- the process to terminate without unbinding and deleting
- the windows context. Apparently, DirectDraw unloads
- before OPENGL32.DLL in the close down sequence, but
- NVidia's NT OpenGL needs DirectDraw to close down its
- data structures. */
- window = __glutGetWindow(hwnd);
- if (window) {
- if (window->ctx) {
- wglMakeCurrent(NULL, NULL);
- wglDeleteContext(window->ctx);
- }
- }
- return 0;
-#endif
-
- case WM_SYSKEYUP:
- case WM_KEYUP:
- window = __glutGetWindow(hwnd);
- if (!window) {
- break;
- }
- /* Win32 is dumb and sends these messages only to the parent
- window. Therefore, find out if we're in a child window and
- call the child windows keyboard callback if we are. */
- if (window->parent) {
- GetCursorPos(&point);
- ScreenToClient(hwnd, &point);
- hwnd = ChildWindowFromPoint(hwnd, point);
- window = __glutGetWindow(hwnd);
- }
- if (window->specialUp || window->keyboardUp) {
- GetCursorPos(&point);
- ScreenToClient(window->win, &point);
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */
- __glutModifierMask |= ShiftMask;
- if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */
- __glutModifierMask |= ControlMask;
- if (GetKeyState(VK_MENU) < 0)
- __glutModifierMask |= Mod1Mask;
- switch (wParam) {
- /* *INDENT-OFF* */
- case VK_F1: key = GLUT_KEY_F1; break;
- case VK_F2: key = GLUT_KEY_F2; break;
- case VK_F3: key = GLUT_KEY_F3; break;
- case VK_F4: key = GLUT_KEY_F4; break;
- case VK_F5: key = GLUT_KEY_F5; break;
- case VK_F6: key = GLUT_KEY_F6; break;
- case VK_F7: key = GLUT_KEY_F7; break;
- case VK_F8: key = GLUT_KEY_F8; break;
- case VK_F9: key = GLUT_KEY_F9; break;
- case VK_F10: key = GLUT_KEY_F10; break;
- case VK_F11: key = GLUT_KEY_F11; break;
- case VK_F12: key = GLUT_KEY_F12; break;
- case VK_LEFT: key = GLUT_KEY_LEFT; break;
- case VK_UP: key = GLUT_KEY_UP; break;
- case VK_RIGHT: key = GLUT_KEY_RIGHT; break;
- case VK_DOWN: key = GLUT_KEY_DOWN; break;
- case VK_PRIOR: key = GLUT_KEY_PAGE_UP; break;
- case VK_NEXT: key = GLUT_KEY_PAGE_DOWN; break;
- case VK_HOME: key = GLUT_KEY_HOME; break;
- case VK_END: key = GLUT_KEY_END; break;
- case VK_INSERT: key = GLUT_KEY_INSERT; break;
- case VK_DELETE:
- /* Delete is an ASCII character. */
- if (window->keyboardUp) {
- window->keyboardUp((unsigned char) 127, point.x, point.y);
- }
- return 0;
- /* *INDENT-ON* */
- default:
- if (window->keyboardUp) {
- key = MapVirtualKey(wParam, 2); /* Map to ASCII. */
- if (isascii(key) && (key != 0)) {
-
- /* XXX Attempt to determine modified ASCII character
- is quite incomplete. Digits, symbols, CapsLock,
- Ctrl, and numeric keypad are all ignored. Fix this. */
-
- if (!(__glutModifierMask & ShiftMask))
- key = tolower(key);
- window->keyboardUp((unsigned char) key, point.x, point.y);
- }
- }
- __glutModifierMask = (unsigned int) ~0;
- return 0;
- }
- if (window->specialUp) {
- window->specialUp(key, point.x, point.y);
- }
- __glutModifierMask = (unsigned int) ~0;
- }
- return 0;
-
- case WM_SYSCHAR:
- case WM_CHAR:
- window = __glutGetWindow(hwnd);
- if (!window) {
- break;
- }
-
- /* Bit 30 of lParam is set if key already held down. If
- we are ignoring auto repeated key strokes for the window, bail. */
- if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) {
- break;
- }
-
- /* Win32 is dumb and sends these messages only to the parent
- window. Therefore, find out if we're in a child window and
- call the child windows keyboard callback if we are. */
- if (window->parent) {
- GetCursorPos(&point);
- ScreenToClient(hwnd, &point);
- hwnd = ChildWindowFromPoint(hwnd, point);
- window = __glutGetWindow(hwnd);
- }
- if (window->keyboard) {
- GetCursorPos(&point);
- ScreenToClient(window->win, &point);
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */
- __glutModifierMask |= ShiftMask;
- if (GetKeyState(VK_CONTROL) < 0)
- __glutModifierMask |= ControlMask;
- if (GetKeyState(VK_MENU) < 0)
- __glutModifierMask |= Mod1Mask;
- window->keyboard((unsigned char)wParam, point.x, point.y);
- __glutModifierMask = (unsigned int) ~0;
- }
- return 0;
-
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- window = __glutGetWindow(hwnd);
- if (!window) {
- break;
- }
-
- /* Bit 30 of lParam is set if key already held down. If
- we are ignoring auto repeated key strokes for the window, bail. */
- if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) {
- break;
- }
-
- /* Win32 is dumb and sends these messages only to the parent
- window. Therefore, find out if we're in a child window and
- call the child windows keyboard callback if we are. */
- if (window->parent) {
- GetCursorPos(&point);
- ScreenToClient(hwnd, &point);
- hwnd = ChildWindowFromPoint(hwnd, point);
- window = __glutGetWindow(hwnd);
- }
- if (window->special) {
- switch (wParam) {
- /* *INDENT-OFF* */
- /* function keys */
- case VK_F1: key = GLUT_KEY_F1; break;
- case VK_F2: key = GLUT_KEY_F2; break;
- case VK_F3: key = GLUT_KEY_F3; break;
- case VK_F4: key = GLUT_KEY_F4; break;
- case VK_F5: key = GLUT_KEY_F5; break;
- case VK_F6: key = GLUT_KEY_F6; break;
- case VK_F7: key = GLUT_KEY_F7; break;
- case VK_F8: key = GLUT_KEY_F8; break;
- case VK_F9: key = GLUT_KEY_F9; break;
- case VK_F10: key = GLUT_KEY_F10; break;
- case VK_F11: key = GLUT_KEY_F11; break;
- case VK_F12: key = GLUT_KEY_F12; break;
- /* directional keys */
- case VK_LEFT: key = GLUT_KEY_LEFT; break;
- case VK_UP: key = GLUT_KEY_UP; break;
- case VK_RIGHT: key = GLUT_KEY_RIGHT; break;
- case VK_DOWN: key = GLUT_KEY_DOWN; break;
- /* *INDENT-ON* */
-
- case VK_PRIOR:
- /* VK_PRIOR is Win32's Page Up */
- key = GLUT_KEY_PAGE_UP;
- break;
- case VK_NEXT:
- /* VK_NEXT is Win32's Page Down */
- key = GLUT_KEY_PAGE_DOWN;
- break;
- case VK_HOME:
- key = GLUT_KEY_HOME;
- break;
- case VK_END:
- key = GLUT_KEY_END;
- break;
- case VK_INSERT:
- key = GLUT_KEY_INSERT;
- break;
- case VK_DELETE:
- goto handleDelete;
- default:
- goto defproc;
- }
- GetCursorPos(&point);
- ScreenToClient(window->win, &point);
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */
- __glutModifierMask |= ShiftMask;
- if (GetKeyState(VK_CONTROL) < 0)
- __glutModifierMask |= ControlMask;
- if (GetKeyState(VK_MENU) < 0)
- __glutModifierMask |= Mod1Mask;
- window->special(key, point.x, point.y);
- __glutModifierMask = (unsigned int) ~0;
- } else if (window->keyboard) {
- /* Specially handle any keys that match ASCII values but
- do not generate Windows WM_SYSCHAR or WM_CHAR messages. */
- switch (wParam) {
- case VK_DELETE:
- handleDelete:
- /* Delete is an ASCII character. */
- GetCursorPos(&point);
- ScreenToClient(window->win, &point);
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */
- __glutModifierMask |= ShiftMask;
- if (GetKeyState(VK_CONTROL) < 0)
- __glutModifierMask |= ControlMask;
- if (GetKeyState(VK_MENU) < 0)
- __glutModifierMask |= Mod1Mask;
- window->keyboard((unsigned char) 127, point.x, point.y);
- __glutModifierMask = (unsigned int) ~0;
- return 0;
- default:
- /* Let the following WM_SYSCHAR or WM_CHAR message generate
- the keyboard callback. */
- break;
- }
- }
- return 0;
-
- case WM_LBUTTONDOWN:
- button = GLUT_LEFT_BUTTON;
- case WM_MBUTTONDOWN:
- if (button < 0)
- button = GLUT_MIDDLE_BUTTON;
- case WM_RBUTTONDOWN:
- if (button < 0)
- button = GLUT_RIGHT_BUTTON;
-
- /* finish the menu if we get a button down message (user must have
- cancelled the menu). */
- if (__glutMappedMenu) {
- /* TODO: take this out once the menu on middle mouse stuff works
- properly. */
- if (button == GLUT_MIDDLE_BUTTON)
- return 0;
- GetCursorPos(&point);
- ScreenToClient(hwnd, &point);
- __glutItemSelected = NULL;
- __glutFinishMenu(hwnd, point.x, point.y);
- return 0;
- }
-
- /* set the capture so we can get mouse events outside the window */
- SetCapture(hwnd);
-
- /* Win32 doesn't return the same numbers as X does when the mouse
- goes beyond the upper or left side of the window. roll the
- Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */
- x = LOWORD(lParam);
- y = HIWORD(lParam);
- if(x & 1 << 15) x -= (1 << 16);
- if(y & 1 << 15) y -= (1 << 16);
-
- window = __glutGetWindow(hwnd);
- if (window) {
- menu = __glutGetMenuByNum(window->menu[button]);
- if (menu) {
- point.x = LOWORD(lParam); point.y = HIWORD(lParam);
- ClientToScreen(window->win, &point);
- __glutMenuButton = button == GLUT_RIGHT_BUTTON ? TPM_RIGHTBUTTON :
- button == GLUT_LEFT_BUTTON ? TPM_LEFTBUTTON :
- 0x0001;
- __glutStartMenu(menu, window, point.x, point.y, x, y);
- } else if (window->mouse) {
-
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on. */
- __glutModifierMask |= ShiftMask;
- if (GetKeyState(VK_CONTROL) < 0)
- __glutModifierMask |= ControlMask;
- if (GetKeyState(VK_MENU) < 0)
- __glutModifierMask |= Mod1Mask;
- window->mouse(button, GLUT_DOWN, x, y);
- __glutModifierMask = (unsigned int)~0;
- } else {
- /* Stray mouse events. Ignore. */
- }
- }
- return 0;
-
- case WM_LBUTTONUP:
- button = GLUT_LEFT_BUTTON;
- case WM_MBUTTONUP:
- if (button < 0)
- button = GLUT_MIDDLE_BUTTON;
- case WM_RBUTTONUP:
- if (button < 0)
- button = GLUT_RIGHT_BUTTON;
-
- /* Bail out if we're processing a menu. */
- if (__glutMappedMenu) {
- GetCursorPos(&point);
- ScreenToClient(hwnd, &point);
- /* if we're getting the middle button up signal, then something
- on the menu was selected. */
- if (button == GLUT_MIDDLE_BUTTON) {
- return 0;
- /* For some reason, the code below always returns -1 even
- though the point IS IN THE ITEM! Therefore, just bail out if
- we get a middle mouse up. The user must select using the
- left mouse button. Stupid Win32. */
-#if 0
- int item = MenuItemFromPoint(hwnd, __glutHMenu, point);
- if (item != -1)
- __glutItemSelected = (GLUTmenuItem*)GetMenuItemID(__glutHMenu, item);
- else
- __glutItemSelected = NULL;
- __glutFinishMenu(hwnd, point.x, point.y);
-#endif
- } else {
- __glutItemSelected = NULL;
- __glutFinishMenu(hwnd, point.x, point.y);
- }
- return 0;
- }
-
- /* Release the mouse capture. */
- ReleaseCapture();
-
- window = __glutGetWindow(hwnd);
- if (window && window->mouse) {
- /* Win32 doesn't return the same numbers as X does when the
- mouse goes beyond the upper or left side of the window. roll
- the Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */
- x = LOWORD(lParam);
- y = HIWORD(lParam);
- if(x & 1 << 15) x -= (1 << 16);
- if(y & 1 << 15) y -= (1 << 16);
-
- __glutSetWindow(window);
- __glutModifierMask = 0;
- if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */
- __glutModifierMask |= ShiftMask;
- if (GetKeyState(VK_CONTROL) < 0)
- __glutModifierMask |= ControlMask;
- if (GetKeyState(VK_MENU) < 0)
- __glutModifierMask |= Mod1Mask;
- window->mouse(button, GLUT_UP, x, y);
- __glutModifierMask = (unsigned int)~0;
- } else {
- /* Window might have been destroyed and all the
- events for the window may not yet be received. */
- }
- return 0;
-
- case WM_ENTERMENULOOP:
- /* KLUDGE: create a timer that fires every 100 ms when we start a
- menu so that we can still process the idle & timer events (that
- way, the timers will fire during a menu pick and so will the
- idle func. */
- SetTimer(hwnd, 1, 1, NULL);
- return 0;
-
- case WM_TIMER:
-#if 0
- /* If the timer id is 2, then this is the timer that is set up in
- the main glut message processing loop, and we don't want to do
- anything but acknowledge that we got it. It is used to prevent
- CPU spiking when an idle function is installed. */
- if (wParam == 2)
- return 0;
-#endif
-
- /* only worry about the idle function and the timeouts, since
- these are the only events we expect to process during
- processing of a menu. */
- /* we no longer process the idle functions (as outlined in the
- README), since drawing can't be done until the menu has
- finished...it's pretty lame when the animation goes on, but
- doesn't update, so you get this weird jerkiness. */
-#if 0
- if (__glutIdleFunc)
- __glutIdleFunc();
-#endif
- if (__glutTimerList)
- handleTimeouts();
- return 0;
-
- case WM_EXITMENULOOP:
- /* nuke the above created timer...we don't need it anymore, since
- the menu is gone now. */
- KillTimer(hwnd, 1);
- return 0;
-
- case WM_MENUSELECT:
- if (lParam != 0)
- __glutHMenu = (HMENU)lParam;
- return 0;
-
- case WM_COMMAND:
- if (__glutMappedMenu) {
- if (GetSubMenu(__glutHMenu, LOWORD(wParam)))
- __glutItemSelected = NULL;
- else
- __glutItemSelected =
- __glutGetUniqueMenuItem(__glutMappedMenu, LOWORD(wParam));
- GetCursorPos(&point);
- ScreenToClient(hwnd, &point);
- __glutFinishMenu(hwnd, point.x, point.y);
- }
- return 0;
-
- case WM_MOUSEMOVE:
- if (!__glutMappedMenu) {
- window = __glutGetWindow(hwnd);
- if (window) {
- /* If motion function registered _and_ buttons held *
- down, call motion function... */
- x = LOWORD(lParam);
- y = HIWORD(lParam);
-
- /* Win32 doesn't return the same numbers as X does when the
- mouse goes beyond the upper or left side of the window.
- roll the Win32's 0..2^16 pointer co-ord range to 0..+/-2^15. */
- if(x & 1 << 15) x -= (1 << 16);
- if(y & 1 << 15) y -= (1 << 16);
-
- if (window->motion && wParam &
- (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) {
- __glutSetWindow(window);
- window->motion(x, y);
- }
- /* If passive motion function registered _and_
- buttons not held down, call passive motion
- function... */
- else if (window->passive &&
- ((wParam &
- (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) ==
- 0)) {
- __glutSetWindow(window);
- window->passive(x, y);
- }
- }
- } else {
- /* Motion events are thrown away when a pop up menu is
- active. */
- }
- return 0;
-
- case WM_GETMINMAXINFO:
- /* this voodoo is brought to you by Win32 (again). It allows the
- window to be bigger than the screen, and smaller than 100x100
- (although it doesn't seem to help the y minimum). */
- minmax = (LPMINMAXINFO)lParam;
- minmax->ptMaxSize.x = __glutScreenWidth;
- minmax->ptMaxSize.y = __glutScreenHeight;
- minmax->ptMinTrackSize.x = 0;
- minmax->ptMinTrackSize.y = 0;
- minmax->ptMaxTrackSize.x = __glutScreenWidth +
- GetSystemMetrics(SM_CXSIZE) * 2;
- minmax->ptMaxTrackSize.y = __glutScreenHeight +
- GetSystemMetrics(SM_CXSIZE) * 2 + GetSystemMetrics(SM_CYCAPTION);
- return 0;
-
- case WM_SIZE:
- window = __glutGetWindow(hwnd);
- if (window) {
- width = LOWORD(lParam);
- height = HIWORD(lParam);
- if (width != window->width || height != window->height) {
-#if 0 /* Win32 GLUT does not support overlays for now. */
- if (window->overlay) {
- XResizeWindow(__glutDisplay, window->overlay->win, width, height);
- }
-#endif
- window->width = width;
- window->height = height;
- __glutSetWindow(window);
- /* Do not execute OpenGL out of sequence with respect
- to the SetWindowPos request! */
- GdiFlush();
- window->reshape(width, height);
- window->forceReshape = FALSE;
- /* A reshape should be considered like posting a
- repair request. */
- __glutPostRedisplay(window, GLUT_REPAIR_WORK);
- }
- }
- return 0;
-
- case WM_SETCURSOR:
- /* If the cursor is not in the client area, then we want to send
- this message to the default window procedure ('cause its
- probably in the border or title, and we don't handle that
- cursor. otherwise, set our cursor. Win32 makes us set the
- cursor every time the mouse moves (DUMB!). */
- if(LOWORD(lParam) != HTCLIENT) {
- goto defproc;
- }
- window = __glutGetWindow(hwnd);
- if (window) {
- __glutSetCursor(window);
- }
- /* TODO: check out the info in DevStudio on WM_SETCURSOR in the
- DefaultAction section. */
- return 1;
-
- case WM_SETFOCUS:
- window = __glutGetWindow(hwnd);
- if (window) {
- window->entryState = WM_SETFOCUS;
- if (window->entry) {
- __glutSetWindow(window);
- window->entry(GLUT_ENTERED);
- /* XXX Generation of fake passive notify? See how much
- work the X11 code does to support fake passive notify
- callbacks. */
- }
- if (window->joystick && __glutCurrentWindow) {
- if (__glutCurrentWindow->joyPollInterval > 0) {
- MMRESULT result;
-
- /* Because Win32 will only let one window capture the
- joystick at a time, we must capture it when we get the
- focus and release it when we lose the focus. */
- result = joySetCapture(__glutCurrentWindow->win,
- JOYSTICKID1, 0, TRUE);
- if (result != JOYERR_NOERROR) {
- return 0;
- }
- (void) joySetThreshold(JOYSTICKID1,
- __glutCurrentWindow->joyPollInterval);
- }
- }
- }
- return 0;
-
- case WM_KILLFOCUS:
- window = __glutGetWindow(hwnd);
- if (window) {
- window->entryState = WM_KILLFOCUS;
- if (window->entry) {
- __glutSetWindow(window);
- window->entry(GLUT_LEFT);
- }
- if (window->joystick && __glutCurrentWindow) {
- if (__glutCurrentWindow->joyPollInterval > 0) {
- /* Because Win32 will only let one window capture the
- joystick at a time, we must capture it when we get the
- focus and release it when we lose the focus. */
- (void) joyReleaseCapture(JOYSTICKID1);
- }
- }
- }
- return 0;
- case WM_ACTIVATE:
- window = __glutGetWindow(hwnd);
- /* Make sure we re-select the correct palette if needed. */
- if (LOWORD(wParam)) {
- PostMessage(hwnd, WM_PALETTECHANGED, 0, 0);
- }
- if (window) {
- int visState;
-
- /* HIWORD(wParam) is the minimized flag. */
- visState = !HIWORD(wParam);
- updateWindowState(window, visState);
- }
- return 0;
-
- /* Colour Palette Management */
- case WM_PALETTECHANGED:
- if (hwnd == (HWND)wParam) {
- /* Don't respond to the message that we sent! */
- break;
- }
- /* fall through to WM_QUERYNEWPALETTE */
-
- case WM_QUERYNEWPALETTE:
- window = __glutGetWindow(hwnd);
- if (window && window->colormap) {
- UnrealizeObject(window->colormap->cmap);
- SelectPalette(window->hdc, window->colormap->cmap, FALSE);
- RealizePalette(window->hdc);
- return TRUE;
- }
- return FALSE;
-
- case MM_JOY1MOVE:
- case MM_JOY1ZMOVE:
- window = __glutGetWindow(hwnd);
- if (window->joystick) {
- JOYINFOEX jix;
- int x, y, z;
-
- /* Because WIN32 only supports messages for X, Y, and Z
- translations, we must poll for the rest */
- jix.dwSize = sizeof(jix);
- jix.dwFlags = JOY_RETURNALL;
- joyGetPosEx(JOYSTICKID1,&jix);
-
-#define SCALE(v) ((int) ((v - 32767)/32.768))
-
- /* Convert to integer for scaling. */
- x = jix.dwXpos;
- y = jix.dwYpos;
- z = jix.dwZpos;
- window->joystick(jix.dwButtons, SCALE(x), SCALE(y), SCALE(z));
-
- return TRUE;
- }
- return FALSE;
- case MM_JOY1BUTTONDOWN:
- case MM_JOY1BUTTONUP:
- window = __glutGetWindow(hwnd);
- if (window->joystick) {
- JOYINFOEX jix;
-
- /* Because WIN32 only supports messages for X, Y, and Z
- translations, we must poll for the rest */
- jix.dwSize = sizeof(jix);
- jix.dwFlags = JOY_RETURNALL;
- joyGetPosEx(JOYSTICKID1,&jix);
-
- return TRUE;
- }
- return FALSE;
-
-#if 0
- /* Miscellaneous messages (don't really need to enumerate them,
- but it's good to know what you're not getting sometimes). */
- case WM_DISPLAYCHANGE:
- break;
- case WM_NCHITTEST:
- /* This event is generated by every mouse move event. */
- goto defproc;
- case WM_NCMOUSEMOVE:
- goto defproc;
- case WM_NCACTIVATE:
- goto defproc;
- case WM_NCPAINT:
- goto defproc;
- case WM_NCCALCSIZE:
- goto defproc;
- case WM_NCCREATE:
- goto defproc;
- case WM_NCDESTROY:
- goto defproc;
- case WM_NCLBUTTONDOWN:
- goto defproc;
- case WM_SETTEXT:
- goto defproc;
- case WM_GETTEXT:
- goto defproc;
- case WM_ACTIVATEAPP:
- goto defproc;
- case WM_GETICON:
- goto defproc;
- case WM_ERASEBKGND:
- goto defproc;
- case WM_WINDOWPOSCHANGING:
- goto defproc;
- case WM_WINDOWPOSCHANGED:
- goto defproc;
- case WM_MOUSEACTIVATE:
- goto defproc;
- case WM_SHOWWINDOW:
- goto defproc;
- case WM_MOVING:
- goto defproc;
- case WM_MOVE:
- goto defproc;
- case WM_KEYUP:
- goto defproc;
- case WM_CAPTURECHANGED:
- goto defproc;
- case WM_SYSCOMMAND:
- goto defproc;
- case WM_ENTERSIZEMOVE:
- goto defproc;
- case WM_ENTERIDLE:
- goto defproc;
-#endif
-
- default:
- goto defproc;
- }
-
-defproc:
- return DefWindowProc(hwnd, msg, wParam, lParam);
-}
-
-#endif
-
-#if defined(__OS2PM__)
-Bool __glutSetWindowText(Window window, char *text)
-{
- return WinSetWindowText(window, (PCSZ)text);
-
-}
-
-#endif
- \ No newline at end of file
diff --git a/src/glut/os2/src-glut_os2pm.zip b/src/glut/os2/src-glut_os2pm.zip
deleted file mode 100644
index 8c8a8c7ac48..00000000000
--- a/src/glut/os2/src-glut_os2pm.zip
+++ /dev/null
Binary files differ
diff --git a/src/glw/Makefile b/src/glw/Makefile
index 356351a1ced..5228cbbb721 100644
--- a/src/glw/Makefile
+++ b/src/glw/Makefile
@@ -29,7 +29,7 @@ install:
$(INSTALL) -d $(INSTALL_DIR)/include/GL
$(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 *.h $(INSTALL_DIR)/include/GL
- $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGLw.* $(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(INSTALL_DIR)/$(LIB_DIR)
clean:
-rm depend depend.bak
diff --git a/src/glx/mini/Makefile b/src/glx/mini/Makefile
deleted file mode 100644
index 217b8a76ec5..00000000000
--- a/src/glx/mini/Makefile
+++ /dev/null
@@ -1,82 +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 \
- 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 \
- `pkg-config --cflags libdrm`
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
-
-
-# Make libGL
-$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
- $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
- -major 1 -minor 2 $(MKLIB_OPTIONS) \
- -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) `/usr/bin/pkg-config --libs libdrm` `/usr/bin/pkg-config --libs pciaccess`
- rm -f $(TOP)/$(LIB_DIR)/miniglx.conf
- install example.miniglx.conf $(TOP)/$(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 $(TOP)/$(LIB_DIR)/libGL.so*
- -rm -f *.o *~
- -rm -f depend
-
-include depend
diff --git a/src/glx/mini/NOTES b/src/glx/mini/NOTES
deleted file mode 100644
index 1774107d634..00000000000
--- a/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/src/glx/mini/driver.h b/src/glx/mini/driver.h
deleted file mode 100644
index 9e8bf6fa7cf..00000000000
--- a/src/glx/mini/driver.h
+++ /dev/null
@@ -1,170 +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 {
- drm_handle_t hSAREA;
- int SAREASize;
- drm_handle_t hFrameBuffer;
- int fbOrigin;
- int fbSize;
- int fbStride;
- int virtualWidth;
- int virtualHeight;
- int Width;
- } 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/src/glx/mini/example.miniglx.conf b/src/glx/mini/example.miniglx.conf
deleted file mode 100644
index 62dd4f65ec4..00000000000
--- a/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/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c
deleted file mode 100644
index d4b29508632..00000000000
--- a/src/glx/mini/miniglx.c
+++ /dev/null
@@ -1,2567 +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"
-
-#include "pciaccess.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;
-#if 0
- /* 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;
- }
-#endif
-
- 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 = dpy->driverContext.shared.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;
-
- pci_system_init();
-
- 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 = -1;
- 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/src/glx/mini/miniglxP.h b/src/glx/mini/miniglxP.h
deleted file mode 100644
index 96ed0e81cd7..00000000000
--- a/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/src/glx/mini/miniglx_events.c b/src/glx/mini/miniglx_events.c
deleted file mode 100644
index 969398bc16f..00000000000
--- a/src/glx/mini/miniglx_events.c
+++ /dev/null
@@ -1,984 +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.6 2006/04/03 07:31:27 airlied 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;
-
- drmGetLock(dpy->driverContext.drmFD, 1, 0);
- drmUnlock(dpy->driverContext.drmFD, 1);
- }
-}
-
-/**
- * \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/src/glx/x11/XF86dri.c b/src/glx/x11/XF86dri.c
index 0ce588276be..8909a047721 100644
--- a/src/glx/x11/XF86dri.c
+++ b/src/glx/x11/XF86dri.c
@@ -203,7 +203,7 @@ PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
*hSAREA = rep.hSAREALow;
if (sizeof(drm_handle_t) == 8) {
- const int shift = 32; /* var to prevent warning on next line */
+ int shift = 32; /* var to prevent warning on next line */
*hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift;
}
@@ -566,7 +566,7 @@ PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
*hFrameBuffer = rep.hFrameBufferLow;
if (sizeof(drm_handle_t) == 8) {
- const int shift = 32; /* var to prevent warning on next line */
+ int shift = 32; /* var to prevent warning on next line */
*hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift;
}
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 5b756c26aff..8bec2c34c60 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -64,9 +64,9 @@
#endif
#ifdef USE_XCB
-#include <X11/xcl.h>
-#include <X11/XCB/xcb.h>
-#include <X11/XCB/glx.h>
+#include <X11/Xlib-xcb.h>
+#include <xcb/xcb.h>
+#include <xcb/glx.h>
#endif
#include <assert.h>
@@ -723,6 +723,7 @@ static const __DRIinterfaceMethods interface_methods = {
};
+
/**
* Perform the required libGL-side initialization and call the client-side
* driver's \c __driCreateNewScreen function.
@@ -773,7 +774,8 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
framebuffer.dev_priv = NULL;
if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
- fd = drmOpen(NULL,BusID);
+ int newlyopened;
+ fd = drmOpenOnce(NULL,BusID, &newlyopened);
Xfree(BusID); /* No longer needed */
err_msg = "open DRM";
@@ -800,7 +802,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
}
err_msg = "XF86DRIAuthConnection";
- if (XF86DRIAuthConnection(dpy, scrn, magic)) {
+ if (!newlyopened || XF86DRIAuthConnection(dpy, scrn, magic)) {
char *driverName;
/*
@@ -904,7 +906,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
}
if ( fd >= 0 ) {
- (void)drmClose(fd);
+ (void)drmCloseOnce(fd);
}
(void)XF86DRICloseConnection(dpy, scrn);
@@ -1016,11 +1018,11 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
if (!_XReply(dpy, (xReply*) &reply, 0, False)) {
/* Something is busted. Punt. */
UnlockDisplay(dpy);
+ SyncHandle();
FreeScreenConfigs(priv);
return GL_FALSE;
}
- UnlockDisplay(dpy);
if (!reply.numVisuals) {
/* This screen does not support GL rendering */
UnlockDisplay(dpy);
@@ -1284,7 +1286,7 @@ GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
{
Display * const dpy = ctx->currentDpy;
#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
#else
xGLXRenderReq *req;
#endif /* USE_XCB */
@@ -1292,7 +1294,7 @@ GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
if ( (dpy != NULL) && (size > 0) ) {
#ifdef USE_XCB
- XCBGlxRender(c, ctx->currentContextTag, size, (char *)ctx->buf);
+ xcb_glx_render(c, ctx->currentContextTag, size, (char *)ctx->buf);
#else
/* Send the entire buffer as an X request */
LockDisplay(dpy);
@@ -1335,8 +1337,8 @@ void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
{
Display *dpy = gc->currentDpy;
#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- XCBGlxRenderLarge(c, gc->currentContextTag, requestNumber, totalRequests, dataLen, data);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
+ xcb_glx_render_large(c, gc->currentContextTag, requestNumber, totalRequests, dataLen, data);
#else
xGLXRenderLargeReq *req;
@@ -1480,12 +1482,17 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
* \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 )
+static Bool SendMakeCurrentRequest(Display *dpy, CARD8 opcode,
+ GLXContextID gc_id, GLXContextTag gc_tag,
+ GLXDrawable draw, GLXDrawable read,
+ xGLXMakeCurrentReply *reply)
{
- if ( draw == read ) {
+ Bool ret;
+
+
+ LockDisplay(dpy);
+
+ if (draw == read) {
xGLXMakeCurrentReq *req;
GetReq(GLXMakeCurrent,req);
@@ -1503,7 +1510,7 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
* not the SGI extension.
*/
- if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
+ if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
xGLXMakeContextCurrentReq *req;
GetReq(GLXMakeContextCurrent,req);
@@ -1531,7 +1538,12 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
}
}
- return _XReply(dpy, (xReply*) reply, 0, False);
+ ret = _XReply(dpy, (xReply*) reply, 0, False);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return ret;
}
@@ -1554,161 +1566,93 @@ static Bool UnbindContextWrapper( GLXContext gc )
#endif /* GLX_DIRECT_RENDERING */
-/*
-** Make a particular context current.
-** NOTE: this is in this file so that it can access dummyContext.
-*/
+/**
+ * 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;
+ const GLXContext oldGC = __glXGetCurrentContext();
+ const CARD8 opcode = __glXSetupForCommand(dpy);
+ const CARD8 oldOpcode = ((gc == oldGC) || (oldGC == &dummyContext))
+ ? opcode : __glXSetupForCommand(oldGC->currentDpy);
+ Bool bindReturnValue;
+
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
+ if (!opcode || !oldOpcode) {
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.
- */
+ /* 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) {
+#ifndef GLX_DIRECT_RENDERING
+ if (gc && gc->isDirect) {
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;
- }
+#endif
_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 {
+ bindReturnValue = (gc->driContext.private)
+ ? BindContextWrapper(dpy, gc, draw, read)
+ : False;
+ } 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
+ bindReturnValue =
+ SendMakeCurrentRequest(dpy, opcode, gc ? gc->xid : None,
+ ((dpy != oldGC->currentDpy) || oldGC->isDirect)
+ ? None : oldGC->currentContextTag,
+ draw, read, &reply);
}
-#endif
if (!bindReturnValue) {
- /* The make current failed. */
- if (gc && !gc->isDirect) {
- SyncHandle();
- }
+ return False;
+ }
+
+ if ((dpy != oldGC->currentDpy || (gc && gc->isDirect)) &&
+ !oldGC->isDirect && oldGC != &dummyContext) {
+ xGLXMakeCurrentReply dummy_reply;
+ /* 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.
+ */
+ (void) SendMakeCurrentRequest(oldGC->currentDpy, oldOpcode, None,
+ oldGC->currentContextTag, None, None,
+ & dummy_reply);
+ }
#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;
+ else if (oldGC->isDirect && oldGC->driContext.private) {
+ (void) UnbindContextWrapper(oldGC);
}
+#endif
+
/* 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.
- */
+ /* 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 {
@@ -1720,11 +1664,10 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
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.
- */
+ /* 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) {
@@ -1740,35 +1683,30 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
}
if (gc) {
__glXSetCurrentContext(gc);
-#ifdef GLX_DIRECT_RENDERING
+
+ gc->currentDpy = dpy;
+ gc->currentDrawable = draw;
+ gc->currentReadable = read;
+
if (!gc->isDirect) {
if (!IndirectAPI)
IndirectAPI = __glXNewIndirectAPI();
_glapi_set_dispatch(IndirectAPI);
-# ifdef GLX_USE_APPLEGL
+
+#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);
+ __GLXattribute *state =
+ (__GLXattribute *)(gc->client_state_private);
gc->currentContextTag = reply.contextTag;
- if ( state->array_state == NULL ) {
- (void) glGetString( GL_EXTENSIONS );
- (void) glGetString( GL_VERSION );
+ if (state->array_state == NULL) {
+ (void) glGetString(GL_EXTENSIONS);
+ (void) glGetString(GL_VERSION);
__glXInitVertexArrayState(gc);
}
}
diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c
index 54cea1419ef..b5c306c562d 100644
--- a/src/glx/x11/indirect.c
+++ b/src/glx/x11/indirect.c
@@ -30,11 +30,14 @@
#include "indirect.h"
#include "glxclient.h"
#include "indirect_size.h"
+#include "dispatch.h"
+#include "glapi.h"
+#include "glthread.h"
#include <GL/glxproto.h>
#ifdef USE_XCB
-#include <X11/xcl.h>
-#include <X11/XCB/xcb.h>
-#include <X11/XCB/glx.h>
+#include <X11/Xlib-xcb.h>
+#include <xcb/xcb.h>
+#include <xcb/glx.h>
#endif /* USE_XCB */
#define __GLX_PAD(n) (((n) + 3) & ~3)
@@ -63,24 +66,24 @@
*((int *)(dest)) = temp.i; } while(0)
NOINLINE CARD32
-__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array )
+__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 bytes = (reply_is_always_array)
+ ? (4 * reply.length) : (reply.size * size);
const GLint extra = 4 - (bytes & 3);
_XRead(dpy, dest, bytes);
- if ( extra < 4 ) {
+ if (extra < 4) {
_XEatData(dpy, extra);
}
- }
- else {
- (void) memcpy( dest, &(reply.pad3), size);
+ } else {
+ (void) memcpy(dest, &(reply.pad3), size);
}
}
@@ -88,37 +91,40 @@ __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_alway
}
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 )
+__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;
+ 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; }
+ 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 );
+ void *buf = Xmalloc(size);
- if ( buf == NULL ) {
+ if (buf == NULL) {
_XEatData(dpy, size);
__glXSetError(gc, GL_OUT_OF_MEMORY);
- }
- else {
+ } else {
const GLint extra = 4 - (size & 3);
_XRead(dpy, buf, size);
- if ( extra < 4 ) {
+ if (extra < 4) {
_XEatData(dpy, extra);
}
@@ -132,10 +138,10 @@ __glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim,
#define X_GLXSingle 0
NOINLINE FASTCALL GLubyte *
-__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen )
+__glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen)
{
- xGLXSingleReq * req;
- Display * const dpy = gc->currentDpy;
+ xGLXSingleReq *req;
+ Display *const dpy = gc->currentDpy;
(void) __glXFlushRenderBuffer(gc, gc->pc);
LockDisplay(dpy);
@@ -143,14 +149,15 @@ __glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen )
req->reqType = gc->majorOpcode;
req->contextTag = gc->currentContextTag;
req->glxCode = sop;
- return (GLubyte *)(req) + sz_xGLXSingleReq;
+ return (GLubyte *) (req) + sz_xGLXSingleReq;
}
NOINLINE FASTCALL GLubyte *
-__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen )
+__glXSetupVendorRequest(__GLXcontext * gc, GLint code, GLint vop,
+ GLint cmdlen)
{
- xGLXVendorPrivateReq * req;
- Display * const dpy = gc->currentDpy;
+ xGLXVendorPrivateReq *req;
+ Display *const dpy = gc->currentDpy;
(void) __glXFlushRenderBuffer(gc, gc->pc);
LockDisplay(dpy);
@@ -159,7 +166,7 @@ __glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen
req->glxCode = code;
req->vendorCode = vop;
req->contextTag = gc->currentContextTag;
- return (GLubyte *)(req) + sz_xGLXVendorPrivateReq;
+ return (GLubyte *) (req) + sz_xGLXVendorPrivateReq;
}
const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
@@ -176,118 +183,136 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
#define default_pixel_store_4D_size 36
static FASTCALL NOINLINE void
-generic_3_byte( GLint rop, const void * ptr )
+generic_3_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 8;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 4);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 4);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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 )
+generic_4_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 8;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 4);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 4);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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 )
+generic_6_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 12;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 8);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 8);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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 )
+generic_8_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 12;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 8);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 8);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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 )
+generic_12_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 16;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 12);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 12);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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 )
+generic_16_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 20;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 16);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 16);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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 )
+generic_24_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 28;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 24);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 24);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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 )
+generic_32_byte(GLint rop, const void *ptr)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 36;
emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 32);
+ (void) memcpy((void *) (gc->pc + 4), ptr, 32);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ 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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxNewList(c, gc->currentContextTag, list, mode);
+ xcb_glx_new_list(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();
+ 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;
@@ -297,17 +322,18 @@ __indirect_glNewList(GLuint list, GLenum mode)
void
__indirect_glEndList(void)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxEndList(c, gc->currentContextTag);
+ xcb_glx_end_list(c, gc->currentContextTag);
#else
(void) __glXSetupSingleRequest(gc, X_GLsop_EndList, cmdlen);
- UnlockDisplay(dpy); SyncHandle();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -317,41 +343,45 @@ __indirect_glEndList(void)
void
__indirect_glCallList(GLuint list)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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 ) {
+ 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));
+ (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 {
+ 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);
+ 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));
}
}
@@ -361,19 +391,21 @@ __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists)
void
__indirect_glDeleteLists(GLuint list, GLsizei range)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxDeleteLists(c, gc->currentContextTag, list, range);
+ xcb_glx_delete_lists(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();
+ 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;
@@ -383,22 +415,28 @@ __indirect_glDeleteLists(GLuint list, GLsizei range)
GLuint
__indirect_glGenLists(GLsizei range)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGenListsRep *reply = XCBGlxGenListsReply(c, XCBGlxGenLists(c, gc->currentContextTag, range), NULL);
+ xcb_glx_gen_lists_reply_t *reply =
+ xcb_glx_gen_lists_reply(c,
+ xcb_glx_gen_lists(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return retval;
@@ -408,67 +446,79 @@ __indirect_glGenLists(GLsizei range)
void
__indirect_glListBase(GLuint base)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__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;
+ __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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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);
}
}
}
@@ -477,2736 +527,3083 @@ __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
void
__indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_4_byte(X_GLrop_Color4bv, v);
}
#define X_GLrop_Color4dv 15
void
-__indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+__indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue,
+ GLdouble alpha)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_16_byte(X_GLrop_Color4uiv, v);
}
#define X_GLrop_Color4usv 21
void
-__indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+__indirect_glColor4us(GLushort red, GLushort green, GLushort blue,
+ GLushort alpha)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_Color4usv, v);
}
#define X_GLrop_EdgeFlagv 22
void
__indirect_glEdgeFlag(GLboolean flag)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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); }
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_Indexdv, c);
}
#define X_GLrop_Indexfv 25
void
__indirect_glIndexf(GLfloat c)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_4_byte(X_GLrop_Indexfv, c);
}
#define X_GLrop_Indexiv 26
void
__indirect_glIndexi(GLint c)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_4_byte(X_GLrop_Indexiv, c);
}
#define X_GLrop_Indexsv 27
void
__indirect_glIndexs(GLshort c)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_6_byte(X_GLrop_Normal3sv, v);
}
#define X_GLrop_RasterPos2dv 33
void
__indirect_glRasterPos2d(GLdouble x, GLdouble y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_16_byte(X_GLrop_RasterPos2dv, v);
}
#define X_GLrop_RasterPos2fv 34
void
__indirect_glRasterPos2f(GLfloat x, GLfloat y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_RasterPos2fv, v);
}
#define X_GLrop_RasterPos2iv 35
void
__indirect_glRasterPos2i(GLint x, GLint y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_RasterPos2iv, v);
}
#define X_GLrop_RasterPos2sv 36
void
__indirect_glRasterPos2s(GLshort x, GLshort y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_TexCoord1dv, v);
}
#define X_GLrop_TexCoord1fv 50
void
__indirect_glTexCoord1f(GLfloat s)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_4_byte(X_GLrop_TexCoord1fv, v);
}
#define X_GLrop_TexCoord1iv 51
void
__indirect_glTexCoord1i(GLint s)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_4_byte(X_GLrop_TexCoord1iv, v);
}
#define X_GLrop_TexCoord1sv 52
void
__indirect_glTexCoord1s(GLshort s)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_16_byte(X_GLrop_TexCoord2dv, v);
}
#define X_GLrop_TexCoord2fv 54
void
__indirect_glTexCoord2f(GLfloat s, GLfloat t)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_TexCoord2fv, v);
}
#define X_GLrop_TexCoord2iv 55
void
__indirect_glTexCoord2i(GLint s, GLint t)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_TexCoord2iv, v);
}
#define X_GLrop_TexCoord2sv 56
void
__indirect_glTexCoord2s(GLshort s, GLshort t)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_TexCoord4sv, v);
}
#define X_GLrop_Vertex2dv 65
void
__indirect_glVertex2d(GLdouble x, GLdouble y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_16_byte(X_GLrop_Vertex2dv, v);
}
#define X_GLrop_Vertex2fv 66
void
__indirect_glVertex2f(GLfloat x, GLfloat y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_Vertex2fv, v);
}
#define X_GLrop_Vertex2iv 67
void
__indirect_glVertex2i(GLint x, GLint y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_Vertex2iv, v);
}
#define X_GLrop_Vertex2sv 68
void
__indirect_glVertex2s(GLshort x, GLshort y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_Vertex4sv, v);
}
#define X_GLrop_ClipPlane 77
void
__indirect_glClipPlane(GLenum plane, const GLdouble * equation)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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;
+ __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->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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glTexParameterfv(GLenum target, GLenum pname,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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);
+__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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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)
+__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 );
+ __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)
+__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 );
+ __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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue,
+ GLfloat alpha)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue,
+ GLclampf alpha)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue,
+ GLboolean alpha)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn,
+ GLdouble v1, GLdouble v2)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1,
+ GLfloat v2)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_EvalCoord1dv, u);
}
#define X_GLrop_EvalCoord1fv 152
void
__indirect_glEvalCoord1f(GLfloat u)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_4_byte(X_GLrop_EvalCoord1fv, u);
}
#define X_GLrop_EvalCoord2dv 153
void
__indirect_glEvalCoord2d(GLdouble u, GLdouble v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_16_byte(X_GLrop_EvalCoord2dv, u);
}
#define X_GLrop_EvalCoord2fv 154
void
__indirect_glEvalCoord2f(GLfloat u, GLfloat v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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 ) {
+ 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));
+ (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 {
+ 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);
+ 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));
}
}
@@ -3216,28 +3613,30 @@ __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values)
void
__indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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 ) {
+ 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));
+ (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 {
+ 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);
+ 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));
}
}
@@ -3247,28 +3646,30 @@ __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values)
void
__indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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 ) {
+ 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));
+ (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 {
+ 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);
+ 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));
}
}
@@ -3278,57 +3679,77 @@ __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values)
void
__indirect_glReadBuffer(GLenum mode)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum type)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_read_pixels_reply_t *reply =
+ xcb_glx_read_pixels_reply(c,
+ xcb_glx_read_pixels(c,
+ gc->
+ currentContextTag,
+ x, y, width, height,
+ format, type,
+ state->storePack.
+ swapEndian, 0),
+ NULL);
+ (void) memcpy(pixels, xcb_glx_read_pixels_data(reply),
+ xcb_glx_read_pixels_data_length(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();
+ 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;
@@ -3336,41 +3757,47 @@ __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
#define X_GLrop_DrawPixels 173
void
-__indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+__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;
+ __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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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);
}
}
}
@@ -3379,21 +3806,30 @@ __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum typ
void
__indirect_glGetClipPlane(GLenum plane, GLdouble * equation)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_clip_plane_reply_t *reply =
+ xcb_glx_get_clip_plane_reply(c,
+ xcb_glx_get_clip_plane(c,
+ gc->
+ currentContextTag,
+ plane), NULL);
+ (void) memcpy(equation, xcb_glx_get_clip_plane_data(reply),
+ xcb_glx_get_clip_plane_data_length(reply) *
+ sizeof(GLdouble));
free(reply);
#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&plane), 4);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3403,25 +3839,35 @@ __indirect_glGetClipPlane(GLenum plane, GLdouble * equation)
void
__indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_lightfv_reply_t *reply =
+ xcb_glx_get_lightfv_reply(c,
+ xcb_glx_get_lightfv(c,
+ gc->
+ currentContextTag,
+ light, pname),
+ NULL);
+ if (xcb_glx_get_lightfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetLightfvData(reply), XCBGlxGetLightfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params, xcb_glx_get_lightfv_data(reply),
+ xcb_glx_get_lightfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3431,25 +3877,35 @@ __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params)
void
__indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_lightiv_reply_t *reply =
+ xcb_glx_get_lightiv_reply(c,
+ xcb_glx_get_lightiv(c,
+ gc->
+ currentContextTag,
+ light, pname),
+ NULL);
+ if (xcb_glx_get_lightiv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetLightivData(reply), XCBGlxGetLightivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_lightiv_data(reply),
+ xcb_glx_get_lightiv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3459,25 +3915,33 @@ __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params)
void
__indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_mapdv_reply_t *reply =
+ xcb_glx_get_mapdv_reply(c,
+ xcb_glx_get_mapdv(c,
+ gc->currentContextTag,
+ target, query), NULL);
+ if (xcb_glx_get_mapdv_data_length(reply) == 0)
+ (void) memcpy(v, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(v, XCBGlxGetMapdvData(reply), XCBGlxGetMapdvDataLength(reply) * sizeof(GLdouble));
+ (void) memcpy(v, xcb_glx_get_mapdv_data(reply),
+ xcb_glx_get_mapdv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3487,25 +3951,33 @@ __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v)
void
__indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_mapfv_reply_t *reply =
+ xcb_glx_get_mapfv_reply(c,
+ xcb_glx_get_mapfv(c,
+ gc->currentContextTag,
+ target, query), NULL);
+ if (xcb_glx_get_mapfv_data_length(reply) == 0)
+ (void) memcpy(v, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(v, XCBGlxGetMapfvData(reply), XCBGlxGetMapfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(v, xcb_glx_get_mapfv_data(reply),
+ xcb_glx_get_mapfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3515,25 +3987,33 @@ __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v)
void
__indirect_glGetMapiv(GLenum target, GLenum query, GLint * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_mapiv_reply_t *reply =
+ xcb_glx_get_mapiv_reply(c,
+ xcb_glx_get_mapiv(c,
+ gc->currentContextTag,
+ target, query), NULL);
+ if (xcb_glx_get_mapiv_data_length(reply) == 0)
+ (void) memcpy(v, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(v, XCBGlxGetMapivData(reply), XCBGlxGetMapivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(v, xcb_glx_get_mapiv_data(reply),
+ xcb_glx_get_mapiv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3543,25 +4023,35 @@ __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v)
void
__indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_materialfv_reply_t *reply =
+ xcb_glx_get_materialfv_reply(c,
+ xcb_glx_get_materialfv(c,
+ gc->
+ currentContextTag,
+ face, pname),
+ NULL);
+ if (xcb_glx_get_materialfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetMaterialfvData(reply), XCBGlxGetMaterialfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params, xcb_glx_get_materialfv_data(reply),
+ xcb_glx_get_materialfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3571,25 +4061,35 @@ __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
void
__indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_materialiv_reply_t *reply =
+ xcb_glx_get_materialiv_reply(c,
+ xcb_glx_get_materialiv(c,
+ gc->
+ currentContextTag,
+ face, pname),
+ NULL);
+ if (xcb_glx_get_materialiv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetMaterialivData(reply), XCBGlxGetMaterialivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_materialiv_data(reply),
+ xcb_glx_get_materialiv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3599,24 +4099,33 @@ __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params)
void
__indirect_glGetPixelMapfv(GLenum map, GLfloat * values)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_pixel_mapfv_reply_t *reply =
+ xcb_glx_get_pixel_mapfv_reply(c,
+ xcb_glx_get_pixel_mapfv(c,
+ gc->
+ currentContextTag,
+ map), NULL);
+ if (xcb_glx_get_pixel_mapfv_data_length(reply) == 0)
+ (void) memcpy(values, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(values, XCBGlxGetPixelMapfvData(reply), XCBGlxGetPixelMapfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(values, xcb_glx_get_pixel_mapfv_data(reply),
+ xcb_glx_get_pixel_mapfv_data_length(reply) *
+ sizeof(GLfloat));
free(reply);
#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&map), 4);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3626,24 +4135,34 @@ __indirect_glGetPixelMapfv(GLenum map, GLfloat * values)
void
__indirect_glGetPixelMapuiv(GLenum map, GLuint * values)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_pixel_mapuiv_reply_t *reply =
+ xcb_glx_get_pixel_mapuiv_reply(c,
+ xcb_glx_get_pixel_mapuiv(c,
+ gc->
+ currentContextTag,
+ map),
+ NULL);
+ if (xcb_glx_get_pixel_mapuiv_data_length(reply) == 0)
+ (void) memcpy(values, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(values, XCBGlxGetPixelMapuivData(reply), XCBGlxGetPixelMapuivDataLength(reply) * sizeof(GLuint));
+ (void) memcpy(values, xcb_glx_get_pixel_mapuiv_data(reply),
+ xcb_glx_get_pixel_mapuiv_data_length(reply) *
+ sizeof(GLuint));
free(reply);
#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapuiv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&map), 4);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3653,24 +4172,34 @@ __indirect_glGetPixelMapuiv(GLenum map, GLuint * values)
void
__indirect_glGetPixelMapusv(GLenum map, GLushort * values)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_pixel_mapusv_reply_t *reply =
+ xcb_glx_get_pixel_mapusv_reply(c,
+ xcb_glx_get_pixel_mapusv(c,
+ gc->
+ currentContextTag,
+ map),
+ NULL);
+ if (xcb_glx_get_pixel_mapusv_data_length(reply) == 0)
+ (void) memcpy(values, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(values, XCBGlxGetPixelMapusvData(reply), XCBGlxGetPixelMapusvDataLength(reply) * sizeof(GLushort));
+ (void) memcpy(values, xcb_glx_get_pixel_mapusv_data(reply),
+ xcb_glx_get_pixel_mapusv_data_length(reply) *
+ sizeof(GLushort));
free(reply);
#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapusv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&map), 4);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3680,22 +4209,33 @@ __indirect_glGetPixelMapusv(GLenum map, GLushort * values)
void
__indirect_glGetPolygonStipple(GLubyte * mask)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_polygon_stipple_reply_t *reply =
+ xcb_glx_get_polygon_stipple_reply(c,
+ xcb_glx_get_polygon_stipple(c,
+ gc->
+ currentContextTag,
+ 0),
+ NULL);
+ (void) memcpy(mask, xcb_glx_get_polygon_stipple_data(reply),
+ xcb_glx_get_polygon_stipple_data_length(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();
+ 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;
@@ -3705,25 +4245,35 @@ __indirect_glGetPolygonStipple(GLubyte * mask)
void
__indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_envfv_reply_t *reply =
+ xcb_glx_get_tex_envfv_reply(c,
+ xcb_glx_get_tex_envfv(c,
+ gc->
+ currentContextTag,
+ target, pname),
+ NULL);
+ if (xcb_glx_get_tex_envfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexEnvfvData(reply), XCBGlxGetTexEnvfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params, xcb_glx_get_tex_envfv_data(reply),
+ xcb_glx_get_tex_envfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3733,25 +4283,35 @@ __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
void
__indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_enviv_reply_t *reply =
+ xcb_glx_get_tex_enviv_reply(c,
+ xcb_glx_get_tex_enviv(c,
+ gc->
+ currentContextTag,
+ target, pname),
+ NULL);
+ if (xcb_glx_get_tex_enviv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexEnvivData(reply), XCBGlxGetTexEnvivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_tex_enviv_data(reply),
+ xcb_glx_get_tex_enviv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3761,25 +4321,35 @@ __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params)
void
__indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_gendv_reply_t *reply =
+ xcb_glx_get_tex_gendv_reply(c,
+ xcb_glx_get_tex_gendv(c,
+ gc->
+ currentContextTag,
+ coord, pname),
+ NULL);
+ if (xcb_glx_get_tex_gendv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexGendvData(reply), XCBGlxGetTexGendvDataLength(reply) * sizeof(GLdouble));
+ (void) memcpy(params, xcb_glx_get_tex_gendv_data(reply),
+ xcb_glx_get_tex_gendv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3789,25 +4359,35 @@ __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
void
__indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_genfv_reply_t *reply =
+ xcb_glx_get_tex_genfv_reply(c,
+ xcb_glx_get_tex_genfv(c,
+ gc->
+ currentContextTag,
+ coord, pname),
+ NULL);
+ if (xcb_glx_get_tex_genfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexGenfvData(reply), XCBGlxGetTexGenfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params, xcb_glx_get_tex_genfv_data(reply),
+ xcb_glx_get_tex_genfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3817,25 +4397,35 @@ __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
void
__indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_geniv_reply_t *reply =
+ xcb_glx_get_tex_geniv_reply(c,
+ xcb_glx_get_tex_geniv(c,
+ gc->
+ currentContextTag,
+ coord, pname),
+ NULL);
+ if (xcb_glx_get_tex_geniv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexGenivData(reply), XCBGlxGetTexGenivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_tex_geniv_data(reply),
+ xcb_glx_get_tex_geniv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3843,29 +4433,45 @@ __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params)
#define X_GLsop_GetTexImage 135
void
-__indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
+__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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_image_reply_t *reply =
+ xcb_glx_get_tex_image_reply(c,
+ xcb_glx_get_tex_image(c,
+ gc->
+ currentContextTag,
+ target, level,
+ format, type,
+ state->
+ storePack.
+ swapEndian),
+ NULL);
+ (void) memcpy(pixels, xcb_glx_get_tex_image_data(reply),
+ xcb_glx_get_tex_image_data_length(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();
+ 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;
@@ -3875,25 +4481,36 @@ __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type,
void
__indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_parameterfv_reply_t *reply =
+ xcb_glx_get_tex_parameterfv_reply(c,
+ xcb_glx_get_tex_parameterfv(c,
+ gc->
+ currentContextTag,
+ target,
+ pname),
+ NULL);
+ if (xcb_glx_get_tex_parameterfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexParameterfvData(reply), XCBGlxGetTexParameterfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params, xcb_glx_get_tex_parameterfv_data(reply),
+ xcb_glx_get_tex_parameterfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3903,25 +4520,36 @@ __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
void
__indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_parameteriv_reply_t *reply =
+ xcb_glx_get_tex_parameteriv_reply(c,
+ xcb_glx_get_tex_parameteriv(c,
+ gc->
+ currentContextTag,
+ target,
+ pname),
+ NULL);
+ if (xcb_glx_get_tex_parameteriv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexParameterivData(reply), XCBGlxGetTexParameterivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_tex_parameteriv_data(reply),
+ xcb_glx_get_tex_parameteriv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3929,28 +4557,40 @@ __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params)
#define X_GLsop_GetTexLevelParameterfv 138
void
-__indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params)
+__indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname,
+ GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_level_parameterfv_reply_t *reply =
+ xcb_glx_get_tex_level_parameterfv_reply(c,
+ xcb_glx_get_tex_level_parameterfv
+ (c, gc->currentContextTag,
+ target, level, pname),
+ NULL);
+ if (xcb_glx_get_tex_level_parameterfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexLevelParameterfvData(reply), XCBGlxGetTexLevelParameterfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params,
+ xcb_glx_get_tex_level_parameterfv_data(reply),
+ xcb_glx_get_tex_level_parameterfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3958,28 +4598,40 @@ __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GL
#define X_GLsop_GetTexLevelParameteriv 139
void
-__indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params)
+__indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname,
+ GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_tex_level_parameteriv_reply_t *reply =
+ xcb_glx_get_tex_level_parameteriv_reply(c,
+ xcb_glx_get_tex_level_parameteriv
+ (c, gc->currentContextTag,
+ target, level, pname),
+ NULL);
+ if (xcb_glx_get_tex_level_parameteriv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetTexLevelParameterivData(reply), XCBGlxGetTexLevelParameterivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params,
+ xcb_glx_get_tex_level_parameteriv_data(reply),
+ xcb_glx_get_tex_level_parameteriv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -3989,22 +4641,27 @@ __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GL
GLboolean
__indirect_glIsList(GLuint list)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxIsListRep *reply = XCBGlxIsListReply(c, XCBGlxIsList(c, gc->currentContextTag, list), NULL);
+ xcb_glx_is_list_reply_t *reply =
+ xcb_glx_is_list_reply(c,
+ xcb_glx_is_list(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return retval;
@@ -4014,1881 +4671,2779 @@ __indirect_glIsList(GLuint list)
void
__indirect_glDepthRange(GLclampd zNear, GLclampd zFar)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom,
+ GLdouble top, GLdouble zNear, GLdouble zFar)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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();
+ __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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom,
+ GLdouble top, GLdouble zNear, GLdouble zFar)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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();
+ __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); }
+ 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();
+ __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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glAreTexturesResident(GLsizei n, const GLuint * textures,
+ GLboolean * residences)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_are_textures_resident_reply_t *reply =
+ xcb_glx_are_textures_resident_reply(c,
+ xcb_glx_are_textures_resident
+ (c, gc->currentContextTag, n,
+ textures), NULL);
+ (void) memcpy(residences, xcb_glx_are_textures_resident_data(reply),
+ xcb_glx_are_textures_resident_data_length(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));
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return retval;
}
+#define X_GLvop_AreTexturesResidentEXT 11
+GLboolean
+glAreTexturesResidentEXT(GLsizei n, const GLuint * textures,
+ GLboolean * residences)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ return CALL_AreTexturesResident(GET_DISPATCH(),
+ (n, textures, residences));
+ } else {
+ __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_GLrop_CopyTexImage1D 4119
void
-__indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+__indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLint border)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset,
+ GLint x, GLint y, GLsizei width)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint x, GLint y, GLsizei width,
+ GLsizei height)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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
+#define X_GLsop_DeleteTextures 144
void
__indirect_glDeleteTextures(GLsizei n, const GLuint * textures)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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();
+#ifdef USE_XCB
+ xcb_connection_t *c = XGetXCBConnection(dpy);
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ xcb_glx_delete_textures(c, gc->currentContextTag, n, textures);
+#else
+ GLubyte const *pc =
+ __glXSetupSingleRequest(gc, X_GLsop_DeleteTextures, cmdlen);
+ (void) memcpy((void *) (pc + 0), (void *) (&n), 4);
+ (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4));
+ UnlockDisplay(dpy);
+ SyncHandle();
+#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_DeleteTexturesEXT 12
+void
+glDeleteTexturesEXT(GLsizei n, const GLuint * textures)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_DeleteTextures(GET_DISPATCH(), (n, textures));
+ } else {
+ __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_DeleteTexturesEXT, 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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_gen_textures_reply_t *reply =
+ xcb_glx_gen_textures_reply(c,
+ xcb_glx_gen_textures(c,
+ gc->
+ currentContextTag,
+ n), NULL);
+ (void) memcpy(textures, xcb_glx_gen_textures_data(reply),
+ xcb_glx_gen_textures_data_length(reply) *
+ sizeof(GLuint));
free(reply);
#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GenTexturesEXT 13
+void
+glGenTexturesEXT(GLsizei n, GLuint * textures)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GenTextures(GET_DISPATCH(), (n, textures));
+ } else {
+ __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_GLsop_IsTexture 146
GLboolean
__indirect_glIsTexture(GLuint texture)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxIsTextureRep *reply = XCBGlxIsTextureReply(c, XCBGlxIsTexture(c, gc->currentContextTag, texture), NULL);
+ xcb_glx_is_texture_reply_t *reply =
+ xcb_glx_is_texture_reply(c,
+ xcb_glx_is_texture(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return retval;
}
+#define X_GLvop_IsTextureEXT 14
+GLboolean
+glIsTextureEXT(GLuint texture)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ return CALL_IsTexture(GET_DISPATCH(), (texture));
+ } else {
+ __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_PrioritizeTextures 4118
void
-__indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities)
+__indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures,
+ const GLclampf * priorities)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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;
+__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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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)
+__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 );
+ __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)
+__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 );
+ __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)
+__indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue,
+ GLclampf alpha)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__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;
+ __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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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)
+__indirect_glColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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)
+__indirect_glColorTableParameteriv(GLenum target, GLenum pname,
+ const GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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)
+__indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x,
+ GLint y, GLsizei width)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_color_table_reply_t *reply =
+ xcb_glx_get_color_table_reply(c,
+ xcb_glx_get_color_table(c,
+ gc->
+ currentContextTag,
+ target,
+ format,
+ type,
+ state->
+ storePack.
+ swapEndian),
+ NULL);
+ (void) memcpy(table, xcb_glx_get_color_table_data(reply),
+ xcb_glx_get_color_table_data_length(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();
+ 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_GLvop_GetColorTableSGI 4098
+void
+glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table));
+ } else {
+ __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)) {
+ GLubyte const *pc =
+ __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply,
+ X_GLvop_GetColorTableSGI, 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();
+ }
+ return;
+ }
+}
+
#define X_GLsop_GetColorTableParameterfv 148
void
-__indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params)
+__indirect_glGetColorTableParameterfv(GLenum target, GLenum pname,
+ GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_color_table_parameterfv_reply_t *reply =
+ xcb_glx_get_color_table_parameterfv_reply(c,
+ xcb_glx_get_color_table_parameterfv
+ (c,
+ gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_color_table_parameterfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetColorTableParameterfvData(reply), XCBGlxGetColorTableParameterfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params,
+ xcb_glx_get_color_table_parameterfv_data(reply),
+ xcb_glx_get_color_table_parameterfv_data_length
+ (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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetColorTableParameterfvSGI 4099
+void
+glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetColorTableParameterfv(GET_DISPATCH(),
+ (target, pname, params));
+ } else {
+ __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_GetColorTableParameterfvSGI,
+ 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_GLsop_GetColorTableParameteriv 149
void
-__indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params)
+__indirect_glGetColorTableParameteriv(GLenum target, GLenum pname,
+ GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_color_table_parameteriv_reply_t *reply =
+ xcb_glx_get_color_table_parameteriv_reply(c,
+ xcb_glx_get_color_table_parameteriv
+ (c,
+ gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_color_table_parameteriv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetColorTableParameterivData(reply), XCBGlxGetColorTableParameterivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params,
+ xcb_glx_get_color_table_parameteriv_data(reply),
+ xcb_glx_get_color_table_parameteriv_data_length
+ (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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetColorTableParameterivSGI 4100
+void
+glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetColorTableParameteriv(GET_DISPATCH(),
+ (target, pname, params));
+ } else {
+ __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_GetColorTableParameterivSGI,
+ 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_GLrop_ColorSubTable 195
void
-__indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
+__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;
+ __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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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)
+__indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y,
+ GLsizei width)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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;
+__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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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)
+__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 );
+ __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)
+__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 );
+ __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)
+__indirect_glConvolutionParameterf(GLenum target, GLenum pname,
+ GLfloat params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glConvolutionParameterfv(GLenum target, GLenum pname,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glConvolutionParameteriv(GLenum target, GLenum pname,
+ const GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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)
+__indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width,
+ GLsizei height)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_convolution_filter_reply_t *reply =
+ xcb_glx_get_convolution_filter_reply(c,
+ xcb_glx_get_convolution_filter
+ (c, gc->currentContextTag,
+ target, format, type,
+ state->storePack.
+ swapEndian), NULL);
+ (void) memcpy(image, xcb_glx_get_convolution_filter_data(reply),
+ xcb_glx_get_convolution_filter_data_length(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();
+ 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_GLvop_GetConvolutionFilterEXT 1
+void
+gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type,
+ GLvoid * image)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetConvolutionFilter(GET_DISPATCH(),
+ (target, format, type, image));
+ } else {
+ __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)) {
+ GLubyte const *pc =
+ __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply,
+ X_GLvop_GetConvolutionFilterEXT,
+ 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();
+ }
+ return;
+ }
+}
+
#define X_GLsop_GetConvolutionParameterfv 151
void
-__indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params)
+__indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname,
+ GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_convolution_parameterfv_reply_t *reply =
+ xcb_glx_get_convolution_parameterfv_reply(c,
+ xcb_glx_get_convolution_parameterfv
+ (c,
+ gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_convolution_parameterfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetConvolutionParameterfvData(reply), XCBGlxGetConvolutionParameterfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params,
+ xcb_glx_get_convolution_parameterfv_data(reply),
+ xcb_glx_get_convolution_parameterfv_data_length
+ (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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetConvolutionParameterfvEXT 2
+void
+gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetConvolutionParameterfv(GET_DISPATCH(),
+ (target, pname, params));
+ } else {
+ __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_GetConvolutionParameterfvEXT,
+ 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_GLsop_GetConvolutionParameteriv 152
void
-__indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params)
+__indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname,
+ GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_convolution_parameteriv_reply_t *reply =
+ xcb_glx_get_convolution_parameteriv_reply(c,
+ xcb_glx_get_convolution_parameteriv
+ (c,
+ gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_convolution_parameteriv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetConvolutionParameterivData(reply), XCBGlxGetConvolutionParameterivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params,
+ xcb_glx_get_convolution_parameteriv_data(reply),
+ xcb_glx_get_convolution_parameteriv_data_length
+ (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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetConvolutionParameterivEXT 3
+void
+gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetConvolutionParameteriv(GET_DISPATCH(),
+ (target, pname, params));
+ } else {
+ __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_GetConvolutionParameterivEXT,
+ 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_GLsop_GetHistogram 154
void
-__indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+__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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_histogram_reply_t *reply =
+ xcb_glx_get_histogram_reply(c,
+ xcb_glx_get_histogram(c,
+ gc->
+ currentContextTag,
+ target, reset,
+ format, type,
+ state->
+ storePack.
+ swapEndian),
+ NULL);
+ (void) memcpy(values, xcb_glx_get_histogram_data(reply),
+ xcb_glx_get_histogram_data_length(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();
+ 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_GLvop_GetHistogramEXT 5
+void
+gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLvoid * values)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetHistogram(GET_DISPATCH(),
+ (target, reset, format, type, values));
+ } else {
+ __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)) {
+ GLubyte const *pc =
+ __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply,
+ X_GLvop_GetHistogramEXT, 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();
+ }
+ return;
+ }
+}
+
#define X_GLsop_GetHistogramParameterfv 155
void
-__indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params)
+__indirect_glGetHistogramParameterfv(GLenum target, GLenum pname,
+ GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_histogram_parameterfv_reply_t *reply =
+ xcb_glx_get_histogram_parameterfv_reply(c,
+ xcb_glx_get_histogram_parameterfv
+ (c, gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_histogram_parameterfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetHistogramParameterfvData(reply), XCBGlxGetHistogramParameterfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params,
+ xcb_glx_get_histogram_parameterfv_data(reply),
+ xcb_glx_get_histogram_parameterfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetHistogramParameterfvEXT 6
+void
+gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params));
+ } else {
+ __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_GetHistogramParameterfvEXT,
+ 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_GLsop_GetHistogramParameteriv 156
void
-__indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params)
+__indirect_glGetHistogramParameteriv(GLenum target, GLenum pname,
+ GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_histogram_parameteriv_reply_t *reply =
+ xcb_glx_get_histogram_parameteriv_reply(c,
+ xcb_glx_get_histogram_parameteriv
+ (c, gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_histogram_parameteriv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetHistogramParameterivData(reply), XCBGlxGetHistogramParameterivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params,
+ xcb_glx_get_histogram_parameteriv_data(reply),
+ xcb_glx_get_histogram_parameteriv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetHistogramParameterivEXT 7
+void
+gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params));
+ } else {
+ __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_GetHistogramParameterivEXT,
+ 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_GLsop_GetMinmax 157
void
-__indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+__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;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_minmax_reply_t *reply =
+ xcb_glx_get_minmax_reply(c,
+ xcb_glx_get_minmax(c,
+ gc->currentContextTag,
+ target, reset, format,
+ type,
+ state->storePack.
+ swapEndian), NULL);
+ (void) memcpy(values, xcb_glx_get_minmax_data(reply),
+ xcb_glx_get_minmax_data_length(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();
+ 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_GLvop_GetMinmaxEXT 8
+void
+gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLvoid * values)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values));
+ } else {
+ __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)) {
+ GLubyte const *pc =
+ __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply,
+ X_GLvop_GetMinmaxEXT, 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();
+ }
+ return;
+ }
+}
+
#define X_GLsop_GetMinmaxParameterfv 158
void
-__indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params)
+__indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname,
+ GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_minmax_parameterfv_reply_t *reply =
+ xcb_glx_get_minmax_parameterfv_reply(c,
+ xcb_glx_get_minmax_parameterfv
+ (c, gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_minmax_parameterfv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetMinmaxParameterfvData(reply), XCBGlxGetMinmaxParameterfvDataLength(reply) * sizeof(GLfloat));
+ (void) memcpy(params, xcb_glx_get_minmax_parameterfv_data(reply),
+ xcb_glx_get_minmax_parameterfv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetMinmaxParameterfvEXT 9
+void
+gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params));
+ } else {
+ __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_GetMinmaxParameterfvEXT,
+ 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_GLsop_GetMinmaxParameteriv 159
void
__indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_minmax_parameteriv_reply_t *reply =
+ xcb_glx_get_minmax_parameteriv_reply(c,
+ xcb_glx_get_minmax_parameteriv
+ (c, gc->currentContextTag,
+ target, pname), NULL);
+ if (xcb_glx_get_minmax_parameteriv_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetMinmaxParameterivData(reply), XCBGlxGetMinmaxParameterivDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_minmax_parameteriv_data(reply),
+ xcb_glx_get_minmax_parameteriv_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
}
+#define X_GLvop_GetMinmaxParameterivEXT 10
+void
+gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params)
+{
+ __GLXcontext *const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params));
+ } else {
+ __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_GetMinmaxParameterivEXT,
+ 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_GLrop_Histogram 4110
void
-__indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+__indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat,
+ GLboolean sink)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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;
+__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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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)
+__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 );
+ __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;
+__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 ) {
+ 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);
+ (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->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 {
+ 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);
+ 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)
+__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 );
+ __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)
+__indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLint x, GLint y,
+ GLsizei width, GLsizei height)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t,
+ GLdouble r)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t,
+ GLfloat r)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t,
+ GLshort r)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t,
+ GLdouble r, GLdouble q)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t,
+ GLfloat r, GLfloat q)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r,
+ GLint q)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t,
+ GLshort r, GLshort q)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLvop_GetProgramStringARB 1308
void
__indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -5897,171 +7452,202 @@ __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string)
void
__indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLrop_ProgramEnvParameter4dvARB 4185
void
-__indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+__indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x,
+ GLdouble y, GLdouble z, GLdouble w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index,
+ const GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x,
+ GLfloat y, GLfloat z, GLfloat w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index,
+ GLdouble x, GLdouble y, GLdouble z,
+ GLdouble w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index,
+ const GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index,
+ GLfloat x, GLfloat y, GLfloat z,
+ GLfloat w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len,
+ const GLvoid * string)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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 ) {
+ 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);
+ (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 {
+ 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);
+ 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);
}
}
@@ -6071,521 +7657,602 @@ __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const G
void
__indirect_glVertexAttrib1dARB(GLuint index, GLdouble x)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 16;
emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
+ (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); }
+ 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();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 16;
emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 24;
emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, 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 + 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); }
+ 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();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 24;
emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y,
+ GLdouble z)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 32;
emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, 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 + 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); }
+ 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();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 32;
emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 24);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y,
+ GLubyte z, GLubyte w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y,
+ GLdouble z, GLdouble w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 40;
emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, 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);
+ (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); }
+ 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();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 40;
emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 32);
+ (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); }
+ 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)
+__indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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)
+__indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z,
+ GLshort w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_BeginQueryARB 231
void
__indirect_glBeginQueryARB(GLenum target, GLuint id)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLsop_DeleteQueriesARB 161
void
__indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxDeleteQueriesARB(c, gc->currentContextTag, n, ids);
+ xcb_glx_delete_queries_arb(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();
+ 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;
@@ -6595,33 +8262,44 @@ __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids)
void
__indirect_glEndQueryARB(GLenum target)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLsop_GenQueriesARB 162
void
__indirect_glGenQueriesARB(GLsizei n, GLuint * ids)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_gen_queries_arb_reply_t *reply =
+ xcb_glx_gen_queries_arb_reply(c,
+ xcb_glx_gen_queries_arb(c,
+ gc->
+ currentContextTag,
+ n), NULL);
+ (void) memcpy(ids, xcb_glx_gen_queries_arb_data(reply),
+ xcb_glx_gen_queries_arb_data_length(reply) *
+ sizeof(GLuint));
free(reply);
#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenQueriesARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -6631,25 +8309,33 @@ __indirect_glGenQueriesARB(GLsizei n, GLuint * ids)
void
__indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_query_objectiv_arb_reply_t *reply =
+ xcb_glx_get_query_objectiv_arb_reply(c,
+ xcb_glx_get_query_objectiv_arb
+ (c, gc->currentContextTag,
+ id, pname), NULL);
+ if (xcb_glx_get_query_objectiv_arb_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetQueryObjectivARBData(reply), XCBGlxGetQueryObjectivARBDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_query_objectiv_arb_data(reply),
+ xcb_glx_get_query_objectiv_arb_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -6659,25 +8345,33 @@ __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params)
void
__indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_query_objectuiv_arb_reply_t *reply =
+ xcb_glx_get_query_objectuiv_arb_reply(c,
+ xcb_glx_get_query_objectuiv_arb
+ (c, gc->currentContextTag,
+ id, pname), NULL);
+ if (xcb_glx_get_query_objectuiv_arb_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetQueryObjectuivARBData(reply), XCBGlxGetQueryObjectuivARBDataLength(reply) * sizeof(GLuint));
+ (void) memcpy(params, xcb_glx_get_query_objectuiv_arb_data(reply),
+ xcb_glx_get_query_objectuiv_arb_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -6687,25 +8381,36 @@ __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params)
void
__indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(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));
+ xcb_glx_get_queryiv_arb_reply_t *reply =
+ xcb_glx_get_queryiv_arb_reply(c,
+ xcb_glx_get_queryiv_arb(c,
+ gc->
+ currentContextTag,
+ target,
+ pname),
+ NULL);
+ if (xcb_glx_get_queryiv_arb_data_length(reply) == 0)
+ (void) memcpy(params, &reply->datum, sizeof(reply->datum));
else
- (void)memcpy(params, XCBGlxGetQueryivARBData(reply), XCBGlxGetQueryivARBDataLength(reply) * sizeof(GLint));
+ (void) memcpy(params, xcb_glx_get_queryiv_arb_data(reply),
+ xcb_glx_get_queryiv_arb_data_length(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return;
@@ -6715,22 +8420,29 @@ __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params)
GLboolean
__indirect_glIsQueryARB(GLuint id)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ xcb_connection_t *c = XGetXCBConnection(dpy);
(void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxIsQueryARBRep *reply = XCBGlxIsQueryARBReply(c, XCBGlxIsQueryARB(c, gc->currentContextTag, id), NULL);
+ xcb_glx_is_query_arb_reply_t *reply =
+ xcb_glx_is_query_arb_reply(c,
+ xcb_glx_is_query_arb(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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
#endif /* USE_XCB */
}
return retval;
@@ -6740,445 +8452,377 @@ __indirect_glIsQueryARB(GLuint id)
void
__indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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 ) {
+ 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));
+ (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 {
+ 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);
+ 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_GetColorTableParameterfvSGI 4099
-void
-__indirect_glGetColorTableParameterfvSGI(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)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableParameterfvSGI, 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_GetColorTableParameterivSGI 4100
-void
-__indirect_glGetColorTableParameterivSGI(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_GetColorTableParameterivSGI, 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_GetColorTableSGI 4098
-void
-__indirect_glGetColorTableSGI(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)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableSGI, 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();
- }
- return;
-}
-
-#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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_SecondaryColor3bvEXT 4126
void
__indirect_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_6_byte(X_GLrop_SecondaryColor3usvEXT, v);
}
#define X_GLrop_FogCoorddvEXT 4125
void
__indirect_glFogCoorddEXT(GLdouble coord)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_8_byte(X_GLrop_FogCoorddvEXT, coord);
}
#define X_GLrop_FogCoordfvEXT 4124
void
__indirect_glFogCoordfEXT(GLfloat coord)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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 );
+ generic_4_byte(X_GLrop_FogCoordfvEXT, coord);
}
#define X_GLrop_BlendFuncSeparateEXT 4134
void
-__indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+__indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorAlpha, GLenum dfactorAlpha)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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);
+ (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); }
+ 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 );
+ generic_12_byte(X_GLrop_WindowPos3fvMESA, v);
}
#define X_GLvop_AreProgramsResidentNV 1293
GLboolean
-__indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences)
+__indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids,
+ GLboolean * residences)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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));
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return retval;
}
@@ -7187,93 +8831,112 @@ __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * re
void
__indirect_glBindProgramNV(GLenum target, GLuint program)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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;
+ __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();
+ 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)
+__indirect_glExecuteProgramNV(GLenum target, GLuint id,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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;
+ __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);
+ 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_TRUE);
- UnlockDisplay(dpy); SyncHandle();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLvop_GetProgramParameterdvNV 1297
void
-__indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params)
+__indirect_glGetProgramParameterdvNV(GLenum target, GLuint index,
+ GLenum pname, GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLvop_GetProgramParameterfvNV 1296
void
-__indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params)
+__indirect_glGetProgramParameterfvNV(GLenum target, GLuint index,
+ GLenum pname, GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -7282,15 +8945,18 @@ __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname,
void
__indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -7299,50 +8965,61 @@ __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program)
void
__indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLvop_GetTrackMatrixivNV 1300
void
-__indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params)
+__indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname,
+ GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLvop_GetVertexAttribdvNV 1301
void
-__indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params)
+__indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname,
+ GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -7351,15 +9028,18 @@ __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params)
void
__indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -7368,15 +9048,18 @@ __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params)
void
__indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -7385,129 +9068,153 @@ __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params)
GLboolean
__indirect_glIsProgramNV(GLuint program)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return retval;
}
#define X_GLrop_LoadProgramNV 4183
void
-__indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program)
+__indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len,
+ const GLubyte * program)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x,
+ GLdouble y, GLdouble z, GLdouble w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glProgramParameter4dvNV(GLenum target, GLuint index,
+ const GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x,
+ GLfloat y, GLfloat z, GLfloat w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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)
+__indirect_glProgramParameter4fvNV(GLenum target, GLuint index,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num,
+ const GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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)
+__indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num,
+ const GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -7515,404 +9222,468 @@ __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, con
void
__indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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)
+__indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix,
+ GLenum transform)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib1dvNV 4273
void
__indirect_glVertexAttrib1dNV(GLuint index, GLdouble x)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib1dvNV 4273
void
__indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib1fvNV 4269
void
__indirect_glVertexAttrib1fNV(GLuint index, GLfloat x)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib1fvNV 4269
void
__indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib1svNV 4265
void
__indirect_glVertexAttrib1sNV(GLuint index, GLshort x)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib1svNV 4265
void
__indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib2dvNV 4274
void
__indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib2dvNV 4274
void
__indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib2fvNV 4270
void
__indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib2fvNV 4270
void
__indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib2svNV 4266
void
__indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib2svNV 4266
void
__indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib3dvNV 4275
void
-__indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+__indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y,
+ GLdouble z)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib3dvNV 4275
void
__indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib3fvNV 4271
void
__indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib3fvNV 4271
void
__indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib3svNV 4267
void
__indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib3svNV 4267
void
__indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4dvNV 4276
void
-__indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+__indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y,
+ GLdouble z, GLdouble w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4dvNV 4276
void
__indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4fvNV 4272
void
-__indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+__indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4fvNV 4272
void
__indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4svNV 4268
void
-__indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+__indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z,
+ GLshort w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4svNV 4268
void
__indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4ubvNV 4277
void
-__indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+__indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z,
+ GLubyte w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_VertexAttrib4ubvNV 4277
void
__indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -7920,15 +9691,17 @@ __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v)
void
__indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -7936,15 +9709,17 @@ __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v)
void
__indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -7952,15 +9727,17 @@ __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v)
void
__indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -7968,15 +9745,17 @@ __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v)
void
__indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -7984,15 +9763,17 @@ __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v)
void
__indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8000,15 +9781,17 @@ __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v)
void
__indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8016,15 +9799,17 @@ __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v)
void
__indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8032,15 +9817,17 @@ __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v)
void
__indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8048,15 +9835,17 @@ __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v)
void
__indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8064,15 +9853,17 @@ __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v)
void
__indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8080,15 +9871,17 @@ __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v)
void
__indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8096,15 +9889,17 @@ __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v)
void
__indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8112,148 +9907,182 @@ __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v)
void
__indirect_glPointParameteriNV(GLenum pname, GLint param)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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();
+ __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));
+ (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); }
+ 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();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLvop_GetProgramNamedParameterdvNV 1311
void
-__indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params)
+__indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len,
+ const GLubyte * name,
+ GLdouble * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLvop_GetProgramNamedParameterfvNV 1310
void
-__indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params)
+__indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len,
+ const GLubyte * name,
+ GLfloat * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLrop_ProgramNamedParameter4dvNV 4219
void
-__indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+__indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len,
+ const GLubyte * name, GLdouble x,
+ GLdouble y, GLdouble z, GLdouble w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len,
+ const GLubyte * name,
+ const GLdouble * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
#define X_GLrop_ProgramNamedParameter4fvNV 4218
void
-__indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+__indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len,
+ const GLubyte * name, GLfloat x,
+ GLfloat y, GLfloat z, GLfloat w)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len,
+ const GLubyte * name,
+ const GLfloat * v)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8261,54 +10090,64 @@ __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *
void
__indirect_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __GLXcontext *const gc = __glXGetCurrentContext();
const GLuint cmdlen = 12;
emit_header(gc->pc, X_GLrop_BlendEquationSeparateEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&modeRGB), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&modeA), 4);
+ (void) memcpy((void *) (gc->pc + 4), (void *) (&modeRGB), 4);
+ (void) memcpy((void *) (gc->pc + 8), (void *) (&modeA), 4);
gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_BindFramebufferEXT 4319
void
__indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_BindRenderbufferEXT 4316
void
__indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLvop_CheckFramebufferStatusEXT 1427
GLenum
__indirect_glCheckFramebufferStatusEXT(GLenum target)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return retval;
}
@@ -8317,14 +10156,17 @@ __indirect_glCheckFramebufferStatusEXT(GLenum target)
void
__indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
}
@@ -8332,93 +10174,115 @@ __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
void
__indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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));
+ (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); }
+ 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)
+__indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
#define X_GLrop_FramebufferTexture1DEXT 4321
void
-__indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+__indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture,
+ GLint level)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture,
+ GLint level)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture,
+ GLint level, GLint zoffset)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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); }
+ (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_GLvop_GenFramebuffersEXT 1426
void
__indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -8427,14 +10291,17 @@ __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers)
void
__indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -8443,45 +10310,59 @@ __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers)
void
__indirect_glGenerateMipmapEXT(GLenum target)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ 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)
+__indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target,
+ GLenum attachment,
+ GLenum pname,
+ GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
#define X_GLvop_GetRenderbufferParameterivEXT 1424
void
-__indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params)
+__indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname,
+ GLint * params)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return;
}
@@ -8490,15 +10371,18 @@ __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *
GLboolean
__indirect_glIsFramebufferEXT(GLuint framebuffer)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return retval;
}
@@ -8507,32 +10391,38 @@ __indirect_glIsFramebufferEXT(GLuint framebuffer)
GLboolean
__indirect_glIsRenderbufferEXT(GLuint renderbuffer)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
+ __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);
+ 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();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return retval;
}
#define X_GLrop_RenderbufferStorageEXT 4318
void
-__indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+__indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat,
+ GLsizei width, GLsizei height)
{
- __GLXcontext * const gc = __glXGetCurrentContext();
+ __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);
+ (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); }
+ if (__builtin_expect(gc->pc > gc->limit, 0)) {
+ (void) __glXFlushRenderBuffer(gc, gc->pc);
+ }
}
diff --git a/src/glx/x11/indirect.h b/src/glx/x11/indirect.h
index 2e953ca011c..e5b1fadf2b9 100644
--- a/src/glx/x11/indirect.h
+++ b/src/glx/x11/indirect.h
@@ -392,14 +392,18 @@ 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);
+GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT(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);
+GLAPI void GLAPIENTRY glDeleteTexturesEXT(GLsizei n, const GLuint * textures);
extern HIDDEN void __indirect_glGenTextures(GLsizei n, GLuint * textures);
+GLAPI void GLAPIENTRY glGenTexturesEXT(GLsizei n, GLuint * textures);
extern HIDDEN void __indirect_glGetPointerv(GLenum pname, GLvoid ** params);
extern HIDDEN GLboolean __indirect_glIsTexture(GLuint texture);
+GLAPI GLboolean GLAPIENTRY glIsTextureEXT(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);
@@ -413,8 +417,11 @@ extern HIDDEN void __indirect_glColorTableParameterfv(GLenum target, GLenum pnam
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);
+GLAPI void GLAPIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table);
extern HIDDEN void __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params);
+GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params);
extern HIDDEN void __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params);
+GLAPI void GLAPIENTRY glGetColorTableParameterivEXT(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);
@@ -426,16 +433,26 @@ extern HIDDEN void __indirect_glConvolutionParameteriv(GLenum target, GLenum pna
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 gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image);
extern HIDDEN void __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params);
+extern HIDDEN void gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params);
extern HIDDEN void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params);
+extern HIDDEN void gl_dispatch_stub_358(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 gl_dispatch_stub_359(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 gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
extern HIDDEN void __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params);
+extern HIDDEN void gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params);
extern HIDDEN void __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params);
+extern HIDDEN void gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params);
extern HIDDEN void __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+extern HIDDEN void gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
extern HIDDEN void __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params);
+extern HIDDEN void gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params);
extern HIDDEN void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params);
+extern HIDDEN void gl_dispatch_stub_366(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);
@@ -555,12 +572,6 @@ extern HIDDEN void __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GL
extern HIDDEN void __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params);
extern HIDDEN GLboolean __indirect_glIsQueryARB(GLuint id);
extern HIDDEN void __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs);
-extern HIDDEN void __indirect_glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid * table);
-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);
diff --git a/src/glx/x11/indirect_init.c b/src/glx/x11/indirect_init.c
index ddbd8955220..aaa70c8796a 100644
--- a/src/glx/x11/indirect_init.c
+++ b/src/glx/x11/indirect_init.c
@@ -74,15 +74,20 @@ __GLapi * __glXNewIndirectAPI( void )
/* 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->Accum = __indirect_glAccum;
+ glAPI->AlphaFunc = __indirect_glAlphaFunc;
glAPI->Begin = __indirect_glBegin;
glAPI->Bitmap = __indirect_glBitmap;
+ glAPI->BlendFunc = __indirect_glBlendFunc;
+ glAPI->CallList = __indirect_glCallList;
+ glAPI->CallLists = __indirect_glCallLists;
+ glAPI->Clear = __indirect_glClear;
+ glAPI->ClearAccum = __indirect_glClearAccum;
+ glAPI->ClearColor = __indirect_glClearColor;
+ glAPI->ClearDepth = __indirect_glClearDepth;
+ glAPI->ClearIndex = __indirect_glClearIndex;
+ glAPI->ClearStencil = __indirect_glClearStencil;
+ glAPI->ClipPlane = __indirect_glClipPlane;
glAPI->Color3b = __indirect_glColor3b;
glAPI->Color3bv = __indirect_glColor3bv;
glAPI->Color3d = __indirect_glColor3d;
@@ -115,9 +120,74 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->Color4uiv = __indirect_glColor4uiv;
glAPI->Color4us = __indirect_glColor4us;
glAPI->Color4usv = __indirect_glColor4usv;
+ glAPI->ColorMask = __indirect_glColorMask;
+ glAPI->ColorMaterial = __indirect_glColorMaterial;
+ glAPI->CopyPixels = __indirect_glCopyPixels;
+ glAPI->CullFace = __indirect_glCullFace;
+ glAPI->DeleteLists = __indirect_glDeleteLists;
+ glAPI->DepthFunc = __indirect_glDepthFunc;
+ glAPI->DepthMask = __indirect_glDepthMask;
+ glAPI->DepthRange = __indirect_glDepthRange;
+ glAPI->Disable = __indirect_glDisable;
+ glAPI->DrawBuffer = __indirect_glDrawBuffer;
+ glAPI->DrawPixels = __indirect_glDrawPixels;
glAPI->EdgeFlag = __indirect_glEdgeFlag;
glAPI->EdgeFlagv = __indirect_glEdgeFlagv;
+ glAPI->Enable = __indirect_glEnable;
glAPI->End = __indirect_glEnd;
+ glAPI->EndList = __indirect_glEndList;
+ 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->EvalMesh2 = __indirect_glEvalMesh2;
+ glAPI->EvalPoint1 = __indirect_glEvalPoint1;
+ glAPI->EvalPoint2 = __indirect_glEvalPoint2;
+ glAPI->FeedbackBuffer = __indirect_glFeedbackBuffer;
+ glAPI->Finish = __indirect_glFinish;
+ glAPI->Flush = __indirect_glFlush;
+ glAPI->Fogf = __indirect_glFogf;
+ glAPI->Fogfv = __indirect_glFogfv;
+ glAPI->Fogi = __indirect_glFogi;
+ glAPI->Fogiv = __indirect_glFogiv;
+ glAPI->FrontFace = __indirect_glFrontFace;
+ glAPI->Frustum = __indirect_glFrustum;
+ glAPI->GenLists = __indirect_glGenLists;
+ 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->GetTexLevelParameterfv = __indirect_glGetTexLevelParameterfv;
+ glAPI->GetTexLevelParameteriv = __indirect_glGetTexLevelParameteriv;
+ glAPI->GetTexParameterfv = __indirect_glGetTexParameterfv;
+ glAPI->GetTexParameteriv = __indirect_glGetTexParameteriv;
+ glAPI->Hint = __indirect_glHint;
+ glAPI->IndexMask = __indirect_glIndexMask;
glAPI->Indexd = __indirect_glIndexd;
glAPI->Indexdv = __indirect_glIndexdv;
glAPI->Indexf = __indirect_glIndexf;
@@ -126,6 +196,41 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->Indexiv = __indirect_glIndexiv;
glAPI->Indexs = __indirect_glIndexs;
glAPI->Indexsv = __indirect_glIndexsv;
+ glAPI->InitNames = __indirect_glInitNames;
+ glAPI->IsEnabled = __indirect_glIsEnabled;
+ glAPI->IsList = __indirect_glIsList;
+ glAPI->LightModelf = __indirect_glLightModelf;
+ glAPI->LightModelfv = __indirect_glLightModelfv;
+ glAPI->LightModeli = __indirect_glLightModeli;
+ glAPI->LightModeliv = __indirect_glLightModeliv;
+ glAPI->Lightf = __indirect_glLightf;
+ glAPI->Lightfv = __indirect_glLightfv;
+ glAPI->Lighti = __indirect_glLighti;
+ glAPI->Lightiv = __indirect_glLightiv;
+ glAPI->LineStipple = __indirect_glLineStipple;
+ glAPI->LineWidth = __indirect_glLineWidth;
+ glAPI->ListBase = __indirect_glListBase;
+ glAPI->LoadIdentity = __indirect_glLoadIdentity;
+ glAPI->LoadMatrixd = __indirect_glLoadMatrixd;
+ glAPI->LoadMatrixf = __indirect_glLoadMatrixf;
+ glAPI->LoadName = __indirect_glLoadName;
+ glAPI->LogicOp = __indirect_glLogicOp;
+ 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->Materialf = __indirect_glMaterialf;
+ glAPI->Materialfv = __indirect_glMaterialfv;
+ glAPI->Materiali = __indirect_glMateriali;
+ glAPI->Materialiv = __indirect_glMaterialiv;
+ glAPI->MatrixMode = __indirect_glMatrixMode;
+ glAPI->MultMatrixd = __indirect_glMultMatrixd;
+ glAPI->MultMatrixf = __indirect_glMultMatrixf;
+ glAPI->NewList = __indirect_glNewList;
glAPI->Normal3b = __indirect_glNormal3b;
glAPI->Normal3bv = __indirect_glNormal3bv;
glAPI->Normal3d = __indirect_glNormal3d;
@@ -136,6 +241,25 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->Normal3iv = __indirect_glNormal3iv;
glAPI->Normal3s = __indirect_glNormal3s;
glAPI->Normal3sv = __indirect_glNormal3sv;
+ glAPI->Ortho = __indirect_glOrtho;
+ glAPI->PassThrough = __indirect_glPassThrough;
+ glAPI->PixelMapfv = __indirect_glPixelMapfv;
+ glAPI->PixelMapuiv = __indirect_glPixelMapuiv;
+ glAPI->PixelMapusv = __indirect_glPixelMapusv;
+ glAPI->PixelStoref = __indirect_glPixelStoref;
+ glAPI->PixelStorei = __indirect_glPixelStorei;
+ glAPI->PixelTransferf = __indirect_glPixelTransferf;
+ glAPI->PixelTransferi = __indirect_glPixelTransferi;
+ glAPI->PixelZoom = __indirect_glPixelZoom;
+ glAPI->PointSize = __indirect_glPointSize;
+ glAPI->PolygonMode = __indirect_glPolygonMode;
+ glAPI->PolygonStipple = __indirect_glPolygonStipple;
+ glAPI->PopAttrib = __indirect_glPopAttrib;
+ glAPI->PopMatrix = __indirect_glPopMatrix;
+ glAPI->PopName = __indirect_glPopName;
+ glAPI->PushAttrib = __indirect_glPushAttrib;
+ glAPI->PushMatrix = __indirect_glPushMatrix;
+ glAPI->PushName = __indirect_glPushName;
glAPI->RasterPos2d = __indirect_glRasterPos2d;
glAPI->RasterPos2dv = __indirect_glRasterPos2dv;
glAPI->RasterPos2f = __indirect_glRasterPos2f;
@@ -160,6 +284,8 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->RasterPos4iv = __indirect_glRasterPos4iv;
glAPI->RasterPos4s = __indirect_glRasterPos4s;
glAPI->RasterPos4sv = __indirect_glRasterPos4sv;
+ glAPI->ReadBuffer = __indirect_glReadBuffer;
+ glAPI->ReadPixels = __indirect_glReadPixels;
glAPI->Rectd = __indirect_glRectd;
glAPI->Rectdv = __indirect_glRectdv;
glAPI->Rectf = __indirect_glRectf;
@@ -168,6 +294,17 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->Rectiv = __indirect_glRectiv;
glAPI->Rects = __indirect_glRects;
glAPI->Rectsv = __indirect_glRectsv;
+ glAPI->RenderMode = __indirect_glRenderMode;
+ glAPI->Rotated = __indirect_glRotated;
+ glAPI->Rotatef = __indirect_glRotatef;
+ glAPI->Scaled = __indirect_glScaled;
+ glAPI->Scalef = __indirect_glScalef;
+ glAPI->Scissor = __indirect_glScissor;
+ glAPI->SelectBuffer = __indirect_glSelectBuffer;
+ glAPI->ShadeModel = __indirect_glShadeModel;
+ glAPI->StencilFunc = __indirect_glStencilFunc;
+ glAPI->StencilMask = __indirect_glStencilMask;
+ glAPI->StencilOp = __indirect_glStencilOp;
glAPI->TexCoord1d = __indirect_glTexCoord1d;
glAPI->TexCoord1dv = __indirect_glTexCoord1dv;
glAPI->TexCoord1f = __indirect_glTexCoord1f;
@@ -200,6 +337,24 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->TexCoord4iv = __indirect_glTexCoord4iv;
glAPI->TexCoord4s = __indirect_glTexCoord4s;
glAPI->TexCoord4sv = __indirect_glTexCoord4sv;
+ 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->TexImage1D = __indirect_glTexImage1D;
+ glAPI->TexImage2D = __indirect_glTexImage2D;
+ glAPI->TexParameterf = __indirect_glTexParameterf;
+ glAPI->TexParameterfv = __indirect_glTexParameterfv;
+ glAPI->TexParameteri = __indirect_glTexParameteri;
+ glAPI->TexParameteriv = __indirect_glTexParameteriv;
+ glAPI->Translated = __indirect_glTranslated;
+ glAPI->Translatef = __indirect_glTranslatef;
glAPI->Vertex2d = __indirect_glVertex2d;
glAPI->Vertex2dv = __indirect_glVertex2dv;
glAPI->Vertex2f = __indirect_glVertex2f;
@@ -224,239 +379,94 @@ __GLapi * __glXNewIndirectAPI( void )
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->AreTexturesResident = __indirect_glAreTexturesResident;
glAPI->ArrayElement = __indirect_glArrayElement;
glAPI->BindTexture = __indirect_glBindTexture;
glAPI->ColorPointer = __indirect_glColorPointer;
+ glAPI->CopyTexImage1D = __indirect_glCopyTexImage1D;
+ glAPI->CopyTexImage2D = __indirect_glCopyTexImage2D;
+ glAPI->CopyTexSubImage1D = __indirect_glCopyTexSubImage1D;
+ glAPI->CopyTexSubImage2D = __indirect_glCopyTexSubImage2D;
+ glAPI->DeleteTextures = __indirect_glDeleteTextures;
glAPI->DisableClientState = __indirect_glDisableClientState;
glAPI->DrawArrays = __indirect_glDrawArrays;
glAPI->DrawElements = __indirect_glDrawElements;
glAPI->EdgeFlagPointer = __indirect_glEdgeFlagPointer;
glAPI->EnableClientState = __indirect_glEnableClientState;
+ glAPI->GenTextures = __indirect_glGenTextures;
+ glAPI->GetPointerv = __indirect_glGetPointerv;
glAPI->IndexPointer = __indirect_glIndexPointer;
glAPI->Indexub = __indirect_glIndexub;
glAPI->Indexubv = __indirect_glIndexubv;
glAPI->InterleavedArrays = __indirect_glInterleavedArrays;
+ glAPI->IsTexture = __indirect_glIsTexture;
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->PopClientAttrib = __indirect_glPopClientAttrib;
glAPI->PrioritizeTextures = __indirect_glPrioritizeTextures;
+ glAPI->PushClientAttrib = __indirect_glPushClientAttrib;
+ glAPI->TexCoordPointer = __indirect_glTexCoordPointer;
glAPI->TexSubImage1D = __indirect_glTexSubImage1D;
glAPI->TexSubImage2D = __indirect_glTexSubImage2D;
- glAPI->PopClientAttrib = __indirect_glPopClientAttrib;
- glAPI->PushClientAttrib = __indirect_glPushClientAttrib;
+ glAPI->VertexPointer = __indirect_glVertexPointer;
/* 1.2 */
glAPI->BlendColor = __indirect_glBlendColor;
glAPI->BlendEquation = __indirect_glBlendEquation;
- glAPI->DrawRangeElements = __indirect_glDrawRangeElements;
+ glAPI->ColorSubTable = __indirect_glColorSubTable;
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->CopyColorSubTable = __indirect_glCopyColorSubTable;
+ glAPI->CopyColorTable = __indirect_glCopyColorTable;
glAPI->CopyConvolutionFilter1D = __indirect_glCopyConvolutionFilter1D;
glAPI->CopyConvolutionFilter2D = __indirect_glCopyConvolutionFilter2D;
+ glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D;
+ glAPI->DrawRangeElements = __indirect_glDrawRangeElements;
+ glAPI->GetColorTable = __indirect_glGetColorTable;
+ glAPI->GetColorTableParameterfv = __indirect_glGetColorTableParameterfv;
+ glAPI->GetColorTableParameteriv = __indirect_glGetColorTableParameteriv;
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->GetSeparableFilter = __indirect_glGetSeparableFilter;
glAPI->Histogram = __indirect_glHistogram;
glAPI->Minmax = __indirect_glMinmax;
glAPI->ResetHistogram = __indirect_glResetHistogram;
glAPI->ResetMinmax = __indirect_glResetMinmax;
+ glAPI->SeparableFilter2D = __indirect_glSeparableFilter2D;
glAPI->TexImage3D = __indirect_glTexImage3D;
glAPI->TexSubImage3D = __indirect_glTexSubImage3D;
- glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D;
/* 1. GL_ARB_multitexture */
+ 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;
glAPI->MultiTexCoord2dARB = __indirect_glMultiTexCoord2dARB;
glAPI->MultiTexCoord2dvARB = __indirect_glMultiTexCoord2dvARB;
glAPI->MultiTexCoord2fARB = __indirect_glMultiTexCoord2fARB;
@@ -481,16 +491,6 @@ __GLapi * __glXNewIndirectAPI( void )
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 */
@@ -588,18 +588,6 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB;
- /* 14. GL_SGI_color_table */
-
- glAPI->GetColorTableParameterfvSGI = __indirect_glGetColorTableParameterfvSGI;
- glAPI->GetColorTableParameterivSGI = __indirect_glGetColorTableParameterivSGI;
- glAPI->GetColorTableSGI = __indirect_glGetColorTableSGI;
-
- /* 20. GL_EXT_texture_object */
-
- glAPI->AreTexturesResidentEXT = __indirect_glAreTexturesResidentEXT;
- glAPI->GenTexturesEXT = __indirect_glGenTexturesEXT;
- glAPI->IsTextureEXT = __indirect_glIsTextureEXT;
-
/* 25. GL_SGIS_multisample */
glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS;
@@ -646,11 +634,11 @@ __GLapi * __glXNewIndirectAPI( void )
/* 149. GL_EXT_fog_coord */
+ glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT;
+ glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT;
glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT;
glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT;
glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT;
- glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT;
- glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT;
/* 173. GL_EXT_blend_func_separate */
diff --git a/src/glx/x11/indirect_size.c b/src/glx/x11/indirect_size.c
index 79d57d55b68..12214d7fe40 100644
--- a/src/glx/x11/indirect_size.c
+++ b/src/glx/x11/indirect_size.c
@@ -64,307 +64,319 @@
INTERNAL PURE FASTCALL GLint
-__glCallLists_size( GLenum e )
+__glCallLists_size(GLenum e)
{
- switch( e ) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- return 1;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_2_BYTES:
- return 2;
- case GL_3_BYTES:
- return 3;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_4_BYTES:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ return 1;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_2_BYTES:
+ return 2;
+ case GL_3_BYTES:
+ return 3;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_4_BYTES:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glFogfv_size( GLenum e )
+__glFogfv_size(GLenum e)
{
- switch( e ) {
- case GL_FOG_INDEX:
- case GL_FOG_DENSITY:
- case GL_FOG_START:
- case GL_FOG_END:
- case GL_FOG_MODE:
- case GL_FOG_OFFSET_VALUE_SGIX:
- case GL_FOG_DISTANCE_MODE_NV:
- return 1;
- case GL_FOG_COLOR:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_FOG_INDEX:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_MODE:
+ case GL_FOG_OFFSET_VALUE_SGIX:
+ case GL_FOG_DISTANCE_MODE_NV:
+ return 1;
+ case GL_FOG_COLOR:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glLightfv_size( GLenum e )
+__glLightfv_size(GLenum e)
{
- switch( e ) {
- case GL_SPOT_EXPONENT:
- case GL_SPOT_CUTOFF:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION:
- return 1;
- case GL_SPOT_DIRECTION:
- return 3;
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- case GL_POSITION:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_SPOT_EXPONENT:
+ case GL_SPOT_CUTOFF:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ return 1;
+ case GL_SPOT_DIRECTION:
+ return 3;
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_POSITION:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glLightModelfv_size( GLenum e )
+__glLightModelfv_size(GLenum e)
{
- switch( e ) {
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- case GL_LIGHT_MODEL_TWO_SIDE:
- case GL_LIGHT_MODEL_COLOR_CONTROL:
+ switch (e) {
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
/* case GL_LIGHT_MODEL_COLOR_CONTROL_EXT:*/
- return 1;
- case GL_LIGHT_MODEL_AMBIENT:
- return 4;
- default: return 0;
+ return 1;
+ case GL_LIGHT_MODEL_AMBIENT:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glMaterialfv_size( GLenum e )
+__glMaterialfv_size(GLenum e)
{
- switch( e ) {
- case GL_SHININESS:
- return 1;
- case GL_COLOR_INDEXES:
- return 3;
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- case GL_EMISSION:
- case GL_AMBIENT_AND_DIFFUSE:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_SHININESS:
+ return 1;
+ case GL_COLOR_INDEXES:
+ return 3;
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_EMISSION:
+ case GL_AMBIENT_AND_DIFFUSE:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glTexParameterfv_size( GLenum e )
+__glTexParameterfv_size(GLenum e)
{
- switch( e ) {
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_PRIORITY:
- case GL_TEXTURE_WRAP_R:
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ switch (e) {
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
/* case GL_SHADOW_AMBIENT_SGIX:*/
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_CLIPMAP_FRAME_SGIX:
- case GL_TEXTURE_LOD_BIAS_S_SGIX:
- case GL_TEXTURE_LOD_BIAS_T_SGIX:
- case GL_TEXTURE_LOD_BIAS_R_SGIX:
- case GL_GENERATE_MIPMAP:
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_TEXTURE_CLIPMAP_FRAME_SGIX:
+ case GL_TEXTURE_LOD_BIAS_S_SGIX:
+ case GL_TEXTURE_LOD_BIAS_T_SGIX:
+ case GL_TEXTURE_LOD_BIAS_R_SGIX:
+ case GL_GENERATE_MIPMAP:
/* case GL_GENERATE_MIPMAP_SGIS:*/
- case GL_TEXTURE_COMPARE_SGIX:
- case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
- case GL_TEXTURE_MAX_CLAMP_S_SGIX:
- case GL_TEXTURE_MAX_CLAMP_T_SGIX:
- case GL_TEXTURE_MAX_CLAMP_R_SGIX:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- case GL_TEXTURE_LOD_BIAS:
+ case GL_TEXTURE_COMPARE_SGIX:
+ case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_S_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_T_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_R_SGIX:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
/* case GL_TEXTURE_LOD_BIAS_EXT:*/
- case GL_DEPTH_TEXTURE_MODE:
+ case GL_DEPTH_TEXTURE_MODE:
/* case GL_DEPTH_TEXTURE_MODE_ARB:*/
- case GL_TEXTURE_COMPARE_MODE:
+ case GL_TEXTURE_COMPARE_MODE:
/* case GL_TEXTURE_COMPARE_MODE_ARB:*/
- case GL_TEXTURE_COMPARE_FUNC:
+ case GL_TEXTURE_COMPARE_FUNC:
/* case GL_TEXTURE_COMPARE_FUNC_ARB:*/
- case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV:
- return 1;
- case GL_TEXTURE_CLIPMAP_CENTER_SGIX:
- case GL_TEXTURE_CLIPMAP_OFFSET_SGIX:
- return 2;
- case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX:
- return 3;
- case GL_TEXTURE_BORDER_COLOR:
- case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
- case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
- return 4;
- default: return 0;
+ case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV:
+ return 1;
+ case GL_TEXTURE_CLIPMAP_CENTER_SGIX:
+ case GL_TEXTURE_CLIPMAP_OFFSET_SGIX:
+ return 2;
+ case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX:
+ return 3;
+ case GL_TEXTURE_BORDER_COLOR:
+ case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
+ case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glTexEnvfv_size( GLenum e )
+__glTexEnvfv_size(GLenum e)
{
- switch( e ) {
- case GL_ALPHA_SCALE:
- case GL_TEXTURE_ENV_MODE:
- case GL_TEXTURE_LOD_BIAS:
- case GL_COMBINE_RGB:
- case GL_COMBINE_ALPHA:
- case GL_RGB_SCALE:
- case GL_SOURCE0_RGB:
- case GL_SOURCE1_RGB:
- case GL_SOURCE2_RGB:
- case GL_SOURCE3_RGB_NV:
- case GL_SOURCE0_ALPHA:
- case GL_SOURCE1_ALPHA:
- case GL_SOURCE2_ALPHA:
- case GL_SOURCE3_ALPHA_NV:
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- case GL_OPERAND3_RGB_NV:
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- case GL_OPERAND3_ALPHA_NV:
- case GL_COORD_REPLACE_ARB:
+ switch (e) {
+ case GL_ALPHA_SCALE:
+ case GL_TEXTURE_ENV_MODE:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_COMBINE_RGB:
+ case GL_COMBINE_ALPHA:
+ case GL_RGB_SCALE:
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
+ case GL_SOURCE3_RGB_NV:
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
+ case GL_SOURCE3_ALPHA_NV:
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ case GL_OPERAND3_RGB_NV:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ case GL_OPERAND3_ALPHA_NV:
+ case GL_COORD_REPLACE_ARB:
/* case GL_COORD_REPLACE_NV:*/
- return 1;
- case GL_TEXTURE_ENV_COLOR:
- return 4;
- default: return 0;
+ return 1;
+ case GL_TEXTURE_ENV_COLOR:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glTexGendv_size( GLenum e )
+__glTexGendv_size(GLenum e)
{
- switch( e ) {
- case GL_TEXTURE_GEN_MODE:
- return 1;
- case GL_OBJECT_PLANE:
- case GL_EYE_PLANE:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_TEXTURE_GEN_MODE:
+ return 1;
+ case GL_OBJECT_PLANE:
+ case GL_EYE_PLANE:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glMap1d_size( GLenum e )
+__glMap1d_size(GLenum e)
{
- switch( e ) {
- case GL_MAP1_INDEX:
- case GL_MAP1_TEXTURE_COORD_1:
- return 1;
- case GL_MAP1_TEXTURE_COORD_2:
- return 2;
- case GL_MAP1_NORMAL:
- case GL_MAP1_TEXTURE_COORD_3:
- case GL_MAP1_VERTEX_3:
- return 3;
- case GL_MAP1_COLOR_4:
- case GL_MAP1_TEXTURE_COORD_4:
- case GL_MAP1_VERTEX_4:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_MAP1_INDEX:
+ case GL_MAP1_TEXTURE_COORD_1:
+ return 1;
+ case GL_MAP1_TEXTURE_COORD_2:
+ return 2;
+ case GL_MAP1_NORMAL:
+ case GL_MAP1_TEXTURE_COORD_3:
+ case GL_MAP1_VERTEX_3:
+ return 3;
+ case GL_MAP1_COLOR_4:
+ case GL_MAP1_TEXTURE_COORD_4:
+ case GL_MAP1_VERTEX_4:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glMap2d_size( GLenum e )
+__glMap2d_size(GLenum e)
{
- switch( e ) {
- case GL_MAP2_INDEX:
- case GL_MAP2_TEXTURE_COORD_1:
- return 1;
- case GL_MAP2_TEXTURE_COORD_2:
- return 2;
- case GL_MAP2_NORMAL:
- case GL_MAP2_TEXTURE_COORD_3:
- case GL_MAP2_VERTEX_3:
- return 3;
- case GL_MAP2_COLOR_4:
- case GL_MAP2_TEXTURE_COORD_4:
- case GL_MAP2_VERTEX_4:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_MAP2_INDEX:
+ case GL_MAP2_TEXTURE_COORD_1:
+ return 1;
+ case GL_MAP2_TEXTURE_COORD_2:
+ return 2;
+ case GL_MAP2_NORMAL:
+ case GL_MAP2_TEXTURE_COORD_3:
+ case GL_MAP2_VERTEX_3:
+ return 3;
+ case GL_MAP2_COLOR_4:
+ case GL_MAP2_TEXTURE_COORD_4:
+ case GL_MAP2_VERTEX_4:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glColorTableParameterfv_size( GLenum e )
+__glColorTableParameterfv_size(GLenum e)
{
- switch( e ) {
- case GL_COLOR_TABLE_SCALE:
- case GL_COLOR_TABLE_BIAS:
- return 4;
- default: return 0;
+ switch (e) {
+ case GL_COLOR_TABLE_SCALE:
+ case GL_COLOR_TABLE_BIAS:
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glConvolutionParameterfv_size( GLenum e )
+__glConvolutionParameterfv_size(GLenum e)
{
- switch( e ) {
- case GL_CONVOLUTION_BORDER_MODE:
+ switch (e) {
+ case GL_CONVOLUTION_BORDER_MODE:
/* case GL_CONVOLUTION_BORDER_MODE_EXT:*/
- return 1;
- case GL_CONVOLUTION_FILTER_SCALE:
+ return 1;
+ case GL_CONVOLUTION_FILTER_SCALE:
/* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/
- case GL_CONVOLUTION_FILTER_BIAS:
+ case GL_CONVOLUTION_FILTER_BIAS:
/* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/
- case GL_CONVOLUTION_BORDER_COLOR:
+ case GL_CONVOLUTION_BORDER_COLOR:
/* case GL_CONVOLUTION_BORDER_COLOR_HP:*/
- return 4;
- default: return 0;
+ return 4;
+ default:
+ return 0;
}
}
INTERNAL PURE FASTCALL GLint
-__glPointParameterfvEXT_size( GLenum e )
+__glPointParameterfvEXT_size(GLenum e)
{
- switch( e ) {
- case GL_POINT_SIZE_MIN:
+ switch (e) {
+ case GL_POINT_SIZE_MIN:
/* case GL_POINT_SIZE_MIN_ARB:*/
/* case GL_POINT_SIZE_MIN_SGIS:*/
- case GL_POINT_SIZE_MAX:
+ case GL_POINT_SIZE_MAX:
/* case GL_POINT_SIZE_MAX_ARB:*/
/* case GL_POINT_SIZE_MAX_SGIS:*/
- case GL_POINT_FADE_THRESHOLD_SIZE:
+ case GL_POINT_FADE_THRESHOLD_SIZE:
/* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/
/* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/
- case GL_POINT_SPRITE_R_MODE_NV:
- case GL_POINT_SPRITE_COORD_ORIGIN:
- return 1;
- case GL_POINT_DISTANCE_ATTENUATION:
+ case GL_POINT_SPRITE_R_MODE_NV:
+ case GL_POINT_SPRITE_COORD_ORIGIN:
+ return 1;
+ case GL_POINT_DISTANCE_ATTENUATION:
/* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/
/* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/
- return 3;
- default: return 0;
+ return 3;
+ default:
+ return 0;
}
}
-ALIAS( Fogiv, Fogfv )
-ALIAS( Lightiv, Lightfv )
-ALIAS( LightModeliv, LightModelfv )
-ALIAS( Materialiv, Materialfv )
-ALIAS( TexParameteriv, TexParameterfv )
-ALIAS( TexEnviv, TexEnvfv )
-ALIAS( TexGenfv, TexGendv )
-ALIAS( TexGeniv, TexGendv )
-ALIAS( Map1f, Map1d )
-ALIAS( Map2f, Map2d )
-ALIAS( ColorTableParameteriv, ColorTableParameterfv )
-ALIAS( ConvolutionParameteriv, ConvolutionParameterfv )
-ALIAS( PointParameterivNV, PointParameterfvEXT )
-
+ALIAS(Fogiv, Fogfv)
+ ALIAS(Lightiv, Lightfv)
+ ALIAS(LightModeliv, LightModelfv)
+ ALIAS(Materialiv, Materialfv)
+ ALIAS(TexParameteriv, TexParameterfv)
+ ALIAS(TexEnviv, TexEnvfv)
+ ALIAS(TexGenfv, TexGendv)
+ ALIAS(TexGeniv, TexGendv)
+ ALIAS(Map1f, Map1d)
+ ALIAS(Map2f, Map2d)
+ ALIAS(ColorTableParameteriv, ColorTableParameterfv)
+ ALIAS(ConvolutionParameteriv, ConvolutionParameterfv)
+ ALIAS(PointParameterivNV, PointParameterfvEXT)
# undef PURE
# undef FASTCALL
# undef INTERNAL
diff --git a/src/glx/x11/indirect_vertex_array.c b/src/glx/x11/indirect_vertex_array.c
index 5a5cd6697ea..429b52ae635 100644
--- a/src/glx/x11/indirect_vertex_array.c
+++ b/src/glx/x11/indirect_vertex_array.c
@@ -123,10 +123,8 @@ __glXInitVertexArrayState( __GLXcontext * gc )
struct array_state_vector * arrays;
unsigned array_count;
- unsigned texture_units = 1;
- unsigned i;
- unsigned j;
- unsigned vertex_program_attribs = 0;
+ int texture_units = 1, vertex_program_attribs = 0;
+ unsigned i, j;
GLboolean got_fog = GL_FALSE;
GLboolean got_secondary_color = GL_FALSE;
diff --git a/src/glx/x11/singlepix.c b/src/glx/x11/singlepix.c
index 4a10083b8fe..a7b5b798707 100644
--- a/src/glx/x11/singlepix.c
+++ b/src/glx/x11/singlepix.c
@@ -36,6 +36,11 @@
#include "packsingle.h"
#include "indirect.h"
+#include "dispatch.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "glapioffsets.h"
+#include <GL/glxproto.h>
void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
GLvoid *row, GLvoid *column, GLvoid *span)
@@ -103,3 +108,85 @@ void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
__GLX_SINGLE_END();
}
+
+
+#define CONCAT(a,b) a ## b
+#define NAME(o) CONCAT(gl_dispatch_stub_, o)
+
+void NAME(_gloffset_GetSeparableFilter)(GLenum target, GLenum format, GLenum type,
+ GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ __GLXcontext * const gc = __glXGetCurrentContext();
+
+ if (gc->isDirect) {
+ CALL_GetSeparableFilter(GET_DISPATCH(),
+ (target, format, type, row, column, span));
+ return;
+ }
+ else {
+ Display *const dpy = gc->currentDpy;
+ const GLuint cmdlen = __GLX_PAD(13);
+
+ if (dpy != NULL) {
+ const __GLXattribute * const state = gc->client_state_private;
+ xGLXGetSeparableFilterReply reply;
+ GLubyte const *pc =
+ __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply,
+ X_GLvop_GetSeparableFilterEXT, cmdlen);
+ unsigned compsize;
+
+
+ (void) memcpy((void *) (pc + 0), (void *) (&target), 4);
+ (void) memcpy((void *) (pc + 4), (void *) (&format), 4);
+ (void) memcpy((void *) (pc + 8), (void *) (&type), 4);
+ *(int8_t *) (pc + 12) = state->storePack.swapEndian;
+
+ (void) _XReply(dpy, (xReply *) & reply, 0, False);
+
+ compsize = reply.length << 2;
+
+ if (compsize != 0) {
+ const GLint width = reply.width;
+ const GLint height = reply.height;
+ const GLint widthsize =
+ __glImageSize(width, 1, 1, format, type, 0);
+ const GLint heightsize =
+ __glImageSize(height, 1, 1, format, type, 0);
+ GLubyte * const buf =
+ (GLubyte*) Xmalloc((widthsize > heightsize) ? widthsize : heightsize);
+
+ if (buf == NULL) {
+ /* Throw data away */
+ _XEatData(dpy, compsize);
+ __glXSetError(gc, GL_OUT_OF_MEMORY);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return;
+ } else {
+ int extra;
+
+ extra = 4 - (widthsize & 3);
+ _XRead(dpy, (char *)buf, widthsize);
+ if (extra < 4) {
+ _XEatData(dpy, extra);
+ }
+
+ __glEmptyImage(gc, 1, width, 1, 1, format, type, buf,
+ row);
+
+ extra = 4 - (heightsize & 3);
+ _XRead(dpy, (char *)buf, heightsize);
+ if (extra < 4) {
+ _XEatData(dpy, extra);
+ }
+
+ __glEmptyImage(gc, 1, height, 1, 1, format, type, buf,
+ column);
+
+ Xfree((char*) buf);
+ }
+ }
+ }
+ }
+}
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index d4645606f7f..1cd9e5b2bb7 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -33,8 +33,8 @@ default:
$(MAKE) beos ; \
elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \
$(MAKE) directfb ; \
- elif [ "$(DRIVER_DIRS)" = "fbdev" ]; then \
- $(MAKE) fbdev ; \
+ elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \
+ $(MAKE) fbdev ; $(MAKE) osmesa-only ; \
else \
$(MAKE) stand-alone ; \
fi
@@ -141,7 +141,7 @@ $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECT
depend: $(ALL_SOURCES)
@ echo "running $(MKDEP)"
@ touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
+ @$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
> /dev/null
@@ -154,14 +154,19 @@ install: default
$(INSTALL) -d $(INSTALL_DIR)/include/GL
$(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL
- $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGL.* $(INSTALL_DIR)/$(LIB_DIR)
+ @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(INSTALL_DIR)/$(LIB_DIR); \
+ fi
+ @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(INSTALL_DIR)/$(LIB_DIR); \
+ fi
@if [ "${DRIVER_DIRS}" = "dri" ] ; then \
cd drivers/dri ; $(MAKE) install ; \
fi
- ## NOT YET:
- ## $(INSTALL) -d $(INSTALL_DIR)/include/GLES
- ## $(INSTALL) -m 644 include/GLES/*.h $(INSTALL_DIR)/include/GLES
+## NOT INSTALLED YET:
+## $(INSTALL) -d $(INSTALL_DIR)/include/GLES
+## $(INSTALL) -m 644 include/GLES/*.h $(INSTALL_DIR)/include/GLES
# Emacs tags
diff --git a/src/mesa/array_cache/sources b/src/mesa/array_cache/sources
new file mode 100644
index 00000000000..fb3328d10e6
--- /dev/null
+++ b/src/mesa/array_cache/sources
@@ -0,0 +1,7 @@
+MESA_ARRAY_CACHE_SOURCES = \
+ac_context.c \
+ac_import.c
+
+MESA_ARRAY_CACHE_HEADERS = \
+ac_context.h \
+acache.h
diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c
deleted file mode 100644
index cb46efa56ac..00000000000
--- a/src/mesa/drivers/allegro/amesa.c
+++ /dev/null
@@ -1,404 +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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <allegro.h>
-#include "buffers.h"
-#include "context.h"
-#include "imports.h"
-#include "matrix.h"
-#include "mtypes.h"
-#include "GL/amesa.h"
-
-
-struct amesa_visual
- {
- GLvisual *GLVisual; /* inherit from GLvisual */
- GLboolean DBFlag; /* double buffered? */
- GLuint Depth; /* bits per pixel ( >= 15 ) */
- };
-
-
-struct amesa_buffer
- {
- GLframebuffer *GLBuffer; /* inherit from GLframebuffer */
- GLuint Width, Height;
- BITMAP *Screen;
- BITMAP *Background;
- BITMAP *Active;
- };
-
-
-struct amesa_context
- {
- GLcontext *GLContext; /* inherit from GLcontext */
- AMesaVisual Visual;
- AMesaBuffer Buffer;
- GLuint ClearColor;
- GLuint CurrentColor;
- };
-
-
-static void setup_dd_pointers(GLcontext *ctx);
-
-
-/**********************************************************************/
-/***** drawing functions *****/
-/**********************************************************************/
-
-#define FLIP(context, y) (context->Buffer->Height - (y) - 1)
-
-#include "allegro/generic.h"
-#include "allegro/direct.h"
-
-
-/**********************************************************************/
-/***** 15-bit accelerated drawing funcs *****/
-/**********************************************************************/
-
-IMPLEMENT_WRITE_RGBA_SPAN(15, unsigned short)
-IMPLEMENT_WRITE_RGB_SPAN(15, unsigned short)
-IMPLEMENT_WRITE_MONO_RGBA_SPAN(15, unsigned short)
-IMPLEMENT_READ_RGBA_SPAN(15, unsigned short)
-IMPLEMENT_WRITE_RGBA_PIXELS(15, unsigned short)
-IMPLEMENT_WRITE_MONO_RGBA_PIXELS(15, unsigned short)
-IMPLEMENT_READ_RGBA_PIXELS(15, unsigned short)
-
-
-/**********************************************************************/
-/***** 16-bit accelerated drawing funcs *****/
-/**********************************************************************/
-
-IMPLEMENT_WRITE_RGBA_SPAN(16, unsigned short)
-IMPLEMENT_WRITE_RGB_SPAN(16, unsigned short)
-IMPLEMENT_WRITE_MONO_RGBA_SPAN(16, unsigned short)
-IMPLEMENT_READ_RGBA_SPAN(16, unsigned short)
-IMPLEMENT_WRITE_RGBA_PIXELS(16, unsigned short)
-IMPLEMENT_WRITE_MONO_RGBA_PIXELS(16, unsigned short)
-IMPLEMENT_READ_RGBA_PIXELS(16, unsigned short)
-
-
-/**********************************************************************/
-/***** 32-bit accelerated drawing funcs *****/
-/**********************************************************************/
-
-IMPLEMENT_WRITE_RGBA_SPAN(32, unsigned long)
-IMPLEMENT_WRITE_RGB_SPAN(32, unsigned long)
-IMPLEMENT_WRITE_MONO_RGBA_SPAN(32, unsigned long)
-IMPLEMENT_READ_RGBA_SPAN(32, unsigned long)
-IMPLEMENT_WRITE_RGBA_PIXELS(32, unsigned long)
-IMPLEMENT_WRITE_MONO_RGBA_PIXELS(32, unsigned long)
-IMPLEMENT_READ_RGBA_PIXELS(32, unsigned long)
-
-
-/**********************************************************************/
-/***** Miscellaneous device driver funcs *****/
-/**********************************************************************/
-
-static GLboolean set_buffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bit)
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- GLboolean ok = GL_TRUE;
-
- if (bit == DD_FRONT_LEFT_BIT)
- context->Buffer->Active = context->Buffer->Screen;
-
- else if (bit == DD_BACK_LEFT)
- {
- if (context->Buffer->Background)
- context->Buffer->Active = context->Buffer->Background;
- else
- ok = GL_FALSE;
- }
-
- else
- ok = GL_FALSE;
-
- return ok;
- }
-
-
-static void get_buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
-
- *width = context->Buffer->Width;
- *height = context->Buffer->Height;
- }
-
-
-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();
-}
-
-
-/**********************************************************************/
-/**********************************************************************/
-
-static void setup_dd_pointers(GLcontext *ctx)
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
-
- /* Initialize all the pointers in the driver struct. Do this whenever */
- /* a new context is made current or we change buffers via set_buffer! */
-
- ctx->Driver.UpdateState = setup_dd_pointers;
- ctx->Driver.SetBuffer = set_buffer;
- ctx->Driver.GetBufferSize = get_buffer_size;
- ctx->Driver.Viewport = viewport;
-
- ctx->Driver.Color = set_color_generic;
- ctx->Driver.ClearColor = clear_color_generic;
- ctx->Driver.Clear = clear_generic;
- ctx->Driver.WriteRGBASpan = write_rgba_span_generic;
- ctx->Driver.WriteRGBSpan = write_rgb_span_generic;
- ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_generic;
- ctx->Driver.WriteRGBAPixels = write_rgba_pixels_generic;
- ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_generic;
- ctx->Driver.ReadRGBASpan = read_rgba_span_generic;
- ctx->Driver.ReadRGBAPixels = read_rgba_pixels_generic;
-
- if (context->Buffer->Active != screen)
- {
- switch (context->Visual->Depth)
- {
- case 15:
- ctx->Driver.WriteRGBASpan = write_rgba_span_15;
- ctx->Driver.WriteRGBSpan = write_rgb_span_15;
- ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_15;
- ctx->Driver.WriteRGBAPixels = write_rgba_pixels_15;
- ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_15;
- ctx->Driver.ReadRGBASpan = read_rgba_span_15;
- ctx->Driver.ReadRGBAPixels = read_rgba_pixels_15;
- break;
-
- case 16:
- ctx->Driver.WriteRGBASpan = write_rgba_span_16;
- ctx->Driver.WriteRGBSpan = write_rgb_span_16;
- ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_16;
- ctx->Driver.WriteRGBAPixels = write_rgba_pixels_16;
- ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_16;
- ctx->Driver.ReadRGBASpan = read_rgba_span_16;
- ctx->Driver.ReadRGBAPixels = read_rgba_pixels_16;
- break;
-
- case 32:
- ctx->Driver.WriteRGBASpan = write_rgba_span_32;
- ctx->Driver.WriteRGBSpan = write_rgb_span_32;
- ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_32;
- ctx->Driver.WriteRGBAPixels = write_rgba_pixels_32;
- ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_32;
- ctx->Driver.ReadRGBASpan = read_rgba_span_32;
- ctx->Driver.ReadRGBAPixels = read_rgba_pixels_32;
- break;
- }
- }
- }
-
-
-/**********************************************************************/
-/***** AMesa Public API Functions *****/
-/**********************************************************************/
-
-
-AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth,
- GLint depthSize, GLint stencilSize, GLint accumSize)
- {
- AMesaVisual visual;
- GLbyte redBits, greenBits, blueBits;
-
- visual = (AMesaVisual)calloc(1, sizeof(struct amesa_visual));
- if (!visual)
- return NULL;
-
- switch (depth)
- {
- case 15:
- redBits = 5;
- greenBits = 5;
- blueBits = 5;
- break;
-
- case 16:
- redBits = 5;
- greenBits = 6;
- blueBits = 5;
- break;
-
- case 24: case 32:
- redBits = 8;
- greenBits = 8;
- blueBits = 8;
- break;
-
- default:
- free(visual);
- return NULL;
- }
-
- visual->DBFlag = dbFlag;
- visual->Depth = depth;
- visual->GLVisual = _mesa_create_visual(GL_TRUE, /* rgb mode */
- dbFlag, /* db_flag */
- GL_FALSE, /* stereo */
- redBits, greenBits, blueBits, 8,
- 0, /* index bits */
- depthSize, /* depth bits */
- stencilSize,/* stencil bits */
- accumSize, /* accum bits */
- accumSize, /* accum bits */
- accumSize, /* accum bits */
- accumSize, /* accum bits */
- 1 );
- if (!visual->GLVisual)
- {
- free(visual);
- return NULL;
- }
-
- return visual;
- }
-
-
-void AMesaDestroyVisual(AMesaVisual visual)
- {
- _mesa_destroy_visual(visual->GLVisual);
- free(visual);
- }
-
-
-AMesaBuffer AMesaCreateBuffer(AMesaVisual visual,
- GLint width, GLint height)
- {
- AMesaBuffer buffer;
-
- buffer = (AMesaBuffer)calloc(1, sizeof(struct amesa_buffer));
- if (!buffer)
- return NULL;
-
- buffer->Screen = NULL;
- buffer->Background = NULL;
- buffer->Active = NULL;
- buffer->Width = width;
- buffer->Height = height;
-
- if (visual->DBFlag)
- {
- buffer->Background = create_bitmap_ex(visual->Depth, width, height);
- if (!buffer->Background)
- {
- free(buffer);
- return NULL;
- }
- }
-
- buffer->GLBuffer = _mesa_create_framebuffer(visual->GLVisual);
- if (!buffer->GLBuffer)
- {
- if (buffer->Background) destroy_bitmap(buffer->Background);
- free(buffer);
- return NULL;
- }
-
- return buffer;
- }
-
-
-void AMesaDestroyBuffer(AMesaBuffer buffer)
-{
- if (buffer->Screen) destroy_bitmap(buffer->Screen);
- if (buffer->Background) destroy_bitmap(buffer->Background);
- _mesa_destroy_framebuffer(buffer->GLBuffer);
- free(buffer);
-}
-
-
-AMesaContext AMesaCreateContext(AMesaVisual visual,
- AMesaContext share)
-{
- AMesaContext context;
- GLboolean direct = GL_FALSE;
-
- context = (AMesaContext)calloc(1, sizeof(struct amesa_context));
- if (!context)
- return NULL;
-
- context->Visual = visual;
- context->Buffer = NULL;
- context->ClearColor = 0;
- context->CurrentColor = 0;
- context->GLContext = _mesa_create_context(visual->GLVisual,
- share ? share->GLContext : NULL,
- (void *) context, GL_FALSE );
- if (!context->GLContext)
- {
- free(context);
- return NULL;
- }
-
- return context;
-}
-
-
-void AMesaDestroyContext(AMesaContext context)
-{
- _mesa_destroy_context(context->GLContext);
- free(context);
-}
-
-
-GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer)
-{
- if (context && buffer) {
- set_color_depth(context->Visual->Depth);
- if (set_gfx_mode(GFX_AUTODETECT, buffer->Width, buffer->Height, 0, 0) != 0)
- return GL_FALSE;
-
- context->Buffer = buffer;
- buffer->Screen = screen;
- buffer->Active = buffer->Background ? buffer->Background : screen;
-
- setup_dd_pointers(context->GLContext);
- _mesa_make_current(context->GLContext, buffer->GLBuffer);
- }
- else {
- /* XXX I don't think you want to destroy anything here! */
- destroy_bitmap(context->Buffer->Screen);
- context->Buffer->Screen = NULL;
- context->Buffer->Active = NULL;
- context->Buffer = NULL;
- _mesa_make_current(NULL, NULL);
- }
-
- return GL_TRUE;
-}
-
-
-void AMesaSwapBuffers(AMesaBuffer buffer)
-{
- if (buffer->Background) {
- blit(buffer->Background, buffer->Screen,
- 0, 0, 0, 0,
- buffer->Width, buffer->Height);
- }
-}
diff --git a/src/mesa/drivers/allegro/direct.h b/src/mesa/drivers/allegro/direct.h
deleted file mode 100644
index 3998fc19d7b..00000000000
--- a/src/mesa/drivers/allegro/direct.h
+++ /dev/null
@@ -1,189 +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.
- */
-
-
-#define DESTINATION(BMP, X, Y, TYPE) \
- ({ \
- BITMAP *_bmp = BMP; \
- \
- (TYPE*)(_bmp->line[_bmp->h - (Y) - 1]) + (X); \
- })
-
-
-#define IMPLEMENT_WRITE_RGBA_SPAN(DEPTH, TYPE) \
-static void write_rgba_span_##DEPTH (const GLcontext *ctx, \
- GLuint n, GLint x, GLint y, \
- const GLubyte rgba[][4], \
- const GLubyte mask[]) \
- { \
- AMesaContext context = (AMesaContext)(ctx->DriverCtx); \
- TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \
- \
- if (mask) \
- { \
- while (n--) \
- { \
- if (mask[0]) d[0] = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \
- d++; rgba++; mask++; \
- } \
- } \
- else \
- { \
- while (n--) \
- { \
- d[0] = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \
- d++; rgba++; \
- } \
- } \
- }
-
-
-#define IMPLEMENT_WRITE_RGB_SPAN(DEPTH, TYPE) \
-static void write_rgb_span_##DEPTH (const GLcontext *ctx, \
- GLuint n, GLint x, GLint y, \
- const GLubyte rgb[][3], \
- const GLubyte mask[]) \
- { \
- AMesaContext context = (AMesaContext)(ctx->DriverCtx); \
- TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \
- \
- if (mask) \
- { \
- while (n--) \
- { \
- if (mask[0]) d[0] = makecol##DEPTH(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]); \
- d++; rgb++; mask++; \
- } \
- } \
- else \
- { \
- while (n--) \
- { \
- d[0] = makecol##DEPTH(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]); \
- d++; rgb++; \
- } \
- } \
- }
-
-
-#define IMPLEMENT_WRITE_MONO_RGBA_SPAN(DEPTH, TYPE) \
-static void write_mono_rgba_span_##DEPTH (const GLcontext *ctx, \
- GLuint n, GLint x, GLint y, \
- const GLubyte mask[]) \
- { \
- AMesaContext context = (AMesaContext)(ctx->DriverCtx); \
- TYPE color = context->CurrentColor; \
- TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \
- \
- while (n--) \
- { \
- if (mask[0]) d[0] = color; \
- d++; mask++; \
- } \
- }
-
-
-#define IMPLEMENT_READ_RGBA_SPAN(DEPTH, TYPE) \
-static void read_rgba_span_##DEPTH (const GLcontext *ctx, \
- GLuint n, GLint x, GLint y, \
- GLubyte rgba[][4]) \
- { \
- AMesaContext context = (AMesaContext)(ctx->DriverCtx); \
- BITMAP *bmp = context->Buffer->Active; \
- TYPE *d = DESTINATION(bmp, x, y, TYPE); \
- \
- while (n--) \
- { \
- rgba[0][RCOMP] = getr##DEPTH(d[0]); \
- rgba[0][GCOMP] = getg##DEPTH(d[0]); \
- rgba[0][BCOMP] = getb##DEPTH(d[0]); \
- rgba[0][ACOMP] = 255; \
- \
- d++; rgba++; \
- } \
- }
-
-
-#define IMPLEMENT_WRITE_RGBA_PIXELS(DEPTH, TYPE) \
-static void write_rgba_pixels_##DEPTH (const GLcontext *ctx, \
- GLuint n, \
- const GLint x[], \
- const GLint y[], \
- const GLubyte rgba[][4], \
- const GLubyte mask[]) \
- { \
- AMesaContext context = (AMesaContext)(ctx->DriverCtx); \
- BITMAP *bmp = context->Buffer->Active; \
- \
- while (n--) \
- { \
- if (mask[0]) *DESTINATION(bmp, x[0], y[0], TYPE) = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \
- rgba++; x++; y++; mask++; \
- } \
- }
-
-
-
-#define IMPLEMENT_WRITE_MONO_RGBA_PIXELS(DEPTH, TYPE) \
-static void write_mono_rgba_pixels_##DEPTH (const GLcontext *ctx, \
- GLuint n, \
- const GLint x[], \
- const GLint y[], \
- const GLubyte mask[]) \
- { \
- AMesaContext context = (AMesaContext)(ctx->DriverCtx); \
- TYPE color = context->CurrentColor; \
- BITMAP *bmp = context->Buffer->Active; \
- \
- while (n--) \
- { \
- if (mask[0]) *DESTINATION(bmp, x[0], y[0], TYPE) = color; \
- x++; y++; mask++; \
- } \
- }
-
-
-#define IMPLEMENT_READ_RGBA_PIXELS(DEPTH, TYPE) \
-static void read_rgba_pixels_##DEPTH (const GLcontext *ctx, \
- GLuint n, \
- const GLint x[], \
- const GLint y[], \
- GLubyte rgba[][4], \
- const GLubyte mask[]) \
- { \
- AMesaContext context = (AMesaContext)(ctx->DriverCtx); \
- BITMAP *bmp = context->Buffer->Active; \
- \
- while (n--) \
- { \
- if (mask[0]) \
- { \
- int color = *DESTINATION(bmp, x[0], y[0], TYPE); \
- \
- rgba[0][RCOMP] = getr##DEPTH(color); \
- rgba[0][GCOMP] = getg##DEPTH(color); \
- rgba[0][BCOMP] = getb##DEPTH(color); \
- rgba[0][ACOMP] = 255; \
- } \
- \
- x++; y++; rgba++; mask++; \
- } \
- }
-
diff --git a/src/mesa/drivers/allegro/generic.h b/src/mesa/drivers/allegro/generic.h
deleted file mode 100644
index cbdf5ff2b3a..00000000000
--- a/src/mesa/drivers/allegro/generic.h
+++ /dev/null
@@ -1,234 +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.
- */
-
-static void clear_color_generic(GLcontext *ctx, const GLfloat color[4])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- GLubyte r, g, b;
- CLAMPED_FLOAT_TO_UBYTE(r, color[0]);
- CLAMPED_FLOAT_TO_UBYTE(g, color[1]);
- CLAMPED_FLOAT_TO_UBYTE(b, color[2]);
- context->ClearColor = makecol(r, g, b);
- }
-
-
-static void set_color_generic(GLcontext *ctx,
- GLubyte red, GLubyte green,
- GLubyte blue, GLubyte alpha)
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
-
- context->CurrentColor = makecol(red, green, blue);
- }
-
-
-static GLbitfield clear_generic(GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint x, GLint y,
- GLint width, GLint height)
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
-
- if (mask & GL_COLOR_BUFFER_BIT)
- {
- if (all)
- clear_to_color(context->Buffer->Active, context->ClearColor);
- else
- rect(context->Buffer->Active,
- x, y, x+width-1, y+height-1,
- context->ClearColor);
- }
-
- return mask & (~GL_COLOR_BUFFER_BIT);
- }
-
-
-static void write_rgba_span_generic(const GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- const GLubyte rgba[][4],
- const GLubyte mask[])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- BITMAP *bmp = context->Buffer->Active;
-
- y = FLIP(context, y);
-
- if (mask)
- {
- while (n--)
- {
- if (mask[0]) putpixel(bmp, x, y, makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]));
- x++; mask++; rgba++;
- }
- }
- else
- {
- while (n--)
- {
- putpixel(bmp, x, y, makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]));
- x++; rgba++;
- }
- }
- }
-
-
-static void write_rgb_span_generic(const GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- const GLubyte rgb[][3],
- const GLubyte mask[])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- BITMAP *bmp = context->Buffer->Active;
-
- y = FLIP(context, y);
-
- if (mask)
- {
- while(n--)
- {
- if (mask[0]) putpixel(bmp, x, y, makecol(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]));
- x++; mask++; rgb++;
- }
- }
- else
- {
- while (n--)
- {
- putpixel(bmp, x, y, makecol(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]));
- x++; rgb++;
- }
- }
- }
-
-
-static void write_mono_rgba_span_generic(const GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- const GLubyte mask[])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- BITMAP *bmp = context->Buffer->Active;
- int color = context->CurrentColor;
-
- y = FLIP(context, y);
-
- if (mask)
- {
- while(n--)
- {
- if (mask[0]) putpixel(bmp, x, y, color);
- x++; mask++;
- }
- }
- else
- {
- while(n--)
- {
- putpixel(bmp, x, y, color);
- x++;
- }
- }
- }
-
-
-static void read_rgba_span_generic(const GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- GLubyte rgba[][4])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- BITMAP *bmp = context->Buffer->Active;
-
- y = FLIP(context, y);
-
- while (n--)
- {
- int color = getpixel(bmp, x, y);
-
- rgba[0][RCOMP] = getr(color);
- rgba[0][GCOMP] = getg(color);
- rgba[0][BCOMP] = getb(color);
- rgba[0][ACOMP] = 255;
-
- x++; rgba++;
- }
- }
-
-
-static void write_rgba_pixels_generic(const GLcontext *ctx,
- GLuint n,
- const GLint x[],
- const GLint y[],
- const GLubyte rgba[][4],
- const GLubyte mask[])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- BITMAP *bmp = context->Buffer->Active;
-
- while (n--)
- {
- if (mask[0]) putpixel(bmp, x[0], FLIP(context, y[0]), makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]));
- x++; y++; mask++;
- }
- }
-
-
-static void write_mono_rgba_pixels_generic(const GLcontext *ctx,
- GLuint n,
- const GLint x[],
- const GLint y[],
- const GLubyte mask[])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- BITMAP *bmp = context->Buffer->Active;
- int color = context->CurrentColor;
-
- while (n--)
- {
- if (mask[0]) putpixel(bmp, x[0], FLIP(context, y[0]), color);
- x++; y++; mask++;
- }
- }
-
-
-static void read_rgba_pixels_generic(const GLcontext *ctx,
- GLuint n,
- const GLint x[],
- const GLint y[],
- GLubyte rgba[][4],
- const GLubyte mask[])
- {
- AMesaContext context = (AMesaContext)(ctx->DriverCtx);
- BITMAP *bmp = context->Buffer->Active;
-
- while (n--)
- {
- if (mask[0])
- {
- int color = getpixel(bmp, x[0], FLIP(context, y[0]));
-
- rgba[0][RCOMP] = getr(color);
- rgba[0][GCOMP] = getg(color);
- rgba[0][BCOMP] = getb(color);
- rgba[0][ACOMP] = 255;
- }
-
- x++; y++; mask++; rgba++;
- }
- }
-
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 3ccbe54817a..1e44904b930 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -126,6 +126,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->BindProgram = NULL;
driver->NewProgram = _mesa_new_program;
driver->DeleteProgram = _mesa_delete_program;
+#if FEATURE_MESA_program_debug
+ driver->GetFragmentProgramRegister = _swrast_get_program_register;
+#endif /* FEATURE_MESA_program_debug */
/* simple state commands */
driver->AlphaFunc = NULL;
diff --git a/src/mesa/drivers/common/sources b/src/mesa/drivers/common/sources
new file mode 100644
index 00000000000..90e29d78d3f
--- /dev/null
+++ b/src/mesa/drivers/common/sources
@@ -0,0 +1,2 @@
+MESA_DRIVER_COMMON_SOURCES = \
+driverfuncs.c
diff --git a/src/mesa/drivers/d3d/D3DCAPS.CPP b/src/mesa/drivers/d3d/D3DCAPS.CPP
deleted file mode 100644
index cd95ef0f1ee..00000000000
--- a/src/mesa/drivers/d3d/D3DCAPS.CPP
+++ /dev/null
@@ -1,250 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver Build 5 */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "D3DHAL.h"
-/*===========================================================================*/
-/* Macros. */
-/*===========================================================================*/
-#define SRCBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwSrcBlendCaps & d3d ) \
- { \
- sprintf( buffer, "SRC Blend: %s -> %s", # gl, # d3d ); \
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
- pShared->dwSrcBlendCaps[index] = d3d; \
- } \
- else \
- { \
- sprintf( buffer, "SRC Blend: %s -> %s", # gl, # fall ); \
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
- pShared->dwSrcBlendCaps[index] = fall; \
- }
-#define DSTBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwDestBlendCaps & d3d ) \
- { \
- sprintf( buffer, "DST Blend: %s -> %s", # gl, # d3d ); \
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
- pShared->dwDestBlendCaps[index] = d3d; \
- } \
- else \
- { \
- sprintf( buffer, "DST Blend: %s -> %s", # gl, # fall ); \
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
- pShared->dwDestBlendCaps[index] = fall; \
- }
-
-/*===========================================================================*/
-/* I use this function to handle the fact that the D3D texture blending and */
-/* OpenGL texture blending functions don't map one to one. Also there is the*/
-/* problem with cards not supporting all the D3D functions. So I use the CAPS*/
-/* of the card to make a table of functions that will have defaults for the */
-/* unsupported functions. */
-/* So first I fill the table with the fallback function then I check to see */
-/* if the card supports the requested function. If it does I replace the */
-/* default thats already in the array. Now order does matter as I used an */
-/* enum type in D3DShared.h so that the mapping would be a little easier. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void AlphaBlendTableHAL( PMESAD3DHAL pHAL )
-{
- PMESAD3DSHARED pShared = &pHAL->shared;
- int index;
- char buffer[128];
-
- DPF(( DBG_FUNC, "AlphaBlendTableHAL();" ));
-
- /* Make the fallback for the Source blend. */
- for( index = 0; index < 14; index++ )
- {
- switch( index )
- {
- case s_zero:
- SRCBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE );
- break;
- case s_one:
- SRCBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE );
- break;
- case s_dst_color:
- SRCBLEND_MAP( GL_DST_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE );
- break;
- case s_one_minus_dst_color:
- SRCBLEND_MAP( GL_ONE_MINUS_DST_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE );
- break;
- case s_src_alpha:
- SRCBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE );
- break;
- case s_one_minus_src_alpha:
- SRCBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE );
- break;
- case s_dst_alpha:
- SRCBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE );
- break;
- case s_one_minus_dst_alpha:
- SRCBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE );
- break;
- case s_src_alpha_saturate:
- SRCBLEND_MAP( GL_SRC_ALPHA_SATURATE, D3DBLEND_SRCALPHASAT, D3DBLEND_ONE );
- break;
- case s_constant_color:
- SRCBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE );
- break;
- case s_one_minus_constant_color:
- SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE );
- break;
- case s_constant_alpha:
- SRCBLEND_MAP( GL_CONSTANT_ALPHA, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE );
- break;
- case s_one_minus_constant_alpha:
- SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE );
- break;
- }
- }
-
- /* Make the fallback for the Destination blend. */
- for( index = 0; index < 14; index++ )
- {
- switch( index )
- {
- case d_zero:
- DSTBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE );
- break;
- case d_one:
- DSTBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE );
- break;
- case d_src_color:
- DSTBLEND_MAP( GL_SRC_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE );
- break;
- case d_one_minus_src_color:
- DSTBLEND_MAP( GL_ONE_MINUS_SRC_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE );
- break;
- case d_src_alpha:
- DSTBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE );
- break;
- case d_one_minus_src_alpha:
- DSTBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE );
- break;
- case d_dst_alpha:
- DSTBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE );
- break;
- case d_one_minus_dst_alpha:
- DSTBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE );
- break;
- case d_constant_color:
- DSTBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE );
- break;
- case d_one_minus_constant_color:
- DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE );
- break;
- case d_constant_alpha:
- DSTBLEND_MAP( GL_CONSTANT_ALPHAR, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE );
- break;
- case d_one_minus_constant_alpha:
- DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE );
- break;
- }
- }
-
- /* Make the fallbacks for the texture functions. */
- for( index = 0; index < 4; index++ )
- {
- switch( index )
- {
- case d3dtblend_decal:
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_DECAL" ));
- pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
- }
- else
- {
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_MODULATE" ));
- pShared->dwTexFunc[index] = D3DTBLEND_MODULATE;
- }
- else
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_ADD" ));
- pShared->dwTexFunc[index] = D3DTBLEND_ADD;
- }
- }
- break;
- case d3dtblend_decalalpha:
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECALALPHA )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_DECALALPHA" ));
- pShared->dwTexFunc[index] = D3DTBLEND_DECALALPHA;
- }
- else
- {
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPA -> D3DTBLEND_DECAL" ));
- pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
- }
- else
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_ADD" ));
- pShared->dwTexFunc[index] = D3DTBLEND_ADD;
- }
- }
- break;
- case d3dtblend_modulate:
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATE" ));
- pShared->dwTexFunc[index] = D3DTBLEND_MODULATE;
- }
- else
- {
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATEALPHA" ));
- pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA;
- }
- else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_DECAL" ));
- pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
- }
- else
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_ADD" ));
- pShared->dwTexFunc[index] = D3DTBLEND_ADD;
- }
- }
- break;
- case d3dtblend_modulatealpha:
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATEALPHA" ));
- pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA;
- }
- else
- {
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATE" ));
- pShared->dwTexFunc[index] = D3DTBLEND_MODULATE;
- }
- else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_DECALE" ));
- pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
- }
- else
- {
- DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_ADD" ));
- pShared->dwTexFunc[index] = D3DTBLEND_ADD;
- }
- }
- break;
- }
- }
-}
-
diff --git a/src/mesa/drivers/d3d/D3DHAL.H b/src/mesa/drivers/d3d/D3DHAL.H
deleted file mode 100644
index 5295520d7be..00000000000
--- a/src/mesa/drivers/d3d/D3DHAL.H
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#ifndef _D3D_HAL_INC
-#define _D3D_HAL_INC
-
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include <windows.h>
-#include <ddraw.h>
-#include <d3d.h>
-#include <stdlib.h>
-#include <time.h>
-#include "D3DShared.h"
-#include "D3DTextureMgr.h"
-#include "Debug.h"
-/*===========================================================================*/
-/* Defines. */
-/*===========================================================================*/
-#define DX_RESTORE(ps) if ( (ps) && (ps)->IsLost() ) (ps)->Restore();
-/*===========================================================================*/
-/* Type defines. */
-/*===========================================================================*/
-typedef struct _d3d_hal_struct
-{
- MESAD3DSHARED shared;
-
- GUID guid;
- LPDIRECTDRAW lpDD;
- LPDIRECTDRAW4 lpDD4;
- LPDIRECT3D3 lpD3D3;
- LPDIRECT3DDEVICE3 lpD3DDevice;
- D3DDEVICEDESC D3DHWDevDesc;
- LPDIRECTDRAWSURFACE4 lpDDSPrimary,
- lpDDSRender,
- lpDDSZbuffer;
- LPDIRECT3DVIEWPORT3 lpViewport;
- LPDIRECTDRAWCLIPPER lpClipper;
- DDPIXELFORMAT ddpf,
- ddpfZBuffer;
- PTM_OBJECT pTMList;
-
-} MESAD3DHAL, *PMESAD3DHAL;
-/*===========================================================================*/
-/* External function prototypes. */
-/*===========================================================================*/
-extern BOOL InitTMgrHAL( PMESAD3DHAL pHAL );
-extern void TermTMgrHAL( PMESAD3DHAL pHAL );
-extern void AlphaBlendTableHAL( PMESAD3DHAL pHAL );
-
-extern void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel );
-extern char *ErrorStringD3D( HRESULT hr );
-extern void FatalShutDown( PMESAD3DHAL pHAL );
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-extern char *errorMsg;
-
-#endif
-
diff --git a/src/mesa/drivers/d3d/D3DInit.cpp b/src/mesa/drivers/d3d/D3DInit.cpp
deleted file mode 100644
index ba7891612e4..00000000000
--- a/src/mesa/drivers/d3d/D3DInit.cpp
+++ /dev/null
@@ -1,891 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver Build 5 */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "D3DHAL.h"
-/*===========================================================================*/
-/* Local function prototypes. */
-/*===========================================================================*/
-static void DestroyAllSurfaces( PMESAD3DHAL pHAL );
-static void DestroyDevice( PMESAD3DHAL pHAL );
-static void DestroyInterfaces( PMESAD3DHAL pHAL );
-
-HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid );
-HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid );
-HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid );
-/*===========================================================================*/
-/* Globals. */
-/*===========================================================================*/
-//char *errorMsg;
-/*===========================================================================*/
-/* This function is responable for allocating the actual MESAD3DHAL struct. */
-/* Each Mesa context will have its own MESAD3DHAL struct so its like a mini */
-/* context to some extent. All one time allocations/operations get done here.*/
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-extern "C" PMESAD3DSHARED InitHAL( HWND hwnd )
-{
- PMESAD3DHAL pHAL;
- ULONG rc;
-
- DPF(( DBG_FUNC, "InitHAL();" ));
- DPF(( DBG_CNTX_INFO, "hwnd: %d", hwnd ));
-
- /* Allocate the structure and zero it out. */
- pHAL = (PMESAD3DHAL)ALLOC( sizeof(MESAD3DHAL) );
- if ( pHAL == NULL )
- {
- RIP( pHAL, "InitHAL->", "Memory Allocation" );
- return (PMESAD3DSHARED)NULL;
- }
- memset( pHAL, 0, sizeof(MESAD3DHAL) );
-
- /* Get the texture manager going. */
- rc = InitTMgrHAL( pHAL );
- if ( rc == FALSE )
- {
- RIP( pHAL, "InitTMgrHAL->", "Failed" );
- return (PMESAD3DSHARED)NULL;
- }
-
- /* Fill in the window parameters if we can. */
- pHAL->shared.hwnd = hwnd;
-
- /* Parse the user's enviroment variables to generate a debug mask. */
- ReadDBGEnv();
-
- return (PMESAD3DSHARED)pHAL;
-}
-/*===========================================================================*/
-/* This function will unload all the resources that the MESAD3DHAL struct */
-/* has bound to it. The actual structure itself will be freed. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void TermHAL( PMESAD3DSHARED pShared )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
-
- DPF(( DBG_FUNC, "TermHAL();" ));
-
- /* Check for an empty wrapper structure. */
- if ( pHAL == NULL )
- return;
-
- /* Kill this texture manager. */
- TermTMgrHAL( pHAL );
-
- /* Kill any DDraw stuff if exists. */
- DestroyDevice( pHAL );
- DestroyAllSurfaces( pHAL );
- DestroyInterfaces( pHAL );
-
- FREE( pHAL );
-}
-/*===========================================================================*/
-/* This function is used to init and resize the rendering surface as the two*/
-/* are almost the same. First the device and all the surfaces are destoryed */
-/* if they already exist. Next we create a OffScreen rendering surface and */
-/* save some pixelformat info to do color convertions. Next we start to take */
-/* care of getting the most out of the hardware. I use bHardware to determine*/
-/* the state of the device we found in the device enumeration. The enum proc*/
-/* will try for hardware first. I next use a bForceSW to make the enum proc */
-/* choose a software device. So I will try some combinations with HW first */
-/* until I feel I have to set the bForceSW and call this function again. If */
-/* this function is called with no width or height then use the internals. */
-/* NOTE: The worst case is that all will be in SW (RGBDevice) and really */
-/* I should forget the whole thing and fall back to a DDraw span type*/
-/* rendering but what is the point. This way I always know I have a */
-/* D3DDevice and that makes things easier. I do impliment the span */
-/* rendering function for stuff that I haven't done support for such */
-/* as points and lines. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE */
-/*===========================================================================*/
-extern "C" BOOL CreateHAL( PMESAD3DSHARED pShared )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
- DDSURFACEDESC2 ddsd2;
- D3DDEVICEDESC D3DSWDevDesc;
- DDSCAPS2 ddscaps;
- DWORD dwCoopFlags,
- dwWidth,
- dwHeight;
- ULONG rc;
-
- DPF(( DBG_FUNC, "CreateHAL();" ));
-
-#define InitDDSD2(f) memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); \
- ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); \
- ddsd2.dwFlags = f;
-
- if ( pHAL == NULL )
- return FALSE;
-
- /* Use the internal rectangle struct. */
- dwWidth = pShared->rectW.right - pShared->rectW.left;
- dwHeight = pShared->rectW.bottom - pShared->rectW.top;
-
- DPF(( DBG_CNTX_INFO, "Width: %d Height: %d", dwWidth, dwHeight ));
-
- /* The dimensions might still be the same so just leave. */
- if ( (dwWidth == pShared->dwWidth) && (dwHeight == pShared->dwHeight) )
- {
- DPF(( DBG_CNTX_WARN, "Context size hasn't changed" ));
- return TRUE;
- }
-
- /* If one of the dimensions are zero then leave. WM_SIZE should get us back here. */
- if ( (dwWidth == 0) || (dwHeight == 0) )
- return TRUE;
-
- /* Save the renders dimensions. */
- pShared->dwWidth = dwWidth;
- pShared->dwHeight = dwHeight;
-
- DPF(( DBG_CNTX_INFO, "Creating Context:\n cx:%d cy:%d", pShared->dwWidth, pShared->dwHeight ));
-
- /*=================================*/
- /* Create all required interfaces. */
- /*=================================*/
-
- /* Kill any DDraw stuff if exists. */
- DestroyDevice( pHAL );
- DestroyAllSurfaces( pHAL );
- DestroyInterfaces( pHAL );
-
- /* Create a instance of DDraw using the Primary display driver. */
- rc = DirectDrawCreate( NULL, &pHAL->lpDD, NULL );
- if( FAILED(rc) )
- {
- RIP( pHAL, "DirectDrawCreate->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Get the DDraw4 interface. */
- rc = pHAL->lpDD->QueryInterface( IID_IDirectDraw4, (void **)&pHAL->lpDD4 );
- if( FAILED(rc) )
- {
- RIP( pHAL, "QueryInterface (IID_IDirectDraw4) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Get the Direct3D3 interface. */
- rc = pHAL->lpDD4->QueryInterface( IID_IDirect3D3, (void **)&pHAL->lpD3D3 );
- if( FAILED(rc) )
- {
- RIP( pHAL, "QueryInterface (IID_IDirect3D3) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Set the Cooperative level. NOTE: we need to know if we are FS at this point.*/
- dwCoopFlags = (pShared->bWindow == TRUE) ? DDSCL_NORMAL : (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
- rc = pHAL->lpDD4->SetCooperativeLevel( pShared->hwnd, dwCoopFlags );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "SetCooperativeLevel->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /*==================================================================*/
- /* Get the best device we can and note whether its hardware or not. */
- /*==================================================================*/
- pShared->bForceSW = FALSE;
- pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL );
- pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice );
- DPF(( DBG_CNTX_INFO, "bHardware: %s", (pShared->bHardware) ? "TRUE" : "FALSE" ));
- DPF(( DBG_CNTX_INFO, "bWindowed: %s", (pShared->bWindow) ? "TRUE" : "FALSE" ));
-
- /*========================================================================*/
- /* HARDWARE was found. */
- /*========================================================================*/
- if ( pShared->bHardware == TRUE )
- {
- /*===================================*/
- /* HARDWARE -> Z-BUFFER. */
- /*===================================*/
-
- /* Get a Z-Buffer pixelformat. */
- memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
- ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
- rc = pHAL->lpD3D3->EnumZBufferFormats( pHAL->guid, EnumZBufferHook, (VOID*)&ddsd2.ddpfPixelFormat );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "EnumZBufferFormatsl->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Setup our request structure for the Z-buffer surface. */
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY;
- ddsd2.dwWidth = dwWidth;
- ddsd2.dwHeight = dwHeight;
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSZbuffer, NULL );
- if ( !FAILED(rc) )
- {
- DPF(( DBG_CNTX_INFO, "HW ZBuffer" ));
-
- /*===================================*/
- /* HARDWARE -> Z-BUFFER -> FLIPABLE */
- /*===================================*/
- if ( pShared->bWindow == FALSE )
- {
- InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT );
- ddsd2.dwBackBufferCount = 1;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
- if ( FAILED(rc) )
- {
- /* Make sure we try the next fall back. */
- DPF(( DBG_CNTX_WARN, "HW Flip/Complex not available" ));
- pHAL->lpDDSPrimary = NULL;
- }
- else
- {
- /* Get the back buffer that was created. */
- ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
- rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender );
- if ( FAILED(rc) )
- {
- DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> HW Flip/Complex" ));
-
- /* Make sure we try the next fall back. */
- pHAL->lpDDSPrimary->Release();
- pHAL->lpDDSPrimary = NULL;
- }
- else
- {
- /* I have had problems when a complex surface comes back */
- /* with the back buffer being created in SW. Not sure why */
- /* or how this is possable but I'm checking for it here. */
- memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
- ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
- DX_RESTORE( pHAL->lpDDSRender );
- rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* If the surface is in VID then we are happy with are Flipable. */
- if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM )
- {
- pShared->bFlipable = TRUE;
- DPF(( DBG_CNTX_INFO, "HW Flip/Complex!" ));
- }
- else
- {
- /* Kill this setup. */
- pHAL->lpDDSPrimary->Release();
- pHAL->lpDDSPrimary = NULL;
- }
- }
- }
- }
-
- /*===================================*/
- /* HARDWARE -> Z-BUFFER -> BLT */
- /*===================================*/
- if ( pHAL->lpDDSPrimary == NULL )
- {
- pShared->bFlipable = FALSE;
-
- /* Create the Primary (front buffer). */
- InitDDSD2( DDSD_CAPS );
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
- if ( FAILED(rc) )
- {
- /* This is an error as we should be able to do this at minimum. */
- RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Create the Render (back buffer). */
- InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT );
- ddsd2.dwWidth = dwWidth;
- ddsd2.dwHeight = dwHeight;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL );
- if ( FAILED(rc) )
- {
- DPF(( DBG_CNTX_WARN, "Failed HW Offscreen surface" ));
-
- /* Make sure we try the next fall back. */
- pHAL->lpDDSPrimary->Release();
- pHAL->lpDDSPrimary = NULL;
- }
- else
- {
- /* Might as well check here too see if this surface is in */
- /* hardware. If nothing else just to be consistant. */
- memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
- ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
- DX_RESTORE( pHAL->lpDDSRender );
- rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* If the surface is in VID then we are happy. */
- if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM )
- {
- /* Create a clipper object so that DDraw will be able to blt windows that */
- /* have been clipped by the screen or other windows. */
- pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL );
- pHAL->lpClipper->SetHWnd( 0, pShared->hwnd );
- pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper );
- pHAL->lpClipper->Release();
- DPF(( DBG_CNTX_INFO, "HW RENDER surface" ));
- }
- else
- {
- /* Kill this setup. */
- pHAL->lpDDSRender->Release();
- pHAL->lpDDSRender = NULL;
- pHAL->lpDDSPrimary->Release();
- pHAL->lpDDSPrimary = NULL;
- }
- }
- }
-
- /*===================================*/
- /* Create D3DDEVICE -> HARDWARE. */
- /*===================================*/
- if ( pHAL->lpDDSZbuffer && pHAL->lpDDSPrimary && pHAL->lpDDSRender )
- {
- DX_RESTORE( pHAL->lpDDSRender );
- DX_RESTORE( pHAL->lpDDSZbuffer );
-
- rc = pHAL->lpDDSRender->AddAttachedSurface( pHAL->lpDDSZbuffer );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "AddAttachedSurface (ZBUFFER) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DHALDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL );
- if ( rc != D3D_OK )
- {
- DPF(( DBG_CNTX_WARN, "Failed HW Device" ));
- pHAL->lpD3DDevice = NULL;
- }
- else
- {
- DPF(( DBG_CNTX_INFO, "HW Device" ));
- }
- }
- }
- }
-
- /*========================================================================*/
- /* SOFTWARE fallback. */
- /*========================================================================*/
- if ( pHAL->lpD3DDevice == NULL )
- {
- DPF(( DBG_CNTX_INFO, "SW fallback :(" ));
-
- /* Make sure we have no surfaces allocated. Just incase. */
- DestroyAllSurfaces( pHAL );
-
- /* Get a software device. */
- pShared->bFlipable = FALSE;
- pShared->bForceSW = TRUE;
- pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL );
- pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice );
-
- /*===================================*/
- /* SOFTWARE -> Z-BUFFER. */
- /*===================================*/
-
- /*===================================*/
- /* SOFTWARE -> Z-BUFFER -> FLIPABLE */
- /*===================================*/
- if ( pShared->bWindow == FALSE )
- {
- InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT );
- ddsd2.dwBackBufferCount = 1;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
- ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
- ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS);
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
- if ( FAILED(rc) )
- {
- DPF(( DBG_CNTX_WARN, "Failed SW Flip/Complex" ));
-
- /* Make sure we try the next fall back. */
- pHAL->lpDDSPrimary = NULL;
- }
- else
- {
- ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
- rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender );
- if ( FAILED(rc) )
- {
- /* Make sure we try the next fall back. */
- DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> SW Flip/Complex" ));
- pHAL->lpDDSPrimary->Release();
- pHAL->lpDDSPrimary = NULL;
- }
- else
- {
- DPF(( DBG_CNTX_INFO, "SW Flip/Complex" ));
- pShared->bFlipable = TRUE;
- }
- }
- }
-
- /*===================================*/
- /* SOFTWARE -> Z-BUFFER -> BLT */
- /*===================================*/
- if ( pHAL->lpDDSPrimary == NULL )
- {
- /* Create the Primary (front buffer). */
- InitDDSD2( DDSD_CAPS );
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
- if ( FAILED(rc) )
- {
- /* This is an error as we should be able to do this at minimum. */
- RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Create the Render (back buffer). */
- InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT );
- ddsd2.dwWidth = dwWidth;
- ddsd2.dwHeight = dwHeight;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
- ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
- ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS);
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL );
- if ( FAILED(rc) )
- {
- /* That was our last hope. */
- RIP( pHAL, "CreateSurface (RENDER) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
- else
- {
- DPF(( DBG_CNTX_INFO, "SW RENDER surface" ));
-
- /* Create a clipper object so that DDraw will be able to blt windows that */
- /* have been clipped by the screen or other windows. */
- pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL );
- pHAL->lpClipper->SetHWnd( 0, pShared->hwnd );
- pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper );
- pHAL->lpClipper->Release();
- }
- }
-
- /*===================================*/
- /* Create D3DDEVICE -> SOFTWARE. */
- /*===================================*/
- if ( pHAL->lpDDSPrimary && pHAL->lpDDSRender )
- {
- DX_RESTORE( pHAL->lpDDSRender );
- rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DRGBDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL );
- if ( rc != D3D_OK )
- {
- /* That was our last hope. */
- RIP( pHAL, "CreateDevice (IID_IDirect3DRGBDevice) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- DPF(( DBG_CNTX_INFO, "SW Device" ));
- }
- }
-
- /*==============================================================================*/
- /* Get a copy of the render pixelformat so that wgl.c can call GetPixelInfoD3D. */
- /*==============================================================================*/
- memset( &pHAL->ddpf, 0, sizeof(DDPIXELFORMAT) );
- pHAL->ddpf.dwSize = sizeof( DDPIXELFORMAT );
- rc = pHAL->lpDDSRender->GetPixelFormat( &pHAL->ddpf );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "GetPixelFormat ->", ErrorStringD3D(rc) );
- return FALSE;
- }
- DebugPixelFormat( "Using OFFSCREEN", &pHAL->ddpf );
- DebugPixelFormat( "Using ZBUFFER", &ddsd2.ddpfPixelFormat );
-
- /* Get a copy of what the D3DDevice supports for later use. */
- memset( &D3DSWDevDesc, 0, sizeof(D3DDEVICEDESC) );
- memset( &pHAL->D3DHWDevDesc, 0, sizeof(D3DDEVICEDESC) );
- D3DSWDevDesc.dwSize = sizeof( D3DDEVICEDESC );
- pHAL->D3DHWDevDesc.dwSize = sizeof( D3DDEVICEDESC );
- rc = pHAL->lpD3DDevice->GetCaps( &pHAL->D3DHWDevDesc, &D3DSWDevDesc );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "GetCaps ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Get a copy of the pixel convertion stuff for direct buffer access. */
- Solve8BitChannelPixelFormat( &pHAL->ddpf, &pShared->pixel );
- AlphaBlendTableHAL( pHAL );
-
- /* We must prime the Begin/End scene for SwapBuffers to work. */
- rc = pHAL->lpD3DDevice->BeginScene();
- if ( FAILED(rc) )
- {
- RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
-#undef InitDDSD2
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function will make sure a viewport is created and set for the device*/
-/* in the supplied structure. If a rect is supplied then it will be used for*/
-/* the viewport otherwise the current setting in the strucute will be used. */
-/* Note that the rect is relative to the window. So left/top must be 0,0 to */
-/* use the whole window else there is scissoring going down. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-extern "C" BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
- D3DVIEWPORT2 vdData;
- ULONG rc;
- POINT pt;
-
- DPF(( DBG_FUNC, "SetViewportHAL();" ));
-
- /* Make sure we have enough info. */
- if ( !pHAL || !pHAL->lpDDSPrimary || !pHAL->lpD3DDevice )
- {
- DPF(( DBG_CNTX_WARN, "SetViewport() -> NULL Pointer" ));
- return FALSE;
- }
-
- /* TODO: this is just a temp fix to stop redundant changes. */
- if ( pRect &&
- (pShared->rectV.left == pRect->left) &&
- (pShared->rectV.right == pRect->right) &&
- (pShared->rectV.top == pRect->top) &&
- (pShared->rectV.bottom == pRect->bottom) )
- {
- DPF(( DBG_CNTX_WARN, "Redundant viewport" ));
- return TRUE;
- }
-
- DPF(( DBG_CNTX_INFO, "Current Viewport:" ));
- DPF(( DBG_CNTX_INFO, "x: %d y: %d", pShared->rectV.left, pShared->rectV.top ));
- DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pShared->rectV.right-pShared->rectV.left), (pShared->rectV.bottom-pShared->rectV.top) ));
- DPF(( DBG_CNTX_INFO, "New Viewport:" ));
- DPF(( DBG_CNTX_INFO, "x: %d y: %d", pRect->left, pRect->top ));
- DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pRect->right-pRect->left), (pRect->bottom-pRect->top) ));
-
- /* Update the current viewport rect if one is supplied. */
- if ( pRect )
- memcpy( &pShared->rectV, pRect, sizeof(RECT) );
-
- /* Build the request structure. */
- memset( &vdData, 0, sizeof(D3DVIEWPORT2) );
- vdData.dwSize = sizeof(D3DVIEWPORT2);
- vdData.dwX = pShared->rectV.left;
- vdData.dwY = pShared->rectV.top;
- vdData.dwWidth = (pShared->rectV.right - pShared->rectV.left);
- vdData.dwHeight = (pShared->rectV.bottom - pShared->rectV.top);
-
- if ( !vdData.dwWidth || !vdData.dwHeight )
- {
- GetClientRect( pShared->hwnd, &pShared->rectW );
- pt.x = pt.y = 0;
- ClientToScreen( pShared->hwnd, &pt );
- OffsetRect( &pShared->rectW, pt.x, pt.y);
- vdData.dwX = pShared->rectW.left;
- vdData.dwY = pShared->rectW.top;
- vdData.dwWidth = (pShared->rectW.right - pShared->rectW.left);
- vdData.dwHeight = (pShared->rectW.bottom - pShared->rectW.top);
- memcpy( &pShared->rectV, &pShared->rectW, sizeof(RECT) );
- }
-
- // The dvClipX, dvClipY, dvClipWidth, dvClipHeight, dvMinZ,
- // and dvMaxZ members define the non-normalized post-perspective
- // 3-D view volume which is visible to the viewer. In most cases,
- // dvClipX is set to -1.0 and dvClipY is set to the inverse of
- // the viewport's aspect ratio on the target surface, which can be
- // calculated by dividing the dwHeight member by dwWidth. Similarly,
- // the dvClipWidth member is typically 2.0 and dvClipHeight is set
- // to twice the aspect ratio set in dwClipY. The dvMinZ and dvMaxZ
- // are usually set to 0.0 and 1.0.
- vdData.dvClipX = -1.0f;
- vdData.dvClipWidth = 2.0f;
- vdData.dvClipY = 1.0f;
- vdData.dvClipHeight = 2.0f;
- vdData.dvMaxZ = maxZ;
- vdData.dvMinZ = minZ;
-
- DPF(( DBG_CNTX_INFO, "zMin: %f zMax: %f", minZ, maxZ ));
-
- /* I'm going to destroy the viewport everytime as when we size we will */
- /* have a new D3DDevice. As this area doesn't need to be fast... */
- if ( pHAL->lpViewport )
- {
- DPF(( DBG_CNTX_INFO, "DeleteViewport" ));
-
- pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport );
- rc = pHAL->lpViewport->Release();
- pHAL->lpViewport = NULL;
- }
-
- rc = pHAL->lpD3D3->CreateViewport( &pHAL->lpViewport, NULL );
- if ( rc != D3D_OK )
- {
- DPF(( DBG_CNTX_ERROR, "CreateViewport Failed" ));
- return FALSE;
- }
-
- /* Update the device with the new viewport. */
- pHAL->lpD3DDevice->AddViewport( pHAL->lpViewport );
- pHAL->lpViewport->SetViewport2( &vdData );
- pHAL->lpD3DDevice->SetCurrentViewport( pHAL->lpViewport );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* */
-/* */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid )
-{
- DDSURFACEDESC2 *pddsd2 = (DDSURFACEDESC2 *)pVoid;
-
- DPF(( DBG_FUNC, "EnumSurfacesHook();" ));
-
- if ( (lpDDSDesc->ddpfPixelFormat.dwFlags == pddsd2->ddpfPixelFormat.dwFlags) && (lpDDSDesc->ddsCaps.dwCaps == pddsd2->ddsCaps.dwCaps) )
- {
- /* Save the pixelformat now so that we know we have one. */
- memcpy( pddsd2, lpDDSDesc, sizeof(DDSURFACEDESC2) );
-
- return D3DENUMRET_CANCEL;
- }
-
- return D3DENUMRET_OK;
-}
-/*===========================================================================*/
-/* This is the callback proc to get a Z-Buffer. Thats it. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid )
-{
- DDPIXELFORMAT *pddpfChoice = (DDPIXELFORMAT *)pVoid;
-
- DPF(( DBG_FUNC, "EnumZBufferHook();" ));
-
- /* If this is ANY type of depth-buffer, stop. */
- if( pddpf->dwFlags == DDPF_ZBUFFER )
- {
- /* Save the pixelformat now so that we know we have one. */
- memcpy( pddpfChoice, pddpf, sizeof(DDPIXELFORMAT) );
-
- /* I feel if the hardware supports this low then lets use it. Could get ugly. */
- if( pddpf->dwZBufferBitDepth >= 8 )
- {
- return D3DENUMRET_CANCEL;
- }
- }
-
- return D3DENUMRET_OK;
-}
-/*===========================================================================*/
-/* This function handles the callback for the D3DDevice enumeration. Good */
-/* god who's idea was this? The D3D wrapper has two variable related to what*/
-/* kind of device we want and have. First we have a Bool that is set if we */
-/* have allocated a HW device. We always look for the HW device first. The */
-/* other variable is used to force SW. If we have run into a case that we */
-/* want to fallback to SW then we set this. We will fallback if we cannot */
-/* texture in video memory (among others). */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pVoid;
- LPD3DDEVICEDESC pChoice = lpD3DHWDesc;
-
- DPF(( DBG_FUNC, "EnumDeviceHook();" ));
-
- /* Determine if which device description is valid. */
- if ( pChoice->dcmColorModel == 0 )
- pChoice = lpD3DHELDesc;
-
- /* Make sure we always have a GUID. */
- memcpy( &pHAL->guid, lpGuid, sizeof(GUID) );
-
- /* This controls whether we will except HW or not. */
- if ( pHAL->shared.bForceSW == TRUE )
- {
- return (pChoice == lpD3DHELDesc) ? D3DENUMRET_CANCEL : D3DENUMRET_OK;
- }
-
- /* Always try for hardware. */
- if ( pChoice == lpD3DHWDesc )
- {
- return D3DENUMRET_CANCEL;
- }
-
- return D3DENUMRET_OK;
-}
-/*===========================================================================*/
-/* This function will destroy any and all surfaces that this context has */
-/* allocated. If there is a clipper object then it will also be destoryed as*/
-/* it is part of the Primary Surface. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void DestroyAllSurfaces( PMESAD3DHAL pHAL )
-{
- LONG refCount;
-
- DPF(( DBG_FUNC, "DestroyAllSurfaces();" ));
-
- DX_RESTORE( pHAL->lpDDSPrimary );
- DX_RESTORE( pHAL->lpDDSRender );
- DX_RESTORE( pHAL->lpDDSZbuffer);
-
- if ( pHAL->lpDDSRender )
- {
- pHAL->lpDDSRender->Unlock( NULL );
-
- /* If this isn't a Flipable surface then we must clean up the render. */
- if ( pHAL->shared.bFlipable == FALSE)
- {
- if ( pHAL->lpDDSZbuffer )
- {
- DPF(( DBG_CNTX_INFO, "Remove attached surfaces from RENDER" ));
- pHAL->lpDDSRender->DeleteAttachedSurface( 0, NULL );
- }
-
- DPF(( DBG_CNTX_INFO, "Release RENDER" ));
- refCount = pHAL->lpDDSRender->Release();
- pHAL->lpDDSRender = NULL;
- }
- }
-
- if ( pHAL->lpDDSZbuffer )
- {
- DPF(( DBG_CNTX_INFO, "Release ZBuffer" ));
- pHAL->lpDDSZbuffer->Unlock( NULL );
- refCount = pHAL->lpDDSZbuffer->Release();
- pHAL->lpDDSZbuffer = NULL;
- }
-
- if ( pHAL->lpClipper )
- {
- DPF(( DBG_CNTX_INFO, "Release Clipper" ));
- refCount = pHAL->lpClipper->Release();
- pHAL->lpClipper = NULL;
- }
-
- if ( pHAL->lpDDSPrimary )
- {
- pHAL->lpDDSPrimary->Unlock( NULL );
-
- DPF(( DBG_CNTX_INFO, "Release PRIMARY" ));
- refCount = pHAL->lpDDSPrimary->Release();
- pHAL->lpDDSPrimary = NULL;
- }
-}
-/*===========================================================================*/
-/* This function will destroy the current D3DDevice and any resources that */
-/* belong to it. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void DestroyDevice( PMESAD3DHAL pHAL )
-{
- LONG refCount;
-
- DPF(( DBG_FUNC, "DestroyDevice();" ));
-
- /* Kill the D3D stuff if exists. */
- if ( pHAL->lpViewport )
- {
- DPF(( DBG_CNTX_INFO, "Delete Viewport" ));
- pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport );
-
- DPF(( DBG_CNTX_INFO, "Release Viewport" ));
- refCount = pHAL->lpViewport->Release();
- pHAL->lpViewport = NULL;
- }
-
- if ( pHAL->lpD3DDevice != NULL )
- {
- DPF(( DBG_CNTX_INFO, "Release D3DDevice" ));
- refCount = pHAL->lpD3DDevice->EndScene();
- refCount = pHAL->lpD3DDevice->Release();
- pHAL->lpD3DDevice = NULL;
- }
-}
-/*===========================================================================*/
-/* This function will destroy the current D3DDevice and any resources that */
-/* belong to it. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void DestroyInterfaces( PMESAD3DHAL pHAL )
-{
- LONG refCount;
-
- DPF(( DBG_FUNC, "DestroyInterfaces();" ));
-
- if ( pHAL->lpD3D3 != NULL )
- {
- DPF(( DBG_CNTX_INFO, "Release Direct3D3" ));
- refCount = pHAL->lpD3D3->Release();
- pHAL->lpD3D3 = NULL;
- }
-
- if ( pHAL->lpDD4 != NULL )
- {
- DPF(( DBG_CNTX_INFO, "Release DDraw4" ));
- refCount = pHAL->lpDD4->Release();
- pHAL->lpDD4 = NULL;
- }
-
- if ( pHAL->lpDD != NULL )
- {
- DPF(( DBG_CNTX_INFO, "Release DDraw" ));
- refCount = pHAL->lpDD->Release();
- pHAL->lpDD = NULL;
- }
-}
-/*===========================================================================*/
-/* This function will first send (not post) a message to the client window */
-/* that this context is using. The client will respond by unbinding itself */
-/* and binding the 'default' context. This allows the API to be supported */
-/* until the window can be destroyed. Finally we post the quit message to */
-/* the client in hopes to end the application. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void FatalShutDown( PMESAD3DHAL pHAL )
-{
- /* Whip this baby in too try and support the API until we die... */
- if ( pHAL )
- SendMessage( pHAL->shared.hwnd, UM_FATALSHUTDOWN, 0L, 0L );
-
- /* Close the client application down. */
- PostQuitMessage( 0 );
-}
-
diff --git a/src/mesa/drivers/d3d/D3DMESA.H b/src/mesa/drivers/d3d/D3DMESA.H
deleted file mode 100644
index 074ceca816a..00000000000
--- a/src/mesa/drivers/d3d/D3DMESA.H
+++ /dev/null
@@ -1,84 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#ifndef D3D_MESA_H
-#define D3D_MESA_H
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include <windows.h>
-#include <ddraw.h>
-#include <d3d.h>
-#include "matrix.h"
-#include "context.h"
-#include "mtypes.h"
-#include "vb.h"
-#include "D3DShared.h"
-#include "Debug.h"
-#include "NULLProcs.h"
-/*===========================================================================*/
-/* Macros. */
-/*===========================================================================*/
-#define FLIP(h,y) (h-y)
-/*===========================================================================*/
-/* Magic numbers. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Type defines. */
-/*===========================================================================*/
-struct __extensions__
-{
- PROC proc;
- char *name;
-};
-
-typedef GLbitfield (*ClearPROC)( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
-typedef void (*WSpanRGBPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] );
-typedef void (*WSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
-typedef void (*WSpanRGBAMonoPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] );
-typedef void (*WPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
-typedef void (*WPixelsRGBAMonoPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
-typedef void (*RSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
-typedef void (*RPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
-
-typedef struct D3D_mesa_context
-{
- PMESAD3DSHARED pShared;
-
- GLcontext *gl_ctx; /* The core GL/Mesa context */
- GLvisual *gl_visual; /* Describes the buffers */
- GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers */
-
- HDC hdc;
- WNDPROC hOldProc;
-
- UCHAR rClear, /* Current clear colors. */
- gClear,
- bClear,
- aClear,
- rCurrent, /* Current rendering colors. */
- gCurrent,
- bCurrent,
- aCurrent;
-
- struct D3D_mesa_context *next;
-
-} D3DMESACONTEXT, *PD3DMESACONTEXT;
-/*===========================================================================*/
-/* Extern function prototypes. */
-/*===========================================================================*/
-extern void gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height );
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-extern D3DTLVERTEX D3DTLVertices[(VB_MAX*6)];
-
-#endif
-
diff --git a/src/mesa/drivers/d3d/D3DRaster.cpp b/src/mesa/drivers/d3d/D3DRaster.cpp
deleted file mode 100644
index 004bb773603..00000000000
--- a/src/mesa/drivers/d3d/D3DRaster.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "D3DHAL.h"
-/*===========================================================================*/
-/* This function clears the context bound to the supplied shared context. */
-/* The function takes the D3D flags D3DCLEAR_TARGET, D3DCLEAR_STENCIL and */
-/* D3DCLEAR_ZBUFFER. Set bAll to TRUE for a full clear else supply the coord*/
-/* of the rect to be cleared relative to the window. The color is always a */
-/* 32bit value (RGBA). Fill in the z-value and stencil if needed. */
-/* */
-/* TODO: this can be redone to be called by Mesa directly. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
- D3DRECT d3dRect;
-
-#ifdef D3D_DEBUG
- HRESULT rc;
-
- DPF(( DBG_FUNC, "CleaHAL();" ));
-
- /* Make sure we have enough info. */
- if ( (pHAL == NULL) || (pHAL->lpViewport == NULL) )
- return;
-#endif
-
- if ( bAll )
- {
- /* I assume my viewport is valid. */
- d3dRect.lX1 = pShared->rectV.left;
- d3dRect.lY1 = pShared->rectV.top;
- d3dRect.lX2 = pShared->rectV.right;
- d3dRect.lY2 = pShared->rectV.bottom;
- }
- else
- {
- d3dRect.lX1 = pShared->rectV.left + x;
- d3dRect.lY1 = pShared->rectV.top + y;
- d3dRect.lX2 = d3dRect.lX1 + cx;
- d3dRect.lY2 = d3dRect.lY1 + cy;
- }
-
-#ifdef D3D_DEBUG
- rc = pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "Clear2 ->", ErrorStringD3D(rc) );
- }
-#else
- pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil );
-#endif
-}
-/*===========================================================================*/
-/* Well this is the guts of it all. Here we rasterize the primitives that */
-/* are in their final form. OpenGL has done all the lighting, transfomations*/
-/* and clipping at this point. */
-/* */
-/* TODO: I'm not sure if I want to bother to check for errors on this call. */
-/* The overhead kills me... */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
-
-#ifdef D3D_DEBUG
- HRESULT rc;
-
- DPF(( DBG_FUNC, "DrawPrimitveHAL();" ));
-
- /* Make sure we have enough info. */
- if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) )
- return;
-
- DPF(( DBG_PRIM_INFO, "DP( %d )", dwCount ));
-
- rc = pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType,
- D3DFVF_TLVERTEX,
- (LPVOID)pVertices,
- dwCount,
- (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "DrawPrimitive ->", ErrorStringD3D(rc) );
- }
-#else
- pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType,
- D3DFVF_TLVERTEX,
- (LPVOID)pVertices,
- dwCount,
- (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
-#endif
-}
-/*===========================================================================*/
-/* This call will handle the swapping of the buffers. Now I didn't bother */
-/* to support single buffered so this will be used for glFlush() as its all */
-/* the same. So first we do an EndScene as we are always considered to be in*/
-/* a BeginScene because when we leave we do a BeginScene. Now note that when*/
-/* the context is created in the first place we do a BeginScene also just to */
-/* get things going. The call will use either Flip/blt based on the type of */
-/* surface was created for rendering. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void SwapBuffersHAL( PMESAD3DSHARED pShared )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
-
-#ifdef D3D_DEBUG
- HRESULT rc;
-
- DPF(( DBG_FUNC, "SwapBuffersHAL();" ));
- DPF(( DBG_ALL_PROFILE, "=================SWAP===================" ));
-
- /* Make sure we have enough info. */
- if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) )
- return;
-
- /* Make sure we have enough info. */
- if ( pHAL->lpDDSPrimary != NULL )
- {
- rc = pHAL->lpD3DDevice->EndScene();
- if ( FAILED(rc) )
- {
- RIP( pHAL, "EndScene ->", ErrorStringD3D(rc) );
- }
-
- if ( pShared->bFlipable )
- {
- DPF(( DBG_CNTX_PROFILE, "Swap->FLIP" ));
- rc = pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT );
- }
- else
- {
- DPF(( DBG_CNTX_PROFILE, "Swap->Blt" ));
- rc = pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL );
- }
- if ( FAILED(rc) )
- {
- RIP( pHAL, "Blt (RENDER/PRIMARY) ->", ErrorStringD3D(rc) );
- }
-
- rc = pHAL->lpD3DDevice->BeginScene();
- if ( FAILED(rc) )
- {
- RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) );
- }
- }
-#else
- pHAL->lpD3DDevice->EndScene();
-
- if ( pShared->bFlipable )
- pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT );
- else
- pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL );
-
- pHAL->lpD3DDevice->BeginScene();
-
-#endif
-}
-/*===========================================================================*/
-/* This function is a very thin wrapper for the D3D call 'SetRenderState'. */
-/* Using this function requires all the types to be defined by including the */
-/* D3D header file. */
-/* */
-/* TODO: would be much better to get ride of all these calls per VBRender. */
-/* I feel I should get this call into SetRenderStates() the RenderVB. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
-
-#ifdef D3D_DEBUG
- HRESULT rc;
-
- DPF(( DBG_FUNC, "SetStateHAL();" ));
-
- /* Make sure we have enough info. */
- if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) )
- return;
-
- rc = pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "SetRenderState ->", ErrorStringD3D(rc) );
- }
-
-#else
- pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState );
-#endif
-}
-
-
-
-
-
-
-
-
diff --git a/src/mesa/drivers/d3d/D3DShared.h b/src/mesa/drivers/d3d/D3DShared.h
deleted file mode 100644
index cc629e21111..00000000000
--- a/src/mesa/drivers/d3d/D3DShared.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#ifndef D3D_MESA_ALL_H
-#define D3D_MESA_ALL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include <stdio.h>
-#include <string.h>
-/*===========================================================================*/
-/* Magic numbers. */
-/*===========================================================================*/
-#define TM_ACTION_LOAD 0x01
-#define TM_ACTION_BIND 0x02
-#define TM_ACTION_UPDATE 0x04
-
-#define UM_FATALSHUTDOWN (WM_USER+42)
-/*===========================================================================*/
-/* Macros defines. */
-/*===========================================================================*/
-#define ALLOC(cb) malloc( (cb) )
-#define FREE(p) { free( (p) ); (p) = NULL; }
-/*===========================================================================*/
-/* Type defines. */
-/*===========================================================================*/
-typedef struct _pixel_convert
-{
- int cb, /* Count in bytes of one pixel. */
- rShift, /* Shift count that postions each componet. */
- gShift,
- bShift,
- aShift;
- float rScale, /* Value that scales a color that ranges 0.0 -> 1.0 */
- gScale, /* to this pixel format. */
- bScale,
- aScale;
- DWORD dwRMask, /* Color mask per component. */
- dwGMask,
- dwBMask,
- dwAMask;
-
-} PIXELINFO, *PPIXELINFO;
-
-
-typedef struct _d3d_shared_info
-{
- HWND hwnd;
- BOOL bWindow,
- bFlipable,
- bForceSW,
- bHardware;
- RECT rectW, /* Window size and postion in screen space. */
- rectV; /* Viewport size and postion. */
- DWORD dwWidth, /* Current render size for quick checks. */
- dwHeight;
-
- PIXELINFO pixel;
- DWORD dwSrcBlendCaps[14], /* See D3DCAPS.CPP */
- dwDestBlendCaps[14],
- dwTexFunc[4];
-
-} MESAD3DSHARED, *PMESAD3DSHARED;
-
-typedef struct _render_options
-{
- BOOL bForceSoftware, /* TODO: Add user switches. */
- bStretchtoPrimary;
-
-} USER_CTRL, *PUSER_CRTL;
-
-enum { s_zero = 0,
- s_one,
- s_dst_color,
- s_one_minus_dst_color,
- s_src_alpha,
- s_one_minus_src_alpha,
- s_dst_alpha,
- s_one_minus_dst_alpha,
- s_src_alpha_saturate,
- s_constant_color,
- s_one_minus_constant_color,
- s_constant_alpha,
- s_one_minus_constant_alpha };
-
-enum { d_zero = 0,
- d_one,
- d_src_color,
- d_one_minus_src_color,
- d_src_alpha,
- d_one_minus_src_alpha,
- d_dst_alpha,
- d_one_minus_dst_alpha,
- d_constant_color,
- d_one_minus_constant_color,
- d_constant_alpha,
- d_one_minus_constant_alpha };
-
-enum { d3dtblend_decal = 0,
- d3dtblend_decalalpha,
- d3dtblend_modulate,
- d3dtblend_modulatealpha };
-
-/*===========================================================================*/
-/* Function prototypes. */
-/*===========================================================================*/
-PMESAD3DSHARED InitHAL( HWND hwnd );
-void TermHAL( PMESAD3DSHARED pShared );
-BOOL CreateHAL( PMESAD3DSHARED pShared );
-BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ );
-
-void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil );
-void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState );
-void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount );
-
-void SwapBuffersHAL( PMESAD3DSHARED pShared );
-DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack );
-void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack );
-void UpdateScreenPosHAL( PMESAD3DSHARED pShared );
-void GetPixelInfoHAL( PMESAD3DSHARED pShared, PPIXELINFO pPixel );
-BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags, RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels );
-void DisableTMgrHAL( PMESAD3DSHARED pShared );
-
-
-int SaveDIBitmap( char *filename, BITMAPINFO *info, void *bits );
-int ARGB_SaveBitmap( char *filename, int width, int height, unsigned char *pARGB );
-int BGRA_SaveBitmap( char *filename, int width, int height, unsigned char *pBGRA );
-int BGR_SaveBitmap( char *filename, int width, int height, unsigned char *pBGR );
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-extern float g_DepthScale, /* Mesa needs to scale Z in SW. The HAL */
- g_MaxDepth; /* doesn't but I wanted SW still to work.*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
-
diff --git a/src/mesa/drivers/d3d/D3DTEXT.CPP b/src/mesa/drivers/d3d/D3DTEXT.CPP
deleted file mode 100644
index e6ff8645611..00000000000
--- a/src/mesa/drivers/d3d/D3DTEXT.CPP
+++ /dev/null
@@ -1,576 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "d3dText.h"
-
-/*=============================================================================
-
- 1
- ------
- | |
- 6 | | 2
- | 7 |
- ------
- | |
- 5 | | 3
- | |
- ------
- 4
-
- TL_0 TR_0
-TLL TL_1 TR_1 TRR
-
-MLL_0 ML_0 MR_0 MRR_0
-MLL_1 ML_1 MR_1 MRR_1
-
-BLL BL_0 BR_0 BRR
- BL_1 BR_1
-
-=============================================================================*/
-
-#define TLL 0
-#define TRR 1
-#define TL_0 2
-#define TL_1 3
-#define TR_0 4
-#define TR_1 5
-
-#define MLL_0 6
-#define MLL_1 7
-#define MRR_0 8
-#define MRR_1 9
-
-#define ML_0 10
-#define ML_1 11
-#define MR_0 12
-#define MR_1 13
-
-#define BL_0 14
-#define BL_1 15
-#define BR_0 16
-#define BR_1 17
-#define BLL 18
-#define BRR 19
-
-#define BIT1 0x00000001
-#define BIT2 0x00000002
-#define BIT3 0x00000004
-#define BIT4 0x00000008
-#define BIT5 0x00000010
-#define BIT6 0x00000020
-#define BIT7 0x00000040
-
-#define TOP BIT4
-#define MIDDLE BIT7
-#define BOTTOM BIT1
-#define TLEFT BIT5
-#define BLEFT BIT6
-#define LEFT (TLEFT|BLEFT)
-#define TRIGHT BIT3
-#define BRIGHT BIT2
-#define RIGHT (TRIGHT|BRIGHT)
-#define ALL 0xFFFFFFFF
-
-/*===========================================================================*/
-/* This is the static array that will map the ASCII value of the character */
-/* being draw to the bit mask that will be scan converted to the LED display.*/
-/*===========================================================================*/
-DWORD textBitMasks[] =
-{
- 0xFFFFFFFF, // 000
- 0xFFFFFFFF, // 001
- 0xFFFFFFFF, // 002
- 0xFFFFFFFF, // 003
- 0xFFFFFFFF, // 004
- 0xFFFFFFFF, // 005
- 0xFFFFFFFF, // 006
- 0xFFFFFFFF, // 007
- 0xFFFFFFFF, // 008
- 0xFFFFFFFF, // 009
- 0xFFFFFFFF, // 010
- 0xFFFFFFFF, // 011
- 0xFFFFFFFF, // 012
- 0xFFFFFFFF, // 013
- 0xFFFFFFFF, // 014
- 0xFFFFFFFF, // 015
- 0xFFFFFFFF, // 016
- 0xFFFFFFFF, // 017
- 0xFFFFFFFF, // 018
- 0xFFFFFFFF, // 019
- 0xFFFFFFFF, // 020
- 0xFFFFFFFF, // 021
- 0xFFFFFFFF, // 022
- 0xFFFFFFFF, // 023
- 0xFFFFFFFF, // 024
- 0xFFFFFFFF, // 025
- 0xFFFFFFFF, // 026
- 0xFFFFFFFF, // 027
- 0xFFFFFFFF, // 028
- 0xFFFFFFFF, // 029
- 0xFFFFFFFF, // 030
- 0XFFFFFFFF, // 031
- 0x00000000, // 032 'SPC'
- 0xFFFFFFFF, // 033
- 0xFFFFFFFF, // 034
- 0xFFFFFFFF, // 035
- 0xFFFFFFFF, // 036
- 0xFFFFFFFF, // 037
- 0xFFFFFFFF, // 038
- 0xFFFFFFFF, // 039
- 0xFFFFFFFF, // 040
- 0xFFFFFFFF, // 041
- 0xFFFFFFFF, // 042
- 0xFFFFFFFF, // 043
- 0xFFFFFFFF, // 044
- 0xFFFFFFFF, // 045
- 0xFFFFFFFF, // 046
- 0xFFFFFFFF, // 047
- (ALL &~ MIDDLE), // 048 '0'
- (RIGHT), // 049 '1'
- (ALL &~ TLEFT &~ BRIGHT), // 050 '2'
- (ALL &~ LEFT), // 051 '3'
- (TLEFT | MIDDLE | RIGHT), // 052 '4'
- (ALL &~ TRIGHT &~ BLEFT), // 053 '5'
- (ALL &~ TRIGHT), // 054 '6'
- (TOP | RIGHT), // 055 '7'
- (ALL), // 056 '8'
- (ALL &~ BOTTOM &~ BLEFT), // 057 '9'
- 0xFFFFFFFF, // 058
- 0xFFFFFFFF, // 059
- 0xFFFFFFFF, // 060
- 0XFFFFFFFF, // 061
- 0xFFFFFFFF, // 062
- 0xFFFFFFFF, // 063
- 0xFFFFFFFF, // 064
- (ALL &~ BOTTOM), // 065 'A'
- (ALL), // 066 'B'
- (TOP | LEFT | BOTTOM), // 067 'C'
- (ALL &~ MIDDLE), // 068 'D'
- (ALL &~ RIGHT), // 069 'E'
- (LEFT | TOP | MIDDLE), // 070 'F'
- 0x00000000, // 071 'G'
- (ALL &~ TOP &~ BOTTOM), // 072 'H'
- (RIGHT), // 073 'I'
- (RIGHT | BOTTOM), // 074 'J'
- 0x00000000, // 075 'K'
- (LEFT | BOTTOM), // 076 'L'
- 0x00000000, // 088 'M'
- 0x00000000, // 089 'N'
- (ALL &~ MIDDLE), // 090 'O'
- (ALL &~ BRIGHT &~ BOTTOM),// 091 'P'
- 0x00000000, // 092 'Q'
- 0x00000000, // 093 'R'
- (ALL &~ TRIGHT &~ BLEFT), // 094 'S'
- 0X00000000, // 095 'T'
- (LEFT | RIGHT | BOTTOM), // 096 'U'
- 0x00000000, // 097 'V'
- 0x00000000, // 098 'W'
- 0x00000000, // 099 'X'
- 0x00000000, // 1000 'Z'
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 100
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 104
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 108
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 112
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 116
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 120
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF // 124
-};
-
-#define CT 1.0f
-#define CX 7.0f
-#define CY 13.0f
-#define CM ((CY-(CT*3.0f))/2.0f)
-
-float lCoords[][2] =
-{
- /* Top outsides. */
- { 0, (CY-CT) },
- { CX, (CY-CT) },
-
- /* Top Line. */
- { CT, CY },
- { CT, (CY-CT) },
- { (CX-CT), CY },
- { (CX-CT), (CY-CT) },
-
- /* Middle outsides. */
- { 0.0f, (CT+CM+CT) },
- { 0.0f, (CT+CM) },
- { CX, (CT+CM+CT) },
- { CX, (CT+CM) },
-
- /* Middle Line. */
- { CT, (CT+CM+CT) },
- { CT, (CT+CM) },
- { (CX-CT), (CT+CM+CT) },
- { (CX-CT), (CT+CM) },
-
- /* Bottom line. */
- { CT, CT },
- { CT, 0.0f },
- { (CX-CT), CT },
- { (CX-CT), 0.0f },
-
- /* Bottom outsides. */
- { 0.0f, CT},
- { CX, CT }
-};
-
-static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics );
-
-D3DTLVERTEX TextVertices[MAX_VERTICES];
-/*===========================================================================*/
-/* When we attach I will zero out the whole D3D vertex buffer I'm using for */
-/* the text. This way I don't need to set all the redundant values. I also */
-/* set all the oow values to 1 as I will be doing direct rendering. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-extern "C" BOOL InitD3DText( void )
-{
- int index;
-
- /* Set the D3D Vertex Buffer up once so we don't do redundant changes. */
- memset( &TextVertices[0], 0, sizeof(TextVertices) );
- for( index = 0; index < MAX_VERTICES; index++ )
- TextVertices[index].rhw = D3DVAL( 1.0 );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function takes a single character and draw it using the supplied */
-/* fontmetrics structure. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics )
-{
- int cIndex,
- nIndex,
- index;
- float cWidth = CX,
- cHeight = CY;
-
- /* Find the max width/height of a character and add the spacing so */
- /* that we can use this value to calculate the x,y of the character.*/
- cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing;
- cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing;
-
- /* Walk the string. This must be NULL terminated. */
- for( cIndex = 0, nIndex = 0; *pszString; pszString++, cIndex = nIndex, x++ )
- {
- /* Convert the character and get the index into the text vertex buffer. */
- nIndex = ConvertCharacter( &pszString[0], cIndex, pfntMetrics );
- if ( (nIndex - cIndex) > 2 )
- {
- /* Modify the text vertex buffer based on the fntMetrics structure. */
- for( index = cIndex; index < nIndex; index++ )
- {
- /* Scale the character. */
- TextVertices[index].sx *= pfntMetrics->fntXScale;
- TextVertices[index].sy *= pfntMetrics->fntYScale;
-
- /* Move the character. */
- TextVertices[index].sx += (cWidth*x);
- TextVertices[index].sy += (cHeight*y);
-
- /* Set the color. */
- TextVertices[index].color = pfntMetrics->dwColor;
- }
- }
- }
-
- if ( nIndex < 3 )
- return;
-
- /* Set the states that slim things down. */
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE );
-
- /* Blast them baby... */
- pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST,
- D3DFVF_TLVERTEX,
- (LPVOID)&TextVertices[0],
- nIndex,
- (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
-}
-/*===========================================================================*/
-/* This function takes a single character and draw it directly to the screen*/
-/* unsing the supplied fntMetrics structure. The character will be drawn at */
-/* the supplied x,y. The x,y position is relative to the top left and uses */
-/* the spacing in the fntMetrics structure. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics )
-{
- int cIndex = 0,
- index;
- float cWidth = CX,
- cHeight = CY;
-
- /* Convert the character and get the index into the text vertex buffer. */
- cIndex = ConvertCharacter( c, 0, pfntMetrics );
- if ( cIndex < 3 )
- return;
-
- /* Find the max width/height of a character and add the spacing so */
- /* that we can use this value to calculate the x,y of the character.*/
- cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing;
- cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing;
-
- /* Modify the text vertex buffer based on the fntMetrics structure. */
- for( index = 0; index < cIndex; index++ )
- {
- /* Scale the character. */
- TextVertices[index].sx *= pfntMetrics->fntXScale;
- TextVertices[index].sy *= pfntMetrics->fntYScale;
-
- /* Move the character. */
- TextVertices[index].sx += (cWidth*x);
- TextVertices[index].sy += (cHeight*y);
-
- /* Set the color. */
- TextVertices[index].color = pfntMetrics->dwColor;
- }
-
-
- /* Set the states that slim things down. */
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE );
- pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE );
-
- /* Blast them baby... */
- pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST,
- D3DFVF_TLVERTEX,
- (LPVOID)&TextVertices[0],
- cIndex,
- (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
-}
-/*===========================================================================*/
-/* This function takes a single character and draw it using the supplied */
-/* fontmetrics structure. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics )
-{
- DWORD asciiChar = (int)(*c);
-
- /* Handle the TOP line. */
- if ( textBitMasks[asciiChar] & BIT1 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TR_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] );
- }
-
- /* Handle the TOP/BOTTOM RIGHT lines. */
- // if ( textBitMasks[index] & (BIT2|BIT3) )
- if ( 1 == 0 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TRR][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
- }
- else
- {
- if ( textBitMasks[asciiChar] & BIT2 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[TRR][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] );
- }
- if ( textBitMasks[asciiChar] & BIT3 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[BR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] );
- }
- }
-
- /* Handle the TOP/BOTTOM LEFT lines. */
- // if ( textBitMasks[asciiChar] & (BIT5|BIT6) )
- if ( 1 == 0 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BLL][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] );
- }
- else
- {
- if ( textBitMasks[asciiChar] & BIT5 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[BLL][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] );
- }
- if ( textBitMasks[asciiChar] & BIT6 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[TL_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_0][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
- TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] );
- }
- }
-
- /* Handle the MIDDLE line. */
- if ( textBitMasks[asciiChar] & BIT7 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] );
- }
-
- /* Handle the BOTTOM line. */
- if ( textBitMasks[asciiChar] & BIT4 )
- {
- TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BL_1][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_1][1] );
- TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
- TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
- }
-
- return cIndex;
-}
-
-#undef CM
-#undef CY
-#undef CX
-#undef CT
-
-#undef TLL
-#undef TRR
-#undef TL_0
-#undef TL_1
-#undef TR_0
-#undef TR_1
-
-#undef MLL_0
-#undef MLL_1
-#undef MRR_0
-#undef MRR_1
-
-#undef ML_0
-#undef ML_1
-#undef MR_0
-#undef MR_1
-
-#undef BL_0
-#undef BL_1
-#undef BR_0
-#undef BR_1
-#undef BLL
-#undef BRR
-
-#undef BIT1
-#undef BIT2
-#undef BIT3
-#undef BIT4
-#undef BIT5
-#undef BIT6
-#undef BIT7
-
-#undef TOP
-#undef MIDDLE
-#undef BOTTOM
-#undef TLEFT
-#undef BLEFT
-#undef LEFT
-#undef TRIGHT
-#undef BRIGHT
-#undef RIGHT
-#undef ALL
diff --git a/src/mesa/drivers/d3d/D3DTextureMgr.cpp b/src/mesa/drivers/d3d/D3DTextureMgr.cpp
deleted file mode 100644
index ac9d2621fcc..00000000000
--- a/src/mesa/drivers/d3d/D3DTextureMgr.cpp
+++ /dev/null
@@ -1,947 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "D3DHAL.h"
-/*===========================================================================*/
-/* Local function prototypes. */
-/*===========================================================================*/
-static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels );
-static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj );
-static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject );
-static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject );
-HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext );
-/*===========================================================================*/
-/* This function will simply set the top of stack to NULL. I only used it */
-/* just incase I want to add something later. */
-/*===========================================================================*/
-/* RETURN: TRUE. */
-/*===========================================================================*/
-BOOL InitTMgrHAL( PMESAD3DHAL pHAL )
-{
- DPF(( DBG_FUNC, "InitTMgrHAL();" ));
-
- /* Be clean my friend. */
- pHAL->pTMList = NULL;
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function will walk the Texture Managers linked list and destroy all */
-/* surfaces (SYSTEM/VIDEO). The texture objects themselves also will be */
-/* freed. */
-/* NOTE: this is per/context. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void TermTMgrHAL( PMESAD3DHAL pHAL )
-{
- DPF(( DBG_FUNC, "TermTMgrHAL();" ));
-
- if ( pHAL && pHAL->pTMList )
- {
- /* Destroy the surface and remove the TMO from the stack. */
- while( DestroyTextureObject(pHAL,NULL) );
-
- /* Be clean my friend. */
- pHAL->pTMList = NULL;
- }
-}
-/*===========================================================================*/
-/* This function is a HACK as I don't know how I can disable a texture with-*/
-/* out booting it out. Is there know state change? */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void DisableTMgrHAL( PMESAD3DSHARED pShared )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
-
- DPF(( DBG_FUNC, "DisableTMgrHAL();" ));
-
- /* Check too see that we have a valid context. */
- if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) )
- {
- DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" ));
- return;
- }
-
- // TODO: This is a hack to shut off textures.
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
-}
-/*===========================================================================*/
-/* This function is the only entry into the TextureManager that Mesa/wgl */
-/* will see. It uses a dwAction to specify what we are doing. I did this as*/
-/* depending on the cards resources the action taken can change. */
-/* When this function is called we will always search the Texture Managers */
-/* linked list (per context remember) and try and find a structure that has */
-/* the same dwName. If we have a match we pull it out of the list and put it*/
-/* at the top of the list (TOL). If we don't find one then we create a struc*/
-/* and put it a TOL. This TOL idea makes for some caching as we will always */
-/* destroy Texture Surfaces from the bottom up... */
-/* All texture objects at this point will create a texture surface in System*/
-/* memory (SMEM). Then we will copy the Mesa texture into the surface using */
-/* the 'pixel' struc to get the translation info. So now this means that all*/
-/* textures that Mesa gives me I will have a Surface with a copy. If Mesa */
-/* changes the texture the I update the surface in (SMEM). */
-/* Now we have a texture struc and a Texture Surface in SMEM. At this point*/
-/* we create another surface on the card (VMEM). Finally we blt from the */
-/* SMEM to the VMEM and set the texture as current. Why do I need two? First*/
-/* this solves square textures. If the cards CAPS is square textures only */
-/* then I change the dimensions of the VMEM surface and the blt solves it for*/
-/* me. Second it saves me from filling D3D textures over and over if the */
-/* card needs to be creating and destroying surfaces because of low memory. */
-/* The surface in SMEM is expected to work always. When a surface has to be*/
-/* created in VMEM then we put it in a loop that tries to create the surface.*/
-/* If we create the surface ok then we brake from the loop. If we fail then */
-/* we will call 'FreeTextureMemory' that will return TRUE/FALSE as to whether*/
-/* memory was freed. If memory was freed then we can try again. If no memory*/
-/* was freed then it just can't fit. */
-/* 'FreeTextureMemory' will find the end of the list and start freeing VMEM */
-/* (never SMEM) surfaces that are not locked. */
-/* BIND - when we bind and there is a texture struct with a texture surface */
-/* in VMEM then we just make it current. If we have a struct and a surface */
-/* in SMEM but no VMEM surface then we create the surface in VMEM and blt */
-/* from the SMEM surface. If we have nothing its just like a creation... */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-extern "C" BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags,
- RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
- PTM_OBJECT pTMObj,
- pTemp;
- DDSURFACEDESC2 ddsd2;
- HRESULT rc;
-
-
- DPF(( DBG_FUNC, "CreateTMgrHAL();" ));
-
- DPF(( DBG_TXT_INFO, "Texture:" ));
- DPF(( DBG_TXT_INFO, "cx: %d cy: %d", dwWidth, dwHeight ));
- DPF(( DBG_TXT_INFO, "Rect:" ));
- if ( rectDirty )
- {
- DPF(( DBG_TXT_INFO, "x0: %d y0: %d", rectDirty->left, rectDirty->top ));
- DPF(( DBG_TXT_INFO, "x1: %d y1: %d", rectDirty->right, rectDirty->bottom ));
- }
-
- /* Check too see that we have a valid context. */
- if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) )
- {
- DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" ));
- return FALSE;
- }
-
- /*=================================================*/
- /* See if we can find this texture object by name. */
- /*=================================================*/
- for( pTMObj = pHAL->pTMList; pTMObj && (pTMObj->dwName != dwName); pTMObj = pTMObj->next );
-
- /*=========================================================*/
- /* Allocate a new object if we didn't get a matching name. */
- /*=========================================================*/
- if ( pTMObj == NULL )
- {
- pTMObj = (PTM_OBJECT)ALLOC( sizeof(TM_OBJECT) );
- if ( pTMObj == NULL )
- return FALSE;
- memset( pTMObj, 0, sizeof(TM_OBJECT) );
-
- /* Put the object at the beginning of the list. */
- pTMObj->next = pHAL->pTMList;
- if ( pTMObj->next )
- {
- pTemp = pTMObj->next;
- pTemp->prev = pTMObj;
- }
- pHAL->pTMList = pTMObj;
- }
- else
- {
- /*===============================================================*/
- /* Make some caching happen by pulling this object to the front. */
- /*===============================================================*/
- if ( pHAL->pTMList != pTMObj )
- {
- /* Pull the object out of the list. */
- if ( pTMObj->prev )
- {
- pTemp = pTMObj->prev;
- pTemp->next = pTMObj->next;
- }
- if ( pTMObj->next )
- {
- pTemp = pTMObj->next;
- pTemp->prev = pTMObj->prev;
- }
-
- pTMObj->prev = NULL;
- pTMObj->next = NULL;
-
- /* Put the object at the front of the list. */
- pTMObj->next = pHAL->pTMList;
- if ( pTMObj->next )
- {
- pTemp = pTMObj->next;
- pTemp->prev = pTMObj;
- }
- pHAL->pTMList = pTMObj;
- }
- }
-
- /*========================================================*/
- /* If we are doing BIND and the texture is in VID memory. */
- /*========================================================*/
- if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_Video )
- {
- DPF(( DBG_TXT_PROFILE, "Cache HIT (%d)", dwName ));
-
- /* Make this the current texture. */
- rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
- if ( FAILED(rc) )
- {
- DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
- return FALSE;
- }
-
- return TRUE;
- }
-
- /*=================================================================*/
- /* If we are doing BIND and the texture is at least in SYS memory. */
- /*=================================================================*/
- if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_System )
- {
- DPF(( DBG_TXT_PROFILE, "Cache MISS (%d)", dwName ));
-
- /* Create the texture on the card. */
- rc = LoadTextureInVideo( pHAL, pTMObj );
- if ( rc == FALSE )
- return FALSE;
-
- /* Make this the current texture. */
- rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
- if ( FAILED(rc) )
- {
- DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
- return FALSE;
- }
-
- return TRUE;
- }
-
- /*=========================================================*/
- /* If we are doing UPDATE then try in VID first for speed. */
- /*=========================================================*/
- if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_Video &&
- !(pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) )
- {
- DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" ));
-
- /* Update the texture on the card. */
- UpdateTexture( pTMObj, TRUE, rectDirty, (UCHAR *)pPixels );
-
- /* We updated the texture in VID so kill the SYS so we know its dirty. */
- if ( pTMObj->lpDDS_System )
- {
- DPF(( DBG_TXT_INFO, "Release texture (SYS)" ));
- DX_RESTORE( pTMObj->lpDDS_System );
- pTMObj->lpDDS_System->Release();
- pTMObj->lpDDS_System = NULL;
- }
-
- /* Make this the current texture. */
- rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
- if ( FAILED(rc) )
- {
- DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
- return FALSE;
- }
-
- return TRUE;
- }
-
- /*===========================================================*/
- /* If we are doing UPDATE then try in SYS still gives speed. */
- /*===========================================================*/
- if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_System )
- {
- DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" ));
-
- /* Update the texture in SYS. */
- UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels );
-
- /* We updated the SYS texture only so now blt to the VID. */
- rc = LoadTextureInVideo( pHAL, pTMObj );
- if ( rc == FALSE )
- return FALSE;
-
- /* Make this the current texture. */
- rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
- if ( FAILED(rc) )
- {
- DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
- return FALSE;
- }
-
- return TRUE;
- }
-
- /* At this point we have a valid Texture Manager Object with updated */
- /* links. We now need to create or update a texture surface that is */
- /* in system memory. Every texture has a copy in system so we can use*/
- /* blt to solve problems with textures allocated on the card (square */
- /* only textures, pixelformats...). */
-
- // TODO: make support for update also. Dirty rectangle basicly...
-
- /* Kill the interface if we have one no matter what. */
- if ( pTMObj->lpD3DTexture2 )
- {
- DPF(( DBG_TXT_INFO, "Release Texture2" ));
- pTMObj->lpD3DTexture2->Release();
- pTMObj->lpD3DTexture2 = NULL;
- }
-
- /* Kill the system surface. TODO: should try to get the SubIMage going again */
- if ( pTMObj->lpDDS_System )
- {
- DPF(( DBG_TXT_INFO, "Release texture (SYS)" ));
- DX_RESTORE( pTMObj->lpDDS_System );
- pTMObj->lpDDS_System->Release();
- pTMObj->lpDDS_System = NULL;
- }
-
- /* Kill the Video surface. TODO: need some reuse system... */
- if ( pTMObj->lpDDS_Video )
- {
- DPF(( DBG_TXT_INFO, "Release texture (VID)" ));
- DX_RESTORE( pTMObj->lpDDS_Video );
- pTMObj->lpDDS_Video->Release();
- pTMObj->lpDDS_Video = NULL;
- }
-
- /*================================================================*/
- /* Translate the the Mesa/OpenGL pixel channels to the D3D flags. */
- /*================================================================*/
- switch( dwRequestFlags )
- {
- case GL_ALPHA:
- dwRequestFlags = DDPF_ALPHA;
- DPF(( DBG_TXT_WARN, "GL_ALPHA not supported!)" ));
- return FALSE;
-
- case GL_INTENSITY:
- case GL_LUMINANCE:
- DPF(( DBG_TXT_WARN, "GL_INTENSITY/GL_LUMINANCE not supported!)" ));
- dwRequestFlags = DDPF_LUMINANCE;
- return FALSE;
-
- case GL_LUMINANCE_ALPHA:
- DPF(( DBG_TXT_WARN, "GL_LUMINANCE_ALPHA not supported!)" ));
- dwRequestFlags = DDPF_LUMINANCE | DDPF_ALPHAPIXELS;
- return FALSE;
-
- case GL_RGB:
- DPF(( DBG_TXT_INFO, "Texture -> GL_RGB" ));
- dwRequestFlags = DDPF_RGB;
- break;
-
- case GL_RGBA:
- DPF(( DBG_TXT_INFO, "Texture -> GL_RGBA" ));
- dwRequestFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
- break;
- }
-
- /*==============================*/
- /* Populate the texture object. */
- /*==============================*/
- pTMObj->dwName = dwName;
- pTMObj->lpD3DDevice = pHAL->lpD3DDevice;
- pTMObj->dwFlags = dwRequestFlags;
- if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY )
- {
- DPF(( DBG_TXT_INFO, "Convert to Square..." ));
- pTMObj->dwSHeight = dwHeight;
- pTMObj->dwSWidth = dwWidth;
-
- /* Shrink non-square textures. */
- pTMObj->dwVHeight = (dwHeight > dwWidth) ? dwWidth : dwHeight;
- pTMObj->dwVWidth = (dwHeight > dwWidth) ? dwWidth : dwHeight;
- }
- else
- {
- pTMObj->dwSHeight = dwHeight;
- pTMObj->dwSWidth = dwWidth;
- pTMObj->dwVHeight = dwHeight;
- pTMObj->dwVWidth = dwWidth;
- }
-
- /*========================*/
- /* Create SYSTEM surface. */
- /*========================*/
-
- /* Request a surface in system memory. */
- memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
- ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
- ddsd2.dwWidth = pTMObj->dwSWidth;
- ddsd2.dwHeight = pTMObj->dwSHeight;
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY;
- ddsd2.ddsCaps.dwCaps2 = 0L;
- memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) );
- ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
- ddsd2.ddpfPixelFormat.dwFlags = dwRequestFlags;
- rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "EnumerTextureFormats (SYSTEM)->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Create the surface using the enumerated pixelformat. */
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_System, NULL );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "CreateSurface (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Solve the pixel mapping info using the surface pixelformat. */
- Solve8BitChannelPixelFormat( &ddsd2.ddpfPixelFormat, &pTMObj->pixel );
-
- /*===================================================================*/
- /* Fill the texture using the PixelInfo structure to do the mapping. */
- /*===================================================================*/
- UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels );
-
- /*=======================*/
- /* Create VIDEO surface. */
- /*=======================*/
- rc = LoadTextureInVideo( pHAL, pTMObj );
- if ( rc == FALSE )
- return FALSE;
-
- /* Make this the current texture. */
- rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
- if ( FAILED(rc) )
- {
- DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
- return FALSE;
- }
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function will handle the creation and destruction of the texture */
-/* surfaces on the card. Using the dw'V'Width/Height dimensions the call */
-/* try and create the texture on the card and keep using FreeTextureMemory */
-/* until the surace can be created. Once the surface is created we get the */
-/* interface that we will use to make it the current texture. I didn't put */
-/* the code to make the texture current in this function as BIND needs to */
-/* use the same code and this function doesn't always get called when we do a*/
-/* bind. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj )
-{
- DDSURFACEDESC2 ddsd2;
- HRESULT rc;
-
- DPF(( DBG_FUNC, "LoadTextureInVideo();" ));
-
- /* Kill the interface if we have one no matter what. */
- if ( pTMObj->lpD3DTexture2 )
- {
- DPF(( DBG_TXT_INFO, "Release Texture2" ));
- pTMObj->lpD3DTexture2->Release();
- pTMObj->lpD3DTexture2 = NULL;
- }
-
- /* Kill the Video surface. TODO: need some reuse system... */
- if ( pTMObj->lpDDS_Video )
- {
- DPF(( DBG_TXT_INFO, "Release texture (VID)" ));
- DX_RESTORE( pTMObj->lpDDS_Video );
- pTMObj->lpDDS_Video->Release();
- pTMObj->lpDDS_Video = NULL;
- }
-
- /* Request a surface in Video memory. */
- memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
- ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
- ddsd2.dwWidth = pTMObj->dwVWidth;
- ddsd2.dwHeight = pTMObj->dwVHeight;
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY;
- ddsd2.ddsCaps.dwCaps2 = 0L;
- memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) );
- ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
- ddsd2.ddpfPixelFormat.dwFlags = pTMObj->dwFlags;
- rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "EnumerTextureFormats ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Make sure we lock so we don't nuke this texture trying to free memory for it. */
- pTMObj->bLock = TRUE;
-
- /* Start a loop that will free all textures until we have created the texture */
- /* surface or we can't free up more memory. */
- do
- {
- /* Try to create the texture surface. */
- rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_Video, NULL );
- if ( !FAILED(rc) )
- break;
-
- DPF(( DBG_TXT_INFO, "Free Texture Memory" ));
-
- /* DestroyTexture will return TRUE if a surface was freed. */
- } while( FreeTextureMemory(pHAL,NULL) );
-
- /* Make sure we unlock or we won't be able to nuke the TMO later. */
- pTMObj->bLock = FALSE;
-
- /* Did we create a valid texture surface? */
- if ( FAILED(rc) )
- {
- DPF(( DBG_TXT_WARN, "Failed to load texture" ));
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
- return FALSE;
- }
-
- DX_RESTORE( pTMObj->lpDDS_System );
- DX_RESTORE( pTMObj->lpDDS_Video );
-
- DPF(( DBG_TXT_INFO, "Texture Blt SYSTEM -> VID" ));
-
- /* Now blt the texture in system memory to the card. */
- rc = pTMObj->lpDDS_Video->Blt( NULL, pTMObj->lpDDS_System, NULL, DDBLT_WAIT, NULL );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "Blt (TEXTURE) ->", ErrorStringD3D(rc) );
- return FALSE;
- }
-
- /* Get the Texture interface that is used to render with. */
- pTMObj->lpDDS_Video->QueryInterface( IID_IDirect3DTexture2, (void **)&pTMObj->lpD3DTexture2 );
- if ( pTMObj->lpD3DTexture2 == NULL )
- {
- DPF(( DBG_TXT_WARN, "Failed QueryTextureInterface" ));
- pHAL->lpD3DDevice->SetTexture( 0, NULL );
- return FALSE;
- }
-
- return TRUE;
-}
-/*===========================================================================*/
-/* If this function gets a texture object struc then we will try and free */
-/* it. If we get a NULL then we will search from the bottom up and free one */
-/* VMEM surface. I can only free when the surface isn't locked and of course*/
-/* there must be a VMEM surface. We never free SMEM surfaces as that isn't */
-/* the point. */
-/* TODO: should have a pointer to the bottom of the stack really. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject )
-{
- PTM_OBJECT pCurrent;
- BOOL bFreed = FALSE;
-
- DPF(( DBG_FUNC, "FreeTextureMemory();" ));
- DPF(( DBG_TXT_WARN, "FREE TEXTURE!" ));
-
- /* Just to be safe. */
- if ( !pHAL || !pHAL->pTMList )
- {
- DPF(( DBG_TXT_WARN, "FreeTextureMemory() -> NULL pHAL/pHAL->pTMList" ));
- return FALSE;
- }
-
- /* Free the last texture in the list. */
- if ( pTMObject == NULL )
- {
- DPF(( DBG_TXT_INFO, "Free Last texture in cache" ));
-
- /* Find the last texture object. */
- for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next );
-
- /* Now backup until we find a texture on the card. */
- while( pCurrent && (pCurrent->lpDDS_Video == NULL) && (pCurrent->bLock == FALSE) )
- pCurrent = pCurrent->prev;
-
- /* Didn't find anything. */
- if ( pCurrent == NULL )
- {
- DPF(( DBG_TXT_INFO, "No texture memory freed" ));
- return FALSE;
- }
- }
- else
- {
- /* See if we can find this texture object. */
- for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next );
-
- /* Didn't find anything. */
- if ( pCurrent == NULL )
- {
- DPF(( DBG_TXT_INFO, "Requested texture to be freed NOT FOUND" ));
- return FALSE;
- }
- }
-
- /* Can't free this baby. */
- if ( pCurrent->bLock == TRUE )
- {
- DPF(( DBG_TXT_WARN, "Requested texture LOCKED" ));
- return FALSE;
- }
-
- /* Free the texture memory. */
- if ( pCurrent->lpD3DTexture2 )
- {
- DPF(( DBG_TXT_INFO, "Release Texture2" ));
- pCurrent->lpD3DTexture2->Release();
- pCurrent->lpD3DTexture2 = NULL;
- bFreed = TRUE;
- }
- if ( pCurrent->lpDDS_Video )
- {
- DPF(( DBG_TXT_INFO, "Release texture (VID):" ));
- DPF(( DBG_TXT_INFO, "dwName: %d", pCurrent->dwName ));
- DPF(( DBG_TXT_INFO, "cx: %d, cy: %d", pCurrent->dwVWidth, pCurrent->dwVHeight ));
- pCurrent->lpDDS_Video->Release();
- pCurrent->lpDDS_Video = NULL;
- bFreed = TRUE;
- }
-
- return bFreed;
-}
-/*===========================================================================*/
-/* This function searches the linked list of texture objects in the supplied*/
-/* D3Dwrapper structure. If it finds a match it will free it and pull it out*/
-/* of the linked list. The function works on the bases of a matching pointer*/
-/* to the object (not matching content). */
-/* If the function gets passed a NULL then we want to free the last texture */
-/* object in the list. Used in a loop to destory all. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject )
-{
- PTM_OBJECT pCurrent;
-
- DPF(( DBG_FUNC, "DestoryTextureObject();" ));
-
- /* Just to be safe. */
- if ( !pHAL || !pHAL->pTMList )
- {
- DPF(( DBG_TXT_WARN, "DestroyTextureObject() -> NULL pHAL/pHAL->pTMList" ));
- return FALSE;
- }
-
- /* Free the last texture in the list. */
- if ( pTMObject == NULL )
- {
- /* Find the last texture object. */
- for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next );
- }
- else
- {
- /* See if we can find this texture object. */
- for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next );
-
- /* Didn't find anything. */
- if ( pCurrent == NULL )
- {
- DPF(( DBG_TXT_WARN, "No textures to be freed" ));
- return FALSE;
- }
- }
-
- /* Can't free this baby. */
- if ( pCurrent->bLock == TRUE )
- {
- DPF(( DBG_TXT_WARN, "Requested texture to be freed LOCKED" ));
- return FALSE;
- }
-
- /* Free the texture memory. */
- if ( pCurrent->lpD3DTexture2 )
- {
- DPF(( DBG_TXT_INFO, "Release Texture2" ));
- pCurrent->lpD3DTexture2->Release();
- pCurrent->lpD3DTexture2 = NULL;
- }
- if ( pCurrent->lpDDS_Video )
- {
- DPF(( DBG_TXT_INFO, "Release texture (VID):" ));
- pCurrent->lpDDS_Video->Release();
- pCurrent->lpDDS_Video = NULL;
- }
- if ( pCurrent->lpDDS_System )
- {
- DPF(( DBG_TXT_INFO, "Release texture (SYS):" ));
- pCurrent->lpDDS_System->Release();
- pCurrent->lpDDS_System = NULL;
- }
-
- /* Pull this texture out of the list. */
- if ( pCurrent == pHAL->pTMList )
- pHAL->pTMList = NULL;
- if ( pCurrent->prev )
- (pCurrent->prev)->next = pCurrent->next;
- if ( pCurrent->next )
- (pCurrent->next)->prev = pCurrent->prev;
- FREE( pCurrent );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function is the callback function that gets called when we are doing*/
-/* an enumeration of the texture formats supported by this device. The choice*/
-/* is made by checking to see if we have a match with the supplied D3D pixel-*/
-/* format. So the enumeration has to pass a desired D3D PF as the user var. */
-/*===========================================================================*/
-/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */
-/*===========================================================================*/
-static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels )
-{
- LPDIRECTDRAWSURFACE4 lpDDS;
- DDSURFACEDESC2 ddsd2;
- DWORD srcPitch,
- dwHeight,
- dwWidth,
- dwCol,
- dwColor;
- UCHAR *pSrc,
- *pSrcRow,
- *pDest,
- *pDestRow;
- int rc;
-
- // TODO: Do I need to pass the h/w when its in the object!
- DPF(( DBG_FUNC, "UpdateTexture();" ));
-
- /* Get the surface pointer we are looking for. */
- lpDDS = (bVideo) ? pTMObj->lpDDS_Video : pTMObj->lpDDS_System;
-
- /*===================================================================*/
- /* Fill the texture using the PixelInfo structure to do the mapping. */
- /*===================================================================*/
-
- /* Get the surface pointer. */
- memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
- ddsd2.dwSize = sizeof(DDSURFACEDESC2);
- rc = lpDDS->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL );
- if ( FAILED(rc) )
- {
- RIP( NULL, "Lock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) );
- return;
- }
-
- /* For now we are only updating the system surface so use its dimensions. */
- dwWidth = (bVideo) ? pTMObj->dwVWidth : pTMObj->dwSWidth;
- dwHeight = (bVideo) ? pTMObj->dwVHeight : pTMObj->dwSHeight;
-
- /* If we are updating the whole surface then the pDest/pSrc will */
- /* always be the same. */
- if ( pRect == NULL )
- {
- pDest = (UCHAR *)ddsd2.lpSurface;
- pSrc = pixels;
- }
-
- /* Fill the texture surface based on the pixelformat flags. */
- if ( pTMObj->dwFlags == (DDPF_RGB | DDPF_ALPHAPIXELS) )
- {
- srcPitch = dwWidth * 4;
- if ( pRect )
- {
- pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
- pSrc = pixels + (pRect->top * dwWidth * 4) + (pRect->left * 4);
- dwHeight = (pRect->bottom - pRect->top);
- dwWidth = (pRect->right - pRect->left);
- }
-
- for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
- {
- for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
- {
- dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
- dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift );
- dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift );
- if ( pTMObj->pixel.aScale == -1.0 )
- dwColor |= ( (*(pSrc+3) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 );
- else
- dwColor |= ( ((DWORD)(*(pSrc+3) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift );
- memcpy( pDest, &dwColor, pTMObj->pixel.cb );
- pDest += pTMObj->pixel.cb;
- pSrc += 4;
- }
- }
- }
- else if ( pTMObj->dwFlags == DDPF_RGB )
- {
- srcPitch = dwWidth * 3;
- if ( pRect )
- {
- pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
- pSrc = pixels + (pRect->top * dwWidth * 3) + (pRect->left * 3);
- dwHeight = (pRect->bottom - pRect->top);
- dwWidth = (pRect->right - pRect->left);
- }
-
- for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
- {
- for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
- {
- dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
- dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift );
- dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift );
- memcpy( pDest, &dwColor, pTMObj->pixel.cb );
- pDest += pTMObj->pixel.cb;
- pSrc += 3;
- }
- }
- }
- else if ( pTMObj->dwFlags == (DDPF_LUMINANCE | DDPF_ALPHAPIXELS) )
- {
- srcPitch = dwWidth * 2;
- if ( pRect )
- {
- pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
- pSrc = pixels + (pRect->top * dwWidth * 2) + (pRect->left * 2);
- dwHeight = (pRect->bottom - pRect->top);
- dwWidth = (pRect->right - pRect->left);
- }
-
- for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
- {
- for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
- {
- dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
- if ( pTMObj->pixel.aScale == -1.0 )
- dwColor |= ( (*(pSrc+1) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 );
- else
- dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift );
- memcpy( pDest, &dwColor, pTMObj->pixel.cb );
- pDest += pTMObj->pixel.cb;
- pSrc += 2;
- }
- }
- }
- else if ( pTMObj->dwFlags == DDPF_LUMINANCE )
- {
- srcPitch = dwWidth;
- if ( pRect )
- {
- pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
- pSrc = pixels + (pRect->top * dwWidth) + (pRect->left);
- dwHeight = (pRect->bottom - pRect->top);
- dwWidth = (pRect->right - pRect->left);
- }
-
- for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
- {
- for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
- {
- dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
- memcpy( pDest, &dwColor, pTMObj->pixel.cb );
- pDest += pTMObj->pixel.cb;
- pSrc++;
- }
- }
- }
- else if ( pTMObj->dwFlags == DDPF_ALPHAPIXELS )
- {
- srcPitch = dwWidth;
- if ( pRect )
- {
- pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
- pSrc = pixels + (pRect->top * dwWidth) + (pRect->left);
- dwHeight = (pRect->bottom - pRect->top);
- dwWidth = (pRect->right - pRect->left);
- }
-
- for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
- {
- for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
- {
- if ( pTMObj->pixel.aScale == -1.0 )
- dwColor = ( (*pSrc & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 );
- else
- dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift );
- memcpy( pDest, &dwColor, pTMObj->pixel.cb );
- pDest += pTMObj->pixel.cb;
- pSrc++;
- }
- }
- }
-
- /* Unlock the surface. */
- rc = lpDDS->Unlock( NULL );
- if ( FAILED(rc) )
- {
- RIP( NULL, "Unlock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) );
- }
-}
-/*===========================================================================*/
-/* This function is the callback function that gets called when we are doing*/
-/* an enumeration of the texture formats supported by this device. The choice*/
-/* is made by checking to see if we have a match with the supplied D3D pixel-*/
-/* format. So the enumeration has to pass a desired D3D PF as the user var. */
-/*===========================================================================*/
-/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */
-/*===========================================================================*/
-HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext )
-{
- LPDDPIXELFORMAT lpDDPixFmtRequest = (LPDDPIXELFORMAT)lpContext;
- PIXELINFO pixel;
-
- DPF(( DBG_FUNC, "EnumPFHook();" ));
-
- if ( lpDDPixFmt->dwFlags == lpDDPixFmtRequest->dwFlags )
- {
- /* Are we looking for an alpha channel? */
- if ( lpDDPixFmtRequest->dwFlags & DDPF_ALPHAPIXELS )
- {
- /* Try for something that has more then 1bits of Alpha. */
- Solve8BitChannelPixelFormat( lpDDPixFmt, &pixel );
- if ( pixel.aScale == -1.0 )
- {
- /* Save this format no matter what as its a match of sorts. */
- memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) );
- return D3DENUMRET_OK;
- }
- }
-
- /* Save this format as its a good match. */
- memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) );
-
- /* We are happy at this point so lets leave. */
- return D3DENUMRET_CANCEL;
- }
-
- return D3DENUMRET_OK;
-}
-
-
diff --git a/src/mesa/drivers/d3d/D3DTextureMgr.h b/src/mesa/drivers/d3d/D3DTextureMgr.h
deleted file mode 100644
index f4a4154917a..00000000000
--- a/src/mesa/drivers/d3d/D3DTextureMgr.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#ifndef _TEXTURE_MGR_INC
-#define _TEXTURE_MGR_INC
-
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include <windows.h>
-#include <ddraw.h>
-#include <d3d.h>
-#include <stdlib.h>
-#include <stdlib.h>
-#include "GL/gl.h"
-/*========================================================================*/
-/* Defines. */
-/*========================================================================*/
-/*========================================================================*/
-/* Type defines. */
-/*========================================================================*/
-typedef struct _local_texture_object
-{
- DWORD dwName,
- dwPriority,
- dwFlags,
- dwSWidth,
- dwSHeight,
- dwVWidth,
- dwVHeight;
- BOOL bLock,
- bDirty; /* I only update VID on SubImage calls so the system */
- /* texture can get invalid. */
-
- LPDIRECT3DDEVICE3 lpD3DDevice; /* If the device changes we must get new handles... */
- LPDIRECTDRAWSURFACE4 lpDDS_System,
- lpDDS_Video;
- LPDIRECT3DTEXTURE2 lpD3DTexture2;
-
- PIXELINFO pixel;
-
- struct _local_texture_object *next;
- struct _local_texture_object *prev;
-
-} TM_OBJECT, *PTM_OBJECT;
-/*========================================================================*/
-/* Function prototypes. */
-/*========================================================================*/
-void APIENTRY InitTMD3D( void *pVoid );
-void APIENTRY TermTMD3D( void *pVoid );
-/*========================================================================*/
-/* Global variables declaration. */
-/*========================================================================*/
-
-#endif
diff --git a/src/mesa/drivers/d3d/D3DUTILS.CPP b/src/mesa/drivers/d3d/D3DUTILS.CPP
deleted file mode 100644
index c13d89cd711..00000000000
--- a/src/mesa/drivers/d3d/D3DUTILS.CPP
+++ /dev/null
@@ -1,638 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "D3DHAL.h"
-/*===========================================================================*/
-/* Local only functions. */
-/*===========================================================================*/
-static int CountTrailingZeros( DWORD dwMask );
-/*===========================================================================*/
-/* This function is used to get the pointer to the surface and the pitch for*/
-/* the scanline rendering functions. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
- static DDSURFACEDESC2 ddsd2;
- HRESULT rc;
-
- DPF(( DBG_FUNC, "LockHAL();" ));
-
- /* Set the request structure up first. */
- memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
- ddsd2.dwSize = sizeof(DDSURFACEDESC2);
-
- /* Make sure we have enough info. */
- if ( pHAL )
- {
- rc = pHAL->lpDDSRender->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "Lock (RENDER) ->", ErrorStringD3D(rc) );
- }
- }
-
- return &ddsd2;
-}
-/*===========================================================================*/
-/* This is just a simple wrapper. I probably don't need to do any error */
-/* checking as the Lock must have worked inorder to get here... */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
- HRESULT rc;
-
- DPF(( DBG_FUNC, "UnlockHAL();" ));
-
- /* Make sure we have enough info. */
- if ( pHAL )
- {
- rc = pHAL->lpDDSRender->Unlock( NULL );
- if ( FAILED(rc) )
- {
- RIP( pHAL, "Unlock (RENDER) ->", ErrorStringD3D(rc) );
- }
- }
-}
-/*===========================================================================*/
-/* This function will track the main/Primary window that will be used as the*/
-/* target for the Blt in SwapBuffers. As a side effect the call will check */
-/* to see if the primary surface is the same size and position as the screen.*/
-/* If they are the same size we will call it fullscreen... */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-extern "C" void UpdateScreenPosHAL( PMESAD3DSHARED pShared )
-{
- PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
- POINT pt;
- DWORD dwWidth, dwHeight;
-
- DPF(( DBG_FUNC, "UpdateScreenPosHAL();" ));
-
- /* Make sure we have enough info. */
- if ( pHAL != NULL )
- {
- /* Update the windows screen position. */
- GetClientRect( pShared->hwnd, &pShared->rectW );
- pt.x = pt.y = 0;
- ClientToScreen( pShared->hwnd, &pt );
- OffsetRect( &pShared->rectW, pt.x, pt.y);
-
- /* Compare the primary to the screen. */
- dwWidth = GetSystemMetrics( SM_CXSCREEN );
- dwHeight = GetSystemMetrics( SM_CYSCREEN );
- if ( (pShared->rectW.left > 0) || (pShared->rectW.top > 0) ||
- (pShared->rectW.right > dwWidth) || (pShared->rectW.bottom > dwHeight) )
- pShared->bWindow = TRUE;
- else
- pShared->bWindow = FALSE;
- }
-}
-/*===========================================================================*/
-/* This function will fill in the pixel info structure defined in D3Dshared.*/
-/* Basicly it will take a DirectDraw pixelformat structure and make scaling */
-/* values that will convert from 8bit channels to whatever the supplied ddpf */
-/* uses. Also we will generate shift values that will be used to get move */
-/* each component of the pixel into place. */
-/* I have now added a special case for a 1bit alpha channel. If I find a 1b*/
-/* alpha then I will set the scale to -1.0 which should be unique. Later I */
-/* can check the alpha scale value too see if its -1.0 and thus handle it. I*/
-/* was finding that the case was not working tom my advantage so this is my */
-/* HACK for the day. As a TODO I should work on this... */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel )
-{
- DPF(( DBG_FUNC, "Solve8BitChannelPixelFromat();" ));
-
- memset( pPixel, 0, sizeof(PPIXELINFO) );
-
- /* Check too see if the color space is valid in the PF. */
- if ( pddpf->dwFlags & DDPF_RGB )
- {
- /* Solve the red stuff. */
- pPixel->dwRMask = pddpf->dwRBitMask;
- pPixel->rShift = CountTrailingZeros( pPixel->dwRMask );
- pPixel->rScale = (float)0.00392156 * (float)(pPixel->dwRMask >> pPixel->rShift);
-
- /* Solve the green thingy's. */
- pPixel->dwGMask = pddpf->dwGBitMask;
- pPixel->gShift = CountTrailingZeros( pPixel->dwGMask );
- pPixel->gScale = (float)0.00392156 * (float)(pPixel->dwGMask >> pPixel->gShift);
-
- /* Solve the blues. */
- pPixel->dwBMask = pddpf->dwBBitMask;
- pPixel->bShift = CountTrailingZeros( pddpf->dwBBitMask );
- pPixel->bScale = (float)0.00392156 * (float)(pddpf->dwBBitMask >> pPixel->bShift);
- }
-
- /* Do the alpha channel if there is one. */
- if ( pddpf->dwFlags & DDPF_ALPHAPIXELS )
- {
- pPixel->dwAMask = pddpf->dwRGBAlphaBitMask;
- pPixel->aShift = CountTrailingZeros( pPixel->dwAMask );
-
- /* Special case a 1bit alpha. */
- if ( (pPixel->dwAMask >> pPixel->aShift) == 1 )
- pPixel->aScale = -1.0;
- else
- pPixel->aScale = (float)0.00392156 * (float)(pPixel->dwAMask >> pPixel->aShift);
- }
-
- /* Get the size of the pixel in bytes. Should work as dwRGBBitCount is in a union. */
- pPixel->cb = pddpf->dwRGBBitCount / 8;
-}
-/*===========================================================================*/
-/* See RETURN :) */
-/*===========================================================================*/
-/* RETURN: number of contiguous zeros starting from the right. */
-/*===========================================================================*/
-static int CountTrailingZeros( DWORD dwMask )
-{
- DWORD Mask;
-
- if ( dwMask == 0 )
- return 32;
-
- /* Can't take credit for this one! */
- Mask = dwMask & -(int)dwMask;
- return ((Mask & 0xFFFF0000)!=0) << 4
- | ((Mask & 0xFF00FF00)!=0) << 3
- | ((Mask & 0xF0F0F0F0)!=0) << 2
- | ((Mask & 0xCCCCCCCC)!=0) << 1
- | ((Mask & 0xAAAAAAAA)!=0);
-}
-/*===========================================================================*/
-/* This function will convert the DDraw error code to its macro string. The*/
-/* returned pointer is static so you need not worry about memory managemnet */
-/* but the error message gets written over from call to call... */
-/*===========================================================================*/
-/* RETURN: pointer to the single static buffer that hold the error message. */
-/*===========================================================================*/
-char *ErrorStringD3D( HRESULT hr )
-{
- static char errorString[128];
-
- switch( hr )
- {
- case DDERR_ALREADYINITIALIZED:
- strcpy( errorString, "DDERR_ALREADYINITIALIZED" );
- break;
-
- case DDERR_CANNOTATTACHSURFACE:
- strcpy( errorString, "DDERR_CANNOTATTACHSURFACE" );
- break;
-
- case DDERR_CANNOTDETACHSURFACE:
- strcpy( errorString, "DDERR_CANNOTDETACHSURFACE" );
- break;
-
- case DDERR_CURRENTLYNOTAVAIL:
- strcpy( errorString, "DDERR_CURRENTLYNOTAVAIL" );
- break;
-
- case DDERR_EXCEPTION:
- strcpy( errorString, "DDERR_EXCEPTION" );
- break;
-
- case DDERR_GENERIC:
- strcpy( errorString, "DDERR_GENERIC" );
- break;
-
- case DDERR_HEIGHTALIGN:
- strcpy( errorString, "DDERR_HEIGHTALIGN" );
- break;
-
- case DDERR_INCOMPATIBLEPRIMARY:
- strcpy( errorString, "DDERR_INCOMPATIBLEPRIMARY" );
- break;
-
- case DDERR_INVALIDCAPS:
- strcpy( errorString, "DDERR_INVALIDCAPS" );
- break;
-
- case DDERR_INVALIDCLIPLIST:
- strcpy( errorString, "DDERR_INVALIDCLIPLIST" );
- break;
-
- case DDERR_INVALIDMODE:
- strcpy( errorString, "DDERR_INVALIDMODE" );
- break;
-
- case DDERR_INVALIDOBJECT:
- strcpy( errorString, "DDERR_INVALIDOBJECT" );
- break;
-
- case DDERR_INVALIDPARAMS:
- strcpy( errorString, "DDERR_INVALIDPARAMS" );
- break;
-
- case DDERR_INVALIDPIXELFORMAT:
- strcpy( errorString, "DDERR_INVALIDPIXELFORMAT" );
- break;
-
- case DDERR_INVALIDRECT:
- strcpy( errorString, "DDERR_INVALIDRECT" );
- break;
-
- case DDERR_LOCKEDSURFACES:
- strcpy( errorString, "DDERR_LOCKEDSURFACES" );
- break;
-
- case DDERR_NO3D:
- strcpy( errorString, "DDERR_NO3D" );
- break;
-
- case DDERR_NOALPHAHW:
- strcpy( errorString, "DDERR_NOALPHAHW" );
- break;
-
- case DDERR_NOCLIPLIST:
- strcpy( errorString, "DDERR_NOCLIPLIST" );
- break;
-
- case DDERR_NOCOLORCONVHW:
- strcpy( errorString, "DDERR_NOCOLORCONVHW" );
- break;
-
- case DDERR_NOCOOPERATIVELEVELSET:
- strcpy( errorString, "DDERR_NOCOOPERATIVELEVELSET" );
- break;
-
- case DDERR_NOCOLORKEY:
- strcpy( errorString, "DDERR_NOCOLORKEY" );
- break;
-
- case DDERR_NOCOLORKEYHW:
- strcpy( errorString, "DDERR_NOCOLORKEYHW" );
- break;
-
- case DDERR_NODIRECTDRAWSUPPORT:
- strcpy( errorString, "DDERR_NODIRECTDRAWSUPPORT" );
- break;
-
- case DDERR_NOEXCLUSIVEMODE:
- strcpy( errorString, "DDERR_NOEXCLUSIVEMODE" );
- break;
-
- case DDERR_NOFLIPHW:
- strcpy( errorString, "DDERR_NOFLIPHW" );
- break;
-
- case DDERR_NOGDI:
- strcpy( errorString, "DDERR_NOGDI" );
- break;
-
- case DDERR_NOMIRRORHW:
- strcpy( errorString, "DDERR_NOMIRRORHW" );
- break;
-
- case DDERR_NOTFOUND:
- strcpy( errorString, "DDERR_NOTFOUND" );
- break;
-
- case DDERR_NOOVERLAYHW:
- strcpy( errorString, "DDERR_NOOVERLAYHW" );
- break;
-
- case DDERR_OVERLAPPINGRECTS:
- strcpy( errorString, "DDERR_OVERLAPPINGRECTS" );
- break;
-
- case DDERR_NORASTEROPHW:
- strcpy( errorString, "DDERR_NORASTEROPHW" );
- break;
-
- case DDERR_NOROTATIONHW:
- strcpy( errorString, "DDERR_NOROTATIONHW" );
- break;
-
- case DDERR_NOSTRETCHHW:
- strcpy( errorString, "DDERR_NOSTRETCHHW" );
- break;
-
- case DDERR_NOT4BITCOLOR:
- strcpy( errorString, "DDERR_NOT4BITCOLOR" );
- break;
-
- case DDERR_NOT4BITCOLORINDEX:
- strcpy( errorString, "DDERR_NOT4BITCOLORINDEX" );
- break;
-
- case DDERR_NOT8BITCOLOR:
- strcpy( errorString, "DDERR_NOT8BITCOLOR" );
- break;
-
- case DDERR_NOTEXTUREHW:
- strcpy( errorString, "DDERR_NOTEXTUREHW" );
- break;
-
- case DDERR_NOVSYNCHW:
- strcpy( errorString, "DDERR_NOVSYNCHW" );
- break;
-
- case DDERR_NOZBUFFERHW:
- strcpy( errorString, "DDERR_NOZBUFFERHW" );
- break;
-
- case DDERR_NOZOVERLAYHW:
- strcpy( errorString, "DDERR_NOZOVERLAYHW" );
- break;
-
- case DDERR_OUTOFCAPS:
- strcpy( errorString, "DDERR_OUTOFCAPS" );
- break;
-
- case DDERR_OUTOFMEMORY:
- strcpy( errorString, "DDERR_OUTOFMEMORY" );
- break;
-
- case DDERR_OUTOFVIDEOMEMORY:
- strcpy( errorString, "DDERR_OUTOFVIDEOMEMORY" );
- break;
-
- case DDERR_OVERLAYCANTCLIP:
- strcpy( errorString, "DDERR_OVERLAYCANTCLIP" );
- break;
-
- case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
- strcpy( errorString, "DDERR_OVERLAYCOLORKEYONLYONEACTIVE" );
- break;
-
- case DDERR_PALETTEBUSY:
- strcpy( errorString, "DDERR_PALETTEBUSY" );
- break;
-
- case DDERR_COLORKEYNOTSET:
- strcpy( errorString, "DDERR_COLORKEYNOTSET" );
- break;
-
- case DDERR_SURFACEALREADYATTACHED:
- strcpy( errorString, "DDERR_SURFACEALREADYATTACHED" );
- break;
-
- case DDERR_SURFACEALREADYDEPENDENT:
- strcpy( errorString, "DDERR_SURFACEALREADYDEPENDENT" );
- break;
-
- case DDERR_SURFACEBUSY:
- strcpy( errorString, "DDERR_SURFACEBUSY" );
- break;
-
- case DDERR_CANTLOCKSURFACE:
- strcpy( errorString, "DDERR_CANTLOCKSURFACE" );
- break;
-
- case DDERR_SURFACEISOBSCURED:
- strcpy( errorString, "DDERR_SURFACEISOBSCURED" );
- break;
-
- case DDERR_SURFACELOST:
- strcpy( errorString, "DDERR_SURFACELOST" );
- break;
-
- case DDERR_SURFACENOTATTACHED:
- strcpy( errorString, "DDERR_SURFACENOTATTACHED" );
- break;
-
- case DDERR_TOOBIGHEIGHT:
- strcpy( errorString, "DDERR_TOOBIGHEIGHT" );
- break;
-
- case DDERR_TOOBIGSIZE:
- strcpy( errorString, "DDERR_TOOBIGSIZE" );
- break;
-
- case DDERR_TOOBIGWIDTH:
- strcpy( errorString, "DDERR_TOOBIGWIDTH" );
- break;
-
- case DDERR_UNSUPPORTED:
- strcpy( errorString, "DDERR_UNSUPPORTED" );
- break;
-
- case DDERR_UNSUPPORTEDFORMAT:
- strcpy( errorString, "DDERR_UNSUPPORTEDFORMAT" );
- break;
-
- case DDERR_UNSUPPORTEDMASK:
- strcpy( errorString, "DDERR_UNSUPPORTEDMASK" );
- break;
-
- case DDERR_INVALIDSTREAM:
- strcpy( errorString, "DDERR_INVALIDSTREAM" );
- break;
-
- case DDERR_VERTICALBLANKINPROGRESS:
- strcpy( errorString, "DDERR_VERTICALBLANKINPROGRESS" );
- break;
-
- case DDERR_WASSTILLDRAWING:
- strcpy( errorString, "DDERR_WASSTILLDRAWING" );
- break;
-
- case DDERR_XALIGN:
- strcpy( errorString, "DDERR_XALIGN" );
- break;
-
- case DDERR_INVALIDDIRECTDRAWGUID:
- strcpy( errorString, "DDERR_INVALIDDIRECTDRAWGUID" );
- break;
-
- case DDERR_DIRECTDRAWALREADYCREATED:
- strcpy( errorString, "DDERR_DIRECTDRAWALREADYCREATED" );
- break;
-
- case DDERR_NODIRECTDRAWHW:
- strcpy( errorString, "DDERR_NODIRECTDRAWHW" );
- break;
-
- case DDERR_PRIMARYSURFACEALREADYEXISTS:
- strcpy( errorString, "DDERR_PRIMARYSURFACEALREADYEXISTS" );
- break;
-
- case DDERR_NOEMULATION:
- strcpy( errorString, "DDERR_NOEMULATION" );
- break;
-
- case DDERR_REGIONTOOSMALL:
- strcpy( errorString, "DDERR_REGIONTOOSMALL" );
- break;
-
- case DDERR_CLIPPERISUSINGHWND:
- strcpy( errorString, "DDERR_CLIPPERISUSINGHWND" );
- break;
-
- case DDERR_NOCLIPPERATTACHED:
- strcpy( errorString, "DDERR_NOCLIPPERATTACHED" );
- break;
-
- case DDERR_NOHWND:
- strcpy( errorString, "DDERR_NOHWND" );
- break;
-
- case DDERR_HWNDSUBCLASSED:
- strcpy( errorString, "DDERR_HWNDSUBCLASSED" );
- break;
-
- case DDERR_HWNDALREADYSET:
- strcpy( errorString, "DDERR_HWNDALREADYSET" );
- break;
-
- case DDERR_NOPALETTEATTACHED:
- strcpy( errorString, "DDERR_NOPALETTEATTACHED" );
- break;
-
- case DDERR_NOPALETTEHW:
- strcpy( errorString, "DDERR_NOPALETTEHW" );
- break;
-
- case DDERR_BLTFASTCANTCLIP:
- strcpy( errorString, "DDERR_BLTFASTCANTCLIP" );
- break;
-
- case DDERR_NOBLTHW:
- strcpy( errorString, "DDERR_NOBLTHW" );
- break;
-
- case DDERR_NODDROPSHW:
- strcpy( errorString, "DDERR_NODDROPSHW" );
- break;
-
- case DDERR_OVERLAYNOTVISIBLE:
- strcpy( errorString, "DDERR_OVERLAYNOTVISIBLE" );
- break;
-
- case DDERR_NOOVERLAYDEST:
- strcpy( errorString, "DDERR_NOOVERLAYDEST" );
- break;
-
- case DDERR_INVALIDPOSITION:
- strcpy( errorString, "DDERR_INVALIDPOSITION" );
- break;
-
- case DDERR_NOTAOVERLAYSURFACE:
- strcpy( errorString, "DDERR_NOTAOVERLAYSURFACE" );
- break;
-
- case DDERR_EXCLUSIVEMODEALREADYSET:
- strcpy( errorString, "DDERR_EXCLUSIVEMODEALREADYSET" );
- break;
-
- case DDERR_NOTFLIPPABLE:
- strcpy( errorString, "DDERR_NOTFLIPPABLE" );
- break;
-
- case DDERR_CANTDUPLICATE:
- strcpy( errorString, "DDERR_CANTDUPLICATE" );
- break;
-
- case DDERR_NOTLOCKED:
- strcpy( errorString, "DDERR_NOTLOCKED" );
- break;
-
- case DDERR_CANTCREATEDC:
- strcpy( errorString, "DDERR_CANTCREATEDC" );
- break;
-
- case DDERR_NODC:
- strcpy( errorString, "DDERR_NODC" );
- break;
-
- case DDERR_WRONGMODE:
- strcpy( errorString, "DDERR_WRONGMODE" );
- break;
-
- case DDERR_IMPLICITLYCREATED:
- strcpy( errorString, "DDERR_IMPLICITLYCREATED" );
- break;
-
- case DDERR_NOTPALETTIZED:
- strcpy( errorString, "DDERR_NOTPALETTIZED" );
- break;
-
- case DDERR_UNSUPPORTEDMODE:
- strcpy( errorString, "DDERR_UNSUPPORTEDMODE" );
- break;
-
- case DDERR_NOMIPMAPHW:
- strcpy( errorString, "DDERR_NOMIPMAPHW" );
- break;
-
- case DDERR_INVALIDSURFACETYPE:
- strcpy( errorString, "DDERR_INVALIDSURFACETYPE" );
- break;
-
- case DDERR_NOOPTIMIZEHW:
- strcpy( errorString, "DDERR_NOOPTIMIZEHW" );
- break;
-
- case DDERR_NOTLOADED:
- strcpy( errorString, "DDERR_NOTLOADED" );
- break;
-
- case DDERR_NOFOCUSWINDOW:
- strcpy( errorString, "DDERR_NOFOCUSWINDOW" );
- break;
-
- case DDERR_DCALREADYCREATED:
- strcpy( errorString, "DDERR_DCALREADYCREATED" );
- break;
-
- case DDERR_NONONLOCALVIDMEM:
- strcpy( errorString, "DDERR_NONONLOCALVIDMEM" );
- break;
-
- case DDERR_CANTPAGELOCK:
- strcpy( errorString, "DDERR_CANTPAGELOCK" );
- break;
-
- case DDERR_CANTPAGEUNLOCK:
- strcpy( errorString, "DDERR_CANTPAGEUNLOCK" );
- break;
-
- case DDERR_NOTPAGELOCKED:
- strcpy( errorString, "DDERR_NOTPAGELOCKED" );
- break;
-
- case DDERR_MOREDATA:
- strcpy( errorString, "DDERR_MOREDATA" );
- break;
-
- case DDERR_EXPIRED:
- strcpy( errorString, "DDERR_EXPIRED" );
- break;
-
- case DDERR_VIDEONOTACTIVE:
- strcpy( errorString, "DDERR_VIDEONOTACTIVE" );
- break;
-
- case DDERR_DEVICEDOESNTOWNSURFACE:
- strcpy( errorString, "DDERR_DEVICEDOESNTOWNSURFACE" );
- break;
-
- case DDERR_NOTINITIALIZED:
- strcpy( errorString, "DDERR_NOTINITIALIZED" );
- break;
-
- default:
- strcpy( errorString, "<unknown error code>" );
- break;
- }
-
- return &errorString[0];
-}
diff --git a/src/mesa/drivers/d3d/D3Dvbrender.c b/src/mesa/drivers/d3d/D3Dvbrender.c
deleted file mode 100644
index 09857f1dc8d..00000000000
--- a/src/mesa/drivers/d3d/D3Dvbrender.c
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include <stdio.h>
-#include "clip.h"
-#include "context.h"
-#include "light.h"
-#include "lines.h"
-#include "macros.h"
-#include "matrix.h"
-#include "pb.h"
-#include "points.h"
-#include "mtypes.h"
-#include "vb.h"
-#include "vbrender.h"
-#include "xform.h"
-#include "D3DMesa.h"
-
-static void SetRenderStates( GLcontext *ctx );
-static void DebugRenderStates( GLcontext *ctx, BOOL bForce );
-
-static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end );
-static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end );
-static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end );
-static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end );
-static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end );
-static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv );
-void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv );
-void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv );
-
-/* I went with a D3D vertex buffer that is 6 times that of the Mesa one */
-/* instead of having the D3D one flush when its full. This way Mesa will*/
-/* handle all the flushing. I need x6 as points can use 4 vertex each. */
-D3DTLVERTEX D3DTLVertices[ (VB_MAX*6) ];
-GLuint VList[VB_SIZE];
-/*===========================================================================*/
-/* Compute Z offsets for a polygon with plane defined by (A,B,C,D) */
-/* D is not needed. TODO: Currently we are calculating this but not using it.*/
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void OffsetPolygon( GLcontext *ctx, GLfloat a, GLfloat b, GLfloat c )
-{
- GLfloat ac,
- bc,
- m,
- offset;
-
- DPF(( DBG_FUNC, "OffsetPolygon();" ));
-
- if ( (c < 0.001F) && (c > - 0.001F) )
- {
- /* Prevents underflow problems. */
- ctx->PointZoffset = 0.0F;
- ctx->LineZoffset = 0.0F;
- ctx->PolygonZoffset = 0.0F;
- }
- else
- {
- ac = a / c;
- bc = b / c;
- if ( ac < 0.0F )
- ac = -ac;
- if ( bc<0.0F )
- bc = -bc;
- m = MAX2( ac, bc ); /* m = sqrt( ac*ac + bc*bc ); */
-
- offset = (m * ctx->Polygon.OffsetFactor + ctx->Polygon.OffsetUnits);
- ctx->PointZoffset = ctx->Polygon.OffsetPoint ? offset : 0.0F;
- ctx->LineZoffset = ctx->Polygon.OffsetLine ? offset : 0.0F;
- ctx->PolygonZoffset = ctx->Polygon.OffsetFill ? offset : 0.0F;
- }
-
- DPF(( DBG_PRIM_INFO, "OffsetPolygon: %f", offset ));
-}
-/*===========================================================================*/
-/* Compute signed area of the n-sided polgyon specified by vertices */
-/* vb->Win[] and vertex list vlist[]. */
-/* A clockwise polygon will return a negative area. A counter-clockwise */
-/* polygon will return a positive area. I have changed this function to */
-/* actually calculate twice the area as its faster and still gives the sign. */
-/*===========================================================================*/
-/* RETURN: signed area of the polgon. */
-/*===========================================================================*/
-static GLfloat PolygonArea( const struct vertex_buffer *vb, GLuint n, const GLuint vlist[] )
-{
- GLfloat area;
- GLuint i;
-
- DPF(( DBG_FUNC, "PolygonArea();" ));
-
-#define j0 vlist[i]
-#define j1 vlist[(i+1)%n]
-#define x0 vb->Win[j0][0]
-#define y0 vb->Win[j0][1]
-#define x1 vb->Win[j1][0]
-#define y1 vb->Win[j1][1]
-
- /* area = sum of trapezoids */
- for( i = 0, area = 0.0; i < n; i++ )
- area += ((x0 - x1) * (y0 + y1)); /* Note: no divide by two here! */
-
-#undef x0
-#undef y0
-#undef x1
-#undef y1
-#undef j1
-#undef j0
-
- // TODO: I don't see the point or * 0.5 as we just want the sign...
- return area;
-}
-/*===========================================================================*/
-/* Render a polygon that needs clipping on at least one vertex. The function*/
-/* will first clip the polygon to any user clipping planes then clip to the */
-/* viewing volume. The final polygon will be draw as single triangles that */
-/* first need minor proccessing (culling, offset, etc) before we draw the */
-/* polygon as a fan. NOTE: the fan is draw as single triangles as its not */
-/* formed sequentaly in the VB but is in the vlist[]. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void RenderClippedPolygon( GLcontext *ctx, GLuint n, GLuint vlist[] )
-{
- struct vertex_buffer *VB = ctx->VB;
- GLfloat (*win)[3] = VB->Win,
- *proj = ctx->ProjectionMatrix,
- ex, ey,
- fx, fy, c,
- wInv;
- GLuint index,
- pv,
- facing;
-
- DPF(( DBG_FUNC, "RenderClippedPolygon();" ));
-
- DPF(( DBG_PRIM_INFO, "RenderClippedtPolygon( %d )", n ));
-
- /* Which vertex dictates the color when flat shading. */
- pv = (ctx->Primitive==GL_POLYGON) ? vlist[0] : vlist[n-1];
-
- /* Clipping may introduce new vertices. New vertices will be stored in */
- /* the vertex buffer arrays starting with location VB->Free. After we've*/
- /* rendered the polygon, these extra vertices can be overwritten. */
- VB->Free = VB_MAX;
-
- /* Clip against user clipping planes in eye coord space. */
- if ( ctx->Transform.AnyClip )
- {
- n = gl_userclip_polygon( ctx, n, vlist );
- if ( n < 3 )
- return;
-
- /* Transform vertices from eye to clip coordinates: clip = Proj * eye */
- for( index = 0; index < n; index++ )
- {
- TRANSFORM_POINT( VB->Clip[vlist[index]], proj, VB->Eye[vlist[index]] );
- }
- }
-
- /* Clip against view volume in clip coord space */
- n = gl_viewclip_polygon( ctx, n, vlist );
- if ( n < 3 )
- return;
-
- /* Transform new vertices from clip to ndc to window coords. */
- /* ndc = clip / W window = viewport_mapping(ndc) */
- /* Note that window Z values are scaled to the range of integer */
- /* depth buffer values. */
-
- /* Only need to compute window coords for new vertices */
- for( index = VB_MAX; index < VB->Free; index++ )
- {
- if ( VB->Clip[index][3] != 0.0F )
- {
- wInv = 1.0F / VB->Clip[index][3];
-
- win[index][0] = VB->Clip[index][0] * wInv * ctx->Viewport.Sx + ctx->Viewport.Tx;
- win[index][1] = VB->Clip[index][1] * wInv * ctx->Viewport.Sy + ctx->Viewport.Ty;
- win[index][2] = VB->Clip[index][2] * wInv * ctx->Viewport.Sz + ctx->Viewport.Tz;
- }
- else
- {
- /* Can't divide by zero, so... */
- win[index][0] = win[index][1] = win[index][2] = 0.0F;
- }
- }
-
- /* Draw filled polygon as a triangle fan */
- for( index = 2; index < n; index++ )
- {
- /* Compute orientation of triangle */
- ex = win[vlist[index-1]][0] - win[vlist[0]][0];
- ey = win[vlist[index-1]][1] - win[vlist[0]][1];
- fx = win[vlist[index]][0] - win[vlist[0]][0];
- fy = win[vlist[index]][1] - win[vlist[0]][1];
- c = (ex * fy) - (ey * fx);
-
- /* polygon is perpindicular to view plane, don't draw it */
- if ( (c == 0.0F) && !ctx->Polygon.Unfilled )
- continue;
-
- /* Backface culling. */
- facing = (c < 0.0F) ^ ctx->Polygon.FrontBit;
- if ( (facing + 1) & ctx->Polygon.CullBits )
- continue;
-
- if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE )
- {
- if ( facing == 1 )
- {
- /* use back color */
- VB->Color = VB->Bcolor;
- VB->Specular= VB->Bspec;
- }
- else
- {
- /* use front color */
- VB->Color = VB->Fcolor;
- VB->Specular= VB->Fspec;
- }
- }
-
- if ( ctx->IndirectTriangles & DD_TRI_OFFSET )
- {
- /* finish computing plane equation of polygon, compute offset */
- GLfloat fz = win[vlist[index]][2] - win[vlist[0]][2];
- GLfloat ez = win[vlist[index-1]][2] - win[vlist[0]][2];
- GLfloat a = (ey * fz) - (ez * fy);
- GLfloat b = (ez * fx) - (ex * fz);
- OffsetPolygon( ctx, a, b, c );
- }
- RenderOneTriangle( ctx, vlist[0], vlist[index-1], vlist[index], pv );
- }
-}
-/*===========================================================================*/
-/* This function gets called when either the vertex buffer is full or glEnd */
-/* has been called. If the we aren't in rendering mode (FEEDBACK) then I */
-/* pass the vertex buffer back to Mesa to deal with by returning FALSE. */
-/* If I can render the primitive types in the buffer directly then I will */
-/* return TRUE after I render the vertex buffer and reset the vertex buffer. */
-/* */
-/* TODO: I don't handle the special case of when the vertex buffer is full */
-/* and we have a primitive that bounds this buffer and the next one to */
-/* come. I'm not sure right now if Mesa handles this for me... */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone )
-{
- struct vertex_buffer *VB = ctx->VB;
- GLuint index,
- vlist[VB_SIZE];
-
- DPF(( DBG_FUNC, "RenderVertexBuffer();" ));
-
- /* We only need to hook actual tri's that need rendering. */
- if ( ctx->RenderMode != GL_RENDER )
- {
- // (ctx->Visual->AccumBits > 0) )
- // (ctx->Visual->StencilBits > 0) )
- DPF(( DBG_PRIM_INFO, "Passing VB back to Mesa" ));
- return FALSE;
- }
-
- /* I'm going to set the states here so that all functions will */
- /* be assured to have the right states. If Mesa's vertex bufefr */
- /* function calls one of my primitive functions (TRI,POINT,LINE) */
- /* it will need the right states. So instead of doing it in the */
- /* primitive function I will always do it here at risk of some */
- /* slow down to some cases... */
- SetRenderStates( ctx );
-
- switch( ctx->Primitive )
- {
- case GL_POINTS:
- DPF(( DBG_PRIM_INFO, "GL_POINTS( %d )", VB->Count ));
- RenderPointsVB( ctx, 0, VB->Count );
- break;
-
- case GL_LINES:
- case GL_LINE_STRIP:
- case GL_LINE_LOOP:
- /* Not supported functions yet so pass back that we failed to */
- /* render the vertex buffer and Mesa will have to do it. */
- DPF(( DBG_PRIM_INFO, "GL_LINE_?( %d )", VB->Count ));
- return FALSE;
-
- case GL_TRIANGLES:
- if ( VB->Count < 3 )
- {
- DPF(( DBG_PRIM_WARN, "GL_TRIANGLES( %d )", VB->Count ));
- return FALSE;
- }
-
- DPF(( DBG_PRIM_INFO, "GL_TRIANGLES( %d )", VB->Count ));
- RenderTriangleVB( ctx, 0, VB->Count );
- break;
-
- case GL_TRIANGLE_STRIP:
- if ( VB->Count < 3 )
- {
- DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_STRIP( %d )", VB->Count ));
- return FALSE;
- }
-
- DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_STRIP( %d )", VB->Count ));
- RenderTriangleStripVB( ctx, 0, VB->Count );
- break;
-
- case GL_TRIANGLE_FAN:
- if ( VB->Count < 3 )
- {
- DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_FAN( %d )", VB->Count ));
- return FALSE;
- }
-
- DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_FAN( %d )", VB->Count ));
- RenderTriangleFanVB( ctx, 0, VB->Count );
- break;
-
- case GL_QUADS:
- if ( VB->Count < 4 )
- {
- DPF(( DBG_PRIM_WARN, "GL_QUADS( %d )", VB->Count ));
- return FALSE;
- }
-
- DPF(( DBG_PRIM_INFO, "GL_QUADS( %d )", VB->Count ));
- RenderQuadVB( ctx, 0, VB->Count );
- break;
-
- case GL_QUAD_STRIP:
- if ( VB->Count < 4 )
- {
- DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count ));
- return FALSE;
- }
-
- DPF(( DBG_PRIM_INFO, "GL_QUAD_STRIP( %d )", VB->Count ));
-
- if ( VB->ClipOrMask )
- {
- for( index = 3; index < VB->Count; index += 2 )
- {
- if ( VB->ClipMask[index-3] & VB->ClipMask[index-2] & VB->ClipMask[index-1] & VB->ClipMask[index] & CLIP_ALL_BITS )
- {
- /* All points clipped by common plane */
- DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count ));
- continue;
- }
- else if ( VB->ClipMask[index-3] | VB->ClipMask[index-2] | VB->ClipMask[index-1] | VB->ClipMask[index] )
- {
- vlist[0] = index - 3;
- vlist[1] = index - 2;
- vlist[2] = index;
- vlist[3] = index - 1;
- RenderClippedPolygon( ctx, 4, vlist );
- }
- else
- {
- RenderQuad( ctx, (index-3), (index-2), index, (index-1), index );
- }
- }
- }
- else
- {
- /* No clipping needed */
- for( index = 3; index < VB->Count; index += 2 )
- RenderQuad( ctx, (index-3), (index-2), index, (index-1), index );
- }
- break;
-
- case GL_POLYGON:
- if ( VB->Count < 3 )
- {
- DPF(( DBG_PRIM_WARN, "GL_POLYGON( %d )", VB->Count ));
- return FALSE;
- }
-
- DPF(( DBG_PRIM_INFO, "GL_POLYGON( %d )", VB->Count ));
-
- /* All points clipped by common plane, draw nothing */
- if ( !(VB->ClipAndMask & CLIP_ALL_BITS) )
- RenderTriangleFanVB( ctx, 0, VB->Count );
- break;
-
- default:
- /* should never get here */
- _mesa_problem( ctx, "invalid mode in gl_render_vb" );
- }
-
- DPF(( DBG_PRIM_INFO, "ResetVB" ));
-
- /* We return TRUE to indicate we rendered the VB. */
- gl_reset_vb( ctx, allDone );
- return TRUE;
-}
-/*===========================================================================*/
-/* This function will render the current vertex buffer as triangles. The */
-/* buffer has to be able to be rendered directly. This means that we are */
-/* filled, no offsets, no culling and one sided rendering. Also we must be */
-/* in render mode of course. */
-/* First I will fill the global D3D vertice buffer. Next I will set all the*/
-/* states for D3D based on the current OGL state. Finally I pass the D3D VB */
-/* to the wrapper that call DrawPrimitives. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- int index,
- cVertex,
- height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- DWORD dwPVColor;
- GLfloat ex, ey,
- fx, fy, c;
- GLuint facing;
-
- DPF(( DBG_FUNC, "RenderTriangleVB" ));
-
- if ( !VB->ClipOrMask )
- {
- DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) ));
- for( index = start, cVertex = 0; index < end; )
- {
- dwPVColor = (VB->Color[(index+2)][3]<<24) | (VB->Color[(index+2)][0]<<16) | (VB->Color[(index+2)][1]<<8) | VB->Color[(index+2)][2];
-
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2];
- index++;
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2];
- index++;
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color= dwPVColor;
- index++;
- }
- }
- else
- {
-#define v1 index
-#define v2 (index+1)
-#define v3 (index+2)
-
- for( index = start, cVertex = 0; index < end; index += 3 )
- {
- if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS )
- {
- continue;
- }
- else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] )
- {
- VList[0] = v1;
- VList[1] = v2;
- VList[2] = v3;
- RenderClippedPolygon( ctx, 3, VList );
- continue;
- }
-
- /* Compute orientation of triangle */
- ex = VB->Win[v2][0] - VB->Win[v1][0];
- ey = VB->Win[v2][1] - VB->Win[v1][1];
- fx = VB->Win[v3][0] - VB->Win[v1][0];
- fy = VB->Win[v3][1] - VB->Win[v1][1];
- c = (ex * fy) - (ey * fx);
-
- /* polygon is perpindicular to view plane, don't draw it */
- if ( (c == 0.0F) && !ctx->Polygon.Unfilled )
- continue;
-
- /* Backface culling. */
- facing = (c < 0.0F) ^ ctx->Polygon.FrontBit;
- if ( (facing + 1) & ctx->Polygon.CullBits )
- continue;
-
- if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE )
- {
- if ( facing == 1 )
- {
- /* use back color */
- VB->Color = VB->Bcolor;
- VB->Specular= VB->Bspec;
- }
- else
- {
- /* use front color */
- VB->Color = VB->Fcolor;
- VB->Specular= VB->Fspec;
- }
- }
-
- if ( ctx->IndirectTriangles & DD_TRI_OFFSET )
- {
- /* Finish computing plane equation of polygon, compute offset */
- GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2];
- GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2];
- GLfloat a = (ey * fz) - (ez * fy);
- GLfloat b = (ez * fx) - (ex * fz);
- OffsetPolygon( ctx, a, b, c );
- }
-
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
- /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */
- dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- D3DTLVertices[cVertex++].color= dwPVColor;
- }
-#undef v1
-#undef v2
-#undef v3
- }
-
- /* Render the converted vertex buffer. */
- if ( cVertex > 2 )
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex );
-}
-/*===========================================================================*/
-/* This function will render the current vertex buffer as a triangle fan. */
-/* The buffer has to be able to be rendered directly. This means that we are*/
-/* filled, no offsets, no culling and one sided rendering. Also we must be */
-/* in render mode of course. */
-/* First I will fill the global D3D vertice buffer. Next I will set all the*/
-/* states for D3D based on the current OGL state. Finally I pass the D3D VB */
-/* to the wrapper that call DrawPrimitives. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- int index,
- cVertex,
- height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- GLfloat ex, ey,
- fx, fy, c;
- GLuint facing;
- DWORD dwPVColor;
-
- DPF(( DBG_FUNC, "RenderTriangleFanVB();" ));
-
- /* Special case that we can blast the fan without culling, offset, etc... */
- if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) )
- {
- DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) ));
-
- /* Seed the the fan. */
- D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] );
- D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) );
- D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] );
- D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] );
- D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] );
- D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) );
- D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2];
-
- /* Seed the the fan. */
- D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] );
- D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) );
- D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] );
- D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] );
- D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] );
- D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) );
- D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2];
-
- for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ )
- {
- /*=================================*/
- /* Add the next vertex to the fan. */
- /*=================================*/
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2];
- }
-
- /* Render the converted vertex buffer. */
- if ( cVertex )
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLEFAN, &D3DTLVertices[0], cVertex );
- }
- else
- {
-#define v1 start
-#define v2 (index-1)
-#define v3 index
-
- for( index = (start+2), cVertex = 0; index < end; index++ )
- {
- if ( VB->ClipOrMask )
- {
- /* All points clipped by common plane */
- if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS )
- {
- continue;
- }
- else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] )
- {
- VList[0] = v1;
- VList[1] = v2;
- VList[2] = v3;
- RenderClippedPolygon( ctx, 3, VList );
- continue;
- }
- }
-
- /* Compute orientation of triangle */
- ex = VB->Win[v2][0] - VB->Win[v1][0];
- ey = VB->Win[v2][1] - VB->Win[v1][1];
- fx = VB->Win[v3][0] - VB->Win[v1][0];
- fy = VB->Win[v3][1] - VB->Win[v1][1];
- c = (ex * fy) - (ey * fx);
-
- /* polygon is perpindicular to view plane, don't draw it */
- if ( (c == 0.0F) && !ctx->Polygon.Unfilled )
- continue;
-
- /* Backface culling. */
- facing = (c < 0.0F) ^ ctx->Polygon.FrontBit;
- if ( (facing + 1) & ctx->Polygon.CullBits )
- continue;
-
- if ( ctx->IndirectTriangles & DD_TRI_OFFSET )
- {
- /* Finish computing plane equation of polygon, compute offset */
- GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2];
- GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2];
- GLfloat a = (ey * fz) - (ez * fy);
- GLfloat b = (ez * fx) - (ex * fz);
- OffsetPolygon( ctx, a, b, c );
- }
-
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
- dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- D3DTLVertices[cVertex++].color= dwPVColor;
- }
-
- /* Render the converted vertex buffer. */
- if ( cVertex )
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex );
-#undef v1
-#undef v2
-#undef v3
- }
-}
-/*===========================================================================*/
-/* This function will render the current vertex buffer as a triangle strip. */
-/* The buffer has to be able to be rendered directly. This means that we are*/
-/* filled, no offsets, no culling and one sided rendering. Also we must be */
-/* in render mode of course. */
-/* First I will fill the global D3D vertice buffer. Next I will set all the*/
-/* states for D3D based on the current OGL state. Finally I pass the D3D VB */
-/* to the wrapper that call DrawPrimitives. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- int index,
- cVertex = 0,
- v1, v2, v3,
- height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- GLfloat ex, ey,
- fx, fy, c;
- GLuint facing;
- DWORD dwPVColor;
-
- DPF(( DBG_FUNC, "RenderTriangleStripVB();" ));
-
- /* Special case that we can blast the fan without culling, offset, etc... */
- if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) )
- {
- DPF(( DBG_PRIM_PROFILE, "DirectTriangles" ));
-
- /* Seed the the strip. */
- D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] );
- D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) );
- D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] );
- D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] );
- D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] );
- D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) );
- D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2];
-
- /* Seed the the strip. */
- D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] );
- D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) );
- D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] );
- D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] );
- D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] );
- D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) );
- D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2];
-
- for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ )
- {
- /*===================================*/
- /* Add the next vertex to the strip. */
- /*===================================*/
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2];
- }
-
- /* Render the converted vertex buffer. */
- if ( cVertex )
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLESTRIP, &D3DTLVertices[0], cVertex );
- }
- else
- {
- for( index = (start+2); index < end; index++ )
- {
- /* We need to switch order so that winding won't be a problem. */
- if ( index & 1 )
- {
- v1 = index - 1;
- v2 = index - 2;
- v3 = index - 0;
- }
- else
- {
- v1 = index - 2;
- v2 = index - 1;
- v3 = index - 0;
- }
-
- /* All vertices clipped by common plane */
- if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS )
- continue;
-
- /* Check if any vertices need clipping. */
- if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] )
- {
- VList[0] = v1;
- VList[1] = v2;
- VList[2] = v3;
- RenderClippedPolygon( ctx, 3, VList );
- }
- else
- {
- /* Compute orientation of triangle */
- ex = VB->Win[v2][0] - VB->Win[v1][0];
- ey = VB->Win[v2][1] - VB->Win[v1][1];
- fx = VB->Win[v3][0] - VB->Win[v1][0];
- fy = VB->Win[v3][1] - VB->Win[v1][1];
- c = (ex * fy) - (ey * fx);
-
- /* Polygon is perpindicular to view plane, don't draw it */
- if ( (c == 0.0F) && !ctx->Polygon.Unfilled )
- continue;
-
- /* Backface culling. */
- facing = (c < 0.0F) ^ ctx->Polygon.FrontBit;
- if ( (facing + 1) & ctx->Polygon.CullBits )
- continue;
-
- /* Need right color if we have two sided lighting. */
- if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE )
- {
- if ( facing == 1 )
- {
- /* use back color */
- VB->Color = VB->Bcolor;
- VB->Specular= VB->Bspec;
- }
- else
- {
- /* use front color */
- VB->Color = VB->Fcolor;
- VB->Specular= VB->Fspec;
- }
- }
-
- if ( ctx->IndirectTriangles & DD_TRI_OFFSET )
- {
- /* Finish computing plane equation of polygon, compute offset */
- GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2];
- GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2];
- GLfloat a = (ey * fz) - (ez * fy);
- GLfloat b = (ez * fx) - (ex * fz);
- OffsetPolygon( ctx, a, b, c );
- }
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
-
- /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */
- dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- D3DTLVertices[cVertex++].color= dwPVColor;
- }
- }
-
- /* Render the converted vertex buffer. */
- if ( cVertex )
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex );
- }
-}
-/*===========================================================================*/
-/* This function will render the current vertex buffer as Quads. The buffer*/
-/* has to be able to be rendered directly. This means that we are filled, no*/
-/* offsets, no culling and one sided rendering. Also we must be in render */
-/* mode of cource. */
-/* First I will fill the global D3D vertice buffer. Next I will set all the*/
-/* states for D3D based on the current OGL state. Finally I pass the D3D VB */
-/* to the wrapper that call DrawPrimitives. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- int index,
- cVertex,
- height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- DWORD dwPVColor;
- GLfloat ex, ey,
- fx, fy, c;
- GLuint facing; /* 0=front, 1=back */
-
- DPF(( DBG_FUNC, "RenderQuadVB();" ));
-
-#define v1 (index)
-#define v2 (index+1)
-#define v3 (index+2)
-#define v4 (index+3)
-
- if ( !VB->ClipOrMask )
- {
- DPF(( DBG_PRIM_PROFILE, "DirectTriangles" ));
-
- for( cVertex = 0, index = start; index < end; index += 4 )
- {
- if ( ctx->Light.ShadeModel == GL_FLAT )
- dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2];
-
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v2][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v4][2] );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2];
- }
- }
- else
- {
- for( cVertex = 0, index = start; index < end; index += 4 )
- {
- if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & VB->ClipMask[v4] & CLIP_ALL_BITS )
- {
- continue;
- }
- else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] | VB->ClipMask[v4] )
- {
- VList[0] = v1;
- VList[1] = v2;
- VList[2] = v3;
- VList[3] = v4;
- RenderClippedPolygon( ctx, 4, VList );
- continue;
- }
-
- /* Compute orientation of triangle */
- ex = VB->Win[v2][0] - VB->Win[v1][0];
- ey = VB->Win[v2][1] - VB->Win[v1][1];
- fx = VB->Win[v3][0] - VB->Win[v1][0];
- fy = VB->Win[v3][1] - VB->Win[v1][1];
- c = (ex * fy) - (ey * fx);
-
- /* polygon is perpindicular to view plane, don't draw it */
- if ( (c == 0.0F) && !ctx->Polygon.Unfilled )
- continue;
-
- /* Backface culling. */
- facing = (c < 0.0F) ^ ctx->Polygon.FrontBit;
- if ( (facing + 1) & ctx->Polygon.CullBits )
- continue;
-
- if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE )
- {
- if ( facing == 1 )
- {
- /* use back color */
- VB->Color = VB->Bcolor;
- VB->Specular= VB->Bspec;
- }
- else
- {
- /* use front color */
- VB->Color = VB->Fcolor;
- VB->Specular= VB->Fspec;
- }
- }
-
- if ( ctx->IndirectTriangles & DD_TRI_OFFSET )
- {
- /* Finish computing plane equation of polygon, compute offset */
- GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2];
- GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2];
- GLfloat a = (ey * fz) - (ez * fy);
- GLfloat b = (ez * fx) - (ex * fz);
- OffsetPolygon( ctx, a, b, c );
- }
-
- if ( ctx->Light.ShadeModel == GL_FLAT )
- dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2];
-
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] );
- D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) );
- D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) );
- D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] );
- D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] );
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) );
- D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ?
- dwPVColor :
- (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2];
- }
- }
-
-#undef v4
-#undef v3
-#undef v2
-#undef v1
-
- /* Render the converted vertex buffer. */
- if ( cVertex )
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex );
-}
-/*===========================================================================*/
-/* */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- DWORD dwPVColor;
- GLfloat ex, ey,
- fx, fy, c;
- GLuint facing; /* 0=front, 1=back */
- static D3DTLVERTEX TLVertices[6];
-
- DPF(( DBG_FUNC, "RenderQuad" ));
- DPF(( DBG_PRIM_INFO, "RenderQuad( 1 )" ));
-
- /* Compute orientation of triangle */
- ex = VB->Win[v2][0] - VB->Win[v1][0];
- ey = VB->Win[v2][1] - VB->Win[v1][1];
- fx = VB->Win[v3][0] - VB->Win[v1][0];
- fy = VB->Win[v3][1] - VB->Win[v1][1];
- c = (ex * fy) - (ey * fx);
-
- /* polygon is perpindicular to view plane, don't draw it */
- if ( (c == 0.0F) && !ctx->Polygon.Unfilled )
- return;
-
- /* Backface culling. */
- facing = (c < 0.0F) ^ ctx->Polygon.FrontBit;
- if ( (facing + 1) & ctx->Polygon.CullBits )
- return;
-
- if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE )
- {
- if ( facing == 1 )
- {
- /* use back color */
- VB->Color = VB->Bcolor;
- VB->Specular= VB->Bspec;
- }
- else
- {
- /* use front color */
- VB->Color = VB->Fcolor;
- VB->Specular= VB->Fspec;
- }
- }
-
- if ( ctx->IndirectTriangles & DD_TRI_OFFSET )
- {
- /* Finish computing plane equation of polygon, compute offset */
- GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2];
- GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2];
- GLfloat a = (ey * fz) - (ez * fy);
- GLfloat b = (ez * fx) - (ex * fz);
- OffsetPolygon( ctx, a, b, c );
- }
-
- if ( ctx->Light.ShadeModel == GL_FLAT )
- dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2];
-
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
- TLVertices[0].sx = D3DVAL( VB->Win[v1][0] );
- TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) );
- TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] );
- TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] );
- TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- TLVertices[1].sx = D3DVAL( VB->Win[v2][0] );
- TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) );
- TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) );
- TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] );
- TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] );
- TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
-
- TLVertices[2].sx = D3DVAL( VB->Win[v3][0] );
- TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) );
- TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] );
- TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] );
- TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- TLVertices[3].sx = D3DVAL( VB->Win[v3][0] );
- TLVertices[3].sy = D3DVAL( (height - VB->Win[v3][1]) );
- TLVertices[3].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- TLVertices[3].tu = D3DVAL( VB->TexCoord[v3][0] );
- TLVertices[3].tv = D3DVAL( VB->TexCoord[v3][1] );
- TLVertices[3].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- TLVertices[3].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
-
- TLVertices[4].sx = D3DVAL( VB->Win[v4][0] );
- TLVertices[4].sy = D3DVAL( (height - VB->Win[v4][1]) );
- TLVertices[4].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) );
- TLVertices[4].tu = D3DVAL( VB->TexCoord[v4][0] );
- TLVertices[4].tv = D3DVAL( VB->TexCoord[v4][1] );
- TLVertices[4].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) );
- TLVertices[4].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2];
-
- TLVertices[5].sx = D3DVAL( VB->Win[v1][0] );
- TLVertices[5].sy = D3DVAL( (height - VB->Win[v1][1]) );
- TLVertices[5].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- TLVertices[5].tu = D3DVAL( VB->TexCoord[v1][0] );
- TLVertices[5].tv = D3DVAL( VB->TexCoord[v1][1] );
- TLVertices[5].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- TLVertices[5].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- /* Draw the two triangles. */
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 6 );
-}
-/*===========================================================================*/
-/* */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- DWORD dwPVColor;
- static D3DTLVERTEX TLVertices[3];
-
- DPF(( DBG_FUNC, "RenderOneTriangle" ));
- DPF(( DBG_PRIM_INFO, "RenderTriangle( 1 )" ));
-
- /*=====================================*/
- /* Populate the the triangle vertices. */
- /*=====================================*/
- if ( ctx->Light.ShadeModel == GL_FLAT )
- dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2];
-
- TLVertices[0].sx = D3DVAL( VB->Win[v1][0] );
- TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) );
- TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) );
- TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] );
- TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] );
- TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
- DPF(( DBG_PRIM_INFO, "V1 -> x:%f y:%f z:%f c:%x",
- TLVertices[0].sx,
- TLVertices[0].sy,
- TLVertices[0].sz,
- TLVertices[0].color ));
-
- TLVertices[1].sx = D3DVAL( VB->Win[v2][0] );
- TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) );
- TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) );
- TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] );
- TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] );
- TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
- DPF(( DBG_PRIM_INFO, "V2 -> x:%f y:%f z:%f c:%x",
- TLVertices[1].sx,
- TLVertices[1].sy,
- TLVertices[1].sz,
- TLVertices[1].color ));
-
- TLVertices[2].sx = D3DVAL( VB->Win[v3][0] );
- TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) );
- TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) );
- TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] );
- TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] );
- TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) );
- TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2];
- DPF(( DBG_PRIM_INFO, "V3 -> x:%f y:%f z:%f c:%x",
- TLVertices[2].sx,
- TLVertices[2].sy,
- TLVertices[2].sz,
- TLVertices[2].color ));
-
- /* Draw the triangle. */
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 3 );
-}
-/*===========================================================================*/
-/* */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- DWORD dwPVColor;
- static D3DTLVERTEX TLVertices[2];
-
- DPF(( DBG_FUNC, "RenderOneLine" ));
- DPF(( DBG_PRIM_INFO, "RenderLine( 1 )" ));
-
- if ( VB->MonoColor )
- dwPVColor = (pContext->aCurrent<<24) | (pContext->rCurrent<<16) | (pContext->gCurrent<<8) | pContext->bCurrent;
- else
- dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2];
-
- TLVertices[0].sx = D3DVAL( VB->Win[v1][0] );
- TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) );
- TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->LineZoffset) );
- TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] );
- TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] );
- TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) );
- TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2];
-
- TLVertices[1].sx = D3DVAL( VB->Win[v2][0] );
- TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) );
- TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->LineZoffset) );
- TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] );
- TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] );
- TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) );
- TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor :
- (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2];
-
- /* Draw line from (x0,y0) to (x1,y1) with current pixel color/index */
- DrawPrimitiveHAL( pContext->pShared, D3DPT_LINELIST, &TLVertices[0], 2 );
-}
-/*===========================================================================*/
-/* This function was written to convert points into triangles. I did this */
-/* as all card accelerate triangles and most drivers do this anyway. In hind*/
-/* thought this might be a bad idea as some cards do better. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- struct vertex_buffer *VB = ctx->VB;
- struct pixel_buffer *PB = ctx->PB;
- GLuint index;
- GLfloat radius, z,
- xmin, ymin,
- xmax, ymax;
- GLint cVertex,
- height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top);
- DWORD dwPVColor;
-
- DPF(( DBG_FUNC, "RenderPointsVB();" ));
-
- radius = CLAMP( ctx->Point.Size, MIN_POINT_SIZE, MAX_POINT_SIZE ) * 0.5F;
-
- for( index = start, cVertex = 0; index <= end; index++ )
- {
- if ( VB->ClipMask[index] == 0 )
- {
- xmin = D3DVAL( VB->Win[index][0] - radius );
- xmax = D3DVAL( VB->Win[index][0] + radius );
- ymin = D3DVAL( height - VB->Win[index][1] - radius );
- ymax = D3DVAL( height - VB->Win[index][1] + radius );
- z = D3DVAL( (VB->Win[index][2] + ctx->PointZoffset) );
-
- dwPVColor = (VB->Color[index][3]<<24) |
- (VB->Color[index][0]<<16) |
- (VB->Color[index][1]<<8) |
- VB->Color[index][2];
-
- D3DTLVertices[cVertex].sx = xmin;
- D3DTLVertices[cVertex].sy = ymax;
- D3DTLVertices[cVertex].sz = z;
- D3DTLVertices[cVertex].tu = 0.0;
- D3DTLVertices[cVertex].tv = 0.0;
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color = dwPVColor;
-
- D3DTLVertices[cVertex].sx = xmin;
- D3DTLVertices[cVertex].sy = ymin;
- D3DTLVertices[cVertex].sz = z;
- D3DTLVertices[cVertex].tu = 0.0;
- D3DTLVertices[cVertex].tv = 0.0;
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color = dwPVColor;
-
- D3DTLVertices[cVertex].sx = xmax;
- D3DTLVertices[cVertex].sy = ymin;
- D3DTLVertices[cVertex].sz = z;
- D3DTLVertices[cVertex].tu = 0.0;
- D3DTLVertices[cVertex].tv = 0.0;
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color = dwPVColor;
-
- D3DTLVertices[cVertex].sx = xmax;
- D3DTLVertices[cVertex].sy = ymin;
- D3DTLVertices[cVertex].sz = z;
- D3DTLVertices[cVertex].tu = 0.0;
- D3DTLVertices[cVertex].tv = 0.0;
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color = dwPVColor;
-
- D3DTLVertices[cVertex].sx = xmax;
- D3DTLVertices[cVertex].sy = ymax;
- D3DTLVertices[cVertex].sz = z;
- D3DTLVertices[cVertex].tu = 0.0;
- D3DTLVertices[cVertex].tv = 0.0;
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color = dwPVColor;
-
- D3DTLVertices[cVertex].sx = xmin;
- D3DTLVertices[cVertex].sy = ymax;
- D3DTLVertices[cVertex].sz = z;
- D3DTLVertices[cVertex].tu = 0.0;
- D3DTLVertices[cVertex].tv = 0.0;
- D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) );
- D3DTLVertices[cVertex++].color = dwPVColor;
- }
- }
-
- /* Render the converted vertex buffer. */
- if ( cVertex )
- DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex );
-}
-/*===========================================================================*/
-/* This gets call before we render any primitives so that the current OGL */
-/* states will be mapped the D3D context. I'm still not sure how D3D works */
-/* but I'm finding that it doesn't act like a state machine as OGL is. It */
-/* looks like the state gets set back to the defaults after a DrawPrimitives */
-/* or an EndScene. Also I set states that are the default even though this */
-/* is redundant as the defaults seem screwed up. */
-/* TODO: make a batch call. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void SetRenderStates( GLcontext *ctx )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DWORD dwFunc;
- static BOOL bTexture = FALSE;
- static int texName = -1;
-
- DPF(( DBG_FUNC, "SetRenderStates();" ));
-
- if ( g_DBGMask & DBG_STATES )
- DebugRenderStates( ctx, FALSE );
-
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE );
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_DITHERENABLE, (ctx->Color.DitherFlag) ? TRUE : FALSE );
-
- /*================================================*/
- /* Check too see if there are new TEXTURE states. */
- /*================================================*/
- if ( ctx->Texture._EnabledUnits )
- {
- switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode )
- {
- case GL_MODULATE:
- if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA )
- dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulatealpha];
- else
- dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulate];
- break;
-
- case GL_BLEND:
- dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha];
- break;
-
- case GL_REPLACE:
- dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal];
- break;
-
- case GL_DECAL:
- if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA )
- dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha];
- else
- dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal];
- break;
- }
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAPBLEND, dwFunc );
-
- switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter )
- {
- case GL_NEAREST:
- dwFunc = D3DFILTER_NEAREST;
- break;
- case GL_LINEAR:
- dwFunc = D3DFILTER_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- dwFunc = D3DFILTER_MIPNEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- dwFunc = D3DFILTER_LINEARMIPNEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- dwFunc = D3DFILTER_MIPLINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- dwFunc = D3DFILTER_LINEARMIPLINEAR;
- break;
- }
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAG, dwFunc );
-
- switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter )
- {
- case GL_NEAREST:
- dwFunc = D3DFILTER_NEAREST;
- break;
- case GL_LINEAR:
- dwFunc = D3DFILTER_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- dwFunc = D3DFILTER_MIPNEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- dwFunc = D3DFILTER_LINEARMIPNEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- dwFunc = D3DFILTER_MIPLINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- dwFunc = D3DFILTER_LINEARMIPLINEAR;
- break;
- }
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMIN, dwFunc );
-
- /* Another hack to cut down on redundant texture binding. */
- // if ( texName != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name )
- // {
- texName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name;
- CreateTMgrHAL( pContext->pShared,
- texName,
- 0,
- ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format,
- (RECT *)NULL,
- ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Width,
- ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Height,
- TM_ACTION_BIND,
- (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Data );
- // }
- bTexture = TRUE;
- }
- else
- {
- /* This is nasty but should cut down on the number of redundant calls. */
- if ( bTexture == TRUE )
- {
- DisableTMgrHAL( pContext->pShared );
- bTexture = FALSE;
- }
- }
-
- /*===============================================*/
- /* Check too see if there are new RASTER states. */
- /*===============================================*/
-
- // TODO: no concept of front & back.
- switch( ctx->Polygon.FrontMode )
- {
- case GL_POINT:
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_POINT );
- break;
- case GL_LINE:
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME );
- break;
- case GL_FILL:
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID );
- break;
- }
-
- /*************/
- /* Z-Buffer. */
- /*************/
- if ( ctx->Depth.Test == GL_TRUE )
- {
- switch( ctx->Depth.Func )
- {
- case GL_NEVER:
- dwFunc = D3DCMP_NEVER;
- break;
- case GL_LESS:
- dwFunc = D3DCMP_LESS;
- break;
- case GL_GEQUAL:
- dwFunc = D3DCMP_GREATEREQUAL;
- break;
- case GL_LEQUAL:
- dwFunc = D3DCMP_LESSEQUAL;
- break;
- case GL_GREATER:
- dwFunc = D3DCMP_GREATER;
- break;
- case GL_NOTEQUAL:
- dwFunc = D3DCMP_NOTEQUAL;
- break;
- case GL_EQUAL:
- dwFunc = D3DCMP_EQUAL;
- break;
- case GL_ALWAYS:
- dwFunc = D3DCMP_ALWAYS;
- break;
- }
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZFUNC, dwFunc );
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, TRUE );
- }
- else
- {
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, FALSE );
- }
-
- /*******************/
- /* Z-Write Enable. */
- /*******************/
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZWRITEENABLE , (ctx->Depth.Mask == GL_TRUE) ? TRUE : FALSE );
-
- /***************/
- /* Alpha test. */
- /***************/
- if ( ctx->Color.AlphaEnabled == GL_TRUE )
- {
- switch( ctx->Color.AlphaFunc )
- {
- case GL_NEVER:
- dwFunc = D3DCMP_NEVER;
- break;
- case GL_LESS:
- dwFunc = D3DCMP_LESS;
- break;
- case GL_GEQUAL:
- dwFunc = D3DCMP_GREATEREQUAL;
- break;
- case GL_LEQUAL:
- dwFunc = D3DCMP_LESSEQUAL;
- break;
- case GL_GREATER:
- dwFunc = D3DCMP_GREATER;
- break;
- case GL_NOTEQUAL:
- dwFunc = D3DCMP_NOTEQUAL;
- break;
- case GL_EQUAL:
- dwFunc = D3DCMP_EQUAL;
- break;
- case GL_ALWAYS:
- dwFunc = D3DCMP_ALWAYS;
- break;
- }
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHAFUNC , dwFunc );
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, TRUE );
- }
- else
- {
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, FALSE );
- }
-
- /****************/
- /* Alpha blend. */
- /****************/
- if ( ctx->Color.BlendEnabled == GL_TRUE )
- {
- switch( ctx->Color.BlendSrc )
- {
- case GL_ZERO:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_zero];
- break;
- case GL_ONE:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_one];
- break;
- case GL_DST_COLOR:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_color];
- break;
- case GL_ONE_MINUS_DST_COLOR:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_color];
- break;
- case GL_SRC_ALPHA:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha];
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_src_alpha];
- break;
- case GL_DST_ALPHA:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_alpha];
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_alpha];
- break;
- case GL_SRC_ALPHA_SATURATE:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha_saturate];
- break;
- case GL_CONSTANT_COLOR:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_color];
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_color];
- break;
- case GL_CONSTANT_ALPHA:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_alpha];
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_alpha];
- break;
- }
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_SRCBLEND, dwFunc );
-
- switch( ctx->Color.BlendDst )
- {
- case GL_ZERO:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_zero];
- break;
- case GL_ONE:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_one];
- break;
- case GL_SRC_COLOR:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_src_color];
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_color];
- break;
- case GL_SRC_ALPHA:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_src_alpha];
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_alpha];
- break;
- case GL_DST_ALPHA:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_dst_alpha];
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_dst_alpha];
- break;
- case GL_CONSTANT_COLOR:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_color];
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_color];
- break;
- case GL_CONSTANT_ALPHA:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_alpha];
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_alpha];
- break;
- }
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_DESTBLEND, dwFunc );
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE );
- }
- else
- {
- SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE );
- }
-}
-/*===========================================================================*/
-/* If this function is called it will track the changes to the current */
-/* states that I'm setting in Direct3D. I did this so that the DPF's would */
-/* be under control! */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void DebugRenderStates( GLcontext *ctx, BOOL bForce )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DWORD dwFunc;
- static int dither = -1,
- texture = -1,
- textName = -1,
- textEnv = -1,
- textMin = -1,
- textMag = -1,
- polyMode = -1,
- depthTest = -1,
- depthFunc = -1,
- depthMask = -1,
- alphaTest = -1,
- alphaFunc = -1,
- blend = -1,
- blendSrc = -1,
- blendDest = -1;
-
- /* Force a displayed update of all current states. */
- if ( bForce )
- {
- dither = texture = textName = textEnv = textMin = textMag = -1;
- polyMode = depthTest = depthFunc = depthMask = -1;
- alphaTest = alphaFunc = blend = blendSrc = blendDest = -1;
- }
-
- if ( dither != ctx->Color.DitherFlag )
- {
- dither = ctx->Color.DitherFlag;
- DPF(( 0, "\tDither\t\t%s", (dither) ? "ENABLED" : "--------" ));
- }
- if ( depthTest != ctx->Depth.Test )
- {
- depthTest = ctx->Depth.Test;
- DPF(( 0, "\tDepth Test\t%s", (depthTest) ? "ENABLED" : "--------" ));
- }
- if ( alphaTest != ctx->Color.AlphaEnabled )
- {
- alphaTest = ctx->Color.AlphaEnabled;
-
- DPF(( 0, "\tAlpha Test\t%s", (alphaTest) ? "ENABLED" : "--------" ));
- }
- if ( blend != ctx->Color.BlendEnabled )
- {
- blend = ctx->Color.BlendEnabled;
-
- DPF(( 0, "\tBlending\t%s", (blend) ? "ENABLED" : "--------" ));
- }
-
- /*================================================*/
- /* Check too see if there are new TEXTURE states. */
- /*================================================*/
- if ( texture != ctx->Texture._EnabledUnits )
- {
- texture = ctx->Texture._EnabledUnits;
- DPF(( 0, "\tTexture\t\t%s", (texture) ? "ENABLED" : "--------" ));
- }
-
- if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current )
- {
- if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name != textName )
- {
- textName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name;
- DPF(( 0, "\tTexture Name:\t%d", textName ));
- DPF(( 0, "\tTexture Format:\t%s",
- (ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA) ?
- "GL_RGBA" : "GLRGB" ));
- }
-
- if ( textEnv != ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode )
- {
- textEnv = ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode;
-
- switch( textEnv )
- {
- case GL_MODULATE:
- DPF(( 0, "\tTexture\tMode\tGL_MODULATE" ));
- break;
- case GL_BLEND:
- DPF(( 0, "\tTexture\tMode\tGL_BLEND" ));
- break;
- case GL_REPLACE:
- DPF(( 0, "\tTexture\tMode\tGL_REPLACE" ));
- break;
- case GL_DECAL:
- DPF(( 0, "\tTexture\tMode\tGL_DECAL" ));
- break;
- }
- }
-
- if ( textMag != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter )
- {
- textMag = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter;
-
- switch( textMag )
- {
- case GL_NEAREST:
- DPF(( 0, "\tTexture MAG\tGL_NEAREST" ));
- break;
- case GL_LINEAR:
- DPF(( 0, "\tTexture MAG\tGL_LINEAR" ));
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_NEAREST" ));
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_NEAREST" ));
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_LINEAR" ));
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_LINEAR" ));
- break;
- }
- }
-
- if ( textMin != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter )
- {
- textMin = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter;
-
- switch( textMin )
- {
- case GL_NEAREST:
- DPF(( 0, "\tTexture MIN\tGL_NEAREST" ));
- break;
- case GL_LINEAR:
- DPF(( 0, "\tTexture MIN\tGL_LINEAR" ));
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- DPF(( 0, "\tTexture MIN\tGL_NEAREST_MIPMAP_NEAREST" ));
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_NEAREST" ));
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" ));
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" ));
- break;
- }
- }
- }
-
- if ( ctx->Polygon.FrontMode != polyMode )
- {
- polyMode = ctx->Polygon.FrontMode;
-
- switch( polyMode )
- {
- case GL_POINT:
- DPF(( 0, "\tMode\t\tGL_POINT" ));
- break;
- case GL_LINE:
- DPF(( 0, "\tMode\t\tGL_LINE" ));
- break;
- case GL_FILL:
- DPF(( 0, "\tMode\t\tGL_FILL" ));
- break;
- }
- }
-
- if ( depthFunc != ctx->Depth.Func )
- {
- depthFunc = ctx->Depth.Func;
-
- switch( depthFunc )
- {
- case GL_NEVER:
- DPF(( 0, "\tDepth Func\tGL_NEVER" ));
- break;
- case GL_LESS:
- DPF(( 0, "\tDepth Func\tGL_LESS" ));
- break;
- case GL_GEQUAL:
- DPF(( 0, "\tDepth Func\tGL_GEQUAL" ));
- break;
- case GL_LEQUAL:
- DPF(( 0, "\tDepth Func\tGL_LEQUAL" ));
- break;
- case GL_GREATER:
- DPF(( 0, "\tDepth Func\tGL_GREATER" ));
- break;
- case GL_NOTEQUAL:
- DPF(( 0, "\tDepth Func\tGL_NOTEQUAL" ));
- break;
- case GL_EQUAL:
- DPF(( 0, "\tDepth Func\tGL_EQUAL" ));
- break;
- case GL_ALWAYS:
- DPF(( 0, "\tDepth Func\tGL_ALWAYS" ));
- break;
- }
- }
-
- if ( depthMask != ctx->Depth.Mask )
- {
- depthMask = ctx->Depth.Mask;
- DPF(( 0, "\tZWrite\t\t%s", (depthMask) ? "ENABLED" : "--------" ));
- }
-
- if ( alphaFunc != ctx->Color.AlphaFunc )
- {
- alphaFunc = ctx->Color.AlphaFunc;
-
- switch( alphaFunc )
- {
- case GL_NEVER:
- DPF(( 0, "\tAlpha Func\tGL_NEVER" ));
- break;
- case GL_LESS:
- DPF(( 0, "\tAlpha Func\tGL_LESS" ));
- break;
- case GL_GEQUAL:
- DPF(( 0, "\tAlpha Func\tGL_GEQUAL" ));
- break;
- case GL_LEQUAL:
- DPF(( 0, "\tAlpha Func\tGL_LEQUAL" ));
- break;
- case GL_GREATER:
- DPF(( 0, "\tAlpha Func\tGL_GREATER" ));
- break;
- case GL_NOTEQUAL:
- DPF(( 0, "\tAlpha Func\tGL_NOTEQUAL" ));
- break;
- case GL_EQUAL:
- DPF(( 0, "\tAlpha Func\tGL_EQUAL" ));
- break;
- case GL_ALWAYS:
- DPF(( 0, "\tAlpha Func\tGL_ALWAYS" ));
- break;
- }
- }
-
- if ( blendSrc != ctx->Color.BlendSrc )
- {
- blendSrc = ctx->Color.BlendSrc;
-
- switch( blendSrc )
- {
- case GL_ZERO:
- DPF(( 0, "\tSRC Blend\tGL_ZERO" ));
- break;
- case GL_ONE:
- DPF(( 0, "\tSRC Blend\tGL_ONE" ));
- break;
- case GL_DST_COLOR:
- DPF(( 0, "\tSRC Blend\tGL_DST_COLOR" ));
- break;
- case GL_ONE_MINUS_DST_COLOR:
- DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_COLOR" ));
- break;
- case GL_SRC_ALPHA:
- DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA" ));
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- DPF(( 0, "\tSRC Blend\tGL_MINUS_SRC_ALPHA" ));
- break;
- case GL_DST_ALPHA:
- DPF(( 0, "\tSRC Blend\tGL_DST_ALPHA" ));
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_ALPHA" ));
- break;
- case GL_SRC_ALPHA_SATURATE:
- DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA_SATURATE" ));
- break;
- case GL_CONSTANT_COLOR:
- DPF(( 0, "\tSRC Blend\tGL_CONSTANT_COLOR" ));
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_COLOR" ));
- break;
- case GL_CONSTANT_ALPHA:
- DPF(( 0, "\tSRC Blend\tGL_CONSTANT_ALPHA" ));
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" ));
- break;
- }
- }
-
- if ( blendDest != ctx->Color.BlendDst )
- {
- blendDest = ctx->Color.BlendDst;
-
- switch( blendDest )
- {
- case GL_ZERO:
- DPF(( 0, "\tDST Blend\tGL_ZERO" ));
- break;
- case GL_ONE:
- DPF(( 0, "\tDST Blend\tGL_ONE" ));
- break;
- case GL_SRC_COLOR:
- DPF(( 0, "\tDST Blend\tGL_SRC_COLOR" ));
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_COLOR" ));
- break;
- case GL_SRC_ALPHA:
- DPF(( 0, "\tDST Blend\tGL_SRC_ALPHA" ));
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_ALPHA" ));
- break;
- case GL_DST_ALPHA:
- DPF(( 0, "\tDST Blend\tGL_DST_ALPHA" ));
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_DST_ALPHA" ));
- break;
- case GL_CONSTANT_COLOR:
- DPF(( 0, "\tDST Blend\tGL_CONSTANT_COLOR" ));
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_COLOR" ));
- break;
- case GL_CONSTANT_ALPHA:
- DPF(( 0, "\tDST Blend\tGL_CONSTANT_ALPHA" ));
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" ));
- break;
- }
- }
-}
diff --git a/src/mesa/drivers/d3d/DDrawPROCS.c b/src/mesa/drivers/d3d/DDrawPROCS.c
deleted file mode 100644
index a02a89debbb..00000000000
--- a/src/mesa/drivers/d3d/DDrawPROCS.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "D3DMesa.h"
-/*===========================================================================*/
-/* This call will clear the render surface using the pixel info built from */
-/* the surface at creation time. The call uses Lock/Unlock to access the */
-/* surface. The call also special cases a full clear or a dirty rectangle. */
-/* Finally the call returns the new clear mask that reflects that the color */
-/* buffer was cleared. */
-/*===========================================================================*/
-/* RETURN: the original mask with the bits cleared that represents the buffer*/
-/* or buffers we just cleared. */
-/*===========================================================================*/
-GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- UCHAR *pBuffer,
- *pScanLine;
- int index,
- index2;
- DWORD dwColor;
-
- if ( mask & GL_COLOR_BUFFER_BIT )
- {
- /* Lock the surface to get the surface pointer. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- /* Solve the color once only. */
- dwColor = ( ((DWORD)((float)pContext->rClear * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)pContext->gClear * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)pContext->bClear * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
-
- if ( all )
- {
- for( index = 0, pScanLine = (UCHAR *)pddsd2->lpSurface; index < pContext->pShared->dwHeight; index++, pScanLine += pddsd2->lPitch )
- for( pBuffer = pScanLine, index2 = 0; index2 < pContext->pShared->dwWidth; index2++, pBuffer += pContext->pShared->pixel.cb )
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- else
- {
- pScanLine = ((UCHAR *)pddsd2->lpSurface) +
- ( (FLIP( pContext->pShared->dwHeight, (y+height)) * pddsd2->lPitch) + (x * pContext->pShared->pixel.cb) );
-
- for( index = 0; index < height; index++, pScanLine += pddsd2->lPitch )
- {
- for( index2 = 0, pBuffer = pScanLine; index2 < width; index2++, pBuffer += pContext->pShared->pixel.cb )
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
-
- UnlockHAL( pContext->pShared, TRUE );
- }
-
- return (mask & ~GL_COLOR_BUFFER_BIT);
-}
-/*===========================================================================*/
-/* This proc (as all others) has been written for the general case. I use */
-/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
-/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- UCHAR *pBuffer;
- int index;
- DWORD dwColor;
-
- /* Get the surface pointer and the pitch. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- /* Find the start of the span. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb);
-
- if ( mask )
- {
- for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
- {
- if ( mask[index] )
- {
- /* Pack the color components. */
- dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
- }
- else
- {
- for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
- {
- /* Pack the color components. */
- dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
-
- /* Giver back. */
- UnlockHAL( pContext->pShared, TRUE );
-}
-/*===========================================================================*/
-/* This proc (as all others) has been written for the general case. I use */
-/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
-/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- UCHAR *pBuffer;
- int index;
- DWORD dwColor;
-
- /* Get the surface pointer and the pitch. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- /* Find the start of the span. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb);
-
- if ( mask )
- {
- for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
- {
- if ( mask[index] )
- {
- /* Pack the color components. */
- dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
- }
- else
- {
- for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
- {
- /* Pack the color components. */
- dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
-
- /* Giver back. */
- UnlockHAL( pContext->pShared, TRUE );
-}
-/*===========================================================================*/
-/* This proc (as all others) has been written for the general case. I use */
-/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
-/* Screen render surface uses. The color is solved once from the current */
-/* color components. The alpha is ignored as Mesa is doing it in SW. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- UCHAR *pBuffer;
- int index;
- DWORD dwColor;
-
- /* Lock the surface to get the surface pointer and the pitch. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- /* Solve the color once only. (no alpha) */
- dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
-
- /* Find the start of the span. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb);
-
- if ( mask )
- {
- for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
- if ( mask[index] )
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- else
- {
- for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
-
- /* Giver back. */
- UnlockHAL( pContext->pShared, TRUE );
-}
-/*===========================================================================*/
-/* This proc (as all others) has been written for the general case. I use */
-/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
-/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- UCHAR *pBuffer;
- int index;
- DWORD dwColor;
-
- /* Get the surface pointer and the pitch. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- if ( mask )
- {
- for( index = 0; index < n; index++ )
- {
- if ( mask[index] )
- {
- /* Pack the color components. */
- dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
-
- /* Find the pixel. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
- }
- else
- {
- for( index = 0; index < n; index++ )
- {
- /* Pack the color components. */
- dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
-
- /* Find the pixel. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
-
- /* Giver back. */
- UnlockHAL( pContext->pShared, TRUE );
-}
-/*===========================================================================*/
-/* This proc (as all others) has been written for the general case. I use */
-/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
-/* Screen render surface uses. The color is solved once from the current */
-/* color components. The alpha is ignored as Mesa is doing it in SW. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- UCHAR *pBuffer;
- int index;
- DWORD dwColor;
-
- /* Get the surface pointer and the pitch. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- /* Solve the color once only. I don't uses the alpha. */
- dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
- dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
- dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
-
- if ( mask )
- {
- /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
- for( index = 0; index < n; index++ )
- {
- if ( mask[index] )
- {
- /* Find the pixel. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
- }
- else
- {
- /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
- for( index = 0; index < n; index++ )
- {
- /* Find the pixel. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
- memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
- }
- }
-
- /* Giver back. */
- UnlockHAL( pContext->pShared, TRUE );
-}
-/*===========================================================================*/
-/* This proc isn't written for speed rather its to handle the general case. */
-/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/
-/* structure that was generated from the OffScreen surface pixelformat. The */
-/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/
-/* own alpha channel when the context was created. I did this as I didn't */
-/* feel that it was worth the effort to try and get HW to work (bus bound). */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- UCHAR *pBuffer;
- int index;
- DWORD *pdwColor;
-
- /* Get the surface pointer and the pitch. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- /* Find the start of the span. Invert y for Windows. */
- pBuffer = (UCHAR *)pddsd2->lpSurface +
- (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) +
- (x*pContext->pShared->pixel.cb);
-
- /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
- for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
- {
- pdwColor = (DWORD *)pBuffer;
- rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale);
- rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale);
- rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale);
- }
-
- /* Giver back. */
- UnlockHAL( pContext->pShared, TRUE );
-}
-/*===========================================================================*/
-/* This proc isn't written for speed rather its to handle the general case. */
-/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/
-/* structure that was generated from the OffScreen surface pixelformat. The */
-/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/
-/* own alpha channel when the context was created. I did this as I didn't */
-/* feel that it was worth the effort to try and get HW to work (bus bound). */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DDSURFACEDESC2 *pddsd2;
- int index;
- DWORD *pdwColor;
-
- /* Get the surface pointer and the pitch. */
- pddsd2 = LockHAL( pContext->pShared, TRUE );
-
- if ( mask )
- {
- /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
- for( index = 0; index < n; index++ )
- {
- if ( mask[index] )
- {
- /* Find the start of the pixel. Invert y for Windows. */
- pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb));
- rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale);
- rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale);
- rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale);
- }
- }
- }
- else
- {
- /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
- for( index = 0; index < n; index++ )
- {
- /* Find the start of the pixel. Invert y for Windows. */
- pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb));
- rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale);
- rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale);
- rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale);
- }
- }
-
- /* Giver back. */
- UnlockHAL( pContext->pShared, TRUE );
-}
diff --git a/src/mesa/drivers/d3d/DEBUG.C b/src/mesa/drivers/d3d/DEBUG.C
deleted file mode 100644
index dfa524bf314..00000000000
--- a/src/mesa/drivers/d3d/DEBUG.C
+++ /dev/null
@@ -1,143 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "Debug.h"
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-DWORD g_DBGMask = DBG_ALL_ERROR;
-/*===========================================================================*/
-/* This is your basic DPF function with printf like support. The function */
-/* also works with a global debug mask variable. I have written support that*/
-/* allows for the user's enviroment variable space to be read and set the */
-/* masks. This is done when the dll starts and is only in the debug version.*/
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void _cdecl DebugPrint( int mask, char *pszFormat, ... )
-{
- char buffer[512];
- va_list args;
-
- /* A mask of 0 will always pass. Easy to remeber. */
- if ( (mask == 0) || (mask & g_DBGMask) )
- {
- va_start( args, pszFormat );
-
- if ( mask & DBG_ALL_ERROR )
- OutputDebugString( "MesaD3D: (ERROR)" );
- else
- OutputDebugString( "MesaD3D: " );
-
- vsprintf( buffer, pszFormat, args );
- strcat( buffer, "\n" );
- OutputDebugString( buffer );
-
- va_end( args );
- }
-}
-/*===========================================================================*/
-/* This call reads the users enviroment variables and sets any debug mask */
-/* that they have set to TRUE. Now the value must be "TRUE". */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void ReadDBGEnv( void )
-{
- g_DBGMask = DBG_ALL_ERROR;
-
-#define IS_VAR_SET(v) if ( getenv( # v ) && !strcmp(getenv( # v ),"TRUE") ) g_DBGMask |= v;
-
- IS_VAR_SET( DBG_FUNC );
- IS_VAR_SET( DBG_STATES );
-
- IS_VAR_SET( DBG_CNTX_INFO );
- IS_VAR_SET( DBG_CNTX_WARN );
- IS_VAR_SET( DBG_CNTX_PROFILE );
- IS_VAR_SET( DBG_CNTX_ERROR );
- IS_VAR_SET( DBG_CNTX_ALL );
-
- IS_VAR_SET( DBG_PRIM_INFO );
- IS_VAR_SET( DBG_PRIM_WARN );
- IS_VAR_SET( DBG_PRIM_PROFILE );
- IS_VAR_SET( DBG_PRIM_ERROR );
- IS_VAR_SET( DBG_PRIM_ALL );
-
- IS_VAR_SET( DBG_TXT_INFO );
- IS_VAR_SET( DBG_TXT_WARN );
- IS_VAR_SET( DBG_TXT_PROFILE );
- IS_VAR_SET( DBG_TXT_ERROR );
- IS_VAR_SET( DBG_TXT_ALL );
-
- IS_VAR_SET( DBG_ALL_INFO );
- IS_VAR_SET( DBG_ALL_WARN );
- IS_VAR_SET( DBG_ALL_PROFILE );
- IS_VAR_SET( DBG_ALL_ERROR );
- IS_VAR_SET( DBG_ALL );
-
-#undef IS_VAR_SET
-}
-/*===========================================================================*/
-/* This function will take a pointer to a DDSURFACEDESC2 structure & display*/
-/* the parsed information using a DPF call. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf )
-{
- char buffer[256];
-
- /* Parse the flag type and write the string equivalent. */
- if ( pddpf->dwFlags & DDPF_ALPHA )
- strcat( buffer, "DDPF_ALPHA " );
- if ( pddpf->dwFlags & DDPF_ALPHAPIXELS )
- strcat( buffer, "DDPF_ALPHAPIXELS " );
- if ( pddpf->dwFlags & DDPF_ALPHAPREMULT )
- strcat( buffer, "DDPF_ALPHAPREMULT " );
- if ( pddpf->dwFlags & DDPF_BUMPLUMINANCE )
- strcat( buffer, "DDPF_BUMPLUMINANCE " );
- if ( pddpf->dwFlags & DDPF_BUMPDUDV )
- strcat( buffer, "DDPF_BUMPDUDV " );
- if ( pddpf->dwFlags & DDPF_COMPRESSED )
- strcat( buffer, "DDPF_COMPRESSED " );
- if ( pddpf->dwFlags & DDPF_FOURCC )
- strcat( buffer, "DDPF_FOURCC " );
- if ( pddpf->dwFlags & DDPF_LUMINANCE )
- strcat( buffer, "DDPF_LUMINANCE " );
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED1 )
- strcat( buffer, "DDPF_PALETTEINDEXED1 " );
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED2 )
- strcat( buffer, "DDPF_PALETTEINDEXED2 " );
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED4 )
- strcat( buffer, "DDPF_PALETTEINDEXED4 " );
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED8 )
- strcat( buffer, "DDPF_PALETTEINDEXED8 " );
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXEDTO8 )
- strcat( buffer, "DDPF_PALETTEINDEXEDTO8 " );
- if ( pddpf->dwFlags & DDPF_RGB )
- strcat( buffer, "DDPF_RGB " );
- if ( pddpf->dwFlags & DDPF_RGBTOYUV )
- strcat( buffer, "DDPF_RGBTOYUV " );
- if ( pddpf->dwFlags & DDPF_STENCILBUFFER )
- strcat( buffer, "DDPF_STENCILBUFFER " );
- if ( pddpf->dwFlags & DDPF_YUV )
- strcat( buffer, "DDPF_YUV " );
- if ( pddpf->dwFlags & DDPF_ZBUFFER )
- strcat( buffer, "DDPF_ZBUFFER " );
- if ( pddpf->dwFlags & DDPF_ZPIXELS )
- strcat( buffer, "DDPF_ZPIXELS " );
-
- DPF(( (DBG_TXT_INFO|DBG_CNTX_INFO),"%s", buffer ));
-}
-
-
-
-
-
diff --git a/src/mesa/drivers/d3d/DEBUG.H b/src/mesa/drivers/d3d/DEBUG.H
deleted file mode 100644
index 76122b91210..00000000000
--- a/src/mesa/drivers/d3d/DEBUG.H
+++ /dev/null
@@ -1,90 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#ifndef _DEBUG_H
-#define _DEBUG_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include <stdio.h>
-#include <string.h>
-#include <ddraw.h>
-#include <d3d.h>
-#include "D3DShared.h"
-/*===========================================================================*/
-/* Magic numbers. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Macros defines. */
-/*===========================================================================*/
-#define DBG_FUNC 0x00000001
-#define DBG_STATES 0x00000002
-
-#define DBG_CNTX_INFO 0x00000010
-#define DBG_CNTX_WARN 0x00000020
-#define DBG_CNTX_PROFILE 0x00000040
-#define DBG_CNTX_ERROR 0x00000080
-#define DBG_CNTX_ALL 0x000000F0
-
-#define DBG_PRIM_INFO 0x00000100
-#define DBG_PRIM_WARN 0x00000200
-#define DBG_PRIM_PROFILE 0x00000400
-#define DBG_PRIM_ERROR 0x00000800
-#define DBG_PRIM_ALL 0x00000F00
-
-#define DBG_TXT_INFO 0x00001000
-#define DBG_TXT_WARN 0x00002000
-#define DBG_TXT_PROFILE 0x00004000
-#define DBG_TXT_ERROR 0x00008000
-#define DBG_TXT_ALL 0x0000F000
-
-#define DBG_ALL_INFO 0x11111110
-#define DBG_ALL_WARN 0x22222220
-#define DBG_ALL_PROFILE 0x44444440
-#define DBG_ALL_ERROR 0x88888880
-#define DBG_ALL 0xFFFFFFFF
-
-#ifdef D3D_DEBUG
-# define DPF(arg) DebugPrint arg
-# define RIP(pH,msg,err) OutputDebugString(msg); \
- OutputDebugString(err); \
- OutputDebugString("\n"); \
- FatalShutDown(pH)
-#else
-# define DPF(arg)
-# define RIP(pH,msg,err) FatalShutDown(pH)
-#endif
-/*===========================================================================*/
-/* Type defines. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Function prototypes. */
-/*===========================================================================*/
-extern void ReadDBGEnv( void );
-extern void _cdecl DebugPrint( int mask, char *pszFormat, ... );
-extern void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf );
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-extern DWORD g_DBGMask;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
-
diff --git a/src/mesa/drivers/d3d/DbgEnv.bat b/src/mesa/drivers/d3d/DbgEnv.bat
deleted file mode 100644
index 40858e66844..00000000000
--- a/src/mesa/drivers/d3d/DbgEnv.bat
+++ /dev/null
@@ -1,25 +0,0 @@
-SET DBG_FUNC=FALSE
-
-SET DBG_CNTX_INFO=TRUE
-SET DBG_CNTX_WARN=TRUE
-SET DBG_CNTX_PROFILE=FALSE
-SET DBG_CNTX_ERROR=TRUE
-SET DBG_CNTX_ALL=TRUE
-
-SET DBG_PRIM_INFO=FALSE
-SET DBG_PRIM_WARN=FALSE
-SET DBG_PRIM_PROFILE=FALSE
-SET DBG_PRIM_ERROR=TRUE
-SET DBG_PRIM_ALL=FALSE
-
-SET DBG_TXT_INFO=FALSE
-SET DBG_TXT_WARN=TRUE
-SET DBG_TXT_PROFILE=FALSE
-SET DBG_TXT_ERROR=TRUE
-SET DBG_TXT_ALL=FALSE
-
-SET DBG_ALL_INFO=FALSE
-SET DBG_ALL_WARN=TRUE
-SET DBG_ALL_PROFILE=FALSE
-SET DBG_ALL_ERROR=TRUE
-SET DBG_ALL=FALSE
diff --git a/src/mesa/drivers/d3d/MAKEFILE b/src/mesa/drivers/d3d/MAKEFILE
deleted file mode 100644
index ad1d40dc27b..00000000000
--- a/src/mesa/drivers/d3d/MAKEFILE
+++ /dev/null
@@ -1,101 +0,0 @@
-##############################################################################
-#
-# Mesa-3.0 Makefile for DirectX 6 Driver
-#
-# By Leigh McRae
-#
-# http://www.altsoftware.com/
-#
-# Copyright (c) 1999-1998 alt.software inc. All Rights Reserved
-##############################################################################
-NAME=
-TARGET= WGL Driver (D3DHAL)
-
-D3D_DIR=$(MAKEDIR)\D3D
-TARGET_DIR=e:\WinNT\System32
-TEMP_DIR=c:\Temp
-
-SPACE=-
-LINKER=link.exe
-
-INCLUDE=$(SDKROOT)\include;$(INCLUDE)
-LIB=$(SDKROOT)\lib;$(LIB)
-##############################################################################
-CFLAGS = /c /nologo /W1 /G5 /I..\ /I..\..\Include \
- /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D"
-CPPFLAGS= /c /nologo /W1 /G5 /I..\ /I..\..\Include \
- /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D"
-
-!IF "$(DEBUG)" == "1"
-
-CFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CFLAGS)
-CPPFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CPPFLAGS)
-BUILD_TYPE=debug
-
-!ELSE
-
-CFLAGS = /MT /Ox /D "NDEBUG" $(CFLAGS)
-CPPFLAGS = /MT /Ox /D "NDEBUG" $(CPPFLAGS)
-BUILD_TYPE=release
-
-!ENDIF
-##############################################################################
-SRCS_WGL = wgl.c D3Dvbrender.c DDrawPROCS.c NULLProcs.c Debug.c
-SRCS_HAL = D3DInit.cpp D3DRaster.cpp D3DTextureMgr.cpp D3DUtils.cpp D3DCaps.cpp
-OBJS_WGL = $(SRCS_WGL:.c=.obj)
-OBJS_HAL = $(SRCS_HAL:.cpp=.obj)
-
-WINLIBS = kernel32.lib user32.lib gdi32.lib oldnames.lib
-DXLIBS =
-LIBS = $(WINLIBS) $(DXLIBS)
-###############################################################################
-# Primary Targets #
-###############################################################################
-
-default: header WGL HAL footer
-
-all: default
-
-WGL : $(OBJS_WGL)
-
-HAL : $(OBJS_HAL)
-
-install : forceit
- @echo $(SPACE)
- @echo ========================================
- @echo Install files created.
- @echo ========================================
-
-
-###############################################################################
-# Secondary Targets #
-###############################################################################
-
-clean:
- @echo ========================================
- @echo Cleaning $(TARGET)
- @del *.obj
- @del *.dep
- @del *.exp
- @del *.ncb
- @del *.plg
- @del *.lib
- @echo ========================================
-
-header:
- @echo ============================================================
- @echo Building $(TARGET) ($(BUILD_TYPE) version)
- @echo ============================================================
- @echo $(SPACE)
-
-footer:
- @echo $(SPACE)
- @echo ============================================================
- @echo DONE building $(TARGET) ($(BUILD_TYPE) version)
- @echo ============================================================
-
-forceit:
-
-
-
-
diff --git a/src/mesa/drivers/d3d/NULLProcs.h b/src/mesa/drivers/d3d/NULLProcs.h
deleted file mode 100644
index f0bbd2162dd..00000000000
--- a/src/mesa/drivers/d3d/NULLProcs.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#ifndef NULL_MESA_PROCS_INC
-#define NULL_MESA_PROCS_INC
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include "matrix.h"
-#include "context.h"
-#include "types.h"
-#include "vb.h"
-/*===========================================================================*/
-/* Macros. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Magic numbers. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Type defines. */
-/*===========================================================================*/
-void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
-void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
-GLboolean NULLSetBuffer( GLcontext *ctx, GLenum mode );
-void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height );
-GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h );
-void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] );
-void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] );
-void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] );
-void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] );
-void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] );
-void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] );
-void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] );
-/*===========================================================================*/
-/* Extern function prototypes. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-
-#endif
-
diff --git a/src/mesa/drivers/d3d/NullProcs.c b/src/mesa/drivers/d3d/NullProcs.c
deleted file mode 100644
index d6fb598074b..00000000000
--- a/src/mesa/drivers/d3d/NullProcs.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 DirectX 6 Driver */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#ifndef NULL_MESA_PROCS_INC
-#define NULL_MESA_PROCS_INC
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include "matrix.h"
-#include "context.h"
-#include "mtypes.h"
-#include "vb.h"
-/*===========================================================================*/
-/* Macros. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Magic numbers. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Type defines. */
-/*===========================================================================*/
-void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
-void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
-GLboolean NULLSetBuffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bit );
-void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height );
-GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h );
-void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] );
-void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] );
-void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] );
-void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] );
-void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] );
-void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] );
-void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] );
-/*===========================================================================*/
-/* Extern function prototypes. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-
-#endif
-
diff --git a/src/mesa/drivers/d3d/OPENGL32.DEF b/src/mesa/drivers/d3d/OPENGL32.DEF
deleted file mode 100644
index b32bd1fef81..00000000000
--- a/src/mesa/drivers/d3d/OPENGL32.DEF
+++ /dev/null
@@ -1,442 +0,0 @@
-;===========================================================================
-;
-; Mesa-3.0 DirectX 6 Driver
-;
-; By Leigh McRae
-;
-; http://www.altsoftware.com/
-;
-; Copyright (c) 1999-1998 alt.software inc. All Rights Reserved
-;===========================================================================
-NAME OpenGL32.DLL
-DESCRIPTION "Mesa-3.0 DX6 Driver Version 0.5"
-
-EXPORTS
- DllMain
- 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
-; WMesaCreateContext
-; WMesaDestroyContext
-; WMesaMakeCurrent
-; WMesaPaletteChange
-; WMesaSwapBuffers
-; OSMesaCreateContext
-; OSMesaDestroyContext
-; OSMesaMakeCurrent
-; OSMesaGetCurrentContext
-; OSMesaPixelStore
-; OSMesaGetIntegerv
-; OSMesaGetDepthBuffer
- wglCopyContext
- wglCreateContext
- wglCreateLayerContext
- wglDeleteContext
-; wglDescribeLayerPlane
- wglGetCurrentContext
- wglGetCurrentDC
-; wglGetLayerPaletteEntries
- wglGetProcAddress
- wglMakeCurrent
-; wglRealizeLayerPalette
-; wglSetLayerPaletteEntries
- wglShareLists
- wglSwapLayerBuffers
- wglUseFontBitmapsA
- wglUseFontBitmapsW
- wglUseFontOutlinesA
- wglUseFontOutlinesW
- wglChoosePixelFormat
- wglDescribePixelFormat
- wglGetPixelFormat
- wglSetPixelFormat
- wglSwapBuffers
-
-
-
diff --git a/src/mesa/drivers/d3d/WGL.C b/src/mesa/drivers/d3d/WGL.C
deleted file mode 100644
index e3b95e1de72..00000000000
--- a/src/mesa/drivers/d3d/WGL.C
+++ /dev/null
@@ -1,1262 +0,0 @@
-/*===========================================================================*/
-/* */
-/* Mesa-3.0 Makefile for DirectX 6 */
-/* */
-/* By Leigh McRae */
-/* */
-/* http://www.altsoftware.com/ */
-/* */
-/* Copyright (c) 1998-1997 alt.software inc. All Rights Reserved */
-/*===========================================================================*/
-#include "D3DMesa.h"
-/*===========================================================================*/
-/* Window managment. */
-/*===========================================================================*/
-static BOOL InitOpenGL( HINSTANCE hInst );
-static BOOL TermOpenGL( HINSTANCE hInst );
-static BOOL ResizeContext( GLcontext *ctx );
-static BOOL MakeCurrent( D3DMESACONTEXT *pContext );
-static void DestroyContext( D3DMESACONTEXT *pContext );
-static BOOL UnBindWindow( D3DMESACONTEXT *pContext );
-LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam );
-/*===========================================================================*/
-/* Mesa hooks. */
-/*===========================================================================*/
-static void SetupDDPointers( GLcontext *ctx );
-static void SetupSWDDPointers( GLcontext *ctx );
-static void SetupHWDDPointers( GLcontext *ctx );
-static void SetupNULLDDPointers( GLcontext *ctx );
-static const char *RendererString( void );
-
-/* State Management hooks. */
-static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
-static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
-static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer );
-
-/* Window Management hooks. */
-static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height );
-static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h );
-static void Flush( GLcontext *ctx );
-
-/* Span rendering hooks. */
-void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] );
-void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
-void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] );
-void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
-void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
-void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
-void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
-GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
-
-/* Primitve rendering hooks. */
-GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone );
-void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv );
-void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv );
-GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
-
-/* Texture Management hooks. */
-static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj );
-static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image );
-static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image );
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-D3DMESACONTEXT *pD3DCurrent,
- *pD3DDefault; /* Thin support context. */
-
-struct __extensions__ ext[] = {
-
- { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
- { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
- { (PROC)glBlendColorEXT, "glBlendColorExt" },
- { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
- { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
- { (PROC)glColorPointerEXT, "glColorPointerEXT" },
- { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
- { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
- { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
- { (PROC)glGetPointervEXT, "glGetPointervEXT" },
- { (PROC)glArrayElementEXT, "glArrayElementEXT" },
- { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
- { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
- { (PROC)glBindTextureEXT, "glBindTextureEXT" },
- { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
- { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
- { (PROC)glIsTextureEXT, "glIsTextureEXT" },
- { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
- { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
- { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
- { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
-};
-
-int qt_ext = sizeof(ext) / sizeof(ext[0]);
-float g_DepthScale,
- g_MaxDepth;
-/*===========================================================================*/
-/* When a process loads this DLL we will setup the linked list for context */
-/* management and create a default context that will support the API until */
-/* the user creates and binds thier own. This THIN default context is useful*/
-/* to have around. */
-/* When the process terminates we will clean up all resources here. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY DllMain( HINSTANCE hInst, DWORD reason, LPVOID reserved )
-{
- switch( reason )
- {
- case DLL_PROCESS_ATTACH:
- return InitOpenGL( hInst );
-
- case DLL_PROCESS_DETACH:
- return TermOpenGL( hInst );
- }
-
- return TRUE;
-}
-/*===========================================================================*/
-/* The first thing we do when this dll is hit is connect to the dll that has*/
-/* handles all the DirectX 6 rendering. I decided to use another dll as DX6 */
-/* is all C++ and Mesa-3.0 is C (thats a good thing). This way I can write */
-/* the DX6 in C++ and Mesa-3.0 in C without having to worry about linkage. */
-/* I feel this is easy and better then using static wrappers as it is likely */
-/* faster and it allows me to just develope the one without compiling the */
-/* other. */
-/* NOTE that at this point we don't have much other than a very thin context*/
-/* that will support the API calls only to the point of not causing the app */
-/* to crash from the API table being empty. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-static BOOL InitOpenGL( HINSTANCE hInst )
-{
- /* Allocate and clear the default context. */
- pD3DDefault = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) );
- if ( pD3DDefault == NULL )
- return FALSE;
- memset( pD3DDefault, 0, sizeof(D3DMESACONTEXT) );
-
- /* Clear the D3D vertex buffer so that values not used will be zero. This */
- /* save me from some redundant work. */
- memset( &D3DTLVertices, 0, sizeof(D3DTLVertices) );
-
- /* Update the link. We uses a circular list so that it is easy to */
- /* add and search. This context will also be used for head and tail.*/
- pD3DDefault->next = pD3DDefault;
-
- /*========================================================================*/
- /* Do all core Mesa stuff. */
- /*========================================================================*/
- pD3DDefault->gl_visual = _mesa_create_visual( TRUE,
- FALSE, /* db_flag */
- GL_FALSE, /* stereo */
- 8,8,8,8, /* r, g, b, a bits */
- 0, /* index bits */
- 16, /* depth_bits */
- 8, /* stencil_bits */
- 8,8,8,8, /* accum_bits */
- 1 );
-
- if ( pD3DDefault->gl_visual == NULL)
- {
- FREE( pD3DDefault );
- return FALSE;
- }
-
- /* Allocate a new Mesa context */
- pD3DDefault->gl_ctx = _mesa_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE );
- if ( pD3DDefault->gl_ctx == NULL )
- {
- _mesa_destroy_visual( pD3DDefault->gl_visual );
- FREE( pD3DDefault );
- return FALSE;
- }
-
- /* Allocate a new Mesa frame buffer */
- pD3DDefault->gl_buffer = _mesa_create_framebuffer( pD3DDefault->gl_visual );
- if ( pD3DDefault->gl_buffer == NULL )
- {
- _mesa_destroy_visual( pD3DDefault->gl_visual );
- _mesa_destroy_context( pD3DDefault->gl_ctx );
- FREE( pD3DDefault );
- return FALSE;
- }
- SetupDDPointers( pD3DDefault->gl_ctx );
- _mesa_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function will create a new D3D context but will not create the D3D */
-/* surfaces or even an instance of D3D (see at GetBufferSize). The only stuff*/
-/* done here is the internal Mesa stuff and some Win32 handles. */
-/*===========================================================================*/
-/* RETURN: casted pointer to the context, NULL. */
-/*===========================================================================*/
-HGLRC APIENTRY wglCreateContext( HDC hdc )
-{
- D3DMESACONTEXT *pNewContext;
- DWORD dwCoopFlags = DDSCL_NORMAL;
- RECT rectClient;
- POINT pt;
-
- /* ALLOC and clear the new context. */
- pNewContext = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) );
- if ( pNewContext == NULL )
- {
- SetLastError( 0 );
- return (HGLRC)NULL;
- }
- memset( pNewContext, 0, sizeof(D3DMESACONTEXT) );
-
- /*========================================================================*/
- /* Do all core Mesa stuff. */
- /*========================================================================*/
-
- /* TODO: support more then one visual. */
- pNewContext->gl_visual = _mesa_create_visual( TRUE,
- TRUE, /* db_flag */
- GL_FALSE, /* stereo */
- 8,8,8,8, /* r, g, b, a bits */
- 0, /* index bits */
- 16, /* depth_bits */
- 8, /* stencil_bits */
- 16,16,16,16,/* accum_bits */
- 1 );
- if ( pNewContext->gl_visual == NULL)
- {
- FREE( pNewContext );
- SetLastError( 0 );
- return (HGLRC)NULL;
- }
-
- /* Allocate a new Mesa context */
- pNewContext->gl_ctx = _mesa_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE );
- if ( pNewContext->gl_ctx == NULL )
- {
- _mesa_destroy_visual( pNewContext->gl_visual );
- FREE( pNewContext );
- SetLastError( 0 );
- return (HGLRC)NULL;
- }
-
- /* Allocate a new Mesa frame buffer */
- pNewContext->gl_buffer = _mesa_create_framebuffer( pNewContext->gl_visual );
- if ( pNewContext->gl_buffer == NULL )
- {
- _mesa_destroy_visual( pNewContext->gl_visual );
- _mesa_destroy_context( pNewContext->gl_ctx );
- FREE( pNewContext );
- SetLastError( 0 );
- return (HGLRC)NULL;
- }
-
- /*========================================================================*/
- /* Do all the driver stuff. */
- /*========================================================================*/
- pNewContext->hdc = hdc;
- pNewContext->next = pD3DDefault->next;
- pD3DDefault->next = pNewContext; /* Add to circular list. */
-
- /* Create the HAL for the new context. */
- pNewContext->pShared = InitHAL( WindowFromDC(hdc) );
-
- return (HGLRC)pNewContext;
-}
-/*===========================================================================*/
-/* This is a wrapper function that is supported by MakeCurrent. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglMakeCurrent( HDC hdc, HGLRC hglrc )
-{
- return MakeCurrent((D3DMESACONTEXT *)hglrc);
-}
-/*===========================================================================*/
-/* MakeCurrent will unbind whatever context is current (if any) & then bind */
-/* the supplied context. A context that is bound has it's window proc hooked*/
-/* with the wglMonitorProc and the context pointer is saved in pD3DCurrent. */
-/* Once the context is bound we update the Mesa-3.0 hooks (SetDDPointers) and*/
-/* the viewport (Mesa-.30 and DX6). */
-/* */
-/* TODO: this function can't fail. */
-/*===========================================================================*/
-/* RETURN: TRUE */
-/*===========================================================================*/
-static BOOL MakeCurrent( D3DMESACONTEXT *pContext )
-{
- D3DMESACONTEXT *pNext;
-
- /*====================================================================*/
- /* This is a special case that is a request to have no context bound. */
- /*====================================================================*/
- if ( pContext == NULL )
- {
- /* Walk the whole list. We start and end at the Default context. */
- for( pNext = pD3DDefault->next; pNext != pD3DDefault; pNext = pNext->next )
- UnBindWindow( pNext );
-
- return TRUE;
- }
-
- /*=================================================*/
- /* Make for a fast redundant use of this function. */
- /*=================================================*/
- if ( pD3DCurrent == pContext )
- return TRUE;
-
- /*=============================*/
- /* Unbind the current context. */
- /*=============================*/
- UnBindWindow( pD3DCurrent );
-
- /*=====================================*/
- /* Let Mesa-3.0 we have a new context. */
- /*=====================================*/
- SetupDDPointers( pContext->gl_ctx );
- _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer );
-
- /* We are done so set the internal current context. */
- if ( pContext != pD3DDefault )
- {
- ResizeContext( pContext->gl_ctx );
- pContext->hOldProc = (WNDPROC)GetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC );
- SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)wglMonitorProc );
- }
- pD3DCurrent = pContext;
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function will only return the current window size. I have re-done */
-/* this function so that it doesn't check the current size and react to it as*/
-/* I should be able to have all the react code in the WM_SIZE message. The */
-/* old version would check the current window size and create/resize the HAL */
-/* surfaces if they have changed. I needed to delay the creation if the */
-/* surfaces because sometimes I wouldn't have a window size so this is where */
-/* I delayed it. If you are reading this then all went ok! */
-/* The default context will return a zero sized window and I'm not sure if */
-/* this is ok at this point (TODO). */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- /* Fall through for the default because that is one of the uses for it. */
- if ( pContext == pD3DDefault )
- {
- *width = 0;
- *height = 0;
- }
- else
- {
- *width = pContext->pShared->dwWidth;
- *height = pContext->pShared->dwHeight;
- }
-}
-/*===========================================================================*/
-/* */
-/* */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static BOOL ResizeContext( GLcontext *ctx )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx,
- *pCurrentTemp;
- RECT rectClient;
- POINT pt;
- DWORD dwWidth,
- dwHeight;
- static BOOL bDDrawLock = FALSE;
-
- /* Make sure we have some values. */
- if ( (pContext->hdc == NULL ) ||
- (pContext->pShared->hwnd != WindowFromDC(pContext->hdc)) ||
- (pContext == pD3DDefault) )
- return FALSE;
-
- /* Having problems with DDraw sending resize messages before I was done. */
- if( bDDrawLock == TRUE )
- return FALSE;
-
- // TODO: don't think I need this anymore.
- pCurrentTemp = pD3DCurrent;
- pD3DCurrent = pD3DDefault;
- bDDrawLock = TRUE;
-
- /* Get the current window dimentions. */
- UpdateScreenPosHAL( pContext->pShared );
- dwWidth = pContext->pShared->rectW.right - pContext->pShared->rectW.left;
- dwHeight = pContext->pShared->rectW.bottom - pContext->pShared->rectW.top;
-
- /* Is the size of the OffScreen Render different? */
- if ( (dwWidth != pContext->pShared->dwWidth) || (dwHeight != pContext->pShared->dwHeight) )
- {
- /* Create all the D3D surfaces and device. */
- CreateHAL( pContext->pShared );
-
- /* I did this so that software rendering would still work as */
- /* I don't need to scale the z values twice. */
- g_DepthScale = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF);
- g_MaxDepth = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF);
- gl_DepthRange( pContext->gl_ctx, ctx->Viewport.Near, ctx->Viewport.Far );
-
- /* Make sure we have a viewport. */
- gl_Viewport( pContext->gl_ctx, 0, 0, dwWidth, dwHeight );
-
- /* Update Mesa as we might have changed from SW <-> HW. */
- SetupDDPointers( pContext->gl_ctx );
- _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer );
-
- /* If we are in HW we need to load the current texture if there is one already. */
- // if ( (ctx->Texture.Set[ctx->Texture.CurrentSet].Current != NULL) &&
- // (pContext->pShared->bHardware == TRUE) )
- // {
- // CreateTMgrHAL( pContext->pShared,
- // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name,
- // 0,
- // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format,
- // (RECT *)NULL,
- // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Width,
- // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Height,
- // TM_ACTION_BIND,
- // (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Data );
- // }
- }
-
- // TODO: don't think I need this anymore.
- pD3DCurrent = pCurrentTemp;
- bDDrawLock = FALSE;
-
- return TRUE;
-}
-
-/*===========================================================================*
-/* This function will Blt the render buffer to the PRIMARY surface. I repeat*/
-/* this code for the other SwapBuffer like functions and the flush (didn't */
-/* want the function calling overhead). Thsi could have been a macro... */
-/* */
-/* TODO: there are some problems with viewport/scissoring. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglSwapBuffers( HDC hdc )
-{
- /* Fall through for the default because that is one of the uses for it. */
- if ( pD3DCurrent == pD3DDefault )
- return FALSE;
-
- SwapBuffersHAL( pD3DCurrent->pShared );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* Same as wglSwapBuffers. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY SwapBuffers( HDC hdc )
-{
- /* Fall through for the default because that is one of the uses for it. */
- if ( pD3DCurrent == pD3DDefault )
- return FALSE;
-
- SwapBuffersHAL( pD3DCurrent->pShared );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This should be ok as none of the SwapBuffers will cause a redundant Blt */
-/* as none of my Swap functions will call flush. This should also allow */
-/* sinlge buffered applications to work (not really worried though). Some */
-/* applications may flush then swap but then this is there fault IMHO. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void Flush( GLcontext *ctx )
-{
- /* Fall through for the default because that is one of the uses for it. */
- if ( pD3DCurrent == pD3DDefault )
- return;
-
- SwapBuffersHAL( pD3DCurrent->pShared );
-}
-/*===========================================================================*/
-/* For now this function will ignore the supplied PF. If I'm going to allow */
-/* the user to choice the mode and device at startup I'm going to have to do */
-/* something different. */
-/* */
-/* TODO: use the linked list of modes to build a pixel format to be returned */
-/* to the caller. */
-/*===========================================================================*/
-/* RETURN: 1. */
-/*===========================================================================*/
-int APIENTRY wglChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd )
-{
- return 1;
-}
-/*===========================================================================*/
-/* See wglChoosePixelFormat. */
-/*===========================================================================*/
-/* RETURN: 1. */
-/*===========================================================================*/
-int APIENTRY ChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd )
-{
- return wglChoosePixelFormat(hdc,ppfd);
-}
-/*===========================================================================*/
-/* This function (for now) returns a static PF everytime. This is just to */
-/* allow things to continue. */
-/*===========================================================================*/
-/* RETURN: 1. */
-/*===========================================================================*/
-int APIENTRY wglDescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd )
-{
- static PIXELFORMATDESCRIPTOR pfd =
- {
- sizeof(PIXELFORMATDESCRIPTOR), /* size */
- 1, /* version */
- PFD_SUPPORT_OPENGL |
- PFD_DRAW_TO_WINDOW |
- PFD_DOUBLEBUFFER, /* support double-buffering */
- PFD_TYPE_RGBA, /* color type */
- 16, /* prefered color depth */
- 0, 0, 0, 0, 0, 0, /* color bits (ignored) */
- 0, /* no alpha buffer */
- 0, /* alpha bits (ignored) */
- 0, /* no accumulation buffer */
- 0, 0, 0, 0, /* accum bits (ignored) */
- 16, /* depth buffer */
- 0, /* no stencil buffer */
- 0, /* no auxiliary buffers */
- PFD_MAIN_PLANE, /* main layer */
- 0, /* reserved */
- 0, 0, 0, /* no layer, visible, damage masks */
- };
-
- /* Return the address of this static PF if one was requested. */
- if ( ppfd != NULL )
- memcpy( ppfd, &pfd, sizeof(PIXELFORMATDESCRIPTOR) );
-
- return 1;
-}
-/*===========================================================================*/
-/* See wglDescribePixelFormat. */
-/*===========================================================================*/
-/* RETURN: 1. */
-/*===========================================================================*/
-int APIENTRY DescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd )
-{
- return wglDescribePixelFormat(hdc,iPixelFormat,nBytes,ppfd);
-}
-/*===========================================================================*/
-/* This function will always return 1 for now. Just to allow for support. */
-/*===========================================================================*/
-/* RETURN: 1. */
-/*===========================================================================*/
-int APIENTRY wglGetPixelFormat( HDC hdc )
-{
- return 1;
-}
-/*===========================================================================*/
-/* See wglGetPixelFormat. */
-/*===========================================================================*/
-/* RETURN: 1. */
-/*===========================================================================*/
-int APIENTRY GetPixelFormat( HDC hdc )
-{
- return wglGetPixelFormat(hdc);
-}
-/*===========================================================================*/
-/* This will aways work for now. */
-/*===========================================================================*/
-/* RETURN: TRUE. */
-/*===========================================================================*/
-BOOL APIENTRY wglSetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd )
-{
- return TRUE;
-}
-/*===========================================================================*/
-/* See wglSetPixelFormat. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY SetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd )
-{
- return wglSetPixelFormat(hdc,iPixelFormat,ppfd);
-}
-/*===========================================================================*/
-/* This is a wrapper function that is supported by my own internal function.*/
-/* that takes my own D3D Mesa context structure. This so I can reuse the */
-/* function (no need for speed). */
-/*===========================================================================*/
-/* RETURN: TRUE. */
-/*===========================================================================*/
-BOOL APIENTRY wglDeleteContext( HGLRC hglrc )
-{
- DestroyContext( (D3DMESACONTEXT *)hglrc );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* Simple getter function that uses a cast. */
-/*===========================================================================*/
-/* RETURN: casted pointer to the context, NULL. */
-/*===========================================================================*/
-HGLRC APIENTRY wglGetCurrentContext( VOID )
-{
- return (pD3DCurrent) ? (HGLRC)pD3DCurrent : (HGLRC)NULL;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask )
-{
- SetLastError( 0 );
- return FALSE;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: NULL. */
-/*===========================================================================*/
-HGLRC APIENTRY wglCreateLayerContext( HDC hdc,int iLayerPlane )
-{
- SetLastError( 0 );
- return (HGLRC)NULL;
-}
-/*===========================================================================*/
-/* Simple getter function. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-HDC APIENTRY wglGetCurrentDC( VOID )
-{
- return (pD3DCurrent) ? pD3DCurrent->hdc : (HDC)NULL;
-}
-/*===========================================================================*/
-/* Simply call that searches the supported extensions for a match & returns */
-/* the pointer to the function that lends support. */
-/*===========================================================================*/
-/* RETURN: pointer to API call, NULL. */
-/*===========================================================================*/
-PROC APIENTRY wglGetProcAddress( LPCSTR lpszProc )
-{
- int index;
-
- for( index = 0; index < qt_ext; index++ )
- if( !strcmp(lpszProc,ext[index].name) )
- return ext[index].proc;
-
- SetLastError( 0 );
- return NULL;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglShareLists( HGLRC hglrc1, HGLRC hglrc2 )
-{
- SetLastError( 0 );
- return FALSE;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglUseFontBitmaps( HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase )
-{
- SetLastError( 0 );
- return FALSE;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglUseFontBitmapsW( HDC hdc,DWORD first,DWORD count,DWORD listBase )
-{
- SetLastError( 0 );
- return FALSE;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglUseFontOutlinesA( HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf )
-{
- SetLastError( 0 );
- return FALSE;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglUseFontOutlinesW( HDC hdc,DWORD first,DWORD count, DWORD listBase,FLOAT deviation, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf )
-{
- SetLastError( 0 );
- return FALSE ;
-}
-/*===========================================================================*/
-/* No support. */
-/*===========================================================================*/
-/* RETURN: FALSE. */
-/*===========================================================================*/
-BOOL APIENTRY wglSwapLayerBuffers( HDC hdc, UINT fuPlanes )
-{
- SetLastError( 0 );
- return FALSE;
-}
-/*===========================================================================*/
-/* This function will be hooked into the window that has been bound. Right */
-/* now it is used to track the window size and position. Also the we clean */
-/* up the currrent context when the window is close/destroyed. */
-/* */
-/* TODO: there might be something wrong here as some games (Heretic II) don't*/
-/* track the window quit right. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam )
-{
- WNDPROC hOldProc;
- GLint width,
- height;
-
- switch( message )
- {
-// case WM_PAINT:
-// break;
-// case WM_ACTIVATE:
-// break;
-// case WM_SHOWWINDOW:
-// break;
-
- case UM_FATALSHUTDOWN:
- /* Support the API until we die... */
- MakeCurrent( pD3DDefault );
- break;
-
- case WM_MOVE:
- case WM_DISPLAYCHANGE:
- case WM_SIZE:
- ResizeContext( pD3DCurrent->gl_ctx );
- break;
-
- case WM_CLOSE:
- case WM_DESTROY:
- /* Support the API until we die... */
- hOldProc = pD3DCurrent->hOldProc;
- DestroyContext( pD3DCurrent );
- return (hOldProc)(hwnd,message,wParam,lParam);
- }
-
- return (pD3DCurrent->hOldProc)(hwnd,message,wParam,lParam);
-}
-
-/**********************************************************************/
-/***** Miscellaneous device driver funcs *****/
-/**********************************************************************/
-
-/*===========================================================================*/
-/* Not reacting to this as I'm only supporting drawing to the back buffer */
-/* right now. */
-/*===========================================================================*/
-/* RETURN: TRUE. */
-/*===========================================================================*/
-static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer )
-{
- if (buffer == GL_BACK_LEFT)
- return GL_TRUE;
- else
- return GL_FALSE;
-}
-/*===========================================================================*/
-/* This proc will be called by Mesa when the viewport has been set. So if */
-/* we have a context and it isn't the default then we should let D3D know of */
-/* the change. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- RECT rect;
-
- /* Make sure we can set a viewport. */
- if ( pContext->pShared && (pContext != pD3DDefault) )
- {
- // TODO: might be needed.
- UpdateScreenPosHAL( pContext->pShared );
- rect.left = x;
- rect.right = x + w;
- rect.top = y;
- rect.bottom = y + h;
-
- // TODO: shared struct should make this call smaller
- SetViewportHAL( pContext->pShared, &rect, 0.0F, 1.0F );
- }
-}
-/*===========================================================================*/
-/* This function could be better I guess but I decided just to grab the four*/
-/* components and store then seperately. Makes it easier to use IMHO. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- pContext->aClear = a;
- pContext->bClear = b;
- pContext->gClear = g;
- pContext->rClear = r;
-}
-/*===========================================================================*/
-/* This function could be better I guess but I decided just to grab the four*/
-/* components and store then seperately. Makes it easier to use IMHO. */
-/* (is there an echo in here?) */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- pContext->aCurrent = a;
- pContext->bCurrent = b;
- pContext->gCurrent = g;
- pContext->rCurrent = r;
-}
-/*===========================================================================*/
-/* */
-/* */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static const char *RendererString( void )
-{
- static char pszRender[64];
-
- strcpy( pszRender, "altD3D " );
-
- if ( pD3DCurrent->pShared->bHardware )
- strcat( pszRender, "(HW)");
- else
- strcat( pszRender, "(SW)");
-
- return (const char *)pszRender;
-}
-/*===========================================================================*/
-/* This function will choose which set of pointers Mesa will use based on */
-/* whether we hard using hardware or software. I have added another set of */
-/* pointers that will do nothing but stop the API from crashing. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void SetupDDPointers( GLcontext *ctx )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- // TODO: write a generic NULL support for the span render.
- if ( pContext->pShared && pContext->pShared->bHardware )
- {
- ctx->Driver.UpdateState = SetupHWDDPointers;
- }
- else if ( pContext == pD3DDefault )
- {
- ctx->Driver.UpdateState = SetupNULLDDPointers;
- }
- else
- {
- ctx->Driver.UpdateState = SetupSWDDPointers;
- }
-}
-/*===========================================================================*/
-/* This function will populate all the Mesa driver hooks. This version of */
-/* hooks will do nothing but support the API when we don't have a valid */
-/* context bound. This is mostly for applications that don't behave right */
-/* and also to help exit as clean as possable when we have a FatalError. */
-/*===========================================================================*/
-/* RETURN: pointer to the specific function. */
-/*===========================================================================*/
-static void SetupNULLDDPointers( GLcontext *ctx )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- /* Initialize all the pointers in the DD struct. Do this whenever */
- /* a new context is made current or we change buffers via set_buffer! */
- ctx->Driver.UpdateState = SetupNULLDDPointers;
-
- /* State management hooks. */
- ctx->Driver.Color = NULLSetColor;
- ctx->Driver.ClearColor = NULLClearColor;
- ctx->Driver.Clear = NULLClearBuffers;
- ctx->Driver.SetBuffer = NULLSetBuffer;
-
- /* Window management hooks. */
- ctx->Driver.GetBufferSize = NULLGetBufferSize;
-
- /* Primitive rendering hooks. */
- ctx->Driver.TriangleFunc = NULL;
- ctx->Driver.RenderVB = NULL;
-
- /* Pixel/span writing functions: */
- ctx->Driver.WriteRGBASpan = NULLWrSpRGBA;
- ctx->Driver.WriteRGBSpan = NULLWrSpRGB;
- ctx->Driver.WriteMonoRGBASpan = NULLWrSpRGBAMono;
- ctx->Driver.WriteRGBAPixels = NULLWrPiRGBA;
- ctx->Driver.WriteMonoRGBAPixels = NULLWrPiRGBAMono;
-
- /* Pixel/span reading functions: */
- ctx->Driver.ReadRGBASpan = NULLReSpRGBA;
- ctx->Driver.ReadRGBAPixels = NULLRePiRGBA;
-
- /* Misc. hooks. */
- ctx->Driver.RendererString = RendererString;
-}
-/*===========================================================================*/
-/* This function will populate all the Mesa driver hooks. There are two of */
-/* these functions. One if we have hardware support and one is there is only*/
-/* software. These functions will be called by Mesa and by the wgl.c when we*/
-/* have resized (or created) the buffers. The thing is that if a window gets*/
-/* resized we may loose hardware support or gain it... */
-/*===========================================================================*/
-/* RETURN: pointer to the specific function. */
-/*===========================================================================*/
-static void SetupSWDDPointers( GLcontext *ctx )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- /* Initialize all the pointers in the DD struct. Do this whenever */
- /* a new context is made current or we change buffers via set_buffer! */
- ctx->Driver.UpdateState = SetupSWDDPointers;
-
- /* State management hooks. */
- ctx->Driver.Color = SetColor;
- ctx->Driver.ClearColor = ClearColor;
- ctx->Driver.Clear = ClearBuffers;
- ctx->Driver.SetBuffer = SetBuffer;
-
- /* Window management hooks. */
- ctx->Driver.GetBufferSize = GetBufferSize;
- ctx->Driver.Viewport = SetViewport;
-
- /* Primitive rendering hooks. */
- ctx->Driver.TriangleFunc = NULL;
- ctx->Driver.RenderVB = NULL;
-
- /* Texture management hooks. */
-
- /* Pixel/span writing functions: */
- ctx->Driver.WriteRGBASpan = WSpanRGBA;
- ctx->Driver.WriteRGBSpan = WSpanRGB;
- ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono;
- ctx->Driver.WriteRGBAPixels = WPixelsRGBA;
- ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono;
-
- /* Pixel/span reading functions: */
- ctx->Driver.ReadRGBASpan = RSpanRGBA;
- ctx->Driver.ReadRGBAPixels = RPixelsRGBA;
-
- /* Misc. hooks. */
- ctx->Driver.Flush = Flush;
- ctx->Driver.RendererString = RendererString;
-}
-/*===========================================================================*/
-/* This function will populate all the Mesa driver hooks. There are two of */
-/* these functions. One if we have hardware support and one is there is only*/
-/* software. These functions will be called by Mesa and by the wgl.c when we*/
-/* have resized (or created) the buffers. The thing is that if a window gets*/
-/* resized we may loose hardware support or gain it... */
-/*===========================================================================*/
-/* RETURN: pointer to the specific function. */
-/*===========================================================================*/
-static void SetupHWDDPointers( GLcontext *ctx )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- /* Initialize all the pointers in the DD struct. Do this whenever */
- /* a new context is made current or we change buffers via set_buffer! */
- ctx->Driver.UpdateState = SetupHWDDPointers;
-
- /* State management hooks. */
- ctx->Driver.Color = SetColor;
- ctx->Driver.ClearColor = ClearColor;
- ctx->Driver.Clear = ClearBuffersD3D;
- ctx->Driver.SetBuffer = SetBuffer;
-
- /* Window management hooks. */
- ctx->Driver.GetBufferSize = GetBufferSize;
- ctx->Driver.Viewport = SetViewport;
-
- /* Primitive rendering hooks. */
- ctx->Driver.TriangleFunc = RenderOneTriangle;
- ctx->Driver.LineFunc = RenderOneLine;
- ctx->Driver.RenderVB = RenderVertexBuffer;
-
- /* Pixel/span writing functions: */
- ctx->Driver.WriteRGBASpan = WSpanRGBA;
- ctx->Driver.WriteRGBSpan = WSpanRGB;
- ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono;
- ctx->Driver.WriteRGBAPixels = WPixelsRGBA;
- ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono;
-
- /* Pixel/span reading functions: */
- ctx->Driver.ReadRGBASpan = RSpanRGBA;
- ctx->Driver.ReadRGBAPixels = RPixelsRGBA;
-
- /* Texture management hooks. */
- // ctx->Driver.BindTexture = TextureBind;
- ctx->Driver.TexImage = TextureLoad;
- ctx->Driver.TexSubImage = TextureSubImage;
-
- /* Misc. hooks. */
- ctx->Driver.Flush = Flush;
- ctx->Driver.RendererString = RendererString;
-}
-/*===========================================================================*/
-/* This function will release all resources used by the DLL. Every context */
-/* will be clobbered by releaseing all driver desources and then freeing the */
-/* context memory. Most all the work is done in DestroyContext. */
-/*===========================================================================*/
-/* RETURN: TRUE. */
-/*===========================================================================*/
-static BOOL TermOpenGL( HINSTANCE hInst )
-{
- D3DMESACONTEXT *pTmp,
- *pNext;
-
- /* Just incase we are still getting paint msg. */
- MakeCurrent( pD3DDefault );
-
- /* Walk the list until we get back to the default context. */
- for( pTmp = pD3DDefault->next; pTmp != pD3DDefault; pTmp = pNext )
- {
- pNext = pTmp->next;
- DestroyContext( pTmp );
- }
- DestroyContext( pD3DDefault );
-
- return TRUE;
-}
-/*===========================================================================*/
-/* This function is an internal function that will clean up all the Mesa */
-/* context bound to this D3D context. Also any D3D stuff that this context */
-/* uses will be unloaded. */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-static void DestroyContext( D3DMESACONTEXT *pContext )
-{
- D3DMESACONTEXT *pTmp;
-
- /* Walk the list until we find the context before this one. */
- for( pTmp = pD3DDefault; pTmp && (pTmp->next != pContext); pTmp = pTmp->next )
- if ( pTmp == pTmp->next )
- break;
-
- /* If we never found it it must already be deleted. */
- if ( pTmp->next != pContext )
- return;
-
- /* Make sure we are not using this context. */
- if ( pContext == pD3DCurrent )
- MakeCurrent( pD3DDefault );
-
- /* Free the Mesa stuff. */
- if ( pContext->gl_visual )
- {
- _mesa_destroy_visual( pContext->gl_visual );
- pContext->gl_visual = NULL;
- }
- if ( pContext->gl_buffer )
- {
- _mesa_destroy_framebuffer( pContext->gl_buffer );
- pContext->gl_buffer = NULL;
- }
- if ( pContext->gl_ctx )
- {
- _mesa_destroy_context( pContext->gl_ctx );
- pContext->gl_ctx = NULL;
- }
-
- /* Now dump the D3D. */
- if ( pContext->pShared )
- TermHAL( pContext->pShared );
-
- /* Update the previous context's link. */
- pTmp->next = pContext->next;
-
- /* Gonzo. */
- FREE( pContext );
-}
-/*===========================================================================*/
-/* This function will pull the supplied context away from Win32. Basicly it*/
-/* will remove the hook from the window Proc. */
-/* */
-/* TODO: might want to serialize this stuff... */
-/*===========================================================================*/
-/* RETURN: TRUE, FALSE. */
-/*===========================================================================*/
-static BOOL UnBindWindow( D3DMESACONTEXT *pContext )
-{
- if ( pContext == NULL )
- return FALSE;
-
- if ( pContext == pD3DDefault )
- return TRUE;
-
- /* Make sure we always have a context bound. */
- if ( pContext == pD3DCurrent )
- pD3DCurrent = pD3DDefault;
-
- SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)pContext->hOldProc );
- pContext->hOldProc = NULL;
-
- return TRUE;
-}
-/*===========================================================================*/
-/* There are two cases that allow for a faster clear when we know that the */
-/* whole buffer is cleared and that there is no clipping. */
-/*===========================================================================*/
-/* RETURN: the original mask with the bits cleared that represents the buffer*
-/* or buffers we just cleared. */
-/*===========================================================================*/
-GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- DWORD dwFlags = 0;
-
- if ( mask & GL_COLOR_BUFFER_BIT )
- {
- dwFlags |= D3DCLEAR_TARGET;
- mask &= ~GL_COLOR_BUFFER_BIT;
- }
- if ( mask & GL_DEPTH_BUFFER_BIT )
- {
- dwFlags |= D3DCLEAR_ZBUFFER;
- mask &= ~GL_DEPTH_BUFFER_BIT;
- }
- if ( dwFlags == 0 )
- return mask;
-
- ClearHAL( pContext->pShared,
- dwFlags,
- all,
- x, y,
- width, height,
- ((pContext->aClear<<24) | (pContext->rClear<<16) | (pContext->gClear<<8) | (pContext->bClear)),
- ctx->Depth.Clear,
- 0 );
-
- return mask;
-}
-
-
-
-/*===========================================================================*/
-/* TEXTURE MANAGER: ok here is how I did textures. Mesa-3.0 will keep track*/
-/* of all the textures for us. So this means that at anytime we can go to */
-/* the Mesa context and get the current texture. With this in mind this is */
-/* what I did. I really don't care about what textures get or are loaded */
-/* until I actually have to draw a tri that is textured. At this point I */
-/* must have the texture so I demand the texture by destorying all other */
-/* texture surfaces if need be and load the current one. This allows for the*/
-/* best preformance on low memory cards as time is not wasted loading and */
-/* unload textures. */
-/*===========================================================================*/
-
-
-
-
-
-/*===========================================================================*/
-/* TextureLoad will try and create a D3D surface from the supplied texture */
-/* object if its level 0 (first). The surface will be fully filled with the */
-/* texture. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- /* TODO: only doing first LOD. */
- if ( (ctx->DriverCtx == NULL) || (level != 0) )
- return;
-
- CreateTMgrHAL( pContext->pShared,
- tObj->Name,
- level,
- tObj->Image[level]->Format,
- (RECT *)NULL,
- tObj->Image[level]->Width,
- tObj->Image[level]->Height,
- TM_ACTION_LOAD,
- (void *)tObj->Image[level]->Data );
-}
-/*===========================================================================*/
-/* TextureBind make sure that the texture is on the card. Thats it. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
-
- /* TODO: only doing first LOD. */
- if ( (tObj->Image[0] == NULL) || (ctx->DriverCtx == NULL) )
- return;
-
- CreateTMgrHAL( pContext->pShared,
- tObj->Name,
- 0,
- tObj->Image[0]->Format,
- (RECT *)NULL,
- tObj->Image[0]->Width,
- tObj->Image[0]->Height,
- TM_ACTION_BIND,
- (void *)tObj->Image[0]->Data );
-}
-/*===========================================================================*/
-/* TextureSubImage will make sure that the texture being updated is updated */
-/* if its on the card. */
-/*===========================================================================*/
-/* RETURN: */
-/*===========================================================================*/
-static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image )
-{
- D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
- RECT rect;
-
- /* TODO: only doing first LOD. */
- if ( (ctx->DriverCtx == NULL) || (level > 0) )
- return;
-
- /* Create a dirty rectangle structure. */
- rect.left = xoffset;
- rect.right = xoffset + width;
- rect.top = yoffset;
- rect.bottom = yoffset + height;
-
- CreateTMgrHAL( pContext->pShared,
- tObj->Name,
- 0,
- tObj->Image[0]->Format,
- &rect,
- tObj->Image[0]->Width,
- tObj->Image[0]->Height,
- TM_ACTION_UPDATE,
- (void *)tObj->Image[0]->Data );
-}
-
diff --git a/src/mesa/drivers/d3d/d3dText.h b/src/mesa/drivers/d3d/d3dText.h
deleted file mode 100644
index 9ff0650518b..00000000000
--- a/src/mesa/drivers/d3d/d3dText.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef D3D_TEXT_H
-#define D3D_TEXT_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*===========================================================================*/
-/* Includes. */
-/*===========================================================================*/
-#include <windows.h>
-#include <ddraw.h>
-#include <d3d.h>
-/*===========================================================================*/
-/* Magic numbers. */
-/*===========================================================================*/
-#define D3DLTEXT_BITSUSED 0xFFFFFFFF
-#define MAX_VERTICES 700 // (14*40) 14 per character, 40 characters
-/*===========================================================================*/
-/* Macros defines. */
-/*===========================================================================*/
-/*===========================================================================*/
-/* Type defines. */
-/*===========================================================================*/
-typedef struct _d3dText_metrics
-{
- float fntYScale,
- fntXScale;
-
- int fntXSpacing,
- fntYSpacing;
-
- DWORD dwColor;
- LPDIRECT3DDEVICE3 lpD3DDevice;
-
-} D3DFONTMETRICS, *PD3DFONTMETRICS;
-/*===========================================================================*/
-/* Function prototypes. */
-/*===========================================================================*/
-extern BOOL InitD3DText( void );
-extern void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics );
-extern void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics );
-/*===========================================================================*/
-/* Global variables. */
-/*===========================================================================*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
index d11241b2b21..3c8c6c256e6 100644
--- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c
+++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
@@ -25,24 +25,16 @@
#include <pthread.h>
-#include <direct/messages.h>
-#include <direct/interface.h>
-#include <direct/mem.h>
-
#include <directfb.h>
#include <directfb_version.h>
-#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r)))
-#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \
- DIRECTFB_MINOR_VERSION, \
- DIRECTFB_MICRO_VERSION )
+#include <directfbgl.h>
+#include <direct/mem.h>
+#include <direct/messages.h>
+#include <direct/interface.h>
-#ifdef CLAMP
-# undef CLAMP
-#endif
-
-#include "GL/directfbgl.h"
+#undef CLAMP
#include "glheader.h"
#include "buffers.h"
#include "context.h"
@@ -62,6 +54,12 @@
#include "drivers/common/driverfuncs.h"
+#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r)))
+#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \
+ DIRECTFB_MINOR_VERSION, \
+ DIRECTFB_MICRO_VERSION )
+
+
static DFBResult
Probe( void *data );
@@ -79,7 +77,7 @@ DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBGL, Mesa )
typedef struct {
int ref; /* reference counter */
- DFBBoolean locked;
+ int locked;
IDirectFBSurface *surface;
DFBSurfacePixelFormat format;
@@ -87,8 +85,8 @@ typedef struct {
int height;
struct {
- __u8 *start;
- __u8 *end;
+ GLubyte *start;
+ GLubyte *end;
int pitch;
} video;
@@ -185,12 +183,14 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz )
IDirectFBSurface *surface;
int width = 0;
int height = 0;
- DFBResult err;
+ DFBResult ret;
DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
- if (data->locked)
- return DFB_LOCKED;
+ if (data->locked) {
+ data->locked++;
+ return DFB_OK;
+ }
if (directfbgl_lock())
return DFB_LOCKED;
@@ -198,11 +198,12 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz )
surface = data->surface;
surface->GetSize( surface, &width, &height );
- err = surface->Lock( surface, DSLF_READ | DSLF_WRITE,
+ ret = surface->Lock( surface, DSLF_READ | DSLF_WRITE,
(void*)&data->video.start, &data->video.pitch );
- if (err != DFB_OK) {
+ if (ret) {
D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" );
- return err;
+ directfbgl_unlock();
+ return ret;
}
data->video.end = data->video.start + (height-1) * data->video.pitch;
@@ -212,12 +213,13 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz )
&data->framebuffer, &data->framebuffer );
if (data->width != width || data->height != height) {
+ _mesa_resize_framebuffer( &data->context,
+ &data->framebuffer, width, height );
data->width = width;
- data->height = height;
- _mesa_ResizeBuffersMESA();
+ data->height = height;
}
- data->locked = DFB_TRUE;
+ data->locked++;
return DFB_OK;
}
@@ -229,14 +231,14 @@ IDirectFBGL_Mesa_Unlock( IDirectFBGL *thiz )
if (!data->locked)
return DFB_OK;
-
- _mesa_make_current( NULL, NULL, NULL );
+
+ if (--data->locked == 0) {
+ _mesa_make_current( NULL, NULL, NULL );
- data->surface->Unlock( data->surface );
-
- directfbgl_unlock();
+ data->surface->Unlock( data->surface );
- data->locked = DFB_FALSE;
+ directfbgl_unlock();
+ }
return DFB_OK;
}
@@ -269,12 +271,32 @@ IDirectFBGL_Mesa_GetAttributes( IDirectFBGL *thiz,
attributes->accum_green_size = visual->accumGreenBits;
attributes->accum_blue_size = visual->accumBlueBits;
attributes->accum_alpha_size = visual->accumAlphaBits;
- attributes->double_buffer = (caps & DSCAPS_FLIPPING) ? 1 : 0;
+ attributes->double_buffer = ((caps & DSCAPS_FLIPPING) != 0);
attributes->stereo = (visual->stereoMode != 0);
return DFB_OK;
}
+#if DIRECTFBGL_INTERFACE_VERSION >= 1
+static DFBResult
+IDirectFBGL_Mesa_GetProcAddress( IDirectFBGL *thiz,
+ const char *name,
+ void **ret_address )
+{
+ DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
+
+ if (!name)
+ return DFB_INVARG;
+
+ if (!ret_address)
+ return DFB_INVARG;
+
+ *ret_address = _glapi_get_proc_address( name );
+
+ return (*ret_address) ? DFB_OK : DFB_UNSUPPORTED;
+}
+#endif
+
/* exported symbols */
@@ -287,6 +309,8 @@ Probe( void *data )
static DFBResult
Construct( IDirectFBGL *thiz, IDirectFBSurface *surface )
{
+ DFBResult ret;
+
/* Initialize global resources. */
if (directfbgl_init())
return DFB_INIT;
@@ -295,12 +319,17 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface )
DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL );
/* Initialize interface data. */
- data->ref = 1;
- data->surface = surface;
+ data->ref = 1;
- surface->AddRef( surface );
- surface->GetPixelFormat( surface, &data->format );
- surface->GetSize( surface, &data->width, &data->height );
+ /* Duplicate destination surface. */
+ ret = surface->GetSubSurface( surface, NULL, &data->surface );
+ if (ret) {
+ IDirectFBGL_Mesa_Destruct( thiz );
+ return ret;
+ }
+
+ data->surface->GetPixelFormat( data->surface, &data->format );
+ data->surface->GetSize( data->surface, &data->width, &data->height );
/* Configure visual. */
if (!directfbgl_init_visual( &data->visual, data->format )) {
@@ -318,11 +347,14 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface )
}
/* Assign interface pointers. */
- thiz->AddRef = IDirectFBGL_Mesa_AddRef;
- thiz->Release = IDirectFBGL_Mesa_Release;
- thiz->Lock = IDirectFBGL_Mesa_Lock;
- thiz->Unlock = IDirectFBGL_Mesa_Unlock;
- thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes;
+ thiz->AddRef = IDirectFBGL_Mesa_AddRef;
+ thiz->Release = IDirectFBGL_Mesa_Release;
+ thiz->Lock = IDirectFBGL_Mesa_Lock;
+ thiz->Unlock = IDirectFBGL_Mesa_Unlock;
+ thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes;
+#if DIRECTFBGL_INTERFACE_VERSION >= 1
+ thiz->GetProcAddress = IDirectFBGL_Mesa_GetProcAddress;
+#endif
return DFB_OK;
}
@@ -355,65 +387,61 @@ dfbGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height )
*height = (GLuint) data->height;
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
static void
dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
{
- _mesa_ResizeBuffersMESA();
+ /* Nothing to do (the surface can't be resized while it's locked). */
+ return;
}
static void
-dfbClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+dfbClear( GLcontext *ctx, GLbitfield mask )
{
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-
- if (mask & BUFFER_BIT_FRONT_LEFT &&
- ctx->Color.ColorMask[0] &&
- ctx->Color.ColorMask[1] &&
- ctx->Color.ColorMask[2] &&
+
+#define BUFFER_BIT_MASK (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT | \
+ BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT )
+ if (mask & BUFFER_BIT_MASK &&
+ ctx->Color.ColorMask[0] &&
+ ctx->Color.ColorMask[1] &&
+ ctx->Color.ColorMask[2] &&
ctx->Color.ColorMask[3])
{
DFBRegion clip;
- __u8 a, r, g, b;
+ GLubyte a, r, g, b;
UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] );
UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] );
UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] );
UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] );
- data->surface->Unlock( data->surface );
-
-#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25)
- data->surface->GetClip( data->surface, &clip );
-#else
- (void)clip;
-#endif
+ clip.x1 = ctx->DrawBuffer->_Xmin;
+ clip.y1 = ctx->DrawBuffer->_Ymin;
+ clip.x2 = ctx->DrawBuffer->_Xmax - 1;
+ clip.y2 = ctx->DrawBuffer->_Ymax - 1;
+ data->surface->SetClip( data->surface, &clip );
- if (all) {
- data->surface->SetClip( data->surface, NULL );
- }
- else {
- DFBRegion reg = { x1:x, y1:y, x2:x+width-1, y2:y+height-1 };
- data->surface->SetClip( data->surface, &reg );
- }
+ data->surface->Unlock( data->surface );
data->surface->Clear( data->surface, r, g, b, a );
-
-#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25)
- data->surface->SetClip( data->surface, &clip );
-#endif
data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE,
(void*)&data->video.start, &data->video.pitch );
+ data->video.end = data->video.start + (data->height-1) * data->video.pitch;
+ data->render.Data = data->video.start;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
+ mask &= ~BUFFER_BIT_MASK;
}
+#undef BUFFER_BIT_MASK
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
-}
-
-
+ _swrast_Clear( ctx, mask );
+}
+
/************************ RenderBuffer functions *****************************/
@@ -776,6 +804,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB332;
data->render.GetValues = get_values_RGB332;
data->render.PutRow = put_row_RGB332;
+ data->render.PutRowRGB = put_row_rgb_RGB332;
data->render.PutMonoRow = put_mono_row_RGB332;
data->render.PutValues = put_values_RGB332;
data->render.PutMonoValues = put_mono_values_RGB332;
@@ -784,6 +813,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB4444;
data->render.GetValues = get_values_ARGB4444;
data->render.PutRow = put_row_ARGB4444;
+ data->render.PutRowRGB = put_row_rgb_ARGB4444;
data->render.PutMonoRow = put_mono_row_ARGB4444;
data->render.PutValues = put_values_ARGB4444;
data->render.PutMonoValues = put_mono_values_ARGB4444;
@@ -792,6 +822,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB2554;
data->render.GetValues = get_values_ARGB2554;
data->render.PutRow = put_row_ARGB2554;
+ data->render.PutRowRGB = put_row_rgb_ARGB2554;
data->render.PutMonoRow = put_mono_row_ARGB2554;
data->render.PutValues = put_values_ARGB2554;
data->render.PutMonoValues = put_mono_values_ARGB2554;
@@ -800,6 +831,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB1555;
data->render.GetValues = get_values_ARGB1555;
data->render.PutRow = put_row_ARGB1555;
+ data->render.PutRowRGB = put_row_rgb_ARGB1555;
data->render.PutMonoRow = put_mono_row_ARGB1555;
data->render.PutValues = put_values_ARGB1555;
data->render.PutMonoValues = put_mono_values_ARGB1555;
@@ -808,6 +840,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB16;
data->render.GetValues = get_values_RGB16;
data->render.PutRow = put_row_RGB16;
+ data->render.PutRowRGB = put_row_rgb_RGB16;
data->render.PutMonoRow = put_mono_row_RGB16;
data->render.PutValues = put_values_RGB16;
data->render.PutMonoValues = put_mono_values_RGB16;
@@ -816,6 +849,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB24;
data->render.GetValues = get_values_RGB24;
data->render.PutRow = put_row_RGB24;
+ data->render.PutRowRGB = put_row_rgb_RGB24;
data->render.PutMonoRow = put_mono_row_RGB24;
data->render.PutValues = put_values_RGB24;
data->render.PutMonoValues = put_mono_values_RGB24;
@@ -824,6 +858,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB32;
data->render.GetValues = get_values_RGB32;
data->render.PutRow = put_row_RGB32;
+ data->render.PutRowRGB = put_row_rgb_RGB32;
data->render.PutMonoRow = put_mono_row_RGB32;
data->render.PutValues = put_values_RGB32;
data->render.PutMonoValues = put_mono_values_RGB32;
@@ -832,6 +867,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB;
data->render.GetValues = get_values_ARGB;
data->render.PutRow = put_row_ARGB;
+ data->render.PutRowRGB = put_row_rgb_ARGB;
data->render.PutMonoRow = put_mono_row_ARGB;
data->render.PutValues = put_values_ARGB;
data->render.PutMonoValues = put_mono_values_ARGB;
@@ -840,6 +876,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_AiRGB;
data->render.GetValues = get_values_AiRGB;
data->render.PutRow = put_row_AiRGB;
+ data->render.PutRowRGB = put_row_rgb_AiRGB;
data->render.PutMonoRow = put_mono_row_AiRGB;
data->render.PutValues = put_values_AiRGB;
data->render.PutMonoValues = put_mono_values_AiRGB;
diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template
index 58912730fdd..5261a4b55d1 100644
--- a/src/mesa/drivers/dri/Makefile.template
+++ b/src/mesa/drivers/dri/Makefile.template
@@ -9,7 +9,12 @@ COMMON_SOURCES = \
../common/vblank.c \
../common/dri_util.c \
../common/xmlconfig.c \
- ../common/drirenderbuffer.c
+ ../common/drirenderbuffer.c
+
+COMMON_BM_SOURCES = \
+ ../common/dri_bufmgr.c \
+ ../common/dri_drmpool.c
+
ifeq ($(WINDOW_SYSTEM),dri)
WINOBJ=
@@ -85,7 +90,7 @@ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
- $(ASM_SOURCES) > /dev/null
+ $(ASM_SOURCES) 2>&1 /dev/null
# Emacs tags
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c
new file mode 100644
index 00000000000..370b56c3a36
--- /dev/null
+++ b/src/mesa/drivers/dri/common/dri_bufmgr.c
@@ -0,0 +1,493 @@
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ * Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include "glthread.h"
+#include "errno.h"
+#include "dri_bufmgr.h"
+#include "string.h"
+#include "imports.h"
+#include "dri_bufpool.h"
+
+_glthread_DECLARE_STATIC_MUTEX(bmMutex);
+
+/*
+ * TODO: Introduce fence pools in the same way as
+ * buffer object pools.
+ */
+
+
+
+typedef struct _DriFenceObject
+{
+ int fd;
+ _glthread_Mutex mutex;
+ int refCount;
+ const char *name;
+ drmFence fence;
+} DriFenceObject;
+
+typedef struct _DriBufferObject
+{
+ DriBufferPool *pool;
+ _glthread_Mutex mutex;
+ int refCount;
+ const char *name;
+ unsigned flags;
+ unsigned hint;
+ unsigned alignment;
+ void *private;
+} DriBufferObject;
+
+
+void
+bmError(int val, const char *file, const char *function, int line)
+{
+ _mesa_printf("Fatal video memory manager error \"%s\".\n"
+ "Check kernel logs or set the LIBGL_DEBUG\n"
+ "environment variable to \"verbose\" for more info.\n"
+ "Detected in file %s, line %d, function %s.\n",
+ strerror(-val), file, line, function);
+#ifndef NDEBUG
+ abort();
+#else
+ abort();
+#endif
+}
+
+DriFenceObject *
+driFenceBuffers(int fd, char *name, unsigned flags)
+{
+ DriFenceObject *fence = (DriFenceObject *) malloc(sizeof(*fence));
+ int ret;
+
+ if (!fence)
+ BM_CKFATAL(-EINVAL);
+
+ _glthread_LOCK_MUTEX(bmMutex);
+ fence->refCount = 1;
+ fence->name = name;
+ fence->fd = fd;
+ _glthread_INIT_MUTEX(fence->mutex);
+ ret = drmFenceBuffers(fd, flags, &fence->fence);
+ _glthread_UNLOCK_MUTEX(bmMutex);
+ if (ret) {
+ free(fence);
+ BM_CKFATAL(ret);
+ }
+ return fence;
+}
+
+
+unsigned
+driFenceType(DriFenceObject * fence)
+{
+ unsigned ret;
+
+ _glthread_LOCK_MUTEX(bmMutex);
+ ret = fence->fence.flags;
+ _glthread_UNLOCK_MUTEX(bmMutex);
+
+ return ret;
+}
+
+
+DriFenceObject *
+driFenceReference(DriFenceObject * fence)
+{
+ _glthread_LOCK_MUTEX(bmMutex);
+ ++fence->refCount;
+ _glthread_UNLOCK_MUTEX(bmMutex);
+ return fence;
+}
+
+void
+driFenceUnReference(DriFenceObject * fence)
+{
+ if (!fence)
+ return;
+
+ _glthread_LOCK_MUTEX(bmMutex);
+ if (--fence->refCount == 0) {
+ drmFenceDestroy(fence->fd, &fence->fence);
+ free(fence);
+ }
+ _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+void
+driFenceFinish(DriFenceObject * fence, unsigned type, int lazy)
+{
+ int ret;
+ unsigned flags = (lazy) ? DRM_FENCE_FLAG_WAIT_LAZY : 0;
+
+ _glthread_LOCK_MUTEX(fence->mutex);
+ ret = drmFenceWait(fence->fd, flags, &fence->fence, type);
+ _glthread_UNLOCK_MUTEX(fence->mutex);
+ BM_CKFATAL(ret);
+}
+
+int
+driFenceSignaled(DriFenceObject * fence, unsigned type)
+{
+ int signaled;
+ int ret;
+
+ if (fence == NULL)
+ return GL_TRUE;
+
+ _glthread_LOCK_MUTEX(fence->mutex);
+ ret = drmFenceSignaled(fence->fd, &fence->fence, type, &signaled);
+ _glthread_UNLOCK_MUTEX(fence->mutex);
+ BM_CKFATAL(ret);
+ return signaled;
+}
+
+
+extern drmBO *
+driBOKernel(struct _DriBufferObject *buf)
+{
+ drmBO *ret;
+
+ assert(buf->private != NULL);
+ ret = buf->pool->kernel(buf->pool, buf->private);
+ if (!ret)
+ BM_CKFATAL(-EINVAL);
+
+ return ret;
+}
+
+void
+driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
+{
+ assert(buf->private != NULL);
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, lazy));
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void *
+driBOMap(struct _DriBufferObject *buf, unsigned flags, unsigned hint)
+{
+ void *virtual;
+
+ assert(buf->private != NULL);
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ BM_CKFATAL(buf->pool->map(buf->pool, buf->private, flags, hint, &virtual));
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+ return virtual;
+}
+
+void
+driBOUnmap(struct _DriBufferObject *buf)
+{
+ assert(buf->private != NULL);
+
+ buf->pool->unmap(buf->pool, buf->private);
+}
+
+unsigned long
+driBOOffset(struct _DriBufferObject *buf)
+{
+ unsigned long ret;
+
+ assert(buf->private != NULL);
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ ret = buf->pool->offset(buf->pool, buf->private);
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+ return ret;
+}
+
+unsigned
+driBOFlags(struct _DriBufferObject *buf)
+{
+ unsigned ret;
+
+ assert(buf->private != NULL);
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ ret = buf->pool->flags(buf->pool, buf->private);
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+ return ret;
+}
+
+struct _DriBufferObject *
+driBOReference(struct _DriBufferObject *buf)
+{
+ _glthread_LOCK_MUTEX(bmMutex);
+ if (++buf->refCount == 1) {
+ BM_CKFATAL(-EINVAL);
+ }
+ _glthread_UNLOCK_MUTEX(bmMutex);
+ return buf;
+}
+
+void
+driBOUnReference(struct _DriBufferObject *buf)
+{
+ int tmp;
+
+ if (!buf)
+ return;
+
+ _glthread_LOCK_MUTEX(bmMutex);
+ tmp = --buf->refCount;
+ _glthread_UNLOCK_MUTEX(bmMutex);
+ if (!tmp) {
+ buf->pool->destroy(buf->pool, buf->private);
+ free(buf);
+ }
+}
+
+void
+driBOData(struct _DriBufferObject *buf,
+ unsigned size, const void *data, unsigned flags)
+{
+ void *virtual;
+ int newBuffer;
+ struct _DriBufferPool *pool;
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ pool = buf->pool;
+ if (!pool->create) {
+ _mesa_error(NULL, GL_INVALID_OPERATION,
+ "driBOData called on invalid buffer\n");
+ BM_CKFATAL(-EINVAL);
+ }
+ newBuffer = !buf->private || (pool->size(pool, buf->private) < size) ||
+ pool->map(pool, buf->private, DRM_BO_FLAG_WRITE,
+ DRM_BO_HINT_DONT_BLOCK, &virtual);
+
+ if (newBuffer) {
+ if (buf->private)
+ pool->destroy(pool, buf->private);
+ if (!flags)
+ flags = buf->flags;
+ buf->private = pool->create(pool, size, flags, 0, buf->alignment);
+ if (!buf->private)
+ BM_CKFATAL(-ENOMEM);
+ BM_CKFATAL(pool->map(pool, buf->private,
+ DRM_BO_FLAG_WRITE,
+ DRM_BO_HINT_DONT_BLOCK, &virtual));
+ }
+
+ if (data != NULL)
+ memcpy(virtual, data, size);
+
+ BM_CKFATAL(pool->unmap(pool, buf->private));
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOSubData(struct _DriBufferObject *buf,
+ unsigned long offset, unsigned long size, const void *data)
+{
+ void *virtual;
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ if (size && data) {
+ BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
+ DRM_BO_FLAG_WRITE, 0, &virtual));
+ memcpy((unsigned char *) virtual + offset, data, size);
+ BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+ }
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOGetSubData(struct _DriBufferObject *buf,
+ unsigned long offset, unsigned long size, void *data)
+{
+ void *virtual;
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ if (size && data) {
+ BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
+ DRM_BO_FLAG_READ, 0, &virtual));
+ memcpy(data, (unsigned char *) virtual + offset, size);
+ BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+ }
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOSetStatic(struct _DriBufferObject *buf,
+ unsigned long offset,
+ unsigned long size, void *virtual, unsigned flags)
+{
+ _glthread_LOCK_MUTEX(buf->mutex);
+ if (buf->private != NULL) {
+ _mesa_error(NULL, GL_INVALID_OPERATION,
+ "Invalid buffer for setStatic\n");
+ BM_CKFATAL(-EINVAL);
+ }
+ if (buf->pool->setstatic == NULL) {
+ _mesa_error(NULL, GL_INVALID_OPERATION,
+ "Invalid buffer pool for setStatic\n");
+ BM_CKFATAL(-EINVAL);
+ }
+
+ if (!flags)
+ flags = buf->flags;
+
+ buf->private = buf->pool->setstatic(buf->pool, offset, size,
+ virtual, flags);
+ if (!buf->private) {
+ _mesa_error(NULL, GL_OUT_OF_MEMORY,
+ "Invalid buffer pool for setStatic\n");
+ BM_CKFATAL(-ENOMEM);
+ }
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+
+
+void
+driGenBuffers(struct _DriBufferPool *pool,
+ const char *name,
+ unsigned n,
+ struct _DriBufferObject *buffers[],
+ unsigned alignment, unsigned flags, unsigned hint)
+{
+ struct _DriBufferObject *buf;
+ int i;
+
+ flags = (flags) ? flags : DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_MEM_VRAM |
+ DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE;
+
+
+ for (i = 0; i < n; ++i) {
+ buf = (struct _DriBufferObject *) calloc(1, sizeof(*buf));
+ if (!buf)
+ BM_CKFATAL(-ENOMEM);
+
+ _glthread_INIT_MUTEX(buf->mutex);
+ _glthread_LOCK_MUTEX(buf->mutex);
+ _glthread_LOCK_MUTEX(bmMutex);
+ buf->refCount = 1;
+ _glthread_UNLOCK_MUTEX(bmMutex);
+ buf->flags = flags;
+ buf->hint = hint;
+ buf->name = name;
+ buf->alignment = alignment;
+ buf->pool = pool;
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+ buffers[i] = buf;
+ }
+}
+
+void
+driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[])
+{
+ int i;
+
+ for (i = 0; i < n; ++i) {
+ driBOUnReference(buffers[i]);
+ }
+}
+
+
+void
+driInitBufMgr(int fd)
+{
+ ;
+}
+
+
+void
+driBOCreateList(int target, drmBOList * list)
+{
+ _glthread_LOCK_MUTEX(bmMutex);
+ BM_CKFATAL(drmBOCreateList(20, list));
+ _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+void
+driBOResetList(drmBOList * list)
+{
+ _glthread_LOCK_MUTEX(bmMutex);
+ BM_CKFATAL(drmBOResetList(list));
+ _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+void
+driBOAddListItem(drmBOList * list, struct _DriBufferObject *buf,
+ unsigned flags, unsigned mask)
+{
+ int newItem;
+
+ _glthread_LOCK_MUTEX(buf->mutex);
+ _glthread_LOCK_MUTEX(bmMutex);
+ BM_CKFATAL(drmAddValidateItem(list, driBOKernel(buf),
+ flags, mask, &newItem));
+ _glthread_UNLOCK_MUTEX(bmMutex);
+
+ /*
+ * Tell userspace pools to validate the buffer. This should be a
+ * noop if the pool is already validated.
+ * FIXME: We should have a list for this as well.
+ */
+
+ if (buf->pool->validate) {
+ BM_CKFATAL(buf->pool->validate(buf->pool, buf->private));
+ }
+
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOFence(struct _DriBufferObject *buf, struct _DriFenceObject *fence)
+{
+ _glthread_LOCK_MUTEX(buf->mutex);
+ BM_CKFATAL(buf->pool->fence(buf->pool, buf->private, fence));
+ _glthread_UNLOCK_MUTEX(buf->mutex);
+
+}
+
+void
+driBOValidateList(int fd, drmBOList * list)
+{
+ _glthread_LOCK_MUTEX(bmMutex);
+ BM_CKFATAL(drmBOValidateList(fd, list));
+ _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+void
+driPoolTakeDown(struct _DriBufferPool *pool)
+{
+ pool->takeDown(pool);
+
+}
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.h b/src/mesa/drivers/dri/common/dri_bufmgr.h
new file mode 100644
index 00000000000..01f149ae4ed
--- /dev/null
+++ b/src/mesa/drivers/dri/common/dri_bufmgr.h
@@ -0,0 +1,99 @@
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ * Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#ifndef _DRI_BUFMGR_H_
+#define _DRI_BUFMGR_H_
+#include <xf86drm.h>
+
+
+struct _DriFenceObject;
+struct _DriBufferObject;
+struct _DriBufferPool;
+
+extern struct _DriFenceObject *driFenceBuffers(int fd, char *name,
+ unsigned flags);
+
+extern struct _DriFenceObject *driFenceReference(struct _DriFenceObject *fence);
+
+extern void driFenceUnReference(struct _DriFenceObject *fence);
+
+extern void
+driFenceFinish(struct _DriFenceObject *fence, unsigned type, int lazy);
+
+extern int driFenceSignaled(struct _DriFenceObject *fence, unsigned type);
+extern unsigned driFenceType(struct _DriFenceObject *fence);
+
+/*
+ * Return a pointer to the libdrm buffer object this DriBufferObject
+ * uses.
+ */
+
+extern drmBO *driBOKernel(struct _DriBufferObject *buf);
+extern void *driBOMap(struct _DriBufferObject *buf, unsigned flags,
+ unsigned hint);
+extern void driBOUnmap(struct _DriBufferObject *buf);
+extern unsigned long driBOOffset(struct _DriBufferObject *buf);
+extern unsigned driBOFlags(struct _DriBufferObject *buf);
+extern struct _DriBufferObject *driBOReference(struct _DriBufferObject *buf);
+extern void driBOUnReference(struct _DriBufferObject *buf);
+extern void driBOData(struct _DriBufferObject *r_buf,
+ unsigned size, const void *data, unsigned flags);
+extern void driBOSubData(struct _DriBufferObject *buf,
+ unsigned long offset, unsigned long size,
+ const void *data);
+extern void driBOGetSubData(struct _DriBufferObject *buf,
+ unsigned long offset, unsigned long size,
+ void *data);
+extern void driGenBuffers(struct _DriBufferPool *pool,
+ const char *name,
+ unsigned n,
+ struct _DriBufferObject *buffers[],
+ unsigned alignment, unsigned flags, unsigned hint);
+extern void driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]);
+extern void driInitBufMgr(int fd);
+extern void driBOCreateList(int target, drmBOList * list);
+extern void driBOResetList(drmBOList * list);
+extern void driBOAddListItem(drmBOList * list, struct _DriBufferObject *buf,
+ unsigned flags, unsigned mask);
+extern void driBOValidateList(int fd, drmBOList * list);
+
+extern void driBOFence(struct _DriBufferObject *buf,
+ struct _DriFenceObject *fence);
+
+extern void driPoolTakeDown(struct _DriBufferPool *pool);
+extern void driBOSetStatic(struct _DriBufferObject *buf,
+ unsigned long offset,
+ unsigned long size, void *virtual, unsigned flags);
+extern void driBOWaitIdle(struct _DriBufferObject *buf, int lazy);
+extern void driPoolTakeDown(struct _DriBufferPool *pool);
+
+#endif
diff --git a/src/mesa/drivers/dri/common/dri_bufpool.h b/src/mesa/drivers/dri/common/dri_bufpool.h
new file mode 100644
index 00000000000..c6fb2c3ce01
--- /dev/null
+++ b/src/mesa/drivers/dri/common/dri_bufpool.h
@@ -0,0 +1,86 @@
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#ifndef _DRI_BUFPOOL_H_
+#define _DRI_BUFPOOL_H_
+
+#include <xf86drm.h>
+struct _DriFenceObject;
+
+typedef struct _DriBufferPool
+{
+ int fd;
+ int (*map) (struct _DriBufferPool * pool, void *private,
+ unsigned flags, int hint, void **virtual);
+ int (*unmap) (struct _DriBufferPool * pool, void *private);
+ int (*destroy) (struct _DriBufferPool * pool, void *private);
+ unsigned long (*offset) (struct _DriBufferPool * pool, void *private);
+ unsigned (*flags) (struct _DriBufferPool * pool, void *private);
+ unsigned long (*size) (struct _DriBufferPool * pool, void *private);
+ void *(*create) (struct _DriBufferPool * pool, unsigned long size,
+ unsigned flags, unsigned hint, unsigned alignment);
+ int (*fence) (struct _DriBufferPool * pool, void *private,
+ struct _DriFenceObject * fence);
+ drmBO *(*kernel) (struct _DriBufferPool * pool, void *private);
+ int (*validate) (struct _DriBufferPool * pool, void *private);
+ void *(*setstatic) (struct _DriBufferPool * pool, unsigned long offset,
+ unsigned long size, void *virtual, unsigned flags);
+ int (*waitIdle) (struct _DriBufferPool *pool, void *private,
+ int lazy);
+ void (*takeDown) (struct _DriBufferPool * pool);
+ void *data;
+} DriBufferPool;
+
+extern void bmError(int val, const char *file, const char *function,
+ int line);
+#define BM_CKFATAL(val) \
+ do{ \
+ int tstVal = (val); \
+ if (tstVal) \
+ bmError(tstVal, __FILE__, __FUNCTION__, __LINE__); \
+ } while(0);
+
+
+
+
+
+/*
+ * Builtin pools.
+ */
+
+/*
+ * Kernel buffer objects. Size in multiples of page size. Page size aligned.
+ */
+
+extern struct _DriBufferPool *driDRMPoolInit(int fd);
+extern struct _DriBufferPool *driDRMStaticPoolInit(int fd);
+
+#endif
diff --git a/src/mesa/drivers/dri/common/dri_drmpool.c b/src/mesa/drivers/dri/common/dri_drmpool.c
new file mode 100644
index 00000000000..b5b324be500
--- /dev/null
+++ b/src/mesa/drivers/dri/common/dri_drmpool.c
@@ -0,0 +1,227 @@
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "dri_bufpool.h"
+
+/*
+ * Buffer pool implementation using DRM buffer objects as DRI buffer objects.
+ */
+
+static void *
+pool_create(struct _DriBufferPool *pool,
+ unsigned long size, unsigned flags, unsigned hint,
+ unsigned alignment)
+{
+ drmBO *buf = (drmBO *) malloc(sizeof(*buf));
+ int ret;
+ unsigned pageSize = getpagesize();
+
+ if (!buf)
+ return NULL;
+
+ if ((alignment > pageSize) && (alignment % pageSize)) {
+ return NULL;
+ }
+
+ ret = drmBOCreate(pool->fd, 0, size, alignment / pageSize,
+ NULL, drm_bo_type_dc,
+ flags, hint, buf);
+ if (ret) {
+ free(buf);
+ return NULL;
+ }
+
+ return (void *) buf;
+}
+
+static int
+pool_destroy(struct _DriBufferPool *pool, void *private)
+{
+ int ret;
+ drmBO *buf = (drmBO *) private;
+ ret = drmBODestroy(pool->fd, buf);
+ free(buf);
+ return ret;
+}
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+ int hint, void **virtual)
+{
+ drmBO *buf = (drmBO *) private;
+
+ return drmBOMap(pool->fd, buf, flags, hint, virtual);
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+ drmBO *buf = (drmBO *) private;
+ return drmBOUnmap(pool->fd, buf);
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+ drmBO *buf = (drmBO *) private;
+ return buf->offset;
+}
+
+static unsigned
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+ drmBO *buf = (drmBO *) private;
+ return buf->flags;
+}
+
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+ drmBO *buf = (drmBO *) private;
+ return buf->size;
+}
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+ struct _DriFenceObject *fence)
+{
+ /*
+ * Noop. The kernel handles all fencing.
+ */
+
+ return 0;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+ return (drmBO *) private;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *pool, void *private, int lazy)
+{
+ drmBO *buf = (drmBO *) private;
+ return drmBOWaitIdle(pool->fd, buf, (lazy) ? DRM_BO_HINT_WAIT_LAZY:0);
+}
+
+
+static void
+pool_takedown(struct _DriBufferPool *pool)
+{
+ free(pool);
+}
+
+
+struct _DriBufferPool *
+driDRMPoolInit(int fd)
+{
+ struct _DriBufferPool *pool;
+
+ pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
+
+ if (!pool)
+ return NULL;
+
+ pool->fd = fd;
+ pool->map = &pool_map;
+ pool->unmap = &pool_unmap;
+ pool->destroy = &pool_destroy;
+ pool->offset = &pool_offset;
+ pool->flags = &pool_flags;
+ pool->size = &pool_size;
+ pool->create = &pool_create;
+ pool->fence = &pool_fence;
+ pool->kernel = &pool_kernel;
+ pool->validate = NULL;
+ pool->setstatic = NULL;
+ pool->waitIdle = &pool_waitIdle;
+ pool->takeDown = &pool_takedown;
+ pool->data = NULL;
+ return pool;
+}
+
+
+static void *
+pool_setstatic(struct _DriBufferPool *pool, unsigned long offset,
+ unsigned long size, void *virtual, unsigned flags)
+{
+ drmBO *buf = (drmBO *) malloc(sizeof(*buf));
+ int ret;
+
+ if (!buf)
+ return NULL;
+
+ ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake,
+ flags, 0, buf);
+
+ if (ret) {
+ free(buf);
+ return NULL;
+ }
+
+ buf->virtual = virtual;
+
+ return (void *) buf;
+}
+
+
+struct _DriBufferPool *
+driDRMStaticPoolInit(int fd)
+{
+ struct _DriBufferPool *pool;
+
+ pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
+
+ if (!pool)
+ return NULL;
+
+ pool->fd = fd;
+ pool->map = &pool_map;
+ pool->unmap = &pool_unmap;
+ pool->destroy = &pool_destroy;
+ pool->offset = &pool_offset;
+ pool->flags = &pool_flags;
+ pool->size = &pool_size;
+ pool->create = NULL;
+ pool->fence = &pool_fence;
+ pool->kernel = &pool_kernel;
+ pool->validate = NULL;
+ pool->setstatic = &pool_setstatic;
+ pool->waitIdle = &pool_waitIdle;
+ pool->takeDown = &pool_takedown;
+ pool->data = NULL;
+ return pool;
+}
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index b5c20a066a5..ba251a81430 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -323,6 +323,7 @@ static GLboolean DoBindContext(__DRInativeDisplay *dpy,
/* Bind the drawable to the context */
pcp->driDrawablePriv = pdp;
+ pcp->driReadablePriv = prp;
pdp->driContextPriv = pcp;
pdp->refcount++;
if ( pdp != prp ) {
@@ -339,6 +340,12 @@ static GLboolean DoBindContext(__DRInativeDisplay *dpy,
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
}
+ if ((pdp != prp) && (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp)) {
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ __driUtilUpdateDrawableInfo(prp);
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ }
+
/* Call device-specific MakeCurrent */
(*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp);
@@ -402,14 +409,20 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
__DRIscreenPrivate *psp;
__DRIcontextPrivate *pcp = pdp->driContextPriv;
- if (!pcp || (pdp != pcp->driDrawablePriv)) {
- /* ERROR!!! */
- return;
+ if (!pcp
+ || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) {
+ /* ERROR!!!
+ * ...but we must ignore it. There can be many contexts bound to a
+ * drawable.
+ */
}
psp = pdp->driScreenPriv;
if (!psp) {
/* ERROR!!! */
+ _mesa_problem("Warning! Possible infinite loop due to bug "
+ "in file %s, line %d\n",
+ __FILE__, __LINE__);
return;
}
@@ -841,7 +854,7 @@ static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPriv
(void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
(void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
_mesa_free(psp->pDevPriv);
- (void)drmClose(psp->fd);
+ (void)drmCloseOnce(psp->fd);
if ( psp->modes != NULL ) {
(*dri_interface->destroyContextModes)( psp->modes );
}
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index 14c24a0efaa..e43e6532500 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -87,15 +87,15 @@ typedef struct __DRIutilversionRec2 __DRIutilversion2;
#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \
do { \
while (*(pdp->pStamp) != pdp->lastStamp) { \
- DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, \
- pdp->driContextPriv->hHWContext); \
+ register unsigned int hwContext = psp->pSAREA->lock.lock & \
+ ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \
+ DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, hwContext); \
\
DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
\
- DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, \
- pdp->driContextPriv->hHWContext); \
+ DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, hwContext); \
} \
} while (0)
@@ -355,11 +355,16 @@ struct __DRIcontextPrivateRec {
__DRInativeDisplay *display;
/**
- * Pointer to drawable currently bound to this context.
+ * Pointer to drawable currently bound to this context for drawing.
*/
__DRIdrawablePrivate *driDrawablePriv;
/**
+ * Pointer to drawable currently bound to this context for reading.
+ */
+ __DRIdrawablePrivate *driReadablePriv;
+
+ /**
* Pointer to screen on which this context was created.
*/
__DRIscreenPrivate *driScreenPriv;
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h
index cd73b781741..747f92fcdbe 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.h
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.h
@@ -52,8 +52,11 @@ typedef struct {
*/
GLboolean depthHasSurface;
- /* XXX this is for s3v only. A handy flag to know if this is the back
- * color buffer.
+ /**
+ * A handy flag to know if this is the back color buffer.
+ *
+ * \note
+ * This is currently only used by s3v and tdfx.
*/
GLboolean backBuffer;
} driRenderbuffer;
diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h
index 0f762837a4f..d6d51cdd165 100644
--- a/src/mesa/drivers/dri/common/extension_helper.h
+++ b/src/mesa/drivers/dri/common/extension_helper.h
@@ -32,9 +32,10 @@
# define NULL 0
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char UniformMatrix3fvARB_names[] =
"iiip\0" /* Parameter signature */
+ "glUniformMatrix3fv\0"
"glUniformMatrix3fvARB\0"
"";
#endif
@@ -78,6 +79,13 @@ static const char PointParameteriNV_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_0)
+static const char GetProgramiv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetProgramiv\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_3)
static const char MultiTexCoord3sARB_names[] =
"iiii\0" /* Parameter signature */
@@ -132,14 +140,6 @@ static const char VertexAttrib4ubvNV_names[] =
"";
#endif
-#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture)
-static const char GetColorTableParameterfvSGI_names[] =
- "iip\0" /* Parameter signature */
- "glGetColorTableParameterfvSGI\0"
- "glGetColorTableParameterfvEXT\0"
- "";
-#endif
-
#if defined(need_GL_NV_fragment_program)
static const char GetProgramNamedParameterdvNV_names[] =
"iipp\0" /* Parameter signature */
@@ -239,16 +239,17 @@ static const char TexCoord2fColor4ubVertex3fvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
-static const char ProgramEnvParameter4dvARB_names[] =
- "iip\0" /* Parameter signature */
- "glProgramEnvParameter4dvARB\0"
+#if defined(need_GL_VERSION_2_0)
+static const char AttachShader_names[] =
+ "ii\0" /* Parameter signature */
+ "glAttachShader\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2fARB_names[] =
"iff\0" /* Parameter signature */
+ "glVertexAttrib2f\0"
"glVertexAttrib2fARB\0"
"";
#endif
@@ -260,16 +261,10 @@ static const char GetDebugLogLengthMESA_names[] =
"";
#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)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3fARB_names[] =
"ifff\0" /* Parameter signature */
+ "glVertexAttrib3f\0"
"glVertexAttrib3fARB\0"
"";
#endif
@@ -320,16 +315,25 @@ static const char CompressedTexSubImage2DARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_NV_register_combiners)
+static const char CombinerOutputNV_names[] =
+ "iiiiiiiiii\0" /* Parameter signature */
+ "glCombinerOutputNV\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2fARB_names[] =
"iff\0" /* Parameter signature */
+ "glUniform2f\0"
"glUniform2fARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib1sv\0"
"glVertexAttrib1svARB\0"
"";
#endif
@@ -341,9 +345,10 @@ static const char VertexAttribs1dvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform2iv\0"
"glUniform2ivARB\0"
"";
#endif
@@ -362,6 +367,13 @@ static const char WeightubvARB_names[] =
"";
#endif
+#if defined(need_GL_NV_vertex_program)
+static const char VertexAttrib1fvNV_names[] =
+ "ip\0" /* Parameter signature */
+ "glVertexAttrib1fvNV\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_convolution)
static const char CopyConvolutionFilter1D_names[] =
"iiiii\0" /* Parameter signature */
@@ -392,9 +404,10 @@ static const char BlendColor_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char UniformMatrix4fvARB_names[] =
"iiip\0" /* Parameter signature */
+ "glUniformMatrix4fv\0"
"glUniformMatrix4fvARB\0"
"";
#endif
@@ -413,6 +426,13 @@ static const char ReadInstrumentsSGIX_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix2x4fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix2x4fv\0"
+ "";
+#endif
+
#if defined(need_GL_SUN_vertex)
static const char Color4ubVertex3fvSUN_names[] =
"pp\0" /* Parameter signature */
@@ -427,9 +447,10 @@ static const char GetListParameterivSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NusvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nusv\0"
"glVertexAttrib4NusvARB\0"
"";
#endif
@@ -455,10 +476,10 @@ static const char FragmentLightModelivSGIX_names[] =
"";
#endif
-#if defined(need_GL_ATI_fragment_shader)
-static const char ColorFragmentOp3ATI_names[] =
- "iiiiiiiiiiiii\0" /* Parameter signature */
- "glColorFragmentOp3ATI\0"
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix4x3fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix4x3fv\0"
"";
#endif
@@ -551,9 +572,10 @@ static const char ProgramParameter4dvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char DisableVertexAttribArrayARB_names[] =
"i\0" /* Parameter signature */
+ "glDisableVertexAttribArray\0"
"glDisableVertexAttribArrayARB\0"
"";
#endif
@@ -580,9 +602,18 @@ static const char CompressedTexImage3DARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_EXT_convolution)
+static const char GetConvolutionParameteriv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetConvolutionParameteriv\0"
+ "glGetConvolutionParameterivEXT\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1fARB_names[] =
"if\0" /* Parameter signature */
+ "glVertexAttrib1f\0"
"glVertexAttrib1fARB\0"
"";
#endif
@@ -695,16 +726,25 @@ static const char VertexAttrib2dNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0)
+static const char GetProgramInfoLog_names[] =
+ "iipp\0" /* Parameter signature */
+ "glGetProgramInfoLog\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NbvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nbv\0"
"glVertexAttrib4NbvARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_shader)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader)
static const char GetActiveAttribARB_names[] =
"iiipppp\0" /* Parameter signature */
+ "glGetActiveAttrib\0"
"glGetActiveAttribARB\0"
"";
#endif
@@ -723,13 +763,6 @@ static const char TexCoord2fColor4fNormal3fVertex3fSUN_names[] =
"";
#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 */
@@ -877,9 +910,10 @@ static const char ReplacementCodeubvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform3iARB_names[] =
"iiii\0" /* Parameter signature */
+ "glUniform3i\0"
"glUniform3iARB\0"
"";
#endif
@@ -891,10 +925,10 @@ static const char GetFragmentMaterialfvSGIX_names[] =
"";
#endif
-#if defined(need_GL_EXT_coordinate_frame)
-static const char Binormal3fEXT_names[] =
- "fff\0" /* Parameter signature */
- "glBinormal3fEXT\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetShaderInfoLog_names[] =
+ "iipp\0" /* Parameter signature */
+ "glGetShaderInfoLog\0"
"";
#endif
@@ -1012,9 +1046,10 @@ static const char TexSubImage1D_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1sARB_names[] =
"ii\0" /* Parameter signature */
+ "glVertexAttrib1s\0"
"glVertexAttrib1sARB\0"
"";
#endif
@@ -1026,13 +1061,6 @@ static const char FinalCombinerInputNV_names[] =
"";
#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 */
@@ -1047,13 +1075,22 @@ static const char ReplacementCodeuiTexCoord2fVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1fARB_names[] =
"if\0" /* Parameter signature */
+ "glUniform1f\0"
"glUniform1fARB\0"
"";
#endif
+#if defined(need_GL_EXT_texture_object)
+static const char AreTexturesResident_names[] =
+ "ipp\0" /* Parameter signature */
+ "glAreTexturesResident\0"
+ "glAreTexturesResidentEXT\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_framebuffer_object)
static const char IsRenderbufferEXT_names[] =
"i\0" /* Parameter signature */
@@ -1119,13 +1156,6 @@ static const char SecondaryColor3bvEXT_names[] =
"";
#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 */
@@ -1182,9 +1212,10 @@ static const char GetFragmentLightivSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char UniformMatrix2fvARB_names[] =
"iiip\0" /* Parameter signature */
+ "glUniformMatrix2fv\0"
"glUniformMatrix2fvARB\0"
"";
#endif
@@ -1228,9 +1259,10 @@ static const char MapParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib3dv\0"
"glVertexAttrib3dvARB\0"
"";
#endif
@@ -1321,9 +1353,10 @@ static const char GetAttachedObjectsARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform3fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform3fv\0"
"glUniform3fvARB\0"
"";
#endif
@@ -1364,9 +1397,10 @@ static const char GetHandleARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char GetVertexAttribivARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetVertexAttribiv\0"
"glGetVertexAttribivARB\0"
"";
#endif
@@ -1378,10 +1412,10 @@ static const char GetCombinerInputParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_SUN_vertex)
-static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] =
- "ppp\0" /* Parameter signature */
- "glReplacementCodeuiNormal3fVertex3fvSUN\0"
+#if defined(need_GL_VERSION_2_0)
+static const char CreateProgram_names[] =
+ "\0" /* Parameter signature */
+ "glCreateProgram\0"
"";
#endif
@@ -1393,6 +1427,14 @@ static const char LoadTransposeMatrixdARB_names[] =
"";
#endif
+#if defined(need_GL_EXT_histogram)
+static const char GetMinmax_names[] =
+ "iiiip\0" /* Parameter signature */
+ "glGetMinmax\0"
+ "glGetMinmaxEXT\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_2_0)
static const char StencilFuncSeparate_names[] =
"iiii\0" /* Parameter signature */
@@ -1551,13 +1593,6 @@ static const char AlphaFragmentOp2ATI_names[] =
"";
#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 */
@@ -1618,9 +1653,10 @@ static const char VertexAttrib3dNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3dARB_names[] =
"iddd\0" /* Parameter signature */
+ "glVertexAttrib3d\0"
"glVertexAttrib3dARB\0"
"";
#endif
@@ -1632,9 +1668,10 @@ static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names[]
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4fARB_names[] =
"iffff\0" /* Parameter signature */
+ "glVertexAttrib4f\0"
"glVertexAttrib4fARB\0"
"";
#endif
@@ -1683,9 +1720,10 @@ static const char SecondaryColorPointerEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4fv\0"
"glVertexAttrib4fvARB\0"
"";
#endif
@@ -1697,9 +1735,10 @@ static const char ColorPointerListIBM_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetActiveUniformARB_names[] =
"iiipppp\0" /* Parameter signature */
+ "glGetActiveUniform\0"
"glGetActiveUniformARB\0"
"";
#endif
@@ -1741,6 +1780,13 @@ static const char DeformationMap3dSGIX_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_0)
+static const char IsShader_names[] =
+ "i\0" /* Parameter signature */
+ "glIsShader\0"
+ "";
+#endif
+
#if defined(need_GL_HP_image_transform)
static const char GetImageTransformParameterivHP_names[] =
"iip\0" /* Parameter signature */
@@ -1785,9 +1831,10 @@ static const char ResizeBuffersMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetUniformivARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetUniformiv\0"
"glGetUniformivARB\0"
"";
#endif
@@ -1879,10 +1926,10 @@ static const char MultiTexCoord3iARB_names[] =
"";
#endif
-#if defined(need_GL_EXT_convolution)
-static const char GetConvolutionFilterEXT_names[] =
- "iiip\0" /* Parameter signature */
- "glGetConvolutionFilterEXT\0"
+#if defined(need_GL_VERSION_2_0)
+static const char IsProgram_names[] =
+ "i\0" /* Parameter signature */
+ "glIsProgram\0"
"";
#endif
@@ -1921,6 +1968,14 @@ static const char VertexAttrib1dvNV_names[] =
"";
#endif
+#if defined(need_GL_EXT_texture_object)
+static const char GenTextures_names[] =
+ "ip\0" /* Parameter signature */
+ "glGenTextures\0"
+ "glGenTexturesEXT\0"
+ "";
+#endif
+
#if defined(need_GL_NV_fence)
static const char SetFenceNV_names[] =
"ii\0" /* Parameter signature */
@@ -2016,9 +2071,10 @@ static const char PointParameterivNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform2fv\0"
"glUniform2fvARB\0"
"";
#endif
@@ -2045,10 +2101,10 @@ static const char DeleteObjectARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
-static const char UseProgramObjectARB_names[] =
- "i\0" /* Parameter signature */
- "glUseProgramObjectARB\0"
+#if defined(need_GL_ARB_matrix_palette)
+static const char MatrixIndexPointerARB_names[] =
+ "iiip\0" /* Parameter signature */
+ "glMatrixIndexPointerARB\0"
"";
#endif
@@ -2073,10 +2129,18 @@ static const char BindFramebufferEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
-static const char VertexAttrib4usvARB_names[] =
- "ip\0" /* Parameter signature */
- "glVertexAttrib4usvARB\0"
+#if defined(need_GL_SGIX_reference_plane)
+static const char ReferencePlaneSGIX_names[] =
+ "p\0" /* Parameter signature */
+ "glReferencePlaneSGIX\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
+static const char ValidateProgramARB_names[] =
+ "i\0" /* Parameter signature */
+ "glValidateProgram\0"
+ "glValidateProgramARB\0"
"";
#endif
@@ -2118,9 +2182,10 @@ static const char CopyTexSubImage3D_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2dARB_names[] =
"idd\0" /* Parameter signature */
+ "glVertexAttrib2d\0"
"glVertexAttrib2dARB\0"
"";
#endif
@@ -2132,6 +2197,15 @@ static const char TextureColorMaskSGIS_names[] =
"";
#endif
+#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture)
+static const char GetColorTable_names[] =
+ "iiip\0" /* Parameter signature */
+ "glGetColorTable\0"
+ "glGetColorTableSGI\0"
+ "glGetColorTableEXT\0"
+ "";
+#endif
+
#if defined(need_GL_SGI_color_table)
static const char CopyColorTable_names[] =
"iiiii\0" /* Parameter signature */
@@ -2140,6 +2214,14 @@ static const char CopyColorTable_names[] =
"";
#endif
+#if defined(need_GL_EXT_histogram)
+static const char GetHistogramParameterfv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetHistogramParameterfv\0"
+ "glGetHistogramParameterfvEXT\0"
+ "";
+#endif
+
#if defined(need_GL_INTEL_parallel_arrays)
static const char ColorPointervINTEL_names[] =
"iip\0" /* Parameter signature */
@@ -2170,9 +2252,10 @@ static const char MultiTexCoord2sARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib1dv\0"
"glVertexAttrib1dvARB\0"
"";
#endif
@@ -2227,9 +2310,10 @@ static const char DeformSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char GetVertexAttribfvARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetVertexAttribfv\0"
"glGetVertexAttribfvARB\0"
"";
#endif
@@ -2242,6 +2326,13 @@ static const char SecondaryColor3ivEXT_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix4x2fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix4x2fv\0"
+ "";
+#endif
+
#if defined(need_GL_SGIS_detail_texture)
static const char GetDetailTexFuncSGIS_names[] =
"ip\0" /* Parameter signature */
@@ -2256,6 +2347,13 @@ static const char GetCombinerStageParameterfvNV_names[] =
"";
#endif
+#if defined(need_GL_EXT_coordinate_frame)
+static const char Binormal3fEXT_names[] =
+ "fff\0" /* Parameter signature */
+ "glBinormal3fEXT\0"
+ "";
+#endif
+
#if defined(need_GL_SUN_vertex)
static const char Color4ubVertex2fvSUN_names[] =
"pp\0" /* Parameter signature */
@@ -2278,9 +2376,10 @@ static const char SampleMaskSGIS_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_shader)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader)
static const char GetAttribLocationARB_names[] =
"ip\0" /* Parameter signature */
+ "glGetAttribLocation\0"
"glGetAttribLocationARB\0"
"";
#endif
@@ -2329,9 +2428,10 @@ static const char ProgramEnvParameter4fARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform3ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform3iv\0"
"glUniform3ivARB\0"
"";
#endif
@@ -2366,10 +2466,10 @@ static const char MultiTexCoord4ivARB_names[] =
"";
#endif
-#if defined(need_GL_EXT_gpu_program_parameters)
-static const char ProgramLocalParameters4fvEXT_names[] =
- "iiip\0" /* Parameter signature */
- "glProgramLocalParameters4fvEXT\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetVertexAttribPointervARB_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetVertexAttribPointerv\0"
"";
#endif
@@ -2380,9 +2480,10 @@ static const char GetMapAttribParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4sARB_names[] =
"iiiii\0" /* Parameter signature */
+ "glVertexAttrib4s\0"
"glVertexAttrib4sARB\0"
"";
#endif
@@ -2409,23 +2510,10 @@ static const char GenRenderbuffersEXT_names[] =
"";
#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)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib2dv\0"
"glVertexAttrib2dvARB\0"
"";
#endif
@@ -2451,9 +2539,10 @@ static const char WeightbvARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib2fv\0"
"glVertexAttrib2fvARB\0"
"";
#endif
@@ -2487,17 +2576,18 @@ static const char InstrumentsBufferSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NivARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Niv\0"
"glVertexAttrib4NivARB\0"
"";
#endif
-#if defined(need_GL_SUN_triangle_list)
-static const char ReplacementCodeuivSUN_names[] =
- "p\0" /* Parameter signature */
- "glReplacementCodeuivSUN\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetAttachedShaders_names[] =
+ "iipp\0" /* Parameter signature */
+ "glGetAttachedShaders\0"
"";
#endif
@@ -2515,6 +2605,13 @@ static const char ProgramEnvParameters4fvEXT_names[] =
"";
#endif
+#if defined(need_GL_SUN_vertex)
+static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] =
+ "pppp\0" /* Parameter signature */
+ "glTexCoord2fColor4fNormal3fVertex3fvSUN\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos)
static const char WindowPos2iMESA_names[] =
"ii\0" /* Parameter signature */
@@ -2554,17 +2651,26 @@ static const char GetProgramStringARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char CompileShaderARB_names[] =
"i\0" /* Parameter signature */
+ "glCompileShader\0"
"glCompileShaderARB\0"
"";
#endif
-#if defined(need_GL_NV_register_combiners)
-static const char CombinerOutputNV_names[] =
- "iiiiiiiiii\0" /* Parameter signature */
- "glCombinerOutputNV\0"
+#if defined(need_GL_VERSION_2_0)
+static const char DeleteShader_names[] =
+ "i\0" /* Parameter signature */
+ "glDeleteShader\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
+static const char Uniform3fARB_names[] =
+ "ifff\0" /* Parameter signature */
+ "glUniform3f\0"
+ "glUniform3fARB\0"
"";
#endif
@@ -2626,9 +2732,10 @@ static const char WindowPos4sMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NuivARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nuiv\0"
"glVertexAttrib4NuivARB\0"
"";
#endif
@@ -2655,9 +2762,10 @@ static const char ReplacementCodeusvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4fARB_names[] =
"iffff\0" /* Parameter signature */
+ "glUniform4f\0"
"glUniform4fARB\0"
"";
#endif
@@ -2713,6 +2821,14 @@ static const char Binormal3bvEXT_names[] =
"";
#endif
+#if defined(need_GL_EXT_texture_object)
+static const char IsTexture_names[] =
+ "i\0" /* Parameter signature */
+ "glIsTexture\0"
+ "glIsTextureEXT\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_vertex_weighting)
static const char VertexWeightfvEXT_names[] =
"p\0" /* Parameter signature */
@@ -2720,9 +2836,10 @@ static const char VertexWeightfvEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1dARB_names[] =
"id\0" /* Parameter signature */
+ "glVertexAttrib1d\0"
"glVertexAttrib1dARB\0"
"";
#endif
@@ -2763,13 +2880,6 @@ static const char CurrentPaletteMatrixARB_names[] =
"";
#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 */
@@ -2793,9 +2903,17 @@ static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_ARB_vertex_program)
+static const char VertexAttrib4usvARB_names[] =
+ "ip\0" /* Parameter signature */
+ "glVertexAttrib4usvARB\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char LinkProgramARB_names[] =
"i\0" /* Parameter signature */
+ "glLinkProgram\0"
"glLinkProgramARB\0"
"";
#endif
@@ -2807,9 +2925,10 @@ static const char VertexAttrib2fNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char ShaderSourceARB_names[] =
"iipp\0" /* Parameter signature */
+ "glShaderSource\0"
"glShaderSourceARB\0"
"";
#endif
@@ -2821,9 +2940,10 @@ static const char FragmentMaterialiSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib3sv\0"
"glVertexAttrib3svARB\0"
"";
#endif
@@ -2852,20 +2972,30 @@ static const char IsFramebufferEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform4iv\0"
"glUniform4ivARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char GetVertexAttribdvARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetVertexAttribdv\0"
"glGetVertexAttribdvARB\0"
"";
#endif
+#if defined(need_GL_EXT_convolution)
+static const char GetSeparableFilter_names[] =
+ "iiippp\0" /* Parameter signature */
+ "glGetSeparableFilter\0"
+ "glGetSeparableFilterEXT\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_coordinate_frame)
static const char Binormal3dEXT_names[] =
"ddd\0" /* Parameter signature */
@@ -2916,9 +3046,10 @@ static const char MultiDrawElementsEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform1iv\0"
"glUniform1ivARB\0"
"";
#endif
@@ -2962,16 +3093,18 @@ static const char SecondaryColor3ubvEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4dv\0"
"glVertexAttrib4dvARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_shader)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader)
static const char BindAttribLocationARB_names[] =
"iip\0" /* Parameter signature */
+ "glBindAttribLocation\0"
"glBindAttribLocationARB\0"
"";
#endif
@@ -2998,14 +3131,6 @@ static const char LightEnviSGIX_names[] =
"";
#endif
-#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture)
-static const char GetColorTableParameterivSGI_names[] =
- "iip\0" /* Parameter signature */
- "glGetColorTableParameterivSGI\0"
- "glGetColorTableParameterivEXT\0"
- "";
-#endif
-
#if defined(need_GL_SUN_triangle_list)
static const char ReplacementCodeuiSUN_names[] =
"i\0" /* Parameter signature */
@@ -3027,6 +3152,13 @@ static const char VertexAttribPointerNV_names[] =
"";
#endif
+#if defined(need_GL_EXT_gpu_program_parameters)
+static const char ProgramLocalParameters4fvEXT_names[] =
+ "iiip\0" /* Parameter signature */
+ "glProgramLocalParameters4fvEXT\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_framebuffer_object)
static const char GetFramebufferAttachmentParameterivEXT_names[] =
"iiip\0" /* Parameter signature */
@@ -3049,13 +3181,6 @@ static const char PixelTransformParameteriEXT_names[] =
"";
#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 */
@@ -3063,16 +3188,18 @@ static const char TexCoord2fColor4ubVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1iARB_names[] =
"ii\0" /* Parameter signature */
+ "glUniform1i\0"
"glUniform1iARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttribPointerARB_names[] =
"iiiiip\0" /* Parameter signature */
+ "glVertexAttribPointer\0"
"glVertexAttribPointerARB\0"
"";
#endif
@@ -3092,6 +3219,13 @@ static const char MultiTexCoord4fvARB_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix2x3fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix2x3fv\0"
+ "";
+#endif
+
#if defined(need_GL_NV_vertex_program)
static const char TrackMatrixNV_names[] =
"iiii\0" /* Parameter signature */
@@ -3134,16 +3268,18 @@ static const char Normal3fVertex3fvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NsvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nsv\0"
"glVertexAttrib4NsvARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib3fv\0"
"glVertexAttrib3fvARB\0"
"";
#endif
@@ -3206,10 +3342,19 @@ static const char PixelTexGenParameterfSGIS_names[] =
"";
#endif
-#if defined(need_GL_SUN_vertex)
-static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] =
- "pppp\0" /* Parameter signature */
- "glTexCoord2fColor4fNormal3fVertex3fvSUN\0"
+#if defined(need_GL_VERSION_2_0)
+static const char CreateShader_names[] =
+ "i\0" /* Parameter signature */
+ "glCreateShader\0"
+ "";
+#endif
+
+#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture)
+static const char GetColorTableParameterfv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetColorTableParameterfv\0"
+ "glGetColorTableParameterfvSGI\0"
+ "glGetColorTableParameterfvEXT\0"
"";
#endif
@@ -3263,16 +3408,17 @@ static const char FragmentLightfvSGIX_names[] =
"";
#endif
-#if defined(need_GL_NV_vertex_program)
-static const char VertexAttrib3sNV_names[] =
- "iiii\0" /* Parameter signature */
- "glVertexAttrib3sNV\0"
+#if defined(need_GL_VERSION_2_0)
+static const char DetachShader_names[] =
+ "ii\0" /* Parameter signature */
+ "glDetachShader\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NubARB_names[] =
"iiiii\0" /* Parameter signature */
+ "glVertexAttrib4Nub\0"
"glVertexAttrib4NubARB\0"
"";
#endif
@@ -3298,9 +3444,10 @@ static const char VertexAttrib3svNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform4fv\0"
"glUniform4fvARB\0"
"";
#endif
@@ -3320,9 +3467,10 @@ static const char ColorFragmentOp1ATI_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetUniformfvARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetUniformfv\0"
"glGetUniformfvARB\0"
"";
#endif
@@ -3416,6 +3564,14 @@ static const char GetProgramivNV_names[] =
"";
#endif
+#if defined(need_GL_EXT_histogram)
+static const char GetMinmaxParameteriv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetMinmaxParameteriv\0"
+ "glGetMinmaxParameterivEXT\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_copy_texture)
static const char CopyTexImage1D_names[] =
"iiiiiii\0" /* Parameter signature */
@@ -3459,9 +3615,10 @@ static const char GetMapParameterivNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4iARB_names[] =
"iiiii\0" /* Parameter signature */
+ "glUniform4i\0"
"glUniform4iARB\0"
"";
#endif
@@ -3489,6 +3646,22 @@ static const char ConvolutionParameterf_names[] =
"";
#endif
+#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture)
+static const char GetColorTableParameteriv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetColorTableParameteriv\0"
+ "glGetColorTableParameterivSGI\0"
+ "glGetColorTableParameterivEXT\0"
+ "";
+#endif
+
+#if defined(need_GL_ARB_vertex_program)
+static const char ProgramEnvParameter4dvARB_names[] =
+ "iip\0" /* Parameter signature */
+ "glProgramEnvParameter4dvARB\0"
+ "";
+#endif
+
#if defined(need_GL_NV_vertex_program)
static const char VertexAttribs2fvNV_names[] =
"iip\0" /* Parameter signature */
@@ -3496,10 +3669,11 @@ static const char VertexAttribs2fvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_matrix_palette)
-static const char MatrixIndexPointerARB_names[] =
- "iiip\0" /* Parameter signature */
- "glMatrixIndexPointerARB\0"
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
+static const char UseProgramObjectARB_names[] =
+ "i\0" /* Parameter signature */
+ "glUseProgram\0"
+ "glUseProgramObjectARB\0"
"";
#endif
@@ -3517,10 +3691,10 @@ static const char PassTexCoordATI_names[] =
"";
#endif
-#if defined(need_GL_NV_vertex_program)
-static const char VertexAttrib1fvNV_names[] =
- "ip\0" /* Parameter signature */
- "glVertexAttrib1fvNV\0"
+#if defined(need_GL_VERSION_2_0)
+static const char DeleteProgram_names[] =
+ "i\0" /* Parameter signature */
+ "glDeleteProgram\0"
"";
#endif
@@ -3569,14 +3743,6 @@ static const char MultiTexCoord4dARB_names[] =
"";
#endif
-#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture)
-static const char GetColorTableSGI_names[] =
- "iiip\0" /* Parameter signature */
- "glGetColorTableSGI\0"
- "glGetColorTableEXT\0"
- "";
-#endif
-
#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color)
static const char SecondaryColor3usEXT_names[] =
"iii\0" /* Parameter signature */
@@ -3631,20 +3797,14 @@ static const char MultiTexCoord1dvARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2iARB_names[] =
"iii\0" /* Parameter signature */
+ "glUniform2i\0"
"glUniform2iARB\0"
"";
#endif
-#if defined(need_GL_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 */
@@ -3703,13 +3863,6 @@ static const char ResetMinmax_names[] =
"";
#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 */
@@ -3717,10 +3870,18 @@ static const char SpriteParameterfSGIX_names[] =
"";
#endif
-#if defined(need_GL_EXT_histogram)
-static const char GetMinmaxParameterivEXT_names[] =
+#if defined(need_GL_NV_vertex_program)
+static const char VertexAttrib4sNV_names[] =
+ "iiiii\0" /* Parameter signature */
+ "glVertexAttrib4sNV\0"
+ "";
+#endif
+
+#if defined(need_GL_EXT_convolution)
+static const char GetConvolutionParameterfv_names[] =
"iip\0" /* Parameter signature */
- "glGetMinmaxParameterivEXT\0"
+ "glGetConvolutionParameterfv\0"
+ "glGetConvolutionParameterfvEXT\0"
"";
#endif
@@ -3731,9 +3892,10 @@ static const char VertexAttribs4dvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4dARB_names[] =
"idddd\0" /* Parameter signature */
+ "glVertexAttrib4d\0"
"glVertexAttrib4dARB\0"
"";
#endif
@@ -3827,6 +3989,14 @@ static const char GetProgramLocalParameterdvARB_names[] =
"";
#endif
+#if defined(need_GL_EXT_histogram)
+static const char GetHistogramParameteriv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetHistogramParameteriv\0"
+ "glGetHistogramParameterivEXT\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_3)
static const char MultiTexCoord1iARB_names[] =
"ii\0" /* Parameter signature */
@@ -3835,6 +4005,14 @@ static const char MultiTexCoord1iARB_names[] =
"";
#endif
+#if defined(need_GL_EXT_convolution)
+static const char GetConvolutionFilter_names[] =
+ "iiip\0" /* Parameter signature */
+ "glGetConvolutionFilter\0"
+ "glGetConvolutionFilterEXT\0"
+ "";
+#endif
+
#if defined(need_GL_ARB_vertex_program)
static const char GetProgramivARB_names[] =
"iip\0" /* Parameter signature */
@@ -3879,10 +4057,10 @@ static const char Binormal3dvEXT_names[] =
"";
#endif
-#if defined(need_GL_EXT_texture_object)
-static const char AreTexturesResidentEXT_names[] =
- "ipp\0" /* Parameter signature */
- "glAreTexturesResidentEXT\0"
+#if defined(need_GL_NV_fence)
+static const char FinishFenceNV_names[] =
+ "i\0" /* Parameter signature */
+ "glFinishFenceNV\0"
"";
#endif
@@ -3893,9 +4071,10 @@ static const char GetFogFuncSGIS_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetUniformLocationARB_names[] =
"ip\0" /* Parameter signature */
+ "glGetUniformLocation\0"
"glGetUniformLocationARB\0"
"";
#endif
@@ -3915,13 +4094,21 @@ static const char CombinerInputNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3sARB_names[] =
"iiii\0" /* Parameter signature */
+ "glVertexAttrib3s\0"
"glVertexAttrib3sARB\0"
"";
#endif
+#if defined(need_GL_SUN_vertex)
+static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] =
+ "ppp\0" /* Parameter signature */
+ "glReplacementCodeuiNormal3fVertex3fvSUN\0"
+ "";
+#endif
+
#if defined(need_GL_ARB_vertex_program)
static const char ProgramStringARB_names[] =
"iiip\0" /* Parameter signature */
@@ -3937,6 +4124,13 @@ static const char TexCoord4fVertex4fvSUN_names[] =
#endif
#if defined(need_GL_NV_vertex_program)
+static const char VertexAttrib3sNV_names[] =
+ "iiii\0" /* Parameter signature */
+ "glVertexAttrib3sNV\0"
+ "";
+#endif
+
+#if defined(need_GL_NV_vertex_program)
static const char VertexAttrib1fNV_names[] =
"if\0" /* Parameter signature */
"glVertexAttrib1fNV\0"
@@ -3965,6 +4159,14 @@ static const char VertexWeightPointerEXT_names[] =
"";
#endif
+#if defined(need_GL_EXT_histogram)
+static const char GetHistogram_names[] =
+ "iiiip\0" /* Parameter signature */
+ "glGetHistogram\0"
+ "glGetHistogramEXT\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_stencil_two_side)
static const char ActiveStencilFaceEXT_names[] =
"i\0" /* Parameter signature */
@@ -3972,9 +4174,10 @@ static const char ActiveStencilFaceEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetShaderSourceARB_names[] =
"iipp\0" /* Parameter signature */
+ "glGetShaderSource\0"
"glGetShaderSourceARB\0"
"";
#endif
@@ -4089,9 +4292,10 @@ static const char WeightsvARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform1fv\0"
"glUniform1fvARB\0"
"";
#endif
@@ -4134,9 +4338,17 @@ static const char VertexAttribs3svNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_SUN_triangle_list)
+static const char ReplacementCodeuivSUN_names[] =
+ "p\0" /* Parameter signature */
+ "glReplacementCodeuivSUN\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char EnableVertexAttribArrayARB_names[] =
"i\0" /* Parameter signature */
+ "glEnableVertexAttribArray\0"
"glEnableVertexAttribArrayARB\0"
"";
#endif
@@ -4165,13 +4377,6 @@ static const char WindowPos3ivMESA_names[] =
"";
#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 */
@@ -4201,10 +4406,10 @@ static const char Tangent3bvEXT_names[] =
"";
#endif
-#if defined(need_GL_SGIX_reference_plane)
-static const char ReferencePlaneSGIX_names[] =
- "p\0" /* Parameter signature */
- "glReferencePlaneSGIX\0"
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix3x4fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix3x4fv\0"
"";
#endif
@@ -4215,13 +4420,6 @@ static const char Binormal3fvEXT_names[] =
"";
#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 */
@@ -4297,9 +4495,10 @@ static const char BindProgramNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4sv\0"
"glVertexAttrib4svARB\0"
"";
#endif
@@ -4311,10 +4510,10 @@ static const char CreateDebugObjectMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
-static const char Uniform3fARB_names[] =
- "ifff\0" /* Parameter signature */
- "glUniform3fARB\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetShaderiv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetShaderiv\0"
"";
#endif
@@ -4370,9 +4569,17 @@ static const char GetFinalCombinerInputParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_ATI_fragment_shader)
+static const char ColorFragmentOp3ATI_names[] =
+ "iiiiiiiiiiiii\0" /* Parameter signature */
+ "glColorFragmentOp3ATI\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib2sv\0"
"glVertexAttrib2svARB\0"
"";
#endif
@@ -4415,9 +4622,10 @@ static const char PollInstrumentsSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NubvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nubv\0"
"glVertexAttrib4NubvARB\0"
"";
#endif
@@ -4522,9 +4730,10 @@ static const char WeightuivARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2sARB_names[] =
"iii\0" /* Parameter signature */
+ "glVertexAttrib2s\0"
"glVertexAttrib2sARB\0"
"";
#endif
@@ -4572,9 +4781,25 @@ static const char EdgeFlagPointerListIBM_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix3x2fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix3x2fv\0"
+ "";
+#endif
+
+#if defined(need_GL_EXT_histogram)
+static const char GetMinmaxParameterfv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetMinmaxParameterfv\0"
+ "glGetMinmaxParameterfvEXT\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib1fv\0"
"glVertexAttrib1fvARB\0"
"";
#endif
@@ -4681,9 +4906,9 @@ static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = {
static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = {
{ MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 },
{ MatrixIndexuivARB_names, MatrixIndexuivARB_remap_index, -1 },
+ { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 },
{ CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 },
{ MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 },
- { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -4736,26 +4961,26 @@ static const struct dri_extension_function GL_ARB_shader_objects_functions[] = {
{ GetUniformivARB_names, GetUniformivARB_remap_index, -1 },
{ Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 },
{ DeleteObjectARB_names, DeleteObjectARB_remap_index, -1 },
- { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 },
+ { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 },
{ Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 },
{ CompileShaderARB_names, CompileShaderARB_remap_index, -1 },
+ { Uniform3fARB_names, Uniform3fARB_remap_index, -1 },
{ Uniform4fARB_names, Uniform4fARB_remap_index, -1 },
{ LinkProgramARB_names, LinkProgramARB_remap_index, -1 },
{ ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 },
{ Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 },
{ Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 },
- { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 },
{ Uniform1iARB_names, Uniform1iARB_remap_index, -1 },
{ Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 },
{ GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 },
{ DetachObjectARB_names, DetachObjectARB_remap_index, -1 },
{ Uniform4iARB_names, Uniform4iARB_remap_index, -1 },
+ { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 },
{ Uniform2iARB_names, Uniform2iARB_remap_index, -1 },
{ GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, -1 },
{ GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 },
{ GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 },
{ Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 },
- { Uniform3fARB_names, Uniform3fARB_remap_index, -1 },
{ GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, -1 },
{ GetInfoLogARB_names, GetInfoLogARB_remap_index, -1 },
{ NULL, 0, 0 }
@@ -4820,7 +5045,6 @@ static const struct dri_extension_function GL_ARB_vertex_buffer_object_functions
#if defined(need_GL_ARB_vertex_program)
static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
- { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 },
{ VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 },
{ VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 },
{ VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 },
@@ -4840,7 +5064,6 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
{ VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 },
{ VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 },
{ ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, -1 },
- { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 },
{ VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 },
{ VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 },
{ GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 },
@@ -4855,6 +5078,7 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
{ IsProgramNV_names, IsProgramNV_remap_index, -1 },
{ ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 },
{ VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 },
+ { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 },
{ VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 },
{ GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 },
{ VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 },
@@ -4863,6 +5087,7 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
{ VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 },
{ VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 },
{ GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, -1 },
+ { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 },
{ ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, -1 },
{ DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 },
{ GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 },
@@ -4933,7 +5158,6 @@ static const struct dri_extension_function GL_ATI_draw_buffers_functions[] = {
#if defined(need_GL_ATI_fragment_shader)
static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = {
- { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 },
{ ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, -1 },
{ DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, -1 },
{ SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, -1 },
@@ -4945,6 +5169,7 @@ static const struct dri_extension_function GL_ATI_fragment_shader_functions[] =
{ PassTexCoordATI_names, PassTexCoordATI_remap_index, -1 },
{ BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, -1 },
{ BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, -1 },
+ { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 },
{ GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, -1 },
{ EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, -1 },
{ NULL, 0, 0 }
@@ -4999,16 +5224,16 @@ static const struct dri_extension_function GL_EXT_compiled_vertex_array_function
static const struct dri_extension_function GL_EXT_convolution_functions[] = {
{ ConvolutionFilter1D_names, -1, 348 },
{ CopyConvolutionFilter1D_names, -1, 354 },
+ { GetConvolutionParameteriv_names, -1, 358 },
{ ConvolutionFilter2D_names, -1, 349 },
{ ConvolutionParameteriv_names, -1, 353 },
{ ConvolutionParameterfv_names, -1, 351 },
- { GetSeparableFilterEXT_names, GetSeparableFilterEXT_remap_index, -1 },
- { GetConvolutionFilterEXT_names, GetConvolutionFilterEXT_remap_index, -1 },
- { GetConvolutionParameterfvEXT_names, GetConvolutionParameterfvEXT_remap_index, -1 },
+ { GetSeparableFilter_names, -1, 359 },
{ SeparableFilter2D_names, -1, 360 },
{ ConvolutionParameteri_names, -1, 352 },
{ ConvolutionParameterf_names, -1, 350 },
- { GetConvolutionParameterivEXT_names, GetConvolutionParameterivEXT_remap_index, -1 },
+ { GetConvolutionParameterfv_names, -1, 357 },
+ { GetConvolutionFilter_names, -1, 356 },
{ CopyConvolutionFilter2D_names, -1, 355 },
{ NULL, 0, 0 }
};
@@ -5016,11 +5241,11 @@ static const struct dri_extension_function GL_EXT_convolution_functions[] = {
#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 },
+ { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 },
{ Tangent3dvEXT_names, Tangent3dvEXT_remap_index, -1 },
{ Binormal3bvEXT_names, Binormal3bvEXT_remap_index, -1 },
{ Binormal3dEXT_names, Binormal3dEXT_remap_index, -1 },
@@ -5118,8 +5343,8 @@ static const struct dri_extension_function GL_EXT_framebuffer_object_functions[]
#if defined(need_GL_EXT_gpu_program_parameters)
static const struct dri_extension_function GL_EXT_gpu_program_parameters_functions[] = {
- { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 },
{ ProgramEnvParameters4fvEXT_names, ProgramEnvParameters4fvEXT_remap_index, -1 },
+ { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5127,15 +5352,15 @@ static const struct dri_extension_function GL_EXT_gpu_program_parameters_functio
#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, -1 },
{ ResetHistogram_names, -1, 369 },
- { GetMinmaxEXT_names, GetMinmaxEXT_remap_index, -1 },
- { GetHistogramParameterfvEXT_names, GetHistogramParameterfvEXT_remap_index, -1 },
- { GetHistogramEXT_names, GetHistogramEXT_remap_index, -1 },
- { GetMinmaxParameterfvEXT_names, GetMinmaxParameterfvEXT_remap_index, -1 },
+ { GetMinmax_names, -1, 364 },
+ { GetHistogramParameterfv_names, -1, 362 },
+ { GetMinmaxParameteriv_names, -1, 366 },
{ ResetMinmax_names, -1, 370 },
- { GetMinmaxParameterivEXT_names, GetMinmaxParameterivEXT_remap_index, -1 },
+ { GetHistogramParameteriv_names, -1, 363 },
+ { GetHistogram_names, -1, 361 },
{ Minmax_names, -1, 368 },
+ { GetMinmaxParameterfv_names, -1, 365 },
{ NULL, 0, 0 }
};
#endif
@@ -5181,10 +5406,10 @@ static const struct dri_extension_function GL_EXT_multisample_functions[] = {
#if defined(need_GL_EXT_paletted_texture)
static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = {
- { GetColorTableParameterfvSGI_names, GetColorTableParameterfvSGI_remap_index, -1 },
{ ColorTable_names, -1, 339 },
- { GetColorTableParameterivSGI_names, GetColorTableParameterivSGI_remap_index, -1 },
- { GetColorTableSGI_names, GetColorTableSGI_remap_index, -1 },
+ { GetColorTable_names, -1, 343 },
+ { GetColorTableParameterfv_names, -1, 344 },
+ { GetColorTableParameteriv_names, -1, 345 },
{ NULL, 0, 0 }
};
#endif
@@ -5263,11 +5488,11 @@ static const struct dri_extension_function GL_EXT_texture3D_functions[] = {
#if defined(need_GL_EXT_texture_object)
static const struct dri_extension_function GL_EXT_texture_object_functions[] = {
{ PrioritizeTextures_names, -1, 331 },
+ { AreTexturesResident_names, -1, 322 },
+ { GenTextures_names, -1, 328 },
{ DeleteTextures_names, -1, 327 },
- { GenTexturesEXT_names, GenTexturesEXT_remap_index, -1 },
- { AreTexturesResidentEXT_names, AreTexturesResidentEXT_remap_index, -1 },
+ { IsTexture_names, -1, 330 },
{ BindTexture_names, -1, 307 },
- { IsTextureEXT_names, IsTextureEXT_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5459,12 +5684,12 @@ static const struct dri_extension_function GL_NV_point_sprite_functions[] = {
#if defined(need_GL_NV_register_combiners)
static const struct dri_extension_function GL_NV_register_combiners_functions[] = {
+ { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 },
{ CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, -1 },
{ GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, -1 },
{ FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, -1 },
{ GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, -1 },
{ GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, -1 },
- { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 },
{ CombinerParameteriNV_names, CombinerParameteriNV_remap_index, -1 },
{ GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, -1 },
{ CombinerInputNV_names, CombinerInputNV_remap_index, -1 },
@@ -5498,6 +5723,7 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
{ VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 },
{ VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 },
{ VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 },
+ { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 },
{ ProgramParameter4dvNV_names, ProgramParameter4dvNV_remap_index, -1 },
{ VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 },
{ VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, -1 },
@@ -5524,14 +5750,12 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
{ VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, -1 },
{ VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, -1 },
{ IsProgramNV_names, IsProgramNV_remap_index, -1 },
- { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 },
{ VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, -1 },
{ RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, -1 },
{ ExecuteProgramNV_names, ExecuteProgramNV_remap_index, -1 },
{ VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, -1 },
{ TrackMatrixNV_names, TrackMatrixNV_remap_index, -1 },
{ GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, -1 },
- { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 },
{ GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, -1 },
{ VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, -1 },
{ ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, -1 },
@@ -5539,12 +5763,13 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
{ GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, -1 },
{ VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, -1 },
{ VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, -1 },
- { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 },
{ DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 },
{ GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 },
{ GetProgramStringNV_names, GetProgramStringNV_remap_index, -1 },
+ { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 },
{ VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, -1 },
{ ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, -1 },
+ { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 },
{ VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, -1 },
{ VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, -1 },
{ VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, -1 },
@@ -5768,13 +5993,13 @@ static const struct dri_extension_function GL_SGIX_tag_sample_buffer_functions[]
#if defined(need_GL_SGI_color_table)
static const struct dri_extension_function GL_SGI_color_table_functions[] = {
- { GetColorTableParameterfvSGI_names, GetColorTableParameterfvSGI_remap_index, -1 },
{ ColorTableParameteriv_names, -1, 341 },
{ ColorTable_names, -1, 339 },
+ { GetColorTable_names, -1, 343 },
{ CopyColorTable_names, -1, 342 },
{ ColorTableParameterfv_names, -1, 340 },
- { GetColorTableParameterivSGI_names, GetColorTableParameterivSGI_remap_index, -1 },
- { GetColorTableSGI_names, GetColorTableSGI_remap_index, -1 },
+ { GetColorTableParameterfv_names, -1, 344 },
+ { GetColorTableParameteriv_names, -1, 345 },
{ NULL, 0, 0 }
};
#endif
@@ -5811,11 +6036,11 @@ static const struct dri_extension_function GL_SUN_mesh_array_functions[] = {
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 },
+ { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5837,7 +6062,6 @@ static const struct dri_extension_function GL_SUN_vertex_functions[] = {
{ ReplacementCodeuiTexCoord2fVertex3fSUN_names, ReplacementCodeuiTexCoord2fVertex3fSUN_remap_index, -1 },
{ TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_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 },
@@ -5848,18 +6072,19 @@ static const struct dri_extension_function GL_SUN_vertex_functions[] = {
{ Color4ubVertex2fvSUN_names, Color4ubVertex2fvSUN_remap_index, -1 },
{ Normal3fVertex3fSUN_names, Normal3fVertex3fSUN_remap_index, -1 },
{ ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fSUN_remap_index, -1 },
+ { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 },
{ TexCoord2fVertex3fvSUN_names, TexCoord2fVertex3fvSUN_remap_index, -1 },
{ Color4ubVertex2fSUN_names, Color4ubVertex2fSUN_remap_index, -1 },
{ ReplacementCodeuiColor4ubVertex3fSUN_names, ReplacementCodeuiColor4ubVertex3fSUN_remap_index, -1 },
{ TexCoord2fColor4ubVertex3fSUN_names, TexCoord2fColor4ubVertex3fSUN_remap_index, -1 },
{ Normal3fVertex3fvSUN_names, Normal3fVertex3fvSUN_remap_index, -1 },
{ Color4fNormal3fVertex3fSUN_names, Color4fNormal3fVertex3fSUN_remap_index, -1 },
- { 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 },
+ { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 },
{ TexCoord4fVertex4fvSUN_names, TexCoord4fVertex4fvSUN_remap_index, -1 },
{ ReplacementCodeuiVertex3fSUN_names, ReplacementCodeuiVertex3fSUN_remap_index, -1 },
{ NULL, 0, 0 }
@@ -5996,11 +6221,106 @@ static const struct dri_extension_function GL_VERSION_1_5_functions[] = {
#if defined(need_GL_VERSION_2_0)
static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
+ { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 },
+ { GetProgramiv_names, GetProgramiv_remap_index, -1 },
{ BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 },
+ { AttachShader_names, AttachShader_remap_index, -1 },
+ { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 },
+ { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 },
+ { Uniform2fARB_names, Uniform2fARB_remap_index, -1 },
+ { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 },
+ { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 },
+ { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 },
+ { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 },
+ { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 },
{ StencilMaskSeparate_names, StencilMaskSeparate_remap_index, -1 },
+ { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 },
+ { GetProgramInfoLog_names, GetProgramInfoLog_remap_index, -1 },
+ { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 },
+ { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 },
+ { Uniform3iARB_names, Uniform3iARB_remap_index, -1 },
+ { GetShaderInfoLog_names, GetShaderInfoLog_remap_index, -1 },
+ { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 },
+ { Uniform1fARB_names, Uniform1fARB_remap_index, -1 },
{ StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 },
+ { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 },
+ { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 },
+ { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 },
+ { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 },
+ { CreateProgram_names, CreateProgram_remap_index, -1 },
{ StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 },
+ { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 },
+ { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 },
+ { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 },
+ { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 },
+ { IsShader_names, IsShader_remap_index, -1 },
+ { GetUniformivARB_names, GetUniformivARB_remap_index, -1 },
+ { IsProgram_names, IsProgram_remap_index, -1 },
+ { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 },
+ { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 },
+ { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 },
+ { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 },
+ { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 },
+ { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 },
+ { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 },
+ { GetVertexAttribPointervARB_names, GetVertexAttribPointervARB_remap_index, -1 },
+ { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 },
+ { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 },
+ { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 },
+ { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 },
+ { GetAttachedShaders_names, GetAttachedShaders_remap_index, -1 },
+ { CompileShaderARB_names, CompileShaderARB_remap_index, -1 },
+ { DeleteShader_names, DeleteShader_remap_index, -1 },
+ { Uniform3fARB_names, Uniform3fARB_remap_index, -1 },
+ { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 },
+ { Uniform4fARB_names, Uniform4fARB_remap_index, -1 },
+ { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 },
+ { LinkProgramARB_names, LinkProgramARB_remap_index, -1 },
+ { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 },
+ { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 },
+ { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 },
+ { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 },
+ { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 },
+ { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 },
+ { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 },
+ { Uniform1iARB_names, Uniform1iARB_remap_index, -1 },
+ { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 },
+ { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 },
+ { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 },
+ { CreateShader_names, CreateShader_remap_index, -1 },
+ { DetachShader_names, DetachShader_remap_index, -1 },
+ { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 },
+ { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 },
+ { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 },
+ { Uniform4iARB_names, Uniform4iARB_remap_index, -1 },
+ { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 },
+ { DeleteProgram_names, DeleteProgram_remap_index, -1 },
+ { Uniform2iARB_names, Uniform2iARB_remap_index, -1 },
+ { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 },
+ { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 },
+ { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 },
+ { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 },
{ DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 },
+ { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 },
+ { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 },
+ { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 },
+ { GetShaderiv_names, GetShaderiv_remap_index, -1 },
+ { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 },
+ { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 },
+ { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 },
+ { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 },
+ { NULL, 0, 0 }
+};
+#endif
+
+#if defined(need_GL_VERSION_2_1)
+static const struct dri_extension_function GL_VERSION_2_1_functions[] = {
+ { UniformMatrix2x4fv_names, UniformMatrix2x4fv_remap_index, -1 },
+ { UniformMatrix4x3fv_names, UniformMatrix4x3fv_remap_index, -1 },
+ { UniformMatrix4x2fv_names, UniformMatrix4x2fv_remap_index, -1 },
+ { UniformMatrix2x3fv_names, UniformMatrix2x3fv_remap_index, -1 },
+ { UniformMatrix3x4fv_names, UniformMatrix3x4fv_remap_index, -1 },
+ { UniformMatrix3x2fv_names, UniformMatrix3x2fv_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 74ed299a628..6a189e72858 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -421,6 +421,19 @@ driCheckDriDdxDrmVersions2(const char * driver_name,
+GLint
+driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 )
+{
+ if (rect2.x1 > rect1.x1) rect1.x1 = rect2.x1;
+ if (rect2.x2 < rect1.x2) rect1.x2 = rect2.x2;
+ if (rect2.y1 > rect1.y1) rect1.y1 = rect2.y1;
+ if (rect2.y2 < rect1.y2) rect1.y2 = rect2.y2;
+
+ if (rect1.x1 > rect1.x2 || rect1.y1 > rect1.y2) return 0;
+
+ return (rect1.x2 - rect1.x1) * (rect1.y2 - rect1.y1);
+}
+
GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer,
GLint *x, GLint *y,
GLsizei *width, GLsizei *height )
diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h
index 26d178f7478..b2bab86e66c 100644
--- a/src/mesa/drivers/dri/common/utils.h
+++ b/src/mesa/drivers/dri/common/utils.h
@@ -106,6 +106,8 @@ extern GLboolean driCheckDriDdxDrmVersions3(const char * driver_name,
const __DRIversion * ddxActual, const __DRIutilversion2 * ddxExpected,
const __DRIversion * drmActual, const __DRIversion * drmExpected);
+extern GLint driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 );
+
extern GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer,
GLint *x, GLint *y,
GLsizei *width, GLsizei *height );
diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c
index eebe42d96a1..e7ed545f13c 100644
--- a/src/mesa/drivers/dri/common/vblank.c
+++ b/src/mesa/drivers/dri/common/vblank.c
@@ -210,20 +210,6 @@ GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache )
/****************************************************************************/
/**
- * 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
@@ -262,6 +248,71 @@ static int do_wait( drmVBlank * vbl, GLuint * vbl_seq, int fd )
/****************************************************************************/
/**
+ * Sets the default swap interval when the drawable is first bound to a
+ * direct rendering context.
+ */
+
+void driDrawableInitVBlank( __DRIdrawablePrivate *priv, GLuint flags,
+ GLuint *vbl_seq )
+{
+ if ( priv->pdraw->swap_interval == (unsigned)-1 ) {
+ /* Get current vertical blank sequence */
+ drmVBlank vbl = { .request={ .type = DRM_VBLANK_RELATIVE, .sequence = 0 } };
+ do_wait( &vbl, vbl_seq, priv->driScreenPriv->fd );
+
+ priv->pdraw->swap_interval = (flags & (VBLANK_FLAG_THROTTLE |
+ VBLANK_FLAG_SYNC)) != 0 ? 1 : 0;
+ }
+}
+
+
+/****************************************************************************/
+/**
+ * Returns the current swap interval of the given drawable.
+ */
+
+unsigned
+driGetVBlankInterval( const __DRIdrawablePrivate *priv, GLuint flags )
+{
+ if ( (flags & VBLANK_FLAG_INTERVAL) != 0 ) {
+ /* this must have been initialized when the drawable was first bound
+ * to a direct rendering context. */
+ assert ( priv->pdraw->swap_interval != (unsigned)-1 );
+
+ return priv->pdraw->swap_interval;
+ }
+ else if ( (flags & (VBLANK_FLAG_THROTTLE | VBLANK_FLAG_SYNC)) != 0 ) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+
+/****************************************************************************/
+/**
+ * Returns the current vertical blank sequence number of the given drawable.
+ */
+
+void
+driGetCurrentVBlank( const __DRIdrawablePrivate *priv, GLuint flags,
+ GLuint *vbl_seq )
+{
+ drmVBlank vbl;
+
+ vbl.request.type = DRM_VBLANK_RELATIVE;
+ if ( flags & VBLANK_FLAG_SECONDARY ) {
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
+ }
+ vbl.request.sequence = 0;
+
+ (void) do_wait( &vbl, vbl_seq, priv->driScreenPriv->fd );
+}
+
+
+/****************************************************************************/
+/**
* Waits for the vertical blank for use with glXSwapBuffers.
*
* \param vbl_seq Vertical blank sequence number (MSC) after the last buffer
@@ -282,7 +333,7 @@ driWaitForVBlank( const __DRIdrawablePrivate *priv, GLuint * vbl_seq,
unsigned original_seq;
unsigned deadline;
unsigned interval;
-
+ unsigned diff;
*missed_deadline = GL_FALSE;
if ( (flags & (VBLANK_FLAG_INTERVAL |
@@ -304,44 +355,40 @@ driWaitForVBlank( const __DRIdrawablePrivate *priv, GLuint * vbl_seq,
*/
original_seq = *vbl_seq;
+ interval = driGetVBlankInterval(priv, flags);
+ deadline = original_seq + interval;
- vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0;
vbl.request.type = DRM_VBLANK_RELATIVE;
-
+ if ( flags & VBLANK_FLAG_SECONDARY ) {
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
+ }
+ vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0;
+
if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) {
return -1;
}
-
- vbl.request.type = DRM_VBLANK_ABSOLUTE;
+ diff = *vbl_seq - deadline;
- 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;
+ /* No need to wait again if we've already reached the target */
+ if (diff <= (1 << 23)) {
+ *missed_deadline = (flags & VBLANK_FLAG_SYNC) ? (diff > 0) : GL_TRUE;
+ return 0;
}
+ /* Wait until the target vertical blank. */
+ vbl.request.type = DRM_VBLANK_ABSOLUTE;
+ if ( flags & VBLANK_FLAG_SECONDARY ) {
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
+ }
+ vbl.request.sequence = deadline;
- /* 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;
- }
+ if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) {
+ return -1;
}
- deadline = original_seq + ((interval == 0) ? 1 : interval);
- *missed_deadline = ( *vbl_seq > deadline );
+ diff = *vbl_seq - deadline;
+ *missed_deadline = diff > 0 && diff <= (1 << 23);
return 0;
}
diff --git a/src/mesa/drivers/dri/common/vblank.h b/src/mesa/drivers/dri/common/vblank.h
index 3dc965def1a..ec83adc78dd 100644
--- a/src/mesa/drivers/dri/common/vblank.h
+++ b/src/mesa/drivers/dri/common/vblank.h
@@ -42,12 +42,19 @@
*/
#define VBLANK_FLAG_NO_IRQ (1U << 7) /* DRM has no IRQ to wait on.
*/
+#define VBLANK_FLAG_SECONDARY (1U << 8) /* Wait for secondary vblank.
+ */
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 void driDrawableInitVBlank ( __DRIdrawablePrivate *priv, GLuint flags,
+ GLuint *vbl_seq );
+extern unsigned driGetVBlankInterval( const __DRIdrawablePrivate *priv,
+ GLuint flags );
+extern void driGetCurrentVBlank( const __DRIdrawablePrivate *priv,
+ GLuint flags, GLuint *vbl_seq );
extern int driWaitForVBlank( const __DRIdrawablePrivate *priv,
GLuint * vbl_seq, GLuint flags, GLboolean * missed_deadline );
diff --git a/src/mesa/drivers/dri/common/xmlpool/options.h b/src/mesa/drivers/dri/common/xmlpool/options.h
index a0d617c3444..5cef72867b1 100644
--- a/src/mesa/drivers/dri/common/xmlpool/options.h
+++ b/src/mesa/drivers/dri/common/xmlpool/options.h
@@ -88,6 +88,11 @@ DRI_CONF_SECTION_BEGIN \
DRI_CONF_DESC(nl,"Beeldkwaliteit") \
DRI_CONF_DESC(fr,"Qualité d'image")
+#define DRI_CONF_EXCESS_MIPMAP(def) \
+DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \
+ DRI_CONF_DESC(en,"Enable extra mipmap level") \
+DRI_CONF_OPT_END
+
#define DRI_CONF_TEXTURE_DEPTH_FB 0
#define DRI_CONF_TEXTURE_DEPTH_32 1
#define DRI_CONF_TEXTURE_DEPTH_16 2
diff --git a/src/mesa/drivers/dri/common/xmlpool/t_options.h b/src/mesa/drivers/dri/common/xmlpool/t_options.h
index 0330f7560ef..4df1916aad0 100644
--- a/src/mesa/drivers/dri/common/xmlpool/t_options.h
+++ b/src/mesa/drivers/dri/common/xmlpool/t_options.h
@@ -68,6 +68,11 @@ DRI_CONF_OPT_END
DRI_CONF_SECTION_BEGIN \
DRI_CONF_DESC(en,gettext("Image Quality"))
+#define DRI_CONF_EXCESS_MIPMAP(def) \
+DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \
+ DRI_CONF_DESC(en,"Enable extra mipmap level") \
+DRI_CONF_OPT_END
+
#define DRI_CONF_TEXTURE_DEPTH_FB 0
#define DRI_CONF_TEXTURE_DEPTH_32 1
#define DRI_CONF_TEXTURE_DEPTH_16 2
diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c
index 6bbe49021bb..d6ba23bc6e6 100644
--- a/src/mesa/drivers/dri/fb/fb_dri.c
+++ b/src/mesa/drivers/dri/fb/fb_dri.c
@@ -137,7 +137,6 @@ 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;
diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c
index 1b38b26c42d..5c74b0b0f47 100644
--- a/src/mesa/drivers/dri/fb/fb_egl.c
+++ b/src/mesa/drivers/dri/fb/fb_egl.c
@@ -429,7 +429,6 @@ 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;
diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c
index c63179149a7..e8dfcbe2543 100644
--- a/src/mesa/drivers/dri/ffb/ffb_clear.c
+++ b/src/mesa/drivers/dri/ffb/ffb_clear.c
@@ -123,16 +123,22 @@ CreatorComputePageFillFixups(struct ff_fixups *fixups,
}
static void
-ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv,
- GLboolean all, GLint cx, GLint cy, GLint cwidth,
- GLint cheight)
+ffb_do_clear(GLcontext *ctx, __DRIdrawablePrivate *dPriv)
{
+ ffbContextPtr fmesa = FFB_CONTEXT(ctx);
FFBDRIPtr gDRIPriv = (FFBDRIPtr) fmesa->driScreen->pDevPriv;
ffb_fbcPtr ffb = fmesa->regs;
drm_clip_rect_t *box = dPriv->pClipRects;
int nc = dPriv->numClipRects;
+ GLint cx, cy, cw, ch;
+
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
- cy = dPriv->h - cy - cheight;
+ cy = dPriv->h - cy - ch;
cx += dPriv->x;
cy += dPriv->y;
@@ -145,25 +151,6 @@ ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv,
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;
@@ -262,17 +249,14 @@ ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv,
}
}
-void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cwidth, GLint cheight)
+void ffbDDClear(GLcontext *ctx, GLbitfield mask)
{
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);
+ fprintf(stderr, "ffbDDClear: mask(%08x) \n", mask);
#endif
if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS))
stcmask = 0;
@@ -328,7 +312,7 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
if (mask & stcmask)
ffb->consty = fmesa->clear_stencil;
- ffb_do_clear(fmesa, dPriv, all, cx, cy, cwidth, cheight);
+ ffb_do_clear(ctx, dPriv);
FFBFifo(fmesa, 6);
ffb->ppc = fmesa->ppc;
@@ -349,6 +333,6 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear(ctx, mask, all, cx, cy, cwidth, cheight);
+ _swrast_Clear(ctx, mask);
}
diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.h b/src/mesa/drivers/dri/ffb/ffb_clear.h
index 4b707f19b2a..c3b8ce714b3 100644
--- a/src/mesa/drivers/dri/ffb/ffb_clear.h
+++ b/src/mesa/drivers/dri/ffb/ffb_clear.h
@@ -1,9 +1,6 @@
-/* $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);
+extern void ffbDDClear(GLcontext *ctx, GLbitfield mask);
#endif /* !(_FFB_CLEAR_H) */
diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c
index ab2a6688bab..99256d76b6e 100644
--- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c
+++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c
@@ -568,8 +568,7 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv,
*/
ffbDDClear(fmesa->glCtx,
(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT |
- BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL),
- 1, 0, 0, 0, 0);
+ BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL));
}
} else {
_mesa_make_current(NULL, NULL, NULL);
diff --git a/src/mesa/drivers/dri/gamma/gamma_dd.c b/src/mesa/drivers/dri/gamma/gamma_dd.c
index cca382d8926..63e3ab8fa5d 100644
--- a/src/mesa/drivers/dri/gamma/gamma_dd.c
+++ b/src/mesa/drivers/dri/gamma/gamma_dd.c
@@ -104,25 +104,6 @@ void gammaDDInitExtensions( GLcontext *ctx )
*/
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;
+ ctx->Driver.GetBufferSize = gammaDDGetBufferSize;
+ ctx->Driver.GetString = gammaDDGetString;
}
diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c
index 026ff5efbff..08749bf5d39 100644
--- a/src/mesa/drivers/dri/gamma/gamma_state.c
+++ b/src/mesa/drivers/dri/gamma/gamma_state.c
@@ -205,8 +205,7 @@ static void gammaDDBlendFuncSeparate( GLcontext *ctx,
* Buffer clear
*/
-static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void gammaDDClear( GLcontext *ctx, GLbitfield mask )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv;
@@ -410,7 +409,7 @@ static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
#endif
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
}
/* =============================================================
diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c
index 23373ef73b1..c0f4efd7a31 100644
--- a/src/mesa/drivers/dri/i810/i810context.c
+++ b/src/mesa/drivers/dri/i810/i810context.c
@@ -277,7 +277,6 @@ i810CreateContext( const __GLcontextModes *mesaVis,
ctx->Const.PointSizeGranularity = 1.0;
ctx->Driver.GetBufferSize = i810BufferSize;
- ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer;
ctx->Driver.GetString = i810GetString;
/* Who owns who?
diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c
index ba651555a67..57c84193faf 100644
--- a/src/mesa/drivers/dri/i810/i810ioctl.c
+++ b/src/mesa/drivers/dri/i810/i810ioctl.c
@@ -48,8 +48,7 @@ static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa )
#define DEPTH_SCALE ((1<<16)-1)
-static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void i810Clear( GLcontext *ctx, GLbitfield mask )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
@@ -80,8 +79,16 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (clear.flags) {
+ GLint cx, cy, cw, ch;
+
LOCK_HARDWARE( imesa );
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* flip top to bottom */
cy = dPriv->h-cy-ch;
cx += imesa->drawX;
@@ -94,7 +101,8 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes;
int n = 0;
- if (!all) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear sub region */
for ( ; i < nr ; i++) {
GLint x = box[i].x1;
GLint y = box[i].y1;
@@ -116,6 +124,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
n++;
}
} else {
+ /* clear whole buffer */
for ( ; i < nr ; i++) {
*b++ = box[i];
n++;
@@ -132,7 +141,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
}
diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c
index 680b818d286..6f9d4b5bd47 100644
--- a/src/mesa/drivers/dri/i810/i810state.c
+++ b/src/mesa/drivers/dri/i810/i810state.c
@@ -995,19 +995,4 @@ void i810InitStateFuncs(GLcontext *ctx)
} 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/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c
index 17fde2f4804..c1d7fe349c0 100644
--- a/src/mesa/drivers/dri/i915/i830_metaops.c
+++ b/src/mesa/drivers/dri/i915/i830_metaops.c
@@ -50,7 +50,6 @@
#define SET_STATE( i830, STATE ) \
do { \
- assert(!i830->intel.prim.flush); \
i830->current->emitted = 0; \
i830->current = &i830->STATE; \
i830->current->emitted = 0; \
@@ -395,13 +394,15 @@ static void draw_poly(i830ContextPtr i830,
void
i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+ GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
i830ContextPtr i830 = I830_CONTEXT( intel );
__DRIdrawablePrivate *dPriv = intel->driDrawable;
intelScreenPrivate *screen = intel->intelScreen;
int x0, y0, x1, y1;
+ GLint cx, cy, cw, ch;
+ GLboolean all;
INTEL_FIREVERTICES(intel);
SET_STATE( i830, meta );
@@ -411,6 +412,14 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
LOCK_HARDWARE(intel);
+ /* get clear bounds after locking */
+ cx = intel->ctx.DrawBuffer->_Xmin;
+ cy = intel->ctx.DrawBuffer->_Ymin;
+ cw = intel->ctx.DrawBuffer->_Xmax - cx;
+ ch = intel->ctx.DrawBuffer->_Ymax - cy;
+ all = (cw == intel->ctx.DrawBuffer->Width &&
+ ch == intel->ctx.DrawBuffer->Height);
+
if(!all) {
x0 = cx;
y0 = cy;
@@ -897,7 +906,6 @@ i830RotateWindow(intelContextPtr intel, __DRIdrawablePrivate *dPriv,
} /* cliprect loop */
- assert(!intel->prim.flush);
intelFlushBatchLocked( intel, GL_FALSE, GL_FALSE, GL_FALSE );
done:
diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c
index ec9dca6231e..95125190108 100644
--- a/src/mesa/drivers/dri/i915/i830_state.c
+++ b/src/mesa/drivers/dri/i915/i830_state.c
@@ -225,7 +225,7 @@ static void i830EvalLogicOpBlendState(GLcontext *ctx)
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- if (ctx->Color._LogicOpEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
ENABLE_LOGIC_OP_MASK);
i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index 8c99d0e1d67..2f78fd60b21 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -50,6 +50,7 @@ static const struct dri_extension i915_extensions[] =
{ "GL_ARB_depth_texture", NULL },
{ "GL_ARB_fragment_program", NULL },
{ "GL_ARB_shadow", NULL },
+ { "GL_ARB_texture_env_crossbar", NULL },
{ "GL_EXT_shadow_funcs", NULL },
/* ARB extn won't work if not enabled */
{ "GL_SGIX_depth_texture", NULL },
@@ -165,6 +166,8 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
I915_MAX_TEX_INSN);
ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
+ ctx->_MaintainTexEnvProgram = 1;
+ ctx->_UseTexEnvProgram = 1;
driInitExtensions( ctx, i915_extensions, GL_FALSE );
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index b0cc59c3063..ef14f3eef7c 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -29,6 +29,7 @@
#include "macros.h"
#include "enums.h"
+#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "intel_batchbuffer.h"
@@ -38,6 +39,7 @@
#include "program_instruction.h"
#include "program.h"
+#include "programopt.h"
@@ -122,6 +124,7 @@ static GLuint src_vector( struct i915_fragment_program *p,
p, p->ctx->FragmentProgram.Parameters[source->Index]);
break;
+ case PROGRAM_CONSTANT:
case PROGRAM_STATE_VAR:
case PROGRAM_NAMED_PARAM:
src = i915_emit_param4fv(
@@ -936,7 +939,15 @@ static void i915ProgramStringNotify( GLcontext *ctx,
*/
ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB,
ctx->FragmentProgram.Enabled );
+
+ if (p->FragProg.FogOption) {
+ /* add extra instructions to do fog, then turn off FogOption field */
+ _mesa_append_fog_code(ctx, &p->FragProg);
+ p->FragProg.FogOption = GL_NONE;
+ }
}
+
+ _tnl_program_string(ctx, target, prog);
}
@@ -955,6 +966,17 @@ void i915ValidateFragmentProgram( i915ContextPtr i915 )
GLuint s2 = S2_TEXCOORD_NONE;
int i, offset = 0;
+ if (i915->current_program != p)
+ {
+ if (i915->current_program) {
+ i915->current_program->on_hardware = 0;
+ i915->current_program->params_uptodate = 0;
+ }
+
+ i915->current_program = p;
+ }
+
+
/* Important:
*/
VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
@@ -996,7 +1018,10 @@ void i915ValidateFragmentProgram( i915ContextPtr i915 )
EMIT_PAD( 1 );
}
-#if 0
+ /* XXX this was disabled, but enabling this code helped fix the Glean
+ * tfragprog1 fog tests.
+ */
+#if 1
if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) {
EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 );
}
diff --git a/src/mesa/drivers/dri/i915/i915_metaops.c b/src/mesa/drivers/dri/i915/i915_metaops.c
index 3ab5dbfd685..1be7ac4c485 100644
--- a/src/mesa/drivers/dri/i915/i915_metaops.c
+++ b/src/mesa/drivers/dri/i915/i915_metaops.c
@@ -493,14 +493,16 @@ static void draw_poly(i915ContextPtr i915,
void
-i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+i915ClearWithTris(intelContextPtr intel, GLbitfield buffers,
+ GLboolean allFoo,
+ GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo)
{
i915ContextPtr i915 = I915_CONTEXT( intel );
__DRIdrawablePrivate *dPriv = intel->driDrawable;
intelScreenPrivate *screen = intel->intelScreen;
int x0, y0, x1, y1;
+ GLint cx, cy, cw, ch;
+ GLboolean all;
SET_STATE( i915, meta );
set_initial_state( i915 );
@@ -509,6 +511,14 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
LOCK_HARDWARE(intel);
+ /* get clear bounds after locking */
+ cx = intel->ctx.DrawBuffer->_Xmin;
+ cy = intel->ctx.DrawBuffer->_Ymin;
+ cw = intel->ctx.DrawBuffer->_Xmax - cx;
+ ch = intel->ctx.DrawBuffer->_Ymax - cy;
+ all = (cw == intel->ctx.DrawBuffer->Width &&
+ ch == intel->ctx.DrawBuffer->Height);
+
if (!all) {
x0 = cx;
y0 = cy;
@@ -525,7 +535,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
* The active cliprects will be applied as for any other geometry.
*/
- if (mask & BUFFER_BIT_FRONT_LEFT) {
+ if (buffers & BUFFER_BIT_FRONT_LEFT) {
set_no_depth_stencil_write( i915 );
set_color_mask( i915, GL_TRUE );
set_draw_region( i915, &screen->front );
@@ -536,7 +546,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
0, 0, 0, 0);
}
- if (mask & BUFFER_BIT_BACK_LEFT) {
+ if (buffers & BUFFER_BIT_BACK_LEFT) {
set_no_depth_stencil_write( i915 );
set_color_mask( i915, GL_TRUE );
set_draw_region( i915, &screen->back );
@@ -547,7 +557,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
0, 0, 0, 0);
}
- if (mask & BUFFER_BIT_STENCIL) {
+ if (buffers & BUFFER_BIT_STENCIL) {
set_stencil_replace( i915,
intel->ctx.Stencil.WriteMask[0],
intel->ctx.Stencil.Clear);
diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c
index 0faadb4f1a7..9c13290d118 100644
--- a/src/mesa/drivers/dri/i915/i915_program.c
+++ b/src/mesa/drivers/dri/i915/i915_program.c
@@ -369,10 +369,7 @@ GLuint i915_emit_param4fv( struct i915_fragment_program *p,
void i915_program_error( struct i915_fragment_program *p, const char *msg )
{
- /* XXX we shouldn't print anything to stdout, record GL error or
- * call _mesa_problem()
- */
- fprintf(stderr, "%s\n", msg);
+ _mesa_problem(NULL, "i915_program_error: %s", msg);
p->error = 1;
}
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index db5bb9ddc78..3cec6a2ddfc 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -141,7 +141,7 @@ static void i915EvalLogicOpBlendState(GLcontext *ctx)
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (ctx->Color._LogicOpEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE;
i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE;
} else {
diff --git a/src/mesa/drivers/dri/i915/i915_texprog.c b/src/mesa/drivers/dri/i915/i915_texprog.c
index 4fbce34ba21..f6a8b0205a6 100644
--- a/src/mesa/drivers/dri/i915/i915_texprog.c
+++ b/src/mesa/drivers/dri/i915/i915_texprog.c
@@ -591,6 +591,11 @@ void i915ValidateTextureProgram( i915ContextPtr i915 )
intel->specoffset = 0;
offset = 0;
+ if (i915->current_program) {
+ i915->current_program->on_hardware = 0;
+ i915->current_program->params_uptodate = 0;
+ }
+
if (i915->vertex_fog == I915_FOG_PIXEL) {
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16 );
RENDERINPUTS_CLEAR( index_bitset, _TNL_ATTRIB_FOG );
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index 9ec54de23c5..2936a0fb721 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -48,8 +48,10 @@ static void i915_render_start( intelContextPtr intel )
if (ctx->FragmentProgram._Active)
i915ValidateFragmentProgram( i915 );
- else
+ else {
+ assert(!ctx->_MaintainTexEnvProgram);
i915ValidateTextureProgram( i915 );
+ }
}
diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
index dd754c67d44..803b41b2567 100644
--- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
@@ -368,6 +368,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv,
const drm_clip_rect_t *rect)
{
intelContextPtr intel;
+ const intelScreenPrivate *intelScreen;
GLboolean missed_target;
int64_t ust;
@@ -382,97 +383,134 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv,
intelFlush( &intel->ctx );
- intelWaitForFrameCompletion( intel );
- LOCK_HARDWARE( intel );
+ intelScreen = intel->intelScreen;
+
+ if (!rect && !intel->swap_scheduled && intelScreen->drmMinor >= 6 &&
+ !(intel->vblank_flags & VBLANK_FLAG_NO_IRQ) &&
+ intelScreen->current_rotation == 0) {
+ unsigned int interval = driGetVBlankInterval(dPriv, intel->vblank_flags);
+ unsigned int target;
+ drm_i915_vblank_swap_t swap;
+
+ swap.drawable = dPriv->hHWDrawable;
+ swap.seqtype = DRM_VBLANK_ABSOLUTE;
+ target = swap.sequence = intel->vbl_seq + interval;
+
+ if (intel->vblank_flags & VBLANK_FLAG_SYNC) {
+ swap.seqtype |= DRM_VBLANK_NEXTONMISS;
+ } else if (interval == 0) {
+ goto noschedule;
+ }
- if (!rect)
- {
- UNLOCK_HARDWARE( intel );
- driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target );
- LOCK_HARDWARE( intel );
- }
- {
- const intelScreenPrivate *intelScreen = intel->intelScreen;
- const __DRIdrawablePrivate *dPriv = intel->driDrawable;
- const int nbox = dPriv->numClipRects;
- const drm_clip_rect_t *pbox = dPriv->pClipRects;
- drm_clip_rect_t box;
- const int cpp = intelScreen->cpp;
- const int pitch = intelScreen->front.pitch; /* in bytes */
- int i;
- GLuint CMD, BR13;
- BATCH_LOCALS;
-
- switch(cpp) {
- case 2:
- BR13 = (pitch) | (0xCC << 16) | (1<<24);
- CMD = XY_SRC_COPY_BLT_CMD;
- break;
- case 4:
- BR13 = (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:
- BR13 = (pitch) | (0xCC << 16) | (1<<24);
- CMD = XY_SRC_COPY_BLT_CMD;
- break;
+ if ( intel->vblank_flags & VBLANK_FLAG_SECONDARY ) {
+ swap.seqtype |= DRM_VBLANK_SECONDARY;
}
-
- 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) {
- _mesa_warning(&intel->ctx, "Bad cliprect in intelCopyBuffer()");
- continue;
- }
+ if (!drmCommandWriteRead(intel->driFd, DRM_I915_VBLANK_SWAP, &swap,
+ sizeof(swap))) {
+ intel->swap_scheduled = 1;
+ intel->vbl_seq = swap.sequence;
+ swap.sequence -= target;
+ missed_target = swap.sequence > 0 && swap.sequence <= (1 << 23);
+ }
+ } else {
+ intel->swap_scheduled = 0;
+ }
+noschedule:
- box = *pbox;
+ if (!intel->swap_scheduled) {
+ intelWaitForFrameCompletion( intel );
+ LOCK_HARDWARE( intel );
- if (rect)
- {
- if (rect->x1 > box.x1)
- box.x1 = rect->x1;
- if (rect->y1 > box.y1)
- box.y1 = rect->y1;
- if (rect->x2 < box.x2)
- box.x2 = rect->x2;
- if (rect->y2 < box.y2)
- box.y2 = rect->y2;
-
- if (box.x1 > box.x2 || box.y1 > box.y2)
- continue;
+ if (!rect)
+ {
+ UNLOCK_HARDWARE( intel );
+ driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target );
+ LOCK_HARDWARE( intel );
+ }
+ {
+ const intelScreenPrivate *intelScreen = intel->intelScreen;
+ const __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ const int nbox = dPriv->numClipRects;
+ const drm_clip_rect_t *pbox = dPriv->pClipRects;
+ drm_clip_rect_t box;
+ const int cpp = intelScreen->cpp;
+ const int pitch = intelScreen->front.pitch; /* in bytes */
+ int i;
+ GLuint CMD, BR13;
+ BATCH_LOCALS;
+
+ switch(cpp) {
+ case 2:
+ BR13 = (pitch) | (0xCC << 16) | (1<<24);
+ CMD = XY_SRC_COPY_BLT_CMD;
+ break;
+ case 4:
+ BR13 = (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:
+ BR13 = (pitch) | (0xCC << 16) | (1<<24);
+ CMD = XY_SRC_COPY_BLT_CMD;
+ break;
}
+
+ if (0)
+ intel_draw_performance_boxes( intel );
- BEGIN_BATCH( 8);
- OUT_BATCH( CMD );
- OUT_BATCH( BR13 );
- OUT_BATCH( (box.y1 << 16) | box.x1 );
- OUT_BATCH( (box.y2 << 16) | box.x2 );
+ for (i = 0 ; i < nbox; i++, pbox++)
+ {
+ if (pbox->x1 > pbox->x2 ||
+ pbox->y1 > pbox->y2 ||
+ pbox->x2 > intelScreen->width ||
+ pbox->y2 > intelScreen->height) {
+ _mesa_warning(&intel->ctx, "Bad cliprect in intelCopyBuffer()");
+ continue;
+ }
+
+ box = *pbox;
+
+ if (rect)
+ {
+ if (rect->x1 > box.x1)
+ box.x1 = rect->x1;
+ if (rect->y1 > box.y1)
+ box.y1 = rect->y1;
+ if (rect->x2 < box.x2)
+ box.x2 = rect->x2;
+ if (rect->y2 < box.y2)
+ box.y2 = rect->y2;
+
+ if (box.x1 > box.x2 || box.y1 > box.y2)
+ continue;
+ }
+
+ BEGIN_BATCH( 8);
+ OUT_BATCH( CMD );
+ OUT_BATCH( BR13 );
+ OUT_BATCH( (box.y1 << 16) | box.x1 );
+ OUT_BATCH( (box.y2 << 16) | box.x2 );
- if (intel->sarea->pf_current_page == 0)
- OUT_BATCH( intelScreen->front.offset );
- else
- OUT_BATCH( intelScreen->back.offset );
+ if (intel->sarea->pf_current_page == 0)
+ OUT_BATCH( intelScreen->front.offset );
+ else
+ OUT_BATCH( intelScreen->back.offset );
- OUT_BATCH( (box.y1 << 16) | box.x1 );
- OUT_BATCH( BR13 & 0xffff );
+ OUT_BATCH( (box.y1 << 16) | box.x1 );
+ OUT_BATCH( BR13 & 0xffff );
- if (intel->sarea->pf_current_page == 0)
- OUT_BATCH( intelScreen->back.offset );
- else
- OUT_BATCH( intelScreen->front.offset );
+ if (intel->sarea->pf_current_page == 0)
+ OUT_BATCH( intelScreen->back.offset );
+ else
+ OUT_BATCH( intelScreen->front.offset );
- ADVANCE_BATCH();
+ ADVANCE_BATCH();
+ }
}
+ intelFlushBatchLocked( intel, GL_TRUE, GL_TRUE, GL_TRUE );
+ UNLOCK_HARDWARE( intel );
}
- intelFlushBatchLocked( intel, GL_TRUE, GL_TRUE, GL_TRUE );
- UNLOCK_HARDWARE( intel );
if (!rect)
{
@@ -583,13 +621,14 @@ void intelEmitCopyBlitLocked( intelContextPtr intel,
-void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch)
+void intelClearWithBlit(GLcontext *ctx, GLbitfield buffers, GLboolean allFoo,
+ GLint cx1Foo, GLint cy1Foo, GLint cwFoo, GLint chFoo)
{
intelContextPtr intel = INTEL_CONTEXT( ctx );
intelScreenPrivate *intelScreen = intel->intelScreen;
GLuint clear_depth, clear_color;
- GLint cx, cy;
+ GLint cx, cy, cw, ch;
+ GLboolean all;
GLint pitch;
GLint cpp = intelScreen->cpp;
GLint i;
@@ -599,16 +638,24 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
intelFlush( &intel->ctx );
LOCK_HARDWARE( intel );
+ /* get clear bounds after locking */
+ cx = intel->ctx.DrawBuffer->_Xmin;
+ cy = intel->ctx.DrawBuffer->_Ymin;
+ cw = intel->ctx.DrawBuffer->_Xmax - cx;
+ ch = intel->ctx.DrawBuffer->_Ymax - cy;
+ all = (cw == intel->ctx.DrawBuffer->Width &&
+ ch == intel->ctx.DrawBuffer->Height);
+
pitch = intelScreen->front.pitch;
clear_color = intel->ClearColor;
clear_depth = 0;
- if (flags & BUFFER_BIT_DEPTH) {
+ if (buffers & BUFFER_BIT_DEPTH) {
clear_depth = (GLuint)(ctx->Depth.Clear * intel->ClearDepth);
}
- if (flags & BUFFER_BIT_STENCIL) {
+ if (buffers & BUFFER_BIT_STENCIL) {
clear_depth |= (ctx->Stencil.Clear & 0xff) << 24;
}
@@ -623,8 +670,8 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
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;
+ if (buffers & BUFFER_BIT_DEPTH) D_CMD |= XY_COLOR_BLT_WRITE_RGB;
+ if (buffers & BUFFER_BIT_STENCIL) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA;
break;
default:
BR13 = (0xF0 << 16) | (pitch) | (1<<24);
@@ -634,17 +681,17 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
{
/* flip top to bottom */
- cy = intel->driDrawable->h-cy1-ch;
- cx = cx1 + intel->drawX;
+ cy = intel->driDrawable->h - cy - ch;
+ cx = cx + intel->drawX;
cy += intel->drawY;
/* adjust for page flipping */
if ( intel->sarea->pf_current_page == 1 ) {
- GLuint tmp = flags;
+ GLuint tmp = buffers;
- 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;
+ buffers &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
+ if ( tmp & BUFFER_BIT_FRONT_LEFT ) buffers |= BUFFER_BIT_BACK_LEFT;
+ if ( tmp & BUFFER_BIT_BACK_LEFT ) buffers |= BUFFER_BIT_FRONT_LEFT;
}
for (i = 0 ; i < intel->numClipRects ; i++)
@@ -680,7 +727,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
b.y2 > intelScreen->height)
continue;
- if ( flags & BUFFER_BIT_FRONT_LEFT ) {
+ if ( buffers & BUFFER_BIT_FRONT_LEFT ) {
BEGIN_BATCH( 6);
OUT_BATCH( CMD );
OUT_BATCH( BR13 );
@@ -691,7 +738,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
ADVANCE_BATCH();
}
- if ( flags & BUFFER_BIT_BACK_LEFT ) {
+ if ( buffers & BUFFER_BIT_BACK_LEFT ) {
BEGIN_BATCH( 6);
OUT_BATCH( CMD );
OUT_BATCH( BR13 );
@@ -702,7 +749,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
ADVANCE_BATCH();
}
- if ( flags & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) {
+ if ( buffers & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) {
BEGIN_BATCH( 6);
OUT_BATCH( D_CMD );
OUT_BATCH( BR13 );
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 770b330d0a3..0a2e33ffd53 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -92,7 +92,7 @@ int prevLockLine;
* Mesa's Driver Functions
***************************************/
-#define DRIVER_DATE "20050225"
+#define DRIVER_DATE "20061017"
const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
{
@@ -134,27 +134,6 @@ const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
}
}
-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);
- if (intel->driDrawable) {
- *width = intel->driDrawable->w;
- *height = intel->driDrawable->h;
- }
- else {
- *width = 0;
- *height = 0;
- }
- UNLOCK_HARDWARE(intel);
-}
-
/**
* Extension strings exported by the intel driver.
@@ -263,14 +242,8 @@ void intelInitDriverFunctions( struct dd_function_table *functions )
functions->Clear = intelClear;
functions->Flush = intelglFlush;
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 );
@@ -543,14 +516,14 @@ void intelSetBackClipRects( intelContextPtr intel )
void intelWindowMoved( intelContextPtr intel )
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
+ GLframebuffer *drawFb = (GLframebuffer *) dPriv->driverPrivate;
if (!intel->ctx.DrawBuffer) {
intelSetFrontClipRects( intel );
}
else {
- driUpdateFramebufferSize(&intel->ctx, intel->driDrawable);
-
- switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) {
+ driUpdateFramebufferSize(&intel->ctx, dPriv);
+ switch (drawFb->_ColorDrawBufferMask[0]) {
case BUFFER_BIT_FRONT_LEFT:
intelSetFrontClipRects( intel );
break;
@@ -563,15 +536,47 @@ void intelWindowMoved( intelContextPtr intel )
}
}
- _mesa_resize_framebuffer(&intel->ctx,
- (GLframebuffer*)dPriv->driverPrivate,
- dPriv->w, dPriv->h);
-
+ if (drawFb->Width != dPriv->w || drawFb->Height != dPriv->h) {
+ /* update Mesa's notion of framebuffer/window size */
+ _mesa_resize_framebuffer(&intel->ctx, drawFb, dPriv->w, dPriv->h);
+ drawFb->Initialized = GL_TRUE; /* XXX remove someday */
+ }
+
/* Set state we know depends on drawable parameters:
*/
{
GLcontext *ctx = &intel->ctx;
+ if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) {
+ drmI830Sarea *sarea = intel->sarea;
+ drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
+ .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
+ drm_clip_rect_t pipeA_rect = { .x1 = sarea->pipeA_x,
+ .x2 = sarea->pipeA_x + sarea->pipeA_w,
+ .y1 = sarea->pipeA_y,
+ .y2 = sarea->pipeA_y + sarea->pipeA_h };
+ drm_clip_rect_t pipeB_rect = { .x1 = sarea->pipeB_x,
+ .x2 = sarea->pipeB_x + sarea->pipeB_w,
+ .y1 = sarea->pipeB_y,
+ .y2 = sarea->pipeB_y + sarea->pipeB_h };
+ GLint areaA = driIntersectArea( drw_rect, pipeA_rect );
+ GLint areaB = driIntersectArea( drw_rect, pipeB_rect );
+ GLuint flags = intel->vblank_flags;
+
+ if (areaB > areaA || (areaA > 0 && areaB > 0)) {
+ flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY;
+ } else {
+ flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY;
+ }
+
+ if (flags != intel->vblank_flags) {
+ intel->vblank_flags = flags;
+ driGetCurrentVBlank(dPriv, intel->vblank_flags, &intel->vbl_seq);
+ }
+ } else {
+ intel->vblank_flags &= ~VBLANK_FLAG_SECONDARY;
+ }
+
ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y,
ctx->Scissor.Width, ctx->Scissor.Height );
@@ -596,7 +601,8 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
if ( intel->driDrawable != driDrawPriv ) {
/* Shouldn't the readbuffer be stored also? */
- driDrawableInitVBlank( driDrawPriv, intel->vblank_flags );
+ driDrawableInitVBlank( driDrawPriv, intel->vblank_flags,
+ &intel->vbl_seq );
intel->driDrawable = driDrawPriv;
intelWindowMoved( intel );
diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h
index 0ca8ff268de..05195e76d65 100644
--- a/src/mesa/drivers/dri/i915/intel_context.h
+++ b/src/mesa/drivers/dri/i915/intel_context.h
@@ -34,6 +34,7 @@
#include "drm.h"
#include "mm.h"
#include "texmem.h"
+#include "vblank.h"
#include "intel_screen.h"
#include "i915_drm.h"
@@ -261,6 +262,8 @@ struct intel_context
GLuint swap_count;
GLuint swap_missed_count;
+
+ GLuint swap_scheduled;
};
@@ -321,6 +324,17 @@ do { \
char __ret=0; \
DEBUG_CHECK_LOCK(); \
assert(!(intel)->locked); \
+ if ((intel)->swap_scheduled) { \
+ drmVBlank vbl; \
+ vbl.request.type = DRM_VBLANK_ABSOLUTE; \
+ if ((intel)->vblank_flags & \
+ VBLANK_FLAG_SECONDARY) { \
+ vbl.request.type |= DRM_VBLANK_SECONDARY; \
+ } \
+ vbl.request.sequence = (intel)->vbl_seq; \
+ drmWaitVBlank((intel)->driFd, &vbl); \
+ (intel)->swap_scheduled = 0; \
+ } \
DRM_CAS((intel)->driHwLock, (intel)->hHWContext, \
(DRM_LOCK_HELD|(intel)->hHWContext), __ret); \
if (__ret) \
diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c
index d8530367664..ede3b6378fe 100644
--- a/src/mesa/drivers/dri/i915/intel_ioctl.c
+++ b/src/mesa/drivers/dri/i915/intel_ioctl.c
@@ -375,8 +375,7 @@ void intelFinish( GLcontext *ctx )
}
-void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+void intelClear(GLcontext *ctx, GLbitfield mask)
{
intelContextPtr intel = INTEL_CONTEXT( ctx );
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
@@ -429,13 +428,13 @@ void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
swrast_mask |= (mask & BUFFER_BIT_ACCUM);
if (blit_mask)
- intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch );
+ intelClearWithBlit( ctx, blit_mask, 0, 0, 0, 0, 0);
if (tri_mask)
- intel->vtbl.clear_with_tris( intel, tri_mask, all, cx, cy, cw, ch);
+ intel->vtbl.clear_with_tris( intel, tri_mask, 0, 0, 0, 0, 0);
if (swrast_mask)
- _swrast_Clear( ctx, swrast_mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, swrast_mask );
}
diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.h b/src/mesa/drivers/dri/i915/intel_ioctl.h
index 099a7e1a44e..6ea47e462e1 100644
--- a/src/mesa/drivers/dri/i915/intel_ioctl.h
+++ b/src/mesa/drivers/dri/i915/intel_ioctl.h
@@ -32,8 +32,7 @@
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 intelClear(GLcontext *ctx, GLbitfield mask);
extern void intelPageFlip( const __DRIdrawablePrivate *dpriv );
diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c
index 2af38541d9c..535cbfcb26e 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -494,18 +494,9 @@ intelCopyPixels( GLcontext *ctx,
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/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
index cf1673b429a..b2787ee60ac 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.c
+++ b/src/mesa/drivers/dri/i915/intel_tris.c
@@ -43,6 +43,12 @@
#include "intel_reg.h"
#include "intel_span.h"
+/* XXX we shouldn't include these headers in this file, but we need them
+ * for fallbackStrings, below.
+ */
+#include "i830_context.h"
+#include "i915_context.h"
+
static void intelRenderPrimitive( GLcontext *ctx, GLenum prim );
static void intelRasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim );
@@ -792,104 +798,123 @@ static void intelRasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint 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;
- }
- }
- }
+/*
+ */
+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 struct {
+ GLuint bit;
+ const char *str;
+} fallbackStrings[] = {
+ { INTEL_FALLBACK_DRAW_BUFFER, "Draw buffer" },
+ { INTEL_FALLBACK_READ_BUFFER, "Read buffer" },
+ { INTEL_FALLBACK_USER, "User" },
+ { INTEL_FALLBACK_NO_BATCHBUFFER, "No Batchbuffer" },
+ { INTEL_FALLBACK_NO_TEXMEM, "No Texmem" },
+ { INTEL_FALLBACK_RENDERMODE, "Rendermode" },
+
+ { I830_FALLBACK_TEXTURE, "i830 texture" },
+ { I830_FALLBACK_COLORMASK, "i830 colormask" },
+ { I830_FALLBACK_STENCIL, "i830 stencil" },
+ { I830_FALLBACK_STIPPLE, "i830 stipple" },
+ { I830_FALLBACK_LOGICOP, "i830 logicop" },
+
+ { I915_FALLBACK_TEXTURE, "i915 texture" },
+ { I915_FALLBACK_COLORMASK, "i915 colormask" },
+ { I915_FALLBACK_STENCIL, "i915 stencil" },
+ { I915_FALLBACK_STIPPLE, "i915 stipple" },
+ { I915_FALLBACK_PROGRAM, "i915 program" },
+ { I915_FALLBACK_LOGICOP, "i915 logicop" },
+ { I915_FALLBACK_POLYGON_SMOOTH, "i915 polygon smooth" },
+ { I915_FALLBACK_POINT_SMOOTH, "i915 point smooth" },
+
+ { 0, NULL }
+};
+
+
+static const char *
+getFallbackString(GLuint bit)
+{
+ int i;
+ for (i = 0; fallbackStrings[i].bit; i++) {
+ if (fallbackStrings[i].bit == bit)
+ return fallbackStrings[i].str;
+ }
+ return "unknown fallback bit";
+}
+
+
+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 0x%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 0x%x: %s\n",
+ bit, 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;
+ }
+ }
+}
diff --git a/src/mesa/drivers/dri/i915/server/i830_common.h b/src/mesa/drivers/dri/i915/server/i830_common.h
index 41b5cc3c01b..fb6ceaa52d4 100644
--- a/src/mesa/drivers/dri/i915/server/i830_common.h
+++ b/src/mesa/drivers/dri/i915/server/i830_common.h
@@ -112,6 +112,21 @@ typedef struct {
int rotated_size;
int rotated_pitch;
int virtualX, virtualY;
+
+ unsigned int front_tiled;
+ unsigned int back_tiled;
+ unsigned int depth_tiled;
+ unsigned int rotated_tiled;
+ unsigned int rotated2_tiled;
+
+ int pipeA_x;
+ int pipeA_y;
+ int pipeA_w;
+ int pipeA_h;
+ int pipeB_x;
+ int pipeB_y;
+ int pipeB_w;
+ int pipeB_h;
} drmI830Sarea;
/* Flags for perf_boxes
diff --git a/src/mesa/drivers/dri/i915tex/Makefile b/src/mesa/drivers/dri/i915tex/Makefile
new file mode 100644
index 00000000000..94879d209f7
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/Makefile
@@ -0,0 +1,66 @@
+
+TOP = ../../../../..
+include $(TOP)/configs/current
+
+LIBNAME = i915tex_dri.so
+
+MINIGLX_SOURCES = server/intel_dri.c
+
+DRIVER_SOURCES = \
+ i830_context.c \
+ i830_metaops.c \
+ i830_state.c \
+ i830_texblend.c \
+ i830_tex.c \
+ i830_texstate.c \
+ i830_vtbl.c \
+ intel_render.c \
+ intel_regions.c \
+ intel_buffer_objects.c \
+ intel_batchbuffer.c \
+ intel_mipmap_tree.c \
+ i915_tex_layout.c \
+ intel_tex_image.c \
+ intel_tex_subimage.c \
+ intel_tex_copy.c \
+ intel_tex_validate.c \
+ intel_tex_format.c \
+ intel_tex.c \
+ intel_pixel.c \
+ intel_pixel_copy.c \
+ intel_pixel_read.c \
+ intel_pixel_draw.c \
+ intel_buffers.c \
+ intel_blit.c \
+ i915_tex.c \
+ i915_texstate.c \
+ i915_context.c \
+ i915_debug.c \
+ i915_fragprog.c \
+ i915_metaops.c \
+ i915_program.c \
+ i915_state.c \
+ i915_vtbl.c \
+ intel_context.c \
+ intel_ioctl.c \
+ intel_rotate.c \
+ intel_screen.c \
+ intel_span.c \
+ intel_state.c \
+ intel_tris.c \
+ intel_fbo.c \
+ intel_depthstencil.c \
+ intel_batchpool.c
+
+C_SOURCES = \
+ $(COMMON_SOURCES) \
+ $(COMMON_BM_SOURCES) \
+ $(DRIVER_SOURCES)
+
+ASM_SOURCES =
+
+
+
+include ../Makefile.template
+
+symlinks:
diff --git a/src/mesa/drivers/dri/i915tex/i830_context.c b/src/mesa/drivers/dri/i915tex/i830_context.c
new file mode 100644
index 00000000000..2ff8621c42f
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_context.c
@@ -0,0 +1,104 @@
+/**************************************************************************
+ *
+ * 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;
+ struct i830_context *i830 = CALLOC_STRUCT(i830_context);
+ struct intel_context *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;
+
+ /* Advertise the full hardware capabilities. The new memory
+ * manager should cope much better with overload situations:
+ */
+ ctx->Const.MaxTextureLevels = 12;
+ ctx->Const.Max3DTextureLevels = 9;
+ ctx->Const.MaxCubeTextureLevels = 11;
+ ctx->Const.MaxTextureRectSize = (1 << 11);
+ 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);
+ i830InitMetaFuncs(i830);
+
+ _tnl_allow_vertex_fog(ctx, 1);
+ _tnl_allow_pixel_fog(ctx, 0);
+
+ return GL_TRUE;
+}
diff --git a/src/mesa/drivers/dri/i915tex/i830_context.h b/src/mesa/drivers/dri/i915tex/i830_context.h
new file mode 100644
index 00000000000..3d754103c0a
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_context.h
@@ -0,0 +1,213 @@
+/**************************************************************************
+ *
+ * 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_INVARIENT 0x8
+#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_DBUFADDR0 2
+#define I830_DESTREG_DBUFADDR1 3
+#define I830_DESTREG_DV0 4
+#define I830_DESTREG_DV1 5
+#define I830_DESTREG_SENABLE 6
+#define I830_DESTREG_SR0 7
+#define I830_DESTREG_SR1 8
+#define I830_DESTREG_SR2 9
+#define I830_DEST_SETUP_SIZE 10
+
+#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_TM0S1 1
+#define I830_TEXREG_TM0S2 2
+#define I830_TEXREG_TM0S3 3
+#define I830_TEXREG_TM0S4 4
+#define I830_TEXREG_MCS 5 /* _3DSTATE_MAP_COORD_SETS */
+#define I830_TEXREG_CUBE 6 /* _3DSTATE_MAP_SUBE */
+#define I830_TEX_SETUP_SIZE 7
+
+#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];
+
+ struct intel_region *draw_region;
+ struct intel_region *depth_region;
+
+ /* Regions aren't actually that appropriate here as the memory may
+ * be from a PBO or FBO. Just use the buffer id. Will have to do
+ * this for draw and depth for FBO's...
+ */
+ struct _DriBufferObject *tex_buffer[I830_TEX_UNITS];
+ GLuint tex_offset[I830_TEX_UNITS];
+
+ GLuint emitted; /* I810_UPLOAD_* */
+ GLuint active;
+};
+
+struct i830_context
+{
+ struct intel_context intel;
+
+ GLuint lodbias_tm0s3[MAX_TEXTURE_UNITS];
+ DECLARE_RENDERINPUTS(last_index_bitset);
+
+ struct i830_hw_state meta, initial, state, *current;
+};
+
+
+
+
+#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(struct i830_context *i830);
+
+extern void
+i830_state_draw_region(struct intel_context *intel,
+ struct i830_hw_state *state,
+ struct intel_region *color_region,
+ struct intel_region *depth_region);
+/* i830_context.c
+ */
+extern GLboolean
+i830CreateContext(const __GLcontextModes * mesaVis,
+ __DRIcontextPrivate * driContextPriv,
+ void *sharedContextPrivate);
+
+/* i830_tex.c, i830_texstate.c
+ */
+extern void i830UpdateTextureState(struct intel_context *intel);
+
+extern void i830InitTextureFuncs(struct dd_function_table *functions);
+
+/* i830_texblend.c
+ */
+extern GLuint i830SetTexEnvCombine(struct i830_context *i830,
+ const struct gl_tex_env_combine_state
+ *combine, GLint blendUnit, GLuint texel_op,
+ GLuint * state, const GLfloat * factor);
+
+extern void i830EmitTextureBlend(struct i830_context *i830);
+
+
+/* i830_state.c
+ */
+extern void i830InitStateFuncs(struct dd_function_table *functions);
+
+extern void i830EmitState(struct i830_context *i830);
+
+extern void i830InitState(struct i830_context *i830);
+
+/* i830_metaops.c
+ */
+extern void i830InitMetaFuncs(struct i830_context *i830);
+
+extern void
+i830RotateWindow(struct intel_context *intel, __DRIdrawablePrivate * dPriv,
+ GLuint srcBuf);
+
+/*======================================================================
+ * Inline conversion functions. These are better-typed than the
+ * macros used previously:
+ */
+static INLINE struct i830_context *
+i830_context(GLcontext * ctx)
+{
+ return (struct i830_context *) ctx;
+}
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/i830_metaops.c b/src/mesa/drivers/dri/i915tex/i830_metaops.c
new file mode 100644
index 00000000000..f76646d89db
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_metaops.c
@@ -0,0 +1,457 @@
+/**************************************************************************
+ *
+ * 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 "intel_regions.h"
+
+#include "i830_context.h"
+#include "i830_reg.h"
+
+/* A large amount of state doesn't need to be uploaded.
+ */
+#define ACTIVE (I830_UPLOAD_INVARIENT | \
+ I830_UPLOAD_CTX | \
+ I830_UPLOAD_BUFFERS | \
+ I830_UPLOAD_STIPPLE | \
+ I830_UPLOAD_TEXBLEND(0) | \
+ I830_UPLOAD_TEX(0))
+
+
+#define SET_STATE( i830, STATE ) \
+do { \
+ i830->current->emitted &= ~ACTIVE; \
+ i830->current = &i830->STATE; \
+ i830->current->emitted &= ~ACTIVE; \
+} while (0)
+
+
+static void
+set_no_stencil_write(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ /* 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;
+
+ i830->meta.emitted &= ~I830_UPLOAD_CTX;
+}
+
+static void
+set_no_depth_write(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ /* 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 depth unit to replace.
+ */
+static void
+set_depth_replace(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE )
+ * ctx->Driver.DepthMask( ctx, GL_TRUE )
+ */
+ 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] |= ENABLE_DEPTH_TEST;
+ i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DEPTH_WRITE;
+
+ /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS )
+ */
+ i830->meta.Ctx[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK;
+ i830->meta.Ctx[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC |
+ DEPTH_TEST_FUNC
+ (COMPAREFUNC_ALWAYS));
+
+ i830->meta.emitted &= ~I830_UPLOAD_CTX;
+}
+
+
+/* Set stencil unit to replace always with the reference value.
+ */
+static void
+set_stencil_replace(struct intel_context *intel,
+ GLuint s_mask, GLuint s_clear)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ /* 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.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(struct intel_context *intel, GLboolean state)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ const GLuint mask = ((1 << WRITEMASK_RED_SHIFT) |
+ (1 << WRITEMASK_GREEN_SHIFT) |
+ (1 << WRITEMASK_BLUE_SHIFT) |
+ (1 << WRITEMASK_ALPHA_SHIFT));
+
+ i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~mask;
+
+ if (state) {
+ i830->meta.Ctx[I830_CTXREG_ENABLES_2] |=
+ (i830->state.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(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ 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
+set_texture_blend_replace(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ static const struct gl_tex_env_combine_state comb = {
+ GL_REPLACE, GL_REPLACE,
+ {GL_TEXTURE, GL_TEXTURE, GL_TEXTURE,}, {GL_TEXTURE, GL_TEXTURE,
+ GL_TEXTURE,},
+ {GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_COLOR}, {GL_SRC_ALPHA, GL_SRC_ALPHA,
+ GL_SRC_ALPHA},
+ 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 GLboolean
+set_tex_rect_source(struct intel_context *intel,
+ struct _DriBufferObject *buffer,
+ GLuint offset,
+ GLuint pitch, GLuint height, GLenum format, GLenum type)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ GLuint *setup = i830->meta.Tex[0];
+ GLint numLevels = 1;
+ GLuint textureFormat;
+ GLuint cpp;
+
+ /* A full implementation of this would do the upload through
+ * glTexImage2d, and get all the conversion operations at that
+ * point. We are restricted, but still at least have access to the
+ * fragment program swizzle.
+ */
+ switch (format) {
+ case GL_BGRA:
+ switch (type) {
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_BYTE:
+ textureFormat = (MAPSURF_32BIT | MT_32BIT_ARGB8888);
+ cpp = 4;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ case GL_RGBA:
+ switch (type) {
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_BYTE:
+ textureFormat = (MAPSURF_32BIT | MT_32BIT_ABGR8888);
+ cpp = 4;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ case GL_BGR:
+ switch (type) {
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565);
+ cpp = 2;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ case GL_RGB:
+ switch (type) {
+ case GL_UNSIGNED_SHORT_5_6_5:
+ textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565);
+ cpp = 2;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+
+ default:
+ return GL_FALSE;
+ }
+
+ i830->meta.tex_buffer[0] = buffer;
+ i830->meta.tex_offset[0] = offset;
+
+ setup[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 |
+ (LOAD_TEXTURE_MAP0 << 0) | 4);
+ setup[I830_TEXREG_TM0S1] = (((height - 1) << TM0S1_HEIGHT_SHIFT) |
+ ((pitch - 1) << TM0S1_WIDTH_SHIFT) |
+ textureFormat);
+ setup[I830_TEXREG_TM0S2] =
+ (((((pitch * cpp) / 4) -
+ 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK);
+
+ setup[I830_TEXREG_TM0S3] =
+ ((((numLevels -
+ 1) *
+ 4) << TM0S3_MIN_MIP_SHIFT) | (FILTER_NEAREST <<
+ TM0S3_MIN_FILTER_SHIFT) |
+ (MIPFILTER_NONE << TM0S3_MIP_FILTER_SHIFT) | (FILTER_NEAREST <<
+ TM0S3_MAG_FILTER_SHIFT));
+
+ setup[I830_TEXREG_CUBE] = (_3DSTATE_MAP_CUBE | MAP_UNIT(0));
+
+ 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);
+ return GL_TRUE;
+}
+
+
+static void
+set_vertex_format(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ i830->meta.Ctx[I830_CTXREG_VF] = (_3DSTATE_VFT0_CMD |
+ VFT0_TEX_COUNT(1) |
+ VFT0_DIFFUSE | VFT0_XYZ);
+ 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
+meta_import_pixel_state(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ i830->meta.Ctx[I830_CTXREG_STATE1] = i830->state.Ctx[I830_CTXREG_STATE1];
+ i830->meta.Ctx[I830_CTXREG_STATE2] = i830->state.Ctx[I830_CTXREG_STATE2];
+ i830->meta.Ctx[I830_CTXREG_STATE3] = i830->state.Ctx[I830_CTXREG_STATE3];
+ i830->meta.Ctx[I830_CTXREG_STATE4] = i830->state.Ctx[I830_CTXREG_STATE4];
+ i830->meta.Ctx[I830_CTXREG_STATE5] = i830->state.Ctx[I830_CTXREG_STATE5];
+ i830->meta.Ctx[I830_CTXREG_IALPHAB] = i830->state.Ctx[I830_CTXREG_IALPHAB];
+ i830->meta.Ctx[I830_CTXREG_STENCILTST] =
+ i830->state.Ctx[I830_CTXREG_STENCILTST];
+ i830->meta.Ctx[I830_CTXREG_ENABLES_1] =
+ i830->state.Ctx[I830_CTXREG_ENABLES_1];
+ i830->meta.Ctx[I830_CTXREG_ENABLES_2] =
+ i830->state.Ctx[I830_CTXREG_ENABLES_2];
+ i830->meta.Ctx[I830_CTXREG_AA] = i830->state.Ctx[I830_CTXREG_AA];
+ i830->meta.Ctx[I830_CTXREG_FOGCOLOR] =
+ i830->state.Ctx[I830_CTXREG_FOGCOLOR];
+ i830->meta.Ctx[I830_CTXREG_BLENDCOLOR0] =
+ i830->state.Ctx[I830_CTXREG_BLENDCOLOR0];
+ i830->meta.Ctx[I830_CTXREG_BLENDCOLOR1] =
+ i830->state.Ctx[I830_CTXREG_BLENDCOLOR1];
+ i830->meta.Ctx[I830_CTXREG_MCSB0] = i830->state.Ctx[I830_CTXREG_MCSB0];
+ i830->meta.Ctx[I830_CTXREG_MCSB1] = i830->state.Ctx[I830_CTXREG_MCSB1];
+
+
+ i830->meta.Ctx[I830_CTXREG_STATE3] &= ~CULLMODE_MASK;
+ i830->meta.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE;
+ i830->meta.emitted &= ~I830_UPLOAD_CTX;
+
+
+ i830->meta.Buffer[I830_DESTREG_SENABLE] =
+ i830->state.Buffer[I830_DESTREG_SENABLE];
+ i830->meta.Buffer[I830_DESTREG_SR1] = i830->state.Buffer[I830_DESTREG_SR1];
+ i830->meta.Buffer[I830_DESTREG_SR2] = i830->state.Buffer[I830_DESTREG_SR2];
+ i830->meta.emitted &= ~I830_UPLOAD_BUFFERS;
+}
+
+
+
+/* Select between front and back draw buffers.
+ */
+static void
+meta_draw_region(struct intel_context *intel,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ i830_state_draw_region(intel, &i830->meta, color_region, depth_region);
+}
+
+
+/* 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
+install_meta_state(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ memcpy(&i830->meta, &i830->initial, sizeof(i830->meta));
+
+ i830->meta.active = ACTIVE;
+ i830->meta.emitted = 0;
+
+ SET_STATE(i830, meta);
+ set_vertex_format(intel);
+ set_no_texture(intel);
+}
+
+static void
+leave_meta_state(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ intel_region_release(&i830->meta.draw_region);
+ intel_region_release(&i830->meta.depth_region);
+/* intel_region_release(intel, &i830->meta.tex_region[0]); */
+ SET_STATE(i830, state);
+}
+
+
+
+void
+i830InitMetaFuncs(struct i830_context *i830)
+{
+ i830->intel.vtbl.install_meta_state = install_meta_state;
+ i830->intel.vtbl.leave_meta_state = leave_meta_state;
+ i830->intel.vtbl.meta_no_depth_write = set_no_depth_write;
+ i830->intel.vtbl.meta_no_stencil_write = set_no_stencil_write;
+ i830->intel.vtbl.meta_stencil_replace = set_stencil_replace;
+ i830->intel.vtbl.meta_depth_replace = set_depth_replace;
+ i830->intel.vtbl.meta_color_mask = set_color_mask;
+ i830->intel.vtbl.meta_no_texture = set_no_texture;
+ i830->intel.vtbl.meta_texture_blend_replace = set_texture_blend_replace;
+ i830->intel.vtbl.meta_tex_rect_source = set_tex_rect_source;
+ i830->intel.vtbl.meta_draw_region = meta_draw_region;
+ i830->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state;
+}
diff --git a/src/mesa/drivers/dri/i915tex/i830_reg.h b/src/mesa/drivers/dri/i915tex/i830_reg.h
new file mode 100644
index 00000000000..24ac5245005
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_reg.h
@@ -0,0 +1,641 @@
+/**************************************************************************
+ *
+ * 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)&0xff)<<8)
+#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff))
+#define ENABLE_STENCIL_WRITE_MASK (1<<16)
+#define STENCIL_WRITE_MASK(x) ((x)&0xff)
+
+/* _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/src/mesa/drivers/dri/i915tex/i830_state.c b/src/mesa/drivers/dri/i915tex/i830_state.c
new file mode 100644
index 00000000000..812daa65246
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_state.c
@@ -0,0 +1,1114 @@
+/**************************************************************************
+ *
+ * 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 "intel_fbo.h"
+
+#include "i830_context.h"
+#include "i830_reg.h"
+
+#define FILE_DEBUG_FLAG DEBUG_STATE
+
+static void
+i830StencilFuncSeparate(GLcontext * ctx, GLenum face, GLenum func, GLint ref,
+ GLuint mask)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ int test = intel_translate_compare_func(func);
+
+ mask = mask & 0xff;
+
+ DBG("%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
+i830StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask)
+{
+ struct i830_context *i830 = i830_context(ctx);
+
+ DBG("%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
+i830StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail, GLenum zfail,
+ GLenum zpass)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ int fop, dfop, dpop;
+
+ DBG("%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)
+{
+ struct i830_context *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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+
+ I830_STATECHANGE(i830, I830_UPLOAD_CTX);
+
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
+ 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])
+{
+ struct i830_context *i830 = i830_context(ctx);
+ GLubyte r, g, b, a;
+
+ DBG("%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)
+{
+ struct i830_context *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)
+{
+ DBG("%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)
+{
+ DBG("%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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ int test = intel_translate_compare_func(func);
+
+ DBG("%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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+
+ DBG("%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)
+{
+ struct i830_context *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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ int x1, y1, x2, y2;
+
+ if (!ctx->DrawBuffer)
+ return;
+
+ DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
+
+ if (ctx->DrawBuffer->Name == 0) {
+ x1 = x;
+ y1 = ctx->DrawBuffer->Height - (y + h);
+ x2 = x + w - 1;
+ y2 = y1 + h - 1;
+ DBG("%s %d..%d,%d..%d (inverted)\n", __FUNCTION__, x1, x2, y1, y2);
+ }
+ else {
+ /* FBO - not inverted
+ */
+ x1 = x;
+ y1 = y;
+ x2 = x + w - 1;
+ y2 = y + h - 1;
+ DBG("%s %d..%d,%d..%d (not inverted)\n", __FUNCTION__, x1, x2, y1, y2);
+ }
+
+ x1 = CLAMP(x1, 0, ctx->DrawBuffer->Width - 1);
+ y1 = CLAMP(y1, 0, ctx->DrawBuffer->Height - 1);
+ x2 = CLAMP(x2, 0, ctx->DrawBuffer->Width - 1);
+ y2 = CLAMP(y2, 0, ctx->DrawBuffer->Height - 1);
+
+ DBG("%s %d..%d,%d..%d (clamped)\n", __FUNCTION__, x1, x2, y1, y2);
+
+ 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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ int tmp = intel_translate_logic_op(opcode);
+
+ DBG("%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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ GLuint mode;
+
+ DBG("%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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ int width;
+ int state5;
+
+ DBG("%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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ GLint point_size = (int) size;
+
+ DBG("%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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+ GLuint tmp = 0;
+
+ DBG("%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)
+{
+ struct i830_context *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)
+{
+ DBG("%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)
+{
+ struct i830_context *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)
+{
+ struct i830_context *i830 = i830_context(ctx);
+
+ DBG("%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)
+{
+ struct i830_context *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:
+ {
+ GLboolean hw_stencil = GL_FALSE;
+ if (ctx->DrawBuffer) {
+ struct intel_renderbuffer *irbStencil
+ = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL);
+ hw_stencil = (irbStencil && irbStencil->region);
+ }
+ if (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(struct i830_context *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 000 /* XXX all the stencil enable state is set in i830Enable(), right? */
+ 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
+#endif
+ {
+ 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->front.pitch) | /* pitch in bytes */
+ 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->depth.pitch) | /* pitch in bytes */
+ BUF_3D_USE_FENCE);
+
+ i830->state.Buffer[I830_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
+
+#if 0
+ switch (screen->fbFormat) {
+ 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;
+ }
+#endif
+ 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->StencilFuncSeparate = i830StencilFuncSeparate;
+ functions->StencilMaskSeparate = i830StencilMaskSeparate;
+ functions->StencilOpSeparate = i830StencilOpSeparate;
+}
+
+void
+i830InitState(struct i830_context *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_INVARIENT |
+ I830_UPLOAD_TEXBLEND(0) |
+ I830_UPLOAD_STIPPLE |
+ I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS);
+}
diff --git a/src/mesa/drivers/dri/i915tex/i830_tex.c b/src/mesa/drivers/dri/i915tex/i830_tex.c
new file mode 100644
index 00000000000..fed464d1aac
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_tex.c
@@ -0,0 +1,100 @@
+/**************************************************************************
+ *
+ * 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"
+
+
+
+static void
+i830TexEnv(GLcontext * ctx, GLenum target,
+ GLenum pname, const GLfloat * param)
+{
+
+ switch (pname) {
+ case GL_TEXTURE_ENV_COLOR:
+ 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:{
+ struct i830_context *i830 = i830_context(ctx);
+ GLuint unit = ctx->Texture.CurrentUnit;
+ int b = (int) ((*param) * 16.0);
+ if (b > 63)
+ b = 63;
+ if (b < -64)
+ b = -64;
+ I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit));
+ i830->lodbias_tm0s3[unit] =
+ ((b << TM0S3_LOD_BIAS_SHIFT) & TM0S3_LOD_BIAS_MASK);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+
+
+
+void
+i830InitTextureFuncs(struct dd_function_table *functions)
+{
+ functions->TexEnv = i830TexEnv;
+}
diff --git a/src/mesa/drivers/dri/i915tex/i830_texblend.c b/src/mesa/drivers/dri/i915tex/i830_texblend.c
new file mode 100644
index 00000000000..58f220eb7ce
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_texblend.c
@@ -0,0 +1,463 @@
+/**************************************************************************
+ *
+ * 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(struct i830_context * 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(struct i830_context *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(struct i830_context *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(struct i830_context *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/src/mesa/drivers/dri/i915tex/i830_texstate.c b/src/mesa/drivers/dri/i915tex/i830_texstate.c
new file mode 100644
index 00000000000..e3f34e3944a
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_texstate.c
@@ -0,0 +1,322 @@
+/**************************************************************************
+ *
+ * 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 "mtypes.h"
+#include "enums.h"
+#include "texformat.h"
+#include "dri_bufmgr.h"
+
+#include "intel_mipmap_tree.h"
+#include "intel_tex.h"
+
+#include "i830_context.h"
+#include "i830_reg.h"
+
+
+
+static GLuint
+translate_texture_format(GLuint mesa_format)
+{
+ switch (mesa_format) {
+ case MESA_FORMAT_L8:
+ return MAPSURF_8BIT | MT_8BIT_L8;
+ case MESA_FORMAT_I8:
+ return MAPSURF_8BIT | MT_8BIT_I8;
+ case MESA_FORMAT_A8:
+ return MAPSURF_8BIT | MT_8BIT_I8; /* Kludge! */
+ case MESA_FORMAT_AL88:
+ return MAPSURF_16BIT | MT_16BIT_AY88;
+ case MESA_FORMAT_RGB565:
+ return MAPSURF_16BIT | MT_16BIT_RGB565;
+ case MESA_FORMAT_ARGB1555:
+ return MAPSURF_16BIT | MT_16BIT_ARGB1555;
+ case MESA_FORMAT_ARGB4444:
+ return MAPSURF_16BIT | MT_16BIT_ARGB4444;
+ case MESA_FORMAT_ARGB8888:
+ return MAPSURF_32BIT | MT_32BIT_ARGB8888;
+ case MESA_FORMAT_YCBCR_REV:
+ return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
+ case MESA_FORMAT_YCBCR:
+ return (MAPSURF_422 | MT_422_YCRCB_SWAPY);
+ case MESA_FORMAT_RGB_FXT1:
+ case MESA_FORMAT_RGBA_FXT1:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1);
+ case MESA_FORMAT_RGBA_DXT1:
+ case MESA_FORMAT_RGB_DXT1:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1);
+ case MESA_FORMAT_RGBA_DXT3:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3);
+ case MESA_FORMAT_RGBA_DXT5:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
+ default:
+ fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format);
+ abort();
+ return 0;
+ }
+}
+
+
+
+
+/* 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:
+ case GL_CLAMP_TO_EDGE:
+ return TEXCOORDMODE_CLAMP; /* not really correct */
+ case GL_CLAMP_TO_BORDER:
+ return TEXCOORDMODE_CLAMP_BORDER;
+ case GL_MIRRORED_REPEAT:
+ return TEXCOORDMODE_MIRROR;
+ default:
+ return TEXCOORDMODE_WRAP;
+ }
+}
+
+
+/* Recalculate all state from scratch. Perhaps not the most
+ * efficient, but this has gotten complex enough that we need
+ * something which is understandable and reliable.
+ */
+static GLboolean
+i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
+{
+ GLcontext *ctx = &intel->ctx;
+ struct i830_context *i830 = i830_context(ctx);
+ struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
+ struct intel_texture_object *intelObj = intel_texture_object(tObj);
+ struct gl_texture_image *firstImage;
+ GLuint *state = i830->state.Tex[unit];
+
+ memset(state, 0, sizeof(state));
+
+ /*We need to refcount these. */
+
+ if (i830->state.tex_buffer[unit] != NULL) {
+ driBOUnReference(i830->state.tex_buffer[unit]);
+ i830->state.tex_buffer[unit] = NULL;
+ }
+
+ if (!intel_finalize_mipmap_tree(intel, unit))
+ return GL_FALSE;
+
+ /* Get first image here, since intelObj->firstLevel will get set in
+ * the intel_finalize_mipmap_tree() call above.
+ */
+ firstImage = tObj->Image[0][intelObj->firstLevel];
+
+ i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer);
+ i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
+ intelObj->
+ firstLevel);
+
+
+ state[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 |
+ (LOAD_TEXTURE_MAP0 << unit) | 4);
+
+/* state[I830_TEXREG_TM0S0] = (TM0S0_USE_FENCE | */
+/* t->intel.TextureOffset); */
+
+
+ state[I830_TEXREG_TM0S1] =
+ (((firstImage->Height - 1) << TM0S1_HEIGHT_SHIFT) |
+ ((firstImage->Width - 1) << TM0S1_WIDTH_SHIFT) |
+ translate_texture_format(firstImage->TexFormat->MesaFormat));
+
+ state[I830_TEXREG_TM0S2] =
+ (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) -
+ 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK);
+
+ {
+ if (tObj->Target == GL_TEXTURE_CUBE_MAP)
+ state[I830_TEXREG_CUBE] = (_3DSTATE_MAP_CUBE | MAP_UNIT(unit) |
+ CUBE_NEGX_ENABLE |
+ CUBE_POSX_ENABLE |
+ CUBE_NEGY_ENABLE |
+ CUBE_POSY_ENABLE |
+ CUBE_NEGZ_ENABLE | CUBE_POSZ_ENABLE);
+ else
+ state[I830_TEXREG_CUBE] = (_3DSTATE_MAP_CUBE | MAP_UNIT(unit));
+ }
+
+
+
+
+ {
+ GLuint minFilt, mipFilt, magFilt;
+
+ switch (tObj->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:
+ return GL_FALSE;
+ }
+
+ if (tObj->MaxAnisotropy > 1.0) {
+ minFilt = FILTER_ANISOTROPIC;
+ magFilt = FILTER_ANISOTROPIC;
+ }
+ else {
+ switch (tObj->MagFilter) {
+ case GL_NEAREST:
+ magFilt = FILTER_NEAREST;
+ break;
+ case GL_LINEAR:
+ magFilt = FILTER_LINEAR;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ }
+
+ state[I830_TEXREG_TM0S3] = i830->lodbias_tm0s3[unit];
+
+#if 0
+ /* YUV conversion:
+ */
+ if (firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR ||
+ firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV)
+ state[I830_TEXREG_TM0S3] |= SS2_COLORSPACE_CONVERSION;
+#endif
+
+ state[I830_TEXREG_TM0S3] |= ((intelObj->lastLevel -
+ intelObj->firstLevel) *
+ 4) << TM0S3_MIN_MIP_SHIFT;
+
+ state[I830_TEXREG_TM0S3] |= ((minFilt << TM0S3_MIN_FILTER_SHIFT) |
+ (mipFilt << TM0S3_MIP_FILTER_SHIFT) |
+ (magFilt << TM0S3_MAG_FILTER_SHIFT));
+ }
+
+ {
+ GLenum ws = tObj->WrapS;
+ GLenum wt = tObj->WrapT;
+
+
+ /* 3D textures not available on i830
+ */
+ if (tObj->Target == GL_TEXTURE_3D)
+ return GL_FALSE;
+
+ state[I830_TEXREG_MCS] = (_3DSTATE_MAP_COORD_SET_CMD |
+ MAP_UNIT(unit) |
+ ENABLE_TEXCOORD_PARAMS |
+ ss3 |
+ ENABLE_ADDR_V_CNTL |
+ TEXCOORD_ADDR_V_MODE(translate_wrap_mode(wt))
+ | ENABLE_ADDR_U_CNTL |
+ TEXCOORD_ADDR_U_MODE(translate_wrap_mode
+ (ws)));
+ }
+
+
+ state[I830_TEXREG_TM0S4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
+ tObj->_BorderChan[1],
+ tObj->_BorderChan[2],
+ tObj->_BorderChan[3]);
+
+
+ I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(unit), GL_TRUE);
+ /* memcmp was already disabled, but definitely won't work as the
+ * region might now change and that wouldn't be detected:
+ */
+ I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit));
+ return GL_TRUE;
+}
+
+
+
+
+void
+i830UpdateTextureState(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ GLboolean ok = GL_TRUE;
+ GLuint i;
+
+ for (i = 0; i < I830_TEX_UNITS && ok; i++) {
+ switch (intel->ctx.Texture.Unit[i]._ReallyEnabled) {
+ case TEXTURE_1D_BIT:
+ case TEXTURE_2D_BIT:
+ case TEXTURE_CUBE_BIT:
+ ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_NORMAL);
+ break;
+ case TEXTURE_RECT_BIT:
+ ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_IN_TEXELUNITS);
+ break;
+ case 0:{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ if (i830->state.active & I830_UPLOAD_TEX(i))
+ I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), GL_FALSE);
+
+ if (i830->state.tex_buffer[i] != NULL) {
+ driBOUnReference(i830->state.tex_buffer[i]);
+ i830->state.tex_buffer[i] = NULL;
+ }
+ break;
+ }
+ case TEXTURE_3D_BIT:
+ default:
+ ok = GL_FALSE;
+ break;
+ }
+ }
+
+ FALLBACK(intel, I830_FALLBACK_TEXTURE, !ok);
+
+ if (ok)
+ i830EmitTextureBlend(i830);
+}
diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
new file mode 100644
index 00000000000..dd0670dec37
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -0,0 +1,659 @@
+/**************************************************************************
+ *
+ * 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 "intel_regions.h"
+#include "tnl/t_context.h"
+#include "tnl/t_vertex.h"
+
+#define FILE_DEBUG_FLAG DEBUG_STATE
+
+static GLboolean i830_check_vertex_size(struct intel_context *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(struct intel_context *intel)
+{
+ GLcontext *ctx = &intel->ctx;
+ struct i830_context *i830 = i830_context(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ DECLARE_RENDERINPUTS(index_bitset);
+ GLuint v0 = _3DSTATE_VFT0_CMD;
+ GLuint v2 = _3DSTATE_VFT1_CMD;
+ GLuint mcsb1 = 0;
+
+ RENDERINPUTS_COPY(index_bitset, tnl->render_inputs_bitset);
+
+ /* 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 (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) {
+ 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 (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_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 (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR1) ||
+ RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_FOG)) {
+ if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR1)) {
+ intel->specoffset = intel->coloroffset + 1;
+ EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, VFT0_SPEC);
+ }
+ else
+ EMIT_PAD(3);
+
+ if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_FOG))
+ EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1UB_1F, VFT0_SPEC);
+ else
+ EMIT_PAD(1);
+ }
+
+ if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) {
+ int i, count = 0;
+
+ for (i = 0; i < I830_TEX_UNITS; i++) {
+ if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_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] ||
+ !RENDERINPUTS_EQUAL(index_bitset, i830->last_index_bitset)) {
+ int k;
+
+ 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;
+ RENDERINPUTS_COPY(i830->last_index_bitset, index_bitset);
+
+ k = i830_check_vertex_size(intel, intel->vertex_size);
+ assert(k);
+ }
+}
+
+static void
+i830_reduced_primitive_state(struct intel_context *intel, GLenum rprim)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ 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]) {
+ INTEL_FIREVERTICES(intel);
+
+ 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(struct intel_context *intel, GLuint expected)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ 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(struct intel_context *intel)
+{
+ BATCH_LOCALS;
+
+ BEGIN_BATCH(40, 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);
+
+ 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_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), 0); \
+ for (k = 0 ; k < size / sizeof(GLuint) ; k++) { \
+ if (0) _mesa_printf(" 0x%08x\n", state[k]); \
+ OUT_BATCH(state[k]); \
+ } \
+ ADVANCE_BATCH(); \
+} while (0)
+
+static GLuint
+get_state_size(struct i830_hw_state *state)
+{
+ GLuint dirty = state->active & ~state->emitted;
+ GLuint sz = 0;
+ GLuint i;
+
+ if (dirty & I830_UPLOAD_INVARIENT)
+ sz += 40 * sizeof(int);
+
+ if (dirty & I830_UPLOAD_CTX)
+ sz += sizeof(state->Ctx);
+
+ if (dirty & I830_UPLOAD_BUFFERS)
+ sz += sizeof(state->Buffer);
+
+ if (dirty & I830_UPLOAD_STIPPLE)
+ sz += sizeof(state->Stipple);
+
+ for (i = 0; i < I830_TEX_UNITS; i++) {
+ if ((dirty & I830_UPLOAD_TEX(i)))
+ sz += sizeof(state->Tex[i]);
+
+ if (dirty & I830_UPLOAD_TEXBLEND(i))
+ sz += state->TexBlendWordsUsed[i] * 4;
+ }
+
+ return sz;
+}
+
+
+/* Push the state into the sarea and/or texture memory.
+ */
+static void
+i830_emit_state(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ struct i830_hw_state *state = i830->current;
+ int i;
+ GLuint dirty;
+ BATCH_LOCALS;
+
+ /* We don't hold the lock at this point, so want to make sure that
+ * there won't be a buffer wrap.
+ *
+ * It might be better to talk about explicit places where
+ * scheduling is allowed, rather than assume that it is whenever a
+ * batchbuffer fills up.
+ */
+ intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
+
+ /* Do this here as we may have flushed the batchbuffer above,
+ * causing more state to be dirty!
+ */
+ dirty = state->active & ~state->emitted;
+
+ if (dirty & I830_UPLOAD_INVARIENT) {
+ DBG("I830_UPLOAD_INVARIENT:\n");
+ i830_emit_invarient_state(intel);
+ }
+
+ if (dirty & I830_UPLOAD_CTX) {
+ DBG("I830_UPLOAD_CTX:\n");
+ emit(i830, state->Ctx, sizeof(state->Ctx));
+
+ }
+
+ if (dirty & I830_UPLOAD_BUFFERS) {
+ DBG("I830_UPLOAD_BUFFERS:\n");
+ BEGIN_BATCH(I830_DEST_SETUP_SIZE + 2, 0);
+ OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR0]);
+ OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR1]);
+ OUT_RELOC(state->draw_region->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ state->draw_region->draw_offset);
+
+ if (state->depth_region) {
+ OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR0]);
+ OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR1]);
+ OUT_RELOC(state->depth_region->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ state->depth_region->draw_offset);
+ }
+
+ OUT_BATCH(state->Buffer[I830_DESTREG_DV0]);
+ OUT_BATCH(state->Buffer[I830_DESTREG_DV1]);
+ OUT_BATCH(state->Buffer[I830_DESTREG_SENABLE]);
+ OUT_BATCH(state->Buffer[I830_DESTREG_SR0]);
+ OUT_BATCH(state->Buffer[I830_DESTREG_SR1]);
+ OUT_BATCH(state->Buffer[I830_DESTREG_SR2]);
+ ADVANCE_BATCH();
+ }
+
+ if (dirty & I830_UPLOAD_STIPPLE) {
+ DBG("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))) {
+ DBG("I830_UPLOAD_TEX(%d):\n", i);
+
+ BEGIN_BATCH(I830_TEX_SETUP_SIZE + 1, 0);
+ OUT_BATCH(state->Tex[i][I830_TEXREG_TM0LI]);
+
+ if (state->tex_buffer[i]) {
+ OUT_RELOC(state->tex_buffer[i],
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
+ state->tex_offset[i] | TM0S0_USE_FENCE);
+ }
+ else {
+ assert(i == 0);
+ assert(state == &i830->meta);
+ OUT_BATCH(0);
+ }
+
+ OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S1]);
+ OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S2]);
+ OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S3]);
+ OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S4]);
+ OUT_BATCH(state->Tex[i][I830_TEXREG_MCS]);
+ OUT_BATCH(state->Tex[i][I830_TEXREG_CUBE]);
+ }
+
+ if (dirty & I830_UPLOAD_TEXBLEND(i)) {
+ DBG("I830_UPLOAD_TEXBLEND(%d): %d words\n", i,
+ state->TexBlendWordsUsed[i]);
+ emit(i830, state->TexBlend[i], state->TexBlendWordsUsed[i] * 4);
+ }
+ }
+
+ state->emitted |= dirty;
+}
+
+static void
+i830_destroy_context(struct intel_context *intel)
+{
+ _tnl_free_vertices(&intel->ctx);
+}
+
+
+void
+i830_state_draw_region(struct intel_context *intel,
+ struct i830_hw_state *state,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ GLuint value;
+
+ ASSERT(state == &i830->state || state == &i830->meta);
+
+ if (state->draw_region != color_region) {
+ intel_region_release(&state->draw_region);
+ intel_region_reference(&state->draw_region, color_region);
+ }
+ if (state->depth_region != depth_region) {
+ intel_region_release(&state->depth_region);
+ intel_region_reference(&state->depth_region, depth_region);
+ }
+
+ /*
+ * Set stride/cpp values
+ */
+ if (color_region) {
+ state->Buffer[I830_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ state->Buffer[I830_DESTREG_CBUFADDR1] =
+ (BUF_3D_ID_COLOR_BACK |
+ BUF_3D_PITCH(color_region->pitch * color_region->cpp) |
+ BUF_3D_USE_FENCE);
+ }
+
+ if (depth_region) {
+ state->Buffer[I830_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ state->Buffer[I830_DESTREG_DBUFADDR1] =
+ (BUF_3D_ID_DEPTH |
+ BUF_3D_PITCH(depth_region->pitch * depth_region->cpp) |
+ BUF_3D_USE_FENCE);
+ }
+
+ /*
+ * Compute/set I830_DESTREG_DV1 value
+ */
+ value = (DSTORG_HORT_BIAS(0x8) | /* .5 */
+ DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z); /* .5 */
+
+ if (color_region && color_region->cpp == 4) {
+ value |= DV_PF_8888;
+ }
+ else {
+ value |= DV_PF_565;
+ }
+ if (depth_region && depth_region->cpp == 4) {
+ value |= DEPTH_FRMT_24_FIXED_8_OTHER;
+ }
+ else {
+ value |= DEPTH_FRMT_16_FIXED;
+ }
+ state->Buffer[I830_DESTREG_DV1] = value;
+
+ I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS);
+
+
+}
+
+
+static void
+i830_set_draw_region(struct intel_context *intel,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ i830_state_draw_region(intel, &i830->state, color_region, depth_region);
+}
+
+#if 0
+static void
+i830_update_color_z_regions(intelContextPtr intel,
+ const intelRegion * colorRegion,
+ const intelRegion * depthRegion)
+{
+ i830ContextPtr i830 = I830_CONTEXT(intel);
+
+ i830->state.Buffer[I830_DESTREG_CBUFADDR1] =
+ (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(colorRegion->pitch) |
+ BUF_3D_USE_FENCE);
+ i830->state.Buffer[I830_DESTREG_CBUFADDR2] = colorRegion->offset;
+
+ i830->state.Buffer[I830_DESTREG_DBUFADDR1] =
+ (BUF_3D_ID_DEPTH | BUF_3D_PITCH(depthRegion->pitch) | BUF_3D_USE_FENCE);
+ i830->state.Buffer[I830_DESTREG_DBUFADDR2] = depthRegion->offset;
+}
+#endif
+
+
+/* This isn't really handled at the moment.
+ */
+static void
+i830_lost_hardware(struct intel_context *intel)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ i830->state.emitted = 0;
+}
+
+
+
+static GLuint
+i830_flush_cmd(void)
+{
+ return MI_FLUSH | FLUSH_MAP_CACHE;
+}
+
+
+static void
+i830_assert_not_dirty( struct intel_context *intel )
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ struct i830_hw_state *state = i830->current;
+ GLuint dirty = state->active & ~state->emitted;
+ assert(!dirty);
+}
+
+
+void
+i830InitVtbl(struct i830_context *i830)
+{
+ i830->intel.vtbl.check_vertex_size = i830_check_vertex_size;
+ i830->intel.vtbl.destroy = i830_destroy_context;
+ 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_region = i830_set_draw_region;
+ i830->intel.vtbl.update_texture_state = i830UpdateTextureState;
+ i830->intel.vtbl.flush_cmd = i830_flush_cmd;
+ i830->intel.vtbl.render_start = i830_render_start;
+ i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty;
+}
diff --git a/src/mesa/drivers/dri/i915tex/i915_context.c b/src/mesa/drivers/dri/i915tex/i915_context.c
new file mode 100644
index 00000000000..4cbe29d79d6
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_context.c
@@ -0,0 +1,175 @@
+/**************************************************************************
+ *
+ * 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"
+
+#include "intel_regions.h"
+#include "intel_batchbuffer.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_ARB_texture_env_crossbar", NULL},
+ {"GL_ARB_texture_non_power_of_two", 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;
+ struct i915_context *i915 =
+ (struct i915_context *) CALLOC_STRUCT(i915_context);
+ struct intel_context *intel = &i915->intel;
+ GLcontext *ctx = &intel->ctx;
+
+ if (!i915)
+ return GL_FALSE;
+
+ if (0)
+ _mesa_printf("\ntexmem-0-3 branch\n\n");
+
+ i915InitVtbl(i915);
+ i915InitMetaFuncs(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;
+
+
+ /* Advertise the full hardware capabilities. The new memory
+ * manager should cope much better with overload situations:
+ */
+ ctx->Const.MaxTextureLevels = 12;
+ ctx->Const.Max3DTextureLevels = 9;
+ ctx->Const.MaxCubeTextureLevels = 12;
+ ctx->Const.MaxTextureRectSize = (1 << 11);
+ 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.FragmentProgram.MaxNativeTemps = I915_MAX_TEMPORARY;
+ ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* 8 tex, 2 color, fog */
+ ctx->Const.FragmentProgram.MaxNativeParameters = I915_MAX_CONSTANT;
+ ctx->Const.FragmentProgram.MaxNativeAluInstructions = I915_MAX_ALU_INSN;
+ ctx->Const.FragmentProgram.MaxNativeTexInstructions = I915_MAX_TEX_INSN;
+ ctx->Const.FragmentProgram.MaxNativeInstructions = (I915_MAX_ALU_INSN +
+ I915_MAX_TEX_INSN);
+ ctx->Const.FragmentProgram.MaxNativeTexIndirections =
+ I915_MAX_TEX_INDIRECT;
+ ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
+
+ ctx->_MaintainTexEnvProgram = 1;
+ ctx->_UseTexEnvProgram = 1;
+
+ 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/src/mesa/drivers/dri/i915tex/i915_context.h b/src/mesa/drivers/dri/i915tex/i915_context.h
new file mode 100644
index 00000000000..5ae76fcd185
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_context.h
@@ -0,0 +1,367 @@
+ /**************************************************************************
+ *
+ * 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_FALLBACK_POLYGON_SMOOTH 0x40000
+#define I915_FALLBACK_POINT_SMOOTH 0x80000
+
+#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_INVARIENT 0x40
+#define I915_UPLOAD_DEFAULTS 0x80
+#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_DBUFADDR0 3
+#define I915_DESTREG_DBUFADDR1 4
+#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_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_DEFREG_C0 0
+#define I915_DEFREG_C1 1
+#define I915_DEFREG_S0 2
+#define I915_DEFREG_S1 3
+#define I915_DEFREG_Z0 4
+#define I915_DEFREG_Z1 5
+#define I915_DEF_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 gl_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;
+};
+
+
+
+
+
+
+
+#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 Defaults[I915_DEF_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;
+
+ /* Region pointers for relocation:
+ */
+ struct intel_region *draw_region;
+ struct intel_region *depth_region;
+/* struct intel_region *tex_region[I915_TEX_UNITS]; */
+
+ /* Regions aren't actually that appropriate here as the memory may
+ * be from a PBO or FBO. Just use the buffer id. Will have to do
+ * this for draw and depth for FBO's...
+ */
+ struct _DriBufferObject *tex_buffer[I915_TEX_UNITS];
+ GLuint tex_offset[I915_TEX_UNITS];
+
+
+ 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;
+ GLuint lodbias_ss2[MAX_TEXTURE_UNITS];
+
+
+ struct i915_fragment_program tex_program;
+ struct i915_fragment_program *current_program;
+
+ struct i915_hw_state meta, initial, state, *current;
+};
+
+
+#define I915_STATECHANGE(i915, flag) \
+do { \
+ INTEL_FIREVERTICES( &(i915)->intel ); \
+ (i915)->state.emitted &= ~(flag); \
+} while (0)
+
+#define I915_ACTIVESTATE(i915, flag, mode) \
+do { \
+ INTEL_FIREVERTICES( &(i915)->intel ); \
+ if (mode) \
+ (i915)->state.active |= (flag); \
+ else \
+ (i915)->state.active &= ~(flag); \
+} while (0)
+
+
+/*======================================================================
+ * i915_vtbl.c
+ */
+extern void i915InitVtbl(struct i915_context *i915);
+
+extern void
+i915_state_draw_region(struct intel_context *intel,
+ struct i915_hw_state *state,
+ struct intel_region *color_region,
+ struct intel_region *depth_region);
+
+
+
+#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(struct i915_context *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(struct i915_context *i915);
+extern void i915_update_fog(GLcontext * ctx);
+
+
+/*======================================================================
+ * i915_tex.c
+ */
+extern void i915UpdateTextureState(struct intel_context *intel);
+extern void i915InitTextureFuncs(struct dd_function_table *functions);
+
+/*======================================================================
+ * i915_metaops.c
+ */
+void i915InitMetaFuncs(struct i915_context *i915);
+
+
+/*======================================================================
+ * i915_fragprog.c
+ */
+extern void i915ValidateFragmentProgram(struct i915_context *i915);
+extern void i915InitFragProgFuncs(struct dd_function_table *functions);
+
+/*======================================================================
+ * Inline conversion functions. These are better-typed than the
+ * macros used previously:
+ */
+static INLINE struct i915_context *
+i915_context(GLcontext * ctx)
+{
+ return (struct i915_context *) ctx;
+}
+
+
+
+#define I915_CONTEXT(ctx) i915_context(ctx)
+
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/i915_debug.c b/src/mesa/drivers/dri/i915tex/i915_debug.c
new file mode 100644
index 00000000000..974527e14cc
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_debug.c
@@ -0,0 +1,334 @@
+/**************************************************************************
+ *
+ * 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/src/mesa/drivers/dri/i915tex/i915_fragprog.c b/src/mesa/drivers/dri/i915tex/i915_fragprog.c
new file mode 100644
index 00000000000..8772e702307
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_fragprog.c
@@ -0,0 +1,1083 @@
+/**************************************************************************
+ *
+ * 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/tnl.h"
+#include "tnl/t_context.h"
+#include "intel_batchbuffer.h"
+
+#include "i915_reg.h"
+#include "i915_context.h"
+#include "i915_program.h"
+
+#include "program_instruction.h"
+#include "program.h"
+#include "programopt.h"
+
+
+
+/* 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 prog_src_register *source,
+ const struct gl_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_CONSTANT:
+ case PROGRAM_STATE_VAR:
+ case PROGRAM_NAMED_PARAM:
+ src =
+ i915_emit_param4fv(p,
+ program->Base.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,
+ GET_BIT(source->NegateBase, 0),
+ GET_BIT(source->NegateBase, 1),
+ GET_BIT(source->NegateBase, 2),
+ GET_BIT(source->NegateBase, 3));
+
+ return src;
+}
+
+
+static GLuint
+get_result_vector(struct i915_fragment_program *p,
+ const struct prog_instruction *inst)
+{
+ switch (inst->DstReg.File) {
+ case PROGRAM_OUTPUT:
+ switch (inst->DstReg.Index) {
+ case FRAG_RESULT_COLR:
+ return UREG(REG_TYPE_OC, 0);
+ case FRAG_RESULT_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 prog_instruction *inst)
+{
+ GLuint flags = 0;
+
+ if (inst->SaturateMode == SATURATE_ZERO_ONE)
+ 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_target(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_target( p, inst->TexSrcTarget ); \
+ 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 gl_fragment_program *program =
+ p->ctx->FragmentProgram._Current;
+ const struct prog_instruction *inst = program->Base.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 == 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 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 OPCODE_ADD:
+ EMIT_2ARG_ARITH(A0_ADD);
+ break;
+
+ case 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 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 / (M_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, (M_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 OPCODE_DP3:
+ EMIT_2ARG_ARITH(A0_DP3);
+ break;
+
+ case OPCODE_DP4:
+ EMIT_2ARG_ARITH(A0_DP4);
+ break;
+
+ case 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 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 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 OPCODE_FLR:
+ EMIT_1ARG_ARITH(A0_FLR);
+ break;
+
+ case OPCODE_FRC:
+ EMIT_1ARG_ARITH(A0_FRC);
+ break;
+
+ case 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 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 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 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 OPCODE_MAD:
+ EMIT_3ARG_ARITH(A0_MAD);
+ break;
+
+ case OPCODE_MAX:
+ EMIT_2ARG_ARITH(A0_MAX);
+ break;
+
+ case 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 OPCODE_MOV:
+ EMIT_1ARG_ARITH(A0_MOV);
+ break;
+
+ case OPCODE_MUL:
+ EMIT_2ARG_ARITH(A0_MUL);
+ break;
+
+ case 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 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 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 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 OPCODE_SGE:
+ EMIT_2ARG_ARITH(A0_SGE);
+ break;
+
+ case 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 / (M_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, (M_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 OPCODE_SLT:
+ EMIT_2ARG_ARITH(A0_SLT);
+ break;
+
+ case 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 OPCODE_SWZ:
+ EMIT_1ARG_ARITH(A0_MOV); /* extended swizzle handled natively */
+ break;
+
+ case OPCODE_TEX:
+ EMIT_TEX(T0_TEXLD);
+ break;
+
+ case OPCODE_TXB:
+ EMIT_TEX(T0_TEXLDB);
+ break;
+
+ case OPCODE_TXP:
+ EMIT_TEX(T0_TEXLDP);
+ break;
+
+ case 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 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.Base.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)
+{
+ struct i915_context *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.Base.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 gl_program *prog)
+{
+ if (target == GL_FRAGMENT_PROGRAM_ARB) {
+ struct i915_context *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 gl_program *
+i915NewProgram(GLcontext * ctx, GLenum target, GLuint id)
+{
+ switch (target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ return _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_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 gl_program *prog)
+{
+ if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
+ struct i915_context *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 gl_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 gl_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);
+
+ if (p->FragProg.FogOption) {
+ /* add extra instructions to do fog, then turn off FogOption field */
+ _mesa_append_fog_code(ctx, &p->FragProg);
+ p->FragProg.FogOption = GL_NONE;
+ }
+ }
+
+ _tnl_program_string(ctx, target, prog);
+}
+
+
+void
+i915ValidateFragmentProgram(struct i915_context *i915)
+{
+ GLcontext *ctx = &i915->intel.ctx;
+ struct intel_context *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;
+
+ const GLuint inputsRead = p->FragProg.Base.InputsRead;
+ GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
+ GLuint s2 = S2_TEXCOORD_NONE;
+ int i, offset = 0;
+
+ if (i915->current_program != p) {
+ if (i915->current_program) {
+ i915->current_program->on_hardware = 0;
+ i915->current_program->params_uptodate = 0;
+ }
+
+ i915->current_program = p;
+ }
+
+
+ /* 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);
+ }
+
+ /* XXX this was disabled, but enabling this code helped fix the Glean
+ * tfragprog1 fog tests.
+ */
+#if 1
+ 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]) {
+ int k;
+
+ 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;
+
+ k = intel->vtbl.check_vertex_size(intel, intel->vertex_size);
+ assert(k);
+ }
+
+ 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/src/mesa/drivers/dri/i915tex/i915_metaops.c b/src/mesa/drivers/dri/i915tex/i915_metaops.c
new file mode 100644
index 00000000000..3ab62bc806b
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_metaops.c
@@ -0,0 +1,509 @@
+/**************************************************************************
+ *
+ * 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 "intel_regions.h"
+#include "intel_rotate.h"
+
+#include "i915_context.h"
+#include "i915_reg.h"
+
+/* We touch almost everything:
+ */
+#define ACTIVE (I915_UPLOAD_INVARIENT | \
+ I915_UPLOAD_CTX | \
+ I915_UPLOAD_BUFFERS | \
+ I915_UPLOAD_STIPPLE | \
+ I915_UPLOAD_PROGRAM | \
+ I915_UPLOAD_FOG | \
+ I915_UPLOAD_TEX(0))
+
+#define SET_STATE( i915, STATE ) \
+do { \
+ i915->current->emitted &= ~ACTIVE; \
+ i915->current = &i915->STATE; \
+ i915->current->emitted &= ~ACTIVE; \
+} while (0)
+
+
+static void
+meta_no_stencil_write(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE )
+ */
+ i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_TEST_ENABLE |
+ S5_STENCIL_WRITE_ENABLE);
+
+ i915->meta.emitted &= ~I915_UPLOAD_CTX;
+}
+
+static void
+meta_no_depth_write(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ /* 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;
+}
+
+static void
+meta_depth_replace(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_TRUE )
+ * ctx->Driver.DepthMask( ctx, GL_TRUE )
+ */
+ i915->meta.Ctx[I915_CTXREG_LIS6] |= (S6_DEPTH_TEST_ENABLE |
+ S6_DEPTH_WRITE_ENABLE);
+
+ /* ctx->Driver.DepthFunc( ctx, GL_REPLACE )
+ */
+ i915->meta.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_FUNC_MASK;
+ i915->meta.Ctx[I915_CTXREG_LIS6] |=
+ COMPAREFUNC_ALWAYS << S6_DEPTH_TEST_FUNC_SHIFT;
+
+ i915->meta.emitted &= ~I915_UPLOAD_CTX;
+}
+
+
+/* Set stencil unit to replace always with the reference value.
+ */
+static void
+meta_stencil_replace(struct intel_context *intel,
+ GLuint s_mask, GLuint s_clear)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ 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.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
+meta_color_mask(struct intel_context *intel, GLboolean state)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ 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;
+}
+
+
+
+static void
+meta_import_pixel_state(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ memcpy(i915->meta.Fog, i915->state.Fog, I915_FOG_SETUP_SIZE * 4);
+
+ i915->meta.Ctx[I915_CTXREG_LIS5] = i915->state.Ctx[I915_CTXREG_LIS5];
+ i915->meta.Ctx[I915_CTXREG_LIS6] = i915->state.Ctx[I915_CTXREG_LIS6];
+ i915->meta.Ctx[I915_CTXREG_STATE4] = i915->state.Ctx[I915_CTXREG_STATE4];
+ i915->meta.Ctx[I915_CTXREG_BLENDCOLOR1] =
+ i915->state.Ctx[I915_CTXREG_BLENDCOLOR1];
+ i915->meta.Ctx[I915_CTXREG_IAB] = i915->state.Ctx[I915_CTXREG_IAB];
+
+ i915->meta.Buffer[I915_DESTREG_SENABLE] =
+ i915->state.Buffer[I915_DESTREG_SENABLE];
+ i915->meta.Buffer[I915_DESTREG_SR1] = i915->state.Buffer[I915_DESTREG_SR1];
+ i915->meta.Buffer[I915_DESTREG_SR2] = i915->state.Buffer[I915_DESTREG_SR2];
+
+ i915->meta.emitted &= ~I915_UPLOAD_FOG;
+ i915->meta.emitted &= ~I915_UPLOAD_BUFFERS;
+ 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
+meta_no_texture(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ 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;
+}
+
+static void
+meta_texture_blend_replace(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ 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 GLboolean
+meta_tex_rect_source(struct intel_context *intel,
+ struct _DriBufferObject *buffer,
+ GLuint offset,
+ GLuint pitch, GLuint height, GLenum format, GLenum type)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ GLuint unit = 0;
+ GLint numLevels = 1;
+ GLuint *state = i915->meta.Tex[0];
+ GLuint textureFormat;
+ GLuint cpp;
+
+ /* A full implementation of this would do the upload through
+ * glTexImage2d, and get all the conversion operations at that
+ * point. We are restricted, but still at least have access to the
+ * fragment program swizzle.
+ */
+ switch (format) {
+ case GL_BGRA:
+ switch (type) {
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_BYTE:
+ textureFormat = (MAPSURF_32BIT | MT_32BIT_ARGB8888);
+ cpp = 4;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ case GL_RGBA:
+ switch (type) {
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_BYTE:
+ textureFormat = (MAPSURF_32BIT | MT_32BIT_ABGR8888);
+ cpp = 4;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ case GL_BGR:
+ switch (type) {
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565);
+ cpp = 2;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ case GL_RGB:
+ switch (type) {
+ case GL_UNSIGNED_SHORT_5_6_5:
+ textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565);
+ cpp = 2;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+
+ default:
+ return GL_FALSE;
+ }
+
+
+ if ((pitch * cpp) & 3) {
+ _mesa_printf("%s: texture is not dword pitch\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+/* intel_region_release(&i915->meta.tex_region[0]); */
+/* intel_region_reference(&i915->meta.tex_region[0], region); */
+ i915->meta.tex_buffer[0] = buffer;
+ i915->meta.tex_offset[0] = offset;
+
+ state[I915_TEXREG_MS3] = (((height - 1) << MS3_HEIGHT_SHIFT) |
+ ((pitch - 1) << MS3_WIDTH_SHIFT) |
+ textureFormat | MS3_USE_FENCE_REGS);
+
+ state[I915_TEXREG_MS4] = (((((pitch * cpp) / 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);
+ return GL_TRUE;
+}
+
+
+/**
+ * Set the color and depth drawing region for meta ops.
+ */
+static void
+meta_draw_region(struct intel_context *intel,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ i915_state_draw_region(intel, &i915->meta, color_region, depth_region);
+}
+
+
+static void
+set_vertex_format(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ 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_XYZ);
+
+ i915->meta.emitted &= ~I915_UPLOAD_CTX;
+}
+
+
+
+/* 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
+install_meta_state(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ memcpy(&i915->meta, &i915->initial, sizeof(i915->meta));
+ i915->meta.active = ACTIVE;
+ i915->meta.emitted = 0;
+
+ SET_STATE(i915, meta);
+ set_vertex_format(intel);
+ meta_no_texture(intel);
+}
+
+static void
+leave_meta_state(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ intel_region_release(&i915->meta.draw_region);
+ intel_region_release(&i915->meta.depth_region);
+/* intel_region_release(&i915->meta.tex_region[0]); */
+ SET_STATE(i915, state);
+}
+
+
+
+void
+i915InitMetaFuncs(struct i915_context *i915)
+{
+ i915->intel.vtbl.install_meta_state = install_meta_state;
+ i915->intel.vtbl.leave_meta_state = leave_meta_state;
+ i915->intel.vtbl.meta_no_depth_write = meta_no_depth_write;
+ i915->intel.vtbl.meta_no_stencil_write = meta_no_stencil_write;
+ i915->intel.vtbl.meta_stencil_replace = meta_stencil_replace;
+ i915->intel.vtbl.meta_depth_replace = meta_depth_replace;
+ i915->intel.vtbl.meta_color_mask = meta_color_mask;
+ i915->intel.vtbl.meta_no_texture = meta_no_texture;
+ i915->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace;
+ i915->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source;
+ i915->intel.vtbl.meta_draw_region = meta_draw_region;
+ i915->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state;
+}
diff --git a/src/mesa/drivers/dri/i915tex/i915_program.c b/src/mesa/drivers/dri/i915tex/i915_program.c
new file mode 100644
index 00000000000..0be89d33206
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_program.c
@@ -0,0 +1,515 @@
+/**************************************************************************
+ *
+ * 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);
+ dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest));
+ assert(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 )
+{
+ if (coord != UREG(GET_UREG_TYPE(coord), GET_UREG_NR(coord))) {
+ /* No real way to work around this in the general case - need to
+ * allocate and declare a new temporary register (a utemp won't
+ * do). Will fallback for now.
+ */
+ i915_program_error(p, "Can't (yet) swizzle TEX arguments");
+ return 0;
+ }
+
+ /* Don't worry about saturate as we only support
+ */
+ if (destmask != A0_DEST_CHANNEL_ALL) {
+ GLuint tmp = i915_get_utemp(p);
+ i915_emit_texld( p, tmp, A0_DEST_CHANNEL_ALL, sampler, coord, op );
+ i915_emit_arith( p, A0_MOV, dest, destmask, 0, tmp, 0, 0 );
+ return dest;
+ }
+ else {
+ 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 ) |
+ 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 char *msg)
+{
+ _mesa_problem(NULL, "i915_program_error: %s", msg);
+ p->error = 1;
+}
+
+
+void
+i915_init_program(struct i915_context *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");
+
+ if (p->error) {
+ p->FragProg.Base.NumNativeInstructions = 0;
+ p->FragProg.NumNativeAluInstructions = 0;
+ p->FragProg.NumNativeTexInstructions = 0;
+ p->FragProg.NumNativeTexIndirections = 0;
+ }
+ else {
+ p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn +
+ p->nr_tex_insn +
+ p->nr_decl_insn);
+ p->FragProg.NumNativeAluInstructions = p->nr_alu_insn;
+ p->FragProg.NumNativeTexInstructions = p->nr_tex_insn;
+ p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect;
+ }
+
+ p->declarations[0] |= program_size + decl_size - 2;
+}
+
+void
+i915_upload_program(struct i915_context *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/src/mesa/drivers/dri/i915tex/i915_program.h b/src/mesa/drivers/dri/i915tex/i915_program.h
new file mode 100644
index 00000000000..3c12b34f163
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_program.h
@@ -0,0 +1,160 @@
+/**************************************************************************
+ *
+ * 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 char *msg);
+
+extern void i915_init_program(struct i915_context *i915,
+ struct i915_fragment_program *p);
+
+extern void i915_upload_program(struct i915_context *i915,
+ struct i915_fragment_program *p);
+
+extern void i915_fini_program(struct i915_fragment_program *p);
+
+
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/i915_reg.h b/src/mesa/drivers/dri/i915tex/i915_reg.h
new file mode 100644
index 00000000000..04b199905c1
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_reg.h
@@ -0,0 +1,841 @@
+/**************************************************************************
+ *
+ * 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 */
+#define _3DSTATE_MAP_PALETTE_LOAD_32 (CMD_3D|(0x1d<<24)|(0x8f<<16))
+/* subsequent dwords up to length (max 16) are ARGB8888 color values */
+
+/* _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)&0xff)<<8)
+#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff))
+#define ENABLE_STENCIL_WRITE_MASK (1<<16)
+#define STENCIL_WRITE_MASK(x) ((x)&0xff)
+
+/* _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_MIP_LAYOUT_BELOW_LPT (0<<8)
+#define MS4_MIP_LAYOUT_RIGHT_LPT (1<<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 _3DSTATE_DEFAULT_Z ((0x3<<29)|(0x1d<<24)|(0x98<<16))
+#define _3DSTATE_DEFAULT_DIFFUSE ((0x3<<29)|(0x1d<<24)|(0x99<<16))
+#define _3DSTATE_DEFAULT_SPECULAR ((0x3<<29)|(0x1d<<24)|(0x9a<<16))
+
+
+#define MI_FLUSH ((0<<29)|(4<<23))
+#define FLUSH_MAP_CACHE (1<<0)
+#define INHIBIT_FLUSH_RENDER_CACHE (1<<2)
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/i915_state.c b/src/mesa/drivers/dri/i915tex/i915_state.c
new file mode 100644
index 00000000000..2f5a30787ee
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_state.c
@@ -0,0 +1,1019 @@
+/**************************************************************************
+ *
+ * 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_fbo.h"
+#include "intel_screen.h"
+#include "intel_batchbuffer.h"
+
+#include "i915_context.h"
+#include "i915_reg.h"
+
+#define FILE_DEBUG_FLAG DEBUG_STATE
+
+static void
+i915StencilFuncSeparate(GLcontext * ctx, GLenum face, GLenum func, GLint ref,
+ GLuint mask)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ int test = intel_translate_compare_func(func);
+
+ mask = mask & 0xff;
+
+ DBG("%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
+i915StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+
+ DBG("%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
+i915StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail, GLenum zfail,
+ GLenum zpass)
+{
+ struct i915_context *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);
+
+
+ DBG("%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)
+{
+ struct i915_context *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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+
+ I915_STATECHANGE(i915, I915_UPLOAD_CTX);
+
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
+ 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])
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ GLubyte r, g, b, a;
+
+ DBG("%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)
+{
+ struct i915_context *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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ int test = intel_translate_compare_func(func);
+
+ DBG("%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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+
+ DBG("%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)
+{
+ struct i915_context *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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ int x1, y1, x2, y2;
+
+ if (!ctx->DrawBuffer)
+ return;
+
+ DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
+
+ if (ctx->DrawBuffer->Name == 0) {
+ x1 = x;
+ y1 = ctx->DrawBuffer->Height - (y + h);
+ x2 = x + w - 1;
+ y2 = y1 + h - 1;
+ DBG("%s %d..%d,%d..%d (inverted)\n", __FUNCTION__, x1, x2, y1, y2);
+ }
+ else {
+ /* FBO - not inverted
+ */
+ x1 = x;
+ y1 = y;
+ x2 = x + w - 1;
+ y2 = y + h - 1;
+ DBG("%s %d..%d,%d..%d (not inverted)\n", __FUNCTION__, x1, x2, y1, y2);
+ }
+
+ x1 = CLAMP(x1, 0, ctx->DrawBuffer->Width - 1);
+ y1 = CLAMP(y1, 0, ctx->DrawBuffer->Height - 1);
+ x2 = CLAMP(x2, 0, ctx->DrawBuffer->Width - 1);
+ y2 = CLAMP(y2, 0, ctx->DrawBuffer->Height - 1);
+
+ DBG("%s %d..%d,%d..%d (clamped)\n", __FUNCTION__, x1, x2, y1, y2);
+
+ 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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ int tmp = intel_translate_logic_op(opcode);
+
+ DBG("%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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ GLuint mode;
+
+ DBG("%s %d\n", __FUNCTION__,
+ ctx->DrawBuffer ? ctx->DrawBuffer->Name : 0);
+
+ if (!ctx->Polygon.CullFlag) {
+ mode = S4_CULLMODE_NONE;
+ }
+ else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
+ mode = S4_CULLMODE_CW;
+
+ if (ctx->DrawBuffer && ctx->DrawBuffer->Name != 0)
+ mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
+ 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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ int lis4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_LINE_WIDTH_MASK;
+ int width;
+
+ DBG("%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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ int lis4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_POINT_WIDTH_MASK;
+ GLint point_size = (int) size;
+
+ DBG("%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)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+ GLuint tmp = i915->state.Ctx[I915_CTXREG_LIS5] & ~S5_WRITEDISABLE_MASK;
+
+ DBG("%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)
+{
+ DBG("%s\n", __FUNCTION__);
+
+ if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) {
+ update_specular(ctx);
+ }
+}
+
+static void
+i915ShadeModel(GLcontext * ctx, GLenum mode)
+{
+ struct i915_context *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)
+{
+ struct i915_context *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)
+{
+ struct i915_context *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)
+{
+ struct i915_context *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) /* XXX FBO fix */
+ 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:
+ {
+ GLboolean hw_stencil = GL_FALSE;
+ if (ctx->DrawBuffer) {
+ struct intel_renderbuffer *irbStencil
+ = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL);
+ hw_stencil = (irbStencil && irbStencil->region);
+ }
+ if (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;
+
+ case GL_POLYGON_SMOOTH:
+ break;
+
+ case GL_POINT_SMOOTH:
+ break;
+
+ default:
+ ;
+ }
+}
+
+
+static void
+i915_init_packets(struct i915_context *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) /* XXX FBO fix */
+ 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);
+ /* color buffer offset/stride */
+ i915->state.Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ /* XXX FBO: remove this? Also get set in i915_set_draw_region() */
+ i915->state.Buffer[I915_DESTREG_CBUFADDR1] = (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(screen->front.pitch) | /* pitch in bytes */
+ BUF_3D_USE_FENCE);
+
+ i915->state.Buffer[I915_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ /* XXX FBO: remove this? Also get set in i915_set_draw_region() */
+ i915->state.Buffer[I915_DESTREG_DBUFADDR1] = (BUF_3D_ID_DEPTH | BUF_3D_PITCH(screen->depth.pitch) | /* pitch in bytes */
+ BUF_3D_USE_FENCE);
+
+ i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
+
+ /* XXX FBO: remove this? Also get set in i915_set_draw_region() */
+#if 0 /* seems we don't need this */
+ switch (screen->fbFormat) {
+ 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;
+ }
+#endif
+
+
+ /* scissor */
+ 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;
+ }
+
+
+#if 0
+ {
+ I915_STATECHANGE(i915, I915_UPLOAD_DEFAULTS);
+ i915->state.Default[I915_DEFREG_C0] = _3DSTATE_DEFAULT_DIFFUSE;
+ i915->state.Default[I915_DEFREG_C1] = 0;
+ i915->state.Default[I915_DEFREG_S0] = _3DSTATE_DEFAULT_SPECULAR;
+ i915->state.Default[I915_DEFREG_S1] = 0;
+ i915->state.Default[I915_DEFREG_Z0] = _3DSTATE_DEFAULT_Z;
+ i915->state.Default[I915_DEFREG_Z1] = 0;
+ }
+#endif
+
+
+ /* 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 | I915_UPLOAD_INVARIENT);
+}
+
+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->StencilFuncSeparate = i915StencilFuncSeparate;
+ functions->StencilMaskSeparate = i915StencilMaskSeparate;
+ functions->StencilOpSeparate = i915StencilOpSeparate;
+}
+
+
+void
+i915InitState(struct i915_context *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/src/mesa/drivers/dri/i915tex/i915_tex.c b/src/mesa/drivers/dri/i915tex/i915_tex.c
new file mode 100644
index 00000000000..a53abe9a92f
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_tex.c
@@ -0,0 +1,113 @@
+/**************************************************************************
+ *
+ * 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"
+
+
+
+static void
+i915TexEnv(GLcontext * ctx, GLenum target,
+ GLenum pname, const GLfloat * param)
+{
+ struct i915_context *i915 = I915_CONTEXT(ctx);
+
+ 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:{
+ GLuint unit = ctx->Texture.CurrentUnit;
+ GLint b = (int) ((*param) * 16.0);
+ if (b > 255)
+ b = 255;
+ if (b < -256)
+ b = -256;
+ I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit));
+ i915->lodbias_ss2[unit] =
+ ((b << SS2_LOD_BIAS_SHIFT) & SS2_LOD_BIAS_MASK);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+
+static void
+i915BindTexture(GLcontext * ctx, GLenum target,
+ struct gl_texture_object *texobj)
+{
+ /* 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;
+}
diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
new file mode 100644
index 00000000000..e9360ecea83
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
@@ -0,0 +1,380 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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.
+ *
+ **************************************************************************/
+
+/* Code to layout images in a mipmap tree for i915 and i945
+ * respectively.
+ */
+
+#include "intel_mipmap_tree.h"
+#include "macros.h"
+#include "intel_context.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+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}
+};
+
+static GLuint
+minify(GLuint d)
+{
+ return MAX2(1, d >> 1);
+}
+
+GLboolean
+i915_miptree_layout(struct intel_mipmap_tree * mt)
+{
+ GLint level;
+
+ switch (mt->target) {
+ case GL_TEXTURE_CUBE_MAP:{
+ const GLuint dim = mt->width0;
+ GLuint face;
+
+ /* double pitch for cube layouts */
+ mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp;
+ mt->total_height = dim * 4;
+
+ for (level = mt->first_level; level <= mt->last_level; level++)
+ intel_miptree_set_level_info(mt, level, 6,
+ 0, 0,
+ mt->pitch, mt->total_height, 1);
+
+ for (face = 0; face < 6; face++) {
+ GLuint x = initial_offsets[face][0] * dim;
+ GLuint y = initial_offsets[face][1] * dim;
+ GLuint d = dim;
+
+ for (level = mt->first_level; level <= mt->last_level; level++) {
+ intel_miptree_set_image_offset(mt, level, face, x, y);
+
+ if (d == 0)
+ _mesa_printf("cube mipmap %d/%d (%d..%d) is 0x0\n",
+ face, level, mt->first_level, mt->last_level);
+
+ d >>= 1;
+ x += step_offsets[face][0] * d;
+ y += step_offsets[face][1] * d;
+ }
+ }
+ break;
+ }
+ case GL_TEXTURE_3D:{
+ GLuint width = mt->width0;
+ GLuint height = mt->height0;
+ GLuint depth = mt->depth0;
+ GLuint stack_height = 0;
+
+ /* Calculate the size of a single slice.
+ */
+ mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
+
+ /* XXX: hardware expects/requires 9 levels at minimum.
+ */
+ for (level = mt->first_level; level <= MAX2(8, mt->last_level);
+ level++) {
+ intel_miptree_set_level_info(mt, level, 1, 0, mt->total_height,
+ width, height, depth);
+
+
+ stack_height += MAX2(2, height);
+
+ width = minify(width);
+ height = minify(height);
+ depth = minify(depth);
+ }
+
+ /* Fixup depth image_offsets:
+ */
+ depth = mt->depth0;
+ for (level = mt->first_level; level <= mt->last_level; level++) {
+ GLuint i;
+ for (i = 0; i < depth; i++)
+ intel_miptree_set_image_offset(mt, level, i,
+ 0, i * stack_height);
+
+ depth = minify(depth);
+ }
+
+
+ /* Multiply slice size by texture depth for total size. It's
+ * remarkable how wasteful of memory the i915 texture layouts
+ * are. They are largely fixed in the i945.
+ */
+ mt->total_height = stack_height * mt->depth0;
+ break;
+ }
+
+ default:{
+ GLuint width = mt->width0;
+ GLuint height = mt->height0;
+ GLuint img_height;
+
+ mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
+ mt->total_height = 0;
+
+ for (level = mt->first_level; level <= mt->last_level; level++) {
+ intel_miptree_set_level_info(mt, level, 1,
+ 0, mt->total_height,
+ width, height, 1);
+
+ if (mt->compressed)
+ img_height = MAX2(1, height / 4);
+ else
+ img_height = MAX2(2, height);
+
+ mt->total_height += img_height;
+ mt->total_height += 1;
+ mt->total_height &= ~1;
+
+ width = minify(width);
+ height = minify(height);
+ }
+ break;
+ }
+ }
+ DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
+ mt->pitch,
+ mt->total_height, mt->cpp, mt->pitch * mt->total_height * mt->cpp);
+
+ return GL_TRUE;
+}
+
+
+GLboolean
+i945_miptree_layout(struct intel_mipmap_tree * mt)
+{
+ GLint level;
+
+ switch (mt->target) {
+ case GL_TEXTURE_CUBE_MAP:{
+ const GLuint dim = mt->width0;
+ 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)
+ mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp;
+ else
+ mt->pitch = 14 * 8;
+
+ mt->total_height = dim * 4 + 4;
+
+ /* Set all the levels to effectively occupy the whole rectangular region.
+ */
+ for (level = mt->first_level; level <= mt->last_level; level++)
+ intel_miptree_set_level_info(mt, level, 6,
+ 0, 0,
+ mt->pitch, mt->total_height, 1);
+
+
+
+ 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 = mt->total_height - 4;
+ x = (face - 4) * 8;
+ }
+ else if (dim < 4) {
+ y = mt->total_height - 4;
+ x = face * 8;
+ }
+
+ for (level = mt->first_level; level <= mt->last_level; level++) {
+ intel_miptree_set_image_offset(mt, level, face, x, y);
+
+ 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 = mt->total_height - 4;
+ x = (face - 4) * 8;
+ break;
+ }
+
+ case 2:
+ y = mt->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;
+ }
+ }
+ }
+ break;
+ }
+ case GL_TEXTURE_3D:{
+ GLuint width = mt->width0;
+ GLuint height = mt->height0;
+ GLuint depth = mt->depth0;
+ GLuint pack_x_pitch, pack_x_nr;
+ GLuint pack_y_pitch;
+ GLuint level;
+
+ mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
+ mt->total_height = 0;
+
+ pack_y_pitch = MAX2(mt->height0, 2);
+ pack_x_pitch = mt->pitch;
+ pack_x_nr = 1;
+
+ for (level = mt->first_level; level <= mt->last_level; level++) {
+ GLuint nr_images = mt->target == GL_TEXTURE_3D ? depth : 6;
+ GLint x = 0;
+ GLint y = 0;
+ GLint q, j;
+
+ intel_miptree_set_level_info(mt, level, nr_images,
+ 0, mt->total_height,
+ width, height, depth);
+
+ for (q = 0; q < nr_images;) {
+ for (j = 0; j < pack_x_nr && q < nr_images; j++, q++) {
+ intel_miptree_set_image_offset(mt, level, q, x, y);
+ x += pack_x_pitch;
+ }
+
+ x = 0;
+ y += pack_y_pitch;
+ }
+
+
+ mt->total_height += y;
+
+ if (pack_x_pitch > 4) {
+ pack_x_pitch >>= 1;
+ pack_x_nr <<= 1;
+ assert(pack_x_pitch * pack_x_nr <= mt->pitch);
+ }
+
+ if (pack_y_pitch > 2) {
+ pack_y_pitch >>= 1;
+ }
+
+ width = minify(width);
+ height = minify(height);
+ depth = minify(depth);
+ }
+ break;
+ }
+
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_RECTANGLE_ARB:{
+ GLuint x = 0;
+ GLuint y = 0;
+ GLuint width = mt->width0;
+ GLuint height = mt->height0;
+ GLint align_h = 2;
+
+ mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
+ mt->total_height = 0;
+
+ for (level = mt->first_level; level <= mt->last_level; level++) {
+ GLuint img_height;
+
+ intel_miptree_set_level_info(mt, level, 1,
+ x, y,
+ width,
+ mt->compressed ? height/4 : height, 1);
+
+
+ if (mt->compressed)
+ img_height = MAX2(1, height / 4);
+ else
+ img_height = MAX2(align_h, height);
+
+ /* LPT change: step right after second mipmap.
+ */
+ if (level == mt->first_level + 1) {
+ x += mt->pitch / 2;
+ x = (x + 3) & ~3;
+ }
+ else {
+ y += img_height;
+ y += align_h - 1;
+ y &= ~(align_h - 1);
+ }
+
+ /* Because the images are packed better, the final offset
+ * might not be the maximal one:
+ */
+ mt->total_height = MAX2(mt->total_height, y);
+
+ width = minify(width);
+ height = minify(height);
+ }
+ break;
+ }
+ default:
+ _mesa_problem(NULL, "Unexpected tex target in i945_miptree_layout()");
+ }
+
+ DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
+ mt->pitch,
+ mt->total_height, mt->cpp, mt->pitch * mt->total_height * mt->cpp);
+
+ return GL_TRUE;
+}
diff --git a/src/mesa/drivers/dri/i915tex/i915_texstate.c b/src/mesa/drivers/dri/i915tex/i915_texstate.c
new file mode 100644
index 00000000000..e0ecdfde24a
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_texstate.c
@@ -0,0 +1,338 @@
+/**************************************************************************
+ *
+ * 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 "mtypes.h"
+#include "enums.h"
+#include "texformat.h"
+#include "dri_bufmgr.h"
+
+#include "intel_mipmap_tree.h"
+#include "intel_tex.h"
+
+#include "i915_context.h"
+#include "i915_reg.h"
+
+
+static GLuint
+translate_texture_format(GLuint mesa_format)
+{
+ switch (mesa_format) {
+ case MESA_FORMAT_L8:
+ return MAPSURF_8BIT | MT_8BIT_L8;
+ case MESA_FORMAT_I8:
+ return MAPSURF_8BIT | MT_8BIT_I8;
+ case MESA_FORMAT_A8:
+ return MAPSURF_8BIT | MT_8BIT_A8;
+ case MESA_FORMAT_AL88:
+ return MAPSURF_16BIT | MT_16BIT_AY88;
+ case MESA_FORMAT_RGB565:
+ return MAPSURF_16BIT | MT_16BIT_RGB565;
+ case MESA_FORMAT_ARGB1555:
+ return MAPSURF_16BIT | MT_16BIT_ARGB1555;
+ case MESA_FORMAT_ARGB4444:
+ return MAPSURF_16BIT | MT_16BIT_ARGB4444;
+ case MESA_FORMAT_ARGB8888:
+ return MAPSURF_32BIT | MT_32BIT_ARGB8888;
+ case MESA_FORMAT_YCBCR_REV:
+ return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
+ case MESA_FORMAT_YCBCR:
+ return (MAPSURF_422 | MT_422_YCRCB_SWAPY);
+ case MESA_FORMAT_RGB_FXT1:
+ case MESA_FORMAT_RGBA_FXT1:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1);
+ case MESA_FORMAT_Z16:
+ return (MAPSURF_16BIT | MT_16BIT_L16);
+ case MESA_FORMAT_RGBA_DXT1:
+ case MESA_FORMAT_RGB_DXT1:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1);
+ case MESA_FORMAT_RGBA_DXT3:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3);
+ case MESA_FORMAT_RGBA_DXT5:
+ return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
+ case MESA_FORMAT_Z24_S8:
+ return (MAPSURF_32BIT | MT_32BIT_xL824);
+ default:
+ fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format);
+ abort();
+ return 0;
+ }
+}
+
+
+
+
+/* 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;
+ }
+}
+
+
+
+/* Recalculate all state from scratch. Perhaps not the most
+ * efficient, but this has gotten complex enough that we need
+ * something which is understandable and reliable.
+ */
+static GLboolean
+i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
+{
+ GLcontext *ctx = &intel->ctx;
+ struct i915_context *i915 = i915_context(ctx);
+ struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
+ struct intel_texture_object *intelObj = intel_texture_object(tObj);
+ struct gl_texture_image *firstImage;
+ GLuint *state = i915->state.Tex[unit];
+
+ memset(state, 0, sizeof(state));
+
+ /*We need to refcount these. */
+
+ if (i915->state.tex_buffer[unit] != NULL) {
+ driBOUnReference(i915->state.tex_buffer[unit]);
+ i915->state.tex_buffer[unit] = NULL;
+ }
+
+ if (!intel_finalize_mipmap_tree(intel, unit))
+ return GL_FALSE;
+
+ /* Get first image here, since intelObj->firstLevel will get set in
+ * the intel_finalize_mipmap_tree() call above.
+ */
+ firstImage = tObj->Image[0][intelObj->firstLevel];
+
+ i915->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer);
+ i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
+ intelObj->
+ firstLevel);
+
+ state[I915_TEXREG_MS3] =
+ (((firstImage->Height - 1) << MS3_HEIGHT_SHIFT) |
+ ((firstImage->Width - 1) << MS3_WIDTH_SHIFT) |
+ translate_texture_format(firstImage->TexFormat->MesaFormat) |
+ MS3_USE_FENCE_REGS);
+
+ state[I915_TEXREG_MS4] =
+ (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) -
+ 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK |
+ ((((intelObj->lastLevel -
+ intelObj->firstLevel) *
+ 4)) << MS4_MAX_LOD_SHIFT) | ((firstImage->Depth -
+ 1) << MS4_VOLUME_DEPTH_SHIFT));
+
+
+ {
+ GLuint minFilt, mipFilt, magFilt;
+
+ switch (tObj->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:
+ return GL_FALSE;
+ }
+
+ if (tObj->MaxAnisotropy > 1.0) {
+ minFilt = FILTER_ANISOTROPIC;
+ magFilt = FILTER_ANISOTROPIC;
+ }
+ else {
+ switch (tObj->MagFilter) {
+ case GL_NEAREST:
+ magFilt = FILTER_NEAREST;
+ break;
+ case GL_LINEAR:
+ magFilt = FILTER_LINEAR;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ }
+
+ state[I915_TEXREG_SS2] = i915->lodbias_ss2[unit];
+
+ /* YUV conversion:
+ */
+ if (firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR ||
+ firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV)
+ state[I915_TEXREG_SS2] |= SS2_COLORSPACE_CONVERSION;
+
+ /* Shadow:
+ */
+ if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB &&
+ tObj->Target != GL_TEXTURE_3D) {
+
+ state[I915_TEXREG_SS2] |=
+ (SS2_SHADOW_ENABLE |
+ intel_translate_compare_func(tObj->CompareFunc));
+
+ minFilt = FILTER_4X4_FLAT;
+ magFilt = FILTER_4X4_FLAT;
+ }
+
+ state[I915_TEXREG_SS2] |= ((minFilt << SS2_MIN_FILTER_SHIFT) |
+ (mipFilt << SS2_MIP_FILTER_SHIFT) |
+ (magFilt << SS2_MAG_FILTER_SHIFT));
+ }
+
+ {
+ GLenum ws = tObj->WrapS;
+ GLenum wt = tObj->WrapT;
+ GLenum wr = tObj->WrapR;
+
+
+ /* 3D textures don't seem to respect the border color.
+ * Fallback if there's ever a danger that they might refer to
+ * it.
+ *
+ * Effectively this means fallback on 3D clamp or
+ * clamp_to_border.
+ */
+ if (tObj->Target == GL_TEXTURE_3D &&
+ (tObj->MinFilter != GL_NEAREST ||
+ tObj->MagFilter != GL_NEAREST) &&
+ (ws == GL_CLAMP ||
+ wt == GL_CLAMP ||
+ wr == GL_CLAMP ||
+ ws == GL_CLAMP_TO_BORDER ||
+ wt == GL_CLAMP_TO_BORDER || wr == GL_CLAMP_TO_BORDER))
+ return GL_FALSE;
+
+
+ state[I915_TEXREG_SS3] = ss3; /* SS3_NORMALIZED_COORDS */
+
+ state[I915_TEXREG_SS3] |=
+ ((translate_wrap_mode(ws) << SS3_TCX_ADDR_MODE_SHIFT) |
+ (translate_wrap_mode(wt) << SS3_TCY_ADDR_MODE_SHIFT) |
+ (translate_wrap_mode(wr) << SS3_TCZ_ADDR_MODE_SHIFT));
+
+ state[I915_TEXREG_SS3] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT);
+ }
+
+
+ state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
+ tObj->_BorderChan[1],
+ tObj->_BorderChan[2],
+ tObj->_BorderChan[3]);
+
+
+ I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_TRUE);
+ /* memcmp was already disabled, but definitely won't work as the
+ * region might now change and that wouldn't be detected:
+ */
+ I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit));
+
+
+#if 0
+ DBG(TEXTURE, "state[I915_TEXREG_SS2] = 0x%x\n", state[I915_TEXREG_SS2]);
+ DBG(TEXTURE, "state[I915_TEXREG_SS3] = 0x%x\n", state[I915_TEXREG_SS3]);
+ DBG(TEXTURE, "state[I915_TEXREG_SS4] = 0x%x\n", state[I915_TEXREG_SS4]);
+ DBG(TEXTURE, "state[I915_TEXREG_MS2] = 0x%x\n", state[I915_TEXREG_MS2]);
+ DBG(TEXTURE, "state[I915_TEXREG_MS3] = 0x%x\n", state[I915_TEXREG_MS3]);
+ DBG(TEXTURE, "state[I915_TEXREG_MS4] = 0x%x\n", state[I915_TEXREG_MS4]);
+#endif
+
+ return GL_TRUE;
+}
+
+
+
+
+void
+i915UpdateTextureState(struct intel_context *intel)
+{
+ GLboolean ok = GL_TRUE;
+ GLuint i;
+
+ for (i = 0; i < I915_TEX_UNITS && ok; i++) {
+ switch (intel->ctx.Texture.Unit[i]._ReallyEnabled) {
+ case TEXTURE_1D_BIT:
+ case TEXTURE_2D_BIT:
+ case TEXTURE_CUBE_BIT:
+ case TEXTURE_3D_BIT:
+ ok = i915_update_tex_unit(intel, i, SS3_NORMALIZED_COORDS);
+ break;
+ case TEXTURE_RECT_BIT:
+ ok = i915_update_tex_unit(intel, i, 0);
+ break;
+ case 0:{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ if (i915->state.active & I915_UPLOAD_TEX(i))
+ I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), GL_FALSE);
+
+ if (i915->state.tex_buffer[i] != NULL) {
+ driBOUnReference(i915->state.tex_buffer[i]);
+ i915->state.tex_buffer[i] = NULL;
+ }
+
+ break;
+ }
+ default:
+ ok = GL_FALSE;
+ break;
+ }
+ }
+
+ FALLBACK(intel, I915_FALLBACK_TEXTURE, !ok);
+}
diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
new file mode 100644
index 00000000000..52db9a95e6b
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
@@ -0,0 +1,550 @@
+/**************************************************************************
+ *
+ * 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 "intel_tex.h"
+#include "intel_regions.h"
+
+#include "i915_reg.h"
+#include "i915_context.h"
+
+static void
+i915_render_start(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ i915ValidateFragmentProgram(i915);
+}
+
+
+static void
+i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ 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]) {
+ INTEL_FIREVERTICES(intel);
+
+ 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(struct intel_context *intel, GLuint expected)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ 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(struct intel_context *intel)
+{
+ BATCH_LOCALS;
+
+ BEGIN_BATCH(200, 0);
+
+ 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 ) \
+ intel_batchbuffer_data(intel->batch, state, size, 0 )
+
+static GLuint
+get_dirty(struct i915_hw_state *state)
+{
+ GLuint dirty;
+
+ /* 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;
+ return dirty;
+}
+
+
+static GLuint
+get_state_size(struct i915_hw_state *state)
+{
+ GLuint dirty = get_dirty(state);
+ GLuint i;
+ GLuint sz = 0;
+
+ if (dirty & I915_UPLOAD_CTX)
+ sz += sizeof(state->Ctx);
+
+ if (dirty & I915_UPLOAD_BUFFERS)
+ sz += sizeof(state->Buffer);
+
+ if (dirty & I915_UPLOAD_STIPPLE)
+ sz += sizeof(state->Stipple);
+
+ if (dirty & I915_UPLOAD_FOG)
+ sz += sizeof(state->Fog);
+
+ if (dirty & I915_UPLOAD_TEX_ALL) {
+ int nr = 0;
+ for (i = 0; i < I915_TEX_UNITS; i++)
+ if (dirty & I915_UPLOAD_TEX(i))
+ nr++;
+
+ sz += (2 + nr * 3) * sizeof(GLuint) * 2;
+ }
+
+ if (dirty & I915_UPLOAD_CONSTANTS)
+ sz += state->ConstantSize * sizeof(GLuint);
+
+ if (dirty & I915_UPLOAD_PROGRAM)
+ sz += state->ProgramSize * sizeof(GLuint);
+
+ return sz;
+}
+
+
+/* Push the state into the sarea and/or texture memory.
+ */
+static void
+i915_emit_state(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ struct i915_hw_state *state = i915->current;
+ int i;
+ GLuint dirty;
+ BATCH_LOCALS;
+
+ /* We don't hold the lock at this point, so want to make sure that
+ * there won't be a buffer wrap.
+ *
+ * It might be better to talk about explicit places where
+ * scheduling is allowed, rather than assume that it is whenever a
+ * batchbuffer fills up.
+ */
+ intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
+
+ /* Do this here as we may have flushed the batchbuffer above,
+ * causing more state to be dirty!
+ */
+ dirty = get_dirty(state);
+
+ if (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "%s dirty: %x\n", __FUNCTION__, dirty);
+
+ if (dirty & I915_UPLOAD_INVARIENT) {
+ if (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "I915_UPLOAD_INVARIENT:\n");
+ i915_emit_invarient_state(intel);
+ }
+
+ if (dirty & I915_UPLOAD_CTX) {
+ if (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "I915_UPLOAD_CTX:\n");
+
+ emit(intel, state->Ctx, sizeof(state->Ctx));
+ }
+
+ if (dirty & I915_UPLOAD_BUFFERS) {
+ if (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "I915_UPLOAD_BUFFERS:\n");
+ BEGIN_BATCH(I915_DEST_SETUP_SIZE + 2, 0);
+ OUT_BATCH(state->Buffer[I915_DESTREG_CBUFADDR0]);
+ OUT_BATCH(state->Buffer[I915_DESTREG_CBUFADDR1]);
+ OUT_RELOC(state->draw_region->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ state->draw_region->draw_offset);
+
+ if (state->depth_region) {
+ OUT_BATCH(state->Buffer[I915_DESTREG_DBUFADDR0]);
+ OUT_BATCH(state->Buffer[I915_DESTREG_DBUFADDR1]);
+ OUT_RELOC(state->depth_region->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ state->depth_region->draw_offset);
+ }
+
+ OUT_BATCH(state->Buffer[I915_DESTREG_DV0]);
+ OUT_BATCH(state->Buffer[I915_DESTREG_DV1]);
+ OUT_BATCH(state->Buffer[I915_DESTREG_SENABLE]);
+ OUT_BATCH(state->Buffer[I915_DESTREG_SR0]);
+ OUT_BATCH(state->Buffer[I915_DESTREG_SR1]);
+ OUT_BATCH(state->Buffer[I915_DESTREG_SR2]);
+ ADVANCE_BATCH();
+ }
+
+ if (dirty & I915_UPLOAD_STIPPLE) {
+ if (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "I915_UPLOAD_STIPPLE:\n");
+ emit(intel, state->Stipple, sizeof(state->Stipple));
+ }
+
+ if (dirty & I915_UPLOAD_FOG) {
+ if (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "I915_UPLOAD_FOG:\n");
+ emit(intel, 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, 0);
+ 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)) {
+
+ if (state->tex_buffer[i]) {
+ OUT_RELOC(state->tex_buffer[i],
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
+ state->tex_offset[i]);
+ }
+ else {
+ assert(i == 0);
+ assert(state == &i915->meta);
+ OUT_BATCH(0);
+ }
+
+ OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]);
+ OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]);
+ }
+ ADVANCE_BATCH();
+
+ BEGIN_BATCH(2 + nr * 3, 0);
+ 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 (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "I915_UPLOAD_CONSTANTS:\n");
+ emit(intel, state->Constant, state->ConstantSize * sizeof(GLuint));
+ }
+
+ if (dirty & I915_UPLOAD_PROGRAM) {
+ if (INTEL_DEBUG & DEBUG_STATE)
+ fprintf(stderr, "I915_UPLOAD_PROGRAM:\n");
+
+ assert((state->Program[0] & 0x1ff) + 2 == state->ProgramSize);
+
+ emit(intel, state->Program, state->ProgramSize * sizeof(GLuint));
+ if (INTEL_DEBUG & DEBUG_STATE)
+ i915_disassemble_program(state->Program, state->ProgramSize);
+ }
+
+ state->emitted |= dirty;
+}
+
+static void
+i915_destroy_context(struct intel_context *intel)
+{
+ _tnl_free_vertices(&intel->ctx);
+}
+
+
+/**
+ * Set the drawing regions for the color and depth/stencil buffers.
+ * This involves setting the pitch, cpp and buffer ID/location.
+ * Also set pixel format for color and Z rendering
+ * Used for setting both regular and meta state.
+ */
+void
+i915_state_draw_region(struct intel_context *intel,
+ struct i915_hw_state *state,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ GLuint value;
+
+ ASSERT(state == &i915->state || state == &i915->meta);
+
+ if (state->draw_region != color_region) {
+ intel_region_release(&state->draw_region);
+ intel_region_reference(&state->draw_region, color_region);
+ }
+ if (state->depth_region != depth_region) {
+ intel_region_release(&state->depth_region);
+ intel_region_reference(&state->depth_region, depth_region);
+ }
+
+ /*
+ * Set stride/cpp values
+ */
+ if (color_region) {
+ state->Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ state->Buffer[I915_DESTREG_CBUFADDR1] =
+ (BUF_3D_ID_COLOR_BACK |
+ BUF_3D_PITCH(color_region->pitch * color_region->cpp) |
+ BUF_3D_USE_FENCE);
+ }
+
+ if (depth_region) {
+ state->Buffer[I915_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ state->Buffer[I915_DESTREG_DBUFADDR1] =
+ (BUF_3D_ID_DEPTH |
+ BUF_3D_PITCH(depth_region->pitch * depth_region->cpp) |
+ BUF_3D_USE_FENCE);
+ }
+
+ /*
+ * Compute/set I915_DESTREG_DV1 value
+ */
+ value = (DSTORG_HORT_BIAS(0x8) | /* .5 */
+ DSTORG_VERT_BIAS(0x8) | /* .5 */
+ LOD_PRECLAMP_OGL | TEX_DEFAULT_COLOR_OGL);
+ if (color_region && color_region->cpp == 4) {
+ value |= DV_PF_8888;
+ }
+ else {
+ value |= (DITHER_FULL_ALWAYS | DV_PF_565);
+ }
+ if (depth_region && depth_region->cpp == 4) {
+ value |= DEPTH_FRMT_24_FIXED_8_OTHER;
+ }
+ else {
+ value |= DEPTH_FRMT_16_FIXED;
+ }
+ state->Buffer[I915_DESTREG_DV1] = value;
+
+ I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
+}
+
+
+static void
+i915_set_draw_region(struct intel_context *intel,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ i915_state_draw_region(intel, &i915->state, color_region, depth_region);
+}
+
+
+
+static void
+i915_lost_hardware(struct intel_context *intel)
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ i915->state.emitted = 0;
+}
+
+static GLuint
+i915_flush_cmd(void)
+{
+ return MI_FLUSH | FLUSH_MAP_CACHE;
+}
+
+static void
+i915_assert_not_dirty( struct intel_context *intel )
+{
+ struct i915_context *i915 = i915_context(&intel->ctx);
+ struct i915_hw_state *state = i915->current;
+ GLuint dirty = get_dirty(state);
+ assert(!dirty);
+}
+
+
+void
+i915InitVtbl(struct i915_context *i915)
+{
+ i915->intel.vtbl.check_vertex_size = i915_check_vertex_size;
+ i915->intel.vtbl.destroy = i915_destroy_context;
+ 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_region = i915_set_draw_region;
+ i915->intel.vtbl.update_texture_state = i915UpdateTextureState;
+ i915->intel.vtbl.flush_cmd = i915_flush_cmd;
+ i915->intel.vtbl.assert_not_dirty = i915_assert_not_dirty;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
new file mode 100644
index 00000000000..b4e0b74f161
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
@@ -0,0 +1,342 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 "intel_batchbuffer.h"
+#include "intel_ioctl.h"
+
+/* Relocations in kernel space:
+ * - pass dma buffer seperately
+ * - memory manager knows how to patch
+ * - pass list of dependent buffers
+ * - pass relocation list
+ *
+ * Either:
+ * - get back an offset for buffer to fire
+ * - memory manager knows how to fire buffer
+ *
+ * Really want the buffer to be AGP and pinned.
+ *
+ */
+
+/* Cliprect fence: The highest fence protecting a dma buffer
+ * containing explicit cliprect information. Like the old drawable
+ * lock but irq-driven. X server must wait for this fence to expire
+ * before changing cliprects [and then doing sw rendering?]. For
+ * other dma buffers, the scheduler will grab current cliprect info
+ * and mix into buffer. X server must hold the lock while changing
+ * cliprects??? Make per-drawable. Need cliprects in shared memory
+ * -- beats storing them with every cmd buffer in the queue.
+ *
+ * ==> X server must wait for this fence to expire before touching the
+ * framebuffer with new cliprects.
+ *
+ * ==> Cliprect-dependent buffers associated with a
+ * cliprect-timestamp. All of the buffers associated with a timestamp
+ * must go to hardware before any buffer with a newer timestamp.
+ *
+ * ==> Dma should be queued per-drawable for correct X/GL
+ * synchronization. Or can fences be used for this?
+ *
+ * Applies to: Blit operations, metaops, X server operations -- X
+ * server automatically waits on its own dma to complete before
+ * modifying cliprects ???
+ */
+
+static void
+intel_dump_batchbuffer(GLuint offset, GLuint * ptr, GLuint count)
+{
+ int i;
+ fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count / 4);
+ for (i = 0; i < count / 4; i += 4)
+ fprintf(stderr, "0x%x:\t0x%08x 0x%08x 0x%08x 0x%08x\n",
+ offset + i * 4, ptr[i], ptr[i + 1], ptr[i + 2], ptr[i + 3]);
+ fprintf(stderr, "END BATCH\n\n\n");
+}
+
+void
+intel_batchbuffer_reset(struct intel_batchbuffer *batch)
+{
+
+ int i;
+
+ /*
+ * Get a new, free batchbuffer.
+ */
+
+ batch->size = batch->intel->intelScreen->maxBatchSize;
+ driBOData(batch->buffer, batch->size, NULL, 0);
+
+ driBOResetList(&batch->list);
+
+ /*
+ * Unreference buffers previously on the relocation list.
+ */
+
+ for (i = 0; i < batch->nr_relocs; i++) {
+ struct buffer_reloc *r = &batch->reloc[i];
+ driBOUnReference(r->buf);
+ }
+
+ batch->list_count = 0;
+ batch->nr_relocs = 0;
+ batch->flags = 0;
+
+ /*
+ * We don't refcount the batchbuffer itself since we can't destroy it
+ * while it's on the list.
+ */
+
+
+ driBOAddListItem(&batch->list, batch->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_EXE);
+
+
+ batch->map = driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, 0);
+ batch->ptr = batch->map;
+}
+
+/*======================================================================
+ * Public functions
+ */
+struct intel_batchbuffer *
+intel_batchbuffer_alloc(struct intel_context *intel)
+{
+ struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1);
+
+ batch->intel = intel;
+
+ driGenBuffers(intel->intelScreen->batchPool, "batchbuffer", 1,
+ &batch->buffer, 4096,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE, 0);
+ batch->last_fence = NULL;
+ driBOCreateList(20, &batch->list);
+ intel_batchbuffer_reset(batch);
+ return batch;
+}
+
+void
+intel_batchbuffer_free(struct intel_batchbuffer *batch)
+{
+ if (batch->last_fence) {
+ driFenceFinish(batch->last_fence,
+ DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE);
+ driFenceUnReference(batch->last_fence);
+ batch->last_fence = NULL;
+ }
+ if (batch->map) {
+ driBOUnmap(batch->buffer);
+ batch->map = NULL;
+ }
+ driBOUnReference(batch->buffer);
+ batch->buffer = NULL;
+ free(batch);
+}
+
+/* TODO: Push this whole function into bufmgr.
+ */
+static void
+do_flush_locked(struct intel_batchbuffer *batch,
+ GLuint used,
+ GLboolean ignore_cliprects, GLboolean allow_unlock)
+{
+ GLuint *ptr;
+ GLuint i;
+ struct intel_context *intel = batch->intel;
+ unsigned fenceFlags;
+ struct _DriFenceObject *fo;
+
+ driBOValidateList(batch->intel->driFd, &batch->list);
+
+ /* Apply the relocations. This nasty map indicates to me that the
+ * whole task should be done internally by the memory manager, and
+ * that dma buffers probably need to be pinned within agp space.
+ */
+ ptr = (GLuint *) driBOMap(batch->buffer, DRM_BO_FLAG_WRITE,
+ DRM_BO_HINT_ALLOW_UNFENCED_MAP);
+
+
+ for (i = 0; i < batch->nr_relocs; i++) {
+ struct buffer_reloc *r = &batch->reloc[i];
+
+ ptr[r->offset / 4] = driBOOffset(r->buf) + r->delta;
+ }
+
+ if (INTEL_DEBUG & DEBUG_BATCH)
+ intel_dump_batchbuffer(0, ptr, used);
+
+ driBOUnmap(batch->buffer);
+ batch->map = NULL;
+
+ /* 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)) {
+ intel_batch_ioctl(batch->intel,
+ driBOOffset(batch->buffer),
+ used, ignore_cliprects, allow_unlock);
+ }
+
+
+ /*
+ * Kernel fencing. The flags tells the kernel that we've
+ * programmed an MI_FLUSH.
+ */
+
+ fenceFlags = DRM_I915_FENCE_FLAG_FLUSHED;
+ fo = driFenceBuffers(batch->intel->driFd,
+ "Batch fence", fenceFlags);
+
+ /*
+ * User space fencing.
+ */
+
+ driBOFence(batch->buffer, fo);
+
+ if (driFenceType(fo) == DRM_FENCE_TYPE_EXE) {
+
+ /*
+ * Oops. We only validated a batch buffer. This means we
+ * didn't do any proper rendering. Discard this fence object.
+ */
+
+ driFenceUnReference(fo);
+ } else {
+ driFenceUnReference(batch->last_fence);
+ batch->last_fence = fo;
+ for (i = 0; i < batch->nr_relocs; i++) {
+ struct buffer_reloc *r = &batch->reloc[i];
+ driBOFence(r->buf, fo);
+ }
+ }
+
+ if (intel->numClipRects == 0 && !ignore_cliprects) {
+ if (allow_unlock) {
+ UNLOCK_HARDWARE(intel);
+ sched_yield();
+ LOCK_HARDWARE(intel);
+ }
+ intel->vtbl.lost_hardware(intel);
+ }
+}
+
+
+struct _DriFenceObject *
+intel_batchbuffer_flush(struct intel_batchbuffer *batch)
+{
+ struct intel_context *intel = batch->intel;
+ GLuint used = batch->ptr - batch->map;
+
+ if (used == 0)
+ return batch->last_fence;
+
+ /* Add the MI_BATCH_BUFFER_END. Always add an MI_FLUSH - this is a
+ * performance drain that we would like to avoid.
+ */
+ if (used & 4) {
+ ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd();
+ ((int *) batch->ptr)[1] = 0;
+ ((int *) batch->ptr)[2] = MI_BATCH_BUFFER_END;
+ used += 12;
+ }
+ else {
+ ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd();
+ ((int *) batch->ptr)[1] = MI_BATCH_BUFFER_END;
+ used += 8;
+ }
+
+ driBOUnmap(batch->buffer);
+ batch->ptr = NULL;
+ batch->map = NULL;
+
+ /* TODO: Just pass the relocation list and dma buffer up to the
+ * kernel.
+ */
+ if (!intel->locked) {
+ assert(!(batch->flags & INTEL_BATCH_NO_CLIPRECTS));
+
+ LOCK_HARDWARE(intel);
+ do_flush_locked(batch, used, GL_FALSE, GL_TRUE);
+ UNLOCK_HARDWARE(intel);
+ }
+ else {
+ GLboolean ignore_cliprects = !(batch->flags & INTEL_BATCH_CLIPRECTS);
+ do_flush_locked(batch, used, ignore_cliprects, GL_FALSE);
+ }
+
+ /* Reset the buffer:
+ */
+ intel_batchbuffer_reset(batch);
+ return batch->last_fence;
+}
+
+void
+intel_batchbuffer_finish(struct intel_batchbuffer *batch)
+{
+ struct _DriFenceObject *fence = intel_batchbuffer_flush(batch);
+ driFenceReference(fence);
+ driFenceFinish(fence, 3, GL_FALSE);
+ driFenceUnReference(fence);
+}
+
+
+/* This is the only way buffers get added to the validate list.
+ */
+GLboolean
+intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
+ struct _DriBufferObject *buffer,
+ GLuint flags, GLuint mask, GLuint delta)
+{
+ assert(batch->nr_relocs <= MAX_RELOCS);
+
+ driBOAddListItem(&batch->list, buffer, flags, mask);
+
+ {
+ struct buffer_reloc *r = &batch->reloc[batch->nr_relocs++];
+ driBOReference(buffer);
+ r->buf = buffer;
+ r->offset = batch->ptr - batch->map;
+ r->delta = delta;
+ }
+
+ batch->ptr += 4;
+ return GL_TRUE;
+}
+
+
+
+void
+intel_batchbuffer_data(struct intel_batchbuffer *batch,
+ const void *data, GLuint bytes, GLuint flags)
+{
+ assert((bytes & 3) == 0);
+ intel_batchbuffer_require_space(batch, bytes, flags);
+ __memcpy(batch->ptr, data, bytes);
+ batch->ptr += bytes;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h
new file mode 100644
index 00000000000..a83dbf423df
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h
@@ -0,0 +1,124 @@
+#ifndef INTEL_BATCHBUFFER_H
+#define INTEL_BATCHBUFFER_H
+
+#include "mtypes.h"
+#include "dri_bufmgr.h"
+
+struct intel_context;
+
+#define BATCH_SZ 16384
+#define BATCH_RESERVED 16
+
+#define MAX_RELOCS 100
+
+#define INTEL_BATCH_NO_CLIPRECTS 0x1
+#define INTEL_BATCH_CLIPRECTS 0x2
+
+struct buffer_reloc
+{
+ struct _DriBufferObject *buf;
+ GLuint offset;
+ GLuint delta; /* not needed? */
+};
+
+struct intel_batchbuffer
+{
+ struct bufmgr *bm;
+ struct intel_context *intel;
+
+ struct _DriBufferObject *buffer;
+ struct _DriFenceObject *last_fence;
+ GLuint flags;
+
+ drmBOList list;
+ GLuint list_count;
+ GLubyte *map;
+ GLubyte *ptr;
+
+ struct buffer_reloc reloc[MAX_RELOCS];
+ GLuint nr_relocs;
+ GLuint size;
+};
+
+struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context
+ *intel);
+
+void intel_batchbuffer_free(struct intel_batchbuffer *batch);
+
+
+void intel_batchbuffer_finish(struct intel_batchbuffer *batch);
+
+struct _DriFenceObject *intel_batchbuffer_flush(struct intel_batchbuffer
+ *batch);
+
+void intel_batchbuffer_reset(struct intel_batchbuffer *batch);
+
+
+/* Unlike bmBufferData, this currently requires the buffer be mapped.
+ * Consider it a convenience function wrapping multple
+ * intel_buffer_dword() calls.
+ */
+void intel_batchbuffer_data(struct intel_batchbuffer *batch,
+ const void *data, GLuint bytes, GLuint flags);
+
+void intel_batchbuffer_release_space(struct intel_batchbuffer *batch,
+ GLuint bytes);
+
+GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
+ struct _DriBufferObject *buffer,
+ GLuint flags,
+ GLuint mask, GLuint offset);
+
+/* Inline functions - might actually be better off with these
+ * non-inlined. Certainly better off switching all command packets to
+ * be passed as structs rather than dwords, but that's a little bit of
+ * work...
+ */
+static INLINE GLuint
+intel_batchbuffer_space(struct intel_batchbuffer *batch)
+{
+ return (batch->size - BATCH_RESERVED) - (batch->ptr - batch->map);
+}
+
+
+static INLINE void
+intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword)
+{
+ assert(batch->map);
+ assert(intel_batchbuffer_space(batch) >= 4);
+ *(GLuint *) (batch->ptr) = dword;
+ batch->ptr += 4;
+}
+
+static INLINE void
+intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
+ GLuint sz, GLuint flags)
+{
+ assert(sz < batch->size - 8);
+ if (intel_batchbuffer_space(batch) < sz ||
+ (batch->flags != 0 && flags != 0 && batch->flags != flags))
+ intel_batchbuffer_flush(batch);
+
+ batch->flags |= flags;
+}
+
+/* Here are the crusty old macros, to be removed:
+ */
+#define BATCH_LOCALS
+
+#define BEGIN_BATCH(n, flags) do { \
+ assert(!intel->prim.flush); \
+ intel_batchbuffer_require_space(intel->batch, (n)*4, flags); \
+} while (0)
+
+#define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d)
+
+#define OUT_RELOC(buf,flags,mask,delta) do { \
+ assert((delta) >= 0); \
+ intel_batchbuffer_emit_reloc(intel->batch, buf, flags, mask, delta); \
+} while (0)
+
+#define ADVANCE_BATCH() do { } while(0)
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_batchpool.c b/src/mesa/drivers/dri/i915tex/intel_batchpool.c
new file mode 100644
index 00000000000..3c17c50204b
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_batchpool.c
@@ -0,0 +1,418 @@
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include <errno.h>
+#include "imports.h"
+#include "glthread.h"
+#include "dri_bufpool.h"
+#include "dri_bufmgr.h"
+#include "intel_screen.h"
+
+typedef struct
+{
+ drmMMListHead head;
+ struct _BPool *parent;
+ struct _DriFenceObject *fence;
+ unsigned long start;
+ int unfenced;
+ int mapped;
+} BBuf;
+
+typedef struct _BPool
+{
+ _glthread_Mutex mutex;
+ unsigned long bufSize;
+ unsigned poolSize;
+ unsigned numFree;
+ unsigned numTot;
+ unsigned numDelayed;
+ unsigned checkDelayed;
+ drmMMListHead free;
+ drmMMListHead delayed;
+ drmMMListHead head;
+ drmBO kernelBO;
+ void *virtual;
+ BBuf *bufs;
+} BPool;
+
+
+static BPool *
+createBPool(int fd, unsigned long bufSize, unsigned numBufs, unsigned flags,
+ unsigned checkDelayed)
+{
+ BPool *p = (BPool *) malloc(sizeof(*p));
+ BBuf *buf;
+ int i;
+
+ if (!p)
+ return NULL;
+
+ p->bufs = (BBuf *) malloc(numBufs * sizeof(*p->bufs));
+ if (!p->bufs) {
+ free(p);
+ return NULL;
+ }
+
+ DRMINITLISTHEAD(&p->free);
+ DRMINITLISTHEAD(&p->head);
+ DRMINITLISTHEAD(&p->delayed);
+
+ p->numTot = numBufs;
+ p->numFree = numBufs;
+ p->bufSize = bufSize;
+ p->numDelayed = 0;
+ p->checkDelayed = checkDelayed;
+
+ _glthread_INIT_MUTEX(p->mutex);
+
+ if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc,
+ flags, 0, &p->kernelBO)) {
+ free(p->bufs);
+ free(p);
+ return NULL;
+ }
+ if (drmBOMap(fd, &p->kernelBO, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0,
+ &p->virtual)) {
+ drmBODestroy(fd, &p->kernelBO);
+ free(p->bufs);
+ free(p);
+ return NULL;
+ }
+
+ /*
+ * We unmap the buffer so that we can validate it later. Note that this is
+ * just a synchronizing operation. The buffer will have a virtual mapping
+ * until it is destroyed.
+ */
+
+ drmBOUnmap(fd, &p->kernelBO);
+
+ buf = p->bufs;
+ for (i = 0; i < numBufs; ++i) {
+ buf->parent = p;
+ buf->fence = NULL;
+ buf->start = i * bufSize;
+ buf->mapped = 0;
+ buf->unfenced = 0;
+ DRMLISTADDTAIL(&buf->head, &p->free);
+ buf++;
+ }
+
+ return p;
+}
+
+
+static void
+pool_checkFree(BPool * p, int wait)
+{
+ drmMMListHead *list, *prev;
+ BBuf *buf;
+ int signaled = 0;
+ int i;
+
+ list = p->delayed.next;
+
+ if (p->numDelayed > 3) {
+ for (i = 0; i < p->numDelayed; i += 3) {
+ list = list->next;
+ }
+ }
+
+ prev = list->prev;
+ for (; list != &p->delayed; list = prev, prev = list->prev) {
+
+ buf = DRMLISTENTRY(BBuf, list, head);
+
+ if (!signaled) {
+ if (wait) {
+ driFenceFinish(buf->fence, DRM_FENCE_TYPE_EXE, 1);
+ signaled = 1;
+ }
+ else {
+ signaled = driFenceSignaled(buf->fence, DRM_FENCE_TYPE_EXE);
+ }
+ }
+
+ if (!signaled)
+ break;
+
+ driFenceUnReference(buf->fence);
+ buf->fence = NULL;
+ DRMLISTDEL(list);
+ p->numDelayed--;
+ DRMLISTADD(list, &p->free);
+ p->numFree++;
+ }
+}
+
+static void *
+pool_create(struct _DriBufferPool *pool,
+ unsigned long size, unsigned flags, unsigned hint,
+ unsigned alignment)
+{
+ BPool *p = (BPool *) pool->data;
+
+ drmMMListHead *item;
+
+ if (alignment && (alignment != 4096))
+ return NULL;
+
+ _glthread_LOCK_MUTEX(p->mutex);
+
+ if (p->numFree == 0)
+ pool_checkFree(p, GL_TRUE);
+
+ if (p->numFree == 0) {
+ fprintf(stderr, "Out of fixed size buffer objects\n");
+ BM_CKFATAL(-ENOMEM);
+ }
+
+ item = p->free.next;
+
+ if (item == &p->free) {
+ fprintf(stderr, "Fixed size buffer pool corruption\n");
+ }
+
+ DRMLISTDEL(item);
+ --p->numFree;
+
+ _glthread_UNLOCK_MUTEX(p->mutex);
+ return (void *) DRMLISTENTRY(BBuf, item, head);
+}
+
+
+static int
+pool_destroy(struct _DriBufferPool *pool, void *private)
+{
+ BBuf *buf = (BBuf *) private;
+ BPool *p = buf->parent;
+
+ _glthread_LOCK_MUTEX(p->mutex);
+
+ if (buf->fence) {
+ DRMLISTADDTAIL(&buf->head, &p->delayed);
+ p->numDelayed++;
+ }
+ else {
+ buf->unfenced = 0;
+ DRMLISTADD(&buf->head, &p->free);
+ p->numFree++;
+ }
+
+ if ((p->numDelayed % p->checkDelayed) == 0)
+ pool_checkFree(p, 0);
+
+ _glthread_UNLOCK_MUTEX(p->mutex);
+ return 0;
+}
+
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+ int hint, void **virtual)
+{
+
+ BBuf *buf = (BBuf *) private;
+ BPool *p = buf->parent;
+
+ _glthread_LOCK_MUTEX(p->mutex);
+
+ /*
+ * Currently Mesa doesn't have any condition variables to resolve this
+ * cleanly in a multithreading environment.
+ * We bail out instead.
+ */
+
+ if (buf->mapped) {
+ fprintf(stderr, "Trying to map already mapped buffer object\n");
+ BM_CKFATAL(-EINVAL);
+ }
+
+#if 0
+ if (buf->unfenced && !(hint & DRM_BO_HINT_ALLOW_UNFENCED_MAP)) {
+ fprintf(stderr, "Trying to map an unfenced buffer object 0x%08x"
+ " 0x%08x %d\n", hint, flags, buf->start);
+ BM_CKFATAL(-EINVAL);
+ }
+
+#endif
+
+ if (buf->fence) {
+ _glthread_UNLOCK_MUTEX(p->mutex);
+ return -EBUSY;
+ }
+
+ buf->mapped = GL_TRUE;
+ *virtual = (unsigned char *) p->virtual + buf->start;
+ _glthread_UNLOCK_MUTEX(p->mutex);
+ return 0;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *pool, void *private, int lazy)
+{
+ BBuf *buf = (BBuf *) private;
+ driFenceFinish(buf->fence, 0, lazy);
+ return 0;
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+ BBuf *buf = (BBuf *) private;
+
+ buf->mapped = 0;
+ return 0;
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+ BBuf *buf = (BBuf *) private;
+ BPool *p = buf->parent;
+
+ return p->kernelBO.offset + buf->start;
+}
+
+static unsigned
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+ BPool *p = (BPool *) pool->data;
+
+ return p->kernelBO.flags;
+}
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+ BPool *p = (BPool *) pool->data;
+
+ return p->bufSize;
+}
+
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+ struct _DriFenceObject *fence)
+{
+ BBuf *buf = (BBuf *) private;
+ BPool *p = buf->parent;
+
+ _glthread_LOCK_MUTEX(p->mutex);
+ if (buf->fence) {
+ driFenceUnReference(buf->fence);
+ }
+ buf->fence = fence;
+ buf->unfenced = 0;
+ driFenceReference(buf->fence);
+ _glthread_UNLOCK_MUTEX(p->mutex);
+
+ return 0;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+ BBuf *buf = (BBuf *) private;
+ BPool *p = buf->parent;
+
+ return &p->kernelBO;
+}
+
+static int
+pool_validate(struct _DriBufferPool *pool, void *private)
+{
+ BBuf *buf = (BBuf *) private;
+ BPool *p = buf->parent;
+ _glthread_LOCK_MUTEX(p->mutex);
+ buf->unfenced = GL_TRUE;
+ _glthread_UNLOCK_MUTEX(p->mutex);
+ return 0;
+}
+
+static void
+pool_takedown(struct _DriBufferPool *pool)
+{
+ BPool *p = (BPool *) pool->data;
+
+ /*
+ * Wait on outstanding fences.
+ */
+
+ _glthread_LOCK_MUTEX(p->mutex);
+ while ((p->numFree < p->numTot) && p->numDelayed) {
+ _glthread_UNLOCK_MUTEX(p->mutex);
+ sched_yield();
+ pool_checkFree(p, GL_TRUE);
+ _glthread_LOCK_MUTEX(p->mutex);
+ }
+
+ drmBODestroy(pool->fd, &p->kernelBO);
+ free(p->bufs);
+ _glthread_UNLOCK_MUTEX(p->mutex);
+ free(p);
+ free(pool);
+}
+
+
+struct _DriBufferPool *
+driBatchPoolInit(int fd, unsigned flags,
+ unsigned long bufSize,
+ unsigned numBufs, unsigned checkDelayed)
+{
+ struct _DriBufferPool *pool;
+
+ pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
+ if (!pool)
+ return NULL;
+
+ pool->data = createBPool(fd, bufSize, numBufs, flags, checkDelayed);
+ if (!pool->data)
+ return NULL;
+
+ pool->fd = fd;
+ pool->map = &pool_map;
+ pool->unmap = &pool_unmap;
+ pool->destroy = &pool_destroy;
+ pool->offset = &pool_offset;
+ pool->flags = &pool_flags;
+ pool->size = &pool_size;
+ pool->create = &pool_create;
+ pool->fence = &pool_fence;
+ pool->kernel = &pool_kernel;
+ pool->validate = &pool_validate;
+ pool->waitIdle = &pool_waitIdle;
+ pool->setstatic = NULL;
+ pool->takeDown = &pool_takedown;
+ return pool;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.c b/src/mesa/drivers/dri/i915tex/intel_blit.c
new file mode 100644
index 00000000000..550669ab0c8
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_blit.c
@@ -0,0 +1,579 @@
+/**************************************************************************
+ *
+ * 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_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_context.h"
+#include "intel_fbo.h"
+#include "intel_reg.h"
+#include "intel_regions.h"
+#include "vblank.h"
+
+#define FILE_DEBUG_FLAG DEBUG_BLIT
+
+/**
+ * Copy the back color buffer to the front color buffer.
+ * Used for SwapBuffers().
+ */
+void
+intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
+ const drm_clip_rect_t * rect)
+{
+
+ struct intel_context *intel;
+ const intelScreenPrivate *intelScreen;
+ GLboolean missed_target;
+ int64_t ust;
+
+ DBG("%s\n", __FUNCTION__);
+
+ assert(dPriv);
+
+ intel = intelScreenContext(dPriv->driScreenPriv->private);
+ if (!intel)
+ return;
+
+ intelScreen = intel->intelScreen;
+
+ if (!rect && !intel->swap_scheduled && intelScreen->drmMinor >= 6 &&
+ !(intel->vblank_flags & VBLANK_FLAG_NO_IRQ) &&
+ intelScreen->current_rotation == 0) {
+ unsigned int interval = driGetVBlankInterval(dPriv, intel->vblank_flags);
+ unsigned int target;
+ drm_i915_vblank_swap_t swap;
+
+ swap.drawable = dPriv->hHWDrawable;
+ swap.seqtype = DRM_VBLANK_ABSOLUTE;
+ target = swap.sequence = intel->vbl_seq + interval;
+
+ if (intel->vblank_flags & VBLANK_FLAG_SYNC) {
+ swap.seqtype |= DRM_VBLANK_NEXTONMISS;
+ } else if (interval == 0) {
+ goto noschedule;
+ }
+
+ if ( intel->vblank_flags & VBLANK_FLAG_SECONDARY ) {
+ swap.seqtype |= DRM_VBLANK_SECONDARY;
+ }
+
+ intel_batchbuffer_flush(intel->batch);
+
+ if (!drmCommandWriteRead(intel->driFd, DRM_I915_VBLANK_SWAP, &swap,
+ sizeof(swap))) {
+ intel->swap_scheduled = 1;
+ intel->vbl_seq = swap.sequence;
+ swap.sequence -= target;
+ missed_target = swap.sequence > 0 && swap.sequence <= (1 << 23);
+ }
+ } else {
+ intel->swap_scheduled = 0;
+ }
+noschedule:
+
+ if (intel->last_swap_fence) {
+ driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
+ driFenceUnReference(intel->last_swap_fence);
+ intel->last_swap_fence = NULL;
+ }
+ intel->last_swap_fence = intel->first_swap_fence;
+ intel->first_swap_fence = NULL;
+
+ if (!intel->swap_scheduled) {
+ if (!rect) {
+ driWaitForVBlank(dPriv, &intel->vbl_seq, intel->vblank_flags,
+ &missed_target);
+ }
+
+
+ /* The LOCK_HARDWARE is required for the cliprects. Buffer offsets
+ * should work regardless.
+ */
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable && intel->driDrawable->numClipRects) {
+ const intelScreenPrivate *intelScreen = intel->intelScreen;
+ struct gl_framebuffer *fb
+ = (struct gl_framebuffer *) dPriv->driverPrivate;
+ const struct intel_region *frontRegion
+ = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
+ const struct intel_region *backRegion
+ = intel_get_rb_region(fb, BUFFER_BACK_LEFT);
+ const int nbox = dPriv->numClipRects;
+ const drm_clip_rect_t *pbox = dPriv->pClipRects;
+ const int pitch = frontRegion->pitch;
+ const int cpp = frontRegion->cpp;
+ int BR13, CMD;
+ int i;
+
+ ASSERT(fb);
+ ASSERT(fb->Name == 0); /* Not a user-created FBO */
+ ASSERT(frontRegion);
+ ASSERT(backRegion);
+ ASSERT(frontRegion->pitch == backRegion->pitch);
+ ASSERT(frontRegion->cpp == backRegion->cpp);
+
+ if (cpp == 2) {
+ BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24);
+ CMD = XY_SRC_COPY_BLT_CMD;
+ }
+ else {
+ 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);
+ }
+
+ for (i = 0; i < nbox; i++, pbox++) {
+ drm_clip_rect_t box;
+
+ if (pbox->x1 > pbox->x2 ||
+ pbox->y1 > pbox->y2 ||
+ pbox->x2 > intelScreen->width || pbox->y2 > intelScreen->height)
+ continue;
+
+ box = *pbox;
+
+ if (rect) {
+ if (rect->x1 > box.x1)
+ box.x1 = rect->x1;
+ if (rect->y1 > box.y1)
+ box.y1 = rect->y1;
+ if (rect->x2 < box.x2)
+ box.x2 = rect->x2;
+ if (rect->y2 < box.y2)
+ box.y2 = rect->y2;
+
+ if (box.x1 > box.x2 || box.y1 > box.y2)
+ continue;
+ }
+
+ BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
+ 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_RELOC(frontRegion->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
+ else
+ OUT_RELOC(backRegion->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
+ OUT_BATCH((pbox->y1 << 16) | pbox->x1);
+ OUT_BATCH(BR13 & 0xffff);
+
+ if (intel->sarea->pf_current_page == 0)
+ OUT_RELOC(backRegion->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
+ else
+ OUT_RELOC(frontRegion->buffer,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
+
+ ADVANCE_BATCH();
+ }
+
+ if (intel->first_swap_fence)
+ driFenceUnReference(intel->first_swap_fence);
+ intel->first_swap_fence = intel_batchbuffer_flush(intel->batch);
+ driFenceReference(intel->first_swap_fence);
+ }
+
+ UNLOCK_HARDWARE(intel);
+ }
+
+ if (!rect) {
+ intel->swap_count++;
+ (*dri_interface->getUST) (&ust);
+ if (missed_target) {
+ intel->swap_missed_count++;
+ intel->swap_missed_ust = ust - intel->swap_ust;
+ }
+
+ intel->swap_ust = ust;
+ }
+}
+
+
+
+
+void
+intelEmitFillBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLshort dst_pitch,
+ struct _DriBufferObject *dst_buffer,
+ 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;
+ }
+
+ DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
+ __FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h);
+
+
+ BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((y << 16) | x);
+ OUT_BATCH(((y + h) << 16) | (x + w));
+ OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, dst_offset);
+ OUT_BATCH(color);
+ ADVANCE_BATCH();
+}
+
+
+static GLuint translate_raster_op(GLenum logicop)
+{
+ switch(logicop) {
+ case GL_CLEAR: return 0x00;
+ case GL_AND: return 0x88;
+ case GL_AND_REVERSE: return 0x44;
+ case GL_COPY: return 0xCC;
+ case GL_AND_INVERTED: return 0x22;
+ case GL_NOOP: return 0xAA;
+ case GL_XOR: return 0x66;
+ case GL_OR: return 0xEE;
+ case GL_NOR: return 0x11;
+ case GL_EQUIV: return 0x99;
+ case GL_INVERT: return 0x55;
+ case GL_OR_REVERSE: return 0xDD;
+ case GL_COPY_INVERTED: return 0x33;
+ case GL_OR_INVERTED: return 0xBB;
+ case GL_NAND: return 0x77;
+ case GL_SET: return 0xFF;
+ default: return 0;
+ }
+}
+
+
+/* Copy BitBlt
+ */
+void
+intelEmitCopyBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLshort src_pitch,
+ struct _DriBufferObject *src_buffer,
+ GLuint src_offset,
+ GLshort dst_pitch,
+ struct _DriBufferObject *dst_buffer,
+ GLuint dst_offset,
+ GLshort src_x, GLshort src_y,
+ GLshort dst_x, GLshort dst_y,
+ GLshort w, GLshort h,
+ GLenum logic_op)
+{
+ GLuint CMD, BR13;
+ int dst_y2 = dst_y + h;
+ int dst_x2 = dst_x + w;
+ BATCH_LOCALS;
+
+
+ DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ src_buffer, src_pitch, src_offset, src_x, src_y,
+ dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h);
+
+ src_pitch *= cpp;
+ dst_pitch *= cpp;
+
+ switch (cpp) {
+ case 1:
+ case 2:
+ case 3:
+ BR13 = (((GLint) dst_pitch) & 0xffff) |
+ (translate_raster_op(logic_op) << 16) | (1 << 24);
+ CMD = XY_SRC_COPY_BLT_CMD;
+ break;
+ case 4:
+ BR13 =
+ (((GLint) dst_pitch) & 0xffff) |
+ (translate_raster_op(logic_op) << 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;
+ }
+
+ /* Initial y values don't seem to work with negative pitches. If
+ * we adjust the offsets manually (below), it seems to work fine.
+ *
+ * On the other hand, if we always adjust, the hardware doesn't
+ * know which blit directions to use, so overlapping copypixels get
+ * the wrong result.
+ */
+ if (dst_pitch > 0 && src_pitch > 0) {
+ BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((dst_y << 16) | dst_x);
+ OUT_BATCH((dst_y2 << 16) | dst_x2);
+ OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, dst_offset);
+ OUT_BATCH((src_y << 16) | src_x);
+ OUT_BATCH(((GLint) src_pitch & 0xffff));
+ OUT_RELOC(src_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, src_offset);
+ ADVANCE_BATCH();
+ }
+ else {
+ BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((0 << 16) | dst_x);
+ OUT_BATCH((h << 16) | dst_x2);
+ OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ dst_offset + dst_y * dst_pitch);
+ OUT_BATCH((0 << 16) | src_x);
+ OUT_BATCH(((GLint) src_pitch & 0xffff));
+ OUT_RELOC(src_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
+ src_offset + src_y * src_pitch);
+ ADVANCE_BATCH();
+ }
+}
+
+
+/**
+ * Use blitting to clear the renderbuffers named by 'flags'.
+ * Note: we can't use the ctx->DrawBuffer->_ColorDrawBufferMask field
+ * since that might include software renderbuffers or renderbuffers
+ * which we're clearing with triangles.
+ * \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear
+ */
+void
+intelClearWithBlit(GLcontext * ctx, GLbitfield mask)
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLuint clear_depth;
+ GLbitfield skipBuffers = 0;
+ BATCH_LOCALS;
+
+ DBG("%s %x\n", __FUNCTION__, mask);
+
+ /*
+ * Compute values for clearing the buffers.
+ */
+ clear_depth = 0;
+ if (mask & BUFFER_BIT_DEPTH) {
+ clear_depth = (GLuint) (ctx->DrawBuffer->_DepthMax * ctx->Depth.Clear);
+ }
+ if (mask & BUFFER_BIT_STENCIL) {
+ clear_depth |= (ctx->Stencil.Clear & 0xff) << 24;
+ }
+
+ /* If clearing both depth and stencil, skip BUFFER_BIT_STENCIL in
+ * the loop below.
+ */
+ if ((mask & BUFFER_BIT_DEPTH) && (mask & BUFFER_BIT_STENCIL)) {
+ skipBuffers = BUFFER_BIT_STENCIL;
+ }
+
+ /* XXX Move this flush/lock into the following conditional? */
+ intelFlush(&intel->ctx);
+ LOCK_HARDWARE(intel);
+
+ if (intel->numClipRects) {
+ GLint cx, cy, cw, ch;
+ drm_clip_rect_t clear;
+ int i;
+
+ /* Get clear bounds after locking */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+
+ if (intel->ctx.DrawBuffer->Name == 0) {
+ /* clearing a window */
+
+ /* flip top to bottom */
+ clear.x1 = cx + intel->drawX;
+ clear.y1 = intel->driDrawable->y + intel->driDrawable->h - cy - ch;
+ clear.x2 = clear.x1 + cw;
+ clear.y2 = clear.y1 + ch;
+
+ /* adjust for page flipping */
+ if (intel->sarea->pf_current_page == 1) {
+ const GLuint tmp = mask;
+ mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
+ if (tmp & BUFFER_BIT_FRONT_LEFT)
+ mask |= BUFFER_BIT_BACK_LEFT;
+ if (tmp & BUFFER_BIT_BACK_LEFT)
+ mask |= BUFFER_BIT_FRONT_LEFT;
+ }
+ }
+ else {
+ /* clearing FBO */
+ assert(intel->numClipRects == 1);
+ assert(intel->pClipRects == &intel->fboRect);
+ clear.x1 = cx;
+ clear.y1 = cy;
+ clear.x2 = clear.x1 + cw;
+ clear.y2 = clear.y1 + ch;
+ /* no change to mask */
+ }
+
+ for (i = 0; i < intel->numClipRects; i++) {
+ const drm_clip_rect_t *box = &intel->pClipRects[i];
+ drm_clip_rect_t b;
+ GLuint buf;
+ GLuint clearMask = mask; /* use copy, since we modify it below */
+ GLboolean all = (cw == ctx->DrawBuffer->Width &&
+ ch == ctx->DrawBuffer->Height);
+
+ if (!all) {
+ intel_intersect_cliprects(&b, &clear, box);
+ }
+ else {
+ b = *box;
+ }
+
+ if (0)
+ _mesa_printf("clear %d,%d..%d,%d, mask %x\n",
+ b.x1, b.y1, b.x2, b.y2, mask);
+
+ /* Loop over all renderbuffers */
+ for (buf = 0; buf < BUFFER_COUNT && clearMask; buf++) {
+ const GLbitfield bufBit = 1 << buf;
+ if ((clearMask & bufBit) && !(bufBit & skipBuffers)) {
+ /* OK, clear this renderbuffer */
+ const struct intel_renderbuffer *irb
+ = intel_renderbuffer(ctx->DrawBuffer->
+ Attachment[buf].Renderbuffer);
+ struct _DriBufferObject *write_buffer =
+ intel_region_buffer(intel->intelScreen, irb->region,
+ all ? INTEL_WRITE_FULL :
+ INTEL_WRITE_PART);
+
+ GLuint clearVal;
+ GLint pitch, cpp;
+ GLuint BR13, CMD;
+
+ ASSERT(irb);
+ ASSERT(irb->region);
+
+ pitch = irb->region->pitch;
+ cpp = irb->region->cpp;
+
+ DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ irb->region->buffer, (pitch * cpp),
+ irb->region->draw_offset,
+ b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1);
+
+
+ /* Setup the blit command */
+ if (cpp == 4) {
+ BR13 = (0xF0 << 16) | (pitch * cpp) | (1 << 24) | (1 << 25);
+ if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) {
+ CMD = XY_COLOR_BLT_CMD;
+ if (clearMask & BUFFER_BIT_DEPTH)
+ CMD |= XY_COLOR_BLT_WRITE_RGB;
+ if (clearMask & BUFFER_BIT_STENCIL)
+ CMD |= XY_COLOR_BLT_WRITE_ALPHA;
+ }
+ else {
+ /* clearing RGBA */
+ CMD = (XY_COLOR_BLT_CMD |
+ XY_COLOR_BLT_WRITE_ALPHA |
+ XY_COLOR_BLT_WRITE_RGB);
+ }
+ }
+ else {
+ ASSERT(cpp == 2 || cpp == 0);
+ BR13 = (0xF0 << 16) | (pitch * cpp) | (1 << 24);
+ CMD = XY_COLOR_BLT_CMD;
+ }
+
+ if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) {
+ clearVal = clear_depth;
+ }
+ else {
+ clearVal = (cpp == 4)
+ ? intel->ClearColor8888 : intel->ClearColor565;
+ }
+ /*
+ _mesa_debug(ctx, "hardware blit clear buf %d rb id %d\n",
+ buf, irb->Base.Name);
+ */
+ BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((b.y1 << 16) | b.x1);
+ OUT_BATCH((b.y2 << 16) | b.x2);
+ OUT_RELOC(write_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ irb->region->draw_offset);
+ OUT_BATCH(clearVal);
+ ADVANCE_BATCH();
+ clearMask &= ~bufBit; /* turn off bit, for faster loop exit */
+ }
+ }
+ }
+ intel_batchbuffer_flush(intel->batch);
+ }
+
+ UNLOCK_HARDWARE(intel);
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.h b/src/mesa/drivers/dri/i915tex/intel_blit.h
new file mode 100644
index 00000000000..e7bc280f58a
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_blit.h
@@ -0,0 +1,62 @@
+/**************************************************************************
+ *
+ * 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_BLIT_H
+#define INTEL_BLIT_H
+
+#include "intel_context.h"
+#include "intel_ioctl.h"
+#include "dri_bufmgr.h"
+
+extern void intelCopyBuffer(const __DRIdrawablePrivate * dpriv,
+ const drm_clip_rect_t * rect);
+
+extern void intelClearWithBlit(GLcontext * ctx, GLbitfield mask);
+
+extern void intelEmitCopyBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLshort src_pitch,
+ struct _DriBufferObject *src_buffer,
+ GLuint src_offset,
+ GLshort dst_pitch,
+ struct _DriBufferObject *dst_buffer,
+ GLuint dst_offset,
+ GLshort srcx, GLshort srcy,
+ GLshort dstx, GLshort dsty,
+ GLshort w, GLshort h,
+ GLenum logicop );
+
+extern void intelEmitFillBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLshort dst_pitch,
+ struct _DriBufferObject *dst_buffer,
+ GLuint dst_offset,
+ GLshort x, GLshort y,
+ GLshort w, GLshort h, GLuint color);
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
new file mode 100644
index 00000000000..31c41d86857
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
@@ -0,0 +1,250 @@
+/**************************************************************************
+ *
+ * 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 "imports.h"
+#include "mtypes.h"
+#include "bufferobj.h"
+
+#include "intel_context.h"
+#include "intel_buffer_objects.h"
+#include "intel_regions.h"
+#include "dri_bufmgr.h"
+
+/**
+ * There is some duplication between mesa's bufferobjects and our
+ * bufmgr buffers. Both have an integer handle and a hashtable to
+ * lookup an opaque structure. It would be nice if the handles and
+ * internal structure where somehow shared.
+ */
+static struct gl_buffer_object *
+intel_bufferobj_alloc(GLcontext * ctx, GLuint name, GLenum target)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object);
+
+ _mesa_initialize_buffer_object(&obj->Base, name, target);
+
+ driGenBuffers(intel->intelScreen->regionPool,
+ "bufferobj", 1, &obj->buffer, 64, 0, 0);
+
+ return &obj->Base;
+}
+
+
+/* Break the COW tie to the region. The region gets to keep the data.
+ */
+void
+intel_bufferobj_release_region(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj)
+{
+ assert(intel_obj->region->buffer == intel_obj->buffer);
+ intel_obj->region->pbo = NULL;
+ intel_obj->region = NULL;
+ driBOUnReference(intel_obj->buffer);
+ intel_obj->buffer = NULL;
+
+ /* This leads to a large number of buffer deletion/creation events.
+ * Currently the drm doesn't like that:
+ */
+ driGenBuffers(intel->intelScreen->regionPool,
+ "buffer object", 1, &intel_obj->buffer, 64, 0, 0);
+ driBOData(intel_obj->buffer, intel_obj->Base.Size, NULL, 0);
+}
+
+/* Break the COW tie to the region. Both the pbo and the region end
+ * up with a copy of the data.
+ */
+void
+intel_bufferobj_cow(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj)
+{
+ assert(intel_obj->region);
+ intel_region_cow(intel->intelScreen, intel_obj->region);
+}
+
+
+/**
+ * Deallocate/free a vertex/pixel buffer object.
+ * Called via glDeleteBuffersARB().
+ */
+static void
+intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+
+ if (intel_obj->region) {
+ intel_bufferobj_release_region(intel, intel_obj);
+ }
+ else if (intel_obj->buffer) {
+ driDeleteBuffers(1, &intel_obj->buffer);
+ }
+
+ _mesa_free(intel_obj);
+}
+
+
+
+/**
+ * Allocate space for and store data in a buffer object. Any data that was
+ * previously stored in the buffer object is lost. If data is NULL,
+ * memory will be allocated, but no copy will occur.
+ * Called via glBufferDataARB().
+ */
+static void
+intel_bufferobj_data(GLcontext * ctx,
+ GLenum target,
+ GLsizeiptrARB size,
+ const GLvoid * data,
+ GLenum usage, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ intel_obj->Base.Size = size;
+ intel_obj->Base.Usage = usage;
+
+ if (intel_obj->region)
+ intel_bufferobj_release_region(intel, intel_obj);
+
+ driBOData(intel_obj->buffer, size, data, 0);
+}
+
+
+/**
+ * Replace data in a subrange of buffer object. If the data range
+ * specified by size + offset extends beyond the end of the buffer or
+ * if data is NULL, no copy is performed.
+ * Called via glBufferSubDataARB().
+ */
+static void
+intel_bufferobj_subdata(GLcontext * ctx,
+ GLenum target,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ const GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+
+ if (intel_obj->region)
+ intel_bufferobj_cow(intel, intel_obj);
+
+ driBOSubData(intel_obj->buffer, offset, size, data);
+}
+
+
+/**
+ * Called via glGetBufferSubDataARB().
+ */
+static void
+intel_bufferobj_get_subdata(GLcontext * ctx,
+ GLenum target,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+ driBOGetSubData(intel_obj->buffer, offset, size, data);
+}
+
+
+
+/**
+ * Called via glMapBufferARB().
+ */
+static void *
+intel_bufferobj_map(GLcontext * ctx,
+ GLenum target,
+ GLenum access, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ /* XXX: Translate access to flags arg below:
+ */
+ assert(intel_obj);
+
+ if (intel_obj->region)
+ intel_bufferobj_cow(intel, intel_obj);
+
+ obj->Pointer = driBOMap(intel_obj->buffer,
+ DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
+ return obj->Pointer;
+}
+
+
+/**
+ * Called via glMapBufferARB().
+ */
+static GLboolean
+intel_bufferobj_unmap(GLcontext * ctx,
+ GLenum target, struct gl_buffer_object *obj)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+ assert(obj->Pointer);
+ driBOUnmap(intel_obj->buffer);
+ obj->Pointer = NULL;
+ return GL_TRUE;
+}
+
+struct _DriBufferObject *
+intel_bufferobj_buffer(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj, GLuint flag)
+{
+ if (intel_obj->region) {
+ if (flag == INTEL_WRITE_PART)
+ intel_bufferobj_cow(intel, intel_obj);
+ else if (flag == INTEL_WRITE_FULL)
+ intel_bufferobj_release_region(intel, intel_obj);
+ }
+
+ return intel_obj->buffer;
+}
+
+void
+intel_bufferobj_init(struct intel_context *intel)
+{
+ GLcontext *ctx = &intel->ctx;
+
+ ctx->Driver.NewBufferObject = intel_bufferobj_alloc;
+ ctx->Driver.DeleteBuffer = intel_bufferobj_free;
+ ctx->Driver.BufferData = intel_bufferobj_data;
+ ctx->Driver.BufferSubData = intel_bufferobj_subdata;
+ ctx->Driver.GetBufferSubData = intel_bufferobj_get_subdata;
+ ctx->Driver.MapBuffer = intel_bufferobj_map;
+ ctx->Driver.UnmapBuffer = intel_bufferobj_unmap;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.h b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.h
new file mode 100644
index 00000000000..afe9b2f7cf2
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.h
@@ -0,0 +1,86 @@
+ /**************************************************************************
+ *
+ * Copyright 2005 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_BUFFEROBJ_H
+#define INTEL_BUFFEROBJ_H
+
+#include "mtypes.h"
+
+struct intel_context;
+struct intel_region;
+struct gl_buffer_object;
+
+
+/**
+ * Intel vertex/pixel buffer object, derived from Mesa's gl_buffer_object.
+ */
+struct intel_buffer_object
+{
+ struct gl_buffer_object Base;
+ struct _DriBufferObject *buffer; /* the low-level buffer manager's buffer handle */
+
+ struct intel_region *region; /* Is there a zero-copy texture
+ associated with this (pixel)
+ buffer object? */
+};
+
+
+/* Get the bm buffer associated with a GL bufferobject:
+ */
+struct _DriBufferObject *intel_bufferobj_buffer(struct intel_context *intel,
+ struct intel_buffer_object
+ *obj, GLuint flag);
+
+/* Hook the bufferobject implementation into mesa:
+ */
+void intel_bufferobj_init(struct intel_context *intel);
+
+
+
+/* Are the obj->Name tests necessary? Unfortunately yes, mesa
+ * allocates a couple of gl_buffer_object structs statically, and
+ * the Name == 0 test is the only way to identify them and avoid
+ * casting them erroneously to our structs.
+ */
+static INLINE struct intel_buffer_object *
+intel_buffer_object(struct gl_buffer_object *obj)
+{
+ if (obj->Name)
+ return (struct intel_buffer_object *) obj;
+ else
+ return NULL;
+}
+
+/* Helpers for zerocopy image uploads. See also intel_regions.h:
+ */
+void intel_bufferobj_cow(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj);
+void intel_bufferobj_release_region(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj);
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c
new file mode 100644
index 00000000000..a6b32986233
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c
@@ -0,0 +1,928 @@
+/**************************************************************************
+ *
+ * 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 "intel_screen.h"
+#include "intel_context.h"
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_depthstencil.h"
+#include "intel_fbo.h"
+#include "intel_tris.h"
+#include "intel_regions.h"
+#include "intel_batchbuffer.h"
+#include "context.h"
+#include "utils.h"
+#include "framebuffer.h"
+#include "swrast/swrast.h"
+#include "vblank.h"
+
+
+/**
+ * XXX move this into a new dri/common/cliprects.c file.
+ */
+GLboolean
+intel_intersect_cliprects(drm_clip_rect_t * dst,
+ const drm_clip_rect_t * a,
+ const drm_clip_rect_t * b)
+{
+ GLint bx = b->x1;
+ GLint by = b->y1;
+ GLint bw = b->x2 - bx;
+ GLint bh = b->y2 - by;
+
+ if (bx < a->x1)
+ bw -= a->x1 - bx, bx = a->x1;
+ if (by < a->y1)
+ bh -= a->y1 - by, by = a->y1;
+ if (bx + bw > a->x2)
+ bw = a->x2 - bx;
+ if (by + bh > a->y2)
+ bh = a->y2 - by;
+ if (bw <= 0)
+ return GL_FALSE;
+ if (bh <= 0)
+ return GL_FALSE;
+
+ dst->x1 = bx;
+ dst->y1 = by;
+ dst->x2 = bx + bw;
+ dst->y2 = by + bh;
+
+ return GL_TRUE;
+}
+
+/**
+ * Return pointer to current color drawing region, or NULL.
+ */
+struct intel_region *
+intel_drawbuf_region(struct intel_context *intel)
+{
+ struct intel_renderbuffer *irbColor =
+ intel_renderbuffer(intel->ctx.DrawBuffer->_ColorDrawBuffers[0][0]);
+ if (irbColor)
+ return irbColor->region;
+ else
+ return NULL;
+}
+
+/**
+ * Return pointer to current color reading region, or NULL.
+ */
+struct intel_region *
+intel_readbuf_region(struct intel_context *intel)
+{
+ struct intel_renderbuffer *irb
+ = intel_renderbuffer(intel->ctx.ReadBuffer->_ColorReadBuffer);
+ if (irb)
+ return irb->region;
+ else
+ return NULL;
+}
+
+
+
+/**
+ * Update the following fields for rendering to a user-created FBO:
+ * intel->numClipRects
+ * intel->pClipRects
+ * intel->drawX
+ * intel->drawY
+ */
+static void
+intelSetRenderbufferClipRects(struct intel_context *intel)
+{
+ assert(intel->ctx.DrawBuffer->Width > 0);
+ assert(intel->ctx.DrawBuffer->Height > 0);
+ intel->fboRect.x1 = 0;
+ intel->fboRect.y1 = 0;
+ intel->fboRect.x2 = intel->ctx.DrawBuffer->Width;
+ intel->fboRect.y2 = intel->ctx.DrawBuffer->Height;
+ intel->numClipRects = 1;
+ intel->pClipRects = &intel->fboRect;
+ intel->drawX = 0;
+ intel->drawY = 0;
+}
+
+
+/**
+ * As above, but for rendering to front buffer of a window.
+ * \sa intelSetRenderbufferClipRects
+ */
+static void
+intelSetFrontClipRects(struct intel_context *intel)
+{
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+
+ if (!dPriv)
+ return;
+
+ intel->numClipRects = dPriv->numClipRects;
+ intel->pClipRects = dPriv->pClipRects;
+ intel->drawX = dPriv->x;
+ intel->drawY = dPriv->y;
+}
+
+
+/**
+ * As above, but for rendering to back buffer of a window.
+ */
+static void
+intelSetBackClipRects(struct intel_context *intel)
+{
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+
+ if (!dPriv)
+ return;
+
+ if (intel->sarea->pf_enabled == 0 && dPriv->numBackClipRects == 0) {
+ /* use the front clip rects */
+ intel->numClipRects = dPriv->numClipRects;
+ intel->pClipRects = dPriv->pClipRects;
+ intel->drawX = dPriv->x;
+ intel->drawY = dPriv->y;
+ }
+ else {
+ /* use the back clip rects */
+ intel->numClipRects = dPriv->numBackClipRects;
+ intel->pClipRects = dPriv->pBackClipRects;
+ intel->drawX = dPriv->backX;
+ intel->drawY = dPriv->backY;
+ }
+}
+
+
+/**
+ * This will be called whenever the currently bound window is moved/resized.
+ * XXX: actually, it seems to NOT be called when the window is only moved (BP).
+ */
+void
+intelWindowMoved(struct intel_context *intel)
+{
+ GLcontext *ctx = &intel->ctx;
+
+ if (!intel->ctx.DrawBuffer) {
+ /* when would this happen? -BP */
+ intelSetFrontClipRects(intel);
+ }
+ else if (intel->ctx.DrawBuffer->Name != 0) {
+ /* drawing to user-created FBO - do nothing */
+ /* Cliprects would be set from intelDrawBuffer() */
+ }
+ else {
+ /* drawing to a window */
+ 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);
+ }
+ }
+
+ /* this update Mesa's notion of window size */
+ if (ctx->WinSysDrawBuffer) {
+ _mesa_resize_framebuffer(ctx, ctx->WinSysDrawBuffer,
+ intel->driDrawable->w, intel->driDrawable->h);
+ }
+
+ if (intel->intelScreen->driScrnPriv->ddxMinor >= 7 && intel->driDrawable) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ drmI830Sarea *sarea = intel->sarea;
+ drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
+ .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
+ drm_clip_rect_t pipeA_rect = { .x1 = sarea->pipeA_x, .y1 = sarea->pipeA_y,
+ .x2 = sarea->pipeA_x + sarea->pipeA_w,
+ .y2 = sarea->pipeA_y + sarea->pipeA_h };
+ drm_clip_rect_t pipeB_rect = { .x1 = sarea->pipeB_x, .y1 = sarea->pipeB_y,
+ .x2 = sarea->pipeB_x + sarea->pipeB_w,
+ .y2 = sarea->pipeB_y + sarea->pipeB_h };
+ GLint areaA = driIntersectArea( drw_rect, pipeA_rect );
+ GLint areaB = driIntersectArea( drw_rect, pipeB_rect );
+ GLuint flags = intel->vblank_flags;
+
+ if (areaB > areaA || (areaA == areaB && areaB > 0)) {
+ flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY;
+ } else {
+ flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY;
+ }
+
+ if (flags != intel->vblank_flags) {
+ intel->vblank_flags = flags;
+ driGetCurrentVBlank(dPriv, intel->vblank_flags, &intel->vbl_seq);
+ }
+ } else {
+ intel->vblank_flags &= ~VBLANK_FLAG_SECONDARY;
+ }
+
+ /* Update hardware scissor */
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+}
+
+
+
+/* A true meta version of this would be very simple and additionally
+ * machine independent. Maybe we'll get there one day.
+ */
+static void
+intelClearWithTris(struct intel_context *intel, GLbitfield mask)
+{
+ GLcontext *ctx = &intel->ctx;
+ drm_clip_rect_t clear;
+
+ if (INTEL_DEBUG & DEBUG_BLIT)
+ _mesa_printf("%s 0x%x\n", __FUNCTION__, mask);
+
+ LOCK_HARDWARE(intel);
+
+ /* XXX FBO: was: intel->driDrawable->numClipRects */
+ if (intel->numClipRects) {
+ GLint cx, cy, cw, ch;
+ GLuint buf;
+
+ intel->vtbl.install_meta_state(intel);
+
+ /* Get clear bounds after locking */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+
+ /* note: regardless of 'all', cx, cy, cw, ch are now correct */
+ clear.x1 = cx;
+ clear.y1 = cy;
+ clear.x2 = cx + cw;
+ clear.y2 = cy + ch;
+
+ /* Back and stencil cliprects are the same. Try and do both
+ * buffers at once:
+ */
+ if (mask &
+ (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH)) {
+ struct intel_region *backRegion =
+ intel_get_rb_region(ctx->DrawBuffer, BUFFER_BACK_LEFT);
+ struct intel_region *depthRegion =
+ intel_get_rb_region(ctx->DrawBuffer, BUFFER_DEPTH);
+ const GLuint clearColor = (backRegion && backRegion->cpp == 4)
+ ? intel->ClearColor8888 : intel->ClearColor565;
+
+ intel->vtbl.meta_draw_region(intel, backRegion, depthRegion);
+
+ if (mask & BUFFER_BIT_BACK_LEFT)
+ intel->vtbl.meta_color_mask(intel, GL_TRUE);
+ else
+ intel->vtbl.meta_color_mask(intel, GL_FALSE);
+
+ if (mask & BUFFER_BIT_STENCIL)
+ intel->vtbl.meta_stencil_replace(intel,
+ intel->ctx.Stencil.WriteMask[0],
+ intel->ctx.Stencil.Clear);
+ else
+ intel->vtbl.meta_no_stencil_write(intel);
+
+ if (mask & BUFFER_BIT_DEPTH)
+ intel->vtbl.meta_depth_replace(intel);
+ else
+ intel->vtbl.meta_no_depth_write(intel);
+
+ /* XXX: Using INTEL_BATCH_NO_CLIPRECTS here is dangerous as the
+ * drawing origin may not be correctly emitted.
+ */
+ intel_meta_draw_quad(intel, clear.x1, clear.x2, clear.y1, clear.y2, intel->ctx.Depth.Clear, clearColor, 0, 0, 0, 0); /* texcoords */
+
+ mask &=
+ ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH);
+ }
+
+ /* clear the remaining (color) renderbuffers */
+ for (buf = 0; buf < BUFFER_COUNT && mask; buf++) {
+ const GLuint bufBit = 1 << buf;
+ if (mask & bufBit) {
+ struct intel_renderbuffer *irbColor =
+ intel_renderbuffer(ctx->DrawBuffer->
+ Attachment[buf].Renderbuffer);
+ GLuint color = (irbColor->region->cpp == 4)
+ ? intel->ClearColor8888 : intel->ClearColor565;
+
+ ASSERT(irbColor);
+
+ intel->vtbl.meta_no_depth_write(intel);
+ intel->vtbl.meta_no_stencil_write(intel);
+ intel->vtbl.meta_color_mask(intel, GL_TRUE);
+ intel->vtbl.meta_draw_region(intel, irbColor->region, NULL);
+
+ /* XXX: Using INTEL_BATCH_NO_CLIPRECTS here is dangerous as the
+ * drawing origin may not be correctly emitted.
+ */
+ intel_meta_draw_quad(intel, clear.x1, clear.x2, clear.y1, clear.y2, 0, /* depth clear val */
+ color, 0, 0, 0, 0); /* texcoords */
+
+ mask &= ~bufBit;
+ }
+ }
+
+ intel->vtbl.leave_meta_state(intel);
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+}
+
+
+
+
+/**
+ * Copy the window contents named by dPriv to the rotated (or reflected)
+ * color buffer.
+ * srcBuf is BUFFER_BIT_FRONT_LEFT or BUFFER_BIT_BACK_LEFT to indicate the source.
+ */
+void
+intelRotateWindow(struct intel_context *intel,
+ __DRIdrawablePrivate * dPriv, GLuint srcBuf)
+{
+ intelScreenPrivate *screen = intel->intelScreen;
+ drm_clip_rect_t fullRect;
+ struct intel_region *src;
+ const drm_clip_rect_t *clipRects;
+ int numClipRects;
+ int i;
+ GLenum format, type;
+
+ int xOrig, yOrig;
+ int origNumClipRects;
+ drm_clip_rect_t *origRects;
+
+ /*
+ * set up hardware state
+ */
+ intelFlush(&intel->ctx);
+
+ LOCK_HARDWARE(intel);
+
+ if (!intel->numClipRects) {
+ UNLOCK_HARDWARE(intel);
+ return;
+ }
+
+ intel->vtbl.install_meta_state(intel);
+
+ intel->vtbl.meta_no_depth_write(intel);
+ intel->vtbl.meta_no_stencil_write(intel);
+ intel->vtbl.meta_color_mask(intel, GL_FALSE);
+
+
+ /* save current drawing origin and cliprects (restored at end) */
+ xOrig = intel->drawX;
+ yOrig = intel->drawY;
+ origNumClipRects = intel->numClipRects;
+ origRects = intel->pClipRects;
+
+ /*
+ * set drawing origin, cliprects for full-screen access to rotated screen
+ */
+ fullRect.x1 = 0;
+ fullRect.y1 = 0;
+ fullRect.x2 = screen->rotatedWidth;
+ fullRect.y2 = screen->rotatedHeight;
+ intel->drawX = 0;
+ intel->drawY = 0;
+ intel->numClipRects = 1;
+ intel->pClipRects = &fullRect;
+
+ intel->vtbl.meta_draw_region(intel, screen->rotated_region, NULL); /* ? */
+
+ if (srcBuf == BUFFER_BIT_FRONT_LEFT) {
+ src = intel->intelScreen->front_region;
+ clipRects = dPriv->pClipRects;
+ numClipRects = dPriv->numClipRects;
+ }
+ else {
+ src = intel->intelScreen->back_region;
+ clipRects = dPriv->pBackClipRects;
+ numClipRects = dPriv->numBackClipRects;
+ }
+
+ if (src->cpp == 4) {
+ format = GL_BGRA;
+ type = GL_UNSIGNED_BYTE;
+ }
+ else {
+ format = GL_BGR;
+ type = GL_UNSIGNED_SHORT_5_6_5_REV;
+ }
+
+ /* set the whole screen up as a texture to avoid alignment issues */
+ intel->vtbl.meta_tex_rect_source(intel,
+ src->buffer,
+ screen->width,
+ screen->height, src->pitch, format, type);
+
+ intel->vtbl.meta_texture_blend_replace(intel);
+
+ /*
+ * loop over the source window's cliprects
+ */
+ for (i = 0; i < numClipRects; i++) {
+ int srcX0 = clipRects[i].x1;
+ int srcY0 = clipRects[i].y1;
+ int srcX1 = clipRects[i].x2;
+ int srcY1 = clipRects[i].y2;
+ GLfloat verts[4][2], tex[4][2];
+ int j;
+
+ /* build vertices for four corners of clip rect */
+ verts[0][0] = srcX0;
+ verts[0][1] = srcY0;
+ verts[1][0] = srcX1;
+ verts[1][1] = srcY0;
+ verts[2][0] = srcX1;
+ verts[2][1] = srcY1;
+ verts[3][0] = srcX0;
+ verts[3][1] = srcY1;
+
+ /* .. and texcoords */
+ tex[0][0] = srcX0;
+ tex[0][1] = srcY0;
+ tex[1][0] = srcX1;
+ tex[1][1] = srcY0;
+ tex[2][0] = srcX1;
+ tex[2][1] = srcY1;
+ tex[3][0] = srcX0;
+ tex[3][1] = srcY1;
+
+ /* transform coords to rotated screen coords */
+
+ for (j = 0; j < 4; j++) {
+ matrix23TransformCoordf(&screen->rotMatrix,
+ &verts[j][0], &verts[j][1]);
+ }
+
+ /* draw polygon to map source image to dest region */
+ intel_meta_draw_poly(intel, 4, verts, 0, 0, tex);
+
+ } /* cliprect loop */
+
+ intel->vtbl.leave_meta_state(intel);
+ intel_batchbuffer_flush(intel->batch);
+
+ /* restore original drawing origin and cliprects */
+ intel->drawX = xOrig;
+ intel->drawY = yOrig;
+ intel->numClipRects = origNumClipRects;
+ intel->pClipRects = origRects;
+
+ UNLOCK_HARDWARE(intel);
+}
+
+
+/**
+ * Called by ctx->Driver.Clear.
+ */
+static void
+intelClear(GLcontext *ctx, GLbitfield mask)
+{
+ struct intel_context *intel = intel_context(ctx);
+ const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
+ GLbitfield tri_mask = 0;
+ GLbitfield blit_mask = 0;
+ GLbitfield swrast_mask = 0;
+ GLuint i;
+
+ if (0)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ /* HW color buffers (front, back, aux, generic FBO, etc) */
+ if (colorMask == ~0) {
+ /* clear all R,G,B,A */
+ /* XXX FBO: need to check if colorbuffers are software RBOs! */
+ blit_mask |= (mask & BUFFER_BITS_COLOR);
+ }
+ else {
+ /* glColorMask in effect */
+ tri_mask |= (mask & BUFFER_BITS_COLOR);
+ }
+
+ /* HW stencil */
+ if (mask & BUFFER_BIT_STENCIL) {
+ const struct intel_region *stencilRegion
+ = intel_get_rb_region(ctx->DrawBuffer, BUFFER_STENCIL);
+ if (stencilRegion) {
+ /* have hw stencil */
+ if ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff) {
+ /* not clearing all stencil bits, so use triangle clearing */
+ tri_mask |= BUFFER_BIT_STENCIL;
+ }
+ else {
+ /* clearing all stencil bits, use blitting */
+ blit_mask |= BUFFER_BIT_STENCIL;
+ }
+ }
+ }
+
+ /* HW depth */
+ if (mask & BUFFER_BIT_DEPTH) {
+ /* clear depth with whatever method is used for stencil (see above) */
+ if (tri_mask & BUFFER_BIT_STENCIL)
+ tri_mask |= BUFFER_BIT_DEPTH;
+ else
+ blit_mask |= BUFFER_BIT_DEPTH;
+ }
+
+ /* SW fallback clearing */
+ swrast_mask = mask & ~tri_mask & ~blit_mask;
+
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ GLuint bufBit = 1 << i;
+ if ((blit_mask | tri_mask) & bufBit) {
+ if (!ctx->DrawBuffer->Attachment[i].Renderbuffer->ClassID) {
+ blit_mask &= ~bufBit;
+ tri_mask &= ~bufBit;
+ swrast_mask |= bufBit;
+ }
+ }
+ }
+
+
+ intelFlush(ctx); /* XXX intelClearWithBlit also does this */
+
+ if (blit_mask)
+ intelClearWithBlit(ctx, blit_mask);
+
+ if (tri_mask)
+ intelClearWithTris(intel, tri_mask);
+
+ if (swrast_mask)
+ _swrast_Clear(ctx, swrast_mask);
+}
+
+
+
+/* Flip the front & back buffers
+ */
+static void
+intelPageFlip(const __DRIdrawablePrivate * dPriv)
+{
+#if 0
+ struct intel_context *intel;
+ int tmp, ret;
+
+ if (INTEL_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ assert(dPriv);
+ assert(dPriv->driContextPriv);
+ assert(dPriv->driContextPriv->driverPrivate);
+
+ intel = (struct intel_context *) 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
+}
+
+#if 0
+void
+intelSwapBuffers(__DRIdrawablePrivate * dPriv)
+{
+ if (dPriv->driverPrivate) {
+ const struct gl_framebuffer *fb
+ = (struct gl_framebuffer *) dPriv->driverPrivate;
+ if (fb->Visual.doubleBufferMode) {
+ GET_CURRENT_CONTEXT(ctx);
+ if (ctx && ctx->DrawBuffer == fb) {
+ _mesa_notifySwapBuffers(ctx); /* flush pending rendering */
+ }
+ if (0 /*intel->doPageFlip */ ) { /* doPageFlip is never set !!! */
+ intelPageFlip(dPriv);
+ }
+ else {
+ intelCopyBuffer(dPriv);
+ }
+ }
+ }
+ else {
+ _mesa_problem(NULL,
+ "dPriv has no gl_framebuffer pointer in intelSwapBuffers");
+ }
+}
+#else
+/* Trunk version:
+ */
+void
+intelSwapBuffers(__DRIdrawablePrivate * dPriv)
+{
+ if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
+ GET_CURRENT_CONTEXT(ctx);
+ struct intel_context *intel;
+
+ if (ctx == NULL)
+ return;
+
+ intel = intel_context(ctx);
+
+ if (ctx->Visual.doubleBufferMode) {
+ intelScreenPrivate *screen = intel->intelScreen;
+ _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
+ if (0 /*intel->doPageFlip */ ) { /* doPageFlip is never set !!! */
+ intelPageFlip(dPriv);
+ }
+ else {
+ intelCopyBuffer(dPriv, NULL);
+ }
+ if (screen->current_rotation != 0) {
+ intelRotateWindow(intel, dPriv, BUFFER_BIT_FRONT_LEFT);
+ }
+ }
+ }
+ 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__);
+ }
+}
+#endif
+
+void
+intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
+{
+ if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
+ struct intel_context *intel =
+ (struct intel_context *) dPriv->driContextPriv->driverPrivate;
+ GLcontext *ctx = &intel->ctx;
+
+ if (ctx->Visual.doubleBufferMode) {
+ drm_clip_rect_t rect;
+ rect.x1 = x + dPriv->x;
+ rect.y1 = (dPriv->h - y - h) + dPriv->y;
+ rect.x2 = rect.x1 + w;
+ rect.y2 = rect.y1 + h;
+ _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
+ intelCopyBuffer(dPriv, &rect);
+ }
+ }
+ 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__);
+ }
+}
+
+
+/**
+ * Update the hardware state for drawing into a window or framebuffer object.
+ *
+ * Called by glDrawBuffer, glBindFramebufferEXT, MakeCurrent, and other
+ * places within the driver.
+ *
+ * Basically, this needs to be called any time the current framebuffer
+ * changes, the renderbuffers change, or we need to draw into different
+ * color buffers.
+ */
+void
+intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *colorRegion, *depthRegion = NULL;
+ struct intel_renderbuffer *irbDepth = NULL, *irbStencil = NULL;
+ int front = 0; /* drawing to front color buffer? */
+
+ if (!fb) {
+ /* this can happen during the initial context initialization */
+ return;
+ }
+
+ /* Do this here, note core Mesa, since this function is called from
+ * many places within the driver.
+ */
+ if (ctx->NewState & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) {
+ /* this updates the DrawBuffer->_NumColorDrawBuffers fields, etc */
+ _mesa_update_framebuffer(ctx);
+ /* this updates the DrawBuffer's Width/Height if it's a FBO */
+ _mesa_update_draw_buffer_bounds(ctx);
+ }
+
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ /* this may occur when we're called by glBindFrameBuffer() during
+ * the process of someone setting up renderbuffers, etc.
+ */
+ /*_mesa_debug(ctx, "DrawBuffer: incomplete user FBO\n");*/
+ return;
+ }
+
+ if (fb->Name)
+ intel_validate_paired_depth_stencil(ctx, fb);
+
+ /*
+ * How many color buffers are we drawing into?
+ */
+ if (fb->_NumColorDrawBuffers[0] != 1
+#if 0
+ /* XXX FBO temporary - always use software rendering */
+ || 1
+#endif
+ ) {
+ /* writing to 0 or 2 or 4 color buffers */
+ /*_mesa_debug(ctx, "Software rendering\n");*/
+ FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE);
+ front = 1; /* might not have back color buffer */
+ }
+ else {
+ /* draw to exactly one color buffer */
+ /*_mesa_debug(ctx, "Hardware rendering\n");*/
+ FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE);
+ if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) {
+ front = 1;
+ }
+ }
+
+ /*
+ * Get the intel_renderbuffer for the colorbuffer we're drawing into.
+ * And set up cliprects.
+ */
+ if (fb->Name == 0) {
+ /* drawing to window system buffer */
+ if (intel->sarea->pf_current_page == 1) {
+ /* page flipped back/front */
+ front ^= 1;
+ }
+ if (front) {
+ intelSetFrontClipRects(intel);
+ colorRegion = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
+ }
+ else {
+ intelSetBackClipRects(intel);
+ colorRegion = intel_get_rb_region(fb, BUFFER_BACK_LEFT);
+ }
+ }
+ else {
+ /* drawing to user-created FBO */
+ struct intel_renderbuffer *irb;
+ intelSetRenderbufferClipRects(intel);
+ irb = intel_renderbuffer(fb->_ColorDrawBuffers[0][0]);
+ colorRegion = (irb && irb->region) ? irb->region : NULL;
+ }
+
+ /* Update culling direction which changes depending on the
+ * orientation of the buffer:
+ */
+ if (ctx->Driver.FrontFace)
+ ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
+ else
+ ctx->NewState |= _NEW_POLYGON;
+
+ if (!colorRegion) {
+ FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE);
+ }
+ else {
+ FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE);
+ }
+
+ /***
+ *** Get depth buffer region and check if we need a software fallback.
+ *** Note that the depth buffer is usually a DEPTH_STENCIL buffer.
+ ***/
+ if (fb->_DepthBuffer && fb->_DepthBuffer->Wrapped) {
+ irbDepth = intel_renderbuffer(fb->_DepthBuffer->Wrapped);
+ if (irbDepth && irbDepth->region) {
+ FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE);
+ depthRegion = irbDepth->region;
+ }
+ else {
+ FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_TRUE);
+ depthRegion = NULL;
+ }
+ }
+ else {
+ /* not using depth buffer */
+ FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE);
+ depthRegion = NULL;
+ }
+
+ /***
+ *** Stencil buffer
+ *** This can only be hardware accelerated if we're using a
+ *** combined DEPTH_STENCIL buffer (for now anyway).
+ ***/
+ if (fb->_StencilBuffer && fb->_StencilBuffer->Wrapped) {
+ irbStencil = intel_renderbuffer(fb->_StencilBuffer->Wrapped);
+ if (irbStencil && irbStencil->region) {
+ ASSERT(irbStencil->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+ FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE);
+ /* need to re-compute stencil hw state */
+ ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled);
+ if (!depthRegion)
+ depthRegion = irbStencil->region;
+ }
+ else {
+ FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_TRUE);
+ }
+ }
+ else {
+ /* XXX FBO: instead of FALSE, pass ctx->Stencil.Enabled ??? */
+ FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE);
+ /* need to re-compute stencil hw state */
+ ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled);
+ }
+
+
+ /**
+ ** Release old regions, reference new regions
+ **/
+#if 0 /* XXX FBO: this seems to be redundant with i915_state_draw_region() */
+ if (intel->draw_region != colorRegion) {
+ intel_region_release(&intel->draw_region);
+ intel_region_reference(&intel->draw_region, colorRegion);
+ }
+ if (intel->intelScreen->depth_region != depthRegion) {
+ intel_region_release(&intel->intelScreen->depth_region);
+ intel_region_reference(&intel->intelScreen->depth_region, depthRegion);
+ }
+#endif
+
+ intel->vtbl.set_draw_region(intel, colorRegion, depthRegion);
+
+ /* update viewport since it depends on window size */
+ ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y,
+ ctx->Viewport.Width, ctx->Viewport.Height);
+
+ /* Update hardware scissor */
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+}
+
+
+static void
+intelDrawBuffer(GLcontext * ctx, GLenum mode)
+{
+ intel_draw_buffer(ctx, ctx->DrawBuffer);
+}
+
+
+static void
+intelReadBuffer(GLcontext * ctx, GLenum mode)
+{
+ if (ctx->ReadBuffer == ctx->DrawBuffer) {
+ /* This will update FBO completeness status.
+ * A framebuffer will be incomplete if the GL_READ_BUFFER setting
+ * refers to a missing renderbuffer. Calling glReadBuffer can set
+ * that straight and can make the drawing buffer complete.
+ */
+ intel_draw_buffer(ctx, ctx->DrawBuffer);
+ }
+ /* Generally, functions which read pixels (glReadPixels, glCopyPixels, etc)
+ * reference ctx->ReadBuffer and do appropriate state checks.
+ */
+}
+
+
+void
+intelInitBufferFuncs(struct dd_function_table *functions)
+{
+ functions->Clear = intelClear;
+ functions->DrawBuffer = intelDrawBuffer;
+ functions->ReadBuffer = intelReadBuffer;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.h b/src/mesa/drivers/dri/i915tex/intel_buffers.h
new file mode 100644
index 00000000000..0faf0553474
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.h
@@ -0,0 +1,56 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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_BUFFERS_H
+#define INTEL_BUFFERS_H
+
+
+struct intel_context;
+
+
+extern GLboolean
+intel_intersect_cliprects(drm_clip_rect_t * dest,
+ const drm_clip_rect_t * a,
+ const drm_clip_rect_t * b);
+
+extern struct intel_region *intel_readbuf_region(struct intel_context *intel);
+
+extern struct intel_region *intel_drawbuf_region(struct intel_context *intel);
+
+extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
+
+extern void intelWindowMoved(struct intel_context *intel);
+
+extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb);
+
+extern void intelInitBufferFuncs(struct dd_function_table *functions);
+
+extern void
+intelRotateWindow(struct intel_context *intel,
+ __DRIdrawablePrivate * dPriv, GLuint srcBuf);
+
+#endif /* INTEL_BUFFERS_H */
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c
new file mode 100644
index 00000000000..c77d365360d
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_context.c
@@ -0,0 +1,714 @@
+/**************************************************************************
+ *
+ * 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 "intel_buffers.h"
+#include "intel_tex.h"
+#include "intel_span.h"
+#include "intel_tris.h"
+#include "intel_ioctl.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_pixel.h"
+#include "intel_regions.h"
+#include "intel_buffer_objects.h"
+#include "intel_fbo.h"
+
+#include "vblank.h"
+#include "utils.h"
+#include "xmlpool.h" /* for symbolic values of enum-type options */
+#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_framebuffer_object
+#define need_GL_EXT_multi_draw_arrays
+#define need_GL_EXT_secondary_color
+#define need_GL_NV_vertex_program
+#include "extension_helper.h"
+
+
+#define DRIVER_DATE "20061102"
+
+_glthread_Mutex lockMutex;
+static GLboolean lockMutexInit = GL_FALSE;
+
+
+static 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;
+ case PCI_CHIP_I945_GM:
+ chipset = "Intel(R) 945GM";
+ break;
+ default:
+ chipset = "Unknown Intel Chipset";
+ break;
+ }
+
+ (void) driGetRendererString(buffer, chipset, DRIVER_DATE, 0);
+ return (GLubyte *) buffer;
+
+ default:
+ return NULL;
+ }
+}
+
+
+/**
+ * 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_pixel_buffer_object", NULL},
+ {"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_framebuffer_object", GL_EXT_framebuffer_object_functions},
+ {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
+#if 1 /* XXX FBO temporary? */
+ {"GL_EXT_packed_depth_stencil", NULL},
+#endif
+ {"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[] = {
+ {"tex", DEBUG_TEXTURE},
+ {"state", DEBUG_STATE},
+ {"ioctl", DEBUG_IOCTL},
+ {"blit", DEBUG_BLIT},
+ {"mip", DEBUG_MIPTREE},
+ {"fall", DEBUG_FALLBACKS},
+ {"verb", DEBUG_VERBOSE},
+ {"bat", DEBUG_BATCH},
+ {"pix", DEBUG_PIXEL},
+ {"buf", DEBUG_BUFMGR},
+ {"reg", DEBUG_REGION},
+ {"fbo", DEBUG_FBO},
+ {"lock", DEBUG_LOCK},
+ {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
+intelFlush(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ if (intel->Fallback)
+ _swrast_flush(ctx);
+
+ INTEL_FIREVERTICES(intel);
+
+ if (intel->batch->map != intel->batch->ptr)
+ intel_batchbuffer_flush(intel->batch);
+
+ /* XXX: Need to do an MI_FLUSH here.
+ */
+}
+
+
+/**
+ * Check if we need to rotate/warp the front color buffer to the
+ * rotated screen. We generally need to do this when we get a glFlush
+ * or glFinish after drawing to the front color buffer.
+ */
+static void
+intelCheckFrontRotate(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ if (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0] ==
+ BUFFER_BIT_FRONT_LEFT) {
+ intelScreenPrivate *screen = intel->intelScreen;
+ if (screen->current_rotation != 0) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ intelRotateWindow(intel, dPriv, BUFFER_BIT_FRONT_LEFT);
+ }
+ }
+}
+
+
+/**
+ * Called via glFlush.
+ */
+static void
+intelglFlush(GLcontext * ctx)
+{
+ intelFlush(ctx);
+ intelCheckFrontRotate(ctx);
+}
+
+void
+intelFinish(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ intelFlush(ctx);
+ if (intel->batch->last_fence) {
+ driFenceFinish(intel->batch->last_fence,
+ 0, GL_FALSE);
+ driFenceUnReference(intel->batch->last_fence);
+ intel->batch->last_fence = NULL;
+ }
+ intelCheckFrontRotate(ctx);
+}
+
+
+void
+intelInitDriverFunctions(struct dd_function_table *functions)
+{
+ _mesa_init_driver_functions(functions);
+
+ functions->Flush = intelglFlush;
+ functions->Finish = intelFinish;
+ 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);
+ intelInitBufferFuncs(functions);
+}
+
+
+GLboolean
+intelInitContext(struct intel_context *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);
+ int fthrottle_mode;
+
+ 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;
+
+ if (!lockMutexInit) {
+ lockMutexInit = GL_TRUE;
+ _glthread_INIT_MUTEX(lockMutex);
+ }
+
+ driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
+ intel->driScreen->myNum, "i915");
+
+ ctx->Const.MaxTextureMaxAnisotropy = 2.0;
+
+ /* This doesn't yet catch all non-conformant rendering, but it's a
+ * start.
+ */
+ if (getenv("INTEL_STRICT_CONFORMANCE")) {
+ intel->strict_conformance = 1;
+ }
+
+ 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->Const.MaxColorAttachments = 4; /* XXX FBO: review this */
+
+ /* 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_stipple = 1;
+
+ /* XXX FBO: this doesn't seem to be used anywhere */
+ switch (mesaVis->depthBits) {
+ case 0: /* what to do in this case? */
+ case 16:
+ intel->polygon_offset_scale = 1.0 / 0xffff;
+ break;
+ case 24:
+ intel->polygon_offset_scale = 2.0 / 0xffffff; /* req'd to pass glean */
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ /* Initialize swrast, tnl driver tables: */
+ intelInitSpanFuncs(ctx);
+ intelInitTriFuncs(ctx);
+
+
+ intel->RenderIndex = ~0;
+
+ fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode");
+ intel->iw.irq_seq = -1;
+ intel->irqsEmitted = 0;
+
+ intel->do_irqs = (intel->intelScreen->irq_active &&
+ fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS);
+
+ intel->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
+
+ intel->vblank_flags = (intel->intelScreen->irq_active != 0)
+ ? driGetDefaultVBlankFlags(&intel->optionCache) : VBLANK_FLAG_NO_IRQ;
+
+ (*dri_interface->getUST) (&intel->swap_ust);
+ _math_matrix_ctr(&intel->ViewportMatrix);
+
+ /* Disable imaging extension until convolution is working in
+ * teximage paths:
+ */
+ driInitExtensions(ctx, card_extensions,
+/* GL_TRUE, */
+ GL_FALSE);
+
+
+ intel->batch = intel_batchbuffer_alloc(intel);
+ intel->last_swap_fence = NULL;
+ intel->first_swap_fence = NULL;
+
+ intel_bufferobj_init(intel);
+ intel_fbo_init(intel);
+
+ if (intel->ctx.Mesa_DXTn) {
+ _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
+ _mesa_enable_extension(ctx, "GL_S3_s3tc");
+ }
+ else if (driQueryOptionb(&intel->optionCache, "force_s3tc_enable")) {
+ _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
+ }
+
+ intel->prim.primitive = ~0;
+
+
+#if DO_DEBUG
+ INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
+#endif
+
+ if (getenv("INTEL_NO_RAST")) {
+ fprintf(stderr, "disabling 3D rasterization\n");
+ FALLBACK(intel, INTEL_FALLBACK_USER, 1);
+ }
+
+ return GL_TRUE;
+}
+
+void
+intelDestroyContext(__DRIcontextPrivate * driContextPriv)
+{
+ struct intel_context *intel =
+ (struct intel_context *) driContextPriv->driverPrivate;
+
+ assert(intel); /* should never be null */
+ if (intel) {
+ GLboolean release_texture_heaps;
+
+ INTEL_FIREVERTICES(intel);
+
+ 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 */
+
+ intel_batchbuffer_free(intel->batch);
+
+ if (intel->last_swap_fence) {
+ driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
+ driFenceUnReference(intel->last_swap_fence);
+ intel->last_swap_fence = NULL;
+ }
+ if (intel->first_swap_fence) {
+ driFenceFinish(intel->first_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
+ driFenceUnReference(intel->first_swap_fence);
+ intel->first_swap_fence = NULL;
+ }
+
+
+ if (release_texture_heaps) {
+ /* This share group is about to go away, free our private
+ * texture object data.
+ */
+ if (INTEL_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr, "do something to free texture heaps\n");
+ }
+
+ /* free the Mesa context */
+ _mesa_free_context_data(&intel->ctx);
+ }
+}
+
+GLboolean
+intelUnbindContext(__DRIcontextPrivate * driContextPriv)
+{
+ return GL_TRUE;
+}
+
+GLboolean
+intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
+ __DRIdrawablePrivate * driDrawPriv,
+ __DRIdrawablePrivate * driReadPriv)
+{
+
+ if (driContextPriv) {
+ struct intel_context *intel =
+ (struct intel_context *) driContextPriv->driverPrivate;
+ GLframebuffer *drawFb = (GLframebuffer *) driDrawPriv->driverPrivate;
+ GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate;
+
+
+ /* XXX FBO temporary fix-ups! */
+ /* if the renderbuffers don't have regions, init them from the context */
+ {
+ struct intel_renderbuffer *irbFront
+ = intel_get_renderbuffer(drawFb, BUFFER_FRONT_LEFT);
+ struct intel_renderbuffer *irbBack
+ = intel_get_renderbuffer(drawFb, BUFFER_BACK_LEFT);
+ struct intel_renderbuffer *irbDepth
+ = intel_get_renderbuffer(drawFb, BUFFER_DEPTH);
+ struct intel_renderbuffer *irbStencil
+ = intel_get_renderbuffer(drawFb, BUFFER_STENCIL);
+
+ if (irbFront && !irbFront->region) {
+ intel_region_reference(&irbFront->region, intel->intelScreen->front_region);
+ }
+ if (irbBack && !irbBack->region) {
+ intel_region_reference(&irbBack->region, intel->intelScreen->back_region);
+ }
+ if (irbDepth && !irbDepth->region) {
+ intel_region_reference(&irbDepth->region, intel->intelScreen->depth_region);
+ }
+ if (irbStencil && !irbStencil->region) {
+ intel_region_reference(&irbStencil->region, intel->intelScreen->depth_region);
+ }
+ }
+
+ /* set initial GLframebuffer size to match window, if needed */
+ if (drawFb->Width == 0 && driDrawPriv->w) {
+ _mesa_resize_framebuffer(&intel->ctx, drawFb,
+ driDrawPriv->w, driDrawPriv->h);
+ }
+ if (readFb->Width == 0 && driReadPriv->w) {
+ _mesa_resize_framebuffer(&intel->ctx, readFb,
+ driReadPriv->w, driReadPriv->h);
+ }
+
+ _mesa_make_current(&intel->ctx, drawFb, readFb);
+
+ /* The drawbuffer won't always be updated by _mesa_make_current:
+ */
+ if (intel->ctx.DrawBuffer == drawFb) {
+
+ if (intel->driDrawable != driDrawPriv) {
+ driDrawableInitVBlank(driDrawPriv, intel->vblank_flags, &intel->vbl_seq);
+ intel->driDrawable = driDrawPriv;
+ intelWindowMoved(intel);
+ }
+
+ intel_draw_buffer(&intel->ctx, drawFb);
+ }
+ }
+ else {
+ _mesa_make_current(NULL, NULL, NULL);
+ }
+
+ return GL_TRUE;
+}
+
+static void
+intelContendedLock(struct intel_context *intel, GLuint flags)
+{
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ __DRIscreenPrivate *sPriv = intel->driScreen;
+ intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+ drmI830Sarea *sarea = intel->sarea;
+
+ drmGetLock(intel->driFd, intel->hHWContext, flags);
+
+ if (INTEL_DEBUG & DEBUG_LOCK)
+ _mesa_printf("%s - got contended lock\n", __progname);
+
+ /* 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 (sarea->width != intelScreen->width ||
+ sarea->height != intelScreen->height ||
+ sarea->rotation != intelScreen->current_rotation) {
+
+ intelUpdateScreenRotation(sPriv, sarea);
+
+ /*
+ * This will drop the outstanding batchbuffer on the floor
+ * FIXME: This should be done for all contexts?
+ */
+
+ intel_batchbuffer_reset(intel->batch);
+
+ /* lose all primitives */
+ intel->prim.primitive = ~0;
+ intel->prim.start_ptr = 0;
+ intel->prim.flush = 0;
+
+ /* re-emit all state */
+ intel->vtbl.lost_hardware(intel);
+
+ /* force window update */
+ intel->lastStamp = 0;
+ }
+
+
+ /* Drawable changed?
+ */
+ if (dPriv && intel->lastStamp != dPriv->lastStamp) {
+ intelWindowMoved(intel);
+ intel->lastStamp = dPriv->lastStamp;
+ }
+}
+
+
+/* Lock the hardware and validate our state.
+ */
+void LOCK_HARDWARE( struct intel_context *intel )
+{
+ char __ret=0;
+
+ _glthread_LOCK_MUTEX(lockMutex);
+ assert(!intel->locked);
+
+ if (intel->swap_scheduled) {
+ drmVBlank vbl;
+ vbl.request.type = DRM_VBLANK_ABSOLUTE;
+ if ( intel->vblank_flags & VBLANK_FLAG_SECONDARY ) {
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
+ }
+ vbl.request.sequence = intel->vbl_seq;
+ drmWaitVBlank(intel->driFd, &vbl);
+ intel->swap_scheduled = 0;
+ }
+
+ DRM_CAS(intel->driHwLock, intel->hHWContext,
+ (DRM_LOCK_HELD|intel->hHWContext), __ret);
+
+ if (__ret)
+ intelContendedLock( intel, 0 );
+
+ if (INTEL_DEBUG & DEBUG_LOCK)
+ _mesa_printf("%s - locked\n", __progname);
+
+ intel->locked = 1;
+}
+
+
+ /* Unlock the hardware using the global current context
+ */
+void UNLOCK_HARDWARE( struct intel_context *intel )
+{
+ intel->locked = 0;
+
+ DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext);
+
+ _glthread_UNLOCK_MUTEX(lockMutex);
+
+ if (INTEL_DEBUG & DEBUG_LOCK)
+ _mesa_printf("%s - unlocked\n", __progname);
+}
+
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h
new file mode 100644
index 00000000000..7654e4ecd51
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_context.h
@@ -0,0 +1,502 @@
+/**************************************************************************
+ *
+ * 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 "i915_drm.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)
+
+struct intel_region;
+struct intel_context;
+struct _DriBufferObject;
+
+typedef void (*intel_tri_func) (struct intel_context *, intelVertex *,
+ intelVertex *, intelVertex *);
+typedef void (*intel_line_func) (struct intel_context *, intelVertex *,
+ intelVertex *);
+typedef void (*intel_point_func) (struct intel_context *, intelVertex *);
+
+#define INTEL_FALLBACK_DRAW_BUFFER 0x1
+#define INTEL_FALLBACK_READ_BUFFER 0x2
+#define INTEL_FALLBACK_DEPTH_BUFFER 0x4
+#define INTEL_FALLBACK_STENCIL_BUFFER 0x8
+#define INTEL_FALLBACK_USER 0x10
+#define INTEL_FALLBACK_RENDERMODE 0x20
+
+extern void intelFallback(struct intel_context *intel, GLuint bit,
+ GLboolean mode);
+#define FALLBACK( intel, bit, mode ) intelFallback( intel, bit, mode )
+
+
+#define INTEL_WRITE_PART 0x1
+#define INTEL_WRITE_FULL 0x2
+#define INTEL_READ 0x4
+
+struct intel_texture_object
+{
+ struct gl_texture_object base; /* The "parent" object */
+
+ /* The mipmap tree must include at least these levels once
+ * validated:
+ */
+ GLuint firstLevel;
+ GLuint lastLevel;
+
+ /* Offset for firstLevel image:
+ */
+ GLuint textureOffset;
+
+ /* On validation any active images held in main memory or in other
+ * regions will be copied to this region and the old storage freed.
+ */
+ struct intel_mipmap_tree *mt;
+};
+
+
+
+struct intel_texture_image
+{
+ struct gl_texture_image base;
+
+ /* These aren't stored in gl_texture_image
+ */
+ GLuint level;
+ GLuint face;
+
+ /* If intelImage->mt != NULL, image data is stored here.
+ * Else if intelImage->base.Data != NULL, image is stored there.
+ * Else there is no image data.
+ */
+ struct intel_mipmap_tree *mt;
+};
+
+
+#define INTEL_MAX_FIXUP 64
+
+struct intel_context
+{
+ GLcontext ctx; /* the parent class */
+
+ struct
+ {
+ void (*destroy) (struct intel_context * intel);
+ void (*emit_state) (struct intel_context * intel);
+ void (*lost_hardware) (struct intel_context * intel);
+ void (*update_texture_state) (struct intel_context * intel);
+
+ void (*render_start) (struct intel_context * intel);
+ void (*set_draw_region) (struct intel_context * intel,
+ struct intel_region * draw_region,
+ struct intel_region * depth_region);
+
+ GLuint(*flush_cmd) (void);
+
+ void (*reduced_primitive_state) (struct intel_context * intel,
+ GLenum rprim);
+
+ GLboolean(*check_vertex_size) (struct intel_context * intel,
+ GLuint expected);
+
+
+ /* Metaops:
+ */
+ void (*install_meta_state) (struct intel_context * intel);
+ void (*leave_meta_state) (struct intel_context * intel);
+
+ void (*meta_draw_region) (struct intel_context * intel,
+ struct intel_region * draw_region,
+ struct intel_region * depth_region);
+
+ void (*meta_color_mask) (struct intel_context * intel, GLboolean);
+
+ void (*meta_stencil_replace) (struct intel_context * intel,
+ GLuint mask, GLuint clear);
+
+ void (*meta_depth_replace) (struct intel_context * intel);
+
+ void (*meta_texture_blend_replace) (struct intel_context * intel);
+
+ void (*meta_no_stencil_write) (struct intel_context * intel);
+ void (*meta_no_depth_write) (struct intel_context * intel);
+ void (*meta_no_texture) (struct intel_context * intel);
+
+ void (*meta_import_pixel_state) (struct intel_context * intel);
+
+ GLboolean(*meta_tex_rect_source) (struct intel_context * intel,
+ struct _DriBufferObject * buffer,
+ GLuint offset,
+ GLuint pitch,
+ GLuint height,
+ GLenum format, GLenum type);
+ void (*rotate_window) (struct intel_context * intel,
+ __DRIdrawablePrivate * dPriv, GLuint srcBuf);
+
+ void (*assert_not_dirty) (struct intel_context *intel);
+
+ } vtbl;
+
+ GLint refcount;
+ GLuint Fallback;
+ GLuint NewGLState;
+
+ struct _DriFenceObject *last_swap_fence;
+ struct _DriFenceObject *first_swap_fence;
+
+ struct intel_batchbuffer *batch;
+
+ struct
+ {
+ GLuint id;
+ GLuint primitive;
+ GLubyte *start_ptr;
+ void (*flush) (struct intel_context *);
+ } prim;
+
+ GLboolean locked;
+ char *prevLockFile;
+ int prevLockLine;
+
+ GLuint ClearColor565;
+ GLuint ClearColor8888;
+
+ /* Offsets of fields within the current vertex:
+ */
+ GLuint coloroffset;
+ GLuint specoffset;
+ GLuint wpos_offset;
+ GLuint wpos_size;
+
+ struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
+ GLuint vertex_attr_count;
+
+ GLfloat polygon_offset_scale; /* dependent on depth_scale, bpp */
+
+ GLboolean hw_stipple;
+ GLboolean strict_conformance;
+
+ /* AGP memory buffer manager:
+ */
+ struct bufmgr *bm;
+
+
+ /* State for intelvb.c and inteltris.c.
+ */
+ GLuint RenderIndex;
+ GLmatrix ViewportMatrix;
+ GLenum render_primitive;
+ GLenum reduced_primitive;
+ GLuint vertex_size;
+ GLubyte *verts; /* points to tnl->clipspace.vertex_buf */
+
+#if 0
+ struct intel_region *front_region; /* XXX FBO: obsolete */
+ struct intel_region *rotated_region; /* XXX FBO: obsolete */
+ struct intel_region *back_region; /* XXX FBO: obsolete */
+ struct intel_region *draw_region; /* XXX FBO: rename to color_region */
+ struct intel_region *depth_region; /**< currently bound depth/Z region */
+#endif
+
+ /* Fallback rasterization functions
+ */
+ intel_point_func draw_point;
+ intel_line_func draw_line;
+ intel_tri_func draw_tri;
+
+ /* These refer to the current drawing buffer:
+ */
+ int drawX, drawY; /**< origin of drawing area within region */
+ GLuint numClipRects; /**< cliprects for drawing */
+ drm_clip_rect_t *pClipRects;
+ drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */
+
+ int perf_boxes;
+
+ GLuint do_usleeps;
+ int do_irqs;
+ GLuint irqsEmitted;
+ drm_i915_irq_wait_t iw;
+
+ drm_context_t hHWContext;
+ drmLock *driHwLock;
+ int driFd;
+
+ __DRIdrawablePrivate *driDrawable;
+ __DRIscreenPrivate *driScreen;
+ intelScreenPrivate *intelScreen;
+ drmI830Sarea *sarea;
+
+ GLuint lastStamp;
+
+ /**
+ * Configuration cache
+ */
+ driOptionCache optionCache;
+
+ /* VBI
+ */
+ GLuint vbl_seq;
+ GLuint vblank_flags;
+
+ int64_t swap_ust;
+ int64_t swap_missed_ust;
+
+ GLuint swap_count;
+ GLuint swap_missed_count;
+
+ GLuint swap_scheduled;
+};
+
+/* These are functions now:
+ */
+void LOCK_HARDWARE( struct intel_context *intel );
+void UNLOCK_HARDWARE( struct intel_context *intel );
+
+extern char *__progname;
+
+
+#define SUBPIXEL_X 0.125
+#define SUBPIXEL_Y 0.125
+
+#define INTEL_FIREVERTICES(intel) \
+do { \
+ if ((intel)->prim.flush) \
+ (intel)->prim.flush(intel); \
+} 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)
+
+
+
+/* ================================================================
+ * From linux kernel i386 header files, copes with odd sizes better
+ * than COPY_DWORDS would:
+ * XXX Put this in src/mesa/main/imports.h ???
+ */
+#if defined(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 0
+#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_BLIT 0x8
+#define DEBUG_MIPTREE 0x10
+#define DEBUG_FALLBACKS 0x20
+#define DEBUG_VERBOSE 0x40
+#define DEBUG_BATCH 0x80
+#define DEBUG_PIXEL 0x100
+#define DEBUG_BUFMGR 0x200
+#define DEBUG_REGION 0x400
+#define DEBUG_FBO 0x800
+#define DEBUG_LOCK 0x1000
+
+#define DBG(...) do { if (INTEL_DEBUG & FILE_DEBUG_FLAG) _mesa_printf(__VA_ARGS__); } while(0)
+
+
+#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
+#define PCI_CHIP_I945_GM 0x27A2
+
+
+/* ================================================================
+ * intel_context.c:
+ */
+
+extern GLboolean intelInitContext(struct intel_context *intel,
+ const __GLcontextModes * mesaVis,
+ __DRIcontextPrivate * driContextPriv,
+ void *sharedContextPrivate,
+ struct dd_function_table *functions);
+
+extern void intelGetLock(struct intel_context *intel, GLuint flags);
+
+extern void intelInitState(GLcontext * ctx);
+extern void intelFinish(GLcontext * ctx);
+extern void intelFlush(GLcontext * ctx);
+
+extern void intelInitDriverFunctions(struct dd_function_table *functions);
+
+
+/* ================================================================
+ * 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
+
+#define MI_BATCH_BUFFER_END (0xA<<23)
+
+
+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);
+
+
+/*======================================================================
+ * Inline conversion functions.
+ * These are better-typed than the macros used previously:
+ */
+static INLINE struct intel_context *
+intel_context(GLcontext * ctx)
+{
+ return (struct intel_context *) ctx;
+}
+
+static INLINE struct intel_texture_object *
+intel_texture_object(struct gl_texture_object *obj)
+{
+ return (struct intel_texture_object *) obj;
+}
+
+static INLINE struct intel_texture_image *
+intel_texture_image(struct gl_texture_image *img)
+{
+ return (struct intel_texture_image *) img;
+}
+
+extern struct intel_renderbuffer *intel_renderbuffer(struct gl_renderbuffer
+ *rb);
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_depthstencil.c b/src/mesa/drivers/dri/i915tex/intel_depthstencil.c
new file mode 100644
index 00000000000..d269a85a3c9
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_depthstencil.c
@@ -0,0 +1,282 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 "imports.h"
+#include "context.h"
+#include "depthstencil.h"
+#include "fbobject.h"
+#include "framebuffer.h"
+#include "hash.h"
+#include "mtypes.h"
+#include "renderbuffer.h"
+
+#include "intel_context.h"
+#include "intel_fbo.h"
+#include "intel_depthstencil.h"
+#include "intel_regions.h"
+
+
+/**
+ * The GL_EXT_framebuffer_object allows the user to create their own
+ * framebuffer objects consisting of color renderbuffers (0 or more),
+ * depth renderbuffers (0 or 1) and stencil renderbuffers (0 or 1).
+ *
+ * The spec considers depth and stencil renderbuffers to be totally independent
+ * buffers. In reality, most graphics hardware today uses a combined
+ * depth+stencil buffer (one 32-bit pixel = 24 bits of Z + 8 bits of stencil).
+ *
+ * This causes difficulty because the user may create some number of depth
+ * renderbuffers and some number of stencil renderbuffers and bind them
+ * together in framebuffers in any combination.
+ *
+ * This code manages all that.
+ *
+ * 1. Depth renderbuffers are always allocated in hardware as 32bpp
+ * GL_DEPTH24_STENCIL8 buffers.
+ *
+ * 2. Stencil renderbuffers are initially allocated in software as 8bpp
+ * GL_STENCIL_INDEX8 buffers.
+ *
+ * 3. Depth and Stencil renderbuffers use the PairedStencil and PairedDepth
+ * fields (respectively) to indicate if the buffer's currently paired
+ * with another stencil or depth buffer (respectively).
+ *
+ * 4. When a depth and stencil buffer are initially both attached to the
+ * current framebuffer, we merge the stencil buffer values into the
+ * depth buffer (really a depth+stencil buffer). The then hardware uses
+ * the combined buffer.
+ *
+ * 5. Whenever a depth or stencil buffer is reallocated (with
+ * glRenderbufferStorage) we undo the pairing and copy the stencil values
+ * from the combined depth/stencil buffer back to the stencil-only buffer.
+ *
+ * 6. We also undo the pairing when we find a change in buffer bindings.
+ *
+ * 7. If a framebuffer is only using a depth renderbuffer (no stencil), we
+ * just use the combined depth/stencil buffer and ignore the stencil values.
+ *
+ * 8. If a framebuffer is only using a stencil renderbuffer (no depth) we have
+ * to promote the 8bpp software stencil buffer to a 32bpp hardware
+ * depth+stencil buffer.
+ *
+ */
+
+
+
+static void
+map_regions(GLcontext * ctx,
+ struct intel_renderbuffer *depthRb,
+ struct intel_renderbuffer *stencilRb)
+{
+ struct intel_context *intel = intel_context(ctx);
+ if (depthRb && depthRb->region) {
+ intel_region_map(intel->intelScreen, depthRb->region);
+ depthRb->pfMap = depthRb->region->map;
+ depthRb->pfPitch = depthRb->region->pitch;
+ }
+ if (stencilRb && stencilRb->region) {
+ intel_region_map(intel->intelScreen, stencilRb->region);
+ stencilRb->pfMap = stencilRb->region->map;
+ stencilRb->pfPitch = stencilRb->region->pitch;
+ }
+}
+
+static void
+unmap_regions(GLcontext * ctx,
+ struct intel_renderbuffer *depthRb,
+ struct intel_renderbuffer *stencilRb)
+{
+ struct intel_context *intel = intel_context(ctx);
+ if (depthRb && depthRb->region) {
+ intel_region_unmap(intel->intelScreen, depthRb->region);
+ depthRb->pfMap = NULL;
+ depthRb->pfPitch = 0;
+ }
+ if (stencilRb && stencilRb->region) {
+ intel_region_unmap(intel->intelScreen, stencilRb->region);
+ stencilRb->pfMap = NULL;
+ stencilRb->pfPitch = 0;
+ }
+}
+
+
+
+/**
+ * Undo the pairing/interleaving between depth and stencil buffers.
+ * irb should be a depth/stencil or stencil renderbuffer.
+ */
+void
+intel_unpair_depth_stencil(GLcontext * ctx, struct intel_renderbuffer *irb)
+{
+ if (irb->PairedStencil) {
+ /* irb is a depth/stencil buffer */
+ struct gl_renderbuffer *stencilRb;
+ struct intel_renderbuffer *stencilIrb;
+
+ ASSERT(irb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+
+ stencilRb = _mesa_lookup_renderbuffer(ctx, irb->PairedStencil);
+ stencilIrb = intel_renderbuffer(stencilRb);
+ if (stencilIrb) {
+ /* need to extract stencil values from the depth buffer */
+ ASSERT(stencilIrb->PairedDepth == irb->Base.Name);
+ map_regions(ctx, irb, stencilIrb);
+ _mesa_extract_stencil(ctx, &irb->Base, &stencilIrb->Base);
+ unmap_regions(ctx, irb, stencilIrb);
+ stencilIrb->PairedDepth = 0;
+ }
+ irb->PairedStencil = 0;
+ }
+ else if (irb->PairedDepth) {
+ /* irb is a stencil buffer */
+ struct gl_renderbuffer *depthRb;
+ struct intel_renderbuffer *depthIrb;
+
+ ASSERT(irb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT ||
+ irb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+
+ depthRb = _mesa_lookup_renderbuffer(ctx, irb->PairedDepth);
+ depthIrb = intel_renderbuffer(depthRb);
+ if (depthIrb) {
+ /* need to extract stencil values from the depth buffer */
+ ASSERT(depthIrb->PairedStencil == irb->Base.Name);
+ map_regions(ctx, depthIrb, irb);
+ _mesa_extract_stencil(ctx, &depthIrb->Base, &irb->Base);
+ unmap_regions(ctx, depthIrb, irb);
+ depthIrb->PairedStencil = 0;
+ }
+ irb->PairedDepth = 0;
+ }
+ else {
+ _mesa_problem(ctx, "Problem in undo_depth_stencil_pairing");
+ }
+
+ ASSERT(irb->PairedStencil == 0);
+ ASSERT(irb->PairedDepth == 0);
+}
+
+
+/**
+ * Examine the depth and stencil renderbuffers which are attached to the
+ * framebuffer. If both depth and stencil are attached, make sure that the
+ * renderbuffers are 'paired' (combined). If only depth or only stencil is
+ * attached, undo any previous pairing.
+ *
+ * Must be called if NewState & _NEW_BUFFER (when renderbuffer attachments
+ * change, for example).
+ */
+void
+intel_validate_paired_depth_stencil(GLcontext * ctx,
+ struct gl_framebuffer *fb)
+{
+ struct intel_renderbuffer *depthRb, *stencilRb;
+
+ depthRb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
+ stencilRb = intel_get_renderbuffer(fb, BUFFER_STENCIL);
+
+ if (depthRb && stencilRb) {
+ if (depthRb == stencilRb) {
+ /* Using a user-created combined depth/stencil buffer.
+ * Nothing to do.
+ */
+ ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_STENCIL_EXT);
+ ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+ }
+ else {
+ /* Separate depth/stencil buffers, need to interleave now */
+ ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_COMPONENT);
+ ASSERT(stencilRb->Base._BaseFormat == GL_STENCIL_INDEX);
+ /* may need to interleave depth/stencil now */
+ if (depthRb->PairedStencil == stencilRb->Base.Name) {
+ /* OK, the depth and stencil buffers are already interleaved */
+ ASSERT(stencilRb->PairedDepth == depthRb->Base.Name);
+ }
+ else {
+ /* need to setup new pairing/interleaving */
+ if (depthRb->PairedStencil) {
+ intel_unpair_depth_stencil(ctx, depthRb);
+ }
+ if (stencilRb->PairedDepth) {
+ intel_unpair_depth_stencil(ctx, stencilRb);
+ }
+
+ ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+ ASSERT(stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT ||
+ stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+
+ /* establish new pairing: interleave stencil into depth buffer */
+ map_regions(ctx, depthRb, stencilRb);
+ _mesa_insert_stencil(ctx, &depthRb->Base, &stencilRb->Base);
+ unmap_regions(ctx, depthRb, stencilRb);
+ depthRb->PairedStencil = stencilRb->Base.Name;
+ stencilRb->PairedDepth = depthRb->Base.Name;
+ }
+
+ }
+ }
+ else if (depthRb) {
+ /* Depth buffer but no stencil buffer.
+ * We'll use a GL_DEPTH24_STENCIL8 buffer and ignore the stencil bits.
+ */
+ /* can't assert this until storage is allocated:
+ ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+ */
+ /* intel_undo any previous pairing */
+ if (depthRb->PairedStencil) {
+ intel_unpair_depth_stencil(ctx, depthRb);
+ }
+ }
+ else if (stencilRb) {
+ /* Stencil buffer but no depth buffer.
+ * Since h/w doesn't typically support just 8bpp stencil w/out Z,
+ * we'll use a GL_DEPTH24_STENCIL8 buffer and ignore the depth bits.
+ */
+ /* undo any previous pairing */
+ if (stencilRb->PairedDepth) {
+ intel_unpair_depth_stencil(ctx, stencilRb);
+ }
+ if (stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT) {
+ /* promote buffer to GL_DEPTH24_STENCIL8 for hw rendering */
+ _mesa_promote_stencil(ctx, &stencilRb->Base);
+ ASSERT(stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
+ }
+ }
+
+ /* Finally, update the fb->_DepthBuffer and fb->_StencilBuffer fields */
+ _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
+ if (depthRb && depthRb->PairedStencil)
+ _mesa_update_stencil_buffer(ctx, fb, BUFFER_DEPTH);
+ else
+ _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
+
+
+ /* The hardware should use fb->Attachment[BUFFER_DEPTH].Renderbuffer
+ * first, if present, then fb->Attachment[BUFFER_STENCIL].Renderbuffer
+ * if present.
+ */
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_depthstencil.h b/src/mesa/drivers/dri/i915tex/intel_depthstencil.h
new file mode 100644
index 00000000000..2d3fc48b3a3
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_depthstencil.h
@@ -0,0 +1,14 @@
+
+#ifndef INTEL_DEPTH_STENCIL_H
+#define INTEL_DEPTH_STENCIL_H
+
+
+extern void
+intel_unpair_depth_stencil(GLcontext * ctx, struct intel_renderbuffer *irb);
+
+extern void
+intel_validate_paired_depth_stencil(GLcontext * ctx,
+ struct gl_framebuffer *fb);
+
+
+#endif /* INTEL_DEPTH_STENCIL_H */
diff --git a/src/mesa/drivers/dri/i915tex/intel_fbo.c b/src/mesa/drivers/dri/i915tex/intel_fbo.c
new file mode 100644
index 00000000000..ab0e569bd94
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_fbo.c
@@ -0,0 +1,622 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 "imports.h"
+#include "mtypes.h"
+#include "fbobject.h"
+#include "framebuffer.h"
+#include "renderbuffer.h"
+#include "context.h"
+#include "texformat.h"
+#include "texrender.h"
+
+#include "intel_context.h"
+#include "intel_buffers.h"
+#include "intel_depthstencil.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_span.h"
+
+
+#define FILE_DEBUG_FLAG DEBUG_FBO
+
+#define INTEL_RB_CLASS 0x12345678
+
+
+/* XXX FBO: move this to intel_context.h (inlined) */
+/**
+ * Return a gl_renderbuffer ptr casted to intel_renderbuffer.
+ * NULL will be returned if the rb isn't really an intel_renderbuffer.
+ * This is determiend by checking the ClassID.
+ */
+struct intel_renderbuffer *
+intel_renderbuffer(struct gl_renderbuffer *rb)
+{
+ struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb;
+ if (irb && irb->Base.ClassID == INTEL_RB_CLASS) {
+ /*_mesa_warning(NULL, "Returning non-intel Rb\n");*/
+ return irb;
+ }
+ else
+ return NULL;
+}
+
+
+struct intel_renderbuffer *
+intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex)
+{
+ return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
+}
+
+
+struct intel_region *
+intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
+{
+ struct intel_renderbuffer *irb
+ = intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
+ if (irb)
+ return irb->region;
+ else
+ return NULL;
+}
+
+
+
+/**
+ * Create a new framebuffer object.
+ */
+static struct gl_framebuffer *
+intel_new_framebuffer(GLcontext * ctx, GLuint name)
+{
+ /* there's no intel_framebuffer at this time, just use Mesa's class */
+ return _mesa_new_framebuffer(ctx, name);
+}
+
+
+static void
+intel_delete_renderbuffer(struct gl_renderbuffer *rb)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+
+ ASSERT(irb);
+
+ if (irb->PairedStencil || irb->PairedDepth) {
+ intel_unpair_depth_stencil(ctx, irb);
+ }
+
+ if (intel && irb->region) {
+ intel_region_release(&irb->region);
+ }
+
+ _mesa_free(irb);
+}
+
+
+
+/**
+ * Return a pointer to a specific pixel in a renderbuffer.
+ */
+static void *
+intel_get_pointer(GLcontext * ctx, struct gl_renderbuffer *rb,
+ GLint x, GLint y)
+{
+ /* By returning NULL we force all software rendering to go through
+ * the span routines.
+ */
+ return NULL;
+}
+
+
+
+/**
+ * Called via glRenderbufferStorageEXT() to set the format and allocate
+ * storage for a user-created renderbuffer.
+ */
+static GLboolean
+intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width, GLuint height)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+ GLboolean softwareBuffer = GL_FALSE;
+ int cpp;
+
+ ASSERT(rb->Name != 0);
+
+ switch (internalFormat) {
+ case GL_R3_G3_B2:
+ case GL_RGB4:
+ case GL_RGB5:
+ rb->_ActualFormat = GL_RGB5;
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->RedBits = 5;
+ rb->GreenBits = 6;
+ rb->BlueBits = 5;
+ cpp = 2;
+ break;
+ case GL_RGB:
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ case GL_RGBA:
+ case GL_RGBA2:
+ case GL_RGBA4:
+ case GL_RGB5_A1:
+ case GL_RGBA8:
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+ case GL_RGBA16:
+ rb->_ActualFormat = GL_RGBA8;
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->RedBits = 8;
+ rb->GreenBits = 8;
+ rb->BlueBits = 8;
+ rb->AlphaBits = 8;
+ cpp = 4;
+ break;
+ case GL_STENCIL_INDEX:
+ case GL_STENCIL_INDEX1_EXT:
+ case GL_STENCIL_INDEX4_EXT:
+ case GL_STENCIL_INDEX8_EXT:
+ case GL_STENCIL_INDEX16_EXT:
+ /* alloc a depth+stencil buffer */
+ rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT;
+ rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
+ rb->StencilBits = 8;
+ cpp = 4;
+ break;
+ case GL_DEPTH_COMPONENT16:
+ rb->_ActualFormat = GL_DEPTH_COMPONENT16;
+ rb->DataType = GL_UNSIGNED_SHORT;
+ rb->DepthBits = 16;
+ cpp = 2;
+ break;
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
+ rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT;
+ rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
+ rb->DepthBits = 24;
+ cpp = 4;
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT;
+ rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
+ rb->DepthBits = 24;
+ rb->StencilBits = 8;
+ cpp = 4;
+ break;
+ default:
+ _mesa_problem(ctx,
+ "Unexpected format in intel_alloc_renderbuffer_storage");
+ return GL_FALSE;
+ }
+
+ intelFlush(ctx);
+
+ /* free old region */
+ if (irb->region) {
+ intel_region_release(&irb->region);
+ }
+
+ /* allocate new memory region/renderbuffer */
+ if (softwareBuffer) {
+ return _mesa_soft_renderbuffer_storage(ctx, rb, internalFormat,
+ width, height);
+ }
+ else {
+ /* Choose a pitch to match hardware requirements:
+ */
+ GLuint pitch = ((cpp * width + 63) & ~63) / cpp;
+
+ /* alloc hardware renderbuffer */
+ DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width,
+ height, pitch);
+
+ irb->region = intel_region_alloc(intel->intelScreen, cpp, pitch, height);
+ if (!irb->region)
+ return GL_FALSE; /* out of memory? */
+
+ ASSERT(irb->region->buffer);
+
+ rb->Width = width;
+ rb->Height = height;
+
+ /* This sets the Get/PutRow/Value functions */
+ intel_set_span_functions(&irb->Base);
+
+ return GL_TRUE;
+ }
+}
+
+
+
+/**
+ * Called for each hardware renderbuffer when a _window_ is resized.
+ * Just update fields.
+ * Not used for user-created renderbuffers!
+ */
+static GLboolean
+intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ ASSERT(rb->Name == 0);
+ rb->Width = width;
+ rb->Height = height;
+ rb->_ActualFormat = internalFormat;
+ return GL_TRUE;
+}
+
+
+static GLboolean
+intel_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ _mesa_problem(ctx, "intel_op_alloc_storage should never be called.");
+ return GL_FALSE;
+}
+
+
+
+/**
+ * Create a new intel_renderbuffer which corresponds to an on-screen window,
+ * not a user-created renderbuffer.
+ * \param width the screen width
+ * \param height the screen height
+ */
+struct intel_renderbuffer *
+intel_create_renderbuffer(GLenum intFormat, GLsizei width, GLsizei height,
+ int offset, int pitch, int cpp, void *map)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct intel_renderbuffer *irb;
+ const GLuint name = 0;
+
+ irb = CALLOC_STRUCT(intel_renderbuffer);
+ if (!irb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
+ return NULL;
+ }
+
+ _mesa_init_renderbuffer(&irb->Base, name);
+ irb->Base.ClassID = INTEL_RB_CLASS;
+
+ switch (intFormat) {
+ case GL_RGB5:
+ irb->Base._ActualFormat = GL_RGB5;
+ irb->Base._BaseFormat = GL_RGBA;
+ irb->Base.RedBits = 5;
+ irb->Base.GreenBits = 6;
+ irb->Base.BlueBits = 5;
+ irb->Base.DataType = GL_UNSIGNED_BYTE;
+ cpp = 2;
+ break;
+ case GL_RGBA8:
+ irb->Base._ActualFormat = GL_RGBA8;
+ irb->Base._BaseFormat = GL_RGBA;
+ irb->Base.RedBits = 8;
+ irb->Base.GreenBits = 8;
+ irb->Base.BlueBits = 8;
+ irb->Base.AlphaBits = 8;
+ irb->Base.DataType = GL_UNSIGNED_BYTE;
+ cpp = 4;
+ break;
+ case GL_STENCIL_INDEX8_EXT:
+ irb->Base._ActualFormat = GL_STENCIL_INDEX8_EXT;
+ irb->Base._BaseFormat = GL_STENCIL_INDEX;
+ irb->Base.StencilBits = 8;
+ irb->Base.DataType = GL_UNSIGNED_BYTE;
+ cpp = 1;
+ break;
+ case GL_DEPTH_COMPONENT16:
+ irb->Base._ActualFormat = GL_DEPTH_COMPONENT16;
+ irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ irb->Base.DepthBits = 16;
+ irb->Base.DataType = GL_UNSIGNED_SHORT;
+ cpp = 2;
+ break;
+ case GL_DEPTH_COMPONENT24:
+ irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT;
+ irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ irb->Base.DepthBits = 24;
+ irb->Base.DataType = GL_UNSIGNED_INT;
+ cpp = 4;
+ break;
+ case GL_DEPTH24_STENCIL8_EXT:
+ irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT;
+ irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT;
+ irb->Base.DepthBits = 24;
+ irb->Base.StencilBits = 8;
+ irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
+ cpp = 4;
+ break;
+ default:
+ _mesa_problem(NULL,
+ "Unexpected intFormat in intel_create_renderbuffer");
+ return NULL;
+ }
+
+ irb->Base.InternalFormat = intFormat;
+
+ /* intel-specific methods */
+ irb->Base.Delete = intel_delete_renderbuffer;
+ irb->Base.AllocStorage = intel_alloc_window_storage;
+ irb->Base.GetPointer = intel_get_pointer;
+ /* This sets the Get/PutRow/Value functions */
+ intel_set_span_functions(&irb->Base);
+
+ irb->pfMap = map;
+ irb->pfPitch = pitch / cpp; /* in pixels */
+
+#if 00
+ irb->region = intel_region_create_static(intel,
+ DRM_MM_TT,
+ offset, map, cpp, width, height);
+#endif
+
+ return irb;
+}
+
+
+/**
+ * Create a new renderbuffer object.
+ * Typically called via glBindRenderbufferEXT().
+ */
+static struct gl_renderbuffer *
+intel_new_renderbuffer(GLcontext * ctx, GLuint name)
+{
+ /*struct intel_context *intel = intel_context(ctx); */
+ struct intel_renderbuffer *irb;
+
+ irb = CALLOC_STRUCT(intel_renderbuffer);
+ if (!irb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
+ return NULL;
+ }
+
+ _mesa_init_renderbuffer(&irb->Base, name);
+ irb->Base.ClassID = INTEL_RB_CLASS;
+
+ /* intel-specific methods */
+ irb->Base.Delete = intel_delete_renderbuffer;
+ irb->Base.AllocStorage = intel_alloc_renderbuffer_storage;
+ irb->Base.GetPointer = intel_get_pointer;
+ /* span routines set in alloc_storage function */
+
+ return &irb->Base;
+}
+
+
+/**
+ * Called via glBindFramebufferEXT().
+ */
+static void
+intel_bind_framebuffer(GLcontext * ctx, GLenum target,
+ struct gl_framebuffer *fb)
+{
+ if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
+ intel_draw_buffer(ctx, fb);
+ /* Integer depth range depends on depth buffer bits */
+ ctx->Driver.DepthRange(ctx, ctx->Viewport.Near, ctx->Viewport.Far);
+ }
+ else {
+ /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
+ }
+}
+
+
+/**
+ * Called via glFramebufferRenderbufferEXT().
+ */
+static void
+intel_framebuffer_renderbuffer(GLcontext * ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment, struct gl_renderbuffer *rb)
+{
+ DBG("Intel FramebufferRenderbuffer %u %u\n", fb->Name, rb ? rb->Name : 0);
+
+ intelFlush(ctx);
+
+ _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
+ intel_draw_buffer(ctx, fb);
+}
+
+
+/**
+ * When glFramebufferTexture[123]D is called this function sets up the
+ * gl_renderbuffer wrapp around the texture image.
+ * This will have the region info needed for hardware rendering.
+ */
+static struct intel_renderbuffer *
+intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage)
+{
+ const GLuint name = ~0; /* not significant, but distinct for debugging */
+ struct intel_renderbuffer *irb;
+
+ /* make an intel_renderbuffer to wrap the texture image */
+ irb = CALLOC_STRUCT(intel_renderbuffer);
+ if (!irb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture");
+ return NULL;
+ }
+
+ _mesa_init_renderbuffer(&irb->Base, name);
+ irb->Base.ClassID = INTEL_RB_CLASS;
+
+ if (texImage->TexFormat == &_mesa_texformat_argb8888) {
+ irb->Base._ActualFormat = GL_RGBA8;
+ irb->Base._BaseFormat = GL_RGBA;
+ DBG("Render to RGBA8 texture OK\n");
+ }
+ else if (texImage->TexFormat == &_mesa_texformat_rgb565) {
+ irb->Base._ActualFormat = GL_RGB5;
+ irb->Base._BaseFormat = GL_RGB;
+ DBG("Render to RGB5 texture OK\n");
+ }
+ else if (texImage->TexFormat == &_mesa_texformat_z16) {
+ irb->Base._ActualFormat = GL_DEPTH_COMPONENT16;
+ irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ DBG("Render to DEPTH16 texture OK\n");
+ }
+ else {
+ DBG("Render to texture BAD FORMAT %d\n",
+ texImage->TexFormat->MesaFormat);
+ _mesa_free(irb);
+ return NULL;
+ }
+
+ irb->Base.InternalFormat = irb->Base._ActualFormat;
+ irb->Base.Width = texImage->Width;
+ irb->Base.Height = texImage->Height;
+ irb->Base.DataType = GL_UNSIGNED_BYTE; /* FBO XXX fix */
+ irb->Base.RedBits = texImage->TexFormat->RedBits;
+ irb->Base.GreenBits = texImage->TexFormat->GreenBits;
+ irb->Base.BlueBits = texImage->TexFormat->BlueBits;
+ irb->Base.AlphaBits = texImage->TexFormat->AlphaBits;
+ irb->Base.DepthBits = texImage->TexFormat->DepthBits;
+
+ irb->Base.Delete = intel_delete_renderbuffer;
+ irb->Base.AllocStorage = intel_nop_alloc_storage;
+ intel_set_span_functions(&irb->Base);
+
+ irb->RenderToTexture = GL_TRUE;
+
+ return irb;
+}
+
+
+/**
+ * Called by glFramebufferTexture[123]DEXT() (and other places) to
+ * prepare for rendering into texture memory. This might be called
+ * many times to choose different texture levels, cube faces, etc
+ * before intel_finish_render_texture() is ever called.
+ */
+static void
+intel_render_texture(GLcontext * ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct gl_texture_image *newImage
+ = att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+ struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
+ struct intel_texture_image *intel_image;
+ GLuint imageOffset;
+
+ (void) fb;
+
+ ASSERT(newImage);
+
+ if (!irb) {
+ irb = intel_wrap_texture(ctx, newImage);
+ if (irb) {
+ /* bind the wrapper to the attachment point */
+ att->Renderbuffer = &irb->Base;
+ }
+ else {
+ /* fallback to software rendering */
+ _mesa_render_texture(ctx, fb, att);
+ return;
+ }
+ }
+
+ DBG("Begin render texture tid %x tex=%u w=%d h=%d refcount=%d\n",
+ _glthread_GetID(),
+ att->Texture->Name, newImage->Width, newImage->Height,
+ irb->Base.RefCount);
+
+ /* point the renderbufer's region to the texture image region */
+ intel_image = intel_texture_image(newImage);
+ if (irb->region != intel_image->mt->region) {
+ if (irb->region)
+ intel_region_release(&irb->region);
+ intel_region_reference(&irb->region, intel_image->mt->region);
+ }
+
+ /* compute offset of the particular 2D image within the texture region */
+ imageOffset = intel_miptree_image_offset(intel_image->mt,
+ att->CubeMapFace,
+ att->TextureLevel);
+
+ if (att->Texture->Target == GL_TEXTURE_3D) {
+ const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt,
+ att->TextureLevel);
+ imageOffset += offsets[att->Zoffset];
+ }
+
+ /* store that offset in the region */
+ intel_image->mt->region->draw_offset = imageOffset;
+
+ /* update drawing region, etc */
+ intel_draw_buffer(ctx, fb);
+}
+
+
+/**
+ * Called by Mesa when rendering to a texture is done.
+ */
+static void
+intel_finish_render_texture(GLcontext * ctx,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
+
+ DBG("End render texture (tid %x) tex %u\n", _glthread_GetID(), att->Texture->Name);
+
+ if (irb) {
+ /* just release the region */
+ intel_region_release(&irb->region);
+ }
+ else if (att->Renderbuffer) {
+ /* software fallback */
+ _mesa_finish_render_texture(ctx, att);
+ /* XXX FBO: Need to unmap the buffer (or in intelSpanRenderStart???) */
+ }
+}
+
+
+/**
+ * Do one-time context initializations related to GL_EXT_framebuffer_object.
+ * Hook in device driver functions.
+ */
+void
+intel_fbo_init(struct intel_context *intel)
+{
+ intel->ctx.Driver.NewFramebuffer = intel_new_framebuffer;
+ intel->ctx.Driver.NewRenderbuffer = intel_new_renderbuffer;
+ intel->ctx.Driver.BindFramebuffer = intel_bind_framebuffer;
+ intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer;
+ intel->ctx.Driver.RenderTexture = intel_render_texture;
+ intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_fbo.h b/src/mesa/drivers/dri/i915tex/intel_fbo.h
new file mode 100644
index 00000000000..221f09b39ab
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_fbo.h
@@ -0,0 +1,80 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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_FBO_H
+#define INTEL_FBO_H
+
+
+struct intel_context;
+struct intel_region;
+
+
+/**
+ * Intel renderbuffer, derived from gl_renderbuffer.
+ * Note: The PairedDepth and PairedStencil fields use renderbuffer IDs,
+ * not pointers because in some circumstances a deleted renderbuffer could
+ * result in a dangling pointer here.
+ */
+struct intel_renderbuffer
+{
+ struct gl_renderbuffer Base;
+ struct intel_region *region;
+ void *pfMap; /* possibly paged flipped map pointer */
+ GLuint pfPitch; /* possibly paged flipped pitch */
+ GLboolean RenderToTexture; /* RTT? */
+
+ GLuint PairedDepth; /**< only used if this is a depth renderbuffer */
+ GLuint PairedStencil; /**< only used if this is a stencil renderbuffer */
+};
+
+
+extern struct intel_renderbuffer *intel_create_renderbuffer(GLenum intFormat,
+ GLsizei width,
+ GLsizei height,
+ int offset,
+ int pitch,
+ int cpp,
+ void *map);
+
+
+extern void intel_fbo_init(struct intel_context *intel);
+
+
+/* XXX make inline or macro */
+extern struct intel_renderbuffer *intel_get_renderbuffer(struct gl_framebuffer
+ *fb,
+ GLuint attIndex);
+
+
+/* XXX make inline or macro */
+extern struct intel_region *intel_get_rb_region(struct gl_framebuffer *fb,
+ GLuint attIndex);
+
+
+
+
+#endif /* INTEL_FBO_H */
diff --git a/src/mesa/drivers/dri/i915tex/intel_ioctl.c b/src/mesa/drivers/dri/i915tex/intel_ioctl.c
new file mode 100644
index 00000000000..3250c6b3a9c
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_ioctl.c
@@ -0,0 +1,138 @@
+/**************************************************************************
+ *
+ * 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 "intel_blit.h"
+#include "intel_regions.h"
+#include "drm.h"
+
+#define FILE_DEBUG_FLAG DEBUG_IOCTL
+
+int
+intelEmitIrqLocked(struct intel_context *intel)
+{
+ drmI830IrqEmit ie;
+ int ret, seq;
+
+ 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);
+ }
+
+ DBG("%s --> %d\n", __FUNCTION__, seq);
+
+ return seq;
+}
+
+void
+intelWaitIrq(struct intel_context *intel, int seq)
+{
+ int ret;
+
+ DBG("%s %d\n", __FUNCTION__, seq);
+
+ intel->iw.irq_seq = seq;
+
+ do {
+ ret =
+ drmCommandWrite(intel->driFd, DRM_I830_IRQ_WAIT, &intel->iw,
+ sizeof(intel->iw));
+ } while (ret == -EAGAIN || ret == -EINTR);
+
+ if (ret) {
+ fprintf(stderr, "%s: drmI830IrqWait: %d\n", __FUNCTION__, ret);
+ exit(1);
+ }
+}
+
+
+void
+intel_batch_ioctl(struct intel_context *intel,
+ GLuint start_offset,
+ GLuint used,
+ GLboolean ignore_cliprects, GLboolean allow_unlock)
+{
+ drmI830BatchBuffer batch;
+
+ assert(intel->locked);
+ assert(used);
+
+ DBG("%s used %d offset %x..%x ignore_cliprects %d\n",
+ __FUNCTION__,
+ used, start_offset, start_offset + used, ignore_cliprects);
+
+ /* Throw away non-effective packets. Won't work once we have
+ * hardware contexts which would preserve statechanges beyond a
+ * single buffer.
+ */
+
+
+
+ batch.start = start_offset;
+ batch.used = used;
+ 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));
+
+ DBG("%s: 0x%x..0x%x DR4: %x cliprects: %d\n",
+ __FUNCTION__,
+ batch.start,
+ batch.start + batch.used * 4, batch.DR4, batch.num_cliprects);
+
+ if (drmCommandWrite(intel->driFd, DRM_I830_BATCHBUFFER, &batch,
+ sizeof(batch))) {
+ fprintf(stderr, "DRM_I830_BATCHBUFFER: %d\n", -errno);
+ UNLOCK_HARDWARE(intel);
+ exit(1);
+ }
+
+ /* FIXME: use hardware contexts to avoid 'losing' hardware after
+ * each buffer flush.
+ */
+ intel->vtbl.lost_hardware(intel);
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_ioctl.h b/src/mesa/drivers/dri/i915tex/intel_ioctl.h
new file mode 100644
index 00000000000..e8d07de893e
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_ioctl.h
@@ -0,0 +1,40 @@
+/**************************************************************************
+ *
+ * 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"
+
+void intelWaitIrq(struct intel_context *intel, int seq);
+int intelEmitIrqLocked(struct intel_context *intel);
+
+void intel_batch_ioctl(struct intel_context *intel,
+ GLuint start_offset,
+ GLuint used,
+ GLboolean ignore_cliprects, GLboolean allow_unlock);
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
new file mode 100644
index 00000000000..2b1077aee0d
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
@@ -0,0 +1,347 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "enums.h"
+
+#define FILE_DEBUG_FLAG DEBUG_MIPTREE
+
+static GLenum
+target_to_target(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ return GL_TEXTURE_CUBE_MAP_ARB;
+ default:
+ return target;
+ }
+}
+
+struct intel_mipmap_tree *
+intel_miptree_create(struct intel_context *intel,
+ GLenum target,
+ GLenum internal_format,
+ GLuint first_level,
+ GLuint last_level,
+ GLuint width0,
+ GLuint height0,
+ GLuint depth0, GLuint cpp, GLuint compress_byte)
+{
+ GLboolean ok;
+ struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
+
+ DBG("%s target %s format %s level %d..%d\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(internal_format), first_level, last_level);
+
+ mt->target = target_to_target(target);
+ mt->internal_format = internal_format;
+ mt->first_level = first_level;
+ mt->last_level = last_level;
+ mt->width0 = width0;
+ mt->height0 = height0;
+ mt->depth0 = depth0;
+ mt->cpp = compress_byte ? compress_byte : cpp;
+ mt->compressed = compress_byte ? 1 : 0;
+ mt->refcount = 1;
+
+ switch (intel->intelScreen->deviceID) {
+ case PCI_CHIP_I945_G:
+ case PCI_CHIP_I945_GM:
+ ok = i945_miptree_layout(mt);
+ break;
+ case PCI_CHIP_I915_G:
+ case PCI_CHIP_I915_GM:
+ case PCI_CHIP_I830_M:
+ case PCI_CHIP_I855_GM:
+ case PCI_CHIP_I865_G:
+ default:
+ /* All the i830 chips and the i915 use this layout:
+ */
+ ok = i915_miptree_layout(mt);
+ break;
+ }
+
+ if (ok)
+ mt->region = intel_region_alloc(intel->intelScreen,
+ mt->cpp, mt->pitch, mt->total_height);
+
+ if (!mt->region) {
+ free(mt);
+ return NULL;
+ }
+
+ return mt;
+}
+
+
+void
+intel_miptree_reference(struct intel_mipmap_tree **dst,
+ struct intel_mipmap_tree *src)
+{
+ src->refcount++;
+ *dst = src;
+ DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount);
+}
+
+void
+intel_miptree_release(struct intel_context *intel,
+ struct intel_mipmap_tree **mt)
+{
+ if (!*mt)
+ return;
+
+ DBG("%s %p refcount will be %d\n", __FUNCTION__, *mt, (*mt)->refcount - 1);
+ if (--(*mt)->refcount <= 0) {
+ GLuint i;
+
+ DBG("%s deleting %p\n", __FUNCTION__, *mt);
+
+ intel_region_release(&((*mt)->region));
+
+ for (i = 0; i < MAX_TEXTURE_LEVELS; i++)
+ if ((*mt)->level[i].image_offset)
+ free((*mt)->level[i].image_offset);
+
+ free(*mt);
+ }
+ *mt = NULL;
+}
+
+
+
+
+/* Can the image be pulled into a unified mipmap tree. This mirrors
+ * the completeness test in a lot of ways.
+ *
+ * Not sure whether I want to pass gl_texture_image here.
+ */
+GLboolean
+intel_miptree_match_image(struct intel_mipmap_tree *mt,
+ struct gl_texture_image *image,
+ GLuint face, GLuint level)
+{
+ /* Images with borders are never pulled into mipmap trees.
+ */
+ if (image->Border)
+ return GL_FALSE;
+
+ if (image->InternalFormat != mt->internal_format ||
+ image->IsCompressed != mt->compressed)
+ return GL_FALSE;
+
+ /* Test image dimensions against the base level image adjusted for
+ * minification. This will also catch images not present in the
+ * tree, changed targets, etc.
+ */
+ if (image->Width != mt->level[level].width ||
+ image->Height != mt->level[level].height ||
+ image->Depth != mt->level[level].depth)
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+
+void
+intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
+ GLuint level,
+ GLuint nr_images,
+ GLuint x, GLuint y, GLuint w, GLuint h, GLuint d)
+{
+
+ mt->level[level].width = w;
+ mt->level[level].height = h;
+ mt->level[level].depth = d;
+ mt->level[level].level_offset = (x + y * mt->pitch) * mt->cpp;
+ mt->level[level].nr_images = nr_images;
+
+ DBG("%s level %d size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__,
+ level, w, h, d, x, y, mt->level[level].level_offset);
+
+ /* Not sure when this would happen, but anyway:
+ */
+ if (mt->level[level].image_offset) {
+ free(mt->level[level].image_offset);
+ mt->level[level].image_offset = NULL;
+ }
+
+ assert(nr_images);
+
+ mt->level[level].image_offset = malloc(nr_images * sizeof(GLuint));
+ mt->level[level].image_offset[0] = 0;
+}
+
+
+
+void
+intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
+ GLuint level, GLuint img, GLuint x, GLuint y)
+{
+ if (img == 0 && level == 0)
+ assert(x == 0 && y == 0);
+
+ assert(img < mt->level[level].nr_images);
+
+ mt->level[level].image_offset[img] = (x + y * mt->pitch);
+
+ DBG("%s level %d img %d pos %d,%d image_offset %x\n",
+ __FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]);
+}
+
+
+/* Although we use the image_offset[] array to store relative offsets
+ * to cube faces, Mesa doesn't know anything about this and expects
+ * each cube face to be treated as a separate image.
+ *
+ * These functions present that view to mesa:
+ */
+const GLuint *
+intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, GLuint level)
+{
+ static const GLuint zero = 0;
+
+ if (mt->target != GL_TEXTURE_3D || mt->level[level].nr_images == 1)
+ return &zero;
+ else
+ return mt->level[level].image_offset;
+}
+
+
+GLuint
+intel_miptree_image_offset(struct intel_mipmap_tree * mt,
+ GLuint face, GLuint level)
+{
+ if (mt->target == GL_TEXTURE_CUBE_MAP_ARB)
+ return (mt->level[level].level_offset +
+ mt->level[level].image_offset[face] * mt->cpp);
+ else
+ return mt->level[level].level_offset;
+}
+
+
+
+/**
+ * Map a teximage in a mipmap tree.
+ * \param row_stride returns row stride in bytes
+ * \param image_stride returns image stride in bytes (for 3D textures).
+ * \return address of mapping
+ */
+GLubyte *
+intel_miptree_image_map(struct intel_context * intel,
+ struct intel_mipmap_tree * mt,
+ GLuint face,
+ GLuint level,
+ GLuint * row_stride, GLuint * image_offsets)
+{
+ DBG("%s \n", __FUNCTION__);
+
+ if (row_stride)
+ *row_stride = mt->pitch * mt->cpp;
+
+ if (image_offsets)
+ memcpy(image_offsets, mt->level[level].image_offset,
+ mt->level[level].depth * sizeof(GLuint));
+
+ return (intel_region_map(intel->intelScreen, mt->region) +
+ intel_miptree_image_offset(mt, face, level));
+}
+
+void
+intel_miptree_image_unmap(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ DBG("%s\n", __FUNCTION__);
+ intel_region_unmap(intel->intelScreen, mt->region);
+}
+
+
+
+/* Upload data for a particular image.
+ */
+void
+intel_miptree_image_data(struct intel_context *intel,
+ struct intel_mipmap_tree *dst,
+ GLuint face,
+ GLuint level,
+ void *src,
+ GLuint src_row_pitch, GLuint src_image_pitch)
+{
+ GLuint depth = dst->level[level].depth;
+ GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
+ const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level);
+ GLuint i;
+ GLuint height = 0;
+
+ DBG("%s\n", __FUNCTION__);
+ for (i = 0; i < depth; i++) {
+ height = dst->level[level].height;
+ if(dst->compressed)
+ height /= 4;
+ intel_region_data(intel->intelScreen, dst->region, dst_offset + dst_depth_offset[i], 0, 0, src, src_row_pitch, 0, 0, /* source x,y */
+ dst->level[level].width, height);
+
+ src += src_image_pitch;
+ }
+}
+
+/* Copy mipmap image between trees
+ */
+void
+intel_miptree_image_copy(struct intel_context *intel,
+ struct intel_mipmap_tree *dst,
+ GLuint face, GLuint level,
+ struct intel_mipmap_tree *src)
+{
+ GLuint width = src->level[level].width;
+ GLuint height = src->level[level].height;
+ GLuint depth = src->level[level].depth;
+ GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
+ GLuint src_offset = intel_miptree_image_offset(src, face, level);
+ const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level);
+ const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level);
+ GLuint i;
+
+ if (dst->compressed)
+ height /= 4;
+ for (i = 0; i < depth; i++) {
+ intel_region_copy(intel->intelScreen,
+ dst->region, dst_offset + dst_depth_offset[i],
+ 0,
+ 0,
+ src->region, src_offset + src_depth_offset[i],
+ 0, 0, width, height);
+ }
+
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h
new file mode 100644
index 00000000000..ecdb7be244f
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h
@@ -0,0 +1,198 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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_MIPMAP_TREE_H
+#define INTEL_MIPMAP_TREE_H
+
+#include "intel_regions.h"
+
+/* A layer on top of the intel_regions code which adds:
+ *
+ * - Code to size and layout a region to hold a set of mipmaps.
+ * - Query to determine if a new image fits in an existing tree.
+ * - More refcounting
+ * - maybe able to remove refcounting from intel_region?
+ * - ?
+ *
+ * The fixed mipmap layout of intel hardware where one offset
+ * specifies the position of all images in a mipmap hierachy
+ * complicates the implementation of GL texture image commands,
+ * compared to hardware where each image is specified with an
+ * independent offset.
+ *
+ * In an ideal world, each texture object would be associated with a
+ * single bufmgr buffer or 2d intel_region, and all the images within
+ * the texture object would slot into the tree as they arrive. The
+ * reality can be a little messier, as images can arrive from the user
+ * with sizes that don't fit in the existing tree, or in an order
+ * where the tree layout cannot be guessed immediately.
+ *
+ * This structure encodes an idealized mipmap tree. The GL image
+ * commands build these where possible, otherwise store the images in
+ * temporary system buffers.
+ */
+
+
+/**
+ * Describes the location of each texture image within a texture region.
+ */
+struct intel_mipmap_level
+{
+ GLuint level_offset;
+ GLuint width;
+ GLuint height;
+ GLuint depth;
+ GLuint nr_images;
+
+ /* Explicitly store the offset of each image for each cube face or
+ * depth value. Pretty much have to accept that hardware formats
+ * are going to be so diverse that there is no unified way to
+ * compute the offsets of depth/cube images within a mipmap level,
+ * so have to store them as a lookup table:
+ */
+ GLuint *image_offset;
+};
+
+struct intel_mipmap_tree
+{
+ /* Effectively the key:
+ */
+ GLenum target;
+ GLenum internal_format;
+
+ GLuint first_level;
+ GLuint last_level;
+
+ GLuint width0, height0, depth0; /**< Level zero image dimensions */
+ GLuint cpp;
+ GLboolean compressed;
+
+ /* Derived from the above:
+ */
+ GLuint pitch;
+ GLuint depth_pitch; /* per-image on i945? */
+ GLuint total_height;
+
+ /* Includes image offset tables:
+ */
+ struct intel_mipmap_level level[MAX_TEXTURE_LEVELS];
+
+ /* The data is held here:
+ */
+ struct intel_region *region;
+
+ /* These are also refcounted:
+ */
+ GLuint refcount;
+};
+
+
+
+struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
+ GLenum target,
+ GLenum internal_format,
+ GLuint first_level,
+ GLuint last_level,
+ GLuint width0,
+ GLuint height0,
+ GLuint depth0,
+ GLuint cpp,
+ GLuint compress_byte);
+
+void intel_miptree_reference(struct intel_mipmap_tree **dst,
+ struct intel_mipmap_tree *src);
+
+void intel_miptree_release(struct intel_context *intel,
+ struct intel_mipmap_tree **mt);
+
+/* Check if an image fits an existing mipmap tree layout
+ */
+GLboolean intel_miptree_match_image(struct intel_mipmap_tree *mt,
+ struct gl_texture_image *image,
+ GLuint face, GLuint level);
+
+/* Return a pointer to an image within a tree. Return image stride as
+ * well.
+ */
+GLubyte *intel_miptree_image_map(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ GLuint face,
+ GLuint level,
+ GLuint * row_stride, GLuint * image_stride);
+
+void intel_miptree_image_unmap(struct intel_context *intel,
+ struct intel_mipmap_tree *mt);
+
+
+/* Return the linear offset of an image relative to the start of the
+ * tree:
+ */
+GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt,
+ GLuint face, GLuint level);
+
+/* Return pointers to each 2d slice within an image. Indexed by depth
+ * value.
+ */
+const GLuint *intel_miptree_depth_offsets(struct intel_mipmap_tree *mt,
+ GLuint level);
+
+
+void intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
+ GLuint level,
+ GLuint nr_images,
+ GLuint x, GLuint y,
+ GLuint w, GLuint h, GLuint d);
+
+void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
+ GLuint level,
+ GLuint img, GLuint x, GLuint y);
+
+
+/* Upload an image into a tree
+ */
+void intel_miptree_image_data(struct intel_context *intel,
+ struct intel_mipmap_tree *dst,
+ GLuint face,
+ GLuint level,
+ void *src,
+ GLuint src_row_pitch, GLuint src_image_pitch);
+
+/* Copy an image between two trees
+ */
+void intel_miptree_image_copy(struct intel_context *intel,
+ struct intel_mipmap_tree *dst,
+ GLuint face, GLuint level,
+ struct intel_mipmap_tree *src);
+
+/* i915_mipmap_tree.c:
+ */
+GLboolean i915_miptree_layout(struct intel_mipmap_tree *mt);
+GLboolean i945_miptree_layout(struct intel_mipmap_tree *mt);
+
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel.c b/src/mesa/drivers/dri/i915tex/intel_pixel.c
new file mode 100644
index 00000000000..9018e3daef4
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel.c
@@ -0,0 +1,120 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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 "enums.h"
+#include "state.h"
+#include "swrast/swrast.h"
+
+#include "intel_context.h"
+#include "intel_pixel.h"
+#include "intel_regions.h"
+
+
+/**
+ * Check if any fragment operations are in effect which might effect
+ * glDraw/CopyPixels.
+ */
+GLboolean
+intel_check_blit_fragment_ops(GLcontext * ctx)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ /* XXX Note: Scissor could be done with the blitter:
+ */
+ return !(ctx->_ImageTransferState ||
+ 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->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
+}
+
+
+GLboolean
+intel_check_meta_tex_fragment_ops(GLcontext * ctx)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ /* Some of _ImageTransferState (scale, bias) could be done with
+ * fragment programs on i915.
+ */
+ return !(ctx->_ImageTransferState || ctx->Fog.Enabled || /* not done yet */
+ ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled);
+}
+
+/* The intel_region struct doesn't really do enough to capture the
+ * format of the pixels in the region. For now this code assumes that
+ * the region is a display surface and hence is either ARGB8888 or
+ * RGB565.
+ * XXX FBO: If we'd pass in the intel_renderbuffer instead of region, we'd
+ * know the buffer's pixel format.
+ *
+ * \param format as given to glDraw/ReadPixels
+ * \param type as given to glDraw/ReadPixels
+ */
+GLboolean
+intel_check_blit_format(struct intel_region * region,
+ GLenum format, GLenum type)
+{
+ if (region->cpp == 4 &&
+ (type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_BYTE) && format == GL_BGRA) {
+ return GL_TRUE;
+ }
+
+ if (region->cpp == 2 &&
+ type == GL_UNSIGNED_SHORT_5_6_5_REV && format == GL_BGR) {
+ return GL_TRUE;
+ }
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: bad format for blit (cpp %d, type %s format %s)\n",
+ __FUNCTION__, region->cpp,
+ _mesa_lookup_enum_by_nr(type), _mesa_lookup_enum_by_nr(format));
+
+ return GL_FALSE;
+}
+
+
+void
+intelInitPixelFuncs(struct dd_function_table *functions)
+{
+ functions->Accum = _swrast_Accum;
+ functions->Bitmap = _swrast_Bitmap;
+ functions->CopyPixels = intelCopyPixels;
+ functions->ReadPixels = intelReadPixels;
+ functions->DrawPixels = intelDrawPixels;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel.h b/src/mesa/drivers/dri/i915tex/intel_pixel.h
new file mode 100644
index 00000000000..a6fcf90ce03
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel.h
@@ -0,0 +1,63 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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_PIXEL_H
+#define INTEL_PIXEL_H
+
+#include "mtypes.h"
+
+void intelInitPixelFuncs(struct dd_function_table *functions);
+
+GLboolean intel_check_blit_fragment_ops(GLcontext * ctx);
+
+GLboolean intel_check_meta_tex_fragment_ops(GLcontext * ctx);
+
+GLboolean intel_check_blit_format(struct intel_region *region,
+ GLenum format, GLenum type);
+
+
+void intelReadPixels(GLcontext * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack,
+ GLvoid * pixels);
+
+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);
+
+void intelCopyPixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint destx, GLint desty, GLenum type);
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c
new file mode 100644
index 00000000000..65bf338589e
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c
@@ -0,0 +1,350 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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 "image.h"
+#include "colormac.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "bufferobj.h"
+#include "swrast/swrast.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_ioctl.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_regions.h"
+#include "intel_buffer_objects.h"
+
+
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+
+/* Unlike the other intel_pixel_* functions, the expectation here is
+ * that the incoming data is not in a PBO. With the XY_TEXT blit
+ * method, there's no benefit haveing it in a PBO, but we could
+ * implement a path based on XY_MONO_SRC_COPY_BLIT which might benefit
+ * PBO bitmaps. I think they are probably pretty rare though - I
+ * wonder if Xgl uses them?
+ */
+static const GLubyte *map_pbo( GLcontext *ctx,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ GLubyte *buf;
+
+ if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
+ GL_COLOR_INDEX, GL_BITMAP,
+ (GLvoid *) bitmap)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,"glBitmap(invalid PBO access)");
+ return NULL;
+ }
+
+ buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB,
+ unpack->BufferObj);
+ if (!buf) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)");
+ return NULL;
+ }
+
+ return ADD_POINTERS(buf, bitmap);
+}
+
+static GLboolean test_bit( const GLubyte *src,
+ GLuint bit )
+{
+ return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0;
+}
+
+static void set_bit( GLubyte *dest,
+ GLuint bit )
+{
+ dest[bit/8] |= 1 << (bit % 8);
+}
+
+static int align(int x, int align)
+{
+ return (x + align - 1) & ~(align - 1);
+}
+
+/* Extract a rectangle's worth of data from the bitmap. Called
+ * per-cliprect.
+ */
+static GLuint get_bitmap_rect(GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap,
+ GLuint x, GLuint y,
+ GLuint w, GLuint h,
+ GLubyte *dest,
+ GLuint row_align,
+ GLboolean invert)
+{
+ GLuint src_offset = (x + unpack->SkipPixels) & 0x7;
+ GLuint mask = unpack->LsbFirst ? 0 : 7;
+ GLuint bit = 0;
+ GLint row, col;
+ GLint first, last;
+ GLint incr;
+ GLuint count = 0;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
+ __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
+
+ if (invert) {
+ first = h-1;
+ last = 0;
+ incr = -1;
+ }
+ else {
+ first = 0;
+ last = h-1;
+ incr = 1;
+ }
+
+ /* Require that dest be pre-zero'd.
+ */
+ for (row = first; row != (last+incr); row += incr) {
+ const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap,
+ width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ y + row, x);
+
+ for (col = 0; col < w; col++, bit++) {
+ if (test_bit(rowsrc, (col + src_offset) ^ mask)) {
+ set_bit(dest, bit ^ 7);
+ count++;
+ }
+ }
+
+ if (row_align)
+ bit = (bit + row_align - 1) & ~(row_align - 1);
+ }
+
+ return count;
+}
+
+
+
+
+/*
+ * Render a bitmap.
+ */
+static GLboolean
+do_blit_bitmap( GLcontext *ctx,
+ GLint dstx, GLint dsty,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+
+ union {
+ GLuint ui;
+ GLubyte ub[4];
+ } color;
+
+
+ if (unpack->BufferObj->Name) {
+ bitmap = map_pbo(ctx, width, height, unpack, bitmap);
+ if (bitmap == NULL)
+ return GL_TRUE; /* even though this is an error, we're done */
+ }
+
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], ctx->Current.RasterColor[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], ctx->Current.RasterColor[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], ctx->Current.RasterColor[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], ctx->Current.RasterColor[3]);
+
+ /* Does zoom apply to bitmaps?
+ */
+ if (!intel_check_blit_fragment_ops(ctx) ||
+ ctx->Pixel.ZoomX != 1.0F ||
+ ctx->Pixel.ZoomY != 1.0F)
+ return GL_FALSE;
+
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ drm_clip_rect_t *box = dPriv->pClipRects;
+ drm_clip_rect_t dest_rect;
+ GLint nbox = dPriv->numClipRects;
+ GLint srcx = 0, srcy = 0;
+ GLint orig_screen_x1, orig_screen_y2;
+ GLuint i;
+
+
+ orig_screen_x1 = dPriv->x + dstx;
+ orig_screen_y2 = dPriv->y + (dPriv->h - dsty);
+
+ /* Do scissoring in GL coordinates:
+ */
+x if (ctx->Scissor.Enabled)
+ {
+ GLint x = ctx->Scissor.X;
+ GLint y = ctx->Scissor.Y;
+ GLuint w = ctx->Scissor.Width;
+ GLuint h = ctx->Scissor.Height;
+
+ if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height))
+ goto out;
+ }
+
+ /* Convert from GL to hardware coordinates:
+ */
+ dsty = dPriv->y + (dPriv->h - dsty - height);
+ dstx = dPriv->x + dstx;
+
+ dest_rect.x1 = dstx;
+ dest_rect.y1 = dsty;
+ dest_rect.x2 = dstx + width;
+ dest_rect.y2 = dsty + height;
+
+ for (i = 0; i < nbox; i++) {
+ drm_clip_rect_t rect;
+ int box_w, box_h;
+ GLint px, py;
+ GLuint stipple[32];
+
+ if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i]))
+ continue;
+
+ /* Now go back to GL coordinates to figure out what subset of
+ * the bitmap we are uploading for this cliprect:
+ */
+ box_w = rect.x2 - rect.x1;
+ box_h = rect.y2 - rect.y1;
+ srcx = rect.x1 - orig_screen_x1;
+ srcy = orig_screen_y2 - rect.y2;
+
+
+#define DY 32
+#define DX 32
+
+ /* Then, finally, chop it all into chunks that can be
+ * digested by hardware:
+ */
+ for (py = 0; py < box_h; py += DY) {
+ for (px = 0; px < box_w; px += DX) {
+ int h = MIN2(DY, box_h - py);
+ int w = MIN2(DX, box_w - px);
+ GLuint sz = align(align(w,8) * h, 64)/8;
+
+ assert(sz <= sizeof(stipple));
+ memset(stipple, 0, sz);
+
+ /* May need to adjust this when padding has been introduced in
+ * sz above:
+ */
+ if (get_bitmap_rect(width, height, unpack,
+ bitmap,
+ srcx + px, srcy + py, w, h,
+ (GLubyte *)stipple,
+ 8,
+ GL_TRUE) == 0)
+ continue;
+
+ /*
+ */
+ intelEmitImmediateColorExpandBlit( intel,
+ dst->cpp,
+ (GLubyte *)stipple,
+ sz,
+ color.ui,
+ dst->pitch,
+ dst->buffer,
+ 0,
+ dst->tiled,
+ rect.x1 + px,
+ rect.y2 - (py + h),
+ w, h);
+ }
+ }
+ }
+ intel->need_flush = GL_TRUE;
+ out:
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+
+
+ if (unpack->BufferObj->Name) {
+ /* done with PBO so unmap it now */
+ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ unpack->BufferObj);
+ }
+
+ return GL_TRUE;
+}
+
+
+
+
+
+/* There are a large number of possible ways to implement bitmap on
+ * this hardware, most of them have some sort of drawback. Here are a
+ * few that spring to mind:
+ *
+ * Blit:
+ * - XY_MONO_SRC_BLT_CMD
+ * - use XY_SETUP_CLIP_BLT for cliprect clipping.
+ * - XY_TEXT_BLT
+ * - XY_TEXT_IMMEDIATE_BLT
+ * - blit per cliprect, subject to maximum immediate data size.
+ * - XY_COLOR_BLT
+ * - per pixel or run of pixels
+ * - XY_PIXEL_BLT
+ * - good for sparse bitmaps
+ *
+ * 3D engine:
+ * - Point per pixel
+ * - Translate bitmap to an alpha texture and render as a quad
+ * - Chop bitmap up into 32x32 squares and render w/polygon stipple.
+ */
+void
+intelBitmap(GLcontext * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte * pixels)
+{
+ if (do_blit_bitmap(ctx, x, y, width, height,
+ unpack, pixels))
+ return;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+
+ _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels);
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
new file mode 100644
index 00000000000..9d478283e47
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
@@ -0,0 +1,383 @@
+/**************************************************************************
+ *
+ * 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 "image.h"
+#include "state.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"
+#include "intel_buffers.h"
+#include "intel_blit.h"
+#include "intel_regions.h"
+#include "intel_tris.h"
+#include "intel_pixel.h"
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+static struct intel_region *
+copypix_src_region(struct intel_context *intel, GLenum type)
+{
+ switch (type) {
+ case GL_COLOR:
+ return intel_readbuf_region(intel);
+ case GL_DEPTH:
+ /* Don't think this is really possible execpt at 16bpp, when we have no stencil.
+ */
+ if (intel->intelScreen->depth_region &&
+ intel->intelScreen->depth_region->cpp == 2)
+ return intel->intelScreen->depth_region;
+ case GL_STENCIL:
+ /* Don't think this is really possible.
+ */
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ /* Does it matter whether it is stencil/depth or depth/stencil?
+ */
+ return intel->intelScreen->depth_region;
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
+
+/**
+ * Check if any fragment operations are in effect which might effect
+ * glCopyPixels. Differs from intel_check_blit_fragment_ops in that
+ * we allow Scissor.
+ */
+static GLboolean
+intel_check_copypixel_blit_fragment_ops(GLcontext * ctx)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ /* Could do logicop with the blitter:
+ */
+ return !(ctx->_ImageTransferState ||
+ ctx->Color.AlphaEnabled ||
+ ctx->Depth.Test ||
+ ctx->Fog.Enabled ||
+ ctx->Stencil.Enabled ||
+ !ctx->Color.ColorMask[0] ||
+ !ctx->Color.ColorMask[1] ||
+ !ctx->Color.ColorMask[2] ||
+ !ctx->Color.ColorMask[3] ||
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
+}
+
+/* Doesn't work for overlapping regions. Could do a double copy or
+ * just fallback.
+ */
+static GLboolean
+do_texture_copypixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+ struct intel_region *src = copypix_src_region(intel, type);
+ GLenum src_format;
+ GLenum src_type;
+
+ DBG("%s %d,%d %dx%d --> %d,%d\n", __FUNCTION__,
+ srcx, srcy, width, height, dstx, dsty);
+
+ if (!src || !dst || type != GL_COLOR)
+ return GL_FALSE;
+
+ /* Can't handle overlapping regions. Don't have sufficient control
+ * over rasterization to pull it off in-place. Punt on these for
+ * now.
+ *
+ * XXX: do a copy to a temporary.
+ */
+ if (src->buffer == dst->buffer) {
+ drm_clip_rect_t srcbox;
+ drm_clip_rect_t dstbox;
+ drm_clip_rect_t tmp;
+
+ srcbox.x1 = srcx;
+ srcbox.y1 = srcy;
+ srcbox.x2 = srcx + width;
+ srcbox.y2 = srcy + height;
+
+ dstbox.x1 = dstx;
+ dstbox.y1 = dsty;
+ dstbox.x2 = dstx + width * ctx->Pixel.ZoomX;
+ dstbox.y2 = dsty + height * ctx->Pixel.ZoomY;
+
+ DBG("src %d,%d %d,%d\n", srcbox.x1, srcbox.y1, srcbox.x2, srcbox.y2);
+ DBG("dst %d,%d %d,%d (%dx%d) (%f,%f)\n", dstbox.x1, dstbox.y1, dstbox.x2, dstbox.y2,
+ width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
+
+ if (intel_intersect_cliprects(&tmp, &srcbox, &dstbox)) {
+ DBG("%s: regions overlap\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ }
+
+ intelFlush(&intel->ctx);
+
+ intel->vtbl.install_meta_state(intel);
+
+ /* Is this true? Also will need to turn depth testing on according
+ * to state:
+ */
+ intel->vtbl.meta_no_stencil_write(intel);
+ intel->vtbl.meta_no_depth_write(intel);
+
+ /* Set the 3d engine to draw into the destination region:
+ */
+ intel->vtbl.meta_draw_region(intel, dst, intel->intelScreen->depth_region);
+
+ intel->vtbl.meta_import_pixel_state(intel);
+
+ if (src->cpp == 2) {
+ src_format = GL_RGB;
+ src_type = GL_UNSIGNED_SHORT_5_6_5;
+ }
+ else {
+ src_format = GL_BGRA;
+ src_type = GL_UNSIGNED_BYTE;
+ }
+
+ /* Set the frontbuffer up as a large rectangular texture.
+ */
+ if (!intel->vtbl.meta_tex_rect_source(intel, src->buffer, 0,
+ src->pitch,
+ src->height, src_format, src_type)) {
+ intel->vtbl.leave_meta_state(intel);
+ return GL_FALSE;
+ }
+
+
+ intel->vtbl.meta_texture_blend_replace(intel);
+
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+
+
+ srcy = dPriv->h - srcy - height; /* convert from gl to hardware coords */
+
+ srcx += dPriv->x;
+ srcy += dPriv->y;
+
+ /* Clip against the source region. This is the only source
+ * clipping we do. XXX: Just set the texcord wrap mode to clamp
+ * or similar.
+ *
+ */
+ if (0) {
+ GLint orig_x = srcx;
+ GLint orig_y = srcy;
+
+ if (!_mesa_clip_to_region(0, 0, src->pitch, src->height,
+ &srcx, &srcy, &width, &height))
+ goto out;
+
+ dstx += srcx - orig_x;
+ dsty += (srcy - orig_y) * ctx->Pixel.ZoomY;
+ }
+
+ /* Just use the regular cliprect mechanism... Does this need to
+ * even hold the lock???
+ */
+ intel_meta_draw_quad(intel,
+ dstx,
+ dstx + width * ctx->Pixel.ZoomX,
+ dPriv->h - (dsty + height * ctx->Pixel.ZoomY),
+ dPriv->h - (dsty), 0, /* XXX: what z value? */
+ 0x00ff00ff,
+ srcx, srcx + width, srcy, srcy + height);
+
+ out:
+ intel->vtbl.leave_meta_state(intel);
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+
+ DBG("%s: success\n", __FUNCTION__);
+ return GL_TRUE;
+}
+
+
+
+
+
+/**
+ * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc.
+ */
+static GLboolean
+do_blit_copypixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+ struct intel_region *src = copypix_src_region(intel, type);
+
+ /* Copypixels can be more than a straight copy. Ensure all the
+ * extra operations are disabled:
+ */
+ if (!intel_check_copypixel_blit_fragment_ops(ctx) ||
+ ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F)
+ return GL_FALSE;
+
+ if (!src || !dst)
+ return GL_FALSE;
+
+
+
+ intelFlush(&intel->ctx);
+
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ drm_clip_rect_t *box = dPriv->pClipRects;
+ drm_clip_rect_t dest_rect;
+ GLint nbox = dPriv->numClipRects;
+ GLint delta_x = 0;
+ GLint delta_y = 0;
+ GLuint i;
+
+ /* Do scissoring in GL coordinates:
+ */
+ if (ctx->Scissor.Enabled)
+ {
+ GLint x = ctx->Scissor.X;
+ GLint y = ctx->Scissor.Y;
+ GLuint w = ctx->Scissor.Width;
+ GLuint h = ctx->Scissor.Height;
+ GLint dx = dstx - srcx;
+ GLint dy = dsty - srcy;
+
+ if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height))
+ goto out;
+
+ srcx = dstx - dx;
+ srcy = dsty - dy;
+ }
+
+ /* Convert from GL to hardware coordinates:
+ */
+ dsty = dPriv->h - dsty - height;
+ srcy = dPriv->h - srcy - height;
+ dstx += dPriv->x;
+ dsty += dPriv->y;
+ srcx += dPriv->x;
+ srcy += dPriv->y;
+
+ /* Clip against the source region. This is the only source
+ * clipping we do. Dst is clipped with cliprects below.
+ */
+ {
+ delta_x = srcx - dstx;
+ delta_y = srcy - dsty;
+
+ if (!_mesa_clip_to_region(0, 0, src->pitch, src->height,
+ &srcx, &srcy, &width, &height))
+ goto out;
+
+ dstx = srcx - delta_x;
+ dsty = srcy - delta_y;
+ }
+
+ dest_rect.x1 = dstx;
+ dest_rect.y1 = dsty;
+ dest_rect.x2 = dstx + width;
+ dest_rect.y2 = dsty + height;
+
+ /* Could do slightly more clipping: Eg, take the intersection of
+ * the existing set of cliprects and those cliprects translated
+ * by delta_x, delta_y:
+ *
+ * This code will not overwrite other windows, but will
+ * introduce garbage when copying from obscured window regions.
+ */
+ for (i = 0; i < nbox; i++) {
+ drm_clip_rect_t rect;
+
+ if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i]))
+ continue;
+
+
+ intelEmitCopyBlit(intel, dst->cpp,
+ src->pitch, src->buffer, 0,
+ dst->pitch, dst->buffer, 0,
+ rect.x1 + delta_x,
+ rect.y1 + delta_y, /* srcx, srcy */
+ rect.x1, rect.y1, /* dstx, dsty */
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
+ }
+
+ out:
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+
+ DBG("%s: success\n", __FUNCTION__);
+ return GL_TRUE;
+}
+
+
+void
+intelCopyPixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint destx, GLint desty, GLenum type)
+{
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
+ return;
+
+ if (do_texture_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
+ return;
+
+ DBG("fallback to _swrast_CopyPixels\n");
+
+ _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type);
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
new file mode 100644
index 00000000000..10a079896ae
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
@@ -0,0 +1,367 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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 "image.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "bufferobj.h"
+#include "swrast/swrast.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_ioctl.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_regions.h"
+#include "intel_pixel.h"
+#include "intel_buffer_objects.h"
+#include "intel_tris.h"
+
+
+
+static GLboolean
+do_texture_drawpixels(GLcontext * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid * pixels)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+ struct intel_buffer_object *src = intel_buffer_object(unpack->BufferObj);
+ GLuint rowLength = unpack->RowLength ? unpack->RowLength : width;
+ GLuint src_offset;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ intelFlush(&intel->ctx);
+ intel->vtbl.render_start(intel);
+ intel->vtbl.emit_state(intel);
+
+ if (!dst)
+ return GL_FALSE;
+
+ if (src) {
+ if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
+ format, type, pixels)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
+ return GL_TRUE;
+ }
+ }
+ else {
+ /* PBO only for now:
+ */
+/* _mesa_printf("%s - not PBO\n", __FUNCTION__); */
+ return GL_FALSE;
+ }
+
+ /* There are a couple of things we can't do yet, one of which is
+ * set the correct state for pixel operations when GL texturing is
+ * enabled. That's a pretty rare state and probably not worth the
+ * effort. A completely device-independent version of this may do
+ * more.
+ *
+ * Similarly, we make no attempt to merge metaops processing with
+ * an enabled fragment program, though it would certainly be
+ * possible.
+ */
+ if (!intel_check_meta_tex_fragment_ops(ctx)) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad GL fragment state for metaops texture\n",
+ __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ intel->vtbl.install_meta_state(intel);
+
+
+ /* Is this true? Also will need to turn depth testing on according
+ * to state:
+ */
+ intel->vtbl.meta_no_stencil_write(intel);
+ intel->vtbl.meta_no_depth_write(intel);
+
+ /* Set the 3d engine to draw into the destination region:
+ */
+ intel->vtbl.meta_draw_region(intel, dst, intel->intelScreen->depth_region);
+
+ intel->vtbl.meta_import_pixel_state(intel);
+
+ src_offset = (GLuint) _mesa_image_address(2, unpack, pixels, width, height,
+ format, type, 0, 0, 0);
+
+
+ /* Setup the pbo up as a rectangular texture, if possible.
+ *
+ * TODO: This is almost always possible if the i915 fragment
+ * program is adjusted to correctly swizzle the sampled colors.
+ * The major exception is any 24bit texture, like RGB888, for which
+ * there is no hardware support.
+ */
+ if (!intel->vtbl.meta_tex_rect_source(intel, src->buffer, src_offset,
+ rowLength, height, format, type)) {
+ intel->vtbl.leave_meta_state(intel);
+ return GL_FALSE;
+ }
+
+ intel->vtbl.meta_texture_blend_replace(intel);
+
+
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ GLint srcx, srcy;
+ GLint dstx, dsty;
+
+ dstx = x;
+ dsty = dPriv->h - (y + height);
+
+ srcx = 0; /* skiprows/pixels already done */
+ srcy = 0;
+
+ if (0) {
+ const GLint orig_x = dstx;
+ const GLint orig_y = dsty;
+
+ if (!_mesa_clip_to_region(0, 0, dst->pitch, dst->height,
+ &dstx, &dsty, &width, &height))
+ goto out;
+
+ srcx += dstx - orig_x;
+ srcy += dsty - orig_y;
+ }
+
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("draw %d,%d %dx%d\n", dstx, dsty, width, height);
+
+ /* Must use the regular cliprect mechanism in order to get the
+ * drawing origin set correctly. Otherwise scissor state is in
+ * incorrect coordinate space. Does this even need to hold the
+ * lock???
+ */
+ intel_meta_draw_quad(intel,
+ dstx, dstx + width * ctx->Pixel.ZoomX,
+ dPriv->h - (y + height * ctx->Pixel.ZoomY),
+ dPriv->h - (y),
+ -ctx->Current.RasterPos[2] * .5,
+ 0x00ff00ff,
+ srcx, srcx + width, srcy + height, srcy);
+ out:
+ intel->vtbl.leave_meta_state(intel);
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+ return GL_TRUE;
+}
+
+
+
+
+
+/* Pros:
+ * - no waiting for idle before updating framebuffer.
+ *
+ * Cons:
+ * - if upload is by memcpy, this may actually be slower than fallback path.
+ * - uploads the whole image even if destination is clipped
+ *
+ * Need to benchmark.
+ *
+ * Given the questions about performance, implement for pbo's only.
+ * This path is definitely a win if the pbo is already in agp. If it
+ * turns out otherwise, we can add the code necessary to upload client
+ * data to agp space before performing the blit. (Though it may turn
+ * out to be better/simpler just to use the texture engine).
+ */
+static GLboolean
+do_blit_drawpixels(GLcontext * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid * pixels)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dest = intel_drawbuf_region(intel);
+ struct intel_buffer_object *src = intel_buffer_object(unpack->BufferObj);
+ GLuint src_offset;
+ GLuint rowLength;
+ struct _DriFenceObject *fence = NULL;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s\n", __FUNCTION__);
+
+
+ if (!dest) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - no dest\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (src) {
+ /* This validation should be done by core mesa:
+ */
+ if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
+ format, type, pixels)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
+ return GL_TRUE;
+ }
+ }
+ else {
+ /* PBO only for now:
+ */
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - not PBO\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (!intel_check_blit_format(dest, format, type)) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (!intel_check_blit_fragment_ops(ctx)) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad GL fragment state for blitter\n",
+ __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (ctx->Pixel.ZoomX != 1.0F) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad PixelZoomX for blit\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+
+ if (unpack->RowLength > 0)
+ rowLength = unpack->RowLength;
+ else
+ rowLength = width;
+
+ if (ctx->Pixel.ZoomY == -1.0F) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__);
+ return GL_FALSE; /* later */
+ y -= height;
+ }
+ else if (ctx->Pixel.ZoomY == 1.0F) {
+ rowLength = -rowLength;
+ }
+ else {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ src_offset = (GLuint) _mesa_image_address(2, unpack, pixels, width, height,
+ format, type, 0, 0, 0);
+
+ intelFlush(&intel->ctx);
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ int nbox = dPriv->numClipRects;
+ drm_clip_rect_t *box = dPriv->pClipRects;
+ drm_clip_rect_t rect;
+ drm_clip_rect_t dest_rect;
+ struct _DriBufferObject *src_buffer =
+ intel_bufferobj_buffer(intel, src, INTEL_READ);
+ int i;
+
+ dest_rect.x1 = dPriv->x + x;
+ dest_rect.y1 = dPriv->y + dPriv->h - (y + height);
+ dest_rect.x2 = dest_rect.x1 + width;
+ dest_rect.y2 = dest_rect.y1 + height;
+
+ for (i = 0; i < nbox; i++) {
+ if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i]))
+ continue;
+
+ intelEmitCopyBlit(intel,
+ dest->cpp,
+ rowLength,
+ src_buffer, src_offset,
+ dest->pitch,
+ dest->buffer, 0,
+ rect.x1 - dest_rect.x1,
+ rect.y2 - dest_rect.y2,
+ rect.x1,
+ rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
+ }
+ fence = intel_batchbuffer_flush(intel->batch);
+ driFenceReference(fence);
+ }
+ UNLOCK_HARDWARE(intel);
+
+ if (fence) {
+ driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE);
+ driFenceUnReference(fence);
+ }
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - DONE\n", __FUNCTION__);
+
+ return GL_TRUE;
+}
+
+
+
+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 (do_blit_drawpixels(ctx, x, y, width, height, format, type,
+ unpack, pixels))
+ return;
+
+ if (do_texture_drawpixels(ctx, x, y, width, height, format, type,
+ unpack, pixels))
+ return;
+
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+
+ _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels);
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
new file mode 100644
index 00000000000..24e49ae0663
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
@@ -0,0 +1,319 @@
+/**************************************************************************
+ *
+ * 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 "image.h"
+#include "bufferobj.h"
+#include "swrast/swrast.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_ioctl.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_regions.h"
+#include "intel_pixel.h"
+#include "intel_buffer_objects.h"
+
+/* For many applications, the new ability to pull the source buffers
+ * back out of the GTT and then do the packing/conversion operations
+ * in software will be as much of an improvement as trying to get the
+ * blitter and/or texture engine to do the work.
+ *
+ * This step is gated on private backbuffers.
+ *
+ * Obviously the frontbuffer can't be pulled back, so that is either
+ * an argument for blit/texture readpixels, or for blitting to a
+ * temporary and then pulling that back.
+ *
+ * When the destination is a pbo, however, it's not clear if it is
+ * ever going to be pulled to main memory (though the access param
+ * will be a good hint). So it sounds like we do want to be able to
+ * choose between blit/texture implementation on the gpu and pullback
+ * and cpu-based copying.
+ *
+ * Unless you can magically turn client memory into a PBO for the
+ * duration of this call, there will be a cpu-based copying step in
+ * any case.
+ */
+
+
+static GLboolean
+do_texture_readpixels(GLcontext * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack,
+ struct intel_region *dest_region)
+{
+#if 0
+ struct intel_context *intel = intel_context(ctx);
+ intelScreenPrivate *screen = intel->intelScreen;
+ GLint pitch = pack->RowLength ? pack->RowLength : width;
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ int textureFormat;
+ GLenum glTextureFormat;
+ 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) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ intel->vtbl.meta_texrect_source(intel, intel_readbuf_region(intel));
+
+ if (!intel->vtbl.meta_render_dest(intel, dest_region, type, format)) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: couldn't set dest %s/%s\n",
+ __FUNCTION__,
+ _mesa_lookup_enum_by_nr(type),
+ _mesa_lookup_enum_by_nr(format));
+ return GL_FALSE;
+ }
+
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ intel->vtbl.install_meta_state(intel);
+ intel->vtbl.meta_no_depth_write(intel);
+ intel->vtbl.meta_no_stencil_write(intel);
+
+ if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
+ UNLOCK_HARDWARE(intel);
+ SET_STATE(i830, state);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
+ return GL_TRUE;
+ }
+
+ y = dPriv->h - y - height;
+ x += dPriv->x;
+ y += dPriv->y;
+
+
+ /* Set the frontbuffer up as a large rectangular texture.
+ */
+ intel->vtbl.meta_tex_rect_source(intel, src_region, textureFormat);
+
+
+ intel->vtbl.meta_texture_blend_replace(i830, glTextureFormat);
+
+
+ /* Set the 3d engine to draw into the destination region:
+ */
+
+ intel->vtbl.meta_draw_region(intel, dest_region);
+ intel->vtbl.meta_draw_format(intel, destFormat, depthFormat); /* ?? */
+
+
+ /* Draw a single quad, no cliprects:
+ */
+ intel->vtbl.meta_disable_cliprects(intel);
+
+ intel->vtbl.draw_quad(intel,
+ 0, width, 0, height,
+ 0x00ff00ff, x, x + width, y, y + height);
+
+ intel->vtbl.leave_meta_state(intel);
+ }
+ UNLOCK_HARDWARE(intel);
+
+ intel_region_wait_fence(ctx, dest_region); /* required by GL */
+ return GL_TRUE;
+#endif
+
+ return GL_FALSE;
+}
+
+
+
+
+static GLboolean
+do_blit_readpixels(GLcontext * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *src = intel_readbuf_region(intel);
+ struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
+ GLuint dst_offset;
+ GLuint rowLength;
+ struct _DriFenceObject *fence = NULL;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s\n", __FUNCTION__);
+
+ if (!src)
+ return GL_FALSE;
+
+ if (dst) {
+ /* XXX This validation should be done by core mesa:
+ */
+ if (!_mesa_validate_pbo_access(2, pack, width, height, 1,
+ format, type, pixels)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
+ return GL_TRUE;
+ }
+ }
+ else {
+ /* PBO only for now:
+ */
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - not PBO\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+
+ if (ctx->_ImageTransferState ||
+ !intel_check_blit_format(src, format, type)) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: bad packing params\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ if (pack->RowLength > 0)
+ rowLength = pack->RowLength;
+ else
+ rowLength = width;
+
+ if (pack->Invert) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ else {
+ rowLength = -rowLength;
+ }
+
+ /* XXX 64-bit cast? */
+ dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height,
+ format, type, 0, 0, 0);
+
+
+ /* Although the blits go on the command buffer, need to do this and
+ * fire with lock held to guarentee cliprects are correct.
+ */
+ intelFlush(&intel->ctx);
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ GLboolean all = (width * height * src->cpp == dst->Base.Size &&
+ x == 0 && dst_offset == 0);
+
+ struct _DriBufferObject *dst_buffer =
+ intel_bufferobj_buffer(intel, dst, all ? INTEL_WRITE_FULL :
+ INTEL_WRITE_PART);
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ int nbox = dPriv->numClipRects;
+ drm_clip_rect_t *box = dPriv->pClipRects;
+ drm_clip_rect_t rect;
+ drm_clip_rect_t src_rect;
+ int i;
+
+ src_rect.x1 = dPriv->x + x;
+ src_rect.y1 = dPriv->y + dPriv->h - (y + height);
+ src_rect.x2 = src_rect.x1 + width;
+ src_rect.y2 = src_rect.y1 + height;
+
+
+
+ for (i = 0; i < nbox; i++) {
+ if (!intel_intersect_cliprects(&rect, &src_rect, &box[i]))
+ continue;
+
+ intelEmitCopyBlit(intel,
+ src->cpp,
+ src->pitch, src->buffer, 0,
+ rowLength,
+ dst_buffer, dst_offset,
+ rect.x1,
+ rect.y1,
+ rect.x1 - src_rect.x1,
+ rect.y2 - src_rect.y2,
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ GL_COPY);
+ }
+
+ fence = intel_batchbuffer_flush(intel->batch);
+ driFenceReference(fence);
+
+ }
+ UNLOCK_HARDWARE(intel);
+
+ if (fence) {
+ driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW,
+ GL_FALSE);
+ driFenceUnReference(fence);
+ }
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - DONE\n", __FUNCTION__);
+
+ return GL_TRUE;
+}
+
+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__);
+
+ intelFlush(ctx);
+
+ if (do_blit_readpixels
+ (ctx, x, y, width, height, format, type, pack, pixels))
+ return;
+
+ if (do_texture_readpixels
+ (ctx, x, y, width, height, format, type, pack, pixels))
+ return;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+
+ _swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels);
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_reg.h b/src/mesa/drivers/dri/i915tex/intel_reg.h
new file mode 100644
index 00000000000..1ec153266c7
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_reg.h
@@ -0,0 +1,84 @@
+/**************************************************************************
+ *
+ * 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/src/mesa/drivers/dri/i915tex/intel_regions.c b/src/mesa/drivers/dri/i915tex/intel_regions.c
new file mode 100644
index 00000000000..1205b180ca6
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_regions.c
@@ -0,0 +1,471 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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.
+ *
+ **************************************************************************/
+
+/* Provide additional functionality on top of bufmgr buffers:
+ * - 2d semantics and blit operations
+ * - refcounting of buffers for multiple images in a buffer.
+ * - refcounting of buffer mappings.
+ * - some logic for moving the buffers to the best memory pools for
+ * given operations.
+ *
+ * Most of this is to make it easier to implement the fixed-layout
+ * mipmap tree required by intel hardware in the face of GL's
+ * programming interface where each image can be specifed in random
+ * order and it isn't clear what layout the tree should have until the
+ * last moment.
+ */
+
+#include "intel_context.h"
+#include "intel_regions.h"
+#include "intel_blit.h"
+#include "intel_buffer_objects.h"
+#include "dri_bufmgr.h"
+#include "intel_batchbuffer.h"
+
+#define FILE_DEBUG_FLAG DEBUG_REGION
+
+void
+intel_region_idle(intelScreenPrivate *intelScreen, struct intel_region *region)
+{
+ DBG("%s\n", __FUNCTION__);
+ if (region && region->buffer)
+ driBOWaitIdle(region->buffer, GL_FALSE);
+}
+
+/* XXX: Thread safety?
+ */
+GLubyte *
+intel_region_map(intelScreenPrivate *intelScreen, struct intel_region *region)
+{
+ DBG("%s\n", __FUNCTION__);
+ if (!region->map_refcount++) {
+ if (region->pbo)
+ intel_region_cow(intelScreen, region);
+
+ region->map = driBOMap(region->buffer,
+ DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
+ }
+
+ return region->map;
+}
+
+void
+intel_region_unmap(intelScreenPrivate *intelScreen, struct intel_region *region)
+{
+ DBG("%s\n", __FUNCTION__);
+ if (!--region->map_refcount) {
+ driBOUnmap(region->buffer);
+ region->map = NULL;
+ }
+}
+
+#undef TEST_CACHED_TEXTURES
+
+struct intel_region *
+intel_region_alloc(intelScreenPrivate *intelScreen,
+ GLuint cpp, GLuint pitch, GLuint height)
+{
+ struct intel_region *region = calloc(sizeof(*region), 1);
+
+ DBG("%s\n", __FUNCTION__);
+
+ region->cpp = cpp;
+ region->pitch = pitch;
+ region->height = height; /* needed? */
+ region->refcount = 1;
+
+ driGenBuffers(intelScreen->regionPool,
+ "region", 1, &region->buffer, 64,
+#ifdef TEST_CACHED_TEXTURES
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_BIND_CACHED |
+ DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
+#else
+ 0,
+#endif
+ 0);
+ driBOData(region->buffer, pitch * cpp * height, NULL, 0);
+ return region;
+}
+
+void
+intel_region_reference(struct intel_region **dst, struct intel_region *src)
+{
+ assert(*dst == NULL);
+ if (src) {
+ src->refcount++;
+ *dst = src;
+ }
+}
+
+void
+intel_region_release(struct intel_region **region)
+{
+ if (!*region)
+ return;
+
+ DBG("%s %d\n", __FUNCTION__, (*region)->refcount - 1);
+
+ ASSERT((*region)->refcount > 0);
+ (*region)->refcount--;
+
+ if ((*region)->refcount == 0) {
+ assert((*region)->map_refcount == 0);
+
+ if ((*region)->pbo)
+ (*region)->pbo->region = NULL;
+ (*region)->pbo = NULL;
+ driBOUnReference((*region)->buffer);
+ free(*region);
+ }
+ *region = NULL;
+}
+
+
+struct intel_region *
+intel_region_create_static(intelScreenPrivate *intelScreen,
+ GLuint mem_type,
+ GLuint offset,
+ void *virtual,
+ GLuint cpp, GLuint pitch, GLuint height)
+{
+ struct intel_region *region = calloc(sizeof(*region), 1);
+ DBG("%s\n", __FUNCTION__);
+
+ region->cpp = cpp;
+ region->pitch = pitch;
+ region->height = height; /* needed? */
+ region->refcount = 1;
+
+ /*
+ * We use a "shared" buffer type to indicate buffers created and
+ * shared by others.
+ */
+
+ driGenBuffers(intelScreen->staticPool, "static region", 1,
+ &region->buffer, 64,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE |
+ DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
+ driBOSetStatic(region->buffer, offset, pitch * cpp * height, virtual, 0);
+
+ return region;
+}
+
+
+
+void
+intel_region_update_static(intelScreenPrivate *intelScreen,
+ struct intel_region *region,
+ GLuint mem_type,
+ GLuint offset,
+ void *virtual,
+ GLuint cpp, GLuint pitch, GLuint height)
+{
+ DBG("%s\n", __FUNCTION__);
+
+ region->cpp = cpp;
+ region->pitch = pitch;
+ region->height = height; /* needed? */
+
+ /*
+ * We use a "shared" buffer type to indicate buffers created and
+ * shared by others.
+ */
+
+ driDeleteBuffers(1, &region->buffer);
+ driGenBuffers(intelScreen->staticPool, "static region", 1,
+ &region->buffer, 64,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE |
+ DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
+ driBOSetStatic(region->buffer, offset, pitch * cpp * height, virtual, 0);
+
+}
+
+
+
+/*
+ * XXX Move this into core Mesa?
+ */
+static void
+_mesa_copy_rect(GLubyte * dst,
+ GLuint cpp,
+ GLuint dst_pitch,
+ GLuint dst_x,
+ GLuint dst_y,
+ GLuint width,
+ GLuint height,
+ GLubyte * src, GLuint src_pitch, GLuint src_x, GLuint src_y)
+{
+ GLuint i;
+
+ dst_pitch *= cpp;
+ src_pitch *= cpp;
+ dst += dst_x * cpp;
+ src += src_x * cpp;
+ dst += dst_y * dst_pitch;
+ src += src_y * dst_pitch;
+ width *= cpp;
+
+ if (width == dst_pitch && width == src_pitch)
+ memcpy(dst, src, height * width);
+ else {
+ for (i = 0; i < height; i++) {
+ memcpy(dst, src, width);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
+}
+
+
+/* Upload data to a rectangular sub-region. Lots of choices how to do this:
+ *
+ * - memcpy by span to current destination
+ * - upload data as new buffer and blit
+ *
+ * Currently always memcpy.
+ */
+void
+intel_region_data(intelScreenPrivate *intelScreen,
+ struct intel_region *dst,
+ GLuint dst_offset,
+ GLuint dstx, GLuint dsty,
+ void *src, GLuint src_pitch,
+ GLuint srcx, GLuint srcy, GLuint width, GLuint height)
+{
+ struct intel_context *intel = intelScreenContext(intelScreen);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (intel == NULL)
+ return;
+
+ if (dst->pbo) {
+ if (dstx == 0 &&
+ dsty == 0 && width == dst->pitch && height == dst->height)
+ intel_region_release_pbo(intelScreen, dst);
+ else
+ intel_region_cow(intelScreen, dst);
+ }
+
+
+ LOCK_HARDWARE(intel);
+
+ _mesa_copy_rect(intel_region_map(intelScreen, dst) + dst_offset,
+ dst->cpp,
+ dst->pitch,
+ dstx, dsty, width, height, src, src_pitch, srcx, srcy);
+
+ intel_region_unmap(intelScreen, dst);
+
+ UNLOCK_HARDWARE(intel);
+
+}
+
+/* Copy rectangular sub-regions. Need better logic about when to
+ * push buffers into AGP - will currently do so whenever possible.
+ */
+void
+intel_region_copy(intelScreenPrivate *intelScreen,
+ struct intel_region *dst,
+ GLuint dst_offset,
+ GLuint dstx, GLuint dsty,
+ struct intel_region *src,
+ GLuint src_offset,
+ GLuint srcx, GLuint srcy, GLuint width, GLuint height)
+{
+ struct intel_context *intel = intelScreenContext(intelScreen);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (intel == NULL)
+ return;
+
+ if (dst->pbo) {
+ if (dstx == 0 &&
+ dsty == 0 && width == dst->pitch && height == dst->height)
+ intel_region_release_pbo(intelScreen, dst);
+ else
+ intel_region_cow(intelScreen, dst);
+ }
+
+ assert(src->cpp == dst->cpp);
+
+ intelEmitCopyBlit(intel,
+ dst->cpp,
+ src->pitch, src->buffer, src_offset,
+ dst->pitch, dst->buffer, dst_offset,
+ srcx, srcy, dstx, dsty, width, height,
+ GL_COPY);
+}
+
+/* Fill a rectangular sub-region. Need better logic about when to
+ * push buffers into AGP - will currently do so whenever possible.
+ */
+void
+intel_region_fill(intelScreenPrivate *intelScreen,
+ struct intel_region *dst,
+ GLuint dst_offset,
+ GLuint dstx, GLuint dsty,
+ GLuint width, GLuint height, GLuint color)
+{
+ struct intel_context *intel = intelScreenContext(intelScreen);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (intel == NULL)
+ return;
+
+ if (dst->pbo) {
+ if (dstx == 0 &&
+ dsty == 0 && width == dst->pitch && height == dst->height)
+ intel_region_release_pbo(intelScreen, dst);
+ else
+ intel_region_cow(intelScreen, dst);
+ }
+
+ intelEmitFillBlit(intel,
+ dst->cpp,
+ dst->pitch, dst->buffer, dst_offset,
+ dstx, dsty, width, height, color);
+}
+
+/* Attach to a pbo, discarding our data. Effectively zero-copy upload
+ * the pbo's data.
+ */
+void
+intel_region_attach_pbo(intelScreenPrivate *intelScreen,
+ struct intel_region *region,
+ struct intel_buffer_object *pbo)
+{
+ if (region->pbo == pbo)
+ return;
+
+ /* If there is already a pbo attached, break the cow tie now.
+ * Don't call intel_region_release_pbo() as that would
+ * unnecessarily allocate a new buffer we would have to immediately
+ * discard.
+ */
+ if (region->pbo) {
+ region->pbo->region = NULL;
+ region->pbo = NULL;
+ }
+
+ if (region->buffer) {
+ driDeleteBuffers(1, &region->buffer);
+ region->buffer = NULL;
+ }
+
+ region->pbo = pbo;
+ region->pbo->region = region;
+ region->buffer = driBOReference(pbo->buffer);
+}
+
+
+/* Break the COW tie to the pbo. The pbo gets to keep the data.
+ */
+void
+intel_region_release_pbo(intelScreenPrivate *intelScreen,
+ struct intel_region *region)
+{
+ assert(region->buffer == region->pbo->buffer);
+ region->pbo->region = NULL;
+ region->pbo = NULL;
+ driBOUnReference(region->buffer);
+ region->buffer = NULL;
+
+ driGenBuffers(intelScreen->regionPool,
+ "region", 1, &region->buffer, 64, 0, 0);
+ driBOData(region->buffer,
+ region->cpp * region->pitch * region->height, NULL, 0);
+}
+
+/* Break the COW tie to the pbo. Both the pbo and the region end up
+ * with a copy of the data.
+ */
+void
+intel_region_cow(intelScreenPrivate *intelScreen, struct intel_region *region)
+{
+ struct intel_context *intel = intelScreenContext(intelScreen);
+ struct intel_buffer_object *pbo = region->pbo;
+
+ if (intel == NULL)
+ return;
+
+ intel_region_release_pbo(intelScreen, region);
+
+ assert(region->cpp * region->pitch * region->height == pbo->Base.Size);
+
+ DBG("%s (%d bytes)\n", __FUNCTION__, pbo->Base.Size);
+
+ /* Now blit from the texture buffer to the new buffer:
+ */
+
+ intel_batchbuffer_flush(intel->batch);
+
+ if (!intel->locked) {
+ LOCK_HARDWARE(intel);
+ intelEmitCopyBlit(intel,
+ region->cpp,
+ region->pitch,
+ region->buffer, 0,
+ region->pitch,
+ pbo->buffer, 0,
+ 0, 0, 0, 0,
+ region->pitch, region->height,
+ GL_COPY);
+
+ intel_batchbuffer_flush(intel->batch);
+ UNLOCK_HARDWARE(intel);
+ }
+ else {
+ intelEmitCopyBlit(intel,
+ region->cpp,
+ region->pitch,
+ region->buffer, 0,
+ region->pitch,
+ pbo->buffer, 0,
+ 0, 0, 0, 0,
+ region->pitch, region->height,
+ GL_COPY);
+
+ intel_batchbuffer_flush(intel->batch);
+ }
+}
+
+struct _DriBufferObject *
+intel_region_buffer(intelScreenPrivate *intelScreen,
+ struct intel_region *region, GLuint flag)
+{
+ if (region->pbo) {
+ if (flag == INTEL_WRITE_PART)
+ intel_region_cow(intelScreen, region);
+ else if (flag == INTEL_WRITE_FULL)
+ intel_region_release_pbo(intelScreen, region);
+ }
+
+ return region->buffer;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_regions.h b/src/mesa/drivers/dri/i915tex/intel_regions.h
new file mode 100644
index 00000000000..1415bace690
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_regions.h
@@ -0,0 +1,141 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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_REGIONS_H
+#define INTEL_REGIONS_H
+
+#include "mtypes.h"
+#include "intel_screen.h"
+
+struct intel_context;
+struct intel_buffer_object;
+
+/**
+ * A layer on top of the bufmgr buffers that adds a few useful things:
+ *
+ * - Refcounting for local buffer references.
+ * - Refcounting for buffer maps
+ * - Buffer dimensions - pitch and height.
+ * - Blitter commands for copying 2D regions between buffers. (really???)
+ */
+struct intel_region
+{
+ struct _DriBufferObject *buffer; /**< buffer manager's buffer ID */
+ GLuint refcount; /**< Reference count for region */
+ GLuint cpp; /**< bytes per pixel */
+ GLuint pitch; /**< in pixels */
+ GLuint height; /**< in pixels */
+ GLubyte *map; /**< only non-NULL when region is actually mapped */
+ GLuint map_refcount; /**< Reference count for mapping */
+
+ GLuint draw_offset; /**< Offset of drawing address within the region */
+
+ struct intel_buffer_object *pbo; /* zero-copy uploads */
+};
+
+
+/* Allocate a refcounted region. Pointers to regions should only be
+ * copied by calling intel_reference_region().
+ */
+struct intel_region *intel_region_alloc(intelScreenPrivate *intelScreen,
+ GLuint cpp,
+ GLuint pitch, GLuint height);
+
+void intel_region_reference(struct intel_region **dst,
+ struct intel_region *src);
+
+void intel_region_release(struct intel_region **ib);
+
+extern struct intel_region
+*intel_region_create_static(intelScreenPrivate *intelScreen,
+ GLuint mem_type,
+ GLuint offset,
+ void *virtual,
+ GLuint cpp,
+ GLuint pitch, GLuint height);
+extern void
+intel_region_update_static(intelScreenPrivate *intelScreen,
+ struct intel_region *region,
+ GLuint mem_type,
+ GLuint offset,
+ void *virtual,
+ GLuint cpp, GLuint pitch, GLuint height);
+
+
+void intel_region_idle(intelScreenPrivate *intelScreen,
+ struct intel_region *ib);
+
+/* Map/unmap regions. This is refcounted also:
+ */
+GLubyte *intel_region_map(intelScreenPrivate *intelScreen,
+ struct intel_region *ib);
+
+void intel_region_unmap(intelScreenPrivate *intelScreen, struct intel_region *ib);
+
+
+/* Upload data to a rectangular sub-region
+ */
+void intel_region_data(intelScreenPrivate *intelScreen,
+ struct intel_region *dest,
+ GLuint dest_offset,
+ GLuint destx, GLuint desty,
+ void *src, GLuint src_stride,
+ GLuint srcx, GLuint srcy, GLuint width, GLuint height);
+
+/* Copy rectangular sub-regions
+ */
+void intel_region_copy(intelScreenPrivate *intelScreen,
+ struct intel_region *dest,
+ GLuint dest_offset,
+ GLuint destx, GLuint desty,
+ struct intel_region *src,
+ GLuint src_offset,
+ GLuint srcx, GLuint srcy, GLuint width, GLuint height);
+
+/* Fill a rectangular sub-region
+ */
+void intel_region_fill(intelScreenPrivate *intelScreen,
+ struct intel_region *dest,
+ GLuint dest_offset,
+ GLuint destx, GLuint desty,
+ GLuint width, GLuint height, GLuint color);
+
+/* Helpers for zerocopy uploads, particularly texture image uploads:
+ */
+void intel_region_attach_pbo(intelScreenPrivate *intelScreen,
+ struct intel_region *region,
+ struct intel_buffer_object *pbo);
+void intel_region_release_pbo(intelScreenPrivate *intelScreen,
+ struct intel_region *region);
+void intel_region_cow(intelScreenPrivate *intelScreen,
+ struct intel_region *region);
+
+struct _DriBufferObject *intel_region_buffer(intelScreenPrivate *intelScreen,
+ struct intel_region *region,
+ GLuint flag);
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_render.c b/src/mesa/drivers/dri/i915tex/intel_render.c
new file mode 100644
index 00000000000..f9fa55051ea
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_render.c
@@ -0,0 +1,242 @@
+/**************************************************************************
+ *
+ * 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(struct intel_context *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], INTEL_BATCH_CLIPRECTS);
+}
+
+
+#define LOCAL_VARS struct intel_context *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->batch->size - 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(struct intel_context *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)
+{
+ struct intel_context *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);
+
+ INTEL_FIREVERTICES(intel);
+
+ 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/src/mesa/drivers/dri/i915tex/intel_rotate.c b/src/mesa/drivers/dri/i915tex/intel_rotate.c
new file mode 100644
index 00000000000..12d98c4ad2f
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_rotate.c
@@ -0,0 +1,237 @@
+
+/**
+ * Routines for simple 2D->2D transformations for rotated, flipped screens.
+ *
+ * XXX This code is not intel-specific. Move it into a common/utility
+ * someday.
+ */
+
+#include "intel_rotate.h"
+
+#define MIN2(A, B) ( ((A) < (B)) ? (A) : (B) )
+
+#define ABS(A) ( ((A) < 0) ? -(A) : (A) )
+
+
+void
+matrix23Set(struct matrix23 *m,
+ int m00, int m01, int m02, int m10, int m11, int m12)
+{
+ m->m00 = m00;
+ m->m01 = m01;
+ m->m02 = m02;
+ m->m10 = m10;
+ m->m11 = m11;
+ m->m12 = m12;
+}
+
+
+/*
+ * Transform (x,y) coordinate by the given matrix.
+ */
+void
+matrix23TransformCoordf(const struct matrix23 *m, float *x, float *y)
+{
+ const float x0 = *x;
+ const float y0 = *y;
+
+ *x = m->m00 * x0 + m->m01 * y0 + m->m02;
+ *y = m->m10 * x0 + m->m11 * y0 + m->m12;
+}
+
+
+void
+matrix23TransformCoordi(const struct matrix23 *m, int *x, int *y)
+{
+ const int x0 = *x;
+ const int y0 = *y;
+
+ *x = m->m00 * x0 + m->m01 * y0 + m->m02;
+ *y = m->m10 * x0 + m->m11 * y0 + m->m12;
+}
+
+
+/*
+ * Transform a width and height by the given matrix.
+ * XXX this could be optimized quite a bit.
+ */
+void
+matrix23TransformDistance(const struct matrix23 *m, int *xDist, int *yDist)
+{
+ int x0 = 0, y0 = 0;
+ int x1 = *xDist, y1 = 0;
+ int x2 = 0, y2 = *yDist;
+ matrix23TransformCoordi(m, &x0, &y0);
+ matrix23TransformCoordi(m, &x1, &y1);
+ matrix23TransformCoordi(m, &x2, &y2);
+
+ *xDist = (x1 - x0) + (x2 - x0);
+ *yDist = (y1 - y0) + (y2 - y0);
+
+ if (*xDist < 0)
+ *xDist = -*xDist;
+ if (*yDist < 0)
+ *yDist = -*yDist;
+}
+
+
+/**
+ * Transform the rect defined by (x, y, w, h) by m.
+ */
+void
+matrix23TransformRect(const struct matrix23 *m, int *x, int *y, int *w,
+ int *h)
+{
+ int x0 = *x, y0 = *y;
+ int x1 = *x + *w, y1 = *y;
+ int x2 = *x + *w, y2 = *y + *h;
+ int x3 = *x, y3 = *y + *h;
+ matrix23TransformCoordi(m, &x0, &y0);
+ matrix23TransformCoordi(m, &x1, &y1);
+ matrix23TransformCoordi(m, &x2, &y2);
+ matrix23TransformCoordi(m, &x3, &y3);
+ *w = ABS(x1 - x0) + ABS(x2 - x1);
+ /**w = ABS(*w);*/
+ *h = ABS(y1 - y0) + ABS(y2 - y1);
+ /**h = ABS(*h);*/
+ *x = MIN2(x0, x1);
+ *x = MIN2(*x, x2);
+ *y = MIN2(y0, y1);
+ *y = MIN2(*y, y2);
+}
+
+
+/*
+ * Make rotation matrix for width X height screen.
+ */
+void
+matrix23Rotate(struct matrix23 *m, int width, int height, int angle)
+{
+ switch (angle) {
+ case 0:
+ matrix23Set(m, 1, 0, 0, 0, 1, 0);
+ break;
+ case 90:
+ matrix23Set(m, 0, 1, 0, -1, 0, width);
+ break;
+ case 180:
+ matrix23Set(m, -1, 0, width, 0, -1, height);
+ break;
+ case 270:
+ matrix23Set(m, 0, -1, height, 1, 0, 0);
+ break;
+ default:
+ /*abort() */ ;
+ }
+}
+
+
+/*
+ * Make flip/reflection matrix for width X height screen.
+ */
+void
+matrix23Flip(struct matrix23 *m, int width, int height, int xflip, int yflip)
+{
+ if (xflip) {
+ m->m00 = -1;
+ m->m01 = 0;
+ m->m02 = width - 1;
+ }
+ else {
+ m->m00 = 1;
+ m->m01 = 0;
+ m->m02 = 0;
+ }
+ if (yflip) {
+ m->m10 = 0;
+ m->m11 = -1;
+ m->m12 = height - 1;
+ }
+ else {
+ m->m10 = 0;
+ m->m11 = 1;
+ m->m12 = 0;
+ }
+}
+
+
+/*
+ * result = a * b
+ */
+void
+matrix23Multiply(struct matrix23 *result,
+ const struct matrix23 *a, const struct matrix23 *b)
+{
+ result->m00 = a->m00 * b->m00 + a->m01 * b->m10;
+ result->m01 = a->m00 * b->m01 + a->m01 * b->m11;
+ result->m02 = a->m00 * b->m02 + a->m01 * b->m12 + a->m02;
+
+ result->m10 = a->m10 * b->m00 + a->m11 * b->m10;
+ result->m11 = a->m10 * b->m01 + a->m11 * b->m11;
+ result->m12 = a->m10 * b->m02 + a->m11 * b->m12 + a->m12;
+}
+
+
+#if 000
+
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+ int width = 500, height = 400;
+ int rot;
+ int fx = 0, fy = 0; /* flip x and/or y ? */
+ int coords[4][2];
+
+ /* four corner coords to test with */
+ coords[0][0] = 0;
+ coords[0][1] = 0;
+ coords[1][0] = width - 1;
+ coords[1][1] = 0;
+ coords[2][0] = width - 1;
+ coords[2][1] = height - 1;
+ coords[3][0] = 0;
+ coords[3][1] = height - 1;
+
+
+ for (rot = 0; rot < 360; rot += 90) {
+ struct matrix23 rotate, flip, m;
+ int i;
+
+ printf("Rot %d, xFlip %d, yFlip %d:\n", rot, fx, fy);
+
+ /* make transformation matrix 'm' */
+ matrix23Rotate(&rotate, width, height, rot);
+ matrix23Flip(&flip, width, height, fx, fy);
+ matrix23Multiply(&m, &rotate, &flip);
+
+ /* xform four coords */
+ for (i = 0; i < 4; i++) {
+ int x = coords[i][0];
+ int y = coords[i][1];
+ matrix23TransformCoordi(&m, &x, &y);
+ printf(" %d, %d -> %d %d\n", coords[i][0], coords[i][1], x, y);
+ }
+
+ /* xform width, height */
+ {
+ int x = width;
+ int y = height;
+ matrix23TransformDistance(&m, &x, &y);
+ printf(" %d x %d -> %d x %d\n", width, height, x, y);
+ }
+
+ /* xform rect */
+ {
+ int x = 50, y = 10, w = 200, h = 100;
+ matrix23TransformRect(&m, &x, &y, &w, &h);
+ printf(" %d,%d %d x %d -> %d, %d %d x %d\n", 50, 10, 200, 100,
+ x, y, w, h);
+ }
+
+ }
+
+ return 0;
+}
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_rotate.h b/src/mesa/drivers/dri/i915tex/intel_rotate.h
new file mode 100644
index 00000000000..9c8802ca477
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_rotate.h
@@ -0,0 +1,39 @@
+#ifndef INTEL_ROTATE_H
+#define INTEL_ROTATE_H 1
+
+struct matrix23
+{
+ int m00, m01, m02;
+ int m10, m11, m12;
+};
+
+
+
+extern void
+matrix23Set(struct matrix23 *m,
+ int m00, int m01, int m02, int m10, int m11, int m12);
+
+extern void matrix23TransformCoordi(const struct matrix23 *m, int *x, int *y);
+
+extern void
+matrix23TransformCoordf(const struct matrix23 *m, float *x, float *y);
+
+extern void
+matrix23TransformDistance(const struct matrix23 *m, int *xDist, int *yDist);
+
+extern void
+matrix23TransformRect(const struct matrix23 *m,
+ int *x, int *y, int *w, int *h);
+
+extern void
+matrix23Rotate(struct matrix23 *m, int width, int height, int angle);
+
+extern void
+matrix23Flip(struct matrix23 *m, int width, int height, int xflip, int yflip);
+
+extern void
+matrix23Multiply(struct matrix23 *result,
+ const struct matrix23 *a, const struct matrix23 *b);
+
+
+#endif /* INTEL_ROTATE_H */
diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c
new file mode 100644
index 00000000000..9bbfabbb8c3
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_screen.c
@@ -0,0 +1,864 @@
+/**************************************************************************
+ *
+ * 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 "vblank.h"
+#include "xmlpool.h"
+
+
+#include "intel_screen.h"
+
+#include "intel_buffers.h"
+#include "intel_tex.h"
+#include "intel_span.h"
+#include "intel_tris.h"
+#include "intel_ioctl.h"
+#include "intel_fbo.h"
+
+#include "i830_dri.h"
+#include "dri_bufpool.h"
+#include "intel_regions.h"
+#include "intel_batchbuffer.h"
+
+PUBLIC 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_QUALITY
+ DRI_CONF_FORCE_S3TC_ENABLE(false)
+ DRI_CONF_ALLOW_LARGE_TEXTURES(1)
+ DRI_CONF_SECTION_END DRI_CONF_END;
+ const GLuint __driNConfigOptions = 4;
+
+#ifdef USE_NEW_INTERFACE
+ static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
+#endif /*USE_NEW_INTERFACE */
+
+ extern const struct dri_extension card_extensions[];
+
+/**
+ * Map all the memory regions described by the screen.
+ * \return GL_TRUE if success, GL_FALSE if error.
+ */
+GLboolean
+intelMapScreenRegions(__DRIscreenPrivate * sPriv)
+{
+ intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+
+ if (intelScreen->front.handle) {
+ if (drmMap(sPriv->fd,
+ intelScreen->front.handle,
+ intelScreen->front.size,
+ (drmAddress *) & intelScreen->front.map) != 0) {
+ _mesa_problem(NULL, "drmMap(frontbuffer) failed!");
+ return GL_FALSE;
+ }
+ }
+ else {
+ _mesa_warning(NULL, "no front buffer handle in intelMapScreenRegions!");
+ }
+
+ if (0)
+ _mesa_printf("Back 0x%08x ", intelScreen->back.handle);
+ if (drmMap(sPriv->fd,
+ intelScreen->back.handle,
+ intelScreen->back.size,
+ (drmAddress *) & intelScreen->back.map) != 0) {
+ intelUnmapScreenRegions(intelScreen);
+ return GL_FALSE;
+ }
+
+ if (0)
+ _mesa_printf("Depth 0x%08x ", intelScreen->depth.handle);
+ if (drmMap(sPriv->fd,
+ intelScreen->depth.handle,
+ intelScreen->depth.size,
+ (drmAddress *) & intelScreen->depth.map) != 0) {
+ intelUnmapScreenRegions(intelScreen);
+ return GL_FALSE;
+ }
+
+#if 0
+ _mesa_printf("TEX 0x%08x ", intelScreen->tex.handle);
+ if (drmMap(sPriv->fd,
+ intelScreen->tex.handle,
+ intelScreen->tex.size,
+ (drmAddress *) & intelScreen->tex.map) != 0) {
+ intelUnmapScreenRegions(intelScreen);
+ return GL_FALSE;
+ }
+#endif
+ if (0)
+ printf("Mappings: front: %p back: %p depth: %p tex: %p\n",
+ intelScreen->front.map,
+ intelScreen->back.map,
+ intelScreen->depth.map, intelScreen->tex.map);
+ return GL_TRUE;
+}
+
+
+static struct intel_region *
+intel_recreate_static(intelScreenPrivate *intelScreen,
+ struct intel_region *region,
+ GLuint mem_type,
+ GLuint offset,
+ void *virtual,
+ GLuint cpp, GLuint pitch, GLuint height)
+{
+ if (region) {
+ intel_region_update_static(intelScreen, region, mem_type, offset,
+ virtual, cpp, pitch, height);
+ } else {
+ region = intel_region_create_static(intelScreen, mem_type, offset,
+ virtual, cpp, pitch, height);
+ }
+ return region;
+}
+
+
+/* Create intel_region structs to describe the static front,back,depth
+ * buffers created by the xserver.
+ *
+ * Although FBO's mean we now no longer use these as render targets in
+ * all circumstances, they won't go away until the back and depth
+ * buffers become private, and the front and rotated buffers will
+ * remain even then.
+ *
+ * Note that these don't allocate video memory, just describe
+ * allocations alread made by the X server.
+ */
+static void
+intel_recreate_static_regions(intelScreenPrivate *intelScreen)
+{
+ intelScreen->front_region =
+ intel_recreate_static(intelScreen,
+ intelScreen->front_region,
+ DRM_BO_FLAG_MEM_TT,
+ intelScreen->front.offset,
+ intelScreen->front.map,
+ intelScreen->cpp,
+ intelScreen->front.pitch / intelScreen->cpp,
+ intelScreen->height);
+
+ intelScreen->rotated_region =
+ intel_recreate_static(intelScreen,
+ intelScreen->rotated_region,
+ DRM_BO_FLAG_MEM_TT,
+ intelScreen->rotated.offset,
+ intelScreen->rotated.map,
+ intelScreen->cpp,
+ intelScreen->rotated.pitch /
+ intelScreen->cpp, intelScreen->height);
+
+
+ intelScreen->back_region =
+ intel_recreate_static(intelScreen,
+ intelScreen->back_region,
+ DRM_BO_FLAG_MEM_TT,
+ intelScreen->back.offset,
+ intelScreen->back.map,
+ intelScreen->cpp,
+ intelScreen->back.pitch / intelScreen->cpp,
+ intelScreen->height);
+
+ /* Still assuming front.cpp == depth.cpp
+ */
+ intelScreen->depth_region =
+ intel_recreate_static(intelScreen,
+ intelScreen->depth_region,
+ DRM_BO_FLAG_MEM_TT,
+ intelScreen->depth.offset,
+ intelScreen->depth.map,
+ intelScreen->cpp,
+ intelScreen->depth.pitch / intelScreen->cpp,
+ intelScreen->height);
+}
+
+/**
+ * Use the information in the sarea to update the screen parameters
+ * related to screen rotation. Needs to be called locked.
+ */
+void
+intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea)
+{
+ intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+
+ intelUnmapScreenRegions(intelScreen);
+ intelUpdateScreenFromSAREA(intelScreen, sarea);
+ if (!intelMapScreenRegions(sPriv)) {
+ fprintf(stderr, "ERROR Remapping screen regions!!!\n");
+ }
+ intel_recreate_static_regions(intelScreen);
+}
+
+
+void
+intelUnmapScreenRegions(intelScreenPrivate * intelScreen)
+{
+#define REALLY_UNMAP 1
+ if (intelScreen->front.map) {
+#if REALLY_UNMAP
+ if (drmUnmap(intelScreen->front.map, intelScreen->front.size) != 0)
+ printf("drmUnmap front failed!\n");
+#endif
+ intelScreen->front.map = NULL;
+ }
+ if (intelScreen->back.map) {
+#if REALLY_UNMAP
+ if (drmUnmap(intelScreen->back.map, intelScreen->back.size) != 0)
+ printf("drmUnmap back failed!\n");
+#endif
+ intelScreen->back.map = NULL;
+ }
+ if (intelScreen->depth.map) {
+#if REALLY_UNMAP
+ drmUnmap(intelScreen->depth.map, intelScreen->depth.size);
+ intelScreen->depth.map = NULL;
+#endif
+ }
+ if (intelScreen->tex.map) {
+#if REALLY_UNMAP
+ drmUnmap(intelScreen->tex.map, intelScreen->tex.size);
+ intelScreen->tex.map = NULL;
+#endif
+ }
+}
+
+
+static void
+intelPrintDRIInfo(intelScreenPrivate * intelScreen,
+ __DRIscreenPrivate * sPriv, I830DRIPtr gDRIPriv)
+{
+ fprintf(stderr, "*** Front size: 0x%x offset: 0x%x pitch: %d\n",
+ intelScreen->front.size, intelScreen->front.offset,
+ intelScreen->front.pitch);
+ fprintf(stderr, "*** Back size: 0x%x offset: 0x%x pitch: %d\n",
+ intelScreen->back.size, intelScreen->back.offset,
+ intelScreen->back.pitch);
+ fprintf(stderr, "*** Depth size: 0x%x offset: 0x%x pitch: %d\n",
+ intelScreen->depth.size, intelScreen->depth.offset,
+ intelScreen->depth.pitch);
+ fprintf(stderr, "*** Rotated size: 0x%x offset: 0x%x pitch: %d\n",
+ intelScreen->rotated.size, intelScreen->rotated.offset,
+ intelScreen->rotated.pitch);
+ fprintf(stderr, "*** Texture size: 0x%x offset: 0x%x\n",
+ intelScreen->tex.size, intelScreen->tex.offset);
+ fprintf(stderr, "*** Memory : 0x%x\n", gDRIPriv->mem);
+}
+
+
+static void
+intelPrintSAREA(const drmI830Sarea * sarea)
+{
+ fprintf(stderr, "SAREA: sarea width %d height %d\n", sarea->width,
+ sarea->height);
+ fprintf(stderr, "SAREA: pitch: %d\n", sarea->pitch);
+ fprintf(stderr,
+ "SAREA: front offset: 0x%08x size: 0x%x handle: 0x%x\n",
+ sarea->front_offset, sarea->front_size,
+ (unsigned) sarea->front_handle);
+ fprintf(stderr,
+ "SAREA: back offset: 0x%08x size: 0x%x handle: 0x%x\n",
+ sarea->back_offset, sarea->back_size,
+ (unsigned) sarea->back_handle);
+ fprintf(stderr, "SAREA: depth offset: 0x%08x size: 0x%x handle: 0x%x\n",
+ sarea->depth_offset, sarea->depth_size,
+ (unsigned) sarea->depth_handle);
+ fprintf(stderr, "SAREA: tex offset: 0x%08x size: 0x%x handle: 0x%x\n",
+ sarea->tex_offset, sarea->tex_size, (unsigned) sarea->tex_handle);
+ fprintf(stderr, "SAREA: rotation: %d\n", sarea->rotation);
+ fprintf(stderr,
+ "SAREA: rotated offset: 0x%08x size: 0x%x\n",
+ sarea->rotated_offset, sarea->rotated_size);
+ fprintf(stderr, "SAREA: rotated pitch: %d\n", sarea->rotated_pitch);
+}
+
+
+/**
+ * A number of the screen parameters are obtained/computed from
+ * information in the SAREA. This function updates those parameters.
+ */
+void
+intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
+ drmI830Sarea * sarea)
+{
+ intelScreen->width = sarea->width;
+ intelScreen->height = sarea->height;
+
+ intelScreen->front.offset = sarea->front_offset;
+ intelScreen->front.pitch = sarea->pitch * intelScreen->cpp;
+ intelScreen->front.handle = sarea->front_handle;
+ intelScreen->front.size = sarea->front_size;
+
+ intelScreen->back.offset = sarea->back_offset;
+ intelScreen->back.pitch = sarea->pitch * intelScreen->cpp;
+ intelScreen->back.handle = sarea->back_handle;
+ intelScreen->back.size = sarea->back_size;
+
+ intelScreen->depth.offset = sarea->depth_offset;
+ intelScreen->depth.pitch = sarea->pitch * intelScreen->cpp;
+ intelScreen->depth.handle = sarea->depth_handle;
+ intelScreen->depth.size = sarea->depth_size;
+
+ intelScreen->tex.offset = sarea->tex_offset;
+ intelScreen->logTextureGranularity = sarea->log_tex_granularity;
+ intelScreen->tex.handle = sarea->tex_handle;
+ intelScreen->tex.size = sarea->tex_size;
+
+ intelScreen->rotated.offset = sarea->rotated_offset;
+ intelScreen->rotated.pitch = sarea->rotated_pitch * intelScreen->cpp;
+ intelScreen->rotated.size = sarea->rotated_size;
+ intelScreen->current_rotation = sarea->rotation;
+ matrix23Rotate(&intelScreen->rotMatrix,
+ sarea->width, sarea->height, sarea->rotation);
+ intelScreen->rotatedWidth = sarea->virtualX;
+ intelScreen->rotatedHeight = sarea->virtualY;
+
+ if (0)
+ intelPrintSAREA(sarea);
+}
+
+
+static GLboolean
+intelInitDriver(__DRIscreenPrivate * sPriv)
+{
+ intelScreenPrivate *intelScreen;
+ I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
+ drmI830Sarea *sarea;
+ unsigned batchPoolSize = 1024*1024;
+
+ 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->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
+ sarea = (drmI830Sarea *)
+ (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset);
+
+ intelScreen->maxBatchSize = BATCH_SZ;
+ intelScreen->deviceID = gDRIPriv->deviceID;
+ if (intelScreen->deviceID == PCI_CHIP_I865_G)
+ intelScreen->maxBatchSize = 4096;
+ batchPoolSize /= intelScreen->maxBatchSize;
+
+ intelScreen->mem = gDRIPriv->mem;
+ intelScreen->cpp = gDRIPriv->cpp;
+
+ switch (gDRIPriv->bitsPerPixel) {
+ case 16:
+ intelScreen->fbFormat = DV_PF_565;
+ break;
+ case 32:
+ intelScreen->fbFormat = DV_PF_8888;
+ break;
+ default:
+ exit(1);
+ break;
+ }
+
+ intelUpdateScreenFromSAREA(intelScreen, sarea);
+
+ if (!intelMapScreenRegions(sPriv)) {
+ fprintf(stderr, "\nERROR! mapping regions\n");
+ _mesa_free(intelScreen);
+ sPriv->private = NULL;
+ return GL_FALSE;
+ }
+
+#if 0
+
+ /*
+ * FIXME: Remove this code and its references.
+ */
+
+ intelScreen->tex.offset = gDRIPriv->textureOffset;
+ intelScreen->logTextureGranularity = gDRIPriv->logTextureGranularity;
+ intelScreen->tex.handle = gDRIPriv->textures;
+ intelScreen->tex.size = gDRIPriv->textureSize;
+
+#else
+ intelScreen->tex.offset = 0;
+ intelScreen->logTextureGranularity = 0;
+ intelScreen->tex.handle = 0;
+ intelScreen->tex.size = 0;
+#endif
+
+ intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
+
+ if (0)
+ intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv);
+
+ intelScreen->drmMinor = sPriv->drmMinor;
+
+ /* Determine if IRQs are active? */
+ {
+ 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;
+ }
+ }
+
+ /* Determine if batchbuffers are allowed */
+ {
+ 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_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_SGI_make_current_read");
+ }
+
+ intelScreen->regionPool = driDRMPoolInit(sPriv->fd);
+
+ if (!intelScreen->regionPool)
+ return GL_FALSE;
+
+ intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
+
+ if (!intelScreen->staticPool)
+ return GL_FALSE;
+
+ intelScreen->texPool = intelScreen->regionPool;
+
+ intelScreen->batchPool = driBatchPoolInit(sPriv->fd,
+ DRM_BO_FLAG_EXE |
+ DRM_BO_FLAG_MEM_TT |
+ DRM_BO_FLAG_MEM_LOCAL,
+ intelScreen->maxBatchSize,
+ batchPoolSize, 5);
+ if (!intelScreen->batchPool) {
+ fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
+ return GL_FALSE;
+ }
+
+ intel_recreate_static_regions(intelScreen);
+
+ return GL_TRUE;
+}
+
+
+static void
+intelDestroyScreen(__DRIscreenPrivate * sPriv)
+{
+ intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+
+ intelUnmapScreenRegions(intelScreen);
+
+ driPoolTakeDown(intelScreen->regionPool);
+ driPoolTakeDown(intelScreen->staticPool);
+ driPoolTakeDown(intelScreen->batchPool);
+ FREE(intelScreen);
+ sPriv->private = NULL;
+}
+
+
+/**
+ * This is called when we need to set up GL rendering to a new X window.
+ */
+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);
+ GLenum rgbFormat = (mesaVis->redBits == 5 ? GL_RGB5 : GL_RGBA8);
+
+ struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
+
+ /* setup the hardware-based renderbuffers */
+ {
+ struct intel_renderbuffer *frontRb
+ = intel_create_renderbuffer(rgbFormat,
+ screen->width, screen->height,
+ screen->front.offset,
+ screen->front.pitch,
+ screen->cpp,
+ screen->front.map);
+ intel_set_span_functions(&frontRb->Base);
+ _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
+ }
+
+ if (mesaVis->doubleBufferMode) {
+ struct intel_renderbuffer *backRb
+ = intel_create_renderbuffer(rgbFormat,
+ screen->width, screen->height,
+ screen->back.offset,
+ screen->back.pitch,
+ screen->cpp,
+ screen->back.map);
+ intel_set_span_functions(&backRb->Base);
+ _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
+ }
+
+ if (mesaVis->depthBits == 24 && mesaVis->stencilBits == 8) {
+ /* combined depth/stencil buffer */
+ struct intel_renderbuffer *depthStencilRb
+ = intel_create_renderbuffer(GL_DEPTH24_STENCIL8_EXT,
+ screen->width, screen->height,
+ screen->depth.offset,
+ screen->depth.pitch,
+ screen->cpp, /* 4! */
+ screen->depth.map);
+ intel_set_span_functions(&depthStencilRb->Base);
+ /* note: bind RB to two attachment points */
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthStencilRb->Base);
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &depthStencilRb->Base);
+ }
+ else if (mesaVis->depthBits == 16) {
+ /* just 16-bit depth buffer, no hw stencil */
+ struct intel_renderbuffer *depthRb
+ = intel_create_renderbuffer(GL_DEPTH_COMPONENT16,
+ screen->width, screen->height,
+ screen->depth.offset,
+ screen->depth.pitch,
+ screen->cpp, /* 2! */
+ screen->depth.map);
+ intel_set_span_functions(&depthRb->Base);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+ }
+
+ /* now add any/all software-based renderbuffers we may need */
+ _mesa_add_soft_renderbuffers(fb, GL_FALSE, /* never sw color */
+ GL_FALSE, /* never sw depth */
+ swStencil, mesaVis->accumRedBits > 0, GL_FALSE, /* never sw alpha */
+ GL_FALSE /* never sw aux */ );
+ driDrawPriv->driverPrivate = (void *) fb;
+
+ return (driDrawPriv->driverPrivate != NULL);
+ }
+}
+
+static void
+intelDestroyBuffer(__DRIdrawablePrivate * driDrawPriv)
+{
+ _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
+}
+
+
+/**
+ * Get information about previous buffer swaps.
+ */
+static int
+intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
+{
+ struct intel_context *intel;
+
+ if ((dPriv == NULL) || (dPriv->driContextPriv == NULL)
+ || (dPriv->driContextPriv->driverPrivate == NULL)
+ || (sInfo == NULL)) {
+ return -1;
+ }
+
+ intel = dPriv->driContextPriv->driverPrivate;
+ sInfo->swap_count = intel->swap_count;
+ sInfo->swap_ust = intel->swap_ust;
+ sInfo->swap_missed_count = intel->swap_missed_count;
+
+ sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
+ ? driCalculateSwapUsage(dPriv, 0, intel->swap_missed_ust)
+ : 0.0;
+
+ return 0;
+}
+
+
+/* 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) {
+ /* Don't deal with i830 until texture work complete:
+ */
+ 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:
+ case PCI_CHIP_I945_GM:
+ 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 = intelGetSwapInfo,
+ .GetMSC = driGetMSC32,
+ .WaitForMSC = driWaitForMSC32,
+ .WaitForSBC = NULL,
+ .SwapBuffersMSC = NULL,
+ .CopySubBuffer = intelCopySubBuffer
+};
+
+
+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, 5, 0 };
+ static const __DRIversion dri_expected = { 4, 0, 0 };
+ static const __DRIversion drm_expected = { 1, 7, 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, 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;
+}
+
+struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen)
+{
+ /*
+ * This should probably change to have the screen allocate a dummy
+ * context at screen creation. For now just use the current context.
+ */
+
+ GET_CURRENT_CONTEXT(ctx);
+ if (ctx == NULL) {
+ _mesa_problem(NULL, "No current context in intelScreenContext\n");
+ return NULL;
+ }
+ return intel_context(ctx);
+}
+
diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.h b/src/mesa/drivers/dri/i915tex/intel_screen.h
new file mode 100644
index 00000000000..17698773f3d
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_screen.h
@@ -0,0 +1,132 @@
+/**************************************************************************
+ *
+ * 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 "intel_rotate.h"
+#include "i830_common.h"
+#include "xmlconfig.h"
+#include "dri_bufpool.h"
+
+/* XXX: change name or eliminate to avoid conflict with "struct
+ * intel_region"!!!
+ */
+typedef struct
+{
+ drm_handle_t handle;
+ drmSize size; /* region size in bytes */
+ char *map; /* memory map */
+ int offset; /* from start of video mem, in bytes */
+ int pitch; /* row stride, in bytes */
+} intelRegion;
+
+typedef struct
+{
+ intelRegion front;
+ intelRegion back;
+ intelRegion rotated;
+ intelRegion depth;
+ intelRegion tex;
+
+ struct intel_region *front_region;
+ struct intel_region *back_region;
+ struct intel_region *depth_region;
+ struct intel_region *rotated_region;
+
+ int deviceID;
+ int width;
+ int height;
+ int mem; /* unused */
+
+ int cpp; /* for front and back buffers */
+/* int bitsPerPixel; */
+ int fbFormat; /* XXX FBO: this is obsolete - remove after i830 updates */
+
+ int logTextureGranularity;
+
+ __DRIscreenPrivate *driScrnPriv;
+ unsigned int sarea_priv_offset;
+
+ int drmMinor;
+
+ int irq_active;
+ int allow_batchbuffer;
+
+ struct matrix23 rotMatrix;
+
+ int current_rotation; /* 0, 90, 180 or 270 */
+ int rotatedWidth, rotatedHeight;
+
+ /**
+ * Configuration cache with default values for all contexts
+ */
+ driOptionCache optionCache;
+ struct _DriBufferPool *batchPool;
+ struct _DriBufferPool *texPool;
+ struct _DriBufferPool *regionPool;
+ struct _DriBufferPool *staticPool;
+ unsigned int maxBatchSize;
+} intelScreenPrivate;
+
+
+
+extern GLboolean intelMapScreenRegions(__DRIscreenPrivate * sPriv);
+
+extern void intelUnmapScreenRegions(intelScreenPrivate * intelScreen);
+
+extern void
+intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
+ drmI830Sarea * sarea);
+
+extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv);
+
+extern GLboolean intelUnbindContext(__DRIcontextPrivate * driContextPriv);
+
+extern GLboolean
+intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
+ __DRIdrawablePrivate * driDrawPriv,
+ __DRIdrawablePrivate * driReadPriv);
+
+extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
+
+extern void
+intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h);
+
+extern struct _DriBufferPool *driBatchPoolInit(int fd, unsigned flags,
+ unsigned long bufSize,
+ unsigned numBufs,
+ unsigned checkDelayed);
+
+extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen);
+
+extern void
+intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea);
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_span.c b/src/mesa/drivers/dri/i915tex/intel_span.c
new file mode 100644
index 00000000000..ab0874e4fd6
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_span.c
@@ -0,0 +1,409 @@
+/**************************************************************************
+ *
+ * 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_fbo.h"
+#include "intel_screen.h"
+#include "intel_span.h"
+#include "intel_regions.h"
+#include "intel_ioctl.h"
+#include "intel_tex.h"
+
+#include "swrast/swrast.h"
+
+/*
+ break intelWriteRGBASpan_ARGB8888
+*/
+
+#undef DBG
+#define DBG 0
+
+#define LOCAL_VARS \
+ struct intel_context *intel = intel_context(ctx); \
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \
+ const GLint yScale = irb->RenderToTexture ? 1 : -1; \
+ const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \
+ GLubyte *buf = (GLubyte *) irb->pfMap \
+ + (intel->drawY * irb->pfPitch + intel->drawX) * irb->region->cpp;\
+ GLuint p; \
+ assert(irb->pfMap);\
+ (void) p;
+
+/* XXX FBO: this is identical to the macro in spantmp2.h except we get
+ * the cliprect info from the context, not the driDrawable.
+ * Move this into spantmp2.h someday.
+ */
+#define HW_CLIPLOOP() \
+ do { \
+ int _nc = intel->numClipRects; \
+ while ( _nc-- ) { \
+ int minx = intel->pClipRects[_nc].x1 - intel->drawX; \
+ int miny = intel->pClipRects[_nc].y1 - intel->drawY; \
+ int maxx = intel->pClipRects[_nc].x2 - intel->drawX; \
+ int maxy = intel->pClipRects[_nc].y2 - intel->drawY;
+
+
+
+
+#define Y_FLIP(_y) ((_y) * yScale + yBias)
+
+#define HW_LOCK()
+
+#define HW_UNLOCK()
+
+/* 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) intel##x##_RGB565
+#define TAG2(x,y) intel##x##_RGB565##y
+#define GET_PTR(X,Y) (buf + ((Y) * irb->pfPitch + (X)) * 2)
+#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) intel##x##_ARGB8888
+#define TAG2(x,y) intel##x##_ARGB8888##y
+#define GET_PTR(X,Y) (buf + ((Y) * irb->pfPitch + (X)) * 4)
+#include "spantmp2.h"
+
+
+#define LOCAL_DEPTH_VARS \
+ struct intel_context *intel = intel_context(ctx); \
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \
+ const GLuint pitch = irb->pfPitch/***XXX region->pitch*/; /* in pixels */ \
+ const GLint yScale = irb->RenderToTexture ? 1 : -1; \
+ const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \
+ char *buf = (char *) irb->pfMap/*XXX use region->map*/ + \
+ (intel->drawY * pitch + intel->drawX) * irb->region->cpp;
+
+
+#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
+
+/**
+ ** 16-bit depthbuffer functions.
+ **/
+#define WRITE_DEPTH( _x, _y, d ) \
+ ((GLushort *)buf)[(_x) + (_y) * pitch] = d;
+
+#define READ_DEPTH( d, _x, _y ) \
+ d = ((GLushort *)buf)[(_x) + (_y) * pitch];
+
+
+#define TAG(x) intel##x##_z16
+#include "depthtmp.h"
+
+
+/**
+ ** 24/8-bit interleaved depth/stencil functions
+ ** Note: we're actually reading back combined depth+stencil values.
+ ** The wrappers in main/depthstencil.c are used to extract the depth
+ ** and stencil values.
+ **/
+/* Change ZZZS -> SZZZ */
+#define WRITE_DEPTH( _x, _y, d ) { \
+ GLuint tmp = ((d) >> 8) | ((d) << 24); \
+ ((GLuint *)buf)[(_x) + (_y) * pitch] = tmp; \
+}
+
+/* Change SZZZ -> ZZZS */
+#define READ_DEPTH( d, _x, _y ) { \
+ GLuint tmp = ((GLuint *)buf)[(_x) + (_y) * pitch]; \
+ d = (tmp << 8) | (tmp >> 24); \
+}
+
+#define TAG(x) intel##x##_z24_s8
+#include "depthtmp.h"
+
+
+/**
+ ** 8-bit stencil function (XXX FBO: This is obsolete)
+ **/
+#define WRITE_STENCIL( _x, _y, d ) { \
+ GLuint tmp = ((GLuint *)buf)[(_x) + (_y) * pitch]; \
+ tmp &= 0xffffff; \
+ tmp |= ((d) << 24); \
+ ((GLuint *) buf)[(_x) + (_y) * pitch] = tmp; \
+}
+
+#define READ_STENCIL( d, _x, _y ) \
+ d = ((GLuint *)buf)[(_x) + (_y) * pitch] >> 24;
+
+#define TAG(x) intel##x##_z24_s8
+#include "stenciltmp.h"
+
+
+
+/**
+ * Map or unmap all the renderbuffers which we may need during
+ * software rendering.
+ * XXX in the future, we could probably convey extra information to
+ * reduce the number of mappings needed. I.e. if doing a glReadPixels
+ * from the depth buffer, we really only need one mapping.
+ *
+ * XXX Rewrite this function someday.
+ * We can probably just loop over all the renderbuffer attachments,
+ * map/unmap all of them, and not worry about the _ColorDrawBuffers
+ * _ColorReadBuffer, _DepthBuffer or _StencilBuffer fields.
+ */
+static void
+intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
+{
+ GLcontext *ctx = &intel->ctx;
+ GLuint i, j;
+ struct intel_renderbuffer *irb;
+
+ /* color draw buffers */
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ for (j = 0; j < ctx->DrawBuffer->_NumColorDrawBuffers[i]; j++) {
+ struct gl_renderbuffer *rb =
+ ctx->DrawBuffer->_ColorDrawBuffers[i][j];
+ irb = intel_renderbuffer(rb);
+ if (irb) {
+ /* this is a user-created intel_renderbuffer */
+ if (irb->region) {
+ if (map)
+ intel_region_map(intel->intelScreen, irb->region);
+ else
+ intel_region_unmap(intel->intelScreen, irb->region);
+ }
+ irb->pfMap = irb->region->map;
+ irb->pfPitch = irb->region->pitch;
+ }
+ }
+ }
+
+ /* check for render to textures */
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att =
+ ctx->DrawBuffer->Attachment + i;
+ struct gl_texture_object *tex = att->Texture;
+ if (tex) {
+ /* render to texture */
+ ASSERT(att->Renderbuffer);
+ if (map) {
+ struct gl_texture_image *texImg;
+ texImg = tex->Image[att->CubeMapFace][att->TextureLevel];
+ intel_tex_map_images(intel, intel_texture_object(tex));
+ }
+ else {
+ intel_tex_unmap_images(intel, intel_texture_object(tex));
+ }
+ }
+ }
+
+ /* color read buffers */
+ irb = intel_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
+ if (irb && irb->region) {
+ if (map)
+ intel_region_map(intel->intelScreen, irb->region);
+ else
+ intel_region_unmap(intel->intelScreen, irb->region);
+ irb->pfMap = irb->region->map;
+ irb->pfPitch = irb->region->pitch;
+ }
+
+ /* Account for front/back color page flipping.
+ * The span routines use the pfMap and pfPitch fields which will
+ * swap the front/back region map/pitch if we're page flipped.
+ * Do this after mapping, above, so the map field is valid.
+ */
+#if 0
+ if (map && ctx->DrawBuffer->Name == 0) {
+ struct intel_renderbuffer *irbFront
+ = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_FRONT_LEFT);
+ struct intel_renderbuffer *irbBack
+ = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_BACK_LEFT);
+ if (irbBack) {
+ /* double buffered */
+ if (intel->sarea->pf_current_page == 0) {
+ irbFront->pfMap = irbFront->region->map;
+ irbFront->pfPitch = irbFront->region->pitch;
+ irbBack->pfMap = irbBack->region->map;
+ irbBack->pfPitch = irbBack->region->pitch;
+ }
+ else {
+ irbFront->pfMap = irbBack->region->map;
+ irbFront->pfPitch = irbBack->region->pitch;
+ irbBack->pfMap = irbFront->region->map;
+ irbBack->pfPitch = irbFront->region->pitch;
+ }
+ }
+ }
+#endif
+
+ /* depth buffer (Note wrapper!) */
+ if (ctx->DrawBuffer->_DepthBuffer) {
+ irb = intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped);
+ if (irb && irb->region && irb->Base.Name != 0) {
+ if (map) {
+ intel_region_map(intel->intelScreen, irb->region);
+ irb->pfMap = irb->region->map;
+ irb->pfPitch = irb->region->pitch;
+ }
+ else {
+ intel_region_unmap(intel->intelScreen, irb->region);
+ irb->pfMap = NULL;
+ irb->pfPitch = 0;
+ }
+ }
+ }
+
+ /* stencil buffer (Note wrapper!) */
+ if (ctx->DrawBuffer->_StencilBuffer) {
+ irb = intel_renderbuffer(ctx->DrawBuffer->_StencilBuffer->Wrapped);
+ if (irb && irb->region && irb->Base.Name != 0) {
+ if (map) {
+ intel_region_map(intel->intelScreen, irb->region);
+ irb->pfMap = irb->region->map;
+ irb->pfPitch = irb->region->pitch;
+ }
+ else {
+ intel_region_unmap(intel->intelScreen, irb->region);
+ irb->pfMap = NULL;
+ irb->pfPitch = 0;
+ }
+ }
+ }
+}
+
+
+
+/**
+ * Prepare for softare rendering. Map current read/draw framebuffers'
+ * renderbuffes and all currently bound texture objects.
+ *
+ * Old note: Moved locking out to get reasonable span performance.
+ */
+void
+intelSpanRenderStart(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLuint i;
+
+ intelFinish(&intel->ctx);
+ LOCK_HARDWARE(intel);
+
+#if 0
+ /* Just map the framebuffer and all textures. Bufmgr code will
+ * take care of waiting on the necessary fences:
+ */
+ intel_region_map(intel->intelScreen, intel->front_region);
+ intel_region_map(intel->intelScreen, intel->back_region);
+ intel_region_map(intel->intelScreen, intel->intelScreen->depth_region);
+#endif
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+ intel_tex_map_images(intel, intel_texture_object(texObj));
+ }
+ }
+
+ intel_map_unmap_buffers(intel, GL_TRUE);
+}
+
+/**
+ * Called when done softare rendering. Unmap the buffers we mapped in
+ * the above function.
+ */
+void
+intelSpanRenderFinish(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLuint i;
+
+ _swrast_flush(ctx);
+
+ /* Now unmap the framebuffer:
+ */
+#if 0
+ intel_region_unmap(intel, intel->front_region);
+ intel_region_unmap(intel, intel->back_region);
+ intel_region_unmap(intel, intel->intelScreen->depth_region);
+#endif
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+ intel_tex_unmap_images(intel, intel_texture_object(texObj));
+ }
+ }
+
+ intel_map_unmap_buffers(intel, GL_FALSE);
+
+ UNLOCK_HARDWARE(intel);
+}
+
+
+void
+intelInitSpanFuncs(GLcontext * ctx)
+{
+ struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
+ swdd->SpanRenderStart = intelSpanRenderStart;
+ swdd->SpanRenderFinish = intelSpanRenderFinish;
+}
+
+
+/**
+ * Plug in appropriate span read/write functions for the given renderbuffer.
+ * These are used for the software fallbacks.
+ */
+void
+intel_set_span_functions(struct gl_renderbuffer *rb)
+{
+ if (rb->_ActualFormat == GL_RGB5) {
+ /* 565 RGB */
+ intelInitPointers_RGB565(rb);
+ }
+ else if (rb->_ActualFormat == GL_RGBA8) {
+ /* 8888 RGBA */
+ intelInitPointers_ARGB8888(rb);
+ }
+ else if (rb->_ActualFormat == GL_DEPTH_COMPONENT16) {
+ intelInitDepthPointers_z16(rb);
+ }
+ else if (rb->_ActualFormat == GL_DEPTH_COMPONENT24 || /* XXX FBO remove */
+ rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) {
+ intelInitDepthPointers_z24_s8(rb);
+ }
+ else if (rb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { /* XXX FBO remove */
+ intelInitStencilPointers_z24_s8(rb);
+ }
+ else {
+ _mesa_problem(NULL,
+ "Unexpected _ActualFormat in intelSetSpanFunctions");
+ }
+}
diff --git a/src/glx/mini/dispatch.c b/src/mesa/drivers/dri/i915tex/intel_span.h
index ac24df9e7d4..5201f6d6c6e 100644
--- a/src/glx/mini/dispatch.c
+++ b/src/mesa/drivers/dri/i915tex/intel_span.h
@@ -1,17 +1,6 @@
-/**
- * \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.
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -29,36 +18,21 @@
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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
+ * 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 "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
+#ifndef _INTEL_SPAN_H
+#define _INTEL_SPAN_H
-#define RETURN_DISPATCH(func, args, msg) \
- const struct _glapi_table *dispatch; \
- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
- return (dispatch->func) args
+extern void intelInitSpanFuncs(GLcontext * ctx);
+extern void intelSpanRenderFinish(GLcontext * ctx);
+extern void intelSpanRenderStart(GLcontext * ctx);
-#include "glapitemp.h"
+extern void intel_set_span_functions(struct gl_renderbuffer *rb);
-#endif /* USE_X86_ASM */
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_state.c b/src/mesa/drivers/dri/i915tex/intel_state.c
new file mode 100644
index 00000000000..f85d8ef8353
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_state.c
@@ -0,0 +1,363 @@
+/**************************************************************************
+ *
+ * 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 "colormac.h"
+#include "dd.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_fbo.h"
+#include "intel_regions.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
+intelClearColor(GLcontext * ctx, const GLfloat color[4])
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLubyte clear[4];
+
+ CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]);
+
+ /* compute both 32 and 16-bit clear values */
+ intel->ClearColor8888 = INTEL_PACKCOLOR8888(clear[0], clear[1],
+ clear[2], clear[3]);
+ intel->ClearColor565 = INTEL_PACKCOLOR565(clear[0], clear[1], clear[2]);
+}
+
+
+/**
+ * Update the viewport transformation matrix. Depends on:
+ * - viewport pos/size
+ * - depthrange
+ * - window pos/size or FBO size
+ */
+static void
+intelCalcViewport(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
+ GLfloat *m = intel->ViewportMatrix.m;
+ GLfloat yScale, yBias;
+
+ if (ctx->DrawBuffer->Name) {
+ /* User created FBO */
+ struct intel_renderbuffer *irb
+ = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]);
+ if (irb && !irb->RenderToTexture) {
+ /* y=0=top */
+ yScale = -1.0;
+ yBias = irb->Base.Height;
+ }
+ else {
+ /* y=0=bottom */
+ yScale = 1.0;
+ yBias = 0.0;
+ }
+ }
+ else {
+ /* window buffer, y=0=top */
+ yScale = -1.0;
+ yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F;
+ }
+
+ m[MAT_SX] = v[MAT_SX];
+ m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X;
+
+ m[MAT_SY] = v[MAT_SY] * yScale;
+ m[MAT_TY] = v[MAT_TY] * yScale + yBias + SUBPIXEL_Y;
+
+ m[MAT_SZ] = v[MAT_SZ] * depthScale;
+ m[MAT_TZ] = v[MAT_TZ] * depthScale;
+}
+
+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)
+{
+ struct intel_context *intel = intel_context(ctx);
+ FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER));
+}
+
+
+void
+intelInitStateFuncs(struct dd_function_table *functions)
+{
+ functions->RenderMode = intelRenderMode;
+ functions->Viewport = intelViewport;
+ functions->DepthRange = intelDepthRange;
+ functions->ClearColor = intelClearColor;
+}
+
+
+
+
+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.StencilFuncSeparate(ctx, GL_FRONT,
+ ctx->Stencil.Function[0],
+ ctx->Stencil.Ref[0],
+ ctx->Stencil.ValueMask[0]);
+ ctx->Driver.StencilFuncSeparate(ctx, GL_BACK,
+ ctx->Stencil.Function[1],
+ ctx->Stencil.Ref[1],
+ ctx->Stencil.ValueMask[1]);
+ ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]);
+ ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]);
+ ctx->Driver.StencilOpSeparate(ctx, GL_FRONT,
+ ctx->Stencil.FailFunc[0],
+ ctx->Stencil.ZFailFunc[0],
+ ctx->Stencil.ZPassFunc[0]);
+ ctx->Driver.StencilOpSeparate(ctx, GL_BACK,
+ ctx->Stencil.FailFunc[1],
+ ctx->Stencil.ZFailFunc[1],
+ ctx->Stencil.ZPassFunc[1]);
+
+
+ /* XXX this isn't really needed */
+ ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]);
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_structs.h b/src/mesa/drivers/dri/i915tex/intel_structs.h
new file mode 100644
index 00000000000..522e3bd92c2
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_structs.h
@@ -0,0 +1,132 @@
+#ifndef INTEL_STRUCTS_H
+#define INTEL_STRUCTS_H
+
+struct br0 {
+ GLuint length:8;
+ GLuint pad0:3;
+ GLuint dst_tiled:1;
+ GLuint pad1:8;
+ GLuint write_rgb:1;
+ GLuint write_alpha:1;
+ GLuint opcode:7;
+ GLuint client:3;
+};
+
+
+struct br13 {
+ GLint dest_pitch:16;
+ GLuint rop:8;
+ GLuint color_depth:2;
+ GLuint pad1:3;
+ GLuint mono_source_transparency:1;
+ GLuint clipping_enable:1;
+ GLuint pad0:1;
+};
+
+
+
+/* This is an attempt to move some of the 2D interaction in this
+ * driver to using structs for packets rather than a bunch of #defines
+ * and dwords.
+ */
+struct xy_color_blit {
+ struct br0 br0;
+ struct br13 br13;
+
+ struct {
+ GLuint dest_x1:16;
+ GLuint dest_y1:16;
+ } dw2;
+
+ struct {
+ GLuint dest_x2:16;
+ GLuint dest_y2:16;
+ } dw3;
+
+ GLuint dest_base_addr;
+ GLuint color;
+};
+
+struct xy_src_copy_blit {
+ struct br0 br0;
+ struct br13 br13;
+
+ struct {
+ GLuint dest_x1:16;
+ GLuint dest_y1:16;
+ } dw2;
+
+ struct {
+ GLuint dest_x2:16;
+ GLuint dest_y2:16;
+ } dw3;
+
+ GLuint dest_base_addr;
+
+ struct {
+ GLuint src_x1:16;
+ GLuint src_y1:16;
+ } dw5;
+
+ struct {
+ GLint src_pitch:16;
+ GLuint pad:16;
+ } dw6;
+
+ GLuint src_base_addr;
+};
+
+struct xy_setup_blit {
+ struct br0 br0;
+ struct br13 br13;
+
+ struct {
+ GLuint clip_x1:16;
+ GLuint clip_y1:16;
+ } dw2;
+
+ struct {
+ GLuint clip_x2:16;
+ GLuint clip_y2:16;
+ } dw3;
+
+ GLuint dest_base_addr;
+ GLuint background_color;
+ GLuint foreground_color;
+ GLuint pattern_base_addr;
+};
+
+
+struct xy_text_immediate_blit {
+ struct {
+ GLuint length:8;
+ GLuint pad2:3;
+ GLuint dst_tiled:1;
+ GLuint pad1:4;
+ GLuint byte_packed:1;
+ GLuint pad0:5;
+ GLuint opcode:7;
+ GLuint client:3;
+ } dw0;
+
+ struct {
+ GLuint dest_x1:16;
+ GLuint dest_y1:16;
+ } dw1;
+
+ struct {
+ GLuint dest_x2:16;
+ GLuint dest_y2:16;
+ } dw2;
+
+ /* Src bitmap data follows as inline dwords.
+ */
+};
+
+
+#define CLIENT_2D 0x2
+#define OPCODE_XY_SETUP_BLT 0x1
+#define OPCODE_XY_COLOR_BLT 0x50
+#define OPCODE_XY_TEXT_IMMEDIATE_BLT 0x31
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.c b/src/mesa/drivers/dri/i915tex/intel_tex.c
new file mode 100644
index 00000000000..b08dee43bc1
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex.c
@@ -0,0 +1,192 @@
+#include "texobj.h"
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_tex.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+static GLboolean
+intelIsTextureResident(GLcontext * ctx, struct gl_texture_object *texObj)
+{
+#if 0
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_object *intelObj = intel_texture_object(texObj);
+
+ return
+ intelObj->mt &&
+ intelObj->mt->region &&
+ intel_is_region_resident(intel, intelObj->mt->region);
+#endif
+ return 1;
+}
+
+
+
+static struct gl_texture_image *
+intelNewTextureImage(GLcontext * ctx)
+{
+ DBG("%s\n", __FUNCTION__);
+ (void) ctx;
+ return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image);
+}
+
+
+static struct gl_texture_object *
+intelNewTextureObject(GLcontext * ctx, GLuint name, GLenum target)
+{
+ struct intel_texture_object *obj = CALLOC_STRUCT(intel_texture_object);
+
+ DBG("%s\n", __FUNCTION__);
+ _mesa_initialize_texture_object(&obj->base, name, target);
+
+ return &obj->base;
+}
+
+static void
+intelDeleteTextureObject(GLcontext *ctx,
+ struct gl_texture_object *texObj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_object *intelObj = intel_texture_object(texObj);
+
+ if (intelObj->mt)
+ intel_miptree_release(intel, &intelObj->mt);
+
+ _mesa_delete_texture_object(ctx, texObj);
+}
+
+
+static void
+intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (intelImage->mt) {
+ intel_miptree_release(intel, &intelImage->mt);
+ }
+
+ if (texImage->Data) {
+ free(texImage->Data);
+ texImage->Data = NULL;
+ }
+}
+
+
+/* The system memcpy (at least on ubuntu 5.10) has problems copying
+ * to agp (writecombined) memory from a source which isn't 64-byte
+ * aligned - there is a 4x performance falloff.
+ *
+ * The x86 __memcpy is immune to this but is slightly slower
+ * (10%-ish) than the system memcpy.
+ *
+ * The sse_memcpy seems to have a slight cliff at 64/32 bytes, but
+ * isn't much faster than x86_memcpy for agp copies.
+ *
+ * TODO: switch dynamically.
+ */
+static void *
+do_memcpy(void *dest, const void *src, size_t n)
+{
+ if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) {
+ return __memcpy(dest, src, n);
+ }
+ else
+ return memcpy(dest, src, n);
+}
+
+
+#if DO_DEBUG
+
+#ifndef __x86_64__
+static unsigned
+fastrdtsc(void)
+{
+ unsigned eax;
+ __asm__ volatile ("\t"
+ "pushl %%ebx\n\t"
+ "cpuid\n\t" ".byte 0x0f, 0x31\n\t"
+ "popl %%ebx\n":"=a" (eax)
+ :"0"(0)
+ :"ecx", "edx", "cc");
+
+ return eax;
+}
+#else
+static unsigned
+fastrdtsc(void)
+{
+ unsigned eax;
+ __asm__ volatile ("\t" "cpuid\n\t" ".byte 0x0f, 0x31\n\t":"=a" (eax)
+ :"0"(0)
+ :"ecx", "edx", "ebx", "cc");
+
+ return eax;
+}
+#endif
+
+static unsigned
+time_diff(unsigned t, unsigned t2)
+{
+ return ((t < t2) ? t2 - t : 0xFFFFFFFFU - (t - t2 - 1));
+}
+
+
+static void *
+timed_memcpy(void *dest, const void *src, size_t n)
+{
+ void *ret;
+ unsigned t1, t2;
+ double rate;
+
+ if ((((unsigned) src) & 63) || (((unsigned) dest) & 63))
+ _mesa_printf("Warning - non-aligned texture copy!\n");
+
+ t1 = fastrdtsc();
+ ret = do_memcpy(dest, src, n);
+ t2 = fastrdtsc();
+
+ rate = time_diff(t1, t2);
+ rate /= (double) n;
+ _mesa_printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate);
+ return ret;
+}
+#endif /* DO_DEBUG */
+
+
+void
+intelInitTextureFuncs(struct dd_function_table *functions)
+{
+ functions->ChooseTextureFormat = intelChooseTextureFormat;
+ functions->TexImage1D = intelTexImage1D;
+ functions->TexImage2D = intelTexImage2D;
+ functions->TexImage3D = intelTexImage3D;
+ functions->TexSubImage1D = intelTexSubImage1D;
+ functions->TexSubImage2D = intelTexSubImage2D;
+ functions->TexSubImage3D = intelTexSubImage3D;
+ functions->CopyTexImage1D = intelCopyTexImage1D;
+ functions->CopyTexImage2D = intelCopyTexImage2D;
+ functions->CopyTexSubImage1D = intelCopyTexSubImage1D;
+ functions->CopyTexSubImage2D = intelCopyTexSubImage2D;
+ functions->GetTexImage = intelGetTexImage;
+
+ /* compressed texture functions */
+ functions->CompressedTexImage2D = intelCompressedTexImage2D;
+ functions->GetCompressedTexImage = intelGetCompressedTexImage;
+
+ functions->NewTextureObject = intelNewTextureObject;
+ functions->NewTextureImage = intelNewTextureImage;
+ functions->DeleteTexture = intelDeleteTextureObject;
+ functions->FreeTexImageData = intelFreeTextureImageData;
+ functions->UpdateTexturePalette = 0;
+ functions->IsTextureResident = intelIsTextureResident;
+
+#if DO_DEBUG
+ if (INTEL_DEBUG & DEBUG_BUFMGR)
+ functions->TextureMemCpy = timed_memcpy;
+ else
+#endif
+ functions->TextureMemCpy = do_memcpy;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.h b/src/mesa/drivers/dri/i915tex/intel_tex.h
new file mode 100644
index 00000000000..6e9938fe534
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex.h
@@ -0,0 +1,148 @@
+/**************************************************************************
+ *
+ * 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);
+
+const struct gl_texture_format *intelChooseTextureFormat(GLcontext * ctx,
+ GLint internalFormat,
+ GLenum format,
+ GLenum type);
+
+
+void intelTexImage3D(GLcontext * ctx,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth,
+ GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+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);
+
+void intelTexImage2D(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);
+
+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);
+
+void intelTexImage1D(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);
+
+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);
+
+void intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLint border);
+
+void intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border);
+
+void intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width);
+
+void intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
+
+void intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+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 );
+
+void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
+ GLvoid *pixels,
+ const struct gl_texture_object *texObj,
+ const struct gl_texture_image *texImage);
+
+GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
+
+void intel_tex_map_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj);
+
+void intel_tex_unmap_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj);
+
+int intel_compressed_num_bytes(GLuint mesaFormat);
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
new file mode 100644
index 00000000000..b85a25642a2
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
@@ -0,0 +1,302 @@
+/**************************************************************************
+ *
+ * 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 "mtypes.h"
+#include "enums.h"
+#include "image.h"
+#include "teximage.h"
+#include "swrast/swrast.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_buffers.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_fbo.h"
+#include "intel_tex.h"
+#include "intel_blit.h"
+#include "intel_pixel.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+/**
+ * Get the intel_region which is the source for any glCopyTex[Sub]Image call.
+ *
+ * Do the best we can using the blitter. A future project is to use
+ * the texture engine and fragment programs for these copies.
+ */
+static const struct intel_region *
+get_teximage_source(struct intel_context *intel, GLenum internalFormat)
+{
+ struct intel_renderbuffer *irb;
+
+ DBG("%s %s\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(internalFormat));
+
+ switch (internalFormat) {
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16_ARB:
+ irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH);
+ if (irb && irb->region && irb->region->cpp == 2)
+ return irb->region;
+ return NULL;
+ case GL_DEPTH24_STENCIL8_EXT:
+ case GL_DEPTH_STENCIL_EXT:
+ irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH);
+ if (irb && irb->region && irb->region->cpp == 4)
+ return irb->region;
+ return NULL;
+ case GL_RGBA:
+ case GL_RGBA8:
+ return intel_readbuf_region(intel);
+ case GL_RGB:
+ if (intel->intelScreen->cpp == 2)
+ return intel_readbuf_region(intel);
+ return NULL;
+ default:
+ return NULL;
+ }
+}
+
+
+static GLboolean
+do_copy_texsubimage(struct intel_context *intel,
+ struct intel_texture_image *intelImage,
+ GLenum internalFormat,
+ GLint dstx, GLint dsty,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ GLcontext *ctx = &intel->ctx;
+ const struct intel_region *src =
+ get_teximage_source(intel, internalFormat);
+
+ if (!intelImage->mt || !src) {
+ DBG("%s fail %p %p\n", __FUNCTION__, intelImage->mt, src);
+ return GL_FALSE;
+ }
+
+ intelFlush(ctx);
+ LOCK_HARDWARE(intel);
+ {
+ GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
+ intelImage->face,
+ intelImage->level);
+ const GLint orig_x = x;
+ const GLint orig_y = y;
+ const struct gl_framebuffer *fb = ctx->DrawBuffer;
+
+ if (_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, fb->_Xmax, fb->_Ymax,
+ &x, &y, &width, &height)) {
+ /* Update dst for clipped src. Need to also clip the source rect.
+ */
+ dstx += x - orig_x;
+ dsty += y - orig_y;
+
+ if (ctx->ReadBuffer->Name == 0) {
+ /* reading from a window, adjust x, y */
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ GLuint window_y;
+ /* window_y = position of window on screen if y=0=bottom */
+ window_y = intel->intelScreen->height - (dPriv->y + dPriv->h);
+ y = window_y + y;
+ x += dPriv->x;
+ }
+ else {
+ /* reading from a FBO */
+ /* invert Y */
+ y = ctx->ReadBuffer->Height - y - 1;
+ }
+
+
+ /* A bit of fiddling to get the blitter to work with -ve
+ * pitches. But we get a nice inverted blit this way, so it's
+ * worth it:
+ */
+ intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ -src->pitch,
+ src->buffer,
+ src->height * src->pitch * src->cpp,
+ intelImage->mt->pitch,
+ intelImage->mt->region->buffer,
+ image_offset,
+ x, y + height, dstx, dsty, width, height,
+ GL_COPY); /* ? */
+
+ intel_batchbuffer_flush(intel->batch);
+ }
+ }
+
+
+ UNLOCK_HARDWARE(intel);
+
+#if 0
+ /* GL_SGIS_generate_mipmap -- this can be accelerated now.
+ * XXX Add a ctx->Driver.GenerateMipmaps() function?
+ */
+ if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
+ intel_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ texObj);
+ }
+#endif
+
+ return GL_TRUE;
+}
+
+
+
+
+
+void
+intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLint border)
+{
+ struct gl_texture_unit *texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj =
+ _mesa_select_tex_object(ctx, texUnit, target);
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, level);
+
+ if (border)
+ goto fail;
+
+ /* Setup or redefine the texture object, mipmap tree and texture
+ * image. Don't populate yet.
+ */
+ ctx->Driver.TexImage1D(ctx, target, level, internalFormat,
+ width, border,
+ GL_RGBA, CHAN_TYPE, NULL,
+ &ctx->DefaultPacking, texObj, texImage);
+
+ if (!do_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ internalFormat, 0, 0, x, y, width, 1))
+ goto fail;
+
+ return;
+
+ fail:
+ _swrast_copy_teximage1d(ctx, target, level, internalFormat, x, y,
+ width, border);
+}
+
+void
+intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border)
+{
+ struct gl_texture_unit *texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj =
+ _mesa_select_tex_object(ctx, texUnit, target);
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, level);
+
+ if (border)
+ goto fail;
+
+ /* Setup or redefine the texture object, mipmap tree and texture
+ * image. Don't populate yet.
+ */
+ ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
+ width, height, border,
+ GL_RGBA, CHAN_TYPE, NULL,
+ &ctx->DefaultPacking, texObj, texImage);
+
+
+ if (!do_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ internalFormat, 0, 0, x, y, width, height))
+ goto fail;
+
+ return;
+
+ fail:
+ _swrast_copy_teximage2d(ctx, target, level, internalFormat, x, y,
+ width, height, border);
+}
+
+
+void
+intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ struct gl_texture_unit *texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj =
+ _mesa_select_tex_object(ctx, texUnit, target);
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, level);
+ GLenum internalFormat = texImage->InternalFormat;
+
+ /* XXX need to check <border> as in above function? */
+
+ /* Need to check texture is compatible with source format.
+ */
+
+ if (!do_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ internalFormat, xoffset, 0, x, y, width, 1)) {
+ _swrast_copy_texsubimage1d(ctx, target, level, xoffset, x, y, width);
+ }
+}
+
+
+
+void
+intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ struct gl_texture_unit *texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj =
+ _mesa_select_tex_object(ctx, texUnit, target);
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, level);
+ GLenum internalFormat = texImage->InternalFormat;
+
+
+ /* Need to check texture is compatible with source format.
+ */
+
+ if (!do_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ internalFormat,
+ xoffset, yoffset, x, y, width, height)) {
+
+ DBG("%s - fallback to swrast\n", __FUNCTION__);
+
+ _swrast_copy_texsubimage2d(ctx, target, level,
+ xoffset, yoffset, x, y, width, height);
+ }
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_format.c b/src/mesa/drivers/dri/i915tex/intel_tex_format.c
new file mode 100644
index 00000000000..6e058dff69f
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_format.c
@@ -0,0 +1,172 @@
+#include "intel_context.h"
+#include "intel_tex.h"
+#include "texformat.h"
+#include "enums.h"
+
+/* It works out that this function is fine for all the supported
+ * hardware. However, there is still a need to map the formats onto
+ * hardware descriptors.
+ */
+/* Note that the i915 can actually support many more formats than
+ * these if we take the step of simply swizzling the colors
+ * immediately after sampling...
+ */
+const struct gl_texture_format *
+intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
+ GLenum format, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ const GLboolean do32bpt = (intel->intelScreen->cpp == 4);
+
+ switch (internalFormat) {
+ case 4:
+ case GL_RGBA:
+ case GL_COMPRESSED_RGBA:
+ if (format == GL_BGRA) {
+ if (type == GL_UNSIGNED_BYTE || 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 &_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_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
+ return &_mesa_texformat_z16;
+
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ return &_mesa_texformat_z24_s8;
+
+ default:
+ fprintf(stderr, "unexpected texture format %s in %s\n",
+ _mesa_lookup_enum_by_nr(internalFormat), __FUNCTION__);
+ return NULL;
+ }
+
+ return NULL; /* never get here */
+}
+
+int intel_compressed_num_bytes(GLuint mesaFormat)
+{
+ int bytes = 0;
+ switch(mesaFormat) {
+
+ case MESA_FORMAT_RGB_FXT1:
+ case MESA_FORMAT_RGBA_FXT1:
+ case MESA_FORMAT_RGB_DXT1:
+ case MESA_FORMAT_RGBA_DXT1:
+ bytes = 2;
+ break;
+
+ case MESA_FORMAT_RGBA_DXT3:
+ case MESA_FORMAT_RGBA_DXT5:
+ bytes = 4;
+ default:
+ break;
+ }
+
+ return bytes;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c
new file mode 100644
index 00000000000..22221e7322c
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c
@@ -0,0 +1,686 @@
+
+#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 "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_buffer_objects.h"
+#include "intel_batchbuffer.h"
+#include "intel_tex.h"
+#include "intel_ioctl.h"
+#include "intel_blit.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+/* Functions to store texture images. Where possible, mipmap_tree's
+ * will be created or further instantiated with image data, otherwise
+ * images will be stored in malloc'd memory. A validation step is
+ * required to pull those images into a mipmap tree, or otherwise
+ * decide a fallback is required.
+ */
+
+
+static int
+logbase2(int n)
+{
+ GLint i = 1;
+ GLint log2 = 0;
+
+ while (n > i) {
+ i *= 2;
+ log2++;
+ }
+
+ return log2;
+}
+
+
+/* Otherwise, store it in memory if (Border != 0) or (any dimension ==
+ * 1).
+ *
+ * Otherwise, if max_level >= level >= min_level, create tree with
+ * space for textures from min_level down to max_level.
+ *
+ * Otherwise, create tree with space for textures from (level
+ * 0)..(1x1). Consider pruning this tree at a validation if the
+ * saving is worth it.
+ */
+static void
+guess_and_alloc_mipmap_tree(struct intel_context *intel,
+ struct intel_texture_object *intelObj,
+ struct intel_texture_image *intelImage)
+{
+ GLuint firstLevel;
+ GLuint lastLevel;
+ GLuint width = intelImage->base.Width;
+ GLuint height = intelImage->base.Height;
+ GLuint depth = intelImage->base.Depth;
+ GLuint l2width, l2height, l2depth;
+ GLuint i, comp_byte = 0;
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (intelImage->base.Border)
+ return;
+
+ if (intelImage->level > intelObj->base.BaseLevel &&
+ (intelImage->base.Width == 1 ||
+ (intelObj->base.Target != GL_TEXTURE_1D &&
+ intelImage->base.Height == 1) ||
+ (intelObj->base.Target == GL_TEXTURE_3D &&
+ intelImage->base.Depth == 1)))
+ return;
+
+ /* If this image disrespects BaseLevel, allocate from level zero.
+ * Usually BaseLevel == 0, so it's unlikely to happen.
+ */
+ if (intelImage->level < intelObj->base.BaseLevel)
+ firstLevel = 0;
+ else
+ firstLevel = intelObj->base.BaseLevel;
+
+
+ /* Figure out image dimensions at start level.
+ */
+ for (i = intelImage->level; i > firstLevel; i--) {
+ width <<= 1;
+ if (height != 1)
+ height <<= 1;
+ if (depth != 1)
+ depth <<= 1;
+ }
+
+ /* Guess a reasonable value for lastLevel. This is probably going
+ * to be wrong fairly often and might mean that we have to look at
+ * resizable buffers, or require that buffers implement lazy
+ * pagetable arrangements.
+ */
+ if ((intelObj->base.MinFilter == GL_NEAREST ||
+ intelObj->base.MinFilter == GL_LINEAR) &&
+ intelImage->level == firstLevel) {
+ lastLevel = firstLevel;
+ }
+ else {
+ l2width = logbase2(width);
+ l2height = logbase2(height);
+ l2depth = logbase2(depth);
+ lastLevel = firstLevel + MAX2(MAX2(l2width, l2height), l2depth);
+ }
+
+ assert(!intelObj->mt);
+ if (intelImage->base.IsCompressed)
+ comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
+ intelObj->mt = intel_miptree_create(intel,
+ intelObj->base.Target,
+ intelImage->base.InternalFormat,
+ firstLevel,
+ lastLevel,
+ width,
+ height,
+ depth,
+ intelImage->base.TexFormat->TexelBytes,
+ comp_byte);
+
+ DBG("%s - success\n", __FUNCTION__);
+}
+
+
+
+
+static GLuint
+target_to_face(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ return ((GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X);
+ default:
+ return 0;
+ }
+}
+
+/* There are actually quite a few combinations this will work for,
+ * more than what I've listed here.
+ */
+static GLboolean
+check_pbo_format(GLint internalFormat,
+ GLenum format, GLenum type,
+ const struct gl_texture_format *mesa_format)
+{
+ switch (internalFormat) {
+ case 4:
+ case GL_RGBA:
+ return (format == GL_BGRA &&
+ (type == GL_UNSIGNED_BYTE ||
+ type == GL_UNSIGNED_INT_8_8_8_8_REV) &&
+ mesa_format == &_mesa_texformat_argb8888);
+ case 3:
+ case GL_RGB:
+ return (format == GL_RGB &&
+ type == GL_UNSIGNED_SHORT_5_6_5 &&
+ mesa_format == &_mesa_texformat_rgb565);
+ case GL_YCBCR_MESA:
+ return (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE);
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/* XXX: Do this for TexSubImage also:
+ */
+static GLboolean
+try_pbo_upload(struct intel_context *intel,
+ struct intel_texture_image *intelImage,
+ const struct gl_pixelstore_attrib *unpack,
+ GLint internalFormat,
+ GLint width, GLint height,
+ GLenum format, GLenum type, const void *pixels)
+{
+ struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
+ GLuint src_offset, src_stride;
+ GLuint dst_offset, dst_stride;
+
+ if (!pbo ||
+ intel->ctx._ImageTransferState ||
+ unpack->SkipPixels || unpack->SkipRows) {
+ _mesa_printf("%s: failure 1\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ src_offset = (GLuint) pixels;
+
+ if (unpack->RowLength > 0)
+ src_stride = unpack->RowLength;
+ else
+ src_stride = width;
+
+ dst_offset = intel_miptree_image_offset(intelImage->mt,
+ intelImage->face,
+ intelImage->level);
+
+ dst_stride = intelImage->mt->pitch;
+
+ intelFlush(&intel->ctx);
+ LOCK_HARDWARE(intel);
+ {
+ struct _DriBufferObject *src_buffer =
+ intel_bufferobj_buffer(intel, pbo, INTEL_READ);
+ struct _DriBufferObject *dst_buffer =
+ intel_region_buffer(intel->intelScreen, intelImage->mt->region,
+ INTEL_WRITE_FULL);
+
+
+ intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ src_stride, src_buffer, src_offset,
+ dst_stride, dst_buffer, dst_offset,
+ 0, 0, 0, 0, width, height,
+ GL_COPY);
+
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+
+ return GL_TRUE;
+}
+
+
+
+static GLboolean
+try_pbo_zcopy(struct intel_context *intel,
+ struct intel_texture_image *intelImage,
+ const struct gl_pixelstore_attrib *unpack,
+ GLint internalFormat,
+ GLint width, GLint height,
+ GLenum format, GLenum type, const void *pixels)
+{
+ struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
+ GLuint src_offset, src_stride;
+ GLuint dst_offset, dst_stride;
+
+ if (!pbo ||
+ intel->ctx._ImageTransferState ||
+ unpack->SkipPixels || unpack->SkipRows) {
+ _mesa_printf("%s: failure 1\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ src_offset = (GLuint) pixels;
+
+ if (unpack->RowLength > 0)
+ src_stride = unpack->RowLength;
+ else
+ src_stride = width;
+
+ dst_offset = intel_miptree_image_offset(intelImage->mt,
+ intelImage->face,
+ intelImage->level);
+
+ dst_stride = intelImage->mt->pitch;
+
+ if (src_stride != dst_stride || dst_offset != 0 || src_offset != 0) {
+ _mesa_printf("%s: failure 2\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
+ intel_region_attach_pbo(intel->intelScreen, intelImage->mt->region, pbo);
+
+ return GL_TRUE;
+}
+
+
+
+
+
+
+static void
+intelTexImage(GLcontext * ctx,
+ GLint dims,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth,
+ GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage, GLsizei imageSize, int compressed)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_object *intelObj = intel_texture_object(texObj);
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+ GLint postConvWidth = width;
+ GLint postConvHeight = height;
+ GLint texelBytes, sizeInBytes;
+ GLuint dstRowStride;
+
+
+ DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(target), level, width, height, depth, border);
+
+ intelFlush(ctx);
+
+ intelImage->face = target_to_face(target);
+ intelImage->level = level;
+
+ if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) {
+ _mesa_adjust_image_for_convolution(ctx, dims, &postConvWidth,
+ &postConvHeight);
+ }
+
+ /* choose the texture format */
+ texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat,
+ format, type);
+
+ assert(texImage->TexFormat);
+
+ switch (dims) {
+ case 1:
+ texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D;
+ texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df;
+ break;
+ case 2:
+ texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D;
+ texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df;
+ break;
+ case 3:
+ texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D;
+ texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ if (texImage->TexFormat->TexelBytes == 0) {
+ /* must be a compressed format */
+ texelBytes = 0;
+ texImage->IsCompressed = GL_TRUE;
+ texImage->CompressedSize =
+ ctx->Driver.CompressedTextureSize(ctx, texImage->Width,
+ texImage->Height, texImage->Depth,
+ texImage->TexFormat->MesaFormat);
+ } else {
+ texelBytes = texImage->TexFormat->TexelBytes;
+
+ /* Minimum pitch of 32 bytes */
+ if (postConvWidth * texelBytes < 32) {
+ postConvWidth = 32 / texelBytes;
+ texImage->RowStride = postConvWidth;
+ }
+
+ assert(texImage->RowStride == postConvWidth);
+ }
+
+ /* Release the reference to a potentially orphaned buffer.
+ * Release any old malloced memory.
+ */
+ if (intelImage->mt) {
+ intel_miptree_release(intel, &intelImage->mt);
+ assert(!texImage->Data);
+ }
+ else if (texImage->Data) {
+ _mesa_align_free(texImage->Data);
+ }
+
+ /* If this is the only texture image in the tree, could call
+ * bmBufferData with NULL data to free the old block and avoid
+ * waiting on any outstanding fences.
+ */
+ if (intelObj->mt &&
+ intelObj->mt->first_level == level &&
+ intelObj->mt->last_level == level &&
+ intelObj->mt->target != GL_TEXTURE_CUBE_MAP_ARB &&
+ !intel_miptree_match_image(intelObj->mt, &intelImage->base,
+ intelImage->face, intelImage->level)) {
+
+ DBG("release it\n");
+ intel_miptree_release(intel, &intelObj->mt);
+ assert(!intelObj->mt);
+ }
+
+ if (!intelObj->mt) {
+ guess_and_alloc_mipmap_tree(intel, intelObj, intelImage);
+ if (!intelObj->mt) {
+ DBG("guess_and_alloc_mipmap_tree: failed\n");
+ }
+ }
+
+
+ assert(!intelImage->mt);
+
+ if (intelObj->mt &&
+ intel_miptree_match_image(intelObj->mt, &intelImage->base,
+ intelImage->face, intelImage->level)) {
+
+ intel_miptree_reference(&intelImage->mt, intelObj->mt);
+ assert(intelImage->mt);
+ }
+
+ if (!intelImage->mt)
+ DBG("XXX: Image did not fit into tree - storing in local memory!\n");
+
+ /* PBO fastpaths:
+ */
+ if (dims <= 2 &&
+ intelImage->mt &&
+ intel_buffer_object(unpack->BufferObj) &&
+ check_pbo_format(internalFormat, format,
+ type, intelImage->base.TexFormat)) {
+
+ DBG("trying pbo upload\n");
+
+ /* Attempt to texture directly from PBO data (zero copy upload).
+ *
+ * Currently disable as it can lead to worse as well as better
+ * performance (in particular when intel_region_cow() is
+ * required).
+ */
+ if (intelObj->mt == intelImage->mt &&
+ intelObj->mt->first_level == level &&
+ intelObj->mt->last_level == level) {
+
+ if (try_pbo_zcopy(intel, intelImage, unpack,
+ internalFormat,
+ width, height, format, type, pixels)) {
+
+ DBG("pbo zcopy upload succeeded\n");
+ return;
+ }
+ }
+
+
+ /* Otherwise, attempt to use the blitter for PBO image uploads.
+ */
+ if (try_pbo_upload(intel, intelImage, unpack,
+ internalFormat,
+ width, height, format, type, pixels)) {
+ DBG("pbo upload succeeded\n");
+ return;
+ }
+
+ DBG("pbo upload failed\n");
+ }
+
+
+
+ /* intelCopyTexImage calls this function with pixels == NULL, with
+ * the expectation that the mipmap tree will be set up but nothing
+ * more will be done. This is where those calls return:
+ */
+ if (compressed) {
+ pixels = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, pixels,
+ unpack,
+ "glCompressedTexImage");
+ } else {
+ pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1,
+ format, type,
+ pixels, unpack, "glTexImage");
+ }
+ if (!pixels)
+ return;
+
+
+ if (intelImage->mt)
+ intel_region_idle(intel->intelScreen, intelImage->mt->region);
+
+ LOCK_HARDWARE(intel);
+
+ if (intelImage->mt) {
+ texImage->Data = intel_miptree_image_map(intel,
+ intelImage->mt,
+ intelImage->face,
+ intelImage->level,
+ &dstRowStride,
+ intelImage->base.ImageOffsets);
+ }
+ else {
+ /* Allocate regular memory and store the image there temporarily. */
+ if (texImage->IsCompressed) {
+ sizeInBytes = texImage->CompressedSize;
+ dstRowStride =
+ _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width);
+ assert(dims != 3);
+ }
+ else {
+ dstRowStride = postConvWidth * texelBytes;
+ sizeInBytes = depth * dstRowStride * postConvHeight;
+ }
+
+ texImage->Data = malloc(sizeInBytes);
+ }
+
+ DBG("Upload image %dx%dx%d row_len %x "
+ "pitch %x\n",
+ width, height, depth, width * texelBytes, dstRowStride);
+
+ /* Copy data. Would like to know when it's ok for us to eg. use
+ * the blitter to copy. Or, use the hardware to do the format
+ * conversion and copy:
+ */
+ if (compressed) {
+ memcpy(texImage->Data, pixels, imageSize);
+ } else if (!texImage->TexFormat->StoreImage(ctx, dims,
+ texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, depth,
+ format, type, pixels, unpack)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ }
+
+ _mesa_unmap_teximage_pbo(ctx, unpack);
+
+ if (intelImage->mt) {
+ intel_miptree_image_unmap(intel, intelImage->mt);
+ texImage->Data = NULL;
+ }
+
+ UNLOCK_HARDWARE(intel);
+
+#if 0
+ /* GL_SGIS_generate_mipmap -- this can be accelerated now.
+ */
+ if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
+ intel_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ texObj);
+ }
+#endif
+}
+
+void
+intelTexImage3D(GLcontext * ctx,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth,
+ GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ intelTexImage(ctx, 3, target, level,
+ internalFormat, width, height, depth, border,
+ format, type, pixels, unpack, texObj, texImage, 0, 0);
+}
+
+
+void
+intelTexImage2D(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 *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ intelTexImage(ctx, 2, target, level,
+ internalFormat, width, height, 1, border,
+ format, type, pixels, unpack, texObj, texImage, 0, 0);
+}
+
+void
+intelTexImage1D(GLcontext * ctx,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ intelTexImage(ctx, 1, target, level,
+ internalFormat, width, 1, 1, border,
+ format, type, pixels, unpack, texObj, texImage, 0, 0);
+}
+
+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 )
+{
+ intelTexImage(ctx, 2, target, level,
+ internalFormat, width, height, 1, border,
+ 0, 0, data, &ctx->Unpack, texObj, texImage, imageSize, 1);
+}
+
+/**
+ * Need to map texture image into memory before copying image data,
+ * then unmap it.
+ */
+static void
+intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage, int compressed)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+
+ /* Map */
+ if (intelImage->mt) {
+ /* Image is stored in hardware format in a buffer managed by the
+ * kernel. Need to explicitly map and unmap it.
+ */
+ intelImage->base.Data =
+ intel_miptree_image_map(intel,
+ intelImage->mt,
+ intelImage->face,
+ intelImage->level,
+ &intelImage->base.RowStride,
+ intelImage->base.ImageOffsets);
+ }
+ else {
+ /* Otherwise, the image should actually be stored in
+ * intelImage->base.Data. This is pretty confusing for
+ * everybody, I'd much prefer to separate the two functions of
+ * texImage->Data - storage for texture images in main memory
+ * and access (ie mappings) of images. In other words, we'd
+ * create a new texImage->Map field and leave Data simply for
+ * storage.
+ */
+ assert(intelImage->base.Data);
+ }
+
+
+ if (compressed) {
+ _mesa_get_compressed_teximage(ctx, target, level, pixels,
+ texObj, texImage);
+ } else {
+ _mesa_get_teximage(ctx, target, level, format, type, pixels,
+ texObj, texImage);
+ }
+
+
+ /* Unmap */
+ if (intelImage->mt) {
+ intel_miptree_image_unmap(intel, intelImage->mt);
+ intelImage->base.Data = NULL;
+ }
+}
+
+void
+intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ intel_get_tex_image(ctx, target, level, format, type, pixels,
+ texObj, texImage, 0);
+
+
+}
+
+void
+intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
+ GLvoid *pixels,
+ const struct gl_texture_object *texObj,
+ const struct gl_texture_image *texImage)
+{
+ intel_get_tex_image(ctx, target, level, 0, 0, pixels,
+ texObj, texImage, 1);
+
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c b/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c
new file mode 100644
index 00000000000..25a2dca6857
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c
@@ -0,0 +1,183 @@
+
+/**************************************************************************
+ *
+ * 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 "mtypes.h"
+#include "texobj.h"
+#include "texstore.h"
+#include "enums.h"
+
+#include "intel_context.h"
+#include "intel_tex.h"
+#include "intel_mipmap_tree.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+static void
+intelTexSubimage(GLcontext * ctx,
+ GLint dims,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+ GLuint dstImageStride;
+ GLuint dstRowStride;
+
+ DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(target),
+ level, xoffset, yoffset, width, height);
+
+ intelFlush(ctx);
+
+ pixels =
+ _mesa_validate_pbo_teximage(ctx, dims, width, height, depth, format,
+ type, pixels, packing, "glTexSubImage2D");
+ if (!pixels)
+ return;
+
+ if (intelImage->mt)
+ intel_region_idle(intel->intelScreen, intelImage->mt->region);
+
+ LOCK_HARDWARE(intel);
+
+ /* Map buffer if necessary. Need to lock to prevent other contexts
+ * from uploading the buffer under us.
+ */
+ if (intelImage->mt)
+ texImage->Data = intel_miptree_image_map(intel,
+ intelImage->mt,
+ intelImage->face,
+ intelImage->level,
+ &dstRowStride,
+ &dstImageStride);
+
+ assert(dstRowStride);
+
+ if (!texImage->TexFormat->StoreImage(ctx, dims, texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data,
+ xoffset, yoffset, zoffset,
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, depth,
+ format, type, pixels, packing)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
+ }
+
+#if 0
+ /* GL_SGIS_generate_mipmap */
+ if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
+ _mesa_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ texObj);
+ }
+#endif
+
+ _mesa_unmap_teximage_pbo(ctx, packing);
+
+ if (intelImage->mt) {
+ intel_miptree_image_unmap(intel, intelImage->mt);
+ texImage->Data = NULL;
+ }
+
+ UNLOCK_HARDWARE(intel);
+}
+
+
+
+
+
+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)
+{
+
+ intelTexSubimage(ctx, 3,
+ target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, pixels, packing, texObj, texImage);
+
+}
+
+
+
+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)
+{
+
+ intelTexSubimage(ctx, 2,
+ target, level,
+ xoffset, yoffset, 0,
+ width, height, 1,
+ format, type, pixels, packing, texObj, texImage);
+
+}
+
+
+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)
+{
+ intelTexSubimage(ctx, 1,
+ target, level,
+ xoffset, 0, 0,
+ width, 1, 1,
+ format, type, pixels, packing, texObj, texImage);
+
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
new file mode 100644
index 00000000000..5f82dfa19e6
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
@@ -0,0 +1,256 @@
+#include "mtypes.h"
+#include "macros.h"
+
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_tex.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+/**
+ * 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.
+ */
+static void
+intel_calculate_first_last_level(struct intel_texture_object *intelObj)
+{
+ struct gl_texture_object *tObj = &intelObj->base;
+ 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, tObj->BaseLevel);
+ lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2);
+ lastLevel = MIN2(lastLevel, 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 */
+ intelObj->firstLevel = firstLevel;
+ intelObj->lastLevel = lastLevel;
+}
+
+static void
+copy_image_data_to_tree(struct intel_context *intel,
+ struct intel_texture_object *intelObj,
+ struct intel_texture_image *intelImage)
+{
+ if (intelImage->mt) {
+ /* Copy potentially with the blitter:
+ */
+ intel_miptree_image_copy(intel,
+ intelObj->mt,
+ intelImage->face,
+ intelImage->level, intelImage->mt);
+
+ intel_miptree_release(intel, &intelImage->mt);
+ }
+ else {
+ assert(intelImage->base.Data != NULL);
+
+ /* More straightforward upload.
+ */
+ intel_miptree_image_data(intel,
+ intelObj->mt,
+ intelImage->face,
+ intelImage->level,
+ intelImage->base.Data,
+ intelImage->base.RowStride,
+ intelImage->base.RowStride *
+ intelImage->base.Height);
+ _mesa_align_free(intelImage->base.Data);
+ intelImage->base.Data = NULL;
+ }
+
+ intel_miptree_reference(&intelImage->mt, intelObj->mt);
+}
+
+
+/*
+ */
+GLuint
+intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
+{
+ struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
+ struct intel_texture_object *intelObj = intel_texture_object(tObj);
+
+ GLuint face, i;
+ GLuint nr_faces = 0;
+ struct intel_texture_image *firstImage;
+
+ /* We know/require this is true by now:
+ */
+ assert(intelObj->base.Complete);
+
+ /* What levels must the tree include at a minimum?
+ */
+ intel_calculate_first_last_level(intelObj);
+ firstImage =
+ intel_texture_image(intelObj->base.Image[0][intelObj->firstLevel]);
+
+ /* Fallback case:
+ */
+ if (firstImage->base.Border) {
+ if (intelObj->mt) {
+ intel_miptree_release(intel, &intelObj->mt);
+ }
+ return GL_FALSE;
+ }
+
+
+ /* If both firstImage and intelObj have a tree which can contain
+ * all active images, favour firstImage. Note that because of the
+ * completeness requirement, we know that the image dimensions
+ * will match.
+ */
+ if (firstImage->mt &&
+ firstImage->mt != intelObj->mt &&
+ firstImage->mt->first_level <= intelObj->firstLevel &&
+ firstImage->mt->last_level >= intelObj->lastLevel) {
+
+ if (intelObj->mt)
+ intel_miptree_release(intel, &intelObj->mt);
+
+ intel_miptree_reference(&intelObj->mt, firstImage->mt);
+ }
+
+ /* Check tree can hold all active levels. Check tree matches
+ * target, imageFormat, etc.
+ *
+ * XXX: For some layouts (eg i945?), the test might have to be
+ * first_level == firstLevel, as the tree isn't valid except at the
+ * original start level. Hope to get around this by
+ * programming minLod, maxLod, baseLevel into the hardware and
+ * leaving the tree alone.
+ */
+ if (intelObj->mt &&
+ ((intelObj->mt->first_level > intelObj->firstLevel) ||
+ (intelObj->mt->last_level < intelObj->lastLevel) ||
+ (intelObj->mt->internal_format != firstImage->base.InternalFormat))) {
+ intel_miptree_release(intel, &intelObj->mt);
+ }
+
+
+ /* May need to create a new tree:
+ */
+ if (!intelObj->mt) {
+ int comp_byte = 0;
+
+ if (firstImage->base.IsCompressed)
+ comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat);
+ intelObj->mt = intel_miptree_create(intel,
+ intelObj->base.Target,
+ firstImage->base.InternalFormat,
+ intelObj->firstLevel,
+ intelObj->lastLevel,
+ firstImage->base.Width,
+ firstImage->base.Height,
+ firstImage->base.Depth,
+ firstImage->base.TexFormat->
+ TexelBytes,
+ comp_byte);
+ }
+
+ /* Pull in any images not in the object's tree:
+ */
+ nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ for (face = 0; face < nr_faces; face++) {
+ for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][i]);
+
+ /* Need to import images in main memory or held in other trees.
+ */
+ if (intelObj->mt != intelImage->mt) {
+ copy_image_data_to_tree(intel, intelObj, intelImage);
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+
+
+void
+intel_tex_map_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj)
+{
+ GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ GLuint face, i;
+
+ DBG("%s\n", __FUNCTION__);
+
+ for (face = 0; face < nr_faces; face++) {
+ for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][i]);
+
+ if (intelImage->mt) {
+ intelImage->base.Data =
+ intel_miptree_image_map(intel,
+ intelImage->mt,
+ intelImage->face,
+ intelImage->level,
+ &intelImage->base.RowStride,
+ intelImage->base.ImageOffsets);
+ /* convert stride to texels, not bytes */
+ intelImage->base.RowStride /= intelImage->mt->cpp;
+/* intelImage->base.ImageStride /= intelImage->mt->cpp; */
+ }
+ }
+ }
+}
+
+
+
+void
+intel_tex_unmap_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj)
+{
+ GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ GLuint face, i;
+
+ for (face = 0; face < nr_faces; face++) {
+ for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][i]);
+
+ if (intelImage->mt) {
+ intel_miptree_image_unmap(intel, intelImage->mt);
+ intelImage->base.Data = NULL;
+ }
+ }
+ }
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tris.c b/src/mesa/drivers/dri/i915tex/intel_tris.c
new file mode 100644
index 00000000000..1ba49d8f6ec
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tris.c
@@ -0,0 +1,1149 @@
+/**************************************************************************
+ *
+ * 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 "texobj.h"
+#include "state.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_context.h"
+#include "intel_tris.h"
+#include "intel_batchbuffer.h"
+#include "intel_reg.h"
+#include "intel_span.h"
+#include "intel_tex.h"
+
+static void intelRenderPrimitive(GLcontext * ctx, GLenum prim);
+static void intelRasterPrimitive(GLcontext * ctx, GLenum rprim,
+ GLuint hwprim);
+
+/*
+ */
+static void
+intel_flush_inline_primitive(struct intel_context *intel)
+{
+ GLuint used = intel->batch->ptr - intel->prim.start_ptr;
+
+ assert(intel->prim.primitive != ~0);
+
+/* _mesa_printf("/\n"); */
+
+ 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;
+
+ 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(struct intel_context *intel,
+ GLuint prim, GLuint batch_flags)
+{
+ BATCH_LOCALS;
+
+ intel->vtbl.emit_state(intel);
+
+ /* Need to make sure at the very least that we don't wrap
+ * batchbuffers in BEGIN_BATCH below, otherwise the primitive will
+ * be emitted to a batchbuffer missing the required full-state
+ * preamble.
+ */
+ if (intel_batchbuffer_space(intel->batch) < 100) {
+ intel_batchbuffer_flush(intel->batch);
+ intel->vtbl.emit_state(intel);
+ }
+
+/* _mesa_printf("%s *", __progname); */
+
+ /* Emit a slot which will be filled with the inline primitive
+ * command later.
+ */
+ BEGIN_BATCH(2, batch_flags);
+ OUT_BATCH(0);
+
+ intel->prim.start_ptr = intel->batch->ptr;
+ intel->prim.primitive = prim;
+ intel->prim.flush = intel_flush_inline_primitive;
+
+ OUT_BATCH(0);
+ ADVANCE_BATCH();
+
+/* _mesa_printf(">"); */
+}
+
+
+void
+intelWrapInlinePrimitive(struct intel_context *intel)
+{
+ GLuint prim = intel->prim.primitive;
+ GLuint batchflags = intel->batch->flags;
+
+ intel_flush_inline_primitive(intel);
+ intel_batchbuffer_flush(intel->batch);
+ intelStartInlinePrimitive(intel, prim, batchflags); /* ??? */
+}
+
+GLuint *
+intelExtendInlinePrimitive(struct intel_context *intel, GLuint dwords)
+{
+ GLuint sz = dwords * sizeof(GLuint);
+ GLuint *ptr;
+
+ assert(intel->prim.flush == intel_flush_inline_primitive);
+
+ if (intel_batchbuffer_space(intel->batch) < sz)
+ intelWrapInlinePrimitive(intel);
+
+/* _mesa_printf("."); */
+
+ intel->vtbl.assert_not_dirty(intel);
+
+ ptr = (GLuint *) intel->batch->ptr;
+ intel->batch->ptr += sz;
+
+ return ptr;
+}
+
+
+
+/***********************************************************************
+ * 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 { \
+ for ( j = 0 ; j < vertsize ; j++ ) { \
+ vb[j] = ((GLuint *)v)[j]; \
+ } \
+ vb += vertsize; \
+} while (0)
+#endif
+
+static void
+intel_draw_quad(struct intel_context *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);
+
+ /* If smooth shading, draw like a trifan which gives better
+ * rasterization. Otherwise draw as two triangles with provoking
+ * vertex in third position as required for flat shading.
+ */
+ if (intel->ctx.Light.ShadeModel == GL_FLAT) {
+ COPY_DWORDS(j, vb, vertsize, v3);
+ COPY_DWORDS(j, vb, vertsize, v1);
+ }
+ else {
+ COPY_DWORDS(j, vb, vertsize, v2);
+ COPY_DWORDS(j, vb, vertsize, v0);
+ }
+
+ COPY_DWORDS(j, vb, vertsize, v2);
+ COPY_DWORDS(j, vb, vertsize, v3);
+}
+
+static void
+intel_draw_triangle(struct intel_context *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 void
+intel_draw_line(struct intel_context *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 void
+intel_draw_point(struct intel_context *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 *
+ ***********************************************************************/
+
+/* Currently not working - VERT_ATTRIB_POINTSIZE isn't correctly
+ * represented in the fragment program InputsRead field.
+ */
+static void
+intel_atten_point(struct intel_context *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(struct intel_context *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(struct intel_context *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(struct intel_context *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) \
+ struct intel_context *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(struct intel_context *intel,
+ intelVertex * v0, intelVertex * v1, intelVertex * v2)
+{
+ GLcontext *ctx = &intel->ctx;
+ SWvertex v[3];
+
+ if (0)
+ fprintf(stderr, "\n%s\n", __FUNCTION__);
+
+ INTEL_FIREVERTICES(intel);
+
+ _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(struct intel_context *intel,
+ intelVertex * v0, intelVertex * v1)
+{
+ GLcontext *ctx = &intel->ctx;
+ SWvertex v[2];
+
+ if (0)
+ fprintf(stderr, "\n%s\n", __FUNCTION__);
+
+ INTEL_FIREVERTICES(intel);
+
+ _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(struct intel_context *intel,
+ intelVertex * v0)
+{
+ GLcontext *ctx = &intel->ctx;
+ SWvertex v[1];
+
+ if (0)
+ fprintf(stderr, "\n%s\n", __FUNCTION__);
+
+ INTEL_FIREVERTICES(intel);
+
+ _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 \
+ struct intel_context *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)
+{
+ struct intel_context *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)
+{
+ struct intel_context *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 ANY_FALLBACK_FLAGS (DD_LINE_STIPPLE | DD_TRI_STIPPLE | DD_POINT_ATTEN | DD_POINT_SMOOTH | DD_TRI_SMOOTH)
+#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE | DD_TRI_OFFSET | DD_TRI_UNFILLED)
+
+void
+intelChooseRenderState(GLcontext * ctx)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct intel_context *intel = intel_context(ctx);
+ GLuint flags = ctx->_TriangleCaps;
+ const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current;
+ GLboolean have_wpos = (fprog && (fprog->Base.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 & DD_LINE_STIPPLE)
+ intel->draw_line = intel_fallback_line;
+
+ if ((flags & DD_TRI_STIPPLE) && !intel->hw_stipple)
+ intel->draw_tri = intel_fallback_tri;
+
+ if (flags & DD_TRI_SMOOTH) {
+ if (intel->strict_conformance)
+ intel->draw_tri = intel_fallback_tri;
+ }
+
+ if (flags & DD_POINT_ATTEN) {
+ if (0)
+ intel->draw_point = intel_atten_point;
+ else
+ intel->draw_point = intel_fallback_point;
+ }
+
+ if (flags & DD_POINT_SMOOTH) {
+ if (intel->strict_conformance)
+ intel->draw_point = intel_fallback_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)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ _mesa_lock_context_textures(ctx);
+
+ if (ctx->NewState)
+ _mesa_update_state_locked(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);
+
+ _mesa_unlock_context_textures(ctx);
+}
+
+static void
+intelRenderStart(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel->vtbl.render_start(intel_context(ctx));
+ intel->vtbl.emit_state(intel);
+}
+
+static void
+intelRenderFinish(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ if (intel->RenderIndex & INTEL_FALLBACK_BIT)
+ _swrast_flush(ctx);
+
+ INTEL_FIREVERTICES(intel);
+}
+
+
+
+
+ /* System to flush dma and emit state changes based on the rasterized
+ * primitive.
+ */
+static void
+intelRasterPrimitive(GLcontext * ctx, GLenum rprim, GLuint hwprim)
+{
+ struct intel_context *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) {
+ INTEL_FIREVERTICES(intel);
+
+ intelStartInlinePrimitive(intel, hwprim, INTEL_BATCH_CLIPRECTS);
+ }
+}
+
+
+ /*
+ */
+static void
+intelRenderPrimitive(GLcontext * ctx, GLenum prim)
+{
+ struct intel_context *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[] = {
+ [0] = "Draw buffer",
+ [1] = "Read buffer",
+ [2] = "Depth buffer",
+ [3] = "Stencil buffer",
+ [4] = "User disable",
+ [5] = "Render mode",
+
+ [12] = "Texture",
+ [13] = "Color mask",
+ [14] = "Stencil",
+ [15] = "Stipple",
+ [16] = "Program",
+ [17] = "Logic op",
+ [18] = "Smooth polygon",
+ [19] = "Smooth point",
+};
+
+
+static char *
+getFallbackString(GLuint bit)
+{
+ int i = 0;
+ while (bit > 1) {
+ i++;
+ bit >>= 1;
+ }
+ return fallbackStrings[i];
+}
+
+
+
+void
+intelFallback(struct intel_context *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;
+ }
+ }
+}
+
+union fi
+{
+ GLfloat f;
+ GLint i;
+};
+
+
+/**********************************************************************/
+/* Used only with the metaops callbacks. */
+/**********************************************************************/
+void
+intel_meta_draw_poly(struct intel_context *intel,
+ GLuint n,
+ GLfloat xy[][2],
+ GLfloat z, GLuint color, GLfloat tex[][2])
+{
+ union fi *vb;
+ GLint i;
+
+ /* All 3d primitives should be emitted with INTEL_BATCH_CLIPRECTS,
+ * otherwise the drawing origin (DR4) might not be set correctly.
+ */
+ intelStartInlinePrimitive(intel, PRIM3D_TRIFAN, INTEL_BATCH_CLIPRECTS);
+ vb = (union fi *) intelExtendInlinePrimitive(intel, n * 6);
+
+ for (i = 0; i < n; i++) {
+ vb[0].f = xy[i][0];
+ vb[1].f = xy[i][1];
+ vb[2].f = z;
+ vb[3].i = color;
+ vb[4].f = tex[i][0];
+ vb[5].f = tex[i][1];
+ vb += 6;
+ }
+
+ INTEL_FIREVERTICES(intel);
+}
+
+void
+intel_meta_draw_quad(struct intel_context *intel,
+ GLfloat x0, GLfloat x1,
+ GLfloat y0, GLfloat y1,
+ GLfloat z,
+ GLuint color,
+ GLfloat s0, GLfloat s1, GLfloat t0, GLfloat t1)
+{
+ GLfloat xy[4][2];
+ GLfloat tex[4][2];
+
+ xy[0][0] = x0;
+ xy[0][1] = y0;
+ xy[1][0] = x1;
+ xy[1][1] = y0;
+ xy[2][0] = x1;
+ xy[2][1] = y1;
+ xy[3][0] = x0;
+ xy[3][1] = y1;
+
+ tex[0][0] = s0;
+ tex[0][1] = t0;
+ tex[1][0] = s1;
+ tex[1][1] = t0;
+ tex[2][0] = s1;
+ tex[2][1] = t1;
+ tex[3][0] = s0;
+ tex[3][1] = t1;
+
+ intel_meta_draw_poly(intel, 4, xy, z, color, tex);
+}
+
+
+
+/**********************************************************************/
+/* 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/src/mesa/drivers/dri/i915tex/intel_tris.h b/src/mesa/drivers/dri/i915tex/intel_tris.h
new file mode 100644
index 00000000000..b7bae8cd3bc
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tris.h
@@ -0,0 +1,69 @@
+/**************************************************************************
+ *
+ * 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 intelChooseRenderState(GLcontext * ctx);
+
+extern void intelStartInlinePrimitive(struct intel_context *intel,
+ GLuint prim, GLuint flags);
+extern void intelWrapInlinePrimitive(struct intel_context *intel);
+
+GLuint *intelExtendInlinePrimitive(struct intel_context *intel,
+ GLuint dwords);
+
+
+void intel_meta_draw_quad(struct intel_context *intel,
+ GLfloat x0, GLfloat x1,
+ GLfloat y0, GLfloat y1,
+ GLfloat z,
+ GLuint color,
+ GLfloat s0, GLfloat s1, GLfloat t0, GLfloat t1);
+
+void intel_meta_draw_poly(struct intel_context *intel,
+ GLuint n,
+ GLfloat xy[][2],
+ GLfloat z, GLuint color, GLfloat tex[][2]);
+
+
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/server/i830_common.h b/src/mesa/drivers/dri/i915tex/server/i830_common.h
new file mode 100644
index 00000000000..06f28ed19a4
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/server/i830_common.h
@@ -0,0 +1,220 @@
+/**************************************************************************
+
+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
+#define DRM_I830_DESTROY_HEAP 0x0c
+#define DRM_I830_SET_VBLANK_PIPE 0x0d
+#define DRM_I830_GET_VBLANK_PIPE 0x0e
+
+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 */
+ int width, height; /* screen size in pixels */
+
+ drm_handle_t front_handle;
+ int front_offset;
+ int front_size;
+
+ drm_handle_t back_handle;
+ int back_offset;
+ int back_size;
+
+ drm_handle_t depth_handle;
+ int depth_offset;
+ int depth_size;
+
+ drm_handle_t tex_handle;
+ int tex_offset;
+ int tex_size;
+ int log_tex_granularity;
+ int pitch;
+ int rotation; /* 0, 90, 180 or 270 */
+ int rotated_offset;
+ int rotated_size;
+ int rotated_pitch;
+ int virtualX, virtualY;
+
+ unsigned int front_tiled;
+ unsigned int back_tiled;
+ unsigned int depth_tiled;
+ unsigned int rotated_tiled;
+ unsigned int rotated2_tiled;
+
+ int pipeA_x;
+ int pipeA_y;
+ int pipeA_w;
+ int pipeA_h;
+ int pipeB_x;
+ int pipeB_y;
+ int pipeB_w;
+ int pipeB_h;
+} 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;
+
+typedef struct {
+ int region;
+} drmI830MemDestroyHeap;
+
+#define DRM_I830_VBLANK_PIPE_A 1
+#define DRM_I830_VBLANK_PIPE_B 2
+
+typedef struct {
+ int pipe;
+} drmI830VBlankPipe;
+
+#endif /* _I830_DRM_H_ */
diff --git a/src/mesa/drivers/dri/i915tex/server/i830_dri.h b/src/mesa/drivers/dri/i915tex/server/i830_dri.h
new file mode 100644
index 00000000000..c2a3af8cbf7
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/server/i830_dri.h
@@ -0,0 +1,63 @@
+/* $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 7
+#define I830_PATCHLEVEL 2
+
+#define I830_REG_SIZE 0x80000
+
+typedef struct _I830DRIRec {
+ drm_handle_t regs;
+ drmSize regsSize;
+
+ drmSize unused1; /* backbufferSize */
+ drm_handle_t unused2; /* backbuffer */
+
+ drmSize unused3; /* depthbufferSize */
+ drm_handle_t unused4; /* depthbuffer */
+
+ drmSize unused5; /* rotatedSize */
+ drm_handle_t unused6; /* rotatedbuffer */
+
+ drm_handle_t unused7; /* textures */
+ int unused8; /* textureSize */
+
+ drm_handle_t unused9; /* agp_buffers */
+ drmSize unused10; /* agp_buf_size */
+
+ int deviceID;
+ int width;
+ int height;
+ int mem;
+ int cpp;
+ int bitsPerPixel;
+
+ int unused11[8]; /* was front/back/depth/rotated offset/pitch */
+
+ int unused12; /* logTextureGranularity */
+ int unused13; /* 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/src/mesa/drivers/dri/i915tex/server/intel.h b/src/mesa/drivers/dri/i915tex/server/intel.h
new file mode 100644
index 00000000000..6ea72499c1c
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/server/intel.h
@@ -0,0 +1,331 @@
+#ifndef _INTEL_H_
+#define _INTEL_H_
+
+#include "xf86drm.h" /* drm_handle_t, etc */
+
+/* Intel */
+#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
+#define PCI_CHIP_I810_BRIDGE 0x7120
+#define PCI_CHIP_I810_DC100_BRIDGE 0x7122
+#define PCI_CHIP_I810_E_BRIDGE 0x7124
+#define PCI_CHIP_I815_BRIDGE 0x1130
+#endif
+
+#define PCI_CHIP_845_G 0x2562
+#define PCI_CHIP_I830_M 0x3577
+
+#ifndef PCI_CHIP_I855_GM
+#define PCI_CHIP_I855_GM 0x3582
+#define PCI_CHIP_I855_GM_BRIDGE 0x3580
+#endif
+
+#ifndef PCI_CHIP_I865_G
+#define PCI_CHIP_I865_G 0x2572
+#define PCI_CHIP_I865_G_BRIDGE 0x2570
+#endif
+
+#ifndef PCI_CHIP_I915_G
+#define PCI_CHIP_I915_G 0x2582
+#define PCI_CHIP_I915_G_BRIDGE 0x2580
+#endif
+
+#ifndef PCI_CHIP_I915_GM
+#define PCI_CHIP_I915_GM 0x2592
+#define PCI_CHIP_I915_GM_BRIDGE 0x2590
+#endif
+
+#ifndef PCI_CHIP_E7221_G
+#define PCI_CHIP_E7221_G 0x258A
+/* Same as I915_G_BRIDGE */
+#define PCI_CHIP_E7221_G_BRIDGE 0x2580
+#endif
+
+#ifndef PCI_CHIP_I945_G
+#define PCI_CHIP_I945_G 0x2772
+#define PCI_CHIP_I945_G_BRIDGE 0x2770
+#endif
+
+#ifndef PCI_CHIP_I945_GM
+#define PCI_CHIP_I945_GM 0x27A2
+#define PCI_CHIP_I945_GM_BRIDGE 0x27A0
+#endif
+
+#define IS_I810(pI810) (pI810->Chipset == PCI_CHIP_I810 || \
+ pI810->Chipset == PCI_CHIP_I810_DC100 || \
+ pI810->Chipset == PCI_CHIP_I810_E)
+#define IS_I815(pI810) (pI810->Chipset == PCI_CHIP_I815)
+#define IS_I830(pI810) (pI810->Chipset == PCI_CHIP_I830_M)
+#define IS_845G(pI810) (pI810->Chipset == PCI_CHIP_845_G)
+#define IS_I85X(pI810) (pI810->Chipset == PCI_CHIP_I855_GM)
+#define IS_I852(pI810) (pI810->Chipset == PCI_CHIP_I855_GM && (pI810->variant == I852_GM || pI810->variant == I852_GME))
+#define IS_I855(pI810) (pI810->Chipset == PCI_CHIP_I855_GM && (pI810->variant == I855_GM || pI810->variant == I855_GME))
+#define IS_I865G(pI810) (pI810->Chipset == PCI_CHIP_I865_G)
+
+#define IS_I915G(pI810) (pI810->Chipset == PCI_CHIP_I915_G || pI810->Chipset == PCI_CHIP_E7221_G)
+#define IS_I915GM(pI810) (pI810->Chipset == PCI_CHIP_I915_GM)
+#define IS_I945G(pI810) (pI810->Chipset == PCI_CHIP_I945_G)
+#define IS_I945GM(pI810) (pI810->Chipset == PCI_CHIP_I945_GM)
+#define IS_I9XX(pI810) (IS_I915G(pI810) || IS_I915GM(pI810) || IS_I945G(pI810) || IS_I945GM(pI810))
+
+#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I945GM(pI810))
+
+#define I830_GMCH_CTRL 0x52
+
+#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 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 I915G_GMCH_GMS_STOLEN_48M (0x6 << 4)
+#define I915G_GMCH_GMS_STOLEN_64M (0x7 << 4)
+
+typedef unsigned char Bool;
+#define TRUE 1
+#define FALSE 0
+
+#define PIPE_NONE 0<<0
+#define PIPE_CRT 1<<0
+#define PIPE_TV 1<<1
+#define PIPE_DFP 1<<2
+#define PIPE_LFP 1<<3
+#define PIPE_CRT2 1<<4
+#define PIPE_TV2 1<<5
+#define PIPE_DFP2 1<<6
+#define PIPE_LFP2 1<<7
+
+typedef struct _I830MemPool *I830MemPoolPtr;
+typedef struct _I830MemRange *I830MemRangePtr;
+typedef struct _I830MemRange {
+ long Start;
+ long End;
+ long Size;
+ unsigned long Physical;
+ unsigned long Offset; /* Offset of AGP-allocated portion */
+ unsigned long Alignment;
+ drm_handle_t Key;
+ unsigned long Pitch; // add pitch
+ I830MemPoolPtr Pool;
+} I830MemRange;
+
+typedef struct _I830MemPool {
+ I830MemRange Total;
+ I830MemRange Free;
+ I830MemRange Fixed;
+ I830MemRange Allocated;
+} I830MemPool;
+
+typedef struct {
+ int tail_mask;
+ I830MemRange mem;
+ unsigned char *virtual_start;
+ int head;
+ int tail;
+ int space;
+} I830RingBuffer;
+
+typedef struct _I830Rec {
+ unsigned char *MMIOBase;
+ unsigned char *FbBase;
+ int cpp;
+ uint32_t aper_size;
+ unsigned int bios_version;
+
+ /* These are set in PreInit and never changed. */
+ long FbMapSize;
+ long TotalVideoRam;
+ I830MemRange StolenMemory; /* pre-allocated memory */
+ long BIOSMemorySize; /* min stolen pool size */
+ int BIOSMemSizeLoc;
+
+ /* These change according to what has been allocated. */
+ long FreeMemory;
+ I830MemRange MemoryAperture;
+ I830MemPool StolenPool;
+ long allocatedMemory;
+
+ /* Regions allocated either from the above pools, or from agpgart. */
+ /* for single and dual head configurations */
+ I830MemRange FrontBuffer;
+ I830MemRange FrontBuffer2;
+ I830MemRange Scratch;
+ I830MemRange Scratch2;
+
+ I830RingBuffer *LpRing;
+
+ I830MemRange BackBuffer;
+ I830MemRange DepthBuffer;
+ I830MemRange TexMem;
+ int TexGranularity;
+ I830MemRange ContextMem;
+ int drmMinor;
+ Bool have3DWindows;
+
+ Bool NeedRingBufferLow;
+ Bool allowPageFlip;
+ Bool disableTiling;
+
+ int Chipset;
+ unsigned long LinearAddr;
+ unsigned long MMIOAddr;
+
+ drmSize registerSize; /**< \brief MMIO register map size */
+ drm_handle_t registerHandle; /**< \brief MMIO register map handle */
+ // IOADDRESS ioBase;
+ int irq; /**< \brief IRQ number */
+ int GttBound;
+
+ drm_handle_t ring_map;
+ unsigned int Fence[8];
+
+} I830Rec;
+
+/*
+ * 12288 is set as the maximum, chosen because it is enough for
+ * 1920x1440@32bpp with a 2048 pixel line pitch with some to spare.
+ */
+#define I830_MAXIMUM_VBIOS_MEM 12288
+#define I830_DEFAULT_VIDEOMEM_2D (MB(32) / 1024)
+#define I830_DEFAULT_VIDEOMEM_3D (MB(64) / 1024)
+
+/* Flags for memory allocation function */
+#define FROM_ANYWHERE 0x00000000
+#define FROM_POOL_ONLY 0x00000001
+#define FROM_NEW_ONLY 0x00000002
+#define FROM_MASK 0x0000000f
+
+#define ALLOCATE_AT_TOP 0x00000010
+#define ALLOCATE_AT_BOTTOM 0x00000020
+#define FORCE_GAPS 0x00000040
+
+#define NEED_PHYSICAL_ADDR 0x00000100
+#define ALIGN_BOTH_ENDS 0x00000200
+#define FORCE_LOW 0x00000400
+
+#define ALLOC_NO_TILING 0x00001000
+#define ALLOC_INITIAL 0x00002000
+
+#define ALLOCATE_DRY_RUN 0x80000000
+
+/* Chipset registers for VIDEO BIOS memory RW access */
+#define _855_DRAM_RW_CONTROL 0x58
+#define _845_DRAM_RW_CONTROL 0x90
+#define DRAM_WRITE 0x33330000
+
+#define KB(x) ((x) * 1024)
+#define MB(x) ((x) * KB(1024))
+
+#define GTT_PAGE_SIZE KB(4)
+#define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y))
+#define ROUND_DOWN_TO(x, y) ((x) / (y) * (y))
+#define ROUND_TO_PAGE(x) ROUND_TO((x), GTT_PAGE_SIZE)
+#define ROUND_TO_MB(x) ROUND_TO((x), MB(1))
+#define PRIMARY_RINGBUFFER_SIZE KB(128)
+
+
+/* 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 0x03FFFFF8
+#define I830_RING_START_MASK 0xFFFFF000
+
+#define RING_LEN 0x0C
+#define RING_NR_PAGES 0x001FF000
+#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
+
+
+/* Fence/Tiling ranges [0..7]
+ */
+#define FENCE 0x2000
+#define FENCE_NR 8
+
+#define I915G_FENCE_START_MASK 0x0ff00000
+
+#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 I915G_FENCE_SIZE_1M 0x00000000
+#define I915G_FENCE_SIZE_2M 0x00000100
+#define I915G_FENCE_SIZE_4M 0x00000200
+#define I915G_FENCE_SIZE_8M 0x00000300
+#define I915G_FENCE_SIZE_16M 0x00000400
+#define I915G_FENCE_SIZE_32M 0x00000500
+#define I915G_FENCE_SIZE_64M 0x00000600
+#define I915G_FENCE_SIZE_128M 0x00000700
+#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
+
+#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(MMIO, addr)
+#define INREG(addr) MMIO_IN32(MMIO, addr)
+#define OUTREG8(addr, val) MMIO_OUT8(MMIO, addr, val)
+#define OUTREG(addr, val) MMIO_OUT32(MMIO, addr, val)
+
+#define DSPABASE 0x70184
+
+#endif
diff --git a/src/mesa/drivers/dri/i915tex/server/intel_dri.c b/src/mesa/drivers/dri/i915tex/server/intel_dri.c
new file mode 100644
index 00000000000..4d1ac09f644
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/server/intel_dri.c
@@ -0,0 +1,1333 @@
+/**
+ * \file server/intel_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) 2006 Dave Airlie (airlied@linux.ie)
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and 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 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "driver.h"
+#include "drm.h"
+
+#include "intel.h"
+#include "i830_dri.h"
+
+#include "memops.h"
+#include "pciaccess.h"
+
+static size_t drm_page_size;
+static int nextTile = 0;
+#define xf86DrvMsg(...) do {} while(0)
+
+static const int pitches[] = {
+ 128 * 8,
+ 128 * 16,
+ 128 * 32,
+ 128 * 64,
+ 0
+};
+
+static Bool I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea);
+
+static unsigned long
+GetBestTileAlignment(unsigned long size)
+{
+ unsigned long i;
+
+ for (i = KB(512); i < size; i <<= 1)
+ ;
+
+ if (i > MB(64))
+ i = MB(64);
+
+ return i;
+}
+
+static void SetFenceRegs(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ int i;
+ unsigned char *MMIO = ctx->MMIOAddress;
+
+ for (i = 0; i < 8; i++) {
+ OUTREG(FENCE + i * 4, pI830->Fence[i]);
+ // if (I810_DEBUG & DEBUG_VERBOSE_VGA)
+ fprintf(stderr,"Fence Register : %x\n", pI830->Fence[i]);
+ }
+}
+
+/* Tiled memory is good... really, really good...
+ *
+ * Need to make it less likely that we miss out on this - probably
+ * need to move the frontbuffer away from the 'guarenteed' alignment
+ * of the first memory segment, or perhaps allocate a discontigous
+ * framebuffer to get more alignment 'sweet spots'.
+ */
+static void
+SetFence(const DRIDriverContext *ctx, I830Rec *pI830,
+ int nr, unsigned int start, unsigned int pitch,
+ unsigned int size)
+{
+ unsigned int val;
+ unsigned int fence_mask = 0;
+ unsigned int fence_pitch;
+
+ if (nr < 0 || nr > 7) {
+ fprintf(stderr,
+ "SetFence: fence %d out of range\n",nr);
+ return;
+ }
+
+ pI830->Fence[nr] = 0;
+
+ if (IS_I9XX(pI830))
+ fence_mask = ~I915G_FENCE_START_MASK;
+ else
+ fence_mask = ~I830_FENCE_START_MASK;
+
+ if (start & fence_mask) {
+ fprintf(stderr,
+ "SetFence: %d: start (0x%08x) is not %s aligned\n",
+ nr, start, (IS_I9XX(pI830)) ? "1MB" : "512k");
+ return;
+ }
+
+ if (start % size) {
+ fprintf(stderr,
+ "SetFence: %d: start (0x%08x) is not size (%dk) aligned\n",
+ nr, start, size / 1024);
+ return;
+ }
+
+ if (pitch & 127) {
+ fprintf(stderr,
+ "SetFence: %d: pitch (%d) not a multiple of 128 bytes\n",
+ nr, pitch);
+ return;
+ }
+
+ val = (start | FENCE_X_MAJOR | FENCE_VALID);
+
+ if (IS_I9XX(pI830)) {
+ switch (size) {
+ case MB(1):
+ val |= I915G_FENCE_SIZE_1M;
+ break;
+ case MB(2):
+ val |= I915G_FENCE_SIZE_2M;
+ break;
+ case MB(4):
+ val |= I915G_FENCE_SIZE_4M;
+ break;
+ case MB(8):
+ val |= I915G_FENCE_SIZE_8M;
+ break;
+ case MB(16):
+ val |= I915G_FENCE_SIZE_16M;
+ break;
+ case MB(32):
+ val |= I915G_FENCE_SIZE_32M;
+ break;
+ case MB(64):
+ val |= I915G_FENCE_SIZE_64M;
+ break;
+ default:
+ fprintf(stderr,
+ "SetFence: %d: illegal size (%d kByte)\n", nr, size / 1024);
+ return;
+ }
+ } else {
+ switch (size) {
+ case KB(512):
+ val |= FENCE_SIZE_512K;
+ break;
+ case MB(1):
+ val |= FENCE_SIZE_1M;
+ break;
+ case MB(2):
+ val |= FENCE_SIZE_2M;
+ break;
+ case MB(4):
+ val |= FENCE_SIZE_4M;
+ break;
+ case MB(8):
+ val |= FENCE_SIZE_8M;
+ break;
+ case MB(16):
+ val |= FENCE_SIZE_16M;
+ break;
+ case MB(32):
+ val |= FENCE_SIZE_32M;
+ break;
+ case MB(64):
+ val |= FENCE_SIZE_64M;
+ break;
+ default:
+ fprintf(stderr,
+ "SetFence: %d: illegal size (%d kByte)\n", nr, size / 1024);
+ return;
+ }
+ }
+
+ if (IS_I9XX(pI830))
+ fence_pitch = pitch / 512;
+ else
+ fence_pitch = pitch / 128;
+
+ switch (fence_pitch) {
+ case 1:
+ val |= FENCE_PITCH_1;
+ break;
+ case 2:
+ val |= FENCE_PITCH_2;
+ break;
+ case 4:
+ val |= FENCE_PITCH_4;
+ break;
+ case 8:
+ val |= FENCE_PITCH_8;
+ break;
+ case 16:
+ val |= FENCE_PITCH_16;
+ break;
+ case 32:
+ val |= FENCE_PITCH_32;
+ break;
+ case 64:
+ val |= FENCE_PITCH_64;
+ break;
+ default:
+ fprintf(stderr,
+ "SetFence: %d: illegal pitch (%d)\n", nr, pitch);
+ return;
+ }
+
+ pI830->Fence[nr] = val;
+}
+
+static Bool
+MakeTiles(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *pMem)
+{
+ int pitch, ntiles, i;
+
+ pitch = pMem->Pitch * ctx->cpp;
+ /*
+ * Simply try to break the region up into at most four pieces of size
+ * equal to the alignment.
+ */
+ ntiles = ROUND_TO(pMem->Size, pMem->Alignment) / pMem->Alignment;
+ if (ntiles >= 4) {
+ return FALSE;
+ }
+
+ for (i = 0; i < ntiles; i++, nextTile++) {
+ SetFence(ctx, pI830, nextTile, pMem->Start + i * pMem->Alignment,
+ pitch, pMem->Alignment);
+ }
+ return TRUE;
+}
+
+static void I830SetupMemoryTiling(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ int i;
+
+ /* Clear out */
+ for (i = 0; i < 8; i++)
+ pI830->Fence[i] = 0;
+
+ nextTile = 0;
+
+ if (pI830->BackBuffer.Alignment >= KB(512)) {
+ if (MakeTiles(ctx, pI830, &(pI830->BackBuffer))) {
+ fprintf(stderr,
+ "Activating tiled memory for the back buffer.\n");
+ } else {
+ fprintf(stderr,
+ "MakeTiles failed for the back buffer.\n");
+ pI830->allowPageFlip = FALSE;
+ }
+ }
+
+ if (pI830->DepthBuffer.Alignment >= KB(512)) {
+ if (MakeTiles(ctx, pI830, &(pI830->DepthBuffer))) {
+ fprintf(stderr,
+ "Activating tiled memory for the depth buffer.\n");
+ } else {
+ fprintf(stderr,
+ "MakeTiles failed for the depth buffer.\n");
+ }
+ }
+
+ return;
+}
+
+static int I830DetectMemory(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ struct pci_device host_bridge, ig_dev;
+ uint32_t gmch_ctrl;
+ int memsize = 0;
+ int range;
+ uint32_t aper_size;
+ uint32_t membase2 = 0;
+
+ memset(&host_bridge, 0, sizeof(host_bridge));
+ memset(&ig_dev, 0, sizeof(ig_dev));
+
+ ig_dev.dev = 2;
+
+ pci_device_cfg_read_u32(&host_bridge, &gmch_ctrl, I830_GMCH_CTRL);
+
+ if (IS_I830(pI830) || IS_845G(pI830)) {
+ if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) {
+ aper_size = 0x80000000;
+ } else {
+ aper_size = 0x40000000;
+ }
+ } else {
+ if (IS_I9XX(pI830)) {
+ int ret;
+ ret = pci_device_cfg_read_u32(&ig_dev, &membase2, 0x18);
+ if (membase2 & 0x08000000)
+ aper_size = 0x8000000;
+ else
+ aper_size = 0x10000000;
+
+ fprintf(stderr,"aper size is %08X %08x %d\n", aper_size, membase2, ret);
+ } else
+ aper_size = 0x8000000;
+ }
+
+ pI830->aper_size = aper_size;
+
+
+ /* We need to reduce the stolen size, by the GTT and the popup.
+ * The GTT varying according the the FbMapSize and the popup is 4KB */
+ range = (ctx->shared.fbSize / (1024*1024)) + 4;
+
+ if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I9XX(pI830)) {
+ switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
+ case I855_GMCH_GMS_STOLEN_1M:
+ memsize = MB(1) - KB(range);
+ break;
+ case I855_GMCH_GMS_STOLEN_4M:
+ memsize = MB(4) - KB(range);
+ break;
+ case I855_GMCH_GMS_STOLEN_8M:
+ memsize = MB(8) - KB(range);
+ break;
+ case I855_GMCH_GMS_STOLEN_16M:
+ memsize = MB(16) - KB(range);
+ break;
+ case I855_GMCH_GMS_STOLEN_32M:
+ memsize = MB(32) - KB(range);
+ break;
+ case I915G_GMCH_GMS_STOLEN_48M:
+ if (IS_I9XX(pI830))
+ memsize = MB(48) - KB(range);
+ break;
+ case I915G_GMCH_GMS_STOLEN_64M:
+ if (IS_I9XX(pI830))
+ memsize = MB(64) - KB(range);
+ break;
+ }
+ } else {
+ switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
+ case I830_GMCH_GMS_STOLEN_512:
+ memsize = KB(512) - KB(range);
+ break;
+ case I830_GMCH_GMS_STOLEN_1024:
+ memsize = MB(1) - KB(range);
+ break;
+ case I830_GMCH_GMS_STOLEN_8192:
+ memsize = MB(8) - KB(range);
+ break;
+ case I830_GMCH_GMS_LOCAL:
+ memsize = 0;
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Local memory found, but won't be used.\n");
+ break;
+ }
+ }
+ if (memsize > 0) {
+ fprintf(stderr,
+ "detected %d kB stolen memory.\n", memsize / 1024);
+ } else {
+ fprintf(stderr,
+ "no video memory detected.\n");
+ }
+ return memsize;
+}
+
+static int AgpInit(const DRIDriverContext *ctx, I830Rec *info)
+{
+ unsigned long mode = 0x4;
+
+ if (drmAgpAcquire(ctx->drmFD) < 0) {
+ fprintf(stderr, "[gart] AGP not available\n");
+ return 0;
+ }
+
+ 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);
+
+ return 1;
+}
+
+/*
+ * Allocate memory from the given pool. Grow the pool if needed and if
+ * possible.
+ */
+static unsigned long
+AllocFromPool(const DRIDriverContext *ctx, I830Rec *pI830,
+ I830MemRange *result, I830MemPool *pool,
+ long size, unsigned long alignment, int flags)
+{
+ long needed, start, end;
+
+ if (!result || !pool || !size)
+ return 0;
+
+ /* Calculate how much space is needed. */
+ if (alignment <= GTT_PAGE_SIZE)
+ needed = size;
+ else {
+ start = ROUND_TO(pool->Free.Start, alignment);
+ end = ROUND_TO(start + size, alignment);
+ needed = end - pool->Free.Start;
+ }
+ if (needed > pool->Free.Size) {
+ return 0;
+ }
+
+ result->Start = ROUND_TO(pool->Free.Start, alignment);
+ pool->Free.Start += needed;
+ result->End = pool->Free.Start;
+
+ pool->Free.Size = pool->Free.End - pool->Free.Start;
+ result->Size = result->End - result->Start;
+ result->Pool = pool;
+ result->Alignment = alignment;
+ return needed;
+}
+
+static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, long size, unsigned long alignment, I830MemRange *result)
+{
+ unsigned long start, end;
+ unsigned long newApStart, newApEnd;
+ int ret;
+ if (!result || !size)
+ return 0;
+
+ if (!alignment)
+ alignment = 4;
+
+ start = ROUND_TO(pI830->MemoryAperture.Start, alignment);
+ end = ROUND_TO(start + size, alignment);
+ newApStart = end;
+ newApEnd = pI830->MemoryAperture.End;
+
+ ret=drmAgpAlloc(ctx->drmFD, size, 0, &(result->Physical), (drm_handle_t *)&(result->Key));
+
+ if (ret)
+ {
+ fprintf(stderr,"drmAgpAlloc failed %d\n", ret);
+ return 0;
+ }
+ pI830->allocatedMemory += size;
+ pI830->MemoryAperture.Start = newApStart;
+ pI830->MemoryAperture.End = newApEnd;
+ pI830->MemoryAperture.Size = newApEnd - newApStart;
+ // pI830->FreeMemory -= size;
+ result->Start = start;
+ result->End = start + size;
+ result->Size = size;
+ result->Offset = start;
+ result->Alignment = alignment;
+ result->Pool = NULL;
+
+ return size;
+}
+
+unsigned long
+I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags)
+{
+ int ret;
+
+ if (!result)
+ return 0;
+
+ /* Make sure these are initialised. */
+ result->Size = 0;
+ result->Key = -1;
+
+ if (!size) {
+ return 0;
+ }
+
+ if (pool->Free.Size < size)
+ return AllocFromAGP(ctx, pI830, size, alignment, result);
+ else
+ {
+ ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
+
+ if (ret==0)
+ return AllocFromAGP(ctx, pI830, size, alignment, result);
+ return ret;
+ }
+}
+
+static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem)
+{
+ if (!mem)
+ return FALSE;
+
+ if (mem->Key == -1)
+ return TRUE;
+
+ return !drmAgpBind(ctx->drmFD, mem->Key, mem->Offset);
+}
+
+/* simple memory allocation routines needed */
+/* put ring buffer in low memory */
+/* need to allocate front, back, depth buffers aligned correctly,
+ allocate ring buffer,
+*/
+
+/* */
+static Bool
+I830AllocateMemory(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ unsigned long size, ret;
+ unsigned long lines, lineSize, align;
+
+ /* allocate ring buffer */
+ memset(pI830->LpRing, 0, sizeof(I830RingBuffer));
+ pI830->LpRing->mem.Key = -1;
+
+ size = PRIMARY_RINGBUFFER_SIZE;
+
+ ret = I830AllocVidMem(ctx, pI830, &pI830->LpRing->mem, &pI830->StolenPool, size, 0x1000, 0);
+
+ if (ret != size)
+ {
+ fprintf(stderr,"unable to allocate ring buffer %ld\n", ret);
+ return FALSE;
+ }
+
+ pI830->LpRing->tail_mask = pI830->LpRing->mem.Size - 1;
+
+
+ /* allocate front buffer */
+ memset(&(pI830->FrontBuffer), 0, sizeof(pI830->FrontBuffer));
+ pI830->FrontBuffer.Key = -1;
+ pI830->FrontBuffer.Pitch = ctx->shared.virtualWidth;
+
+ align = KB(512);
+
+ lineSize = ctx->shared.virtualWidth * ctx->cpp;
+ lines = (ctx->shared.virtualHeight + 15) / 16 * 16;
+ size = lineSize * lines;
+ size = ROUND_TO_PAGE(size);
+
+ align = GetBestTileAlignment(size);
+
+ ret = I830AllocVidMem(ctx, pI830, &pI830->FrontBuffer, &pI830->StolenPool, size, align, 0);
+ if (ret < size)
+ {
+ fprintf(stderr,"unable to allocate front buffer %ld\n", ret);
+ return FALSE;
+ }
+
+ memset(&(pI830->BackBuffer), 0, sizeof(pI830->BackBuffer));
+ pI830->BackBuffer.Key = -1;
+ pI830->BackBuffer.Pitch = ctx->shared.virtualWidth;
+
+ ret = I830AllocVidMem(ctx, pI830, &pI830->BackBuffer, &pI830->StolenPool, size, align, 0);
+ if (ret < size)
+ {
+ fprintf(stderr,"unable to allocate back buffer %ld\n", ret);
+ return FALSE;
+ }
+
+ memset(&(pI830->DepthBuffer), 0, sizeof(pI830->DepthBuffer));
+ pI830->DepthBuffer.Key = -1;
+ pI830->DepthBuffer.Pitch = ctx->shared.virtualWidth;
+
+ ret = I830AllocVidMem(ctx, pI830, &pI830->DepthBuffer, &pI830->StolenPool, size, align, 0);
+ if (ret < size)
+ {
+ fprintf(stderr,"unable to allocate depth buffer %ld\n", ret);
+ return FALSE;
+ }
+
+ memset(&(pI830->ContextMem), 0, sizeof(pI830->ContextMem));
+ pI830->ContextMem.Key = -1;
+ size = KB(32);
+
+ ret = I830AllocVidMem(ctx, pI830, &pI830->ContextMem, &pI830->StolenPool, size, align, 0);
+ if (ret < size)
+ {
+ fprintf(stderr,"unable to allocate context buffer %ld\n", ret);
+ return FALSE;
+ }
+
+#if 0
+ memset(&(pI830->TexMem), 0, sizeof(pI830->TexMem));
+ pI830->TexMem.Key = -1;
+
+ size = 32768 * 1024;
+ ret = AllocFromAGP(ctx, pI830, size, align, &pI830->TexMem);
+ if (ret < size)
+ {
+ fprintf(stderr,"unable to allocate texture memory %ld\n", ret);
+ return FALSE;
+ }
+#endif
+
+ return TRUE;
+}
+
+static Bool
+I830BindMemory(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ if (!BindAgpRange(ctx, &pI830->LpRing->mem))
+ return FALSE;
+ if (!BindAgpRange(ctx, &pI830->FrontBuffer))
+ return FALSE;
+ if (!BindAgpRange(ctx, &pI830->BackBuffer))
+ return FALSE;
+ if (!BindAgpRange(ctx, &pI830->DepthBuffer))
+ return FALSE;
+ if (!BindAgpRange(ctx, &pI830->ContextMem))
+ return FALSE;
+#if 0
+ if (!BindAgpRange(ctx, &pI830->TexMem))
+ return FALSE;
+#endif
+ return TRUE;
+}
+
+static void SetupDRIMM(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ unsigned long aperEnd = ROUND_DOWN_TO(pI830->aper_size, GTT_PAGE_SIZE) / GTT_PAGE_SIZE;
+ unsigned long aperStart = ROUND_TO(pI830->aper_size - KB(32768), GTT_PAGE_SIZE) / GTT_PAGE_SIZE;
+
+ fprintf(stderr, "aper size is %08X\n", ctx->shared.fbSize);
+ if (drmMMInit(ctx->drmFD, aperStart, aperEnd - aperStart, DRM_BO_MEM_TT)) {
+ fprintf(stderr,
+ "DRM MM Initialization Failed\n");
+ } else {
+ fprintf(stderr,
+ "DRM MM Initialized at offset 0x%lx length %d page\n", aperStart, aperEnd-aperStart);
+ }
+
+}
+
+static Bool
+I830CleanupDma(const DRIDriverContext *ctx)
+{
+ drmI830Init info;
+
+ memset(&info, 0, sizeof(drmI830Init));
+ info.func = I830_CLEANUP_DMA;
+
+ if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT,
+ &info, sizeof(drmI830Init))) {
+ fprintf(stderr, "I830 Dma Cleanup Failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static Bool
+I830InitDma(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ I830RingBuffer *ring = pI830->LpRing;
+ drmI830Init info;
+
+ memset(&info, 0, sizeof(drmI830Init));
+ info.func = I830_INIT_DMA;
+
+ info.ring_start = ring->mem.Start + pI830->LinearAddr;
+ info.ring_end = ring->mem.End + pI830->LinearAddr;
+ info.ring_size = ring->mem.Size;
+
+ info.mmio_offset = (unsigned int)ctx->MMIOStart;
+
+ info.sarea_priv_offset = sizeof(drm_sarea_t);
+
+ info.front_offset = pI830->FrontBuffer.Start;
+ info.back_offset = pI830->BackBuffer.Start;
+ info.depth_offset = pI830->DepthBuffer.Start;
+ info.w = ctx->shared.virtualWidth;
+ info.h = ctx->shared.virtualHeight;
+ info.pitch = ctx->shared.virtualWidth;
+ info.back_pitch = pI830->BackBuffer.Pitch;
+ info.depth_pitch = pI830->DepthBuffer.Pitch;
+ info.cpp = ctx->cpp;
+
+ if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT,
+ &info, sizeof(drmI830Init))) {
+ fprintf(stderr,
+ "I830 Dma Initialization Failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static int I830CheckDRMVersion( const DRIDriverContext *ctx,
+ I830Rec *pI830 )
+{
+ drmVersionPtr version;
+
+ version = drmGetVersion(ctx->drmFD);
+
+ if (version) {
+ int req_minor, req_patch;
+
+ req_minor = 4;
+ 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] I830DRIScreenInit failed because of a version "
+ "mismatch.\n"
+ "[dri] i915.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;
+ }
+
+ pI830->drmMinor = version->version_minor;
+ drmFreeVersion(version);
+ }
+ return 1;
+}
+
+static void
+I830SetRingRegs(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ unsigned int itemp;
+ unsigned char *MMIO = ctx->MMIOAddress;
+
+ OUTREG(LP_RING + RING_LEN, 0);
+ OUTREG(LP_RING + RING_TAIL, 0);
+ OUTREG(LP_RING + RING_HEAD, 0);
+
+ if ((long)(pI830->LpRing->mem.Start & I830_RING_START_MASK) !=
+ pI830->LpRing->mem.Start) {
+ fprintf(stderr,
+ "I830SetRingRegs: Ring buffer start (%lx) violates its "
+ "mask (%x)\n", pI830->LpRing->mem.Start, I830_RING_START_MASK);
+ }
+ /* Don't care about the old value. Reserved bits must be zero anyway. */
+ itemp = pI830->LpRing->mem.Start & I830_RING_START_MASK;
+ OUTREG(LP_RING + RING_START, itemp);
+
+ if (((pI830->LpRing->mem.Size - 4096) & I830_RING_NR_PAGES) !=
+ pI830->LpRing->mem.Size - 4096) {
+ fprintf(stderr,
+ "I830SetRingRegs: Ring buffer size - 4096 (%lx) violates its "
+ "mask (%x)\n", pI830->LpRing->mem.Size - 4096,
+ I830_RING_NR_PAGES);
+ }
+ /* Don't care about the old value. Reserved bits must be zero anyway. */
+ itemp = (pI830->LpRing->mem.Size - 4096) & I830_RING_NR_PAGES;
+ itemp |= (RING_NO_REPORT | RING_VALID);
+ OUTREG(LP_RING + RING_LEN, itemp);
+
+ pI830->LpRing->head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK;
+ pI830->LpRing->tail = INREG(LP_RING + RING_TAIL);
+ pI830->LpRing->space = pI830->LpRing->head - (pI830->LpRing->tail + 8);
+ if (pI830->LpRing->space < 0)
+ pI830->LpRing->space += pI830->LpRing->mem.Size;
+
+ SetFenceRegs(ctx, pI830);
+
+ /* RESET THE DISPLAY PIPE TO POINT TO THE FRONTBUFFER - hacky
+ hacky hacky */
+ OUTREG(DSPABASE, pI830->FrontBuffer.Start + pI830->LinearAddr);
+
+}
+
+static Bool
+I830SetParam(const DRIDriverContext *ctx, int param, int value)
+{
+ drmI830SetParam sp;
+
+ memset(&sp, 0, sizeof(sp));
+ sp.param = param;
+ sp.value = value;
+
+ if (drmCommandWrite(ctx->drmFD, DRM_I830_SETPARAM, &sp, sizeof(sp))) {
+ fprintf(stderr, "I830 SetParam Failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static Bool
+I830DRIMapScreenRegions(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
+{
+ fprintf(stderr,
+ "[drm] Mapping front buffer\n");
+
+ if (drmAddMap(ctx->drmFD,
+ (drm_handle_t)(sarea->front_offset + pI830->LinearAddr),
+ sarea->front_size,
+ DRM_FRAME_BUFFER, /*DRM_AGP,*/
+ 0,
+ &sarea->front_handle) < 0) {
+ fprintf(stderr,
+ "[drm] drmAddMap(front_handle) failed. Disabling DRI\n");
+ return FALSE;
+ }
+ ctx->shared.hFrameBuffer = sarea->front_handle;
+ ctx->shared.fbSize = sarea->front_size;
+ fprintf(stderr, "[drm] Front Buffer = 0x%08x\n",
+ sarea->front_handle);
+
+ if (drmAddMap(ctx->drmFD,
+ (drm_handle_t)(sarea->back_offset),
+ sarea->back_size, DRM_AGP, 0,
+ &sarea->back_handle) < 0) {
+ fprintf(stderr,
+ "[drm] drmAddMap(back_handle) failed. Disabling DRI\n");
+ return FALSE;
+ }
+ fprintf(stderr, "[drm] Back Buffer = 0x%08x\n",
+ sarea->back_handle);
+
+ if (drmAddMap(ctx->drmFD,
+ (drm_handle_t)sarea->depth_offset,
+ sarea->depth_size, DRM_AGP, 0,
+ &sarea->depth_handle) < 0) {
+ fprintf(stderr,
+ "[drm] drmAddMap(depth_handle) failed. Disabling DRI\n");
+ return FALSE;
+ }
+ fprintf(stderr, "[drm] Depth Buffer = 0x%08x\n",
+ sarea->depth_handle);
+
+#if 0
+ if (drmAddMap(ctx->drmFD,
+ (drm_handle_t)sarea->tex_offset,
+ sarea->tex_size, DRM_AGP, 0,
+ &sarea->tex_handle) < 0) {
+ fprintf(stderr,
+ "[drm] drmAddMap(tex_handle) failed. Disabling DRI\n");
+ return FALSE;
+ }
+ fprintf(stderr, "[drm] textures = 0x%08x\n",
+ sarea->tex_handle);
+#endif
+ return TRUE;
+}
+
+
+static void
+I830DRIUnmapScreenRegions(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
+{
+#if 1
+ if (sarea->front_handle) {
+ drmRmMap(ctx->drmFD, sarea->front_handle);
+ sarea->front_handle = 0;
+ }
+#endif
+ if (sarea->back_handle) {
+ drmRmMap(ctx->drmFD, sarea->back_handle);
+ sarea->back_handle = 0;
+ }
+ if (sarea->depth_handle) {
+ drmRmMap(ctx->drmFD, sarea->depth_handle);
+ sarea->depth_handle = 0;
+ }
+ if (sarea->tex_handle) {
+ drmRmMap(ctx->drmFD, sarea->tex_handle);
+ sarea->tex_handle = 0;
+ }
+}
+
+#if 0
+static void
+I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
+{
+ /* Start up the simple memory manager for agp space */
+ drmI830MemInitHeap drmHeap;
+ drmHeap.region = I830_MEM_REGION_AGP;
+ drmHeap.start = 0;
+ drmHeap.size = sarea->tex_size;
+
+ if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT_HEAP,
+ &drmHeap, sizeof(drmHeap))) {
+ fprintf(stderr,
+ "[drm] Failed to initialized agp heap manager\n");
+ } else {
+ fprintf(stderr,
+ "[drm] Initialized kernel agp heap manager, %d\n",
+ sarea->tex_size);
+
+ I830SetParam(ctx, I830_SETPARAM_TEX_LRU_LOG_GRANULARITY,
+ sarea->log_tex_granularity);
+ }
+}
+#endif
+
+static Bool
+I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
+{
+ if (drmAddMap(ctx->drmFD,
+ (drm_handle_t)pI830->LpRing->mem.Start,
+ pI830->LpRing->mem.Size, DRM_AGP, 0,
+ &pI830->ring_map) < 0) {
+ fprintf(stderr,
+ "[drm] drmAddMap(ring_map) failed. Disabling DRI\n");
+ return FALSE;
+ }
+ fprintf(stderr, "[drm] ring buffer = 0x%08x\n",
+ pI830->ring_map);
+
+ if (I830InitDma(ctx, pI830) == FALSE) {
+ return FALSE;
+ }
+
+ /* init to zero to be safe */
+
+ I830DRIMapScreenRegions(ctx, pI830, sarea);
+ SetupDRIMM(ctx, pI830);
+
+#if 0
+ I830InitTextureHeap(ctx, pI830, sarea);
+#endif
+ if (ctx->pciDevice != PCI_CHIP_845_G &&
+ ctx->pciDevice != PCI_CHIP_I830_M) {
+ I830SetParam(ctx, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 );
+ }
+
+ /* Okay now initialize the dma engine */
+ {
+ pI830->irq = drmGetInterruptFromBusID(ctx->drmFD,
+ ctx->pciBus,
+ ctx->pciDevice,
+ ctx->pciFunc);
+
+ if (drmCtlInstHandler(ctx->drmFD, pI830->irq)) {
+ fprintf(stderr,
+ "[drm] failure adding irq handler\n");
+ pI830->irq = 0;
+ return FALSE;
+ }
+ else
+ fprintf(stderr,
+ "[drm] dma control initialized, using IRQ %d\n",
+ pI830->irq);
+ }
+
+ fprintf(stderr, "[dri] visual configs initialized\n");
+
+ return TRUE;
+}
+
+static Bool
+I830ClearScreen(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
+{
+ /* need to drmMap front and back buffers and zero them */
+ drmAddress map_addr;
+ int ret;
+
+ ret = drmMap(ctx->drmFD,
+ sarea->front_handle,
+ sarea->front_size,
+ &map_addr);
+
+ if (ret)
+ {
+ fprintf(stderr, "Unable to map front buffer\n");
+ return FALSE;
+ }
+
+ drimemsetio((char *)map_addr,
+ 0,
+ sarea->front_size);
+ drmUnmap(map_addr, sarea->front_size);
+
+
+ ret = drmMap(ctx->drmFD,
+ sarea->back_handle,
+ sarea->back_size,
+ &map_addr);
+
+ if (ret)
+ {
+ fprintf(stderr, "Unable to map back buffer\n");
+ return FALSE;
+ }
+
+ drimemsetio((char *)map_addr,
+ 0,
+ sarea->back_size);
+ drmUnmap(map_addr, sarea->back_size);
+
+ return TRUE;
+}
+
+static Bool
+I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830)
+
+{
+ I830DRIPtr pI830DRI;
+ drmI830Sarea *pSAREAPriv;
+ int err;
+
+ drm_page_size = getpagesize();
+
+ pI830->registerSize = ctx->MMIOSize;
+ /* This is a hack for now. We have to have more than a 4k page here
+ * because of the size of the state. However, the state should be
+ * in a per-context mapping. This will be added in the Mesa 3.5 port
+ * of the I830 driver.
+ */
+ ctx->shared.SAREASize = SAREA_MAX;
+
+ /* Note that drmOpen will try to load the kernel module, if needed. */
+ ctx->drmFD = drmOpen("i915", 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%08x\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%08x 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,
+ &pI830->registerHandle) < 0) {
+ fprintf(stderr, "[drm] drmAddMap mmio failed\n");
+ return 0;
+ }
+ fprintf(stderr,
+ "[drm] register handle = 0x%08x\n", pI830->registerHandle);
+
+
+ if (!I830CheckDRMVersion(ctx, pI830)) {
+ return 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 SAREA private data structure */
+ pSAREAPriv = (drmI830Sarea *)(((char*)ctx->pSAREA) +
+ sizeof(drm_sarea_t));
+ memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
+
+ pI830->StolenMemory.Size = I830DetectMemory(ctx, pI830);
+ pI830->StolenMemory.Start = 0;
+ pI830->StolenMemory.End = pI830->StolenMemory.Size;
+
+ pI830->MemoryAperture.Start = pI830->StolenMemory.End;
+ pI830->MemoryAperture.End = KB(40000);
+ pI830->MemoryAperture.Size = pI830->MemoryAperture.End - pI830->MemoryAperture.Start;
+
+ pI830->StolenPool.Fixed = pI830->StolenMemory;
+ pI830->StolenPool.Total = pI830->StolenMemory;
+ pI830->StolenPool.Free = pI830->StolenPool.Total;
+ pI830->FreeMemory = pI830->StolenPool.Total.Size;
+
+ if (!AgpInit(ctx, pI830))
+ return FALSE;
+
+ if (I830AllocateMemory(ctx, pI830) == FALSE)
+ {
+ return FALSE;
+ }
+
+ if (I830BindMemory(ctx, pI830) == FALSE)
+ {
+ return FALSE;
+ }
+
+ pSAREAPriv->rotated_offset = -1;
+ pSAREAPriv->rotated_size = 0;
+ pSAREAPriv->rotated_pitch = ctx->shared.virtualWidth;
+
+ pSAREAPriv->front_offset = pI830->FrontBuffer.Start;
+ pSAREAPriv->front_size = pI830->FrontBuffer.Size;
+ pSAREAPriv->width = ctx->shared.virtualWidth;
+ pSAREAPriv->height = ctx->shared.virtualHeight;
+ pSAREAPriv->pitch = ctx->shared.virtualWidth;
+ pSAREAPriv->virtualX = ctx->shared.virtualWidth;
+ pSAREAPriv->virtualY = ctx->shared.virtualHeight;
+ pSAREAPriv->back_offset = pI830->BackBuffer.Start;
+ pSAREAPriv->back_size = pI830->BackBuffer.Size;
+ pSAREAPriv->depth_offset = pI830->DepthBuffer.Start;
+ pSAREAPriv->depth_size = pI830->DepthBuffer.Size;
+#if 0
+ pSAREAPriv->tex_offset = pI830->TexMem.Start;
+ pSAREAPriv->tex_size = pI830->TexMem.Size;
+#endif
+ pSAREAPriv->log_tex_granularity = pI830->TexGranularity;
+
+ ctx->driverClientMsg = malloc(sizeof(I830DRIRec));
+ ctx->driverClientMsgSize = sizeof(I830DRIRec);
+ pI830DRI = (I830DRIPtr)ctx->driverClientMsg;
+ pI830DRI->deviceID = pI830->Chipset;
+ pI830DRI->regsSize = I830_REG_SIZE;
+ pI830DRI->width = ctx->shared.virtualWidth;
+ pI830DRI->height = ctx->shared.virtualHeight;
+ pI830DRI->mem = ctx->shared.fbSize;
+ pI830DRI->cpp = ctx->cpp;
+
+ pI830DRI->bitsPerPixel = ctx->bpp;
+ pI830DRI->sarea_priv_offset = sizeof(drm_sarea_t);
+
+ err = I830DRIDoMappings(ctx, pI830, pSAREAPriv);
+ if (err == FALSE)
+ return FALSE;
+
+ I830SetupMemoryTiling(ctx, pI830);
+
+ /* 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.
+ */
+ I830ClearScreen(ctx, pI830, pSAREAPriv);
+
+ I830SetRingRegs(ctx, pI830);
+
+ return TRUE;
+}
+
+
+/**
+ * \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 i830ValidateMode( 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 i810ValidateMode().
+ */
+static int i830PostValidateMode( const DRIDriverContext *ctx )
+{
+ I830Rec *pI830 = ctx->driverPrivate;
+
+ I830SetRingRegs(ctx, pI830);
+ 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 i830InitFBDev( DRIDriverContext *ctx )
+{
+ I830Rec *pI830 = calloc(1, sizeof(I830Rec));
+ int i;
+
+ {
+ 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->shared.Width = ctx->shared.virtualWidth;
+ }
+
+
+ for (i = 0; pitches[i] != 0; i++) {
+ if (pitches[i] >= ctx->shared.virtualWidth) {
+ ctx->shared.virtualWidth = pitches[i];
+ break;
+ }
+ }
+
+ ctx->driverPrivate = (void *)pI830;
+
+ pI830->LpRing = calloc(1, sizeof(I830RingBuffer));
+ pI830->Chipset = ctx->chipset;
+ pI830->LinearAddr = ctx->FBStart;
+
+ if (!I830ScreenInit( ctx, pI830 ))
+ 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 i830HaltFBDev( DRIDriverContext *ctx )
+{
+ drmI830Sarea *pSAREAPriv;
+ I830Rec *pI830 = ctx->driverPrivate;
+
+ if (pI830->irq) {
+ drmCtlUninstHandler(ctx->drmFD);
+ pI830->irq = 0; }
+
+ I830CleanupDma(ctx);
+
+ pSAREAPriv = (drmI830Sarea *)(((char*)ctx->pSAREA) +
+ sizeof(drm_sarea_t));
+
+ I830DRIUnmapScreenRegions(ctx, pI830, pSAREAPriv);
+ 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 = {
+ i830ValidateMode,
+ i830PostValidateMode,
+ i830InitFBDev,
+ i830HaltFBDev,
+ NULL,//I830EngineShutdown,
+ NULL, //I830EngineRestore,
+#ifndef _EMBEDDED
+ 0,
+#else
+ i810NotifyFocus,
+#endif
+};
diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile
index e4fb451cc09..213eac895cb 100644
--- a/src/mesa/drivers/dri/i965/Makefile
+++ b/src/mesa/drivers/dri/i965/Makefile
@@ -16,6 +16,8 @@ DRIVER_SOURCES = \
intel_regions.c \
intel_screen.c \
intel_span.c \
+ intel_pixel_copy.c \
+ intel_pixel_bitmap.c \
intel_state.c \
intel_tex.c \
intel_tex_validate.c \
diff --git a/src/mesa/drivers/dri/i965/brw_attrib.h b/src/mesa/drivers/dri/i965/brw_attrib.h
index a8efc3a528b..12659bd1cf0 100644
--- a/src/mesa/drivers/dri/i965/brw_attrib.h
+++ b/src/mesa/drivers/dri/i965/brw_attrib.h
@@ -95,6 +95,7 @@ enum {
} ;
#define BRW_ATTRIB_FIRST_MATERIAL BRW_ATTRIB_MAT_FRONT_AMBIENT
+#define BRW_ATTRIB_LAST_MATERIAL BRW_ATTRIB_MAT_BACK_INDEXES
#define BRW_MAX_COPIED_VERTS 3
diff --git a/src/mesa/drivers/dri/i965/brw_aub_playback.c b/src/mesa/drivers/dri/i965/brw_aub_playback.c
index 49cc967716e..2433d50c116 100644
--- a/src/mesa/drivers/dri/i965/brw_aub_playback.c
+++ b/src/mesa/drivers/dri/i965/brw_aub_playback.c
@@ -39,7 +39,7 @@ static void flush_and_fence( struct aub_state *s )
buf[0] = intel->vtbl.flush_cmd();
buf[1] = 0;
- intel_cmd_ioctl(intel, (char *)&buf, sizeof(buf), GL_TRUE);
+ intel_cmd_ioctl(intel, (char *)&buf, sizeof(buf));
intelWaitIrq( intel, intelEmitIrqLocked( intel ));
}
@@ -64,7 +64,7 @@ static void flush_cmds( struct aub_state *s,
* This differs slightly from how the stream was executed
* initially as this would have been a batchbuffer.
*/
- intel_cmd_ioctl(s->intel, (void *)data, len, GL_TRUE);
+ intel_cmd_ioctl(s->intel, (void *)data, len);
if (1)
flush_and_fence(s);
@@ -345,7 +345,7 @@ static int parse_block_header( struct aub_state *s )
}
case BH_COMMAND_WRITE:
#if 0
- intel_cmd_ioctl(s->intel, (void *)data, len, GL_TRUE);
+ intel_cmd_ioctl(s->intel, (void *)data, len);
#else
if (parse_commands(s, data, len) != 0)
_mesa_printf("parse_commands failed\n");
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index c1f6617f3fd..bc422c1a50b 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -156,6 +156,8 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
brw_ProgramCacheInit( ctx );
+ brw_FrameBufferTexInit( brw );
+
/* Hook our functions into exec and compile dispatch tables. Only
* fallback on out-of-memory situations.
*/
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 1137bfd2c76..a57c794834f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -485,7 +485,7 @@ struct brw_context
*/
struct brw_state_pointers attribs;
struct gl_vertex_program *vp;
- struct gl_fragment_program *fp;
+ struct gl_fragment_program *fp, *fp_tex;
struct gl_buffer_object *vbo;
@@ -493,6 +493,8 @@ struct brw_context
struct intel_region *saved_depth_region;
GLuint restore_draw_mask;
+ struct gl_fragment_program *restore_fp;
+
GLboolean active;
} metaops;
@@ -672,6 +674,8 @@ void brw_destroy_state( struct brw_context *brw );
*/
void brwUpdateTextureState( struct intel_context *intel );
void brwInitTextureFuncs( struct dd_function_table *functions );
+void brw_FrameBufferTexInit( struct brw_context *brw );
+void brw_FrameBufferTexDestroy( struct brw_context *brw );
/*======================================================================
* brw_metaops.c
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index f12fb4c7f3e..471fda9f7ef 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -123,6 +123,23 @@ static GLuint trim(GLenum prim, GLuint length)
}
+static void brw_emit_cliprect( struct brw_context *brw,
+ const drm_clip_rect_t *rect )
+{
+ struct brw_drawrect bdr;
+
+ bdr.header.opcode = CMD_DRAW_RECT;
+ bdr.header.length = sizeof(bdr)/4 - 2;
+ bdr.xmin = rect->x1;
+ bdr.xmax = rect->x2 - 1;
+ bdr.ymin = rect->y1;
+ bdr.ymax = rect->y2 - 1;
+ bdr.xorg = brw->intel.drawX;
+ bdr.yorg = brw->intel.drawY;
+
+ intel_batchbuffer_data( brw->intel.batch, &bdr, sizeof(bdr),
+ INTEL_BATCH_NO_CLIPRECTS);
+}
static void brw_emit_prim( struct brw_context *brw,
@@ -149,7 +166,7 @@ static void brw_emit_prim( struct brw_context *brw,
if (prim_packet.verts_per_instance) {
intel_batchbuffer_data( brw->intel.batch, &prim_packet, sizeof(prim_packet),
- INTEL_BATCH_CLIPRECTS);
+ INTEL_BATCH_NO_CLIPRECTS);
}
}
@@ -192,7 +209,7 @@ static void brw_merge_inputs( struct brw_context *brw,
if (arrays[i] && arrays[i]->Enabled)
{
brw->vb.inputs[i].glarray = arrays[i];
- brw->vb.info.varying |= 1 << i;
+ brw->vb.info.varying |= (GLuint64EXT) 1 << i;
}
else
{
@@ -277,7 +294,7 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
struct intel_context *intel = intel_context(ctx);
struct brw_context *brw = brw_context(ctx);
GLboolean retval = GL_FALSE;
- GLuint i;
+ GLuint i, j;
if (ctx->NewState)
_mesa_update_state( ctx );
@@ -294,8 +311,17 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
*/
LOCK_HARDWARE(intel);
+
+ if (brw->intel.numClipRects == 0) {
+ assert(intel->batch->ptr == intel->batch->map + intel->batch->offset);
+ UNLOCK_HARDWARE(intel);
+ return GL_TRUE;
+ }
+
{
assert(intel->locked);
+
+
/* Set the first primitive early, ahead of validate_state:
*/
@@ -322,12 +348,28 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
goto out;
}
- /* Emit prims to batchbuffer:
+ /* For single cliprect, state is already emitted:
*/
- for (i = 0; i < nr_prims; i++) {
- brw_emit_prim(brw, &prim[i]);
+ if (brw->intel.numClipRects == 1) {
+ for (i = 0; i < nr_prims; i++) {
+ brw_emit_prim(brw, &prim[i]);
+ }
+ }
+ else {
+ /* Otherwise, explicitly do the cliprects at this point:
+ */
+ for (j = 0; j < brw->intel.numClipRects; j++) {
+ brw_emit_cliprect(brw, &brw->intel.pClipRects[j]);
+
+ /* Emit prims to batchbuffer:
+ */
+ for (i = 0; i < nr_prims; i++) {
+ brw_emit_prim(brw, &prim[i]);
+ }
+ }
}
+ intel->need_flush = GL_TRUE;
retval = GL_TRUE;
}
@@ -400,7 +442,7 @@ GLboolean brw_draw_prims( GLcontext *ctx,
retval = brw_try_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index, flags);
}
- if (intel->aub_file) {
+ if (intel->aub_file && (INTEL_DEBUG & DEBUG_SYNC)) {
intelFinish( &intel->ctx );
intel->aub_wrap = 1;
}
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 8c6b5a6d2c4..57ee294f0cf 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -393,7 +393,7 @@ GLboolean brw_upload_vertices( struct brw_context *brw,
{
GLcontext *ctx = &brw->intel.ctx;
struct intel_context *intel = intel_context(ctx);
- GLuint tmp = brw->vs.prog_data->inputs_read;
+ GLuint64EXT tmp = brw->vs.prog_data->inputs_read;
struct brw_vertex_element_packet vep;
struct brw_array_state vbp;
GLuint i;
@@ -414,10 +414,10 @@ GLboolean brw_upload_vertices( struct brw_context *brw,
*/
while (tmp) {
- GLuint i = ffs(tmp)-1;
+ GLuint i = ffsll(tmp)-1;
struct brw_vertex_element *input = &brw->vb.inputs[i];
- tmp &= ~(1<<i);
+ tmp &= ~((GLuint64EXT)1<<i);
enabled[nr_enabled++] = input;
input->index = i;
@@ -435,6 +435,7 @@ GLboolean brw_upload_vertices( struct brw_context *brw,
ptr = input->glarray->Ptr;
}
else if (interleave != input->glarray->StrideB ||
+ (const char *)input->glarray->Ptr - (const char *)ptr < 0 ||
(const char *)input->glarray->Ptr - (const char *)ptr > interleave) {
interleave = 0;
}
diff --git a/src/mesa/drivers/dri/i965/brw_exec_api.c b/src/mesa/drivers/dri/i965/brw_exec_api.c
index ca012dbcd8a..470fa6f4177 100644
--- a/src/mesa/drivers/dri/i965/brw_exec_api.c
+++ b/src/mesa/drivers/dri/i965/brw_exec_api.c
@@ -394,7 +394,7 @@ static void GLAPIENTRY brw_exec_EvalCoord1f( GLfloat u )
for (i = 0 ; i <= BRW_ATTRIB_INDEX ; i++) {
if (exec->eval.map1[i].map)
- if (exec->vtx.attrsz[i] != exec->eval.map1[i].sz)
+ if (exec->vtx.active_sz[i] != exec->eval.map1[i].sz)
brw_exec_fixup_vertex( ctx, i, exec->eval.map1[i].sz );
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c
index 4d84ba88137..56e21e339ef 100644
--- a/src/mesa/drivers/dri/i965/brw_fallback.c
+++ b/src/mesa/drivers/dri/i965/brw_fallback.c
@@ -280,6 +280,9 @@ void brw_loopback_vertex_list( GLcontext *ctx,
GLuint i, nr = 0;
for (i = 0 ; i <= BRW_ATTRIB_TEX7 ; i++) {
+ if (i == BRW_ATTRIB_INDEX || i == BRW_ATTRIB_EDGEFLAG)
+ continue;
+
if (attrsz[i]) {
la[nr].target = i;
la[nr].sz = attrsz[i];
diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c
index 18ca7b13412..2deec5eae3d 100644
--- a/src/mesa/drivers/dri/i965/brw_metaops.c
+++ b/src/mesa/drivers/dri/i965/brw_metaops.c
@@ -27,6 +27,7 @@
/*
* Authors:
* Keith Whitwell <keith@tungstengraphics.com>
+ * frame buffer texture by Gary Wong <gtw@gnu.org>
*/
@@ -144,6 +145,15 @@ static const char *fp_prog =
"MOV result.color, fragment.color;\n"
"END\n";
+static const char *fp_tex_prog =
+ "!!ARBfp1.0\n"
+ "TEMP a;\n"
+ "ADD a, fragment.position, program.local[0];\n"
+ "MUL a, a, program.local[1];\n"
+ "TEX result.color, a, texture[0], 2D;\n"
+ "MOV result.depth.z, fragment.position;\n"
+ "END\n";
+
/* Derived values of importance:
*
* FragmentProgram->_Current
@@ -170,6 +180,9 @@ static void init_metaops_state( struct brw_context *brw )
brw->metaops.fp = (struct gl_fragment_program *)
ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 );
+ brw->metaops.fp_tex = (struct gl_fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 );
+
brw->metaops.vp = (struct gl_vertex_program *)
ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 1 );
@@ -177,6 +190,10 @@ static void init_metaops_state( struct brw_context *brw )
fp_prog, strlen(fp_prog),
brw->metaops.fp);
+ _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB,
+ fp_tex_prog, strlen(fp_tex_prog),
+ brw->metaops.fp_tex);
+
_mesa_parse_arb_vertex_program(ctx, GL_VERTEX_PROGRAM_ARB,
vp_prog, strlen(vp_prog),
brw->metaops.vp);
@@ -267,7 +284,76 @@ static void meta_color_mask( struct intel_context *intel, GLboolean state )
static void meta_no_texture( struct intel_context *intel )
{
- /* Nothing to do */
+ struct brw_context *brw = brw_context(&intel->ctx);
+
+ brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp;
+
+ brw->metaops.attribs.Texture->CurrentUnit = 0;
+ brw->metaops.attribs.Texture->_EnabledUnits = 0;
+ brw->metaops.attribs.Texture->_EnabledCoordUnits = 0;
+ brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = 0;
+ brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = 0;
+
+ brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM;
+}
+
+static void meta_texture_blend_replace(struct intel_context *intel)
+{
+ struct brw_context *brw = brw_context(&intel->ctx);
+
+ brw->metaops.attribs.Texture->CurrentUnit = 0;
+ brw->metaops.attribs.Texture->_EnabledUnits = 1;
+ brw->metaops.attribs.Texture->_EnabledCoordUnits = 1;
+ brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = TEXTURE_2D_BIT;
+ brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = TEXTURE_2D_BIT;
+ brw->metaops.attribs.Texture->Unit[ 0 ].Current2D =
+ intel->frame_buffer_texobj;
+ brw->metaops.attribs.Texture->Unit[ 0 ]._Current =
+ intel->frame_buffer_texobj;
+
+ brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM;
+}
+
+static void meta_import_pixel_state(struct intel_context *intel)
+{
+ struct brw_context *brw = brw_context(&intel->ctx);
+
+ RESTORE(brw, Color, _NEW_COLOR);
+ RESTORE(brw, Depth, _NEW_DEPTH);
+ RESTORE(brw, Fog, _NEW_FOG);
+ RESTORE(brw, Scissor, _NEW_SCISSOR);
+ RESTORE(brw, Stencil, _NEW_STENCIL);
+ RESTORE(brw, Texture, _NEW_TEXTURE);
+ RESTORE(brw, FragmentProgram, _NEW_PROGRAM);
+}
+
+static void meta_frame_buffer_texture( struct intel_context *intel,
+ GLint xoff, GLint yoff )
+{
+ struct brw_context *brw = brw_context(&intel->ctx);
+ struct intel_region *region = intel_drawbuf_region( intel );
+
+ INSTALL(brw, FragmentProgram, _NEW_PROGRAM);
+
+ brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp_tex;
+ /* This is unfortunate, but seems to be necessary, since later on we
+ will end up calling _mesa_load_state_parameters to lookup the
+ local params (below), and that will want to look in ctx.FragmentProgram
+ instead of brw->attribs.FragmentProgram. */
+ intel->ctx.FragmentProgram.Current = brw->metaops.fp_tex;
+
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 0 ] = xoff;
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 1 ] = yoff;
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 2 ] = 0.0;
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 3 ] = 0.0;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 0 ] =
+ 1.0 / region->pitch;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 1 ] =
+ -1.0 / region->height;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 2 ] = 0.0;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 3 ] = 1.0;
+
+ brw->state.dirty.mesa |= _NEW_PROGRAM;
}
@@ -406,7 +492,8 @@ static void meta_draw_quad(struct intel_context *intel,
}
-static void install_meta_state( struct intel_context *intel )
+static void install_meta_state( struct intel_context *intel,
+ GLenum state )
{
GLcontext *ctx = &intel->ctx;
struct brw_context *brw = brw_context(ctx);
@@ -416,9 +503,11 @@ static void install_meta_state( struct intel_context *intel )
}
install_attribs(brw);
+
meta_no_texture(&brw->intel);
meta_flat_shade(&brw->intel);
brw->metaops.restore_draw_mask = ctx->DrawBuffer->_ColorDrawBufferMask[0];
+ brw->metaops.restore_fp = ctx->FragmentProgram.Current;
/* This works without adjusting refcounts. Fix later?
*/
@@ -437,6 +526,7 @@ static void leave_meta_state( struct intel_context *intel )
restore_attribs(brw);
ctx->DrawBuffer->_ColorDrawBufferMask[0] = brw->metaops.restore_draw_mask;
+ ctx->FragmentProgram.Current = brw->metaops.restore_fp;
brw->state.draw_region = brw->metaops.saved_draw_region;
brw->state.depth_region = brw->metaops.saved_depth_region;
@@ -463,10 +553,11 @@ void brw_init_metaops( struct brw_context *brw )
brw->intel.vtbl.meta_depth_replace = meta_depth_replace;
brw->intel.vtbl.meta_color_mask = meta_color_mask;
brw->intel.vtbl.meta_no_texture = meta_no_texture;
+ brw->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state;
+ brw->intel.vtbl.meta_frame_buffer_texture = meta_frame_buffer_texture;
brw->intel.vtbl.meta_draw_region = meta_draw_region;
brw->intel.vtbl.meta_draw_quad = meta_draw_quad;
-
-/* brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; */
+ brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace;
/* brw->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; */
/* brw->intel.vtbl.meta_draw_format = set_draw_format; */
}
@@ -479,5 +570,6 @@ void brw_destroy_metaops( struct brw_context *brw )
ctx->Driver.DeleteBuffer( ctx, brw->metaops.vbo );
/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp ); */
+/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp_tex ); */
/* ctx->Driver.DeleteProgram( ctx, brw->metaops.vp ); */
}
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 29296c17e9e..6a6c4503c74 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -74,7 +74,6 @@ const struct brw_tracked_state brw_blend_constant_color = {
/***********************************************************************
* Drawing rectangle -- Need for AUB file only.
*/
-
static void upload_drawing_rect(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
@@ -83,13 +82,12 @@ static void upload_drawing_rect(struct brw_context *brw)
int x1, y1;
int x2, y2;
- if (!brw->intel.aub_file)
+ /* If there is a single cliprect, set it here. Otherwise iterate
+ * over them in brw_draw_prim().
+ */
+ if (brw->intel.numClipRects > 1)
return;
- /* Basically calculate a single cliprect for the whole window.
- * Don't bother iterating over cliprects at the moment.
- */
-
x1 = dPriv->x;
y1 = dPriv->y;
x2 = dPriv->x + dPriv->w;
@@ -110,7 +108,10 @@ static void upload_drawing_rect(struct brw_context *brw)
bdr.xorg = dPriv->x;
bdr.yorg = dPriv->y;
- BRW_CACHED_BATCH_STRUCT(brw, &bdr);
+ /* Can't use BRW_CACHED_BATCH_STRUCT because this is also emitted
+ * uncached in brw_draw.c:
+ */
+ BRW_BATCH_STRUCT(brw, &bdr);
}
const struct brw_tracked_state brw_drawing_rect = {
diff --git a/src/mesa/drivers/dri/i965/brw_save_api.c b/src/mesa/drivers/dri/i965/brw_save_api.c
index 9c0e4af48a5..06ed1d23aa2 100644
--- a/src/mesa/drivers/dri/i965/brw_save_api.c
+++ b/src/mesa/drivers/dri/i965/brw_save_api.c
@@ -417,7 +417,7 @@ static void _save_copy_to_current( GLcontext *ctx )
struct brw_save_context *save = IMM_CONTEXT(ctx)->save;
GLuint i;
- for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++) {
+ for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++) {
if (save->attrsz[i]) {
save->currentsz[i][0] = save->attrsz[i];
COPY_CLEAN_4V(save->current[i],
@@ -445,7 +445,7 @@ static void _save_copy_from_current( GLcontext *ctx )
struct brw_save_context *save = IMM_CONTEXT(ctx)->save;
GLint i;
- for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++)
+ for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++)
switch (save->attrsz[i]) {
case 4: save->attrptr[i][3] = save->current[i][3];
case 3: save->attrptr[i][2] = save->current[i][2];
@@ -529,7 +529,7 @@ static void _save_upgrade_vertex( GLcontext *ctx,
/* Need to note this and fix up at runtime (or loopback):
*/
- if (save->currentsz[attr][0] == 0) {
+ if (attr != BRW_ATTRIB_POS && save->currentsz[attr][0] == 0) {
assert(oldsz == 0);
save->dangling_attr_ref = GL_TRUE;
}
@@ -855,10 +855,14 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co
if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
return;
+ _ae_map_vbos( ctx );
+
brw_save_NotifyBegin( ctx, mode | BRW_SAVE_PRIM_WEAK );
for (i = 0; i < count; i++)
CALL_ArrayElement(GET_DISPATCH(), (start + i));
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
/* Could do better by copying the arrays and element list intact and
@@ -873,6 +877,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
return;
+ _ae_map_vbos( ctx );
+
brw_save_NotifyBegin( ctx, mode | BRW_SAVE_PRIM_WEAK );
switch (type) {
@@ -894,6 +900,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
}
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
@@ -1113,7 +1121,7 @@ static void _save_current_init( GLcontext *ctx )
save->current[i] = ctx->ListState.CurrentAttrib[i];
}
- for (i = BRW_ATTRIB_FIRST_MATERIAL; i < BRW_ATTRIB_INDEX; i++) {
+ for (i = BRW_ATTRIB_FIRST_MATERIAL; i <= BRW_ATTRIB_LAST_MATERIAL; i++) {
const GLuint j = i - BRW_ATTRIB_FIRST_MATERIAL;
ASSERT(j < MAT_ATTRIB_MAX);
save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
diff --git a/src/mesa/drivers/dri/i965/brw_save_draw.c b/src/mesa/drivers/dri/i965/brw_save_draw.c
index 84f74d3f6cf..cebdd8d0607 100644
--- a/src/mesa/drivers/dri/i965/brw_save_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_save_draw.c
@@ -38,7 +38,10 @@
#include "brw_draw.h"
#include "brw_fallback.h"
-
+/*
+ * After playback, copy everything but the position from the
+ * last vertex to the saved state
+ */
static void _playback_copy_to_current( GLcontext *ctx,
const struct brw_save_vertex_list *node )
{
@@ -47,21 +50,30 @@ static void _playback_copy_to_current( GLcontext *ctx,
GLuint i, offset;
if (node->count)
- offset = node->buffer_offset + (node->count-1) * node->vertex_size;
+ offset = (node->buffer_offset +
+ (node->count-1) * node->vertex_size * sizeof(GLfloat));
else
offset = node->buffer_offset;
- ctx->Driver.GetBufferSubData( ctx, 0, offset, node->vertex_size,
+ ctx->Driver.GetBufferSubData( ctx, 0, offset,
+ node->vertex_size * sizeof(GLfloat),
data, node->vertex_store->bufferobj );
- for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++) {
+ for (i = 0 ; i < BRW_ATTRIB_MAX ; i++) {
if (node->attrsz[i]) {
- COPY_CLEAN_4V(save->current[i], node->attrsz[i], data);
- data += node->attrsz[i];
+ if (i != BRW_ATTRIB_POS)
+ COPY_CLEAN_4V(save->current[i], node->attrsz[i], data);
if (i >= BRW_ATTRIB_MAT_FRONT_AMBIENT &&
i <= BRW_ATTRIB_MAT_BACK_INDEXES)
ctx->NewState |= _NEW_LIGHT;
+
+ /* Edgeflag requires special treatment:
+ */
+ if (i == BRW_ATTRIB_EDGEFLAG)
+ ctx->Current.EdgeFlag = (data[0] == 1.0);
+
+ data += node->attrsz[i] * sizeof(GLfloat);
}
}
@@ -105,7 +117,7 @@ static void brw_bind_vertex_list( struct brw_save_context *save,
memset(arrays, 0, BRW_ATTRIB_MAX * sizeof(arrays[0]));
- for (attr = 0; attr <= BRW_ATTRIB_INDEX; attr++) {
+ for (attr = 0; attr < BRW_ATTRIB_MAX; attr++) {
if (node->attrsz[attr]) {
arrays[attr].Ptr = (const GLubyte *)data;
arrays[attr].Size = node->attrsz[attr];
diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c
index d70b2ea87a5..c3ffa9e6577 100644
--- a/src/mesa/drivers/dri/i965/brw_tex.c
+++ b/src/mesa/drivers/dri/i965/brw_tex.c
@@ -36,11 +36,14 @@
#include "simple_list.h"
#include "enums.h"
#include "image.h"
+#include "teximage.h"
#include "texstore.h"
#include "texformat.h"
#include "texmem.h"
+#include "intel_context.h"
#include "intel_ioctl.h"
+#include "intel_regions.h"
#include "brw_context.h"
#include "brw_defines.h"
@@ -49,34 +52,57 @@
static const struct gl_texture_format *
brwChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
+ GLenum srcFormat, GLenum srcType )
{
switch ( internalFormat ) {
case 4:
case GL_RGBA:
case GL_COMPRESSED_RGBA:
+ if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV)
+ return &_mesa_texformat_argb4444;
+ else if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV)
+ return &_mesa_texformat_argb1555;
+ else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8))
+ return &_mesa_texformat_rgba8888_rev;
+ else
+ return &_mesa_texformat_argb8888;
+
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
- case GL_RGBA4:
- case GL_RGBA2:
- case GL_RGB5_A1:
return &_mesa_texformat_argb8888;
-/* return &_mesa_texformat_rgba8888_rev; */
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
case GL_RGB8:
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
+ /* Broadwater doesn't support RGB888 textures, so these must be
+ * stored as ARGB.
+ */
+ return &_mesa_texformat_argb8888;
+
+ case 3:
+ case GL_COMPRESSED_RGB:
+ case GL_RGB:
+ if (srcFormat == GL_RGB &&
+ srcType == GL_UNSIGNED_SHORT_5_6_5)
+ return &_mesa_texformat_rgb565;
+ else
+ return &_mesa_texformat_argb8888;
+
+
case GL_RGB5:
- case GL_RGB4:
+ case GL_RGB5_A1:
+ return &_mesa_texformat_argb1555;
+
case GL_R3_G3_B2:
-/* return &_mesa_texformat_rgb888; */
- return &_mesa_texformat_argb8888;
+ case GL_RGBA2:
+ case GL_RGBA4:
+ case GL_RGB4:
+ return &_mesa_texformat_argb4444;
case GL_ALPHA:
case GL_ALPHA4:
@@ -115,8 +141,8 @@ brwChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
return &_mesa_texformat_i8;
case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
- type == GL_UNSIGNED_BYTE)
+ if (srcType == GL_UNSIGNED_SHORT_8_8_MESA ||
+ srcType == GL_UNSIGNED_BYTE)
return &_mesa_texformat_ycbcr;
else
return &_mesa_texformat_ycbcr_rev;
@@ -156,3 +182,32 @@ void brwInitTextureFuncs( struct dd_function_table *functions )
{
functions->ChooseTextureFormat = brwChooseTextureFormat;
}
+
+void brw_FrameBufferTexInit( struct brw_context *brw )
+{
+ struct intel_context *intel = &brw->intel;
+ GLcontext *ctx = &intel->ctx;
+ struct intel_region *region = intel->front_region;
+ struct gl_texture_object *obj;
+ struct gl_texture_image *img;
+
+ intel->frame_buffer_texobj = obj =
+ ctx->Driver.NewTextureObject( ctx, (GLuint) -1, GL_TEXTURE_2D );
+
+ obj->MinFilter = GL_NEAREST;
+ obj->MagFilter = GL_NEAREST;
+
+ img = ctx->Driver.NewTextureImage( ctx );
+
+ _mesa_init_teximage_fields( ctx, GL_TEXTURE_2D, img,
+ region->pitch, region->height, 1, 0,
+ region->cpp == 4 ? GL_RGBA : GL_RGB );
+
+ _mesa_set_tex_image( obj, GL_TEXTURE_2D, 0, img );
+}
+
+void brw_FrameBufferTexDestroy( struct brw_context *brw )
+{
+ brw->intel.ctx.Driver.DeleteTexture( &brw->intel.ctx,
+ brw->intel.frame_buffer_texobj );
+}
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index f8aa068241b..1353325afff 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -138,13 +138,16 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
/* Layout_below: step right after second mipmap.
*/
- if (level == mt->first_level + 1)
+ if (level == mt->first_level + 1) {
x += mt->pitch / 2;
+ x = (x + 3) & ~ 3;
+ }
else {
y += img_height;
+ y += align_h - 1;
+ y &= ~(align_h - 1);
}
-
width = minify(width);
height = minify(height);
}
diff --git a/src/mesa/drivers/dri/i965/brw_util.c b/src/mesa/drivers/dri/i965/brw_util.c
index 5957b717218..9d12c26486d 100644
--- a/src/mesa/drivers/dri/i965/brw_util.c
+++ b/src/mesa/drivers/dri/i965/brw_util.c
@@ -98,6 +98,8 @@ static GLuint brw_parameter_state_flags(const enum state_index state[])
switch (state[1]) {
case STATE_NORMAL_SCALE:
return _NEW_MODELVIEW;
+ case STATE_TEXRECT_SCALE:
+ return _NEW_TEXTURE;
default:
assert(0);
return 0;
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 2a94ac64965..e5a28b96e32 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -105,6 +105,11 @@ static void brw_upload_vs_prog( struct brw_context *brw )
key.copy_edgeflag = (brw->attribs.Polygon->FrontMode != GL_FILL ||
brw->attribs.Polygon->BackMode != GL_FILL);
+ /* BRW_NEW_METAOPS
+ */
+ if (brw->metaops.active)
+ key.know_w_is_one = 1;
+
/* Make an early check for the key.
*/
if (brw_search_cache(&brw->cache[BRW_VS_PROG],
@@ -122,7 +127,7 @@ static void brw_upload_vs_prog( struct brw_context *brw )
const struct brw_tracked_state brw_vs_prog = {
.dirty = {
.mesa = _NEW_TRANSFORM | _NEW_POLYGON,
- .brw = BRW_NEW_VERTEX_PROGRAM,
+ .brw = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_METAOPS,
.cache = 0
},
.update = brw_upload_vs_prog
diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h
index d355681b5ea..fdb5785d67d 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.h
+++ b/src/mesa/drivers/dri/i965/brw_vs.h
@@ -43,7 +43,8 @@ struct brw_vs_prog_key {
GLuint program_string_id;
GLuint nr_userclip:4;
GLuint copy_edgeflag:1;
- GLuint pad:27;
+ GLuint know_w_is_one:1;
+ GLuint pad:26;
};
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index a22740084d3..8403e1bd7b6 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -78,7 +78,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
*/
c->nr_inputs = 0;
for (i = 0; i < BRW_ATTRIB_MAX; i++) {
- if (c->prog_data.inputs_read & (1<<i)) {
+ if (c->prog_data.inputs_read & ((GLuint64EXT)1<<i)) {
c->nr_inputs++;
c->regs[PROGRAM_INPUT][i] = brw_vec8_grf(reg, 0);
reg++;
@@ -797,13 +797,21 @@ static void emit_vertex_write( struct brw_vs_compile *c)
/* Build ndc coords? TODO: Shortcircuit when w is known to be one.
*/
- ndc = get_tmp(c);
- emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL);
- brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc);
+ if (!c->key.know_w_is_one) {
+ ndc = get_tmp(c);
+ emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL);
+ brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc);
+ }
+ else {
+ ndc = pos;
+ }
/* This includes the workaround for -ve rhw, so is no longer an
* optional step:
*/
+ if ((c->prog_data.outputs_written & (1<<VERT_RESULT_PSIZ)) ||
+ c->key.nr_userclip ||
+ !c->key.know_w_is_one)
{
struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD);
GLuint i;
@@ -836,20 +844,17 @@ static void emit_vertex_write( struct brw_vs_compile *c)
* Later, clipping will detect ucp[6] and ensure the primitive is
* clipped against all fixed planes.
*/
- brw_CMP(p,
- vec8(brw_null_reg()),
- BRW_CONDITIONAL_L,
- brw_swizzle1(ndc, 3),
- brw_imm_f(0));
+ if (!c->key.know_w_is_one) {
+ brw_CMP(p,
+ vec8(brw_null_reg()),
+ BRW_CONDITIONAL_L,
+ brw_swizzle1(ndc, 3),
+ brw_imm_f(0));
- brw_OR(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(1<<6));
- brw_MOV(p, ndc, brw_imm_f(0));
- brw_set_predicate_control(p, BRW_PREDICATE_NONE);
-
-
-
-
-
+ brw_OR(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(1<<6));
+ brw_MOV(p, ndc, brw_imm_f(0));
+ brw_set_predicate_control(p, BRW_PREDICATE_NONE);
+ }
brw_set_access_mode(p, BRW_ALIGN_1); /* why? */
brw_MOV(p, retype(brw_message_reg(1), BRW_REGISTER_TYPE_UD), header1);
@@ -857,6 +862,9 @@ static void emit_vertex_write( struct brw_vs_compile *c)
release_tmp(c, header1);
}
+ else {
+ brw_MOV(p, retype(brw_message_reg(1), BRW_REGISTER_TYPE_UD), brw_imm_ud(0));
+ }
/* Emit the (interleaved) headers for the two vertices - an 8-reg
diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
index c1099d4c676..b7893ca3e55 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
@@ -146,8 +146,8 @@ static void make_state_key( GLcontext *ctx, struct state_key *key )
}
/* BRW_NEW_INPUT_VARYING */
- for (i = BRW_ATTRIB_MAT_FRONT_AMBIENT ; i < BRW_ATTRIB_INDEX ; i++)
- if (brw->vb.info.varying & (1<<i))
+ for (i = BRW_ATTRIB_MAT_FRONT_AMBIENT ; i < BRW_ATTRIB_MAX ; i++)
+ if (brw->vb.info.varying & ((GLuint64EXT)1<<i))
key->light_material_mask |= 1<<(i-BRW_ATTRIB_MAT_FRONT_AMBIENT);
for (i = 0; i < MAX_LIGHTS; i++) {
@@ -374,16 +374,17 @@ static void release_temps( struct tnl_program *p )
static struct ureg register_input( struct tnl_program *p, GLuint input )
{
+ GLuint orig_input = input;
/* Cram the material flags into the generic range. We'll translate
* them back later.
*/
if (input >= BRW_ATTRIB_MAT_FRONT_AMBIENT)
- input -= BRW_ATTRIB_MAT_FRONT_AMBIENT;
+ input -= BRW_ATTRIB_MAT_FRONT_AMBIENT - BRW_ATTRIB_GENERIC0;
assert(input < 32);
p->program->Base.InputsRead |= (1<<input);
- return make_ureg(PROGRAM_INPUT, input);
+ return make_ureg(PROGRAM_INPUT, orig_input);
}
static struct ureg register_output( struct tnl_program *p, GLuint output )
@@ -404,7 +405,7 @@ static struct ureg register_const4f( struct tnl_program *p,
values[1] = s1;
values[2] = s2;
values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values );
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
return make_ureg(PROGRAM_STATE_VAR, idx);
}
@@ -535,6 +536,7 @@ static void emit_op3fn(struct tnl_program *p,
{
struct prog_instruction *inst = &p->program->Base.Instructions[nr];
+ memset(inst, 0, sizeof(*inst));
inst->Opcode = op;
inst->StringPos = 0;
inst->Data = 0;
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index 4896882034b..ac09754e3ae 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -72,6 +72,7 @@ static void brw_destroy_context( struct intel_context *intel )
brw_save_destroy( ctx );
brw_ProgramCacheDestroy( ctx );
+ brw_FrameBufferTexDestroy( brw );
}
/* called from intelDrawBuffer()
diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h
index 74c3bbe2047..ec6ad6105ca 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.h
+++ b/src/mesa/drivers/dri/i965/brw_wm.h
@@ -167,6 +167,7 @@ struct brw_wm_instruction {
#define WM_CINTERP (MAX_OPCODE + 5)
#define WM_WPOSXY (MAX_OPCODE + 6)
#define WM_FB_WRITE (MAX_OPCODE + 7)
+#define MAX_WM_OPCODE (MAX_OPCODE + 8)
#define PROGRAM_PAYLOAD (PROGRAM_FILE_MAX)
#define PAYLOAD_DEPTH (FRAG_ATTRIB_MAX)
diff --git a/src/mesa/drivers/dri/i965/brw_wm_debug.c b/src/mesa/drivers/dri/i965/brw_wm_debug.c
index 6b0096eca58..9a6154b3336 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_debug.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_debug.c
@@ -36,66 +36,6 @@
#include "shader/arbprogparse.h"
#include "shader/program_instruction.h"
-static const char *fp_opcode_string[] = {
- "ABS", /* ARB_f_p only */
- "ADD",
- "CMP", /* ARB_f_p only */
- "COS",
- "DDX", /* NV_f_p only */
- "DDY", /* NV_f_p only */
- "DP3",
- "DP4",
- "DPH", /* ARB_f_p only */
- "DST",
- "END", /* private opcode */
- "EX2",
- "FLR",
- "FRC",
- "KIL", /* ARB_f_p only */
- "KIL_NV", /* NV_f_p only */
- "LG2",
- "LIT",
- "LRP",
- "MAD",
- "MAX",
- "MIN",
- "MOV",
- "MUL",
- "PK2H", /* NV_f_p only */
- "PK2US", /* NV_f_p only */
- "PK4B", /* NV_f_p only */
- "PK4UB", /* NV_f_p only */
- "POW",
- "PRINT", /* Mesa only */
- "RCP",
- "RFL", /* NV_f_p only */
- "RSQ",
- "SCS", /* ARB_f_p only */
- "SEQ", /* NV_f_p only */
- "SFL", /* NV_f_p only */
- "SGE", /* NV_f_p only */
- "SGT", /* NV_f_p only */
- "SIN",
- "SLE", /* NV_f_p only */
- "SLT",
- "SNE", /* NV_f_p only */
- "STR", /* NV_f_p only */
- "SUB",
- "SWZ", /* ARB_f_p only */
- "TEX",
- "TXB", /* ARB_f_p only */
- "TXD", /* NV_f_p only */
- "TXP", /* ARB_f_p only */
- "TXP_NV", /* NV_f_p only */
- "UP2H", /* NV_f_p only */
- "UP2US", /* NV_f_p only */
- "UP4B", /* NV_f_p only */
- "UP4UB", /* NV_f_p only */
- "X2D", /* NV_f_p only - 2d mat mul */
- "XPD", /* ARB_f_p only - cross product */
-};
-
-
void brw_wm_print_value( struct brw_wm_compile *c,
struct brw_wm_value *value )
@@ -194,7 +134,7 @@ void brw_wm_print_insn( struct brw_wm_compile *c,
_mesa_printf(" = FB_WRITE");
break;
default:
- _mesa_printf(" = %s", fp_opcode_string[inst->opcode]);
+ _mesa_printf(" = %s", _mesa_opcode_string(inst->opcode));
break;
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c
index 203eeead0f3..bb0aa356150 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_fp.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c
@@ -60,9 +60,11 @@ static const char *wm_opcode_strings[] = {
"FB_WRITE"
};
+#if 0
static const char *wm_file_strings[] = {
"PAYLOAD"
};
+#endif
/***********************************************************************
@@ -430,7 +432,7 @@ static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c,
return src_reg(PROGRAM_STATE_VAR, idx);
}
- idx = _mesa_add_unnamed_constant( paramList, values );
+ idx = _mesa_add_unnamed_constant( paramList, values, 4 );
return src_reg(PROGRAM_STATE_VAR, idx);
}
@@ -520,6 +522,35 @@ static void precalc_lit( struct brw_wm_compile *c,
static void precalc_tex( struct brw_wm_compile *c,
const struct prog_instruction *inst )
{
+ struct prog_src_register coord;
+ struct prog_dst_register tmpcoord;
+
+ if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
+ struct prog_src_register scale =
+ search_or_add_param6( c,
+ STATE_INTERNAL,
+ STATE_TEXRECT_SCALE,
+ inst->TexSrcUnit,
+ 0,0,0 );
+
+ tmpcoord = get_temp(c);
+
+ /* coord.xy = MUL inst->SrcReg[0], { 1/width, 1/height }
+ */
+ emit_op(c,
+ OPCODE_MUL,
+ tmpcoord,
+ 0, 0, 0,
+ inst->SrcReg[0],
+ scale,
+ src_undef());
+
+ coord = src_reg_from_dst(tmpcoord);
+ }
+ else {
+ coord = inst->SrcReg[0];
+ }
+
/* Need to emit YUV texture conversions by hand. Probably need to
* do this here - the alternative is in brw_wm_emit.c, but the
* conversion requires allocating a temporary variable which we
@@ -532,7 +563,7 @@ static void precalc_tex( struct brw_wm_compile *c,
inst->SaturateMode,
inst->TexSrcUnit,
inst->TexSrcTarget,
- inst->SrcReg[0],
+ coord,
src_undef(),
src_undef());
}
@@ -604,7 +635,12 @@ static void precalc_tex( struct brw_wm_compile *c,
src_swizzle1(tmpsrc, Z),
src_swizzle1(C1, W),
src_swizzle1(src_reg_from_dst(dst), Y));
+
+ release_temp(c, tmp);
}
+
+ if (inst->TexSrcTarget == GL_TEXTURE_RECTANGLE_NV)
+ release_temp(c, tmpcoord);
}
@@ -769,6 +805,27 @@ static void validate_src_regs( struct brw_wm_compile *c,
+static void print_insns( const struct prog_instruction *insn,
+ GLuint nr )
+{
+ GLuint i;
+ for (i = 0; i < nr; i++, insn++) {
+ _mesa_printf("%3d: ", i);
+ if (insn->Opcode < MAX_OPCODE)
+ _mesa_print_instruction(insn);
+ else if (insn->Opcode < MAX_WM_OPCODE) {
+ GLuint idx = insn->Opcode - MAX_OPCODE;
+
+ _mesa_print_alu_instruction(insn,
+ wm_opcode_strings[idx],
+ 3);
+ }
+ else
+ _mesa_printf("UNKNOWN\n");
+
+ }
+}
+
void brw_wm_pass_fp( struct brw_wm_compile *c )
{
struct brw_fragment_program *fp = c->fp;
@@ -867,7 +924,7 @@ void brw_wm_pass_fp( struct brw_wm_compile *c )
if (INTEL_DEBUG & DEBUG_WM) {
_mesa_printf("\n\n\npass_fp:\n");
-/* _mesa_debug_fp_inst(c->nr_fp_insns, c->prog_instructions, wm_opcode_strings, wm_file_strings); */
+ print_insns( c->prog_instructions, c->nr_fp_insns );
_mesa_printf("\n");
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 6ccf56e41a2..d24c618a668 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -85,7 +85,8 @@ static GLuint translate_tex_format( GLuint mesa_format )
return BRW_SURFACEFORMAT_L8A8_UNORM;
case MESA_FORMAT_RGB888:
- return BRW_SURFACEFORMAT_R8G8B8_UNORM;
+ assert(0); /* not supported for sampling */
+ return BRW_SURFACEFORMAT_R8G8B8_UNORM;
case MESA_FORMAT_ARGB8888:
return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
@@ -93,6 +94,15 @@ static GLuint translate_tex_format( GLuint mesa_format )
case MESA_FORMAT_RGBA8888_REV:
return BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
+ case MESA_FORMAT_RGB565:
+ return BRW_SURFACEFORMAT_B5G6R5_UNORM;
+
+ case MESA_FORMAT_ARGB1555:
+ return BRW_SURFACEFORMAT_B5G5R5A1_UNORM;
+
+ case MESA_FORMAT_ARGB4444:
+ return BRW_SURFACEFORMAT_B4G4R4A4_UNORM;
+
case MESA_FORMAT_YCBCR_REV:
return BRW_SURFACEFORMAT_YCRCB_NORMAL;
@@ -229,6 +239,12 @@ static void upload_wm_surfaces(struct brw_context *brw )
brw->wm.bind.surf_ss_offset[i+1] = brw_cache_data( &brw->cache[BRW_SS_SURFACE], &surf );
brw->wm.nr_surfaces = i+2;
}
+ else if( texUnit->_ReallyEnabled &&
+ texUnit->_Current == intel->frame_buffer_texobj )
+ {
+ brw->wm.bind.surf_ss_offset[i+1] = brw->wm.bind.surf_ss_offset[0];
+ brw->wm.nr_surfaces = i+2;
+ }
else {
brw->wm.bind.surf_ss_offset[i+1] = 0;
}
diff --git a/src/mesa/drivers/dri/i965/bufmgr.h b/src/mesa/drivers/dri/i965/bufmgr.h
index 83a810cc6dd..6932522d3d3 100644
--- a/src/mesa/drivers/dri/i965/bufmgr.h
+++ b/src/mesa/drivers/dri/i965/bufmgr.h
@@ -182,6 +182,8 @@ void bmUnmapBufferAUB( struct intel_context *,
int bmValidateBuffers( struct intel_context * );
void bmReleaseBuffers( struct intel_context * );
+GLuint bmCtxId( struct intel_context *intel );
+
GLboolean bmError( struct intel_context * );
void bmEvictAll( struct intel_context * );
diff --git a/src/mesa/drivers/dri/i965/bufmgr_fake.c b/src/mesa/drivers/dri/i965/bufmgr_fake.c
index 8f182f3d877..ed88ab3797a 100644
--- a/src/mesa/drivers/dri/i965/bufmgr_fake.c
+++ b/src/mesa/drivers/dri/i965/bufmgr_fake.c
@@ -117,6 +117,7 @@ struct bufmgr {
struct block fenced; /* after bmFenceBuffers (mi_flush, emit irq, write dword) */
/* then to pool->lru or free() */
+ unsigned ctxId;
unsigned last_fence;
unsigned free_on_hardware;
@@ -578,6 +579,12 @@ struct bufmgr *bm_fake_intel_Attach( struct intel_context *intel )
make_empty_list(&bm.referenced);
make_empty_list(&bm.fenced);
make_empty_list(&bm.on_hardware);
+
+ /* The context id of any of the share group. This won't be used
+ * in communication with the kernel, so it doesn't matter if
+ * this context is eventually deleted.
+ */
+ bm.ctxId = intel->hHWContext;
}
nr_attach++;
@@ -1242,7 +1249,6 @@ void bmReleaseBuffers( struct intel_context *intel )
LOCK(bm);
{
struct block *block, *tmp;
- assert(intel->locked);
foreach_s (block, tmp, &bm->referenced) {
@@ -1301,7 +1307,7 @@ unsigned bmSetFence( struct intel_context *intel )
GLuint dword[2];
dword[0] = intel->vtbl.flush_cmd();
dword[1] = 0;
- intel_cmd_ioctl(intel, (char *)&dword, sizeof(dword), GL_TRUE);
+ intel_cmd_ioctl(intel, (char *)&dword, sizeof(dword));
intel->bm->last_fence = intelEmitIrqLocked( intel );
@@ -1432,3 +1438,9 @@ GLboolean bmError( struct intel_context *intel )
return retval;
}
+
+
+GLuint bmCtxId( struct intel_context *intel )
+{
+ return intel->bm->ctxId;
+}
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 598ce08735d..64885ed9b4b 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -128,7 +128,6 @@ GLboolean intel_batchbuffer_flush( struct intel_batchbuffer *batch )
struct intel_context *intel = batch->intel;
GLuint used = batch->ptr - (batch->map + batch->offset);
GLuint offset;
- GLboolean ignore_cliprects = (batch->flags & INTEL_BATCH_CLIPRECTS) ? GL_FALSE : GL_TRUE;
GLint retval = GL_TRUE;
assert(intel->locked);
@@ -138,22 +137,6 @@ GLboolean intel_batchbuffer_flush( struct intel_batchbuffer *batch )
return GL_TRUE;
}
- /* Throw away non-effective packets.
- */
- if (intel->numClipRects == 0 && !ignore_cliprects) {
- batch->ptr = batch->map + batch->offset;
- bmReleaseBuffers( batch->intel );
- intel->vtbl.lost_hardware(intel);
- batch->flags = 0;
-
- UNLOCK_HARDWARE(intel);
- sched_yield();
- LOCK_HARDWARE(intel);
-
- return GL_TRUE;
- }
-
-
/* Add the MI_BATCH_BUFFER_END. Always add an MI_FLUSH - this is a
* performance drain that we would like to avoid.
*/
@@ -204,8 +187,7 @@ GLboolean intel_batchbuffer_flush( struct intel_batchbuffer *batch )
*/
intel_batch_ioctl(batch->intel,
offset + batch->offset,
- used,
- ignore_cliprects);
+ used);
if (intel->aub_file &&
intel->ctx.DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
index 7a9ead3e373..25e0a65e99f 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
@@ -46,7 +46,7 @@ struct intel_batchbuffer {
struct buffer *buffer;
GLuint flags;
- GLuint offset;
+ unsigned long offset;
GLubyte *map;
GLubyte *ptr;
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 2191dd585e1..c8c5bf93c95 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -39,6 +39,7 @@
#include "intel_context.h"
#include "intel_blit.h"
#include "intel_regions.h"
+#include "intel_structs.h"
#include "bufmgr.h"
@@ -74,9 +75,6 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv,
if (!rect)
{
- /* This is a really crappy way to do wait-for-vblank. I guess
- * it sortof works in the single-application case.
- */
UNLOCK_HARDWARE( intel );
driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target );
LOCK_HARDWARE( intel );
@@ -223,6 +221,29 @@ void intelEmitFillBlit( struct intel_context *intel,
ADVANCE_BATCH();
}
+static GLuint translate_raster_op(GLenum logicop)
+{
+ switch(logicop) {
+ case GL_CLEAR: return 0x00;
+ case GL_AND: return 0x88;
+ case GL_AND_REVERSE: return 0x44;
+ case GL_COPY: return 0xCC;
+ case GL_AND_INVERTED: return 0x22;
+ case GL_NOOP: return 0xAA;
+ case GL_XOR: return 0x66;
+ case GL_OR: return 0xEE;
+ case GL_NOR: return 0x11;
+ case GL_EQUIV: return 0x99;
+ case GL_INVERT: return 0x55;
+ case GL_OR_REVERSE: return 0xDD;
+ case GL_COPY_INVERTED: return 0x33;
+ case GL_OR_INVERTED: return 0xBB;
+ case GL_NAND: return 0x77;
+ case GL_SET: return 0xFF;
+ default: return 0;
+ }
+}
+
/* Copy BitBlt
*/
@@ -238,7 +259,8 @@ void intelEmitCopyBlit( struct intel_context *intel,
GLboolean dst_tiled,
GLshort src_x, GLshort src_y,
GLshort dst_x, GLshort dst_y,
- GLshort w, GLshort h )
+ GLshort w, GLshort h,
+ GLenum logic_op )
{
GLuint CMD, BR13;
int dst_y2 = dst_y + h;
@@ -246,12 +268,15 @@ void intelEmitCopyBlit( struct intel_context *intel,
BATCH_LOCALS;
- DBG("%s src:buf(%d)/%d %d,%d dst:buf(%d)/%d %d,%d sz:%dx%d\n",
+ DBG("%s src:buf(%d)/%d %d,%d dst:buf(%d)/%d %d,%d sz:%dx%d op:%d\n",
__FUNCTION__,
src_buffer, src_pitch, src_x, src_y,
dst_buffer, dst_pitch, dst_x, dst_y,
- w,h);
+ w,h,logic_op);
+ assert( logic_op - GL_CLEAR >= 0 );
+ assert( logic_op - GL_CLEAR < 0x10 );
+
src_pitch *= cpp;
dst_pitch *= cpp;
@@ -259,11 +284,12 @@ void intelEmitCopyBlit( struct intel_context *intel,
case 1:
case 2:
case 3:
- BR13 = (0xCC << 16) | (1<<24);
+ BR13 = (translate_raster_op(logic_op) << 16) | (1<<24);
CMD = XY_SRC_COPY_BLT_CMD;
break;
case 4:
- BR13 = (0xCC << 16) | (1<<24) | (1<<25);
+ BR13 = (translate_raster_op(logic_op) << 16) | (1<<24) |
+ (1<<25);
CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
XY_SRC_COPY_BLT_WRITE_RGB);
break;
@@ -291,8 +317,12 @@ void intelEmitCopyBlit( struct intel_context *intel,
/* Initial y values don't seem to work with negative pitches. If
* we adjust the offsets manually (below), it seems to work fine.
+ *
+ * On the other hand, if we always adjust, the hardware doesn't
+ * know which blit directions to use, so overlapping copypixels get
+ * the wrong result.
*/
- if (0) {
+ if (dst_pitch > 0 && src_pitch > 0) {
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
OUT_BATCH( CMD );
OUT_BATCH( dst_pitch | BR13 );
@@ -320,14 +350,14 @@ void intelEmitCopyBlit( struct intel_context *intel,
-void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch)
+void intelClearWithBlit(GLcontext *ctx, GLbitfield flags)
{
struct intel_context *intel = intel_context( ctx );
intelScreenPrivate *intelScreen = intel->intelScreen;
GLuint clear_depth, clear_color;
- GLint cx, cy;
+ GLint cx, cy, cw, ch;
GLint cpp = intelScreen->cpp;
+ GLboolean all;
GLint i;
struct intel_region *front = intel->front_region;
struct intel_region *back = intel->back_region;
@@ -374,21 +404,16 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
intelFlush( &intel->ctx );
LOCK_HARDWARE( intel );
{
- /* Refresh the cx/y/w/h values as they may have been invalidated
- * by a new window position or size picked up when we did
- * LOCK_HARDWARE above. The values passed by mesa are not
- * reliable.
- */
- {
- cx = ctx->DrawBuffer->_Xmin;
- cy = ctx->DrawBuffer->_Ymin;
- ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- }
+ /* get clear bounds after locking */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height);
/* flip top to bottom */
- cy = intel->driDrawable->h-cy1-ch;
- cx = cx1 + intel->drawX;
+ cy = intel->driDrawable->h - cy - ch;
+ cx = cx + intel->drawX;
cy += intel->drawY;
/* adjust for page flipping */
@@ -492,3 +517,98 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
}
+
+#define BR13_565 0x1
+#define BR13_8888 0x3
+
+
+void
+intelEmitImmediateColorExpandBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLubyte *src_bits, GLuint src_size,
+ GLuint fg_color,
+ GLshort dst_pitch,
+ struct buffer *dst_buffer,
+ GLuint dst_offset,
+ GLboolean dst_tiled,
+ GLshort x, GLshort y,
+ GLshort w, GLshort h)
+{
+ struct xy_setup_blit setup;
+ struct xy_text_immediate_blit text;
+ int dwords = ((src_size + 7) & ~7) / 4;
+
+
+ if (w < 0 || h < 0)
+ return;
+
+ dst_pitch *= cpp;
+
+ if (dst_tiled)
+ dst_pitch /= 4;
+
+ DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d, %d bytes %d dwords\n",
+ __FUNCTION__,
+ dst_buffer, dst_pitch, dst_offset, x, y, w, h, src_size, dwords);
+
+ memset(&setup, 0, sizeof(setup));
+
+ setup.br0.client = CLIENT_2D;
+ setup.br0.opcode = OPCODE_XY_SETUP_BLT;
+ setup.br0.write_alpha = (cpp == 4);
+ setup.br0.write_rgb = (cpp == 4);
+ setup.br0.dst_tiled = dst_tiled;
+ setup.br0.length = (sizeof(setup) / sizeof(int)) - 2;
+
+ setup.br13.dest_pitch = dst_pitch;
+ setup.br13.rop = 0xcc;
+ setup.br13.color_depth = (cpp == 4) ? BR13_8888 : BR13_565;
+ setup.br13.clipping_enable = 0;
+ setup.br13.mono_source_transparency = 1;
+
+ setup.dw2.clip_y1 = 0;
+ setup.dw2.clip_x1 = 0;
+ setup.dw3.clip_y2 = 100;
+ setup.dw3.clip_x2 = 100;
+
+ setup.dest_base_addr = bmBufferOffset(intel, dst_buffer) + dst_offset;
+ setup.background_color = 0;
+ setup.foreground_color = fg_color;
+ setup.pattern_base_addr = 0;
+
+ memset(&text, 0, sizeof(text));
+ text.dw0.client = CLIENT_2D;
+ text.dw0.opcode = OPCODE_XY_TEXT_IMMEDIATE_BLT;
+ text.dw0.pad0 = 0;
+ text.dw0.byte_packed = 1; /* ?maybe? */
+ text.dw0.pad1 = 0;
+ text.dw0.dst_tiled = dst_tiled;
+ text.dw0.pad2 = 0;
+ text.dw0.length = (sizeof(text)/sizeof(int)) - 2 + dwords;
+ text.dw1.dest_y1 = y; /* duplicates info in setup blit */
+ text.dw1.dest_x1 = x;
+ text.dw2.dest_y2 = y + h;
+ text.dw2.dest_x2 = x + w;
+
+ intel_batchbuffer_require_space( intel->batch,
+ sizeof(setup) +
+ sizeof(text) +
+ dwords,
+ INTEL_BATCH_NO_CLIPRECTS );
+
+ intel_batchbuffer_data( intel->batch,
+ &setup,
+ sizeof(setup),
+ INTEL_BATCH_NO_CLIPRECTS );
+
+ intel_batchbuffer_data( intel->batch,
+ &text,
+ sizeof(text),
+ INTEL_BATCH_NO_CLIPRECTS );
+
+ intel_batchbuffer_data( intel->batch,
+ src_bits,
+ dwords * 4,
+ INTEL_BATCH_NO_CLIPRECTS );
+}
+
diff --git a/src/mesa/drivers/dri/i965/intel_blit.h b/src/mesa/drivers/dri/i965/intel_blit.h
index 357ceb4c512..8b0cc65243c 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.h
+++ b/src/mesa/drivers/dri/i965/intel_blit.h
@@ -35,8 +35,7 @@ struct buffer;
extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv,
const drm_clip_rect_t *rect );
-extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch);
+extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask);
extern void intelEmitCopyBlit( struct intel_context *intel,
GLuint cpp,
@@ -50,7 +49,8 @@ extern void intelEmitCopyBlit( struct intel_context *intel,
GLboolean dst_tiled,
GLshort srcx, GLshort srcy,
GLshort dstx, GLshort dsty,
- GLshort w, GLshort h );
+ GLshort w, GLshort h,
+ GLenum logic_op );
extern void intelEmitFillBlit( struct intel_context *intel,
GLuint cpp,
@@ -62,5 +62,16 @@ extern void intelEmitFillBlit( struct intel_context *intel,
GLshort w, GLshort h,
GLuint color );
+void
+intelEmitImmediateColorExpandBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLubyte *src_bits, GLuint src_size,
+ GLuint fg_color,
+ GLshort dst_pitch,
+ struct buffer *dst_buffer,
+ GLuint dst_offset,
+ GLboolean dst_tiled,
+ GLshort dst_x, GLshort dst_y,
+ GLshort w, GLshort h);
#endif
diff --git a/src/mesa/drivers/dri/i965/intel_buffers.c b/src/mesa/drivers/dri/i965/intel_buffers.c
index 853956671ce..d155c039d77 100644
--- a/src/mesa/drivers/dri/i965/intel_buffers.c
+++ b/src/mesa/drivers/dri/i965/intel_buffers.c
@@ -210,6 +210,12 @@ void intelWindowMoved( struct intel_context *intel )
intel->NewGLState |= _NEW_SCISSOR;
}
+
+ /* This works because the lock is always grabbed before emitting
+ * commands and commands are always flushed prior to releasing
+ * the lock.
+ */
+ intel->NewGLState |= _NEW_WINDOW_POS;
}
@@ -218,12 +224,11 @@ void intelWindowMoved( struct intel_context *intel )
* machine independent. Maybe we'll get there one day.
*/
static void intelClearWithTris(struct intel_context *intel,
- GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy,
- GLint cw, GLint ch)
+ GLbitfield mask)
{
+ GLcontext *ctx = &intel->ctx;
drm_clip_rect_t clear;
+ GLint cx, cy, cw, ch;
if (INTEL_DEBUG & DEBUG_DRI)
_mesa_printf("%s %x\n", __FUNCTION__, mask);
@@ -232,18 +237,11 @@ static void intelClearWithTris(struct intel_context *intel,
intel->vtbl.install_meta_state(intel);
- /* Refresh the cx/y/w/h values as they may have been invalidated
- * by a new window position or size picked up when we did
- * LOCK_HARDWARE above. The values passed by mesa are not
- * reliable.
- */
- {
- GLcontext *ctx = &intel->ctx;
- cx = ctx->DrawBuffer->_Xmin;
- cy = ctx->DrawBuffer->_Ymin;
- ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- }
+ /* Get clear bounds after locking */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
clear.x1 = cx;
clear.y1 = cy;
@@ -321,11 +319,7 @@ static void intelClearWithTris(struct intel_context *intel,
-static void intelClear(GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy,
- GLint cw, GLint ch)
+static void intelClear(GLcontext *ctx, GLbitfield mask)
{
struct intel_context *intel = intel_context( ctx );
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
@@ -334,8 +328,7 @@ static void intelClear(GLcontext *ctx,
GLbitfield swrast_mask = 0;
if (INTEL_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s %x all %d dims %d,%d %dx%d\n", __FUNCTION__,
- mask, all, cx, cy, cw, ch);
+ fprintf(stderr, "%s %x\n", __FUNCTION__, mask);
if (mask & BUFFER_BIT_FRONT_LEFT) {
@@ -386,13 +379,13 @@ static void intelClear(GLcontext *ctx,
intelFlush( ctx );
if (blit_mask)
- intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch );
+ intelClearWithBlit( ctx, blit_mask );
if (tri_mask)
- intelClearWithTris( intel, tri_mask, all, cx, cy, cw, ch);
+ intelClearWithTris( intel, tri_mask );
if (swrast_mask)
- _swrast_Clear( ctx, swrast_mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, swrast_mask );
}
@@ -549,7 +542,6 @@ void intelInitBufferFuncs( struct dd_function_table *functions )
{
functions->Clear = intelClear;
functions->GetBufferSize = intelBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
functions->DrawBuffer = intelDrawBuffer;
functions->ReadBuffer = intelReadBuffer;
}
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index 59fc8073eee..d13e287fa76 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -149,6 +149,10 @@ const struct dri_extension card_extensions[] =
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_texture_non_power_of_two", NULL },
+ { "GL_ARB_texture_rectangle", NULL },
+ { "GL_NV_texture_rectangle", NULL },
+ { "GL_EXT_texture_rectangle", 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 },
@@ -246,18 +250,14 @@ void intelInitDriverFunctions( struct dd_function_table *functions )
functions->Finish = intelFinish;
functions->GetString = intelGetString;
functions->UpdateState = intelInvalidateState;
- functions->CopyColorTable = _swrast_CopyColorTable;
- functions->CopyColorSubTable = _swrast_CopyColorSubTable;
- functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
- /* Pixel path fallbacks.
+ /* CopyPixels can be accelerated even with the current memory
+ * manager:
*/
- functions->Accum = _swrast_Accum;
- functions->Bitmap = _swrast_Bitmap;
- functions->CopyPixels = _swrast_CopyPixels;
- functions->ReadPixels = _swrast_ReadPixels;
- functions->DrawPixels = _swrast_DrawPixels;
+ if (!getenv("INTEL_NO_BLIT")) {
+ functions->CopyPixels = intelCopyPixels;
+ functions->Bitmap = intelBitmap;
+ }
intelInitTextureFuncs( functions );
intelInitStateFuncs( functions );
@@ -320,6 +320,11 @@ GLboolean intelInitContext( struct intel_context *intel,
ctx->Const.MaxPointSizeAA = 3.0;
ctx->Const.PointSizeGranularity = 1.0;
+ /* reinitialize the context point state.
+ * It depend on constants in __GLcontextRec::Const
+ */
+ _mesa_init_point(ctx);
+
/* Initialize the software rasterizer and helper modules. */
_swrast_CreateContext( ctx );
_ac_CreateContext( ctx );
@@ -370,8 +375,6 @@ GLboolean intelInitContext( struct intel_context *intel,
exit(1);
}
- _math_matrix_ctr (&intel->ViewportMatrix);
-
driInitExtensions( ctx, card_extensions,
GL_TRUE );
@@ -446,8 +449,6 @@ GLboolean intelInitContext( struct intel_context *intel,
/* DRI_TEXMGR_DO_TEXTURE_RECT ); */
- intel->prim.primitive = ~0;
-
if (getenv("INTEL_NO_RAST")) {
fprintf(stderr, "disabling 3D rasterization\n");
intel->no_rast = 1;
@@ -537,18 +538,13 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
}
-static void lost_hardware( struct intel_context *intel )
-{
- bm_fake_NotifyContendedLockTake( intel );
- intel->vtbl.lost_hardware( intel );
-}
-
static void intelContendedLock( struct intel_context *intel, GLuint flags )
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
__DRIscreenPrivate *sPriv = intel->driScreen;
volatile drmI830Sarea * sarea = intel->sarea;
int me = intel->hHWContext;
+ int my_bufmgr = bmCtxId(intel);
drmGetLock(intel->driFd, intel->hHWContext, flags);
@@ -562,12 +558,23 @@ static void intelContendedLock( struct intel_context *intel, GLuint flags )
intel->locked = 1;
+ intel->need_flush = 1;
/* Lost context?
*/
if (sarea->ctxOwner != me) {
+ DBG("Lost Context: sarea->ctxOwner %x me %x\n", sarea->ctxOwner, me);
sarea->ctxOwner = me;
- lost_hardware(intel);
+ intel->vtbl.lost_hardware( intel );
+ }
+
+ /* As above, but don't evict the texture data on transitions
+ * between contexts which all share a local buffer manager.
+ */
+ if (sarea->texAge != my_bufmgr) {
+ DBG("Lost Textures: sarea->texAge %x my_bufmgr %x\n", sarea->ctxOwner, my_bufmgr);
+ sarea->texAge = my_bufmgr;
+ bm_fake_NotifyContendedLockTake( intel );
}
/* Drawable changed?
@@ -575,12 +582,6 @@ static void intelContendedLock( struct intel_context *intel, GLuint flags )
if (dPriv && intel->lastStamp != dPriv->lastStamp) {
intelWindowMoved( intel );
intel->lastStamp = dPriv->lastStamp;
-
- /* This works because the lock is always grabbed before emitting
- * commands and commands are always flushed prior to releasing
- * the lock.
- */
- intel->NewGLState |= _NEW_WINDOW_POS;
}
}
diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h
index 0328cb900a8..8367a957109 100644
--- a/src/mesa/drivers/dri/i965/intel_context.h
+++ b/src/mesa/drivers/dri/i965/intel_context.h
@@ -86,7 +86,6 @@ struct intel_texture_object
-
struct intel_context
{
GLcontext ctx; /* the parent class */
@@ -148,9 +147,14 @@ struct intel_context
void (*meta_depth_replace)( struct intel_context *intel );
+ void (*meta_texture_blend_replace) (struct intel_context * intel);
+
void (*meta_no_stencil_write)( struct intel_context *intel );
void (*meta_no_depth_write)( struct intel_context *intel );
void (*meta_no_texture)( struct intel_context *intel );
+ void (*meta_import_pixel_state) (struct intel_context * intel);
+ void (*meta_frame_buffer_texture)( struct intel_context *intel,
+ GLint xoff, GLint yoff );
void (*meta_draw_quad)(struct intel_context *intel,
GLfloat x0, GLfloat x1,
@@ -176,16 +180,6 @@ struct intel_context
struct intel_batchbuffer *batch;
- struct {
- GLuint id;
- GLuint primitive;
- GLubyte *start_ptr;
- void (*flush)( struct intel_context * );
- } prim;
-
- GLboolean locked;
- GLboolean strict_conformance;
-
GLubyte clear_chan[4];
GLuint ClearColor;
GLuint ClearDepth;
@@ -201,6 +195,10 @@ struct intel_context
GLboolean no_hw;
GLboolean no_rast;
GLboolean thrashing;
+ GLboolean locked;
+ GLboolean strict_conformance;
+ GLboolean need_flush;
+
/* AGP memory buffer manager:
@@ -210,32 +208,21 @@ struct intel_context
/* State for intelvb.c and inteltris.c.
*/
- GLuint RenderIndex;
- GLmatrix ViewportMatrix;
GLenum render_primitive;
GLenum reduced_primitive;
- GLuint vertex_size;
- GLubyte *verts; /* points to tnl->clipspace.vertex_buf */
-
struct intel_region *front_region;
struct intel_region *back_region;
struct intel_region *draw_region;
struct intel_region *depth_region;
-
- /* 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:
*/
int drawX; /* origin of drawable in draw buffer */
int drawY;
GLuint numClipRects; /* cliprects for that buffer */
drm_clip_rect_t *pClipRects;
+ struct gl_texture_object *frame_buffer_texobj;
GLboolean scissor;
drm_clip_rect_t draw_rect;
@@ -347,8 +334,8 @@ static inline void * __memcpy(void * to, const void * from, size_t n)
*/
static inline void *do_memcpy( void *dest, const void *src, size_t n )
{
- if ( (((unsigned)src) & 63) ||
- (((unsigned)dest) & 63)) {
+ if ( (((unsigned long)src) & 63) ||
+ (((unsigned long)dest) & 63)) {
return __memcpy(dest, src, n);
}
else
@@ -496,6 +483,21 @@ extern GLboolean intel_intersect_cliprects( drm_clip_rect_t *dest,
const drm_clip_rect_t *b );
+/* ================================================================
+ * intel_pixel_copy.c:
+ */
+void intelCopyPixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint destx, GLint desty, GLenum type);
+
+GLboolean intel_check_blit_fragment_ops(GLcontext * ctx);
+
+void intelBitmap(GLcontext * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte * pixels);
#define _NEW_WINDOW_POS 0x40000000
diff --git a/src/mesa/drivers/dri/i965/intel_ioctl.c b/src/mesa/drivers/dri/i965/intel_ioctl.c
index 9297543f82b..d1f2e3f27ca 100644
--- a/src/mesa/drivers/dri/i965/intel_ioctl.c
+++ b/src/mesa/drivers/dri/i965/intel_ioctl.c
@@ -105,8 +105,7 @@ void intelWaitIrq( struct intel_context *intel, int seq )
void intel_batch_ioctl( struct intel_context *intel,
GLuint start_offset,
- GLuint used,
- GLboolean ignore_cliprects)
+ GLuint used)
{
drmI830BatchBuffer batch;
@@ -114,27 +113,24 @@ void intel_batch_ioctl( struct intel_context *intel,
assert(used);
if (0)
- fprintf(stderr, "%s used %d offset %x..%x ignore_cliprects %d\n",
+ fprintf(stderr, "%s used %d offset %x..%x\n",
__FUNCTION__,
used,
start_offset,
- start_offset + used,
- ignore_cliprects);
+ start_offset + used);
batch.start = start_offset;
batch.used = used;
- batch.cliprects = intel->pClipRects;
- batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects;
+ batch.cliprects = NULL;
+ batch.num_cliprects = 0;
batch.DR1 = 0;
- batch.DR4 = ((((GLuint)intel->drawX) & 0xffff) |
- (((GLuint)intel->drawY) << 16));
+ batch.DR4 = 0;
if (INTEL_DEBUG & DEBUG_DMA)
- fprintf(stderr, "%s: 0x%x..0x%x DR4: %x cliprects: %d\n",
+ fprintf(stderr, "%s: 0x%x..0x%x\n",
__FUNCTION__,
batch.start,
- batch.start + batch.used * 4,
- batch.DR4, batch.num_cliprects);
+ batch.start + batch.used * 4);
if (!intel->no_hw) {
if (drmCommandWrite (intel->driFd, DRM_I830_BATCHBUFFER, &batch,
@@ -148,8 +144,7 @@ void intel_batch_ioctl( struct intel_context *intel,
void intel_cmd_ioctl( struct intel_context *intel,
char *buf,
- GLuint used,
- GLboolean ignore_cliprects)
+ GLuint used)
{
drmI830CmdBuffer cmd;
@@ -159,17 +154,15 @@ void intel_cmd_ioctl( struct intel_context *intel,
cmd.buf = buf;
cmd.sz = used;
cmd.cliprects = intel->pClipRects;
- cmd.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects;
+ cmd.num_cliprects = 0;
cmd.DR1 = 0;
- cmd.DR4 = ((((GLuint)intel->drawX) & 0xffff) |
- (((GLuint)intel->drawY) << 16));
+ cmd.DR4 = 0;
if (INTEL_DEBUG & DEBUG_DMA)
- fprintf(stderr, "%s: 0x%x..0x%x DR4: %x cliprects: %d\n",
+ fprintf(stderr, "%s: 0x%x..0x%x\n",
__FUNCTION__,
0,
- 0 + cmd.sz,
- cmd.DR4, cmd.num_cliprects);
+ 0 + cmd.sz);
if (!intel->no_hw) {
if (drmCommandWrite (intel->driFd, DRM_I830_CMDBUFFER, &cmd,
diff --git a/src/mesa/drivers/dri/i965/intel_ioctl.h b/src/mesa/drivers/dri/i965/intel_ioctl.h
index dcebcb06d1d..df276593626 100644
--- a/src/mesa/drivers/dri/i965/intel_ioctl.h
+++ b/src/mesa/drivers/dri/i965/intel_ioctl.h
@@ -35,12 +35,10 @@ int intelEmitIrqLocked( struct intel_context *intel );
void intel_batch_ioctl( struct intel_context *intel,
GLuint start_offset,
- GLuint used,
- GLboolean ignore_cliprects);
+ GLuint used);
void intel_cmd_ioctl( struct intel_context *intel,
char *buf,
- GLuint used,
- GLboolean ignore_cliprects);
+ GLuint used);
#endif
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
new file mode 100644
index 00000000000..5841afaa3ef
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
@@ -0,0 +1,350 @@
+/**************************************************************************
+ *
+ * Copyright 2006 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 portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 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 "image.h"
+#include "colormac.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "bufferobj.h"
+#include "swrast/swrast.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_ioctl.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_regions.h"
+#include "intel_buffer_objects.h"
+
+
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+
+/* Unlike the other intel_pixel_* functions, the expectation here is
+ * that the incoming data is not in a PBO. With the XY_TEXT blit
+ * method, there's no benefit haveing it in a PBO, but we could
+ * implement a path based on XY_MONO_SRC_COPY_BLIT which might benefit
+ * PBO bitmaps. I think they are probably pretty rare though - I
+ * wonder if Xgl uses them?
+ */
+static const GLubyte *map_pbo( GLcontext *ctx,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ GLubyte *buf;
+
+ if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
+ GL_COLOR_INDEX, GL_BITMAP,
+ (GLvoid *) bitmap)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,"glBitmap(invalid PBO access)");
+ return NULL;
+ }
+
+ buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB,
+ unpack->BufferObj);
+ if (!buf) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)");
+ return NULL;
+ }
+
+ return ADD_POINTERS(buf, bitmap);
+}
+
+static GLboolean test_bit( const GLubyte *src,
+ GLuint bit )
+{
+ return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0;
+}
+
+static void set_bit( GLubyte *dest,
+ GLuint bit )
+{
+ dest[bit/8] |= 1 << (bit % 8);
+}
+
+static int align(int x, int align)
+{
+ return (x + align - 1) & ~(align - 1);
+}
+
+/* Extract a rectangle's worth of data from the bitmap. Called
+ * per-cliprect.
+ */
+static GLuint get_bitmap_rect(GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap,
+ GLuint x, GLuint y,
+ GLuint w, GLuint h,
+ GLubyte *dest,
+ GLuint row_align,
+ GLboolean invert)
+{
+ GLuint src_offset = (x + unpack->SkipPixels) & 0x7;
+ GLuint mask = unpack->LsbFirst ? 0 : 7;
+ GLuint bit = 0;
+ GLint row, col;
+ GLint first, last;
+ GLint incr;
+ GLuint count = 0;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
+ __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
+
+ if (invert) {
+ first = h-1;
+ last = 0;
+ incr = -1;
+ }
+ else {
+ first = 0;
+ last = h-1;
+ incr = 1;
+ }
+
+ /* Require that dest be pre-zero'd.
+ */
+ for (row = first; row != (last+incr); row += incr) {
+ const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap,
+ width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ y + row, x);
+
+ for (col = 0; col < w; col++, bit++) {
+ if (test_bit(rowsrc, (col + src_offset) ^ mask)) {
+ set_bit(dest, bit ^ 7);
+ count++;
+ }
+ }
+
+ if (row_align)
+ bit = (bit + row_align - 1) & ~(row_align - 1);
+ }
+
+ return count;
+}
+
+
+
+
+/*
+ * Render a bitmap.
+ */
+static GLboolean
+do_blit_bitmap( GLcontext *ctx,
+ GLint dstx, GLint dsty,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+
+ union {
+ GLuint ui;
+ GLubyte ub[4];
+ } color;
+
+
+ if (unpack->BufferObj->Name) {
+ bitmap = map_pbo(ctx, width, height, unpack, bitmap);
+ if (bitmap == NULL)
+ return GL_TRUE; /* even though this is an error, we're done */
+ }
+
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], ctx->Current.RasterColor[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], ctx->Current.RasterColor[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], ctx->Current.RasterColor[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], ctx->Current.RasterColor[3]);
+
+ /* Does zoom apply to bitmaps?
+ */
+ if (!intel_check_blit_fragment_ops(ctx) ||
+ ctx->Pixel.ZoomX != 1.0F ||
+ ctx->Pixel.ZoomY != 1.0F)
+ return GL_FALSE;
+
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ drm_clip_rect_t *box = dPriv->pClipRects;
+ drm_clip_rect_t dest_rect;
+ GLint nbox = dPriv->numClipRects;
+ GLint srcx = 0, srcy = 0;
+ GLint orig_screen_x1, orig_screen_y2;
+ GLuint i;
+
+
+ orig_screen_x1 = dPriv->x + dstx;
+ orig_screen_y2 = dPriv->y + (dPriv->h - dsty);
+
+ /* Do scissoring in GL coordinates:
+ */
+ if (ctx->Scissor.Enabled)
+ {
+ GLint x = ctx->Scissor.X;
+ GLint y = ctx->Scissor.Y;
+ GLuint w = ctx->Scissor.Width;
+ GLuint h = ctx->Scissor.Height;
+
+ if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height))
+ goto out;
+ }
+
+ /* Convert from GL to hardware coordinates:
+ */
+ dsty = dPriv->y + (dPriv->h - dsty - height);
+ dstx = dPriv->x + dstx;
+
+ dest_rect.x1 = dstx;
+ dest_rect.y1 = dsty;
+ dest_rect.x2 = dstx + width;
+ dest_rect.y2 = dsty + height;
+
+ for (i = 0; i < nbox; i++) {
+ drm_clip_rect_t rect;
+ int box_w, box_h;
+ GLint px, py;
+ GLuint stipple[32];
+
+ if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i]))
+ continue;
+
+ /* Now go back to GL coordinates to figure out what subset of
+ * the bitmap we are uploading for this cliprect:
+ */
+ box_w = rect.x2 - rect.x1;
+ box_h = rect.y2 - rect.y1;
+ srcx = rect.x1 - orig_screen_x1;
+ srcy = orig_screen_y2 - rect.y2;
+
+
+#define DY 32
+#define DX 32
+
+ /* Then, finally, chop it all into chunks that can be
+ * digested by hardware:
+ */
+ for (py = 0; py < box_h; py += DY) {
+ for (px = 0; px < box_w; px += DX) {
+ int h = MIN2(DY, box_h - py);
+ int w = MIN2(DX, box_w - px);
+ GLuint sz = align(align(w,8) * h, 64)/8;
+
+ assert(sz <= sizeof(stipple));
+ memset(stipple, 0, sz);
+
+ /* May need to adjust this when padding has been introduced in
+ * sz above:
+ */
+ if (get_bitmap_rect(width, height, unpack,
+ bitmap,
+ srcx + px, srcy + py, w, h,
+ (GLubyte *)stipple,
+ 8,
+ GL_TRUE) == 0)
+ continue;
+
+ /*
+ */
+ intelEmitImmediateColorExpandBlit( intel,
+ dst->cpp,
+ (GLubyte *)stipple,
+ sz,
+ color.ui,
+ dst->pitch,
+ dst->buffer,
+ 0,
+ dst->tiled,
+ rect.x1 + px,
+ rect.y2 - (py + h),
+ w, h);
+ }
+ }
+ }
+ intel->need_flush = GL_TRUE;
+ out:
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+
+
+ if (unpack->BufferObj->Name) {
+ /* done with PBO so unmap it now */
+ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ unpack->BufferObj);
+ }
+
+ return GL_TRUE;
+}
+
+
+
+
+
+/* There are a large number of possible ways to implement bitmap on
+ * this hardware, most of them have some sort of drawback. Here are a
+ * few that spring to mind:
+ *
+ * Blit:
+ * - XY_MONO_SRC_BLT_CMD
+ * - use XY_SETUP_CLIP_BLT for cliprect clipping.
+ * - XY_TEXT_BLT
+ * - XY_TEXT_IMMEDIATE_BLT
+ * - blit per cliprect, subject to maximum immediate data size.
+ * - XY_COLOR_BLT
+ * - per pixel or run of pixels
+ * - XY_PIXEL_BLT
+ * - good for sparse bitmaps
+ *
+ * 3D engine:
+ * - Point per pixel
+ * - Translate bitmap to an alpha texture and render as a quad
+ * - Chop bitmap up into 32x32 squares and render w/polygon stipple.
+ */
+void
+intelBitmap(GLcontext * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte * pixels)
+{
+ if (do_blit_bitmap(ctx, x, y, width, height,
+ unpack, pixels))
+ return;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+
+ _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels);
+}
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
new file mode 100644
index 00000000000..58dc49505fe
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
@@ -0,0 +1,343 @@
+/**************************************************************************
+ *
+ * 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 "image.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "state.h"
+#include "swrast/swrast.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_ioctl.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_regions.h"
+
+
+static struct intel_region *
+copypix_src_region(struct intel_context *intel, GLenum type)
+{
+ switch (type) {
+ case GL_COLOR:
+ return intel_readbuf_region(intel);
+ case GL_DEPTH:
+ /* Don't think this is really possible execpt at 16bpp, when we have no stencil.
+ */
+ if (intel->depth_region && intel->depth_region->cpp == 2)
+ return intel->depth_region;
+ case GL_STENCIL:
+ /* Don't think this is really possible.
+ */
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ /* Does it matter whether it is stencil/depth or depth/stencil?
+ */
+ return intel->depth_region;
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
+
+
+
+/**
+ * Check if any fragment operations are in effect which might effect
+ * glDraw/CopyPixels.
+ */
+GLboolean
+intel_check_blit_fragment_ops(GLcontext * ctx)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ return !(ctx->_ImageTransferState ||
+ ctx->RenderMode != GL_RENDER ||
+ ctx->Color.AlphaEnabled ||
+ ctx->Depth.Test ||
+ ctx->Fog.Enabled ||
+ ctx->Stencil.Enabled ||
+ !ctx->Color.ColorMask[0] ||
+ !ctx->Color.ColorMask[1] ||
+ !ctx->Color.ColorMask[2] ||
+ !ctx->Color.ColorMask[3] || /* can do this! */
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
+}
+
+/* Doesn't work for overlapping regions. Could do a double copy or
+ * just fallback.
+ */
+static GLboolean
+do_texture_copypixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+ struct intel_region *src = copypix_src_region(intel, type);
+ GLenum src_format;
+ GLenum src_type;
+
+ DBG("%s %d,%d %dx%d --> %d,%d\n", __FUNCTION__,
+ srcx, srcy, width, height, dstx, dsty);
+
+ if (!src || !dst || type != GL_COLOR ||
+ ctx->_ImageTransferState ||
+ ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F ||
+ ctx->RenderMode != GL_RENDER ||
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ src != dst )
+ return GL_FALSE;
+
+ /* Can't handle overlapping regions. Don't have sufficient control
+ * over rasterization to pull it off in-place. Punt on these for
+ * now.
+ *
+ * XXX: do a copy to a temporary.
+ */
+ if (src->buffer == dst->buffer) {
+ drm_clip_rect_t srcbox;
+ drm_clip_rect_t dstbox;
+ drm_clip_rect_t tmp;
+
+ srcbox.x1 = srcx;
+ srcbox.y1 = srcy;
+ srcbox.x2 = srcx + width - 1;
+ srcbox.y2 = srcy + height - 1;
+
+ dstbox.x1 = dstx;
+ dstbox.y1 = dsty;
+ dstbox.x2 = dstx + width - 1;
+ dstbox.y2 = dsty + height - 1;
+
+ DBG("src %d,%d %d,%d\n", srcbox.x1, srcbox.y1, srcbox.x2, srcbox.y2);
+ DBG("dst %d,%d %d,%d (%dx%d) (%f,%f)\n", dstbox.x1, dstbox.y1, dstbox.x2, dstbox.y2,
+ width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
+
+ if (intel_intersect_cliprects(&tmp, &srcbox, &dstbox)) {
+ DBG("%s: regions overlap\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ }
+
+ intelFlush(&intel->ctx);
+
+ intel->vtbl.install_meta_state(intel);
+
+ /* Is this true? Also will need to turn depth testing on according
+ * to state:
+ */
+ intel->vtbl.meta_no_stencil_write(intel);
+ intel->vtbl.meta_no_depth_write(intel);
+
+ /* Set the 3d engine to draw into the destination region:
+ */
+ intel->vtbl.meta_draw_region(intel, dst, intel->depth_region);
+
+ intel->vtbl.meta_import_pixel_state(intel);
+
+ if (src->cpp == 2) {
+ src_format = GL_RGB;
+ src_type = GL_UNSIGNED_SHORT_5_6_5;
+ }
+ else {
+ src_format = GL_BGRA;
+ src_type = GL_UNSIGNED_BYTE;
+ }
+
+ /* Set the frontbuffer up as a large rectangular texture.
+ */
+ intel->vtbl.meta_frame_buffer_texture( intel, srcx - dstx, srcy - dsty );
+
+ intel->vtbl.meta_texture_blend_replace(intel);
+
+ if (intel->driDrawable->numClipRects)
+ intel->vtbl.meta_draw_quad( intel,
+ dstx, dstx + width,
+ dsty, dsty + height,
+ ctx->Current.RasterPos[ 2 ],
+ 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0 );
+
+ intel->vtbl.leave_meta_state( intel );
+
+ DBG("%s: success\n", __FUNCTION__);
+ return GL_TRUE;
+}
+
+/**
+ * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc.
+ */
+static GLboolean
+do_blit_copypixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+ struct intel_region *src = copypix_src_region(intel, type);
+
+ /* Copypixels can be more than a straight copy. Ensure all the
+ * extra operations are disabled:
+ */
+ if (!intel_check_blit_fragment_ops(ctx) ||
+ ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F)
+ return GL_FALSE;
+
+ if (!src || !dst)
+ return GL_FALSE;
+
+
+
+ intelFlush(&intel->ctx);
+
+/* intel->vtbl.render_start(intel); */
+/* intel->vtbl.emit_state(intel); */
+
+ LOCK_HARDWARE(intel);
+
+ if (intel->driDrawable->numClipRects) {
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ drm_clip_rect_t *box = dPriv->pClipRects;
+ drm_clip_rect_t dest_rect;
+ GLint nbox = dPriv->numClipRects;
+ GLint delta_x = 0;
+ GLint delta_y = 0;
+ GLuint i;
+
+ /* Do scissoring in GL coordinates:
+ */
+ if (ctx->Scissor.Enabled)
+ {
+ GLint x = ctx->Scissor.X;
+ GLint y = ctx->Scissor.Y;
+ GLuint w = ctx->Scissor.Width;
+ GLuint h = ctx->Scissor.Height;
+ GLint dx = dstx - srcx;
+ GLint dy = dsty - srcy;
+
+ if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height))
+ goto out;
+
+ srcx = dstx - dx;
+ srcy = dsty - dy;
+ }
+
+ /* Convert from GL to hardware coordinates:
+ */
+ dsty = dPriv->h - dsty - height;
+ srcy = dPriv->h - srcy - height;
+ dstx += dPriv->x;
+ dsty += dPriv->y;
+ srcx += dPriv->x;
+ srcy += dPriv->y;
+
+ /* Clip against the source region. This is the only source
+ * clipping we do. Dst is clipped with cliprects below.
+ */
+ {
+ delta_x = srcx - dstx;
+ delta_y = srcy - dsty;
+
+ if (!_mesa_clip_to_region(0, 0, src->pitch, src->height,
+ &srcx, &srcy, &width, &height))
+ goto out;
+
+ dstx = srcx - delta_x;
+ dsty = srcy - delta_y;
+ }
+
+ dest_rect.x1 = dstx;
+ dest_rect.y1 = dsty;
+ dest_rect.x2 = dstx + width;
+ dest_rect.y2 = dsty + height;
+
+/* intel->vtbl.emit_flush(intel, 0); */
+
+ /* Could do slightly more clipping: Eg, take the intersection of
+ * the existing set of cliprects and those cliprects translated
+ * by delta_x, delta_y:
+ *
+ * This code will not overwrite other windows, but will
+ * introduce garbage when copying from obscured window regions.
+ */
+ for (i = 0; i < nbox; i++) {
+ drm_clip_rect_t rect;
+
+ if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i]))
+ continue;
+
+
+ intelEmitCopyBlit(intel,
+ dst->cpp,
+ src->pitch, src->buffer, 0, src->tiled,
+ dst->pitch, dst->buffer, 0, dst->tiled,
+ rect.x1 + delta_x,
+ rect.y1 + delta_y, /* srcx, srcy */
+ rect.x1, rect.y1, /* dstx, dsty */
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
+ }
+
+ intel->need_flush = GL_TRUE;
+ out:
+ intel_batchbuffer_flush(intel->batch);
+ }
+ UNLOCK_HARDWARE(intel);
+ return GL_TRUE;
+}
+
+void
+intelCopyPixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint destx, GLint desty, GLenum type)
+{
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
+ return;
+
+ if (do_texture_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
+ return;
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("fallback to _swrast_CopyPixels\n");
+
+ _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type);
+}
diff --git a/src/mesa/drivers/dri/i965/intel_regions.c b/src/mesa/drivers/dri/i965/intel_regions.c
index 53f05612377..398b0a0a3b5 100644
--- a/src/mesa/drivers/dri/i965/intel_regions.c
+++ b/src/mesa/drivers/dri/i965/intel_regions.c
@@ -269,7 +269,8 @@ void intel_region_copy( struct intel_context *intel,
dst->pitch, dst->buffer, dst_offset, dst->tiled,
srcx, srcy,
dstx, dsty,
- width, height);
+ width, height,
+ GL_COPY );
}
/* Fill a rectangular sub-region. Need better logic about when to
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 14b461b1ee7..56e6a792fa2 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -87,7 +87,7 @@ intelMapScreenRegions(__DRIscreenPrivate *sPriv)
* the renderbuffer address to point to the beginning of the
* renderbuffer.
*/
- intelScreen->front.map = sPriv->pFB;
+ intelScreen->front.map = (char *)sPriv->pFB;
if (intelScreen->front.map == NULL) {
fprintf(stderr, "Failed to find framebuffer mapping\n");
return GL_FALSE;
@@ -272,7 +272,7 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
volatile drmI830Sarea *sarea;
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(I830DRIRec) (%d) does not match passed size from device driver (%d)\n", sizeof(I830DRIRec), sPriv->devPrivSize);
+ fprintf(stderr,"\nERROR! sizeof(I830DRIRec) (%ld) does not match passed size from device driver (%d)\n", (unsigned long)sizeof(I830DRIRec), sPriv->devPrivSize);
return GL_FALSE;
}
diff --git a/src/mesa/drivers/dri/i965/intel_span.c b/src/mesa/drivers/dri/i965/intel_span.c
index c68def5a9f9..60fbeccdc54 100644
--- a/src/mesa/drivers/dri/i965/intel_span.c
+++ b/src/mesa/drivers/dri/i965/intel_span.c
@@ -35,6 +35,7 @@
#include "intel_span.h"
#include "intel_ioctl.h"
#include "intel_tex.h"
+#include "intel_batchbuffer.h"
#include "swrast/swrast.h"
#undef DBG
@@ -207,6 +208,16 @@ void intelSpanRenderStart( GLcontext *ctx )
{
struct intel_context *intel = intel_context(ctx);
+ if (intel->need_flush) {
+ LOCK_HARDWARE(intel);
+ intel->vtbl.emit_flush(intel, 0);
+ intel_batchbuffer_flush(intel->batch);
+ intel->need_flush = 0;
+ UNLOCK_HARDWARE(intel);
+ intelFinish(&intel->ctx);
+ }
+
+
LOCK_HARDWARE(intel);
/* Just map the framebuffer and all textures. Bufmgr code will
diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c
index a471f67c510..ec6e0465d4a 100644
--- a/src/mesa/drivers/dri/i965/intel_state.c
+++ b/src/mesa/drivers/dri/i965/intel_state.c
@@ -182,39 +182,6 @@ static void intelClearColor(GLcontext *ctx, const GLfloat color[4])
}
-static void intelCalcViewport( GLcontext *ctx )
-{
- struct intel_context *intel = intel_context(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = intel->ViewportMatrix.m;
- GLint h = 0;
-
- if (intel->driDrawable)
- h = intel->driDrawable->h + SUBPIXEL_Y;
-
- /* 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] + h;
- 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.
*/
@@ -228,8 +195,6 @@ static void intelRenderMode( GLcontext *ctx, GLenum mode )
void intelInitStateFuncs( struct dd_function_table *functions )
{
functions->RenderMode = intelRenderMode;
- functions->Viewport = intelViewport;
- functions->DepthRange = intelDepthRange;
functions->ClearColor = intelClearColor;
}
diff --git a/src/mesa/drivers/dri/i965/intel_structs.h b/src/mesa/drivers/dri/i965/intel_structs.h
new file mode 100644
index 00000000000..522e3bd92c2
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_structs.h
@@ -0,0 +1,132 @@
+#ifndef INTEL_STRUCTS_H
+#define INTEL_STRUCTS_H
+
+struct br0 {
+ GLuint length:8;
+ GLuint pad0:3;
+ GLuint dst_tiled:1;
+ GLuint pad1:8;
+ GLuint write_rgb:1;
+ GLuint write_alpha:1;
+ GLuint opcode:7;
+ GLuint client:3;
+};
+
+
+struct br13 {
+ GLint dest_pitch:16;
+ GLuint rop:8;
+ GLuint color_depth:2;
+ GLuint pad1:3;
+ GLuint mono_source_transparency:1;
+ GLuint clipping_enable:1;
+ GLuint pad0:1;
+};
+
+
+
+/* This is an attempt to move some of the 2D interaction in this
+ * driver to using structs for packets rather than a bunch of #defines
+ * and dwords.
+ */
+struct xy_color_blit {
+ struct br0 br0;
+ struct br13 br13;
+
+ struct {
+ GLuint dest_x1:16;
+ GLuint dest_y1:16;
+ } dw2;
+
+ struct {
+ GLuint dest_x2:16;
+ GLuint dest_y2:16;
+ } dw3;
+
+ GLuint dest_base_addr;
+ GLuint color;
+};
+
+struct xy_src_copy_blit {
+ struct br0 br0;
+ struct br13 br13;
+
+ struct {
+ GLuint dest_x1:16;
+ GLuint dest_y1:16;
+ } dw2;
+
+ struct {
+ GLuint dest_x2:16;
+ GLuint dest_y2:16;
+ } dw3;
+
+ GLuint dest_base_addr;
+
+ struct {
+ GLuint src_x1:16;
+ GLuint src_y1:16;
+ } dw5;
+
+ struct {
+ GLint src_pitch:16;
+ GLuint pad:16;
+ } dw6;
+
+ GLuint src_base_addr;
+};
+
+struct xy_setup_blit {
+ struct br0 br0;
+ struct br13 br13;
+
+ struct {
+ GLuint clip_x1:16;
+ GLuint clip_y1:16;
+ } dw2;
+
+ struct {
+ GLuint clip_x2:16;
+ GLuint clip_y2:16;
+ } dw3;
+
+ GLuint dest_base_addr;
+ GLuint background_color;
+ GLuint foreground_color;
+ GLuint pattern_base_addr;
+};
+
+
+struct xy_text_immediate_blit {
+ struct {
+ GLuint length:8;
+ GLuint pad2:3;
+ GLuint dst_tiled:1;
+ GLuint pad1:4;
+ GLuint byte_packed:1;
+ GLuint pad0:5;
+ GLuint opcode:7;
+ GLuint client:3;
+ } dw0;
+
+ struct {
+ GLuint dest_x1:16;
+ GLuint dest_y1:16;
+ } dw1;
+
+ struct {
+ GLuint dest_x2:16;
+ GLuint dest_y2:16;
+ } dw2;
+
+ /* Src bitmap data follows as inline dwords.
+ */
+};
+
+
+#define CLIENT_2D 0x2
+#define OPCODE_XY_SETUP_BLT 0x1
+#define OPCODE_XY_COLOR_BLT 0x50
+#define OPCODE_XY_TEXT_IMMEDIATE_BLT 0x31
+
+#endif
diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c
index 5f65242458a..cb23b9dd879 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c
@@ -133,6 +133,9 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel,
GLuint nr_faces = 0;
struct gl_texture_image *firstImage;
+ if( tObj == intel->frame_buffer_texobj )
+ return GL_FALSE;
+
/* We know/require this is true by now:
*/
assert(intelObj->base.Complete);
@@ -166,12 +169,15 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel,
* target, imageFormat, etc.
*/
if (intelObj->mt &&
- (intelObj->mt->first_level != intelObj->firstLevel ||
- intelObj->mt->last_level != intelObj->lastLevel ||
+ (intelObj->mt->target != intelObj->base.Target ||
intelObj->mt->internal_format != firstImage->InternalFormat ||
+ intelObj->mt->first_level != intelObj->firstLevel ||
+ intelObj->mt->last_level != intelObj->lastLevel ||
intelObj->mt->width0 != firstImage->Width ||
intelObj->mt->height0 != firstImage->Height ||
- intelObj->mt->depth0 != firstImage->Depth))
+ intelObj->mt->depth0 != firstImage->Depth ||
+ intelObj->mt->cpp != firstImage->TexFormat->TexelBytes ||
+ intelObj->mt->compressed != firstImage->IsCompressed))
{
intel_miptree_destroy(intel, intelObj->mt);
intelObj->mt = NULL;
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c
index 717b9b9e8d8..03ec96a222e 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.c
+++ b/src/mesa/drivers/dri/mach64/mach64_context.c
@@ -308,7 +308,8 @@ mach64MakeCurrent( __DRIcontextPrivate *driContextPriv,
}
- driDrawableInitVBlank( driDrawPriv, newMach64Ctx->vblank_flags );
+ driDrawableInitVBlank( driDrawPriv, newMach64Ctx->vblank_flags,
+ &newMach64Ctx->vbl_seq );
if ( newMach64Ctx->driDrawable != driDrawPriv ) {
newMach64Ctx->driDrawable = driDrawPriv;
diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c
index 7c27c5856a2..17e8d74d9fa 100644
--- a/src/mesa/drivers/dri/mach64/mach64_dd.c
+++ b/src/mesa/drivers/dri/mach64/mach64_dd.c
@@ -127,7 +127,6 @@ static void mach64DDFinish( GLcontext *ctx )
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/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/src/mesa/drivers/dri/mach64/mach64_ioctl.c
index 1889dc2b93c..36e7d3c5d3d 100644
--- a/src/mesa/drivers/dri/mach64/mach64_ioctl.c
+++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.c
@@ -105,7 +105,7 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
int prim = mmesa->hw_primitive;
int fd = mmesa->driScreen->fd;
drm_mach64_vertex_t vertex;
- int i, ret;
+ int i;
mmesa->num_verts = 0;
mmesa->vert_used = 0;
@@ -123,6 +123,9 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
mmesa->dirty |= MACH64_UPLOAD_CLIPRECTS;
if ( !count || !(mmesa->dirty & MACH64_UPLOAD_CLIPRECTS) ) {
+ int to = 0;
+ int ret;
+
/* FIXME: Is this really necessary */
if ( nbox == 1 )
mmesa->sarea->nbox = 0;
@@ -133,7 +136,10 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
vertex.buf = buffer;
vertex.used = count;
vertex.discard = 1;
- ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
+ do {
+ ret = drmCommandWrite( fd, DRM_MACH64_VERTEX,
+ &vertex, sizeof(drm_mach64_vertex_t) );
+ } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
@@ -146,6 +152,8 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
int nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS, nbox );
drm_clip_rect_t *b = mmesa->sarea->boxes;
int discard = 0;
+ int to = 0;
+ int ret;
mmesa->sarea->nbox = nr - i;
for ( ; i < nr ; i++ ) {
@@ -164,7 +172,10 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
vertex.buf = buffer;
vertex.used = count;
vertex.discard = discard;
- ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
+ do {
+ ret = drmCommandWrite( fd, DRM_MACH64_VERTEX,
+ &vertex, sizeof(drm_mach64_vertex_t) );
+ } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
@@ -180,14 +191,15 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
* Texture uploads
*/
-void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
+void mach64FireBlitLocked( mach64ContextPtr mmesa, void *buffer,
GLint offset, GLint pitch, GLint format,
GLint x, GLint y, GLint width, GLint height )
{
drm_mach64_blit_t blit;
- GLint ret;
+ int to = 0;
+ int ret;
- blit.idx = buffer->idx;
+ blit.buf = buffer;
blit.offset = offset;
blit.pitch = pitch;
blit.format = format;
@@ -196,8 +208,10 @@ void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
blit.width = width;
blit.height = height;
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT,
- &blit, sizeof(drm_mach64_blit_t) );
+ do {
+ ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT,
+ &blit, sizeof(drm_mach64_blit_t) );
+ } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
@@ -651,8 +665,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
* Buffer clear
*/
-static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void mach64DDClear( GLcontext *ctx, GLbitfield mask )
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
@@ -660,10 +673,10 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLuint flags = 0;
GLint i;
GLint ret;
+ GLint cx, cy, cw, ch;
if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s: all=%d %d,%d %dx%d\n",
- __FUNCTION__, all, cx, cy, cw, ch );
+ fprintf( stderr, "mach64DDClear\n");
}
#if ENABLE_PERF_BOXES
@@ -699,14 +712,19 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
if ( !flags )
return;
LOCK_HARDWARE( mmesa );
- /* This needs to be in the locked region, so updated drawable origin is used */
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* Flip top to bottom */
cx += mmesa->drawX;
cy = mmesa->drawY + dPriv->h - cy - ch;
@@ -723,7 +741,8 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_clip_rect_t *b = mmesa->sarea->boxes;
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
@@ -745,6 +764,7 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.h b/src/mesa/drivers/dri/mach64/mach64_ioctl.h
index 8bd958531c1..52fe8634845 100644
--- a/src/mesa/drivers/dri/mach64/mach64_ioctl.h
+++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.h
@@ -74,7 +74,7 @@ static __inline void *mach64AllocDmaLocked( mach64ContextPtr mmesa, int bytes )
return head;
}
-extern void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
+extern void mach64FireBlitLocked( mach64ContextPtr mmesa, void *buffer,
GLint offset, GLint pitch, GLint format,
GLint x, GLint y, GLint width, GLint height );
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index 60055e5c9f8..b17de01acc5 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -520,7 +520,7 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIsc
__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 };
+ static const __DRIversion drm_expected = { 2, 0, 0 };
dri_interface = interface;
diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c
index b9881cd941d..d4804a2c550 100644
--- a/src/mesa/drivers/dri/mach64/mach64_state.c
+++ b/src/mesa/drivers/dri/mach64/mach64_state.c
@@ -1186,19 +1186,4 @@ void mach64DDInitStateFuncs( GLcontext *ctx )
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/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c
index f771818c898..017fd3535d5 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texmem.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c
@@ -569,27 +569,17 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
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 );
+ mach64FireBlitLocked( mmesa, (void *)src, offset, pitch, format,
+ x, y, width, height );
+ }
}
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index 6450340a48c..f02913c6af2 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -878,11 +878,11 @@ mgaMakeCurrent(__DRIcontextPrivate *driContextPriv,
mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate;
if (mmesa->driDrawable != driDrawPriv) {
- driDrawableInitVBlank( driDrawPriv, mmesa->vblank_flags );
+ driDrawableInitVBlank( driDrawPriv, mmesa->vblank_flags,
+ &mmesa->vbl_seq );
mmesa->driDrawable = driDrawPriv;
mmesa->dirty = ~0;
mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK);
- mmesa->mesa_drawable = driDrawPriv;
}
mmesa->driReadable = driReadPriv;
diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h
index 81348b6c7f9..2124006ade6 100644
--- a/src/mesa/drivers/dri/mga/mgacontext.h
+++ b/src/mesa/drivers/dri/mga/mgacontext.h
@@ -303,13 +303,6 @@ struct mga_context_t {
__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;
diff --git a/src/mesa/drivers/dri/mga/mgadd.c b/src/mesa/drivers/dri/mga/mgadd.c
index 8532ea95f10..b1d5e0c48fc 100644
--- a/src/mesa/drivers/dri/mga/mgadd.c
+++ b/src/mesa/drivers/dri/mga/mgadd.c
@@ -41,7 +41,7 @@
#include "mga_xmesa.h"
#include "utils.h"
-#define DRIVER_DATE "20050609"
+#define DRIVER_DATE "20061030"
/***************************************
@@ -74,25 +74,7 @@ static const GLubyte *mgaGetString( GLcontext *ctx, GLenum name )
}
-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/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c
index 6e653f8c73d..f8587fc541e 100644
--- a/src/mesa/drivers/dri/mga/mgaioctl.c
+++ b/src/mesa/drivers/dri/mga/mgaioctl.c
@@ -204,8 +204,7 @@ drmBufPtr mga_get_buffer_ioctl( mgaContextPtr mmesa )
static void
-mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+mgaClear( GLcontext *ctx, GLbitfield mask )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
@@ -218,6 +217,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
int i;
static int nrclears;
drm_mga_clear_t clear;
+ GLint cx, cy, cw, ch;
FLUSH_BATCH( mmesa );
@@ -250,6 +250,12 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
if ( flags ) {
LOCK_HARDWARE( mmesa );
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
if ( mmesa->dirty_cliprects )
mgaUpdateRects( mmesa, (MGA_FRONT | MGA_BACK) );
@@ -269,7 +275,8 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_clip_rect_t *b = mmesa->sarea->boxes;
int n = 0;
- if (!all) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++) {
GLint x = box[i].x1;
GLint y = box[i].y1;
@@ -291,6 +298,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++) {
*b++ = box[i];
n++;
@@ -325,7 +333,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
}
diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c
index 38577f05edd..2b9da8c1813 100644
--- a/src/mesa/drivers/dri/mga/mgapixel.c
+++ b/src/mesa/drivers/dri/mga/mgapixel.c
@@ -646,15 +646,8 @@ mgaDDDrawPixels( GLcontext *ctx,
*/
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
+ /* evidently, these functions don't always work */
if (getenv("MGA_BLIT_PIXELS")) {
ctx->Driver.ReadPixels = mgaDDReadPixels; /* requires agp dest */
ctx->Driver.DrawPixels = mgaDDDrawPixels; /* works with agp/normal mem */
diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c
index dbc7fc884ce..05dcbb85263 100644
--- a/src/mesa/drivers/dri/mga/mgaspan.c
+++ b/src/mesa/drivers/dri/mga/mgaspan.c
@@ -36,9 +36,9 @@
#define LOCAL_VARS \
mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \
__DRIscreenPrivate *sPriv = mmesa->driScreen; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ const __DRIdrawablePrivate *dPriv = drb->dPriv; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
char *buf = (char *)(sPriv->pFB + \
@@ -52,9 +52,9 @@
#define LOCAL_DEPTH_VARS \
mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \
__DRIscreenPrivate *sPriv = mmesa->driScreen; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ const __DRIdrawablePrivate *dPriv = drb->dPriv; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
char *buf = (char *)(sPriv->pFB + \
diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c
index de3654bacb3..075fd348cf4 100644
--- a/src/mesa/drivers/dri/mga/mgastate.c
+++ b/src/mesa/drivers/dri/mga/mgastate.c
@@ -24,7 +24,6 @@
* 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"
@@ -49,6 +48,8 @@
#include "swrast_setup/swrast_setup.h"
#include "xmlpool.h"
+#include "drirenderbuffer.h"
+
static void updateSpecularLighting( GLcontext *ctx );
@@ -113,14 +114,15 @@ static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
static void updateBlendLogicOp(GLcontext *ctx)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
+ GLboolean logicOp = RGBA_LOGICOP_ENABLED(ctx);
MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
mmesa->hw.blend_func_enable =
- (ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled) ? ~0 : 0;
+ (ctx->Color.BlendEnabled && !logicOp) ? ~0 : 0;
FALLBACK( ctx, MGA_FALLBACK_BLEND,
- ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled &&
+ ctx->Color.BlendEnabled && !logicOp &&
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
@@ -195,7 +197,7 @@ static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
mmesa->hw.blend_func = (src | dst);
FALLBACK( ctx, MGA_FALLBACK_BLEND,
- ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled &&
+ ctx->Color.BlendEnabled && !RGBA_LOGICOP_ENABLED(ctx) &&
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
@@ -744,32 +746,12 @@ static void mgaDDLogicOp( GLcontext *ctx, GLenum opcode )
}
-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 )
+static void mga_set_cliprects(mgaContextPtr mmesa)
{
__DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
- if (driDrawable->numBackClipRects == 0)
- {
+ if ((mmesa->draw_buffer != MGA_FRONT)
+ || (driDrawable->numBackClipRects == 0)) {
if (driDrawable->numClipRects == 0) {
static drm_clip_rect_t zeroareacliprect = {0,0,0,0};
mmesa->numClipRects = 1;
@@ -794,25 +776,25 @@ static void mgaXMesaSetBackClipRects( mgaContextPtr mmesa )
void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers )
{
- __DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
+ __DRIdrawablePrivate *const driDrawable = mmesa->driDrawable;
+ __DRIdrawablePrivate *const driReadable = mmesa->driReadable;
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 );
+ driUpdateFramebufferSize(mmesa->glCtx, driDrawable);
+ if (driDrawable != driReadable) {
+ driUpdateFramebufferSize(mmesa->glCtx, driReadable);
+ }
+
+ mga_set_cliprects(mmesa);
sarea->req_drawable = driDrawable->draw;
sarea->req_draw_buffer = mmesa->draw_buffer;
mgaUpdateClipping( mmesa->glCtx );
mgaCalcViewport( mmesa->glCtx );
-
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
}
@@ -828,23 +810,21 @@ static void mgaDDDrawBuffer(GLcontext *ctx, GLenum 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;
}
+
+ mmesa->dirty |= MGA_UPLOAD_CONTEXT;
+ mga_set_cliprects(mmesa);
+ FALLBACK(ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE);
}
@@ -987,7 +967,7 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa )
? mmesa->hw.zmode : (DC_zmode_nozcmp | DC_atype_i);
mmesa->setup.dwgctl &= DC_bop_MASK;
- mmesa->setup.dwgctl |= (ctx->Color._LogicOpEnabled)
+ mmesa->setup.dwgctl |= RGBA_LOGICOP_ENABLED(ctx)
? mmesa->hw.rop : mgarop_NoBLK[ GL_COPY & 0x0f ];
mmesa->setup.alphactrl &= AC_src_MASK & AC_dst_MASK & AC_atmode_MASK
@@ -1221,12 +1201,5 @@ void mgaDDInitStateFuncs( GLcontext *ctx )
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/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c
index 8caa1f8580f..a7d74317a5b 100644
--- a/src/mesa/drivers/dri/mga/mgatex.c
+++ b/src/mesa/drivers/dri/mga/mgatex.c
@@ -502,6 +502,9 @@ mgaDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
driDestroyTextureObject( t );
}
+
+ /* Free mipmap images and the texture object itself */
+ _mesa_delete_texture_object(ctx, tObj);
}
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c
index 2f30bd253bf..8ec027542ad 100644
--- a/src/mesa/drivers/dri/r128/r128_context.c
+++ b/src/mesa/drivers/dri/r128/r128_context.c
@@ -345,7 +345,8 @@ r128MakeCurrent( __DRIcontextPrivate *driContextPriv,
newR128Ctx->dirty = R128_UPLOAD_ALL;
}
- driDrawableInitVBlank( driDrawPriv, newR128Ctx->vblank_flags );
+ driDrawableInitVBlank( driDrawPriv, newR128Ctx->vblank_flags,
+ &newR128Ctx->vbl_seq );
newR128Ctx->driDrawable = driDrawPriv;
_mesa_make_current( newR128Ctx->glCtx,
diff --git a/src/mesa/drivers/dri/r128/r128_dd.c b/src/mesa/drivers/dri/r128/r128_dd.c
index 4f0bb4761cd..54f2b21b5d0 100644
--- a/src/mesa/drivers/dri/r128/r128_dd.c
+++ b/src/mesa/drivers/dri/r128/r128_dd.c
@@ -141,7 +141,6 @@ static void r128Finish( GLcontext *ctx )
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/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c
index 3b34d9fbb2d..b0dba7d04e1 100644
--- a/src/mesa/drivers/dri/r128/r128_ioctl.c
+++ b/src/mesa/drivers/dri/r128/r128_ioctl.c
@@ -399,8 +399,7 @@ void r128PageFlip( const __DRIdrawablePrivate *dPriv )
* Buffer clear
*/
-static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void r128Clear( GLcontext *ctx, GLbitfield mask )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->driDrawable;
@@ -409,6 +408,7 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint i;
GLint ret;
GLuint depthmask = 0;
+ GLint cx, cy, cw, ch;
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s:\n", __FUNCTION__ );
@@ -453,12 +453,18 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
if ( flags ) {
+ LOCK_HARDWARE( rmesa );
+
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* 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 ) {
@@ -471,7 +477,8 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_clip_rect_t *b = rmesa->sarea->boxes;
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
@@ -493,6 +500,7 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
@@ -532,7 +540,7 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
}
diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c
index 25e57133cc3..85798c16013 100644
--- a/src/mesa/drivers/dri/r128/r128_span.c
+++ b/src/mesa/drivers/dri/r128/r128_span.c
@@ -209,7 +209,7 @@ do { \
*/
#define WRITE_DEPTH_SPAN() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint i; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
r128scrn->spanOffset); \
@@ -228,7 +228,7 @@ do { \
#define WRITE_DEPTH_PIXELS() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint ox[MAX_WIDTH]; \
GLint oy[MAX_WIDTH]; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
@@ -309,7 +309,7 @@ do { \
*/
#define WRITE_STENCIL_SPAN() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint i; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
r128scrn->spanOffset); \
@@ -328,7 +328,7 @@ do { \
#define WRITE_STENCIL_PIXELS() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint ox[MAX_WIDTH]; \
GLint oy[MAX_WIDTH]; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c
index 491f288ffb2..1bfd3709377 100644
--- a/src/mesa/drivers/dri/r128/r128_state.c
+++ b/src/mesa/drivers/dri/r128/r128_state.c
@@ -1434,19 +1434,4 @@ void r128DDInitStateFuncs( GLcontext *ctx )
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/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c
index 91737d2d33c..2920ceafd30 100644
--- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c
+++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c
@@ -107,8 +107,8 @@ void r200SetUpAtomList( r200ContextPtr rmesa )
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.spr );
+ insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.ptp );
insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.prf );
insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.pvs );
insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.vpp[0] );
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 7a8f270160f..bb7a16c9327 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -75,6 +75,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_NV_vertex_program
+#define need_GL_ARB_point_parameters
#include "extension_helper.h"
#define DRIVER_DATE "20060602"
@@ -86,21 +87,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 )
@@ -170,7 +156,7 @@ const struct dri_extension blend_extensions[] = {
{ "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 }
};
@@ -183,6 +169,12 @@ const struct dri_extension ATI_fs_extension[] = {
{ "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions }
};
+const struct dri_extension point_extensions[] = {
+ { "GL_ARB_point_sprite", NULL },
+ { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
+ { NULL, NULL }
+};
+
extern const struct tnl_pipeline_stage _r200_render_stage;
extern const struct tnl_pipeline_stage _r200_tcl_stage;
@@ -200,9 +192,9 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
&_tnl_fog_coordinate_stage,
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
+ &_tnl_point_attenuation_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)
@@ -226,13 +218,8 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
*/
static void r200InitDriverFuncs( struct dd_function_table *functions )
{
- functions->GetBufferSize = r200GetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
+ functions->GetBufferSize = NULL; /* OBSOLETE */
functions->GetString = r200GetString;
-
- functions->Error = NULL;
- functions->DrawPixels = NULL;
- functions->Bitmap = NULL;
}
static const struct dri_debug_control debug_control[] =
@@ -485,6 +472,8 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
if ((ctx->Const.MaxTextureUnits == 6) && rmesa->r200Screen->drmSupportsFragShader)
driInitSingleExtension( ctx, ATI_fs_extension );
+ if (rmesa->r200Screen->drmSupportsPointSprites)
+ driInitExtensions( ctx, point_extensions, GL_FALSE );
#if 0
r200InitDriverFuncs( ctx );
r200InitIoctlFuncs( ctx );
@@ -694,8 +683,15 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx);
if ( newCtx->dri.drawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags );
+ driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
+ &newCtx->vbl_seq );
+ }
+
+ if ( newCtx->dri.drawable != driDrawPriv ||
+ newCtx->dri.readable != driReadPriv ) {
newCtx->dri.drawable = driDrawPriv;
+ newCtx->dri.readable = driReadPriv;
+
r200UpdateWindow( newCtx->glCtx );
r200UpdateViewportOffset( newCtx->glCtx );
}
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h
index b7ee33aa6c9..fa38a78e263 100644
--- a/src/mesa/drivers/dri/r200/r200_context.h
+++ b/src/mesa/drivers/dri/r200/r200_context.h
@@ -102,10 +102,16 @@ typedef void (*r200_point_func)( r200ContextPtr,
struct r200_vertex_program {
struct gl_vertex_program mesa_program; /* Must be first */
int translated;
- VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 3];
+ /* need excess instr: 1 for late loop checking, 2 for
+ additional instr due to instr/attr, 3 for fog */
+ VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 6];
int pos_end;
int inputs[VERT_ATTRIB_MAX];
+ int rev_inputs[16];
+ int gen_inputs_mapped;
int native;
+ int fogpidx;
+ int fogmode;
};
struct r200_colorbuffer_state {
@@ -445,9 +451,29 @@ struct r200_state_atom {
/* SPR - point sprite state
*/
-#define SPR_CMD_0 0
-#define SPR_POINT_SPRITE_CNTL 1
-#define SPR_STATE_SIZE 2
+#define SPR_CMD_0 0
+#define SPR_POINT_SPRITE_CNTL 1
+#define SPR_STATE_SIZE 2
+
+#define PTP_CMD_0 0
+#define PTP_VPORT_SCALE_0 1
+#define PTP_VPORT_SCALE_1 2
+#define PTP_VPORT_SCALE_PTSIZE 3
+#define PTP_VPORT_SCALE_3 4
+#define PTP_CMD_1 5
+#define PTP_ATT_CONST_QUAD 6
+#define PTP_ATT_CONST_LIN 7
+#define PTP_ATT_CONST_CON 8
+#define PTP_ATT_CONST_3 9
+#define PTP_EYE_X 10
+#define PTP_EYE_Y 11
+#define PTP_EYE_Z 12
+#define PTP_EYE_3 13
+#define PTP_CLAMP_MIN 14
+#define PTP_CLAMP_MAX 15
+#define PTP_CLAMP_2 16
+#define PTP_CLAMP_3 17
+#define PTP_STATE_SIZE 18
#define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
R200_VTX_COLOR_MASK)
@@ -614,6 +640,7 @@ struct r200_hw_state {
struct r200_state_atom vpp[2];
struct r200_state_atom atf;
struct r200_state_atom spr;
+ struct r200_state_atom ptp;
int max_state_size; /* Number of bytes necessary for a full state emit. */
GLboolean is_dirty, all_dirty;
@@ -674,6 +701,7 @@ struct r200_dri_mirror {
__DRIcontextPrivate *context; /* DRI context */
__DRIscreenPrivate *screen; /* DRI screen */
__DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
+ __DRIdrawablePrivate *readable; /* DRI readable bound to this ctx */
drm_context_t hwContext;
drm_hw_lock_t *hwLock;
@@ -700,8 +728,8 @@ struct r200_tcl_info {
GLint last_offset;
GLuint hw_primitive;
-/* FIXME: what's the maximum number of components? */
- struct r200_dma_region *aos_components[11];
+/* hw can handle 12 components max */
+ struct r200_dma_region *aos_components[12];
GLuint nr_aos_components;
GLuint *Elts;
@@ -713,6 +741,7 @@ struct r200_tcl_info {
struct r200_dma_region fog;
struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS];
struct r200_dma_region norm;
+ struct r200_dma_region generic[16];
};
diff --git a/src/mesa/drivers/dri/r200/r200_fragshader.c b/src/mesa/drivers/dri/r200/r200_fragshader.c
index 7993e3015a4..5dd3adaef69 100644
--- a/src/mesa/drivers/dri/r200/r200_fragshader.c
+++ b/src/mesa/drivers/dri/r200/r200_fragshader.c
@@ -132,10 +132,10 @@ static void r200UpdateFSArith( GLcontext *ctx )
R200_STATECHANGE( rmesa, afs[1] );
if (shader->NumPasses < 2) {
- afs_cmd = rmesa->hw.afs[1].cmd;
+ afs_cmd = (GLuint *) rmesa->hw.afs[1].cmd;
}
else {
- afs_cmd = rmesa->hw.afs[0].cmd;
+ afs_cmd = (GLuint *) rmesa->hw.afs[0].cmd;
}
for (pass = 0; pass < shader->NumPasses; pass++) {
GLuint opnum = 0;
@@ -317,7 +317,7 @@ static void r200UpdateFSArith( GLcontext *ctx )
SET_INST(opnum, 1), SET_INST_2(opnum, 1));*/
opnum++;
}
- afs_cmd = rmesa->hw.afs[1].cmd;
+ afs_cmd = (GLuint *) rmesa->hw.afs[1].cmd;
}
rmesa->afs_loaded = ctx->ATIFragmentShader.Current;
}
@@ -362,7 +362,7 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
if (shader->NumPasses < 2) {
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current;
+ GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled;
R200_STATECHANGE( rmesa, tex[reg] );
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = 0;
if (shader->SetupInst[0][reg].Opcode) {
@@ -385,15 +385,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_x |= R200_TEXCOORD_PROJ;
}
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
- else if (texObj->Target == GL_TEXTURE_3D) {
+ else if (targetbit == TEXTURE_3D_BIT) {
txformat_x |= R200_TEXCOORD_VOLUME;
}
- else if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+ else if (targetbit == TEXTURE_CUBE_BIT) {
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
- shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
+ shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
txformat_x |= R200_TEXCOORD_NONPROJ;
}
else {
@@ -401,16 +402,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
- /* is this a good idea? Could potentially sample from not enabled unit.
- results are probably undefined anyway (?) but I hope it doesn't lock up... */
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
+ /* enabling texturing when unit isn't correctly configured may not be safe */
+ if (targetbit)
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
} else {
/* setup 1st pass */
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current;
+ GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled;
R200_STATECHANGE( rmesa, tex[reg] );
GLuint txformat_multi = 0;
if (shader->SetupInst[0][reg].Opcode) {
@@ -425,11 +426,12 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_multi |= R200_PASS1_TEXCOORD_PROJ;
}
+ rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
- else if (texObj->Target == GL_TEXTURE_3D) {
+ else if (targetbit == TEXTURE_3D_BIT) {
txformat_multi |= R200_PASS1_TEXCOORD_VOLUME;
}
- else if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+ else if (targetbit == TEXTURE_CUBE_BIT) {
txformat_multi |= R200_PASS1_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
@@ -439,14 +441,15 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_multi |= R200_PASS1_TEXCOORD_PROJ;
}
- rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
+ if (targetbit)
+ rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = txformat_multi;
}
/* setup 2nd pass */
for (reg=0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current;
+ GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled;
if (shader->SetupInst[1][reg].Opcode) {
GLuint coord = shader->SetupInst[1][reg].src;
GLuint txformat = rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT]
@@ -463,15 +466,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_x |= R200_TEXCOORD_PROJ;
}
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
- else if (texObj->Target == GL_TEXTURE_3D) {
+ else if (targetbit == TEXTURE_3D_BIT) {
txformat_x |= R200_TEXCOORD_VOLUME;
}
- else if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+ else if (targetbit == TEXTURE_CUBE_BIT) {
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STR_ATI ||
- shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
+ shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
txformat_x |= R200_TEXCOORD_NONPROJ;
}
else {
@@ -488,7 +492,8 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
+ if (targetbit)
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
}
diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c
index 650d7cfdf2b..463bd64415b 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c
@@ -605,18 +605,17 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv )
/* ================================================================
* Buffer clear
*/
-static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void r200Clear( GLcontext *ctx, GLbitfield mask )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
GLuint flags = 0;
GLuint color_mask = 0;
GLint ret, i;
+ GLint cx, cy, cw, ch;
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 );
+ fprintf( stderr, "r200Clear\n");
}
{
@@ -653,7 +652,7 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
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 );
+ _swrast_Clear( ctx, mask );
}
if ( !flags )
@@ -670,12 +669,18 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
}
+ LOCK_HARDWARE( rmesa );
+
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* 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 ) {
@@ -717,7 +722,8 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
@@ -739,6 +745,7 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
n++;
}
} else {
+ /* clear whole window */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c
index 66bb075864f..bcc0c916396 100644
--- a/src/mesa/drivers/dri/r200/r200_lock.c
+++ b/src/mesa/drivers/dri/r200/r200_lock.c
@@ -69,7 +69,8 @@ r200UpdatePageFlipping( r200ContextPtr rmesa )
*/
void r200GetLock( r200ContextPtr rmesa, GLuint flags )
{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ __DRIdrawablePrivate *drawable = rmesa->dri.drawable;
+ __DRIdrawablePrivate *readable = rmesa->dri.readable;
__DRIscreenPrivate *sPriv = rmesa->dri.screen;
drm_radeon_sarea_t *sarea = rmesa->sarea;
int i;
@@ -84,17 +85,20 @@ void r200GetLock( r200ContextPtr rmesa, GLuint flags )
* 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 );
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable );
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable );
+ }
- if ( rmesa->lastStamp != dPriv->lastStamp ) {
+ if ( rmesa->lastStamp != drawable->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 );
- driUpdateFramebufferSize(rmesa->glCtx, dPriv);
- rmesa->lastStamp = dPriv->lastStamp;
+ driUpdateFramebufferSize(rmesa->glCtx, drawable);
+ rmesa->lastStamp = drawable->lastStamp;
}
R200_STATECHANGE( rmesa, ctx );
diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
index 12ea462a400..39c1f68911f 100644
--- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
@@ -385,8 +385,16 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
GLuint vfmt0 = 0, vfmt1 = 0;
GLuint count = VB->Count;
GLuint i;
-
- if (1) {
+ GLuint generic_in_mapped = 0;
+ struct r200_vertex_program *vp = NULL;
+
+ /* this looks way more complicated than necessary... */
+ if (ctx->VertexProgram._Enabled) {
+ vp = rmesa->curr_vp_hw;
+ generic_in_mapped = vp->gen_inputs_mapped;
+ }
+
+ if (inputs & VERT_BIT_POS) {
if (!rmesa->tcl.obj.buf)
emit_vector( ctx,
&rmesa->tcl.obj,
@@ -404,7 +412,19 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
}
component[nr++] = &rmesa->tcl.obj;
}
-
+ else if (generic_in_mapped & (1 << 0)) {
+ int geninput = vp->rev_inputs[0] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_W0 | R200_VTX_Z0;
+ }
if (inputs & VERT_BIT_NORMAL) {
if (!rmesa->tcl.norm.buf)
@@ -420,12 +440,21 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
}
if (inputs & VERT_BIT_FOG) {
- if (!rmesa->tcl.fog.buf)
- emit_vecfog( ctx,
- &(rmesa->tcl.fog),
- (char *)VB->FogCoordPtr->data,
- VB->FogCoordPtr->stride,
- count);
+ if (!rmesa->tcl.fog.buf) {
+ if (ctx->VertexProgram._Enabled)
+ emit_vector( ctx,
+ &(rmesa->tcl.fog),
+ (char *)VB->FogCoordPtr->data,
+ 1,
+ VB->FogCoordPtr->stride,
+ count);
+ else
+ emit_vecfog( ctx,
+ &(rmesa->tcl.fog),
+ (char *)VB->FogCoordPtr->data,
+ VB->FogCoordPtr->stride,
+ count);
+ }
vfmt0 |= R200_VTX_DISCRETE_FOG;
component[nr++] = &rmesa->tcl.fog;
@@ -455,6 +484,23 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
component[nr++] = &rmesa->tcl.rgba;
}
+/* vfmt0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT;
+ emit_ubyte_rgba( ctx, &rmesa->tcl.rgba,
+ (char *)VB->ColorPtr[0]->data, 4,
+ VB->ColorPtr[0]->stride, count);*/
+ else if (generic_in_mapped & (1 << 2)) {
+ int geninput = vp->rev_inputs[2] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
+ }
if (inputs & VERT_BIT_COLOR1) {
@@ -472,8 +518,49 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
vfmt0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_1_SHIFT;
component[nr++] = &rmesa->tcl.spec;
}
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
+ else if (generic_in_mapped & (1 << 3)) {
+ int geninput = vp->rev_inputs[3] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT;
+ }
+
+ if (generic_in_mapped & (1 << 4)) {
+ int geninput = vp->rev_inputs[4] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_2_SHIFT;
+ }
+
+ if (generic_in_mapped & (1 << 5)) {
+ int geninput = vp->rev_inputs[5] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_3_SHIFT;
+ }
+
+ for ( i = 0 ; i < 6 ; i++ ) {
if (inputs & (VERT_BIT_TEX0 << i)) {
if (!rmesa->tcl.tex[i].buf)
emit_vector( ctx,
@@ -486,8 +573,82 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
vfmt1 |= VB->TexCoordPtr[i]->size << (i * 3);
component[nr++] = &rmesa->tcl.tex[i];
}
+ else if (generic_in_mapped & (1 << (i + 6))) {
+ int geninput = vp->rev_inputs[i + 6] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt1 |= 4 << (R200_VTX_TEX0_COMP_CNT_SHIFT + (i * 3));
+ }
}
+ if (generic_in_mapped & (1 << 13)) {
+ int geninput = vp->rev_inputs[13] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_XY1 | R200_VTX_Z1 | R200_VTX_W1;
+ }
+
+/* doesn't work. Wrong order with mixed generic & conventional! */
+/*
+ if (ctx->VertexProgram._Enabled) {
+ int *vp_inputs = rmesa->curr_vp_hw->inputs;
+ for ( i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++ ) {
+ if (inputs & (1 << i)) {
+ int geninput = i - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[i]->data,
+ 4,
+ VB->AttribPtr[i]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ switch (vp_inputs[i]) {
+ case 0:
+ vfmt0 |= R200_VTX_W0 | R200_VTX_Z0;
+ break;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ vfmt0 |= R200_VTX_FP_RGBA << (R200_VTX_COLOR_0_SHIFT + (vp_inputs[i] - 2) * 2);
+ break;
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ vfmt1 |= 4 << (R200_VTX_TEX0_COMP_CNT_SHIFT + (vp_inputs[i] - 6) * 3);
+ break;
+ case 13:
+ vfmt0 |= R200_VTX_XY1 | R200_VTX_Z1 | R200_VTX_W1;
+ break;
+ case 1:
+ case 12:
+ default:
+ assert(0);
+ }
+ }
+ }
+ }
+*/
+
if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] ||
vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) {
R200_STATECHANGE( rmesa, vtx );
@@ -513,7 +674,7 @@ void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
if (newinputs & VERT_BIT_NORMAL)
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ );
-
+
if (newinputs & VERT_BIT_FOG)
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.fog, __FUNCTION__ );
@@ -527,4 +688,14 @@ void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
if (newinputs & VERT_BIT_TEX(unit))
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[unit], __FUNCTION__ );
}
+
+ if (ctx->VertexProgram._Enabled) {
+ int i;
+ for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
+ if (newinputs & (1 << i))
+ r200ReleaseDmaRegion( rmesa,
+ &rmesa->tcl.generic[i - VERT_ATTRIB_GENERIC0], __FUNCTION__ );
+ }
+ }
+
}
diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c
index 1f711bbee5a..7b060f9cf0d 100644
--- a/src/mesa/drivers/dri/r200/r200_pixel.c
+++ b/src/mesa/drivers/dri/r200/r200_pixel.c
@@ -482,14 +482,6 @@ r200Bitmap( GLcontext *ctx, GLint px, GLint py,
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")) {
ctx->Driver.ReadPixels = r200ReadPixels;
ctx->Driver.DrawPixels = r200DrawPixels;
diff --git a/src/mesa/drivers/dri/r200/r200_reg.h b/src/mesa/drivers/dri/r200/r200_reg.h
index dab08a9eb73..a88ea4cec26 100644
--- a/src/mesa/drivers/dri/r200/r200_reg.h
+++ b/src/mesa/drivers/dri/r200/r200_reg.h
@@ -250,6 +250,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define R200_ZBIAS_ENABLE_LINE (1 << 17)
#define R200_ZBIAS_ENABLE_TRI (1 << 18)
#define R200_WIDELINE_ENABLE (1 << 20)
+#define R200_DISC_FOG_SHADE_SOLID (0 << 24)
+#define R200_DISC_FOG_SHADE_FLAT (1 << 24)
+#define R200_DISC_FOG_SHADE_GOURAUD (2 << 24)
+#define R200_DISC_FOG_SHADE_MASK (3 << 24)
#define R200_VTX_PIX_CENTER_D3D (0 << 27)
#define R200_VTX_PIX_CENTER_OGL (1 << 27)
#define R200_ROUND_MODE_TRUNC (0 << 28)
@@ -659,7 +663,25 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#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)
+#define R200_PS_MULT_PVATTENCONST (0<<0)
+#define R200_PS_MULT_PVATTEN (1<<0)
+#define R200_PS_MULT_ATTENCONST (2<<0)
+#define R200_PS_MULT_PVCONST (3<<0)
+#define R200_PS_MULT_CONST (4<<0)
+#define R200_PS_MULT_MASK (7<<0)
+#define R200_PS_LIN_ATT_ZERO (1<<3)
+#define R200_PS_USE_MODEL_EYE_VEC (1<<4)
+#define R200_PS_ATT_ALPHA (1<<5)
+#define R200_PS_UCP_MODE_MASK (3<<6)
+#define R200_PS_GEN_TEX_0 (1<<8)
+#define R200_PS_GEN_TEX_1 (1<<9)
+#define R200_PS_GEN_TEX_2 (1<<10)
+#define R200_PS_GEN_TEX_3 (1<<11)
+#define R200_PS_GEN_TEX_4 (1<<12)
+#define R200_PS_GEN_TEX_5 (1<<13)
+#define R200_PS_GEN_TEX_0_SHIFT (8)
+#define R200_PS_GEN_TEX_MASK (0x3f<<8)
+#define R200_PS_SE_SEL_STATE (1<<16)
/* gap */
/* taken from r300, see comments there */
#define R200_VAP_PVS_CNTL_1 0x22d0
diff --git a/src/mesa/drivers/dri/r200/r200_sanity.c b/src/mesa/drivers/dri/r200/r200_sanity.c
index ca5b926a944..3f2a8665309 100644
--- a/src/mesa/drivers/dri/r200/r200_sanity.c
+++ b/src/mesa/drivers/dri/r200/r200_sanity.c
@@ -978,7 +978,7 @@ static int radeon_emit_veclinear(
}
}
else if ((start >= 0x180) && (start < 0x1c0)) {
- for (i = start ; (i < start + sz) ; i += 4) {
+ for (i = 0 ; i < sz ; i += 4) {
fprintf(stderr, "R200_VS_PROG %d OPDST %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i]);
fprintf(stderr, "R200_VS_PROG %d SRC1 %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i+1]);
fprintf(stderr, "R200_VS_PROG %d SRC2 %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i+2]);
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index ac9e20e28ad..dc1fbef72ee 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "enums.h"
#include "colormac.h"
#include "light.h"
+#include "framebuffer.h"
#include "swrast/swrast.h"
#include "array_cache/acache.h"
@@ -490,7 +491,7 @@ static void r200Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
GLuint fog = rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR];
fog &= ~R200_FOG_USE_MASK;
- if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
+ if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD || ctx->VertexProgram.Enabled) {
fog |= R200_FOG_USE_VTX_FOG;
out_0 |= R200_VTX_DISCRETE_FOG;
}
@@ -686,10 +687,80 @@ static void r200FrontFace( GLcontext *ctx, GLenum mode )
static void r200PointSize( GLcontext *ctx, GLfloat size )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat *fcmd = (GLfloat *)rmesa->hw.ptp.cmd;
R200_STATECHANGE( rmesa, cst );
+ R200_STATECHANGE( rmesa, ptp );
rmesa->hw.cst.cmd[CST_RE_POINTSIZE] &= ~0xffff;
rmesa->hw.cst.cmd[CST_RE_POINTSIZE] |= ((GLuint)(ctx->Point.Size * 16.0));
+/* this is the size param of the point size calculation (point size reg value
+ is not used when calculation is active). */
+ fcmd[PTP_VPORT_SCALE_PTSIZE] = ctx->Point.Size;
+}
+
+static void r200PointParameter( GLcontext *ctx, GLenum pname, const GLfloat *params)
+{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat *fcmd = (GLfloat *)rmesa->hw.ptp.cmd;
+
+ switch (pname) {
+ case GL_POINT_SIZE_MIN:
+ /* Can clamp both in tcl and setup - just set both (as does fglrx) */
+ R200_STATECHANGE( rmesa, lin );
+ R200_STATECHANGE( rmesa, ptp );
+ rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] &= 0xffff;
+ rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] |= (GLuint)(ctx->Point.MinSize * 16.0) << 16;
+ fcmd[PTP_CLAMP_MIN] = ctx->Point.MinSize;
+ break;
+ case GL_POINT_SIZE_MAX:
+ R200_STATECHANGE( rmesa, cst );
+ R200_STATECHANGE( rmesa, ptp );
+ rmesa->hw.cst.cmd[CST_RE_POINTSIZE] &= 0xffff;
+ rmesa->hw.cst.cmd[CST_RE_POINTSIZE] |= (GLuint)(ctx->Point.MaxSize * 16.0) << 16;
+ fcmd[PTP_CLAMP_MAX] = ctx->Point.MaxSize;
+ break;
+ case GL_POINT_DISTANCE_ATTENUATION:
+ R200_STATECHANGE( rmesa, vtx );
+ R200_STATECHANGE( rmesa, spr );
+ R200_STATECHANGE( rmesa, ptp );
+ GLfloat *fcmd = (GLfloat *)rmesa->hw.ptp.cmd;
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &=
+ ~(R200_PS_MULT_MASK | R200_PS_LIN_ATT_ZERO | R200_PS_SE_SEL_STATE);
+ /* can't rely on ctx->Point._Attenuated here and test for NEW_POINT in
+ r200ValidateState looks like overkill */
+ if (ctx->Point.Params[0] != 1.0 ||
+ ctx->Point.Params[1] != 0.0 ||
+ ctx->Point.Params[2] != 0.0 ||
+ (ctx->VertexProgram.Enabled && ctx->VertexProgram.PointSizeEnabled)) {
+ /* all we care for vp would be the ps_se_sel_state setting */
+ fcmd[PTP_ATT_CONST_QUAD] = ctx->Point.Params[2];
+ fcmd[PTP_ATT_CONST_LIN] = ctx->Point.Params[1];
+ fcmd[PTP_ATT_CONST_CON] = ctx->Point.Params[0];
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_MULT_ATTENCONST;
+ if (ctx->Point.Params[1] == 0.0)
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_LIN_ATT_ZERO;
+/* FIXME: setting this here doesn't look quite ok - we only want to do
+ that if we're actually drawing points probably */
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_PT_SIZE;
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |= R200_VTX_POINT_SIZE;
+ }
+ else {
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |=
+ R200_PS_SE_SEL_STATE | R200_PS_MULT_CONST;
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_PT_SIZE;
+ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] &= ~R200_VTX_POINT_SIZE;
+ }
+ break;
+ case GL_POINT_FADE_THRESHOLD_SIZE:
+ /* don't support multisampling, so doesn't matter. */
+ break;
+ /* can't do these but don't need them.
+ case GL_POINT_SPRITE_R_MODE_NV:
+ case GL_POINT_SPRITE_COORD_ORIGIN: */
+ default:
+ fprintf(stderr, "bad pname parameter in r200PointParameter\n");
+ return;
+ }
}
/* =============================================================
@@ -1382,20 +1453,23 @@ static void r200ShadeModel( GLcontext *ctx, GLenum mode )
s &= ~(R200_DIFFUSE_SHADE_MASK |
R200_ALPHA_SHADE_MASK |
R200_SPECULAR_SHADE_MASK |
- R200_FOG_SHADE_MASK);
+ R200_FOG_SHADE_MASK |
+ R200_DISC_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);
+ R200_FOG_SHADE_FLAT |
+ R200_DISC_FOG_SHADE_FLAT);
break;
case GL_SMOOTH:
s |= (R200_DIFFUSE_SHADE_GOURAUD |
R200_ALPHA_SHADE_GOURAUD |
R200_SPECULAR_SHADE_GOURAUD |
- R200_FOG_SHADE_GOURAUD);
+ R200_FOG_SHADE_GOURAUD |
+ R200_DISC_FOG_SHADE_GOURAUD);
break;
default:
return;
@@ -1772,23 +1846,26 @@ static void r200LogicOpCode( GLcontext *ctx, GLenum opcode )
void r200SetCliprects( r200ContextPtr rmesa, GLenum mode )
{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const readable = rmesa->dri.readable;
+ GLframebuffer *const draw_fb = (GLframebuffer*) drawable->driverPrivate;
+ GLframebuffer *const read_fb = (GLframebuffer*) readable->driverPrivate;
switch ( mode ) {
case GL_FRONT_LEFT:
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
+ rmesa->numClipRects = drawable->numClipRects;
+ rmesa->pClipRects = drawable->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;
+ if ( drawable->numBackClipRects == 0 || rmesa->doPageFlip ) {
+ rmesa->numClipRects = drawable->numClipRects;
+ rmesa->pClipRects = drawable->pClipRects;
}
else {
- rmesa->numClipRects = dPriv->numBackClipRects;
- rmesa->pClipRects = dPriv->pBackClipRects;
+ rmesa->numClipRects = drawable->numBackClipRects;
+ rmesa->pClipRects = drawable->pBackClipRects;
}
break;
default:
@@ -1796,6 +1873,21 @@ void r200SetCliprects( r200ContextPtr rmesa, GLenum mode )
return;
}
+ if ((draw_fb->Width != drawable->w) || (draw_fb->Height != drawable->h)) {
+ _mesa_resize_framebuffer(rmesa->glCtx, draw_fb,
+ drawable->w, drawable->h);
+ draw_fb->Initialized = GL_TRUE;
+ }
+
+ if (drawable != readable) {
+ if ((read_fb->Width != readable->w) ||
+ (read_fb->Height != readable->h)) {
+ _mesa_resize_framebuffer(rmesa->glCtx, read_fb,
+ readable->w, readable->h);
+ read_fb->Initialized = GL_TRUE;
+ }
+ }
+
if (rmesa->state.scissor.enabled)
r200RecalcScissorRects( rmesa );
}
@@ -2032,6 +2124,19 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
break;
#endif
+ case GL_POINT_SPRITE_ARB:
+ R200_STATECHANGE( rmesa, spr );
+ if ( state ) {
+ int i;
+ for (i = 0; i < 6; i++) {
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |=
+ ctx->Point.CoordReplace[i] << (R200_PS_GEN_TEX_0_SHIFT + i);
+ }
+ } else {
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= ~R200_PS_GEN_TEX_MASK;
+ }
+ break;
+
case GL_POLYGON_OFFSET_FILL:
R200_STATECHANGE( rmesa, set );
if ( state ) {
@@ -2133,10 +2238,9 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(R200_UCP_ENABLE_0 << i);
}*/
}
- /* FIXME: ugly as hell. need to call everything which might change tcl_output_vtxfmt0/1 and compsel */
+ /* ugly. Need to call everything which might change compsel. */
r200UpdateSpecular( ctx );
- r200Fogfv( ctx, GL_FOG_COORD_SRC, NULL );
-#if 1
+#if 0
/* shouldn't be necessary, as it's picked up anyway in r200ValidateState (_NEW_PROGRAM),
but without it doom3 locks up at always the same places. Why? */
/* FIXME: This can (and should) be replaced by a call to the TCL_STATE_FLUSH reg before
@@ -2165,6 +2269,13 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
else {
/* picked up later */
}
+ /* call functions which change hw state based on ARB_vp enabled or not. */
+ r200PointParameter( ctx, GL_POINT_DISTANCE_ATTENUATION, NULL );
+ r200Fogfv( ctx, GL_FOG_COORD_SRC, NULL );
+ break;
+
+ case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
+ r200PointParameter( ctx, GL_POINT_DISTANCE_ATTENUATION, NULL );
break;
case GL_FRAGMENT_SHADER_ATI:
@@ -2516,6 +2627,7 @@ void r200InitStateFuncs( struct dd_function_table *functions )
functions->PolygonMode = r200PolygonMode;
functions->PolygonOffset = r200PolygonOffset;
functions->PolygonStipple = r200PolygonStipple;
+ functions->PointParameterfv = r200PointParameter;
functions->PointSize = r200PointSize;
functions->RenderMode = r200RenderMode;
functions->Scissor = r200Scissor;
@@ -2524,13 +2636,6 @@ void r200InitStateFuncs( struct dd_function_table *functions )
functions->StencilMaskSeparate = r200StencilMaskSeparate;
functions->StencilOpSeparate = r200StencilOpSeparate;
functions->Viewport = r200Viewport;
-
- /* Swrast hooks for imaging extensions:
- */
- functions->CopyColorTable = _swrast_CopyColorTable;
- functions->CopyColorSubTable = _swrast_CopyColorSubTable;
- functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
}
diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c
index ffca7ea5fa1..d95a80c7bbc 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -398,10 +398,14 @@ void r200InitState( r200ContextPtr rmesa )
else {
ALLOC_STATE( prf, never, PRF_STATE_SIZE, "PRF/performance-tri", 0 );
}
- if (rmesa->r200Screen->drmSupportsPointSprites)
+ if (rmesa->r200Screen->drmSupportsPointSprites) {
ALLOC_STATE( spr, always, SPR_STATE_SIZE, "SPR/pointsprite", 0 );
- else
+ ALLOC_STATE( ptp, tcl, PTP_STATE_SIZE, "PTP/pointparams", 0 );
+ }
+ else {
ALLOC_STATE (spr, never, SPR_STATE_SIZE, "SPR/pointsprite", 0 );
+ ALLOC_STATE (ptp, never, PTP_STATE_SIZE, "PTP/pointparams", 0 );
+ }
r200SetUpAtomList( rmesa );
@@ -546,6 +550,11 @@ void r200InitState( r200ContextPtr rmesa )
cmdvec( R200_VS_UCP_ADDR + i, 1, 4 );
}
+ rmesa->hw.ptp.cmd[PTP_CMD_0] =
+ cmdvec( R200_VS_PNT_SPRITE_VPORT_SCALE, 1, 4 );
+ rmesa->hw.ptp.cmd[PTP_CMD_1] =
+ cmdvec( R200_VS_PNT_SPRITE_ATT_CONST, 1, 12 );
+
/* Initial Harware state:
*/
rmesa->hw.ctx.cmd[CTX_PP_MISC] = (R200_ALPHA_TEST_PASS
@@ -653,6 +662,7 @@ void r200InitState( r200ContextPtr rmesa )
R200_ALPHA_SHADE_GOURAUD |
R200_SPECULAR_SHADE_GOURAUD |
R200_FOG_SHADE_GOURAUD |
+ R200_DISC_FOG_SHADE_GOURAUD |
R200_VTX_PIX_CENTER_OGL |
R200_ROUND_MODE_TRUNC |
R200_ROUND_PREC_8TH_PIX);
@@ -931,7 +941,31 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.eye.cmd[EYE_Z] = IEEE_ONE;
rmesa->hw.eye.cmd[EYE_RESCALE_FACTOR] = IEEE_ONE;
- rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] = R200_POINTSIZE_SEL_STATE;
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] =
+ R200_PS_SE_SEL_STATE | R200_PS_MULT_CONST;
+
+ /* ptp_eye is presumably used to calculate the attenuation wrt a different
+ location? In any case, since point attenuation triggers _needeyecoords,
+ it is constant. Probably ignored as long as R200_PS_USE_MODEL_EYE_VEC
+ isn't set */
+ rmesa->hw.ptp.cmd[PTP_EYE_X] = 0;
+ rmesa->hw.ptp.cmd[PTP_EYE_Y] = 0;
+ rmesa->hw.ptp.cmd[PTP_EYE_Z] = IEEE_ONE | 0x80000000; /* -1.0 */
+ rmesa->hw.ptp.cmd[PTP_EYE_3] = 0;
+ /* no idea what the ptp_vport_scale values are good for, except the
+ PTSIZE one - hopefully doesn't matter */
+ rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_0] = IEEE_ONE;
+ rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_1] = IEEE_ONE;
+ rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_PTSIZE] = IEEE_ONE;
+ rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_3] = IEEE_ONE;
+ rmesa->hw.ptp.cmd[PTP_ATT_CONST_QUAD] = 0;
+ rmesa->hw.ptp.cmd[PTP_ATT_CONST_LIN] = 0;
+ rmesa->hw.ptp.cmd[PTP_ATT_CONST_CON] = IEEE_ONE;
+ rmesa->hw.ptp.cmd[PTP_ATT_CONST_3] = 0;
+ rmesa->hw.ptp.cmd[PTP_CLAMP_MIN] = IEEE_ONE;
+ rmesa->hw.ptp.cmd[PTP_CLAMP_MAX] = 0x44ffe000; /* 2047 */
+ rmesa->hw.ptp.cmd[PTP_CLAMP_2] = 0;
+ rmesa->hw.ptp.cmd[PTP_CLAMP_3] = 0;
r200LightingSpaceChange( ctx );
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c
index aa78f382868..c14a275f7a3 100644
--- a/src/mesa/drivers/dri/r200/r200_swtcl.c
+++ b/src/mesa/drivers/dri/r200/r200_swtcl.c
@@ -117,6 +117,11 @@ static void r200SetVertexFormat( GLcontext *ctx )
offset = 3;
}
+ if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) {
+ EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, R200_VTX_POINT_SIZE );
+ offset += 1;
+ }
+
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) );
@@ -349,7 +354,9 @@ static INLINE GLuint reduced_hw_prim( GLcontext *ctx, GLuint prim)
{
switch (prim) {
case GL_POINTS:
- return (ctx->_TriangleCaps & DD_POINT_SIZE) ?
+ return (ctx->Point.PointSprite ||
+ ((ctx->_TriangleCaps & (DD_POINT_SIZE | DD_POINT_ATTEN)) &&
+ !(ctx->_TriangleCaps & (DD_POINT_SMOOTH)))) ?
R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS;
case GL_LINES:
/* fallthrough */
@@ -632,6 +639,17 @@ static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim )
r200ContextPtr rmesa = R200_CONTEXT(ctx);
if (rmesa->swtcl.hw_primitive != hwprim) {
+ /* need to disable perspective-correct texturing for point sprites */
+ if ((hwprim & 0xf) == R200_VF_PRIM_POINT_SPRITES && ctx->Point.PointSprite) {
+ if (rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_PERSPECTIVE_ENABLE;
+ }
+ }
+ else if (!(rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE)) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_PERSPECTIVE_ENABLE;
+ }
R200_NEWPRIM( rmesa );
rmesa->swtcl.hw_primitive = hwprim;
}
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index 18b5458a97b..86edf7132ce 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -68,7 +68,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define HAVE_ELTS 1
-#define HW_POINTS ((ctx->_TriangleCaps & DD_POINT_SIZE) ? \
+#define HW_POINTS ((ctx->Point.PointSprite || \
+ ((ctx->_TriangleCaps & (DD_POINT_SIZE | DD_POINT_ATTEN)) && \
+ !(ctx->_TriangleCaps & (DD_POINT_SMOOTH)))) ? \
R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS)
#define HW_LINES R200_VF_PRIM_LINES
#define HW_LINE_LOOP 0
@@ -268,6 +270,17 @@ void r200TclPrimitive( GLcontext *ctx,
if (newprim != rmesa->tcl.hw_primitive ||
!discrete_prim[hw_prim&0xf]) {
+ /* need to disable perspective-correct texturing for point sprites */
+ if ((prim & PRIM_MODE_MASK) == GL_POINTS && ctx->Point.PointSprite) {
+ if (rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_PERSPECTIVE_ENABLE;
+ }
+ }
+ else if (!(rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE)) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_PERSPECTIVE_ENABLE;
+ }
R200_NEWPRIM( rmesa );
rmesa->tcl.hw_primitive = newprim;
}
@@ -371,7 +384,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
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 inputs = 0;
GLuint i;
/* TODO: separate this from the swtnl pipeline
@@ -391,6 +404,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
r200ValidateState( ctx );
if (!ctx->VertexProgram._Enabled) {
+ inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
/* NOTE: inputs != tnl->render_inputs - these are the untransformed
* inputs.
*/
@@ -416,60 +430,43 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
}
}
else {
- GLuint out_vtxfmt0 = 0;
- GLuint out_vtxfmt1 = 0;
+ /* vtx_tcl_output_vtxfmt_0/1 need to match configuration of "fragment
+ part", since using some vertex interpolator later which is not in
+ out_vtxfmt0/1 will lock up. It seems to be ok to write in vertex
+ prog to a not enabled output however, so just don't mess with it.
+ We only need to change compsel. */
GLuint out_compsel = 0;
GLuint vp_out = rmesa->curr_vp_hw->mesa_program.Base.OutputsWritten;
+#if 0
/* can't handle other inputs, generic attribs etc. currently - should never arrive here */
assert ((rmesa->curr_vp_hw->mesa_program.Base.InputsRead &
~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 |
VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 |
VERT_BIT_TEX3 | VERT_BIT_TEX4 | VERT_BIT_TEX5)) == 0);
+#endif
inputs |= rmesa->curr_vp_hw->mesa_program.Base.InputsRead;
- /* FIXME: this is a mess. Not really sure how to set up TCL_OUTPUT_VTXFMT
- in "undefined" cases (e.g. output needed later but not written by vertex program or vice versa)
- - however misconfiguration here will almost certainly lock up the chip.
- I think at the very least we need to enable tcl outputs which we write to. Maybe even need to
- fix up a vertex program so an output needed later always gets written?
- For now just set the compsel and output_vtxfmt to the outputs written.
- However, for simplicity we assume always all 4 values are written which may not be correct
- (but I don't know if it could lead to lockups). */
assert(vp_out & (1 << VERT_RESULT_HPOS));
- out_vtxfmt0 = R200_VTX_XY | R200_VTX_Z0 | R200_VTX_W0;
- /* FIXME: need to always enable color_0 otherwise doom3's shadow vp (?) will lock up (?) */
- out_vtxfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
out_compsel = R200_OUTPUT_XYZW;
if (vp_out & (1 << VERT_RESULT_COL0)) {
- out_vtxfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
out_compsel |= R200_OUTPUT_COLOR_0;
}
if (vp_out & (1 << VERT_RESULT_COL1)) {
- out_vtxfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT;
out_compsel |= R200_OUTPUT_COLOR_1;
}
- /* FIXME: probably not everything is set up for fogc and psiz to work correctly */
if (vp_out & (1 << VERT_RESULT_FOGC)) {
- out_vtxfmt0 |= R200_VTX_DISCRETE_FOG;
out_compsel |= R200_OUTPUT_DISCRETE_FOG;
}
if (vp_out & (1 << VERT_RESULT_PSIZ)) {
- out_vtxfmt0 |= R200_VTX_POINT_SIZE;
out_compsel |= R200_OUTPUT_PT_SIZE;
}
for (i = VERT_RESULT_TEX0; i < VERT_RESULT_TEX6; i++) {
if (vp_out & (1 << i)) {
- out_vtxfmt1 |= 4 << ((i - VERT_RESULT_TEX0) * 3);
out_compsel |= R200_OUTPUT_TEX_0 << (i - VERT_RESULT_TEX0);
}
}
- if ((rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] != out_vtxfmt0) ||
- (rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] != out_vtxfmt1) ||
- (rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] != out_compsel)) {
+ if (rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] != out_compsel) {
R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] = out_vtxfmt0;
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] = out_vtxfmt1;
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = out_compsel;
- /* FIXME: should restore this when disabling vertex programs maybe? */
}
}
@@ -583,7 +580,7 @@ static void transition_to_hwtnl( GLcontext *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;
diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c
index 3d259c2ca66..6c6450c681f 100644
--- a/src/mesa/drivers/dri/r200/r200_tex.c
+++ b/src/mesa/drivers/dri/r200/r200_tex.c
@@ -115,7 +115,7 @@ static void r200SetTexWrap( r200TexObjPtr t, GLenum swrap, GLenum twrap, GLenum
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;
+ t->pp_txfilter |= R200_CLAMP_T_CLAMP_GL;
is_clamp_to_border = GL_TRUE;
break;
case GL_MIRRORED_REPEAT:
@@ -305,6 +305,27 @@ static r200TexObjPtr r200AllocTexObj( struct gl_texture_object *texObj )
return t;
}
+/* try to find a format which will only need a memcopy */
+static const struct gl_texture_format *
+r200Choose8888TexFormat( GLenum srcFormat, GLenum srcType )
+{
+ const GLuint ui = 1;
+ const GLubyte littleEndian = *((const GLubyte *) &ui);
+
+ if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
+ return &_mesa_texformat_rgba8888;
+ }
+ else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
+ return &_mesa_texformat_rgba8888_rev;
+ }
+ else return _dri_texformat_argb8888;
+}
static const struct gl_texture_format *
r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
@@ -332,7 +353,8 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
return _dri_texformat_argb1555;
default:
- return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_argb4444;
+ return do32bpt ?
+ r200Choose8888TexFormat(format, type) : _dri_texformat_argb4444;
}
case 3:
@@ -349,7 +371,7 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_UNSIGNED_SHORT_5_6_5_REV:
return _dri_texformat_rgb565;
default:
- return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565;
+ return do32bpt ? _dri_texformat_argb8888 : _dri_texformat_rgb565;
}
case GL_RGBA8:
@@ -357,7 +379,7 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGBA12:
case GL_RGBA16:
return !force16bpt ?
- _dri_texformat_rgba8888 : _dri_texformat_argb4444;
+ r200Choose8888TexFormat(format, type) : _dri_texformat_argb4444;
case GL_RGBA4:
case GL_RGBA2:
@@ -370,7 +392,7 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return !force16bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565;
+ return !force16bpt ? _dri_texformat_argb8888 : _dri_texformat_rgb565;
case GL_RGB5:
case GL_RGB4:
@@ -383,7 +405,9 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_ALPHA12:
case GL_ALPHA16:
case GL_COMPRESSED_ALPHA:
- return _dri_texformat_a8;
+ /* can't use a8 format since interpreting hw I8 as a8 would result
+ in wrong rgb values (same as alpha value instead of 0). */
+ return _dri_texformat_al88;
case 1:
case GL_LUMINANCE:
@@ -983,7 +1007,16 @@ static void r200TexEnv( GLcontext *ctx, GLenum target,
}
break;
}
-
+ case GL_COORD_REPLACE_ARB:
+ if (ctx->Point.PointSprite) {
+ R200_STATECHANGE( rmesa, spr );
+ if ((GLenum)param[0]) {
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_GEN_TEX_0 << unit;
+ } else {
+ rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= ~(R200_PS_GEN_TEX_0 << unit);
+ }
+ }
+ break;
default:
return;
}
diff --git a/src/mesa/drivers/dri/r200/r200_texmem.c b/src/mesa/drivers/dri/r200/r200_texmem.c
index 14ee8238ad8..28988c97556 100644
--- a/src/mesa/drivers/dri/r200/r200_texmem.c
+++ b/src/mesa/drivers/dri/r200/r200_texmem.c
@@ -374,6 +374,10 @@ static void uploadSubImage( r200ContextPtr rmesa, r200TexObjPtr t,
tex.height = imageHeight;
tex.width = imageWidth;
tex.format = t->pp_txformat & R200_TXFORMAT_FORMAT_MASK;
+ if (tex.format == R200_TXFORMAT_ABGR8888) {
+ /* drm will refuse abgr8888 textures. */
+ tex.format = R200_TXFORMAT_ARGB8888;
+ }
tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1);
tex.offset += tmp.x & ~1023;
tmp.x = tmp.x % 1024;
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index 433bc67e3f3..875d3bab73f 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -71,14 +71,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _INVALID(f) \
[ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 }
#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5) \
- && (tx_table[f].format != 0xffffffff) )
+ && (tx_table_le[f].format != 0xffffffff) )
static const struct {
GLuint format, filter;
}
-tx_table[] =
+tx_table_be[] =
{
- _ALPHA(RGBA8888),
+ [ MESA_FORMAT_RGBA8888 ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
_ALPHA_REV(RGBA8888),
_ALPHA(ARGB8888),
_ALPHA_REV(ARGB8888),
@@ -105,6 +105,38 @@ tx_table[] =
_ALPHA(RGBA_DXT5),
};
+static const struct {
+ GLuint format, filter;
+}
+tx_table_le[] =
+{
+ _ALPHA(RGBA8888),
+ [ MESA_FORMAT_RGBA8888_REV ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ _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
@@ -129,6 +161,8 @@ static void r200SetTexImages( r200ContextPtr rmesa,
GLint i, texelBytes;
GLint numLevels;
GLint log2Width, log2Height, log2Depth;
+ const GLuint ui = 1;
+ const GLubyte littleEndian = *((const GLubyte *) &ui);
/* Set the hardware texture format
*/
@@ -138,8 +172,14 @@ static void r200SetTexImages( r200ContextPtr rmesa,
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;
+ if (littleEndian) {
+ t->pp_txformat |= tx_table_le[ baseImage->TexFormat->MesaFormat ].format;
+ t->pp_txfilter |= tx_table_le[ baseImage->TexFormat->MesaFormat ].filter;
+ }
+ else {
+ t->pp_txformat |= tx_table_be[ baseImage->TexFormat->MesaFormat ].format;
+ t->pp_txfilter |= tx_table_be[ baseImage->TexFormat->MesaFormat ].filter;
+ }
}
else {
_mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);
@@ -1138,7 +1178,7 @@ static void import_tex_obj_state( r200ContextPtr rmesa,
r200TexObjPtr texobj )
{
/* do not use RADEON_DB_STATE to avoid stale texture caches */
- GLuint *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
+ int *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
R200_STATECHANGE( rmesa, tex[unit] );
@@ -1159,7 +1199,7 @@ static void import_tex_obj_state( r200ContextPtr rmesa,
}
if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) {
- GLuint *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
+ int *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
GLuint bytesPerFace = texobj->base.totalSize / 6;
ASSERT(texobj->base.totalSize % 6 == 0);
@@ -1216,6 +1256,47 @@ static void set_texgen_matrix( r200ContextPtr rmesa,
}
+static GLuint r200_need_dis_texgen(const GLbitfield texGenEnabled,
+ const GLfloat *planeS,
+ const GLfloat *planeT,
+ const GLfloat *planeR,
+ const GLfloat *planeQ)
+{
+ GLuint needtgenable = 0;
+
+ if (!(texGenEnabled & S_BIT)) {
+ if (((texGenEnabled & T_BIT) && planeT[0] != 0.0) ||
+ ((texGenEnabled & R_BIT) && planeR[0] != 0.0) ||
+ ((texGenEnabled & Q_BIT) && planeQ[0] != 0.0)) {
+ needtgenable |= S_BIT;
+ }
+ }
+ if (!(texGenEnabled & T_BIT)) {
+ if (((texGenEnabled & S_BIT) && planeS[1] != 0.0) ||
+ ((texGenEnabled & R_BIT) && planeR[1] != 0.0) ||
+ ((texGenEnabled & Q_BIT) && planeQ[1] != 0.0)) {
+ needtgenable |= T_BIT;
+ }
+ }
+ if (!(texGenEnabled & R_BIT)) {
+ if (((texGenEnabled & S_BIT) && planeS[2] != 0.0) ||
+ ((texGenEnabled & T_BIT) && planeT[2] != 0.0) ||
+ ((texGenEnabled & Q_BIT) && planeQ[2] != 0.0)) {
+ needtgenable |= R_BIT;
+ }
+ }
+ if (!(texGenEnabled & Q_BIT)) {
+ if (((texGenEnabled & S_BIT) && planeS[3] != 0.0) ||
+ ((texGenEnabled & T_BIT) && planeT[3] != 0.0) ||
+ ((texGenEnabled & R_BIT) && planeR[3] != 0.0)) {
+ needtgenable |= Q_BIT;
+ }
+ }
+
+ return needtgenable;
+}
+
+
/*
* Returns GL_FALSE if fallback required.
*/
@@ -1285,28 +1366,72 @@ static GLboolean r200_validate_texgen( GLcontext *ctx, GLuint unit )
return GL_FALSE;
}
+/* we CANNOT do mixed mode if the texgen mode requires a plane where the input
+ is not enabled for texgen, since the planes are concatenated into texmat,
+ and thus the input will come from texcoord rather than tex gen equation!
+ Either fallback or just hope that those texcoords aren't really needed...
+ Assuming the former will cause lots of unnecessary fallbacks, the latter will
+ generate bogus results sometimes - it's pretty much impossible to really know
+ when a fallback is needed, depends on texmat and what sort of texture is bound
+ etc, - for now fallback if we're missing either S or T bits, there's a high
+ probability we need the texcoords in that case.
+ That's a lot of work for some obscure texgen mixed mode fixup - why oh why
+ doesn't the chip just directly accept the plane parameters :-(. */
switch (mode) {
- case GL_OBJECT_LINEAR:
+ case GL_OBJECT_LINEAR: {
+ GLuint needtgenable = r200_need_dis_texgen( texUnit->TexGenEnabled,
+ texUnit->ObjectPlaneS, texUnit->ObjectPlaneT,
+ texUnit->ObjectPlaneR, texUnit->ObjectPlaneQ );
+ if (needtgenable & (S_BIT | T_BIT)) {
+ if (R200_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "fallback mixed texgen / obj plane, 0x%x\n",
+ texUnit->TexGenEnabled);
+ return GL_FALSE;
+ }
+ if (needtgenable & (R_BIT)) {
+ tgcm &= ~(R200_TEXGEN_COMP_R << (unit * 4));
+ }
+ if (needtgenable & (Q_BIT)) {
+ tgcm &= ~(R200_TEXGEN_COMP_Q << (unit * 4));
+ }
+
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:
+ case GL_EYE_LINEAR: {
+ GLuint needtgenable = r200_need_dis_texgen( texUnit->TexGenEnabled,
+ texUnit->EyePlaneS, texUnit->EyePlaneT,
+ texUnit->EyePlaneR, texUnit->EyePlaneQ );
+ if (needtgenable & (S_BIT | T_BIT)) {
+ if (R200_DEBUG & DEBUG_FALLBACKS)
+ fprintf(stderr, "fallback mixed texgen / eye plane, 0x%x\n",
+ texUnit->TexGenEnabled);
+ return GL_FALSE;
+ }
+ if (needtgenable & (R_BIT)) {
+ tgcm &= ~(R200_TEXGEN_COMP_R << (unit * 4));
+ }
+ if (needtgenable & (Q_BIT)) {
+ tgcm &= ~(R200_TEXGEN_COMP_Q << (unit * 4));
+ }
tgi |= R200_TEXGEN_INPUT_EYE << inputshift;
- set_texgen_matrix( rmesa, unit,
+ 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;
+ tgi |= R200_TEXGEN_INPUT_EYE_REFLECT << inputshift;
/* pretty weird, must only negate when lighting is enabled? */
if (ctx->Light.Enabled)
set_texgen_matrix( rmesa, unit,
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index cf0c15093fd..899e84caa0f 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -40,6 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_ioctl.h"
#include "r200_tcl.h"
#include "program_instruction.h"
+#include "programopt.h"
#include "tnl/tnl.h"
#if SWIZZLE_X != VSF_IN_COMPONENT_X || \
@@ -387,16 +388,12 @@ static unsigned long op_operands(enum prog_opcode opcode)
#define UNUSED_SRC_2 ((o_inst->src2 & ~15) | 9)
-/* DP4 version seems to trigger some hw peculiarity - fglrx does this on r200 however */
-#define PREFER_DP4
-
-
/**
* Generate an R200 vertex program from Mesa's internal representation.
*
* \return GL_TRUE for success, GL_FALSE for failure.
*/
-static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
+static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_vertex_program *vp)
{
struct gl_vertex_program *mesa_vp = &vp->mesa_program;
struct prog_instruction *vpi;
@@ -405,13 +402,20 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
unsigned long operands;
int are_srcs_scalar;
unsigned long hw_op;
+ int dofogfix = 0;
+ int fog_temp_i = 0;
+ int free_inputs;
+ int free_inputs_conv;
+ int array_count = 0;
vp->native = GL_FALSE;
vp->translated = GL_TRUE;
+ vp->fogmode = ctx->Fog.Mode;
if (mesa_vp->Base.NumInstructions == 0)
return GL_FALSE;
+#if 0
if ((mesa_vp->Base.InputsRead &
~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 |
VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 |
@@ -422,6 +426,7 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
}
return GL_FALSE;
}
+#endif
if ((mesa_vp->Base.OutputsWritten &
~((1 << VERT_RESULT_HPOS) | (1 << VERT_RESULT_COL0) | (1 << VERT_RESULT_COL1) |
@@ -445,96 +450,22 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
Smart enough to realize that it doesnt need it? */
int u_temp_i = R200_VSF_MAX_TEMPS - 1;
struct prog_src_register src[3];
+ struct prog_dst_register dst;
/* FIXME: is changing the prog safe to do here? */
- if (mesa_vp->IsPositionInvariant) {
- struct gl_program_parameter_list *paramList;
- GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
-
-#ifdef PREFER_DP4
- tokens[5] = STATE_MATRIX;
-#else
- tokens[5] = STATE_MATRIX_TRANSPOSE;
-#endif
- paramList = mesa_vp->Base.Parameters;
-
- vpi = malloc((mesa_vp->Base.NumInstructions + 4) * sizeof(struct prog_instruction));
- memset(vpi, 0, 4 * sizeof(struct prog_instruction));
-
- /* emit four dot product instructions to do MVP transformation */
- for (i=0; i < 4; i++) {
- GLint idx;
- tokens[3] = tokens[4] = i;
- idx = _mesa_add_state_reference(paramList, tokens);
-#ifdef PREFER_DP4
- vpi[i].Opcode = OPCODE_DP4;
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- vpi[i].DstReg.File = PROGRAM_OUTPUT;
- vpi[i].DstReg.Index = VERT_RESULT_HPOS;
- vpi[i].DstReg.WriteMask = 1 << i;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = idx;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-
- vpi[i].SrcReg[1].File = PROGRAM_INPUT;
- vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
- vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-#else
- if (i == 0)
- vpi[i].Opcode = OPCODE_MUL;
- else
- vpi[i].Opcode = OPCODE_MAD;
-
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- if (i == 3)
- vpi[i].DstReg.File = PROGRAM_OUTPUT;
- else
- vpi[i].DstReg.File = PROGRAM_TEMPORARY;
- vpi[i].DstReg.Index = 0;
- vpi[i].DstReg.WriteMask = 0xf;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = idx;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-
- vpi[i].SrcReg[1].File = PROGRAM_INPUT;
- vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
- vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i);
-
- if (i > 0) {
- vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY;
- vpi[i].SrcReg[2].Index = 0;
- vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
- }
-#endif
+ if (mesa_vp->IsPositionInvariant &&
+ /* make sure we only do this once */
+ !(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) {
+ _mesa_insert_mvp_code(ctx, mesa_vp);
}
- /* now append original program after our new instructions */
- memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction));
-
- /* deallocate original program */
- free(mesa_vp->Base.Instructions);
-
- /* install new program */
- mesa_vp->Base.Instructions = vpi;
-
- mesa_vp->Base.NumInstructions += 4;
- vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1];
-
- assert(vpi->Opcode == OPCODE_END);
-
- mesa_vp->Base.InputsRead |= (1 << VERT_ATTRIB_POS);
- mesa_vp->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS);
-
- //fprintf(stderr, "IsPositionInvariant is set!\n");
- //_mesa_print_program(&mesa_vp->Base);
+ /* for fogc, can't change mesa_vp, as it would hose swtnl, and exp with
+ base e isn't directly available neither. */
+ if (mesa_vp->Base.OutputsWritten & VERT_RESULT_FOGC && !vp->fogpidx) {
+ struct gl_program_parameter_list *paramList;
+ GLint tokens[6] = { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 };
+ paramList = mesa_vp->Base.Parameters;
+ vp->fogpidx = _mesa_add_state_reference(paramList, tokens);
}
vp->pos_end = 0;
@@ -544,35 +475,88 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
else
mesa_vp->Base.NumNativeParameters = 0;
- for(i=0; i < VERT_ATTRIB_MAX; i++)
+ for(i = 0; i < VERT_ATTRIB_MAX; i++)
vp->inputs[i] = -1;
+ free_inputs = 0x2ffd;
+
/* fglrx uses fixed inputs as follows for conventional attribs.
- generic attribs use non-fixed assignment, fglrx will always use the lowest attrib values available.
- There are 12 generic attribs possible, corresponding to attrib 0, 2-11 and 13 in a hw vertex prog.
- attr 1 and 12 are not available for generic attribs as those cannot be made vec4 (correspond to
- vertex normal/weight)
+ generic attribs use non-fixed assignment, fglrx will always use the
+ lowest attrib values available. We'll just do the same.
+ There are 12 generic attribs possible, corresponding to attrib 0, 2-11
+ and 13 in a hw vertex prog.
+ attr 1 and 12 aren't used for generic attribs as those cannot be made vec4
+ (correspond to vertex normal/weight - maybe weight actually could be made vec4).
+ Additionally, not more than 12 arrays in total are possible I think.
attr 0 is pos, R200_VTX_XY1|R200_VTX_Z1|R200_VTX_W1 in R200_SE_VTX_FMT_0
attr 2-5 use colors 0-3 (R200_VTX_FP_RGBA << R200_VTX_COLOR_0/1/2/3_SHIFT in R200_SE_VTX_FMT_0)
attr 6-11 use tex 0-5 (4 << R200_VTX_TEX0/1/2/3/4/5_COMP_CNT_SHIFT in R200_SE_VTX_FMT_1)
attr 13 uses vtx1 pos (R200_VTX_XY1|R200_VTX_Z1|R200_VTX_W1 in R200_SE_VTX_FMT_0)
- generic attribs would require some more work (dma regions, renaming). */
+*/
-/* may look different when using idx buf / input_route instead of se_vtx_fmt? */
- vp->inputs[VERT_ATTRIB_POS] = 0;
- vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
- vp->inputs[VERT_ATTRIB_NORMAL] = 1;
- vp->inputs[VERT_ATTRIB_COLOR0] = 2;
- vp->inputs[VERT_ATTRIB_COLOR1] = 3;
- vp->inputs[VERT_ATTRIB_FOG] = 15;
- vp->inputs[VERT_ATTRIB_TEX0] = 6;
- vp->inputs[VERT_ATTRIB_TEX1] = 7;
- vp->inputs[VERT_ATTRIB_TEX2] = 8;
- vp->inputs[VERT_ATTRIB_TEX3] = 9;
- vp->inputs[VERT_ATTRIB_TEX4] = 10;
- vp->inputs[VERT_ATTRIB_TEX5] = 11;
/* attr 4,5 and 13 are only used with generic attribs.
Haven't seen attr 14 used, maybe that's for the hw pointsize vec1 (which is
not possibe to use with vertex progs as it is lacking in vert prog specification) */
+/* may look different when using idx buf / input_route instead of se_vtx_fmt? */
+ if (mesa_vp->Base.InputsRead & VERT_BIT_POS) {
+ vp->inputs[VERT_ATTRIB_POS] = 0;
+ free_inputs &= ~(1 << 0);
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_WEIGHT) {
+ /* we don't actually handle that later. Then again, we don't have to... */
+ vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_NORMAL) {
+ vp->inputs[VERT_ATTRIB_NORMAL] = 1;
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR0) {
+ vp->inputs[VERT_ATTRIB_COLOR0] = 2;
+ free_inputs &= ~(1 << 2);
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR1) {
+ vp->inputs[VERT_ATTRIB_COLOR1] = 3;
+ free_inputs &= ~(1 << 3);
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_FOG) {
+ vp->inputs[VERT_ATTRIB_FOG] = 15; array_count++;
+ }
+ for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX5; i++) {
+ if (mesa_vp->Base.InputsRead & (1 << i)) {
+ vp->inputs[i] = i - VERT_ATTRIB_TEX0 + 6;
+ free_inputs &= ~(1 << (i - VERT_ATTRIB_TEX0 + 6));
+ array_count++;
+ }
+ }
+ free_inputs_conv = free_inputs;
+ /* using VERT_ATTRIB_TEX6/7 would be illegal */
+ /* completely ignore aliasing? */
+ for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
+ int j;
+ /* completely ignore aliasing? */
+ if (mesa_vp->Base.InputsRead & (1 << i)) {
+ array_count++;
+ if (array_count > 12) {
+ if (R200_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "more than 12 attribs used in vert prog\n");
+ }
+ return GL_FALSE;
+ }
+ for (j = 0; j < 14; j++) {
+ /* will always find one due to limited array_count */
+ if (free_inputs & (1 << j)) {
+ free_inputs &= ~(1 << j);
+ vp->inputs[i] = j;
+ vp->rev_inputs[j] = i;
+ break;
+ }
+ }
+ }
+ }
+ vp->gen_inputs_mapped = free_inputs ^ free_inputs_conv;
if (!(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) {
if (R200_DEBUG & DEBUG_FALLBACKS) {
@@ -580,15 +564,59 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
}
return GL_FALSE;
}
+ if (free_inputs & 1) {
+ if (R200_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "can't handle vert prog without position input\n");
+ }
+ return GL_FALSE;
+ }
o_inst = vp->instr;
- for(vpi = mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
+ for (vpi = mesa_vp->Base.Instructions; vpi->Opcode != 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++)
+ for(i = 0; i < operands; i++) {
src[i] = vpi->SrcReg[i];
+ /* hack up default attrib values as per spec as swizzling.
+ normal, fog, secondary color. Crazy?
+ May need more if we don't submit vec4 elements? */
+ if (src[i].File == PROGRAM_INPUT) {
+ if (src[i].Index == VERT_ATTRIB_NORMAL) {
+ int j;
+ for (j = 0; j < 4; j++) {
+ if (GET_SWZ(src[i].Swizzle, j) == SWIZZLE_W) {
+ src[i].Swizzle &= ~(SWIZZLE_W << (j*3));
+ src[i].Swizzle |= SWIZZLE_ONE << (j*3);
+ }
+ }
+ }
+ else if (src[i].Index == VERT_ATTRIB_COLOR1) {
+ int j;
+ for (j = 0; j < 4; j++) {
+ if (GET_SWZ(src[i].Swizzle, j) == SWIZZLE_W) {
+ src[i].Swizzle &= ~(SWIZZLE_W << (j*3));
+ src[i].Swizzle |= SWIZZLE_ZERO << (j*3);
+ }
+ }
+ }
+ else if (src[i].Index == VERT_ATTRIB_FOG) {
+ int j;
+ for (j = 0; j < 4; j++) {
+ if (GET_SWZ(src[i].Swizzle, j) == SWIZZLE_W) {
+ src[i].Swizzle &= ~(SWIZZLE_W << (j*3));
+ src[i].Swizzle |= SWIZZLE_ONE << (j*3);
+ }
+ else if ((GET_SWZ(src[i].Swizzle, j) == SWIZZLE_Y) ||
+ GET_SWZ(src[i].Swizzle, j) == SWIZZLE_Z) {
+ src[i].Swizzle &= ~(SWIZZLE_W << (j*3));
+ src[i].Swizzle |= SWIZZLE_ZERO << (j*3);
+ }
+ }
+ }
+ }
+ }
if(operands == 3){
if( CMP_SRCS(src[1], src[2]) || CMP_SRCS(src[0], src[2]) ){
@@ -634,6 +662,17 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
}
}
+ dst = vpi->DstReg;
+ if (dst.File == PROGRAM_OUTPUT &&
+ dst.Index == VERT_RESULT_FOGC &&
+ dst.WriteMask & WRITEMASK_X) {
+ fog_temp_i = u_temp_i;
+ dst.File = PROGRAM_TEMPORARY;
+ dst.Index = fog_temp_i;
+ dofogfix = 1;
+ u_temp_i--;
+ }
+
/* These ops need special handling. */
switch(vpi->Opcode){
case OPCODE_POW:
@@ -641,8 +680,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
So may need to insert additional instruction */
if ((src[0].File == src[1].File) &&
(src[0].Index == src[1].Index)) {
- o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
SWIZZLE_ZERO,
@@ -670,8 +709,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
o_inst->src2 = UNUSED_SRC_1;
o_inst++;
- o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = MAKE_VSF_SOURCE(u_temp_i,
VSF_IN_COMPONENT_X,
VSF_IN_COMPONENT_Y,
@@ -687,8 +726,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO}
case OPCODE_SWZ:
- o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = t_src(vp, &src[0]);
o_inst->src1 = ZERO_SRC_0;
o_inst->src2 = UNUSED_SRC_1;
@@ -699,8 +738,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
src[1].File == PROGRAM_TEMPORARY &&
src[2].File == PROGRAM_TEMPORARY) ? R200_VPI_OUT_OP_MAD_2 : R200_VPI_OUT_OP_MAD;
- o_inst->op = MAKE_VSF_OP(hw_op, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(hw_op, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = t_src(vp, &src[0]);
#if 0
if ((o_inst - vp->instr) == 31) {
@@ -725,8 +764,8 @@ else {
goto next;
case 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(R200_VPI_OUT_OP_DOT, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
@@ -748,8 +787,8 @@ else {
goto next;
case 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(R200_VPI_OUT_OP_DOT, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
@@ -763,8 +802,8 @@ else {
goto next;
case 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
- o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = t_src(vp, &src[0]);
o_inst->src1 = MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
@@ -778,8 +817,8 @@ else {
goto next;
case 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(R200_VPI_OUT_OP_MAX, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op=MAKE_VSF_OP(R200_VPI_OUT_OP_MAX, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0=t_src(vp, &src[0]);
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
@@ -798,15 +837,15 @@ else {
o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_FRC,
(u_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP,
- t_dst_mask(vpi->DstReg.WriteMask));
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = t_src(vp, &src[0]);
o_inst->src1 = UNUSED_SRC_0;
o_inst->src2 = UNUSED_SRC_1;
o_inst++;
- o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = t_src(vp, &src[0]);
o_inst->src1 = MAKE_VSF_SOURCE(u_temp_i,
@@ -830,7 +869,7 @@ else {
o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL,
(u_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP,
- t_dst_mask(vpi->DstReg.WriteMask));
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
@@ -852,8 +891,8 @@ else {
o_inst++;
u_temp_i--;
- o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MAD, t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MAD, t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y
@@ -886,8 +925,8 @@ else {
break;
}
- o_inst->op = MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst(&vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask));
+ o_inst->op = MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst(&dst),
+ t_dst_mask(dst.WriteMask));
if(are_srcs_scalar){
switch(operands){
@@ -941,6 +980,67 @@ else {
}
}
next:
+
+ if (dofogfix) {
+ o_inst++;
+ if (vp->fogmode == GL_EXP) {
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL,
+ (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP,
+ VSF_FLAG_X);
+ o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE);
+ o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, X, X, X, X, PARAM, NONE);
+ o_inst->src2 = UNUSED_SRC_1;
+ o_inst++;
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_EXP_E,
+ R200_VSF_OUT_CLASS_RESULT_FOGC,
+ VSF_FLAG_X);
+ o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, ALL);
+ o_inst->src1 = UNUSED_SRC_0;
+ o_inst->src2 = UNUSED_SRC_1;
+ }
+ else if (vp->fogmode == GL_EXP2) {
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL,
+ (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP,
+ VSF_FLAG_X);
+ o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE);
+ o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, X, X, X, X, PARAM, NONE);
+ o_inst->src2 = UNUSED_SRC_1;
+ o_inst++;
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL,
+ (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP,
+ VSF_FLAG_X);
+ o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE);
+ o_inst->src1 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE);
+ o_inst->src2 = UNUSED_SRC_1;
+ o_inst++;
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_EXP_E,
+ R200_VSF_OUT_CLASS_RESULT_FOGC,
+ VSF_FLAG_X);
+ o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, ALL);
+ o_inst->src1 = UNUSED_SRC_0;
+ o_inst->src2 = UNUSED_SRC_1;
+ }
+ else { /* fogmode == GL_LINEAR */
+ /* could do that with single op (dot) if using params like
+ with fixed function pipeline fog */
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD,
+ (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP,
+ VSF_FLAG_X);
+ o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, ALL);
+ o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, Z, Z, Z, Z, PARAM, NONE);
+ o_inst->src2 = UNUSED_SRC_1;
+ o_inst++;
+ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL,
+ R200_VSF_OUT_CLASS_RESULT_FOGC,
+ VSF_FLAG_X);
+ o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE);
+ o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, W, W, W, W, PARAM, NONE);
+ o_inst->src2 = UNUSED_SRC_1;
+
+ }
+ dofogfix = 0;
+ }
+
if (mesa_vp->Base.NumNativeTemporaries <
(mesa_vp->Base.NumTemporaries + (R200_VSF_MAX_TEMPS - 1 - u_temp_i))) {
mesa_vp->Base.NumNativeTemporaries =
@@ -981,9 +1081,9 @@ void r200SetupVertexProg( GLcontext *ctx ) {
GLboolean fallback;
GLint i;
- if (!vp->translated) {
+ if (!vp->translated || (ctx->Fog.Enabled && ctx->Fog.Mode != vp->fogmode)) {
rmesa->curr_vp_hw = NULL;
- r200_translate_vertex_program(vp);
+ r200_translate_vertex_program(ctx, vp);
}
/* could optimize setting up vertex progs away for non-tcl hw */
fallback = !(vp->native && r200VertexProgUpdateParams(ctx, vp) &&
@@ -1104,10 +1204,14 @@ r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog)
switch(target) {
case GL_VERTEX_PROGRAM_ARB:
vp->translated = GL_FALSE;
+ vp->fogpidx = 0;
/* memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct gl_vertex_program));*/
- r200_translate_vertex_program(vp);
+ r200_translate_vertex_program(ctx, vp);
rmesa->curr_vp_hw = NULL;
break;
+ case GL_FRAGMENT_SHADER_ATI:
+ rmesa->afs_loaded = NULL;
+ break;
}
/* need this for tcl fallbacks */
_tnl_program_string(ctx, target, prog);
@@ -1122,7 +1226,7 @@ r200IsProgramNative(GLcontext *ctx, GLenum target, struct gl_program *prog)
case GL_VERTEX_STATE_PROGRAM_NV:
case GL_VERTEX_PROGRAM_ARB:
if (!vp->translated) {
- r200_translate_vertex_program(vp);
+ r200_translate_vertex_program(ctx, vp);
}
/* does not take parameters etc. into account */
return vp->native;
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.h b/src/mesa/drivers/dri/r200/r200_vertprog.h
index 0fbe5eec7d9..938237680ce 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.h
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.h
@@ -89,6 +89,8 @@ extern void r200SetupVertexProg( GLcontext *ctx );
#define R200_VPI_OUT_OP_EXP (65 << 0)
#define R200_VPI_OUT_OP_LOG (66 << 0)
+/* base e exp. Useful for fog. */
+#define R200_VPI_OUT_OP_EXP_E (67 << 0)
#define R200_VPI_OUT_OP_LIT (68 << 0)
#define R200_VPI_OUT_OP_POW (69 << 0)
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index df73cdedc11..dd3ecbb2357 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -549,6 +549,7 @@ struct r300_stencilbuffer_state {
/* Can be tested with colormat currently. */
#define VSF_MAX_FRAGMENT_TEMPS (14)
+#define STATE_R300_WINDOW_DIMENSION (STATE_INTERNAL_DRIVER+0)
struct r300_vertex_shader_fragment {
int length;
@@ -592,7 +593,8 @@ struct r300_vertex_shader_state {
extern int hw_tcl_on;
-#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current)
+//#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current)
+#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->selected_vp)
/* Should but doesnt work */
//#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->curr_vp)
@@ -607,15 +609,22 @@ extern int hw_tcl_on;
/* 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_key {
+ GLuint InputsRead;
+ GLuint OutputsWritten;
+};
+
struct r300_vertex_program {
- struct gl_vertex_program mesa_program; /* Must be first */
+ struct r300_vertex_program *next;
+ struct r300_vertex_program_key key;
int translated;
struct r300_vertex_shader_fragment program;
- struct r300_vertex_shader_fragment params;
int pos_end;
int num_temporaries; /* Number of temp vars used by program */
+ int wpos_idx;
int inputs[VERT_ATTRIB_MAX];
int outputs[VERT_RESULT_MAX];
int native;
@@ -623,6 +632,12 @@ struct r300_vertex_program {
int use_ref_count;
};
+struct r300_vertex_program_cont {
+ struct gl_vertex_program mesa_program; /* Must be first */
+ struct r300_vertex_shader_fragment params;
+ struct r300_vertex_program *progs;
+};
+
#define PFS_MAX_ALU_INST 64
#define PFS_MAX_TEX_INST 64
#define PFS_MAX_TEX_INDIRECT 4
@@ -797,6 +812,7 @@ struct r300_context {
struct r300_cmdbuf cmdbuf;
struct r300_state state;
struct gl_vertex_program *curr_vp;
+ struct r300_vertex_program *selected_vp;
/* Vertex buffers
*/
@@ -854,9 +870,9 @@ extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
extern int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim);
-void r300_translate_vertex_shader(struct r300_vertex_program *vp);
+extern void r300_select_vertex_shader(r300ContextPtr r300);
extern void r300InitShaderFuncs(struct dd_function_table *functions);
-extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst);
+extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst);
extern int r300Fallback(GLcontext *ctx);
extern void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, struct vertex_buffer *vb);
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index 2d947dea3af..32c0128eaa2 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -28,14 +28,14 @@
/*
* Authors:
* Ben Skeggs <darktama@iinet.net.au>
+ * Jerome Glisse <j.glisse@gmail.com>
*/
/*TODO'S
*
- * - COS/SIN/SCS/LIT instructions
+ * - COS/SIN/SCS instructions
* - Depth write, WPOS/FOGC inputs
* - FogOption
- * - Negate on individual components (implement in swizzle code?)
* - Verify results of opcodes for accuracy, I've only checked them
* in specific cases.
* - and more...
@@ -82,7 +82,8 @@ static const struct {
{ "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 }
+ { "REPL_ALPHA", 1, R300_FPI0_OUTC_REPL_ALPHA, PFS_INVAL },
+ { "CMPH", 3, R300_FPI0_OUTC_CMPH, PFS_INVAL },
};
#define MAKE_SWZ3(x, y, z) (MAKE_SWIZZLE4(SWIZZLE_##x, \
@@ -180,7 +181,7 @@ static const pfs_reg_t undef = {
valid: GL_FALSE
};
-/* constant zero source */
+/* constant one source */
static const pfs_reg_t pfs_one = {
type: REG_TYPE_CONST,
index: 0,
@@ -189,7 +190,16 @@ static const pfs_reg_t pfs_one = {
valid: GL_TRUE
};
-/* constant one source */
+/* constant half source */
+static const pfs_reg_t pfs_half = {
+ type: REG_TYPE_CONST,
+ index: 0,
+ v_swz: SWIZZLE_HHH,
+ s_swz: SWIZZLE_HALF,
+ valid: GL_TRUE
+};
+
+/* constant zero source */
static const pfs_reg_t pfs_zero = {
type: REG_TYPE_CONST,
index: 0,
@@ -319,7 +329,6 @@ static pfs_reg_t emit_param4fv(struct r300_fragment_program *rp,
return r;
}
-#if 0
static pfs_reg_t emit_const4fv(struct r300_fragment_program *rp, GLfloat *cp)
{
pfs_reg_t r = undef;
@@ -330,13 +339,11 @@ static pfs_reg_t emit_const4fv(struct r300_fragment_program *rp, GLfloat *cp)
ERROR("Out of hw constants!\n");
return r;
}
-
- COPY_4V(rp->constant[r.index], cp);
+ COPY_4V(rp->constant[r.index], cp);
r.valid = GL_TRUE;
return r;
}
-#endif
static __inline pfs_reg_t negate(pfs_reg_t r)
{
@@ -496,9 +503,6 @@ static pfs_reg_t t_src(struct r300_fragment_program *rp,
struct prog_src_register fpsrc)
{
pfs_reg_t r = undef;
-#if 0
- pfs_reg_t n = undef;
-#endif
switch (fpsrc.File) {
case PROGRAM_TEMPORARY:
@@ -531,40 +535,6 @@ static pfs_reg_t t_src(struct r300_fragment_program *rp,
/* no point swizzling ONE/ZERO/HALF constants... */
if (r.v_swz < SWIZZLE_111 || r.s_swz < SWIZZLE_ZERO)
r = do_swizzle(rp, r, fpsrc.Swizzle, fpsrc.NegateBase);
-#if 0
- /* 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 & 0xf) == 0xf)
- r.negate = GL_TRUE;
-
- r.negate_s = (fpsrc.NegateBase >> 3) & 1;
-
- if ((fpsrc.NegateBase & 0x7) == 0x0) {
- r.negate_v = 0;
- } else if ((fpsrc.NegateBase & 0x7) == 0x7) {
- r.negate_v = 1;
- } else {
- if (r.type != REG_TYPE_TEMP) {
- n = get_temp_reg(rp);
- emit_arith(rp, PFS_OP_MAD, n, 0x7 ^ fpsrc.NegateBase,
- keep(r), pfs_one, pfs_zero, 0);
- r.negate_v = 1;
- emit_arith(rp, PFS_OP_MAD, n,
- fpsrc.NegateBase & 0x7 | WRITEMASK_W,
- r, pfs_one, pfs_zero, 0);
- r.negate_v = 0;
- r = n;
- } else {
- r.negate_v = 1;
- emit_arith(rp, PFS_OP_MAD, r,
- fpsrc.NegateBase & 0x7 | WRITEMASK_W,
- r, pfs_one, pfs_zero, 0);
- r.negate_v = 0;
- }
- }
-#endif
-
return r;
}
@@ -573,7 +543,7 @@ static pfs_reg_t t_scalar_src(struct r300_fragment_program *rp,
{
struct prog_src_register src = fpsrc;
int sc = GET_SWZ(fpsrc.Swizzle, 0); /* X */
-
+
src.Swizzle = ((sc<<0)|(sc<<3)|(sc<<6)|(sc<<9));
return t_src(rp, src);
@@ -773,13 +743,15 @@ static void emit_tex(struct r300_fragment_program *rp,
cs->dest_in_node = 0;
}
- if (rp->cur_node == 0) rp->first_node_has_tex = 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 */
+ rp->tex.inst[rp->tex.length++] = 0
+ | (hwsrc << R300_FPITX_SRC_SHIFT)
+ | (hwdest << R300_FPITX_DST_SHIFT)
+ | (unit << R300_FPITX_IMAGE_SHIFT)
+ /* not entirely sure about this */
+ | (opcode << R300_FPITX_OPCODE_SHIFT);
cs->dest_in_node |= (1 << hwdest);
if (coord.type != REG_TYPE_CONST)
@@ -884,7 +856,7 @@ static void emit_arith(struct r300_fragment_program *rp, int op,
vop = r300_fpop[op].v_op;
sop = r300_fpop[op].s_op;
- argc = r300_fpop[op].argc;
+ argc = r300_fpop[op].argc;
if ((mask & WRITEMASK_XYZ) || vop == R300_FPI0_OUTC_DP3)
emit_vop = GL_TRUE;
@@ -1039,7 +1011,9 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
const struct prog_instruction *inst = mp->Base.Instructions;
struct prog_instruction *fpi;
pfs_reg_t src[3], dest, temp;
+ pfs_reg_t cnst;
int flags, mask = 0;
+ GLfloat cnstv[4] = {0.0, 0.0, 0.0, 0.0};
if (!inst || inst[0].Opcode == OPCODE_END) {
ERROR("empty program?\n");
@@ -1083,7 +1057,64 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
flags);
break;
case OPCODE_COS:
- ERROR("COS not implemented\n");
+ /*
+ * cos using taylor serie:
+ * cos(x) = 1 - x^2/2! + x^4/4! - x^6/6!
+ */
+ temp = get_temp_reg(rp);
+ cnstv[0] = 0.5;
+ cnstv[1] = 0.041666667;
+ cnstv[2] = 0.001388889;
+ cnstv[4] = 0.0;
+ cnst = emit_const4fv(rp, cnstv);
+ src[0] = t_scalar_src(rp, fpi->SrcReg[0]);
+
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ src[0],
+ src[0],
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Y | WRITEMASK_Z,
+ temp, temp,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Z,
+ temp,
+ swizzle(temp, X, X, X, W),
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ temp, cnst,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ pfs_one,
+ pfs_one,
+ negate(temp),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ swizzle(temp, Y, Y, Y, W),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ negate(swizzle(temp, Z, Z, Z, W)),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, dest, mask,
+ swizzle(temp, X, X, X, X),
+ pfs_one,
+ pfs_zero,
+ flags);
+ free_temp(rp, temp);
break;
case OPCODE_DP3:
src[0] = t_src(rp, fpi->SrcReg[0]);
@@ -1179,7 +1210,66 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
flags);
break;
case OPCODE_LIT:
- ERROR("LIT not implemented\n");
+ /* LIT
+ * if (s.x < 0) t.x = 0; else t.x = s.x;
+ * if (s.y < 0) t.y = 0; else t.y = s.y;
+ * if (s.w > 128.0) t.w = 128.0; else t.w = s.w;
+ * if (s.w < -128.0) t.w = -128.0; else t.w = s.w;
+ * r.x = 1.0
+ * if (t.x > 0) r.y = pow(t.y, t.w); else r.y = 0;
+ * Also r.y = 0 if t.y < 0
+ * For the t.x > 0 FGLRX use the CMPH opcode which
+ * change the compare to (t.x + 0.5) > 0.5 we may
+ * save one instruction by doing CMP -t.x
+ */
+ cnstv[0] = cnstv[1] = cnstv[2] = cnstv[4] = 0.50001;
+ src[0] = t_src(rp, fpi->SrcReg[0]);
+ temp = get_temp_reg(rp);
+ cnst = emit_const4fv(rp, cnstv);
+ emit_arith(rp, PFS_OP_CMP, temp,
+ WRITEMASK_X | WRITEMASK_Y,
+ src[0], pfs_zero, src[0], flags);
+ emit_arith(rp, PFS_OP_MIN, temp, WRITEMASK_Z,
+ swizzle(keep(src[0]), W, W, W, W),
+ cnst, undef, flags);
+ emit_arith(rp, PFS_OP_LG2, temp, WRITEMASK_W,
+ swizzle(temp, Y, Y, Y, Y),
+ undef, undef, flags);
+ emit_arith(rp, PFS_OP_MAX, temp, WRITEMASK_Z,
+ temp, negate(cnst), undef, flags);
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W,
+ temp, swizzle(temp, Z, Z, Z, Z),
+ pfs_zero, flags);
+ emit_arith(rp, PFS_OP_EX2, temp, WRITEMASK_W,
+ temp, undef, undef, flags);
+ emit_arith(rp, PFS_OP_MAD, dest, WRITEMASK_Y,
+ swizzle(keep(temp), X, X, X, X),
+ pfs_one, pfs_zero, flags);
+#if 0
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
+ temp, pfs_one, pfs_half, flags);
+ emit_arith(rp, PFS_OP_CMPH, temp, WRITEMASK_Z,
+ swizzle(keep(temp), W, W, W, W),
+ pfs_zero, swizzle(keep(temp), X, X, X, X),
+ flags);
+#else
+ emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_Z,
+ pfs_zero,
+ swizzle(keep(temp), W, W, W, W),
+ negate(swizzle(keep(temp), X, X, X, X)),
+ flags);
+#endif
+ emit_arith(rp, PFS_OP_CMP, dest, WRITEMASK_Z,
+ pfs_zero, temp,
+ negate(swizzle(keep(temp), Y, Y, Y, Y)),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, dest,
+ WRITEMASK_X | WRITEMASK_W,
+ pfs_one,
+ pfs_one,
+ pfs_zero,
+ flags);
+ free_temp(rp, temp);
break;
case OPCODE_LRP:
src[0] = t_src(rp, fpi->SrcReg[0]);
@@ -1281,7 +1371,70 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
free_temp(rp, temp);
break;
case OPCODE_SIN:
- ERROR("SIN not implemented\n");
+ /*
+ * sin using taylor serie:
+ * sin(x) = x - x^3/3! + x^5/5! - x^7/7!
+ */
+ temp = get_temp_reg(rp);
+ cnstv[0] = 0.333333333;
+ cnstv[1] = 0.008333333;
+ cnstv[2] = 0.000198413;
+ cnstv[4] = 0.0;
+ cnst = emit_const4fv(rp, cnstv);
+ src[0] = t_scalar_src(rp, fpi->SrcReg[0]);
+
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ src[0],
+ src[0],
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Y | WRITEMASK_Z,
+ temp, temp,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Z,
+ temp,
+ swizzle(temp, X, X, X, W),
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ src[0],
+ temp,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ temp, cnst,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ src[0],
+ pfs_one,
+ negate(temp),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ swizzle(temp, Y, Y, Y, W),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ negate(swizzle(temp, Z, Z, Z, W)),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, dest, mask,
+ swizzle(temp, X, X, X, X),
+ pfs_one,
+ pfs_zero,
+ flags);
+ free_temp(rp, temp);
break;
case OPCODE_SLT:
src[0] = t_src(rp, fpi->SrcReg[0]);
@@ -1345,7 +1498,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
return GL_FALSE;
}
-
+
return GL_TRUE;
}
@@ -1400,6 +1553,13 @@ static void init_program(struct r300_fragment_program *rp)
}
InputsRead &= ~FRAG_BITS_TEX_ANY;
+ /* fragment position treated as a texcoord */
+ if (InputsRead & FRAG_BIT_WPOS) {
+ cs->inputs[FRAG_ATTRIB_WPOS].refcount = 0;
+ cs->inputs[FRAG_ATTRIB_WPOS].reg = get_hw_temp(rp);
+ }
+ InputsRead &= ~FRAG_BIT_WPOS;
+
/* Then primary colour */
if (InputsRead & FRAG_BIT_COL0) {
cs->inputs[FRAG_ATTRIB_COL0].refcount = 0;
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h
index e7dbaf973e2..4bbaa07e012 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.h
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.h
@@ -78,7 +78,8 @@ typedef struct r300_fragment_program_swizzle {
#define PFS_OP_RCP 9
#define PFS_OP_RSQ 10
#define PFS_OP_REPL_ALPHA 11
-#define MAX_PFS_OP 11
+#define PFS_OP_CMPH 12
+#define MAX_PFS_OP 12
#define PFS_FLAG_SAT (1 << 0)
#define PFS_FLAG_ABS (1 << 1)
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index d0d2def8648..0774a2af6b4 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -477,8 +477,7 @@ static void r300EmitClearState(GLcontext * ctx)
/**
* Buffer clear
*/
-static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+static void r300Clear(GLcontext * ctx, GLbitfield mask)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable;
@@ -487,8 +486,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
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);
+ fprintf(stderr, "r300Clear\n");
{
LOCK_HARDWARE(&r300->radeon);
@@ -521,7 +519,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "%s: swrast clear, mask: %x\n",
__FUNCTION__, mask);
- _swrast_Clear(ctx, mask, all, cx, cy, cw, ch);
+ _swrast_Clear(ctx, mask);
}
swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1);
@@ -572,9 +570,10 @@ void r300Flush(GLcontext * ctx)
#ifdef USER_BUFFERS
#include "radeon_mm.h"
-void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
+void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size)
{
struct r300_dma_buffer *dmabuf;
+ size = MAX2(size, RADEON_BUFFER_SIZE*16);
if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA))
fprintf(stderr, "%s\n", __FUNCTION__);
@@ -593,20 +592,20 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
dmabuf->buf = (void *)1; /* hack */
dmabuf->refcount = 1;
- dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16);
+ dmabuf->id = radeon_mm_alloc(rmesa, 4, size);
if (dmabuf->id == 0) {
LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */
r300FlushCmdBufLocked(rmesa, __FUNCTION__);
radeonWaitForIdleLocked(&rmesa->radeon);
- dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16);
+ dmabuf->id = radeon_mm_alloc(rmesa, 4, size);
#ifdef HW_VBOS
if (dmabuf->id == 0) {
/* Just kick all */
r300_evict_vbos(rmesa->radeon.glCtx, /*RADEON_BUFFER_SIZE*16*/1<<30);
- dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16);
+ dmabuf->id = radeon_mm_alloc(rmesa, 4, size);
}
#endif
UNLOCK_HARDWARE(&rmesa->radeon);
@@ -619,7 +618,7 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
rmesa->dma.current.buf = dmabuf;
rmesa->dma.current.address = radeon_mm_ptr(rmesa, dmabuf->id);
- rmesa->dma.current.end = RADEON_BUFFER_SIZE*16;
+ rmesa->dma.current.end = size;
rmesa->dma.current.start = 0;
rmesa->dma.current.ptr = 0;
}
@@ -667,7 +666,8 @@ void r300AllocDmaRegion(r300ContextPtr rmesa,
(rmesa->dma.current.ptr + alignment) & ~alignment;
if (rmesa->dma.current.ptr + bytes > rmesa->dma.current.end)
- r300RefillCurrentDmaRegion(rmesa);
+ r300RefillCurrentDmaRegion(rmesa,
+ (bytes + 0x7) & ~0x7);
region->start = rmesa->dma.current.start;
region->ptr = rmesa->dma.current.start;
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h
index 5514214cc6b..52325646e9f 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.h
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.h
@@ -50,7 +50,6 @@ extern GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa,
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,
diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c
index 2fdad519fd5..fcb87cbbb59 100644
--- a/src/mesa/drivers/dri/r300/r300_maos.c
+++ b/src/mesa/drivers/dri/r300/r300_maos.c
@@ -407,8 +407,8 @@ int r300EmitArrays(GLcontext *ctx)
if (hw_tcl_on) {
struct r300_vertex_program *prog=(struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
inputs = prog->inputs;
- InputsRead = CURRENT_VERTEX_SHADER(ctx)->Base.InputsRead;
- OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten;
+ InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead;
+ OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
} else {
DECLARE_RENDERINPUTS(inputs_bitset);
inputs = r300->state.sw_tcl_inputs;
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index f3d8fa60f5b..9f636ec1d2e 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -1001,6 +1001,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* - DP4: Use OUTC_DP4, OUTA_DP4
* - DP3: Use OUTC_DP3, OUTA_DP4, appropriate alpha operands
* - DPH: Use OUTC_DP4, OUTA_DP4, appropriate alpha operands
+ * - CMPH: If ARG2 > 0.5, return ARG0, else return ARG1
* - CMP: If ARG2 < 0, return ARG1, else return ARG0
* - FLR: use FRC+MAD
* - XPD: use MAD+MAD
@@ -1138,6 +1139,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# 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_CMPH (7 << 23)
# define R300_FPI0_OUTC_CMP (8 << 23)
# define R300_FPI0_OUTC_FRC (9 << 23)
# define R300_FPI0_OUTC_REPL_ALPHA (10 << 23)
diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c
index 576b18953f9..26721e8dfda 100644
--- a/src/mesa/drivers/dri/r300/r300_shader.c
+++ b/src/mesa/drivers/dri/r300/r300_shader.c
@@ -12,13 +12,13 @@ r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct r300_vertex_program *vp=(void *)prog;
+ struct r300_vertex_program_cont *vp=(void *)prog;
switch(target){
case GL_VERTEX_PROGRAM_ARB:
- rmesa->curr_vp = (struct gl_vertex_program *)vp;
- vp->ref_count++;
+ //rmesa->curr_vp = (struct gl_vertex_program *)vp;
+ //vp->ref_count++;
#if 0
if((vp->ref_count % 1500) == 0) {
fprintf(stderr, "id %p, ref_count %d\n", vp, vp->ref_count);
@@ -37,13 +37,13 @@ r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
static struct gl_program *
r300NewProgram(GLcontext *ctx, GLenum target, GLuint id)
{
- struct r300_vertex_program *vp;
+ struct r300_vertex_program_cont *vp;
struct r300_fragment_program *fp;
switch(target){
case GL_VERTEX_STATE_PROGRAM_NV:
case GL_VERTEX_PROGRAM_ARB:
- vp=CALLOC_STRUCT(r300_vertex_program);
+ vp=CALLOC_STRUCT(r300_vertex_program_cont);
return _mesa_init_vertex_program(ctx, &vp->mesa_program, target, id);
case GL_FRAGMENT_PROGRAM_ARB:
fp=CALLOC_STRUCT(r300_fragment_program);
@@ -77,13 +77,14 @@ r300DeleteProgram(GLcontext *ctx, struct gl_program *prog)
static void
r300ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
- struct r300_vertex_program *vp=(void *)prog;
+ struct r300_vertex_program_cont *vp=(void *)prog;
struct r300_fragment_program *fp = (struct r300_fragment_program *) prog;
switch(target) {
case GL_VERTEX_PROGRAM_ARB:
- vp->translated = GL_FALSE;
- memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program));
+ vp->progs = NULL;
+ /*vp->translated = GL_FALSE;
+ memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program));*/
/*r300_translate_vertex_shader(vp);*/
break;
case GL_FRAGMENT_PROGRAM_ARB:
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index bac1bef9681..72255066d59 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -206,7 +206,7 @@ static void r300_set_blend_state(GLcontext * ctx)
(R300_BLEND_GL_ZERO << R300_DST_BLEND_SHIFT);
int eqnA = R300_COMB_FCN_ADD_CLAMP;
- if (ctx->Color._LogicOpEnabled || !ctx->Color.BlendEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx) || !ctx->Color.BlendEnabled) {
r300_set_blend_cntl(r300,
func, eqn, 0,
func, eqn);
@@ -460,7 +460,6 @@ static void update_depth(GLcontext* ctx)
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__,
@@ -1045,6 +1044,59 @@ r300UpdateDrawBuffer(GLcontext *ctx)
#endif
}
+static void r300FetchStateParameter(GLcontext *ctx, const enum state_index state[],
+ GLfloat *value)
+{
+ r300ContextPtr r300 = R300_CONTEXT(ctx);
+
+ switch(state[0])
+ {
+ case STATE_INTERNAL:
+ switch(state[1])
+ {
+ case STATE_R300_WINDOW_DIMENSION:
+ value[0] = r300->radeon.dri.drawable->w; /* width */
+ value[1] = r300->radeon.dri.drawable->h; /* height */
+ value[2] = 0.5F; /* for moving range [-1 1] -> [0 1] */
+ value[3] = 1.0F; /* not used */
+ break;
+ default:;
+ }
+ default:;
+ }
+}
+
+/**
+ * Update R300's own internal state parameters.
+ * For now just STATE_R300_WINDOW_DIMENSION
+ */
+static void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state)
+{
+ struct r300_vertex_program_cont *vpc;
+ struct gl_program_parameter_list *paramList;
+ GLuint i;
+
+ if(!(new_state & (_NEW_BUFFERS|_NEW_PROGRAM)))
+ return;
+
+ vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current;
+ if (!vpc)
+ return;
+
+ paramList = vpc->mesa_program.Base.Parameters;
+
+ if (!paramList)
+ return;
+
+ for (i = 0; i < paramList->NumParameters; i++) {
+ if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR){
+ r300FetchStateParameter(ctx,
+ paramList->Parameters[i].StateIndexes,
+ paramList->ParameterValues[i]);
+ }
+ }
+}
+
/* =============================================================
* Polygon state
*/
@@ -1286,7 +1338,7 @@ void r300_setup_rs_unit(GLcontext *ctx)
int i;
if(hw_tcl_on)
- OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten;
+ OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
else
RENDERINPUTS_COPY( OutputsWritten.index_bitset, r300->state.render_inputs_bitset );
@@ -1305,6 +1357,20 @@ void r300_setup_rs_unit(GLcontext *ctx)
r300->hw.rr.cmd[R300_RR_ROUTE_1] = 0;
+ if (InputsRead & FRAG_BIT_WPOS){
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
+ break;
+
+ if(i == ctx->Const.MaxTextureUnits){
+ fprintf(stderr, "\tno free texcoord found...\n");
+ exit(0);
+ }
+
+ InputsRead |= (FRAG_BIT_TEX0 << i);
+ InputsRead &= ~FRAG_BIT_WPOS;
+ }
+
for (i=0;i<ctx->Const.MaxTextureUnits;i++) {
r300->hw.ri.cmd[R300_RI_INTERP_0+i] = 0
| R300_RS_INTERP_USED
@@ -1611,7 +1677,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa)
((drm_r300_cmd_header_t*)rmesa->hw.vpp.cmd)->vpu.count = 0;
R300_STATECHANGE(rmesa, vpp);
- param_count = r300VertexProgUpdateParams(ctx, prog, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]);
+ param_count = r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *)ctx->VertexProgram._Current/*prog*/, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]);
bump_vpu_count(rmesa->hw.vpp.cmd, param_count);
param_count /= 4;
@@ -1670,9 +1736,10 @@ void r300UpdateShaders(r300ContextPtr rmesa)
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i];
}
+ r300_select_vertex_shader(rmesa);
vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
- if (vp->translated == GL_FALSE)
- r300_translate_vertex_shader(vp);
+ /*if (vp->translated == GL_FALSE)
+ r300_translate_vertex_shader(vp);*/
if (vp->translated == GL_FALSE) {
fprintf(stderr, "Failing back to sw-tcl\n");
hw_tcl_on = future_hw_tcl_on = 0;
@@ -1680,6 +1747,7 @@ void r300UpdateShaders(r300ContextPtr rmesa)
return ;
}
+ r300UpdateStateParameters(ctx, _NEW_PROGRAM);
}
}
@@ -1813,6 +1881,9 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) {
r300UpdateDrawBuffer(ctx);
}
+
+ r300UpdateStateParameters(ctx, new_state);
+
#ifndef CB_DPATH
/* Go inefficiency! */
r300ResetHwState(r300);
@@ -1910,11 +1981,10 @@ void r300ResetHwState(r300ContextPtr r300)
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 (_mesa_little_endian())
+ r300->hw.unk2140.cmd[1] = 0x00000000;
+ else
+ r300->hw.unk2140.cmd[1] = 0x00000002;
#if 0 /* Done in setup routing */
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c
index efa072c2651..6348ba1982a 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.c
+++ b/src/mesa/drivers/dri/r300/r300_tex.c
@@ -297,6 +297,38 @@ static r300TexObjPtr r300AllocTexObj(struct gl_texture_object *texObj)
return t;
}
+/* try to find a format which will only need a memcopy */
+static const struct gl_texture_format *r300Choose8888TexFormat( GLenum srcFormat,
+ GLenum srcType )
+{
+ const GLuint ui = 1;
+ const GLubyte littleEndian = *((const GLubyte *) &ui);
+
+ if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
+ return &_mesa_texformat_rgba8888;
+ }
+ else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
+ return &_mesa_texformat_rgba8888_rev;
+ }
+ else if (srcFormat == GL_BGRA &&
+ ((srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8)) {
+ return &_mesa_texformat_argb8888_rev;
+ }
+ else if (srcFormat == GL_BGRA &&
+ ((srcType == GL_UNSIGNED_BYTE && littleEndian) ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) {
+ return &_mesa_texformat_argb8888;
+ }
+ else return _dri_texformat_argb8888;
+}
+
static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
GLint
internalFormat,
@@ -335,7 +367,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
return _dri_texformat_argb1555;
default:
- return do32bpt ? _dri_texformat_rgba8888 :
+ return do32bpt ? r300Choose8888TexFormat(format, type) :
_dri_texformat_argb4444;
}
@@ -353,7 +385,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
case GL_UNSIGNED_SHORT_5_6_5_REV:
return _dri_texformat_rgb565;
default:
- return do32bpt ? _dri_texformat_rgba8888 :
+ return do32bpt ? _dri_texformat_argb8888 :
_dri_texformat_rgb565;
}
@@ -362,7 +394,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
case GL_RGBA12:
case GL_RGBA16:
return !force16bpt ?
- _dri_texformat_rgba8888 : _dri_texformat_argb4444;
+ r300Choose8888TexFormat(format, type) : _dri_texformat_argb4444;
case GL_RGBA4:
case GL_RGBA2:
@@ -375,7 +407,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return !force16bpt ? _dri_texformat_rgba8888 :
+ return !force16bpt ? _dri_texformat_argb8888 :
_dri_texformat_rgb565;
case GL_RGB5:
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index c4a1bf01b4c..cc356afb230 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -51,14 +51,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \
|| ((f) >= MESA_FORMAT_RGBA_FLOAT32 && \
(f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \
- && tx_table[f].flag )
+ && tx_table_le[f].flag )
#define _ASSIGN(entry, format) \
[ MESA_FORMAT_ ## entry ] = { format, 0, 1}
static const struct {
GLuint format, filter, flag;
-} tx_table[] = {
+} tx_table_be[] = {
/*
* 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
@@ -68,9 +68,9 @@ static const struct {
* 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, R300_EASY_TX_FORMAT(Z, Y, X, W, 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, R300_EASY_TX_FORMAT(W, Z, Y, X, 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)),
@@ -106,6 +106,47 @@ static const struct {
_ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)),
};
+static const struct {
+ GLuint format, filter, flag;
+} tx_table_le[] = {
+ _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)),
+ _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)),
+ _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)),
+ _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(W, Z, Y, X, 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(X, Y, Z, W, W1Z5Y5X5)),
+ _ASSIGN(ARGB1555_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)),
+ _ASSIGN(AL88, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)),
+ _ASSIGN(AL88_REV, R300_EASY_TX_FORMAT(X, X, X, Y, 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),
+ _ASSIGN(RGB_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1)),
+ _ASSIGN(RGBA_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1)),
+ _ASSIGN(RGBA_DXT3, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3)),
+ _ASSIGN(RGBA_DXT5, R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5)),
+ _ASSIGN(RGBA_FLOAT32, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R32G32B32A32)),
+ _ASSIGN(RGBA_FLOAT16, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16)),
+ _ASSIGN(RGB_FLOAT32, 0xffffffff),
+ _ASSIGN(RGB_FLOAT16, 0xffffffff),
+ _ASSIGN(ALPHA_FLOAT32, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32)),
+ _ASSIGN(ALPHA_FLOAT16, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16)),
+ _ASSIGN(LUMINANCE_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32)),
+ _ASSIGN(LUMINANCE_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I16)),
+ _ASSIGN(LUMINANCE_ALPHA_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I32A32)),
+ _ASSIGN(LUMINANCE_ALPHA_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I16A16)),
+ _ASSIGN(INTENSITY_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, X, FL_I32)),
+ _ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)),
+ };
+
#undef _ASSIGN
@@ -133,12 +174,18 @@ static void r300SetTexImages(r300ContextPtr rmesa,
/* Set the hardware texture format
*/
- if (VALID_FORMAT(baseImage->TexFormat->MesaFormat) &&
- tx_table[baseImage->TexFormat->MesaFormat].flag) {
- t->format =
- tx_table[baseImage->TexFormat->MesaFormat].format;
- t->filter |=
- tx_table[baseImage->TexFormat->MesaFormat].filter;
+ if (VALID_FORMAT(baseImage->TexFormat->MesaFormat)) {
+ if (_mesa_little_endian()) {
+ t->format =
+ tx_table_le[baseImage->TexFormat->MesaFormat].format;
+ t->filter |=
+ tx_table_le[baseImage->TexFormat->MesaFormat].filter;
+ } else {
+ t->format =
+ tx_table_be[baseImage->TexFormat->MesaFormat].format;
+ t->filter |=
+ tx_table_be[baseImage->TexFormat->MesaFormat].filter;
+ }
} else {
_mesa_problem(NULL, "unexpected texture format in %s",
__FUNCTION__);
diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c
index cc932b86d99..2492a4a3a0a 100644
--- a/src/mesa/drivers/dri/r300/r300_vertexprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c
@@ -95,7 +95,7 @@ static struct{
};
#undef OPN
-int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst)
+int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst)
{
int pi;
struct gl_vertex_program *mesa_vp = &vp->mesa_program;
@@ -177,17 +177,9 @@ static unsigned long t_dst_class(enum register_file file)
static unsigned long t_dst_index(struct r300_vertex_program *vp, struct prog_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;
- }
- }else if(dst->File == PROGRAM_ADDRESS) {
- assert(dst->Index == 0);
- }
-
+ if(dst->File == PROGRAM_OUTPUT)
+ return vp->outputs[dst->Index];
+
return dst->Index;
}
@@ -335,6 +327,18 @@ static unsigned long op_operands(enum prog_opcode opcode)
return 0;
}
+static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_register *dst)
+{
+ if(dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1){
+ WARN_ONCE("Output %d not used by fragment program\n", dst->Index);
+ return GL_FALSE;
+ }else if(dst->File == PROGRAM_ADDRESS) {
+ assert(dst->Index == 0);
+ }
+
+ return GL_TRUE;
+}
+
/* TODO: Get rid of t_src_class call */
#define CMP_SRCS(a, b) ((a.RelAddr != b.RelAddr) || (a.Index != b.Index && \
((t_src_class(a.File) == VSF_IN_CLASS_PARAM && \
@@ -384,10 +388,8 @@ static unsigned long op_operands(enum prog_opcode opcode)
u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; \
} while (0)
-void r300_translate_vertex_shader(struct r300_vertex_program *vp)
+static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct prog_instruction *vpi)
{
- struct gl_vertex_program *mesa_vp= &vp->mesa_program;
- struct prog_instruction *vpi;
int i, cur_reg=0;
VERTEX_SHADER_INSTRUCTION *o_inst;
unsigned long operands;
@@ -399,131 +401,9 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
int u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1;
struct prog_src_register src[3];
- if (mesa_vp->Base.NumInstructions == 0)
- return;
-
- if (getenv("R300_VP_SAFETY")) {
- WARN_ONCE("R300_VP_SAFETY enabled.\n");
-
- vpi = malloc((mesa_vp->Base.NumInstructions + VSF_MAX_FRAGMENT_TEMPS) * sizeof(struct prog_instruction));
- memset(vpi, 0, VSF_MAX_FRAGMENT_TEMPS * sizeof(struct prog_instruction));
-
- for (i=0; i < VSF_MAX_FRAGMENT_TEMPS; i++) {
- vpi[i].Opcode = OPCODE_MOV;
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- vpi[i].DstReg.File = PROGRAM_TEMPORARY;
- vpi[i].DstReg.Index = i;
- vpi[i].DstReg.WriteMask = WRITEMASK_XYZW;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = 0;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE);
- }
-
- memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction));
-
- free(mesa_vp->Base.Instructions);
-
- mesa_vp->Base.Instructions = vpi;
-
- mesa_vp->Base.NumInstructions += VSF_MAX_FRAGMENT_TEMPS;
- vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1];
-
- assert(vpi->Opcode == OPCODE_END);
- }
-
- if (mesa_vp->IsPositionInvariant) {
- struct gl_program_parameter_list *paramList;
- GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
-
-#ifdef PREFER_DP4
- tokens[5] = STATE_MATRIX;
-#else
- tokens[5] = STATE_MATRIX_TRANSPOSE;
-#endif
- paramList = mesa_vp->Base.Parameters;
-
- vpi = malloc((mesa_vp->Base.NumInstructions + 4) * sizeof(struct prog_instruction));
- memset(vpi, 0, 4 * sizeof(struct prog_instruction));
-
- for (i=0; i < 4; i++) {
- GLint idx;
- tokens[3] = tokens[4] = i;
- idx = _mesa_add_state_reference(paramList, tokens);
-#ifdef PREFER_DP4
- vpi[i].Opcode = OPCODE_DP4;
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- vpi[i].DstReg.File = PROGRAM_OUTPUT;
- vpi[i].DstReg.Index = VERT_RESULT_HPOS;
- vpi[i].DstReg.WriteMask = 1 << i;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = idx;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-
- vpi[i].SrcReg[1].File = PROGRAM_INPUT;
- vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
- vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-#else
- if (i == 0)
- vpi[i].Opcode = OPCODE_MUL;
- else
- vpi[i].Opcode = OPCODE_MAD;
-
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- if (i == 3)
- vpi[i].DstReg.File = PROGRAM_OUTPUT;
- else
- vpi[i].DstReg.File = PROGRAM_TEMPORARY;
- vpi[i].DstReg.Index = 0;
- vpi[i].DstReg.WriteMask = 0xf;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = idx;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-
- vpi[i].SrcReg[1].File = PROGRAM_INPUT;
- vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
- vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i);
-
- if (i > 0) {
- vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY;
- vpi[i].SrcReg[2].Index = 0;
- vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
- }
-#endif
- }
-
- memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction));
-
- free(mesa_vp->Base.Instructions);
-
- mesa_vp->Base.Instructions = vpi;
-
- mesa_vp->Base.NumInstructions += 4;
- vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1];
-
- assert(vpi->Opcode == OPCODE_END);
-
- mesa_vp->Base.InputsRead |= (1 << VERT_ATTRIB_POS);
- mesa_vp->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS);
-
- //fprintf(stderr, "IsPositionInvariant is set!\n");
- //_mesa_print_program(&mesa_vp->Base);
- }
-
vp->pos_end=0; /* Not supported yet */
vp->program.length=0;
- vp->num_temporaries=mesa_vp->Base.NumTemporaries;
+ /*vp->num_temporaries=mesa_vp->Base.NumTemporaries;*/
for(i=0; i < VERT_ATTRIB_MAX; i++)
vp->inputs[i] = -1;
@@ -531,42 +411,49 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
for(i=0; i < VERT_RESULT_MAX; i++)
vp->outputs[i] = -1;
- assert(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS));
+ assert(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS));
/* Assign outputs */
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS))
vp->outputs[VERT_RESULT_HPOS] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ))
vp->outputs[VERT_RESULT_PSIZ] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_COL0))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL0))
vp->outputs[VERT_RESULT_COL0] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_COL1))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL1))
vp->outputs[VERT_RESULT_COL1] = cur_reg++;
#if 0 /* Not supported yet */
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_BFC0))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0))
vp->outputs[VERT_RESULT_BFC0] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_BFC1))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1))
vp->outputs[VERT_RESULT_BFC1] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_FOGC))
+ if(vp->key.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->Base.OutputsWritten & (1 << i))
+ if(vp->key.OutputsWritten & (1 << i))
vp->outputs[i] = cur_reg++;
vp->translated = GL_TRUE;
vp->native = GL_TRUE;
o_inst=vp->program.body.i;
- for(vpi=mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
+ for(; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
FREE_TEMPS();
+
+ if(!valid_dst(vp, &vpi->DstReg))
+ {
+ /* redirect result to unused temp */
+ vpi->DstReg.File = PROGRAM_TEMPORARY;
+ vpi->DstReg.Index = u_temp_i;
+ }
operands=op_operands(vpi->Opcode);
are_srcs_scalar=operands & SCALAR_FLAG;
@@ -987,3 +874,302 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
#endif
}
+static void position_invariant(struct gl_program *prog)
+{
+ struct prog_instruction *vpi;
+ struct gl_program_parameter_list *paramList;
+ int i;
+
+ GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
+
+#ifdef PREFER_DP4
+ tokens[5] = STATE_MATRIX;
+#else
+ tokens[5] = STATE_MATRIX_TRANSPOSE;
+#endif
+ paramList = prog->Parameters;
+
+ vpi = malloc((prog->NumInstructions + 4) * sizeof(struct prog_instruction));
+ memset(vpi, 0, 4 * sizeof(struct prog_instruction));
+
+ for (i=0; i < 4; i++) {
+ GLint idx;
+ tokens[3] = tokens[4] = i;
+ idx = _mesa_add_state_reference(paramList, tokens);
+#ifdef PREFER_DP4
+ vpi[i].Opcode = OPCODE_DP4;
+ vpi[i].StringPos = 0;
+ vpi[i].Data = 0;
+
+ vpi[i].DstReg.File = PROGRAM_OUTPUT;
+ vpi[i].DstReg.Index = VERT_RESULT_HPOS;
+ vpi[i].DstReg.WriteMask = 1 << i;
+ vpi[i].DstReg.CondMask = COND_TR;
+
+ vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
+ vpi[i].SrcReg[0].Index = idx;
+ vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+
+ vpi[i].SrcReg[1].File = PROGRAM_INPUT;
+ vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
+ vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+#else
+ if (i == 0)
+ vpi[i].Opcode = OPCODE_MUL;
+ else
+ vpi[i].Opcode = OPCODE_MAD;
+
+ vpi[i].StringPos = 0;
+ vpi[i].Data = 0;
+
+ if (i == 3)
+ vpi[i].DstReg.File = PROGRAM_OUTPUT;
+ else
+ vpi[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi[i].DstReg.Index = 0;
+ vpi[i].DstReg.WriteMask = 0xf;
+ vpi[i].DstReg.CondMask = COND_TR;
+
+ vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
+ vpi[i].SrcReg[0].Index = idx;
+ vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+
+ vpi[i].SrcReg[1].File = PROGRAM_INPUT;
+ vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
+ vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i);
+
+ if (i > 0) {
+ vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY;
+ vpi[i].SrcReg[2].Index = 0;
+ vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+ }
+#endif
+ }
+
+ memcpy(&vpi[i], prog->Instructions, prog->NumInstructions * sizeof(struct prog_instruction));
+
+ free(prog->Instructions);
+
+ prog->Instructions = vpi;
+
+ prog->NumInstructions += 4;
+ vpi = &prog->Instructions[prog->NumInstructions-1];
+
+ assert(vpi->Opcode == OPCODE_END);
+}
+
+static void insert_wpos(struct r300_vertex_program *vp,
+ struct gl_program *prog,
+ GLint pos)
+{
+
+ GLint tokens[6] = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0, 0 };
+ struct prog_instruction *vpi;
+ struct prog_instruction *vpi_insert;
+ GLuint temp_index;
+ GLuint window_index;
+ int i = 0;
+
+ vpi = malloc((prog->NumInstructions + 5) * sizeof(struct prog_instruction));
+ memcpy(vpi, prog->Instructions, (pos+1) * sizeof(struct prog_instruction));
+
+ vpi_insert = &vpi[pos];
+
+ /* make a copy before outputting VERT_RESULT_HPOS */
+ vpi_insert->DstReg.File = vpi_insert->SrcReg[2].File;
+ vpi_insert->DstReg.Index = temp_index = vpi_insert->SrcReg[2].Index;
+
+ vpi_insert++;
+ memset(vpi_insert, 0, 5 * sizeof(struct prog_instruction));
+
+ vpi_insert[i].Opcode = OPCODE_MOV;
+
+ vpi_insert[i].DstReg.File = PROGRAM_OUTPUT;
+ vpi_insert[i].DstReg.Index = VERT_RESULT_HPOS;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZW;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+ i++;
+
+ /* perspective divide */
+ vpi_insert[i].Opcode = OPCODE_RCP;
+
+ vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi_insert[i].DstReg.Index = temp_index;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_W;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO);
+ i++;
+
+ vpi_insert[i].Opcode = OPCODE_MUL;
+
+ vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi_insert[i].DstReg.Index = temp_index;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZ;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO);
+
+ vpi_insert[i].SrcReg[1].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[1].Index = temp_index;
+ vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_ZERO);
+ i++;
+
+ /* viewport transformation */
+ window_index = _mesa_add_state_reference(prog->Parameters, tokens);
+
+ vpi_insert[i].Opcode = OPCODE_MAD;
+
+ vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi_insert[i].DstReg.Index = temp_index;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZ;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO);
+
+ vpi_insert[i].SrcReg[1].File = PROGRAM_STATE_VAR;
+ vpi_insert[i].SrcReg[1].Index = window_index;
+ vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_ZERO);
+
+ vpi_insert[i].SrcReg[2].File = PROGRAM_STATE_VAR;
+ vpi_insert[i].SrcReg[2].Index = window_index;
+ vpi_insert[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_ZERO);
+ i++;
+
+ vpi_insert[i].Opcode = OPCODE_MUL;
+
+ vpi_insert[i].DstReg.File = PROGRAM_OUTPUT;
+ vpi_insert[i].DstReg.Index = VERT_RESULT_TEX0+vp->wpos_idx;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZW;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+
+ vpi_insert[i].SrcReg[1].File = PROGRAM_STATE_VAR;
+ vpi_insert[i].SrcReg[1].Index = window_index;
+ vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_ONE, SWIZZLE_ONE);
+ i++;
+
+ memcpy(&vpi_insert[i], &prog->Instructions[pos+1], (prog->NumInstructions-(pos+1)) * sizeof(struct prog_instruction));
+
+ free(prog->Instructions);
+
+ prog->Instructions = vpi;
+
+ prog->NumInstructions += i;
+ vpi = &prog->Instructions[prog->NumInstructions-1];
+
+ assert(vpi->Opcode == OPCODE_END);
+}
+
+static void pos_as_texcoord(struct r300_vertex_program *vp,
+ struct gl_program *prog)
+{
+ struct prog_instruction *vpi;
+ int pos = 0;
+
+ for(vpi = prog->Instructions; vpi->Opcode != OPCODE_END; vpi++, pos++){
+ if( vpi->DstReg.File == PROGRAM_OUTPUT &&
+ vpi->DstReg.Index == VERT_RESULT_HPOS ){
+ insert_wpos(vp, prog, pos);
+ break;
+ }
+ }
+
+}
+
+static struct r300_vertex_program *build_program(struct r300_vertex_program_key *wanted_key,
+ struct gl_vertex_program *mesa_vp,
+ GLint wpos_idx)
+{
+ struct r300_vertex_program *vp;
+
+ vp = _mesa_calloc(sizeof(*vp));
+ _mesa_memcpy(&vp->key, wanted_key, sizeof(vp->key));
+
+ vp->wpos_idx = wpos_idx;
+
+ if(mesa_vp->IsPositionInvariant)
+ position_invariant(&mesa_vp->Base);
+
+ if(wpos_idx > -1)
+ pos_as_texcoord(vp, &mesa_vp->Base);
+
+ assert(mesa_vp->Base.NumInstructions);
+
+ vp->num_temporaries=mesa_vp->Base.NumTemporaries;
+
+ r300_translate_vertex_shader(vp, mesa_vp->Base.Instructions);
+
+ return vp;
+}
+
+void r300_select_vertex_shader(r300ContextPtr r300)
+{
+ GLcontext *ctx = ctx = r300->radeon.glCtx;
+ GLuint InputsRead;
+ struct r300_vertex_program_key wanted_key = { 0 };
+ GLint i;
+ struct r300_vertex_program_cont *vpc;
+ struct r300_vertex_program *vp;
+ GLint wpos_idx;
+
+ vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current;
+ InputsRead = ctx->FragmentProgram._Current->Base.InputsRead;
+
+ wanted_key.OutputsWritten |= 1 << VERT_RESULT_HPOS;
+
+ wpos_idx = -1;
+ if (InputsRead & FRAG_BIT_WPOS){
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
+ break;
+
+ if(i == ctx->Const.MaxTextureUnits){
+ fprintf(stderr, "\tno free texcoord found\n");
+ exit(0);
+ }
+
+ InputsRead |= (FRAG_BIT_TEX0 << i);
+ wpos_idx = i;
+ }
+
+ if (InputsRead & FRAG_BIT_COL0)
+ wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL0;
+
+ if ((InputsRead & FRAG_BIT_COL1) /*||
+ (InputsRead & FRAG_BIT_FOGC)*/)
+ wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL1;
+
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ if (InputsRead & (FRAG_BIT_TEX0 << i))
+ wanted_key.OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i);
+
+ wanted_key.InputsRead = vpc->mesa_program.Base.InputsRead;
+
+ for (vp = vpc->progs; vp; vp = vp->next)
+ if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key)) == 0) {
+ r300->selected_vp = vp;
+ return ;
+ }
+
+ //_mesa_print_program(&vpc->mesa_program.Base);
+
+ vp = build_program(&wanted_key, &vpc->mesa_program, wpos_idx);
+ vp->next = vpc->progs;
+ vpc->progs = vp;
+
+ r300->selected_vp = vp;
+}
diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c
index e824a923aca..3a6bde8fc31 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.c
+++ b/src/mesa/drivers/dri/r300/radeon_context.c
@@ -47,11 +47,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#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 "r300_state.h"
@@ -100,28 +98,10 @@ static const GLubyte *radeonGetString(GLcontext * ctx, GLenum name)
}
}
-
-/* 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;
}
@@ -161,7 +141,8 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
/* DRI fields */
radeon->dri.context = driContextPriv;
radeon->dri.screen = sPriv;
- radeon->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
+ radeon->dri.drawable = NULL;
+ radeon->dri.readable = NULL;
radeon->dri.hwContext = driContextPriv->hHWContext;
radeon->dri.hwLock = &sPriv->pSAREA->lock;
radeon->dri.fd = sPriv->fd;
@@ -287,17 +268,17 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
if (radeon->dri.drawable != driDrawPriv) {
driDrawableInitVBlank(driDrawPriv,
- radeon->vblank_flags);
+ radeon->vblank_flags,
+ &radeon->vbl_seq);
+ }
+
+ if (radeon->dri.drawable != driDrawPriv ||
+ radeon->dri.readable != driReadPriv) {
radeon->dri.drawable = driDrawPriv;
-
+ radeon->dri.readable = driReadPriv;
+
r300UpdateWindow(radeon->glCtx);
r300UpdateViewportOffset(radeon->glCtx);
-#if R200_MERGED
- if (IS_R200_CLASS(radeon->radeonScreen)) {
- r200UpdateWindow(radeon->glCtx);
- r200UpdateViewportOffset(radeon->glCtx);
- }
-#endif
}
_mesa_make_current(radeon->glCtx,
@@ -311,13 +292,7 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
driDrawPriv->w, driDrawPriv->h);
}
- _mesa_update_state(radeon->glCtx);
-
-#if R200_MERGED
- if (IS_R200_CLASS(radeon->radeonScreen))
- r200ValidateState(radeon->glCtx);
-#endif
-
+ _mesa_update_state(radeon->glCtx);
} else {
if (RADEON_DEBUG & DEBUG_DRI)
fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h
index 0ec6466e441..07a0c7cbd6d 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.h
+++ b/src/mesa/drivers/dri/r300/radeon_context.h
@@ -120,7 +120,15 @@ extern void radeonTclFallback(GLcontext * ctx, GLuint bit, GLboolean mode);
struct radeon_dri_mirror {
__DRIcontextPrivate *context; /* DRI context */
__DRIscreenPrivate *screen; /* DRI screen */
- __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
+ /**
+ * DRI drawable bound to this context for drawing.
+ */
+ __DRIdrawablePrivate *drawable;
+
+ /**
+ * DRI drawable bound to this context for reading.
+ */
+ __DRIdrawablePrivate *readable;
drm_context_t hwContext;
drm_hw_lock_t *hwLock;
diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c
index d5b53194189..0b8656b9c1d 100644
--- a/src/mesa/drivers/dri/r300/radeon_ioctl.c
+++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c
@@ -40,16 +40,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#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"
-#if R200_MERGED
-#include "r200_tcl.h"
-#include "r200_sanity.h"
-#endif
#include "r300_state.h"
#include "radeon_reg.h"
@@ -245,10 +238,7 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv,
UNLOCK_HARDWARE(radeon);
if (!rect)
{
- if (IS_R200_CLASS(radeon->radeonScreen))
- ((r200ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
- else
- ((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
+ ((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
radeon->swap_count++;
(*dri_interface->getUST) (&ust);
@@ -334,14 +324,6 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
radeon->state.color.drawPitch = radeon->radeonScreen->backPitch;
}
- if (IS_R200_CLASS(radeon->radeonScreen)) {
- 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_R300_CLASS(radeon->radeonScreen)) {
r300ContextPtr r300 = (r300ContextPtr)radeon;
R300_STATECHANGE(r300, cb);
@@ -372,7 +354,7 @@ void radeonWaitForIdleLocked(radeonContextPtr radeon)
if (ret < 0) {
UNLOCK_HARDWARE(radeon);
- fprintf(stderr, "Error: R200 timed out... exiting\n");
+ fprintf(stderr, "Error: R300 timed out... exiting\n");
exit(-1);
}
}
@@ -390,10 +372,6 @@ void radeonFlush(GLcontext * ctx)
if (IS_R300_CLASS(radeon->radeonScreen))
r300Flush(ctx);
-#if R200_MERGED
- else
- r200Flush(ctx);
-#endif
}
diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c
index edf26183148..a00da6c8bc3 100644
--- a/src/mesa/drivers/dri/r300/radeon_lock.c
+++ b/src/mesa/drivers/dri/r300/radeon_lock.c
@@ -33,12 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <string.h>
-#include "r200_context.h"
#include "radeon_lock.h"
-#if R200_MERGED
-#include "r200_tex.h"
-#endif
-#include "r200_state.h"
#include "radeon_ioctl.h"
#include "radeon_state.h"
#include "r300_context.h"
@@ -79,64 +74,31 @@ static void radeonUpdatePageFlipping(radeonContextPtr radeon)
/**
* 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;
+{
int i;
+ __DRIdrawablePrivate *const drawable = radeon->dri.drawable;
r300ContextPtr r300 = (r300ContextPtr)radeon;
+ drm_radeon_sarea_t *sarea = radeon->sarea;
- if (radeon->lastStamp != dPriv->lastStamp) {
- _mesa_resize_framebuffer(radeon->glCtx,
- (GLframebuffer*)dPriv->driverPrivate,
- dPriv->w, dPriv->h);
-
+ if ( radeon->lastStamp != drawable->lastStamp ) {
radeonUpdatePageFlipping(radeon);
-
- if (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
- radeonSetCliprects(radeon, GL_BACK_LEFT);
- else
- radeonSetCliprects(radeon, GL_FRONT_LEFT);
-
+ radeonSetCliprects(radeon);
#if 1
r300UpdateViewportOffset( radeon->glCtx );
- driUpdateFramebufferSize(radeon->glCtx, dPriv);
+ driUpdateFramebufferSize(radeon->glCtx, drawable);
#else
radeonUpdateScissor(radeon->glCtx);
#endif
- radeon->lastStamp = dPriv->lastStamp;
+ radeon->lastStamp = drawable->lastStamp;
}
- for (i = 0; i < r300->nr_heaps; i++) {
- DRI_AGE_TEXTURES(r300->texture_heaps[i]);
+ if (sarea->ctx_owner != radeon->dri.hwContext) {
+ sarea->ctx_owner = radeon->dri.hwContext;
+
+ for (i = 0; i < r300->nr_heaps; i++) {
+ DRI_AGE_TEXTURES(r300->texture_heaps[i]);
+ }
}
}
@@ -150,11 +112,11 @@ static void r300RegainedLock(radeonContextPtr radeon)
*/
void radeonGetLock(radeonContextPtr radeon, GLuint flags)
{
- __DRIdrawablePrivate *dPriv = radeon->dri.drawable;
+ __DRIdrawablePrivate *const drawable = radeon->dri.drawable;
+ __DRIdrawablePrivate *const readable = radeon->dri.readable;
__DRIscreenPrivate *sPriv = radeon->dri.screen;
- drm_radeon_sarea_t *sarea = radeon->sarea;
- assert (dPriv != NULL);
+ assert (drawable != NULL);
drmGetLock(radeon->dri.fd, radeon->dri.hwContext, flags);
@@ -166,17 +128,13 @@ void radeonGetLock(radeonContextPtr radeon, GLuint flags)
* 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;
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable );
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable );
+ }
if (IS_R300_CLASS(radeon->radeonScreen))
r300RegainedLock(radeon);
-#if R200_MERGED
- else
- r200RegainedLock((r200ContextPtr)radeon);
-#endif
radeon->lost_context = GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/r300/radeon_mm.c b/src/mesa/drivers/dri/r300/radeon_mm.c
index 7595d2144f7..f86a1b4e72e 100644
--- a/src/mesa/drivers/dri/r300/radeon_mm.c
+++ b/src/mesa/drivers/dri/r300/radeon_mm.c
@@ -213,7 +213,7 @@ int radeon_mm_alloc(r300ContextPtr rmesa, int alignment, int size)
}
goto again;
#else
- WARN_ONCE("Ran out of GART memory!\nPlease consider adjusting GARTSize option.\n");
+ WARN_ONCE("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", size);
return 0;
#endif
}
diff --git a/src/mesa/drivers/dri/r300/radeon_state.c b/src/mesa/drivers/dri/r300/radeon_state.c
index a6375ff878f..0ceaf7ebb7d 100644
--- a/src/mesa/drivers/dri/r300/radeon_state.c
+++ b/src/mesa/drivers/dri/r300/radeon_state.c
@@ -46,12 +46,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#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"
-
+#include "framebuffer.h"
/* =============================================================
* Scissoring
@@ -136,12 +134,9 @@ void radeonUpdateScissor(GLcontext* ctx)
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 */
r300Flush(ctx);
-
radeonUpdateScissor(ctx);
}
}
@@ -150,31 +145,42 @@ static void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h
/**
* Update cliprects and scissors.
*/
-void radeonSetCliprects(radeonContextPtr radeon, GLenum mode)
+void radeonSetCliprects(radeonContextPtr radeon)
{
- __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;
+ __DRIdrawablePrivate *const drawable = radeon->dri.drawable;
+ __DRIdrawablePrivate *const readable = radeon->dri.readable;
+ GLframebuffer *const draw_fb = (GLframebuffer*)drawable->driverPrivate;
+ GLframebuffer *const read_fb = (GLframebuffer*)readable->driverPrivate;
+
+ if (draw_fb->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) {
+ /* Can't ignore 2d windows if we are page flipping. */
+ if (drawable->numBackClipRects == 0 || radeon->doPageFlip) {
+ radeon->numClipRects = drawable->numClipRects;
+ radeon->pClipRects = drawable->pClipRects;
} else {
- radeon->numClipRects = dPriv->numBackClipRects;
- radeon->pClipRects = dPriv->pBackClipRects;
+ radeon->numClipRects = drawable->numBackClipRects;
+ radeon->pClipRects = drawable->pBackClipRects;
+ }
+ } else {
+ /* front buffer (or none, or multiple buffers */
+ radeon->numClipRects = drawable->numClipRects;
+ radeon->pClipRects = drawable->pClipRects;
+ }
+
+ if ((draw_fb->Width != drawable->w) ||
+ (draw_fb->Height != drawable->h)) {
+ _mesa_resize_framebuffer(radeon->glCtx, draw_fb,
+ drawable->w, drawable->h);
+ draw_fb->Initialized = GL_TRUE;
+ }
+
+ if (drawable != readable) {
+ if ((read_fb->Width != readable->w) ||
+ (read_fb->Height != readable->h)) {
+ _mesa_resize_framebuffer(radeon->glCtx, read_fb,
+ readable->w, readable->h);
+ read_fb->Initialized = GL_TRUE;
}
- break;
- default:
- fprintf(stderr, "bad mode in radeonSetCliprects\n");
- radeon->numClipRects = 0;
- radeon->pClipRects = 0;
- return;
}
if (radeon->state.scissor.enabled)
diff --git a/src/mesa/drivers/dri/r300/radeon_state.h b/src/mesa/drivers/dri/r300/radeon_state.h
index 636bf5d0086..c2d041eb4ae 100644
--- a/src/mesa/drivers/dri/r300/radeon_state.h
+++ b/src/mesa/drivers/dri/r300/radeon_state.h
@@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_context.h"
extern void radeonRecalcScissorRects(radeonContextPtr radeon);
-extern void radeonSetCliprects(radeonContextPtr radeon, GLenum mode);
+extern void radeonSetCliprects(radeonContextPtr radeon);
extern void radeonUpdateScissor(GLcontext* ctx);
extern void radeonEnable(GLcontext* ctx, GLenum cap, GLboolean state);
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 2167e7afe82..8b92e3fe65f 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -70,7 +70,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
-#define DRIVER_DATE "20060327"
+#define DRIVER_DATE "20061018"
#include "vblank.h"
#include "utils.h"
@@ -80,21 +80,6 @@ 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 )
@@ -186,8 +171,6 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = {
*/
static void radeonInitDriverFuncs( struct dd_function_table *functions )
{
- functions->GetBufferSize = radeonGetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
functions->GetString = radeonGetString;
}
@@ -281,7 +264,8 @@ radeonCreateContext( const __GLcontextModes *glVisual,
/* Init radeon context data */
rmesa->dri.context = driContextPriv;
rmesa->dri.screen = sPriv;
- rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
+ rmesa->dri.drawable = NULL;
+ rmesa->dri.readable = NULL;
rmesa->dri.hwContext = driContextPriv->hHWContext;
rmesa->dri.hwLock = &sPriv->pSAREA->lock;
rmesa->dri.fd = sPriv->fd;
@@ -620,12 +604,19 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
if ( newCtx->dri.drawable != driDrawPriv ) {
/* XXX we may need to validate the drawable here!!! */
- driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags );
+ driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
+ &newCtx->vbl_seq );
+ }
+
+ if ( (newCtx->dri.drawable != driDrawPriv)
+ || (newCtx->dri.readable != driReadPriv) ) {
newCtx->dri.drawable = driDrawPriv;
+ newCtx->dri.readable = driReadPriv;
+
radeonUpdateWindow( newCtx->glCtx );
radeonUpdateViewportOffset( newCtx->glCtx );
}
-
+
_mesa_make_current( newCtx->glCtx,
(GLframebuffer *) driDrawPriv->driverPrivate,
(GLframebuffer *) driReadPriv->driverPrivate );
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h
index 9902e60c595..0a7c3b2f544 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.h
+++ b/src/mesa/drivers/dri/radeon/radeon_context.h
@@ -496,7 +496,16 @@ struct radeon_dma {
struct radeon_dri_mirror {
__DRIcontextPrivate *context; /* DRI context */
__DRIscreenPrivate *screen; /* DRI screen */
- __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
+
+ /**
+ * DRI drawable bound to this context for drawing.
+ */
+ __DRIdrawablePrivate *drawable;
+
+ /**
+ * DRI drawable bound to this context for reading.
+ */
+ __DRIdrawablePrivate *readable;
drm_context_t hwContext;
drm_hw_lock_t *hwLock;
diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c
index aee849e13bf..737490fcde0 100644
--- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c
+++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c
@@ -1021,8 +1021,7 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv )
*/
#define RADEON_MAX_CLEARS 256
-static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void radeonClear( GLcontext *ctx, GLbitfield mask )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
@@ -1031,10 +1030,10 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLuint flags = 0;
GLuint color_mask = 0;
GLint ret, i;
+ GLint cx, cy, cw, ch;
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 );
+ fprintf( stderr, "radeonClear\n");
}
{
@@ -1071,7 +1070,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
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 );
+ _swrast_Clear( ctx, mask );
}
if ( !flags )
@@ -1094,6 +1093,12 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
LOCK_HARDWARE( rmesa );
+ /* compute region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
/* Throttle the number of clear ioctls we do.
*/
while ( 1 ) {
@@ -1132,7 +1137,8 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
GLint n = 0;
- if ( !all ) {
+ if (cw != dPriv->w || ch != dPriv->h) {
+ /* clear subregion */
for ( ; i < nr ; i++ ) {
GLint x = box[i].x1;
GLint y = box[i].y1;
@@ -1154,6 +1160,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
n++;
}
} else {
+ /* clear whole buffer */
for ( ; i < nr ; i++ ) {
*b++ = box[i];
n++;
diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c
index ba87271f2f5..e6ab6af4562 100644
--- a/src/mesa/drivers/dri/radeon/radeon_lock.c
+++ b/src/mesa/drivers/dri/radeon/radeon_lock.c
@@ -71,7 +71,8 @@ radeonUpdatePageFlipping( radeonContextPtr rmesa )
*/
void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const readable = rmesa->dri.readable;
__DRIscreenPrivate *sPriv = rmesa->dri.screen;
drm_radeon_sarea_t *sarea = rmesa->sarea;
@@ -85,14 +86,17 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
* 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 );
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable );
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable );
+ }
- if ( rmesa->lastStamp != dPriv->lastStamp ) {
+ if ( rmesa->lastStamp != drawable->lastStamp ) {
radeonUpdatePageFlipping( rmesa );
radeonSetCliprects( rmesa );
radeonUpdateViewportOffset( rmesa->glCtx );
- driUpdateFramebufferSize(rmesa->glCtx, dPriv);
- rmesa->lastStamp = dPriv->lastStamp;
+ driUpdateFramebufferSize(rmesa->glCtx, drawable);
+ rmesa->lastStamp = drawable->lastStamp;
}
RADEON_STATECHANGE( rmesa, ctx );
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 140d848d9ae..279357ab590 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -130,6 +130,7 @@ extern const struct dri_extension blend_extensions[];
extern const struct dri_extension ARB_vp_extension[];
extern const struct dri_extension NV_vp_extension[];
extern const struct dri_extension ATI_fs_extension[];
+extern const struct dri_extension point_extensions[];
#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
@@ -726,6 +727,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
(*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
(*glx_enable_extension)( psc, "GLX_MESA_copy_sub_buffer" );
+ (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
}
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
@@ -1042,6 +1044,7 @@ __driCreateNewScreen_20050727( __DRInativeDisplay *dpy,
driInitSingleExtension( NULL, ARB_vp_extension );
driInitSingleExtension( NULL, NV_vp_extension );
driInitSingleExtension( NULL, ATI_fs_extension );
+ driInitExtensions( NULL, point_extensions, GL_FALSE );
#endif
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c
index 449c63eb7a2..216d7dca174 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "light.h"
#include "state.h"
#include "context.h"
+#include "framebuffer.h"
#include "array_cache/acache.h"
#include "tnl/tnl.h"
@@ -1635,25 +1636,42 @@ static void radeonLogicOpCode( GLcontext *ctx, GLenum opcode )
*/
void radeonSetCliprects( radeonContextPtr rmesa )
{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const readable = rmesa->dri.readable;
+ GLframebuffer *const draw_fb = (GLframebuffer*) drawable->driverPrivate;
+ GLframebuffer *const read_fb = (GLframebuffer*) readable->driverPrivate;
- if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]
+ if (draw_fb->_ColorDrawBufferMask[0]
== BUFFER_BIT_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;
+ if ( drawable->numBackClipRects == 0 || rmesa->doPageFlip ) {
+ rmesa->numClipRects = drawable->numClipRects;
+ rmesa->pClipRects = drawable->pClipRects;
}
else {
- rmesa->numClipRects = dPriv->numBackClipRects;
- rmesa->pClipRects = dPriv->pBackClipRects;
+ rmesa->numClipRects = drawable->numBackClipRects;
+ rmesa->pClipRects = drawable->pBackClipRects;
}
}
else {
/* front buffer (or none, or multiple buffers */
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
+ rmesa->numClipRects = drawable->numClipRects;
+ rmesa->pClipRects = drawable->pClipRects;
+ }
+
+ if ((draw_fb->Width != drawable->w) || (draw_fb->Height != drawable->h)) {
+ _mesa_resize_framebuffer(rmesa->glCtx, draw_fb,
+ drawable->w, drawable->h);
+ draw_fb->Initialized = GL_TRUE;
+ }
+
+ if (drawable != readable) {
+ if ((read_fb->Width != readable->w) || (read_fb->Height != readable->h)) {
+ _mesa_resize_framebuffer(rmesa->glCtx, read_fb,
+ readable->w, readable->h);
+ read_fb->Initialized = GL_TRUE;
+ }
}
if (rmesa->state.scissor.enabled)
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 1e3a3951e2d..37bb749223a 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -523,9 +523,10 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int 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
+ * 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.
+ * textures being a notable exception. Doesn't work for luminance
+ * textures realized with I8 and ALPHA_IN_MAP not set neither (on r100).
*/
/* Don't cache these results.
*/
@@ -555,7 +556,10 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
assert(op <= 3);
switch ( srcRGBi ) {
case GL_TEXTURE:
- color_arg[i] = radeon_texture_color[op][unit];
+ if (texUnit->_Current->Image[0][0]->_BaseFormat == GL_ALPHA)
+ color_arg[i] = radeon_zero_color[op];
+ else
+ color_arg[i] = radeon_texture_color[op][unit];
break;
case GL_CONSTANT:
color_arg[i] = radeon_tfactor_color[op];
@@ -574,12 +578,17 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_TEXTURE0:
case GL_TEXTURE1:
- case GL_TEXTURE2:
+ case GL_TEXTURE2: {
+ GLuint txunit = srcRGBi - GL_TEXTURE0;
+ if (ctx->Texture.Unit[txunit]._Current->Image[0][0]->_BaseFormat == GL_ALPHA)
+ color_arg[i] = radeon_zero_color[op];
+ else
/* 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;
+ color_arg[i] = radeon_texture_color[op][txunit];
+ }
+ break;
default:
return GL_FALSE;
}
@@ -592,7 +601,10 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
assert(op <= 1);
switch ( srcAi ) {
case GL_TEXTURE:
- alpha_arg[i] = radeon_texture_alpha[op][unit];
+ if (texUnit->_Current->Image[0][0]->_BaseFormat == GL_LUMINANCE)
+ alpha_arg[i] = radeon_zero_alpha[op+1];
+ else
+ alpha_arg[i] = radeon_texture_alpha[op][unit];
break;
case GL_CONSTANT:
alpha_arg[i] = radeon_tfactor_alpha[op];
@@ -611,9 +623,14 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
break;
case GL_TEXTURE0:
case GL_TEXTURE1:
- case GL_TEXTURE2:
- alpha_arg[i] = radeon_texture_alpha[op][srcAi - GL_TEXTURE0];
- break;
+ case GL_TEXTURE2: {
+ GLuint txunit = srcAi - GL_TEXTURE0;
+ if (ctx->Texture.Unit[txunit]._Current->Image[0][0]->_BaseFormat == GL_LUMINANCE)
+ alpha_arg[i] = radeon_zero_alpha[op+1];
+ else
+ alpha_arg[i] = radeon_texture_alpha[op][txunit];
+ }
+ break;
default:
return GL_FALSE;
}
@@ -848,7 +865,7 @@ static void import_tex_obj_state( radeonContextPtr rmesa,
radeonTexObjPtr texobj )
{
/* do not use RADEON_DB_STATE to avoid stale texture caches */
- GLuint *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
+ int *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT];
RADEON_STATECHANGE( rmesa, tex[unit] );
@@ -871,7 +888,7 @@ static void import_tex_obj_state( radeonContextPtr rmesa,
se_coord_fmt &= ~(RADEON_VTX_ST0_NONPARAMETRIC << unit);
if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) {
- GLuint *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
+ int *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
GLuint bytesPerFace = texobj->base.totalSize / 6;
ASSERT(texobj->base.totalSize % 6 == 0);
diff --git a/src/mesa/drivers/dri/s3v/s3v_dd.c b/src/mesa/drivers/dri/s3v/s3v_dd.c
index 2c8e230f3ef..1cbe890319a 100644
--- a/src/mesa/drivers/dri/s3v/s3v_dd.c
+++ b/src/mesa/drivers/dri/s3v/s3v_dd.c
@@ -85,24 +85,6 @@ void s3vInitExtensions( GLcontext *ctx )
*/
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;
+ ctx->Driver.GetBufferSize = s3vDDGetBufferSize;
+ ctx->Driver.GetString = s3vDDGetString;
}
diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c
index e692f20e8a9..fcea901c1c9 100644
--- a/src/mesa/drivers/dri/s3v/s3v_state.c
+++ b/src/mesa/drivers/dri/s3v/s3v_state.c
@@ -73,11 +73,16 @@ static void s3vDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
* Buffer clear
*/
-static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void s3vDDClear( GLcontext *ctx, GLbitfield mask )
{
s3vContextPtr vmesa = S3V_CONTEXT(ctx);
unsigned int _stride;
+ GLint cx = ctx->DrawBuffer->_Xmin;
+ GLint cy = ctx->DrawBuffer->_Ymin;
+ GLint cw = ctx->DrawBuffer->_Xmax - cx;
+ GLint ch = ctx->DrawBuffer->_Ymax - cy;
+
+ /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */
vmesa->restore_primitive = -1;
@@ -120,7 +125,7 @@ static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
if (mask & BUFFER_BIT_DEPTH) { /* depth */
DEBUG(("BUFFER_BIT_DEPTH\n"));
- _stride = ((cw+31)&~31) * 2;
+ _stride = ((cw+31)&~31) * 2; /* XXX cw or Buffer->Width??? */
DMAOUT_CHECK(BITBLT_SRC_BASE, 15);
DMAOUT(0);
@@ -157,7 +162,7 @@ static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
if ( mask )
DEBUG(("still masked ;3(\n")); */ /* yes */
#else
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
#endif
}
diff --git a/src/mesa/drivers/dri/savage/savage_init.h b/src/mesa/drivers/dri/savage/savage_init.h
index 0dec397b7ba..43fb969c693 100644
--- a/src/mesa/drivers/dri/savage/savage_init.h
+++ b/src/mesa/drivers/dri/savage/savage_init.h
@@ -80,21 +80,10 @@ typedef struct {
} 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 );
+extern void savageXMesaSetClipRects(savageContextPtr imesa);
#define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index aaba58ed33e..f51e321a4a6 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -173,6 +173,9 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
{
savageScreenPrivate *savageScreen;
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
+
if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
@@ -260,6 +263,11 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
driParseOptionInfo (&savageScreen->optionCache,
__driConfigOptions, __driNConfigOptions);
+ if (glx_enable_extension != NULL) {
+ (*glx_enable_extension)(sPriv->psc->screenConfigs,
+ "GLX_SGI_make_current_read");
+ }
+
#if 0
savageDDFastPathInit();
savageDDTrifuncInit();
@@ -716,34 +724,18 @@ void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv)
}
#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 )
+void savageXMesaSetClipRects(savageContextPtr imesa)
{
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
- if (dPriv->numBackClipRects == 0)
- {
-
-
+ if ((dPriv->numBackClipRects == 0)
+ || (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)) {
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;
@@ -756,18 +748,17 @@ void savageXMesaSetBackClipRects( savageContextPtr imesa )
static void savageXMesaWindowMoved( savageContextPtr imesa )
{
+ __DRIdrawablePrivate *const drawable = imesa->driDrawable;
+ __DRIdrawablePrivate *const readable = imesa->driReadable;
+
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;
+ savageXMesaSetClipRects(imesa);
+
+ driUpdateFramebufferSize(imesa->glCtx, drawable);
+ if (drawable != readable) {
+ driUpdateFramebufferSize(imesa->glCtx, readable);
}
}
@@ -858,11 +849,12 @@ savageMakeCurrent(__DRIcontextPrivate *driContextPriv,
void savageGetLock( savageContextPtr imesa, GLuint flags )
{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
+ __DRIdrawablePrivate *const drawable = imesa->driDrawable;
+ __DRIdrawablePrivate *const readable = imesa->driReadable;
__DRIscreenPrivate *sPriv = imesa->driScreen;
drm_savage_sarea_t *sarea = imesa->sarea;
int me = imesa->hHWContext;
- int stamp = dPriv->lastStamp;
+ int stamp = drawable->lastStamp;
int heap;
unsigned int timestamp = 0;
@@ -882,10 +874,11 @@ void savageGetLock( savageContextPtr imesa, GLuint flags )
* NOTE: This releases and regains the hw lock, so all state
* checking must be done *after* this call:
*/
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
+ }
-
/* If we lost context, need to dump all registers to hardware.
* Note that we don't care about 2d contexts, even if they perform
@@ -916,8 +909,8 @@ void savageGetLock( savageContextPtr imesa, GLuint flags )
DRI_AGE_TEXTURES( imesa->textureHeaps[heap] );
}
- if (dPriv->lastStamp != stamp) {
- driUpdateFramebufferSize(imesa->glCtx, dPriv);
+ if (drawable->lastStamp != stamp) {
+ driUpdateFramebufferSize(imesa->glCtx, drawable);
savageXMesaWindowMoved( imesa );
}
}
diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c
index ced44e562f7..a5c5310e287 100644
--- a/src/mesa/drivers/dri/savage/savagedd.c
+++ b/src/mesa/drivers/dri/savage/savagedd.c
@@ -42,7 +42,7 @@
#include "utils.h"
-#define DRIVER_DATE "20050829"
+#define DRIVER_DATE "20061110"
/***************************************
* Mesa's Driver Functions
@@ -95,25 +95,7 @@ static GLint savageGetParameteri(const GLcontext *ctx, GLint param)
#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/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c
index 244959d64f9..4eac1fb3498 100644
--- a/src/mesa/drivers/dri/savage/savageioctl.c
+++ b/src/mesa/drivers/dri/savage/savageioctl.c
@@ -327,11 +327,16 @@ static GLuint savageIntersectClipRects(drm_clip_rect_t *dest,
}
-static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void savageDDClear( GLcontext *ctx, GLbitfield mask )
{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
+ savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
GLuint colorMask, depthMask, clearColor, clearDepth, flags;
+ GLint cx = ctx->DrawBuffer->_Xmin;
+ GLint cy = ctx->DrawBuffer->_Ymin;
+ GLint cw = ctx->DrawBuffer->_Xmax - cx;
+ GLint ch = ctx->DrawBuffer->_Ymax - cy;
+
+ /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */
if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
fprintf (stderr, "%s\n", __FUNCTION__);
@@ -420,7 +425,7 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
}
/*
diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c
index 606c7d50c7e..61ab9e6d64a 100644
--- a/src/mesa/drivers/dri/savage/savagespan.c
+++ b/src/mesa/drivers/dri/savage/savagespan.c
@@ -33,9 +33,8 @@
#define DBG 0
#define LOCAL_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
GLuint cpp = drb->cpp; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
@@ -44,9 +43,8 @@
(void) p
#define LOCAL_DEPTH_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
GLuint zpp = drb->cpp; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
@@ -234,10 +232,7 @@ void savageDDInitSpanFuncs( GLcontext *ctx )
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
swdd->SpanRenderStart = savageSpanRenderStart;
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
+ /* XXX these should probably be plugged in elsewhere */
ctx->Driver.CopyPixels = savageCopyPixels;
ctx->Driver.DrawPixels = savageDrawPixels;
ctx->Driver.ReadPixels = savageReadPixels;
diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c
index 3a267e025c9..2f20dc23b6e 100644
--- a/src/mesa/drivers/dri/savage/savagestate.c
+++ b/src/mesa/drivers/dri/savage/savagestate.c
@@ -647,23 +647,20 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
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;
}
+ imesa->NotFirstFrame = GL_FALSE;
+ savageXMesaSetClipRects(imesa);
+ FALLBACK(ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE);
+
if (destCtrl != imesa->regs.s4.destCtrl.ui)
imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
}
@@ -1695,11 +1692,6 @@ void savageDDInitStateFuncs(GLcontext *ctx)
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;
@@ -1708,9 +1700,6 @@ void savageDDInitStateFuncs(GLcontext *ctx)
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;
@@ -1736,11 +1725,4 @@ void savageDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.StencilMaskSeparate = NULL;
ctx->Driver.StencilOpSeparate = NULL;
}
-
- /* 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/src/mesa/drivers/dri/sis/sis6326_clear.c b/src/mesa/drivers/dri/sis/sis6326_clear.c
index be5addb7cf2..48db19566c6 100644
--- a/src/mesa/drivers/dri/sis/sis6326_clear.c
+++ b/src/mesa/drivers/dri/sis/sis6326_clear.c
@@ -69,25 +69,18 @@ sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z)
}
void
-sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height)
+sis6326DDClear(GLcontext *ctx, GLbitfield mask)
{
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;
- }
+ /* get region after locking: */
+ x1 = ctx->DrawBuffer->_Xmin;
+ y1 = ctx->DrawBuffer->_Ymin;
+ width1 = ctx->DrawBuffer->_Xmax - x1;
+ height1 = ctx->DrawBuffer->_Ymax - y1;
+ y1 = Y_FLIP(y1 + height1 - 1);
+
/* XXX: Scissoring */
fprintf(stderr, "Clear\n");
@@ -116,7 +109,7 @@ sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
UNLOCK_HARDWARE();
if (mask != 0)
- _swrast_Clear(ctx, mask, all, x1, y1, width, height);
+ _swrast_Clear(ctx, mask);
}
diff --git a/src/mesa/drivers/dri/sis/sis6326_state.c b/src/mesa/drivers/dri/sis/sis6326_state.c
index be229d019f5..6bc2c6de3bf 100644
--- a/src/mesa/drivers/dri/sis/sis6326_state.c
+++ b/src/mesa/drivers/dri/sis/sis6326_state.c
@@ -727,27 +727,9 @@ void sis6326DDInitStateFuncs( GLcontext *ctx )
ctx->Driver.Enable = sis6326DDEnable;
ctx->Driver.FrontFace = sis6326DDFrontFace;
ctx->Driver.Fogfv = sis6326DDFogfv;
- ctx->Driver.Hint = NULL;
- ctx->Driver.Lightfv = NULL;
ctx->Driver.LogicOpcode = sis6326DDLogicOpCode;
- ctx->Driver.PolygonMode = NULL;
- ctx->Driver.PolygonStipple = NULL;
- ctx->Driver.RenderMode = NULL;
ctx->Driver.Scissor = sis6326DDScissor;
ctx->Driver.ShadeModel = sis6326DDShadeModel;
ctx->Driver.LightModelfv = sis6326DDLightModelfv;
ctx->Driver.Viewport = sis6326DDViewport;
-
- /* 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/src/mesa/drivers/dri/sis/sis_clear.c b/src/mesa/drivers/dri/sis/sis_clear.c
index 637d502381e..fb92d06c735 100644
--- a/src/mesa/drivers/dri/sis/sis_clear.c
+++ b/src/mesa/drivers/dri/sis/sis_clear.c
@@ -95,27 +95,18 @@ sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, GLint stencil )
}
void
-sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+sisDDClear( GLcontext * ctx, GLbitfield mask )
{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- GLint x1, y1, width1, height1;
+ sisContextPtr smesa = SIS_CONTEXT(ctx);
- if (all) {
- GLframebuffer *buffer = ctx->DrawBuffer;
+ GLint x1, y1, width1, height1;
- 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 */
+ /* get region after locking: */
+ x1 = ctx->DrawBuffer->_Xmin;
+ y1 = ctx->DrawBuffer->_Ymin;
+ width1 = ctx->DrawBuffer->_Xmax - x1;
+ height1 = ctx->DrawBuffer->_Ymax - y1;
+ y1 = Y_FLIP(y1 + height1 - 1);
/* Mask out any non-existent buffers */
if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask)
@@ -153,7 +144,7 @@ sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all,
UNLOCK_HARDWARE();
if (mask != 0)
- _swrast_Clear( ctx, mask, all, x1, y1, width, height );
+ _swrast_Clear( ctx, mask);
}
@@ -337,9 +328,7 @@ 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;
@@ -387,8 +376,6 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y,
if (width <= 0 || height <= 0)
continue;
- int cmd;
-
mWait3DCmdQueue (8);
MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ?
BLIT_DEPTH_32 : BLIT_DEPTH_16);
diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c
index 4fd692ec240..8f52cfe098e 100644
--- a/src/mesa/drivers/dri/sis/sis_screen.c
+++ b/src/mesa/drivers/dri/sis/sis_screen.c
@@ -209,7 +209,7 @@ sisCreateBuffer( __DRIscreenPrivate *driScrnPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
{
- sisScreenPtr screen = (sisScreenPtr) driScrnPriv->private;
+ /*sisScreenPtr screen = (sisScreenPtr) driScrnPriv->private;*/
struct gl_framebuffer *fb;
if (isPixmap)
diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c
index a30001c7462..2a10a5fbf62 100644
--- a/src/mesa/drivers/dri/sis/sis_state.c
+++ b/src/mesa/drivers/dri/sis/sis_state.c
@@ -861,18 +861,6 @@ void sisDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.LightModelfv = sisDDLightModelfv;
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;
-
+ /* XXX this should go away */
ctx->Driver.ResizeBuffers = sisReAllocateBuffers;
- /* 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/src/mesa/drivers/dri/sis/sis_state.h b/src/mesa/drivers/dri/sis/sis_state.h
index 580a522bf34..8f7e2acb92d 100644
--- a/src/mesa/drivers/dri/sis/sis_state.h
+++ b/src/mesa/drivers/dri/sis/sis_state.h
@@ -35,15 +35,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sis_context.h"
/* sis6326_clear.c */
-extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
+extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask );
extern void sis6326DDClearColor( GLcontext * ctx, const GLfloat color[4] );
extern void sis6326DDClearDepth( GLcontext * ctx, GLclampd d );
extern void sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z);
/* sis_clear.c */
-extern void sisDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
+extern void sisDDClear( GLcontext *ctx, GLbitfield mask );
extern void sisDDClearColor( GLcontext * ctx, const GLfloat color[4] );
extern void sisDDClearDepth( GLcontext * ctx, GLclampd d );
extern void sisDDClearStencil( GLcontext * ctx, GLint s );
diff --git a/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S b/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S
deleted file mode 100644
index 0f4cc45089b..00000000000
--- a/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/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h b/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h
deleted file mode 100644
index 9ec4935d781..00000000000
--- a/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/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c
index dd40544d490..bd9dade89b5 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c
@@ -23,19 +23,14 @@
* 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>
+/**
+ * \file tdfx_context.c
+ * Context management functions for 3Dfx hardware.
*
+ * \author Gareth Hughes <gareth@valinux.com> (original rewrite 29 Sep - 1 Oct 2000)
+ * \author Brian Paul <brianp@valinux.com>
+ * \author Daniel Borca <dborca@users.sourceforge.net> (new fixes 19 Jul 2004)
*/
#include <dlfcn.h>
@@ -65,6 +60,7 @@
#define need_GL_ARB_multisample
/* #define need_GL_ARB_point_parameters */
+#define need_GL_ARB_occlusion_query
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
/* #define need_GL_ARB_vertex_program */
@@ -87,6 +83,7 @@
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
+ { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
@@ -660,8 +657,10 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
GLcontext *newCtx = newFx->glCtx;
GET_CURRENT_CONTEXT(curCtx);
- if ( newFx->driDrawable != driDrawPriv ) {
+ if ((newFx->driDrawable != driDrawPriv)
+ || (newFx->driReadable != driReadPriv)) {
newFx->driDrawable = driDrawPriv;
+ newFx->driReadable = driReadPriv;
newFx->dirty = ~0;
}
else {
@@ -679,6 +678,11 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
newFx->dirty = ~0;
}
+ driUpdateFramebufferSize(newCtx, driDrawPriv);
+ if (driDrawPriv != driReadPriv) {
+ driUpdateFramebufferSize(newCtx, driReadPriv);
+ }
+
if ( !newFx->Glide.Initialized ) {
if ( !tdfxInitContext( driDrawPriv, newFx ) )
return GL_FALSE;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.h b/src/mesa/drivers/dri/tdfx/tdfx_context.h
index b8349fec73b..89a7a9d6c4e 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.h
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.h
@@ -895,7 +895,17 @@ struct tdfx_context {
/* stuff added for DRI */
__DRIscreenPrivate *driScreen;
__DRIcontextPrivate *driContext;
- __DRIdrawablePrivate *driDrawable;
+
+ /**
+ * DRI drawable bound to this context for drawing.
+ */
+ __DRIdrawablePrivate *driDrawable;
+
+ /**
+ * DRI drawable bound to this context for reading.
+ */
+ __DRIdrawablePrivate *driReadable;
+
drm_context_t hHWContext;
drm_hw_lock_t *driHwLock;
int driFd;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
index 3dbd24d49b7..adbe0c0f33f 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
@@ -23,16 +23,13 @@
* 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>
- *
+/**
+ * \file tdfx_dd.c
+ * Device driver interface functions for 3Dfx based cards.
+ *
+ * \author Gareth Hughes <gareth@valinux.com> (Original rewrite 29 Sep - 1 Oct 2000)
+ * \author Brian Paul <brianp@valinux.com>
*/
#include "tdfx_context.h"
@@ -41,6 +38,7 @@
#include "tdfx_vb.h"
#include "tdfx_pixels.h"
+#include "utils.h"
#include "context.h"
#include "enums.h"
#include "framebuffer.h"
@@ -50,7 +48,7 @@
#endif
-#define TDFX_DATE "20040719"
+#define DRIVER_DATE "20061113"
/* These are used in calls to FX_grColorMaskv() */
@@ -67,67 +65,40 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name )
{
tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- switch ( name ) {
+ switch (name) {
case GL_RENDERER:
{
/* The renderer string must be per-context state to handle
* multihead correctly.
*/
- char *buffer = fxMesa->rendererString;
- char hardware[100];
+ char *const buffer = fxMesa->rendererString;
+ char hardware[64];
LOCK_HARDWARE(fxMesa);
- strcpy( hardware, fxMesa->Glide.grGetString(GR_HARDWARE) );
+ strncpy(hardware, fxMesa->Glide.grGetString(GR_HARDWARE),
+ sizeof(hardware));
+ hardware[sizeof(hardware) - 1] = '\0';
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" );
+ if ((strncmp(hardware, "Voodoo3", 7) == 0)
+ || (strncmp(hardware, "Voodoo4", 7) == 0)
+ || (strncmp(hardware, "Voodoo5", 7) == 0)) {
+ hardware[7] = '\0';
}
- else if ( strcmp( hardware, "Voodoo4 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo4" );
- }
- else if ( strcmp( hardware, "Voodoo5 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo5" );
+ else if (strncmp(hardware, "Voodoo Banshee", 14) == 0) {
+ strcpy(&hardware[6], "Banshee");
}
else {
/* unexpected result: replace spaces with hyphens */
int i;
- for ( i = 0 ; hardware[i] && i < 60 ; i++ ) {
- if ( hardware[i] == ' ' || hardware[i] == '\t' )
+ for (i = 0; hardware[i] && (i < sizeof(hardware)); 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
+ (void) driGetRendererString(buffer, hardware, DRIVER_DATE, 0);
return (const GLubyte *) buffer;
}
case GL_VENDOR:
@@ -138,18 +109,52 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name )
}
-/* Return uptodate buffer size information.
- */
-static void tdfxDDGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
+static void
+tdfxBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
+{
+ tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
+
+ (void) q;
+
+ if (target == GL_SAMPLES_PASSED_ARB) {
+ LOCK_HARDWARE(fxMesa);
+ fxMesa->Glide.grFinish();
+ fxMesa->Glide.grReset(GR_STATS_PIXELS);
+ UNLOCK_HARDWARE(fxMesa);
+ }
+}
+
+
+static void
+tdfxEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
{
- GET_CURRENT_CONTEXT(ctx);
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
+ FxI32 total_pixels;
+ FxI32 z_fail_pixels;
+
- LOCK_HARDWARE( fxMesa );
- *width = fxMesa->width;
- *height = fxMesa->height;
- UNLOCK_HARDWARE( fxMesa );
+ if (target == GL_SAMPLES_PASSED_ARB) {
+ LOCK_HARDWARE(fxMesa);
+ fxMesa->Glide.grFinish();
+
+ fxMesa->Glide.grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, sizeof(FxI32),
+ &z_fail_pixels);
+ fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, sizeof(FxI32), &total_pixels);
+
+ q->Result = total_pixels - z_fail_pixels;
+
+ /* Apparently, people have seen z_fail_pixels > total_pixels under
+ * some conditions on some 3Dfx hardware. The occlusion query spec
+ * requires that we clamp to 0.
+ */
+ if (q->Result < 0) {
+ q->Result = 0;
+ }
+
+ q->Ready = GL_TRUE;
+
+ UNLOCK_HARDWARE(fxMesa);
+ }
}
@@ -166,9 +171,9 @@ void tdfxDDInitDriverFuncs( const __GLcontextModes *visual,
fprintf( stderr, "tdfx: %s()\n", __FUNCTION__ );
}
- functions->GetString = tdfxDDGetString;
- functions->GetBufferSize = tdfxDDGetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
+ functions->GetString = tdfxDDGetString;
+ functions->BeginQuery = tdfxBeginQuery;
+ functions->EndQuery = tdfxEndQuery;
/* Accelerated paths
*/
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_lock.c b/src/mesa/drivers/dri/tdfx/tdfx_lock.c
index ae3ba1a8321..a20c91d030a 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_lock.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_lock.c
@@ -47,16 +47,20 @@
void tdfxGetLock( tdfxContextPtr fxMesa )
{
__DRIcontextPrivate *cPriv = fxMesa->driContext;
- __DRIdrawablePrivate *dPriv = cPriv->driDrawablePriv;
- __DRIscreenPrivate *sPriv = dPriv->driScreenPriv;
+ __DRIdrawablePrivate *const drawable = cPriv->driDrawablePriv;
+ __DRIdrawablePrivate *const readable = cPriv->driReadablePriv;
+ __DRIscreenPrivate *sPriv = drawable->driScreenPriv;
TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) (((char *) sPriv->pSAREA) +
fxMesa->fxScreen->sarea_priv_offset);
- unsigned int stamp = dPriv->lastStamp;
+ unsigned int stamp = drawable->lastStamp;
drmGetLock( fxMesa->driFd, fxMesa->hHWContext, 0 );
- /* This macro will update dPriv's cliprects if needed */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
+ /* This macro will update drawable's cliprects if needed */
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
+ }
if ( saPriv->fifoOwner != fxMesa->hHWContext ) {
fxMesa->Glide.grDRIImportFifo( saPriv->fifoPtr, saPriv->fifoRead );
@@ -83,10 +87,15 @@ void tdfxGetLock( tdfxContextPtr fxMesa )
}
#endif
- if ( *dPriv->pStamp != stamp || saPriv->ctxOwner != fxMesa->hHWContext ) {
+ if ((*drawable->pStamp != stamp)
+ || (saPriv->ctxOwner != fxMesa->hHWContext)) {
+ driUpdateFramebufferSize(fxMesa->glCtx, drawable);
+ if (drawable != readable) {
+ driUpdateFramebufferSize(fxMesa->glCtx, readable);
+ }
+
tdfxUpdateClipping(fxMesa->glCtx);
tdfxUploadClipping(fxMesa);
- driUpdateFramebufferSize(fxMesa->glCtx, dPriv);
}
DEBUG_LOCK();
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
index 1a5a2b11090..732270b2bd3 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
@@ -496,9 +496,9 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y,
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
GrLfbInfo_t info;
-
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+ __DRIdrawablePrivate *const readable = fxMesa->driReadable;
+ const GLint winX = readable->x;
+ const GLint winY = readable->y + readable->h - 1;
const GLint scrX = winX + x;
const GLint scrY = winY - y;
@@ -554,9 +554,9 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
GrLfbInfo_t info;
-
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+ __DRIdrawablePrivate *const readable = fxMesa->driReadable;
+ const GLint winX = readable->x;
+ const GLint winY = readable->y + readable->h - 1;
const GLint scrX = winX + x;
const GLint scrY = winY - y;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_render.c b/src/mesa/drivers/dri/tdfx/tdfx_render.c
index a30ec78a558..f36c97bfebe 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_render.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_render.c
@@ -46,9 +46,7 @@
/* Clear the color and/or depth buffers.
*/
-static void tdfxClear( GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+static void tdfxClear( GLcontext *ctx, GLbitfield mask )
{
tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
@@ -56,8 +54,7 @@ static void tdfxClear( GLcontext *ctx,
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 );
+ fprintf( stderr, "tdfxClear(0x%x)\n", mask);
}
/* Need this check to respond to glScissor and clipping updates */
@@ -313,7 +310,7 @@ static void tdfxClear( GLcontext *ctx,
}
if (softwareMask)
- _swrast_Clear( ctx, softwareMask, all, x, y, width, height );
+ _swrast_Clear(ctx, softwareMask);
}
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
index 0a4499cfae7..646f5126eb0 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
@@ -73,6 +73,9 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv )
{
tdfxScreenPrivate *fxScreen;
TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
+ void *const psc = sPriv->psc->screenConfigs;
if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n");
@@ -113,6 +116,10 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv )
return GL_FALSE;
}
+ if (glx_enable_extension != NULL) {
+ (*glx_enable_extension)(psc, "GLX_SGI_make_current_read");
+ }
+
return GL_TRUE;
}
@@ -180,6 +187,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv,
driDrawPriv);
tdfxSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
+ backRb->backBuffer = GL_TRUE;
}
if (mesaVis->depthBits == 16) {
@@ -265,7 +273,9 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
return;
LOCK_HARDWARE( fxMesa );
fxMesa->Glide.grSstSelect( fxMesa->Glide.Board );
+#ifdef DEBUG
printf("SwapBuf SetState 1\n");
+#endif
fxMesa->Glide.grGlideSetState(fxMesa->Glide.State );
}
}
@@ -325,7 +335,9 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
if (ctx->DriverCtx != fxMesa) {
fxMesa = TDFX_CONTEXT(ctx);
fxMesa->Glide.grSstSelect( fxMesa->Glide.Board );
+#ifdef DEBUG
printf("SwapBuf SetState 2\n");
+#endif
fxMesa->Glide.grGlideSetState(fxMesa->Glide.State );
}
UNLOCK_HARDWARE( fxMesa );
@@ -393,7 +405,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
m->accumRedBits = accum ? 16 : 0;
m->accumGreenBits = accum ? 16 : 0;
m->accumBlueBits = accum ? 16 : 0;
- m->accumAlphaBits = accum ? 16 : 0;
+ m->accumAlphaBits = (accum && deep) ? 16 : 0;
m->stencilBits = stencil ? 8 : 0;
m->depthBits = deep
? (depth ? 24 : 0)
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c
index ce895f82542..d9d52d2b6f5 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_span.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c
@@ -47,21 +47,19 @@
#define LOCAL_VARS \
- __DRIdrawablePrivate *dPriv = fxMesa->driDrawable; \
- tdfxScreenPrivate *fxPriv = fxMesa->fxScreen; \
- GLboolean isFront = (ctx->DrawBuffer->_ColorDrawBufferMask[0] \
- == BUFFER_BIT_FRONT_LEFT); \
- GLuint pitch = isFront ? (fxMesa->screen_width * BYTESPERPIXEL) \
- : info.strideInBytes; \
- GLuint height = fxMesa->height; \
+ driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
+ GLuint pitch = drb->backBuffer ? info.strideInBytes \
+ : (drb->pitch * drb->cpp); \
+ const GLuint bottom = dPriv->h - 1; \
char *buf = (char *)((char *)info.lfbPtr + \
- dPriv->x * fxPriv->cpp + \
- dPriv->y * pitch); \
+ (dPriv->x * drb->cpp) + \
+ (dPriv->y * pitch)); \
GLuint p; \
(void) buf; (void) p;
-#define Y_FLIP(_y) (height - _y - 1)
+#define Y_FLIP(_y) (bottom - _y)
#define HW_WRITE_LOCK() \
@@ -71,10 +69,9 @@
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 ) ) \
- {
+ 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 );\
@@ -976,7 +973,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb,
GetFbParams(fxMesa, &info, &backBufferInfo,
&ReadParams, sizeof(GLushort));
for (i = 0; i < n; i++) {
- if (mask[i] && visible_pixel(fxMesa, x[i], y[i])) {
+ if ((!mask || mask[i]) && visible_pixel(fxMesa, x[i], y[i])) {
xpos = x[i] + fxMesa->x_offset;
ypos = bottom - y[i];
d16 = depth[i];
@@ -1000,7 +997,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb,
GetFbParams(fxMesa, &info, &backBufferInfo,
&ReadParams, sizeof(GLuint));
for (i = 0; i < n; i++) {
- if (mask[i]) {
+ if (!mask || mask[i]) {
if (visible_pixel(fxMesa, x[i], y[i])) {
xpos = x[i] + fxMesa->x_offset;
ypos = bottom - y[i];
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c
index a389273b2f0..59e6549e5ef 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_state.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c
@@ -1400,19 +1400,15 @@ void tdfxDDInitStateFuncs( GLcontext *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.ColorMask = tdfxDDColorMask;
ctx->Driver.CullFace = tdfxDDCullFace;
ctx->Driver.FrontFace = tdfxDDFrontFace;
ctx->Driver.DepthFunc = tdfxDDDepthFunc;
@@ -1434,11 +1430,4 @@ void tdfxDDInitStateFuncs( GLcontext *ctx )
}
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/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
index 862c7dacf1f..89865d96379 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
@@ -41,6 +41,7 @@
#include "enums.h"
#include "image.h"
+#include "mipmap.h"
#include "texcompress.h"
#include "texformat.h"
#include "teximage.h"
@@ -593,13 +594,11 @@ tdfxIsTextureResident(GLcontext *ctx, struct gl_texture_object *tObj)
static GrTexTable_t
convertPalette(FxU32 data[256], const struct gl_color_table *table)
{
- const GLubyte *tableUB = (const GLubyte *) table->Table;
+ const GLubyte *tableUB = table->TableUB;
GLint width = table->Size;
FxU32 r, g, b, a;
GLint i;
- ASSERT(table->Type == GL_UNSIGNED_BYTE);
-
switch (table->_BaseFormat) {
case GL_INTENSITY:
for (i = 0; i < width; i++) {
@@ -671,7 +670,7 @@ tdfxUpdateTexturePalette(GLcontext * ctx, struct gl_texture_object *tObj)
tdfxTexInfo *ti;
/* This might be a proxy texture. */
- if (!tObj->Palette.Table)
+ if (!tObj->Palette.TableUB)
return;
if (!tObj->DriverData)
@@ -1405,7 +1404,6 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level,
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);
@@ -1426,7 +1424,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level,
mipWidth, mipHeight, border,
format, type,
NULL);
- mipImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ mipImage = _mesa_select_tex_image(ctx, texObj, target, level);
mip = TDFX_TEXIMAGE_DATA(mipImage);
_mesa_halve2x2_teximage2d(ctx,
texImage,
@@ -1515,7 +1513,6 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
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);
@@ -1535,7 +1532,7 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
break;
}
++level;
- mipImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ mipImage = _mesa_select_tex_image(ctx, texObj, target, level);
mip = TDFX_TEXIMAGE_DATA(mipImage);
_mesa_halve2x2_teximage2d(ctx,
texImage,
@@ -1758,7 +1755,7 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target,
for (i = 0; i < rows; i++) {
MEMCPY(dest, data, srcRowStride);
dest += destRowStride;
- data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride);
+ data = (GLvoid *)((intptr_t)data + (intptr_t)srcRowStride);
}
/* [dBorca] Hack alert:
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
index f5f385fad7c..fda9ce56849 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
@@ -1015,9 +1015,12 @@ SetupSingleTexEnvVoodoo3(GLcontext *ctx, int unit,
}
break;
- default:
+ default: {
+ (void) memcpy(&colorComb, &fxMesa->ColorCombine, sizeof(colorComb));
+ (void) memcpy(&alphaComb, &fxMesa->AlphaCombine, sizeof(alphaComb));
_mesa_problem(ctx, "bad texture env mode in %s", __FUNCTION__);
}
+ }
if (colorComb.Function != fxMesa->ColorCombine.Function ||
colorComb.Factor != fxMesa->ColorCombine.Factor ||
diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c
index 9c8f7ef01f3..d3806586475 100644
--- a/src/mesa/drivers/dri/trident/trident_context.c
+++ b/src/mesa/drivers/dri/trident/trident_context.c
@@ -50,6 +50,7 @@
#include "drivers/common/driverfuncs.h"
#include "dri_util.h"
+#include "utils.h"
static const struct tnl_pipeline_stage *trident_pipeline[] = {
&_tnl_vertex_transform_stage,
diff --git a/src/mesa/drivers/dri/trident/trident_dd.c b/src/mesa/drivers/dri/trident/trident_dd.c
index 8c3af200166..4639b3a15e7 100644
--- a/src/mesa/drivers/dri/trident/trident_dd.c
+++ b/src/mesa/drivers/dri/trident/trident_dd.c
@@ -104,24 +104,7 @@ void tridentDDInitExtensions( GLcontext *ctx )
*/
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;
+ ctx->Driver.GetBufferSize = tridentDDGetBufferSize;
+ ctx->Driver.GetString = tridentDDGetString;
+ ctx->Driver.Error = NULL;
}
diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c
index e0b7a452243..037cce5f862 100644
--- a/src/mesa/drivers/dri/trident/trident_state.c
+++ b/src/mesa/drivers/dri/trident/trident_state.c
@@ -150,14 +150,14 @@ void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv )
}
-static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
+static void tridentDDClear( GLcontext *ctx, GLbitfield mask )
{
tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
int busy;
GLuint flags = 0;
GLint i;
+ GLint cx, cy, cw, ch;
#define DRM_TRIDENT_FRONT 0x01
#define DRM_TRIDENT_BACK 0x02
@@ -183,6 +183,12 @@ static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
LOCK_HARDWARE(tmesa);
+ /* get region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+
if ( flags ) {
cx += tmesa->drawX;
@@ -290,7 +296,7 @@ if (flags & DRM_TRIDENT_FRONT) {
UNLOCK_HARDWARE(tmesa);
if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
+ _swrast_Clear( ctx, mask );
}
static void tridentDDShadeModel( GLcontext *ctx, GLenum mode )
@@ -539,20 +545,4 @@ void tridentDDInitStateFuncs( GLcontext *ctx )
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/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index ffde1b66b76..49c24656551 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -147,10 +147,13 @@ viaRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-viaInitRenderbuffer(struct gl_renderbuffer *rb, GLenum format)
+viaInitRenderbuffer(struct via_renderbuffer *vrb, GLenum format,
+ __DRIdrawablePrivate *dPriv)
{
const GLuint name = 0;
+ struct gl_renderbuffer *rb = & vrb->Base;
+ vrb->dPriv = dPriv;
_mesa_init_renderbuffer(rb, name);
/* Make sure we're using a null-valued GetPointer routine */
@@ -198,8 +201,9 @@ viaInitRenderbuffer(struct gl_renderbuffer *rb, GLenum format)
* \sa AllocateBuffer
*/
static GLboolean
-calculate_buffer_parameters( struct via_context *vmesa,
- struct gl_framebuffer *fb )
+calculate_buffer_parameters(struct via_context *vmesa,
+ struct gl_framebuffer *fb,
+ __DRIdrawablePrivate *dPriv)
{
const unsigned shift = vmesa->viaScreen->bitsPerPixel / 16;
const unsigned extra = 32;
@@ -215,26 +219,28 @@ calculate_buffer_parameters( struct via_context *vmesa,
if (!vmesa->front.Base.InternalFormat) {
/* do one-time init for the renderbuffers */
- viaInitRenderbuffer(&vmesa->front.Base, GL_RGBA);
+ viaInitRenderbuffer(&vmesa->front, GL_RGBA, dPriv);
viaSetSpanFunctions(&vmesa->front, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &vmesa->front.Base);
if (fb->Visual.doubleBufferMode) {
- viaInitRenderbuffer(&vmesa->back.Base, GL_RGBA);
+ viaInitRenderbuffer(&vmesa->back, GL_RGBA, dPriv);
viaSetSpanFunctions(&vmesa->back, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &vmesa->back.Base);
}
if (vmesa->glCtx->Visual.depthBits > 0) {
- viaInitRenderbuffer(&vmesa->depth.Base,
+ viaInitRenderbuffer(&vmesa->depth,
(vmesa->glCtx->Visual.depthBits == 16
- ? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24));
+ ? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24),
+ dPriv);
viaSetSpanFunctions(&vmesa->depth, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &vmesa->depth.Base);
}
if (vmesa->glCtx->Visual.stencilBits > 0) {
- viaInitRenderbuffer(&vmesa->stencil.Base, GL_STENCIL_INDEX8_EXT);
+ viaInitRenderbuffer(&vmesa->stencil, GL_STENCIL_INDEX8_EXT,
+ dPriv);
viaSetSpanFunctions(&vmesa->stencil, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &vmesa->stencil.Base);
}
@@ -243,11 +249,9 @@ calculate_buffer_parameters( struct via_context *vmesa,
assert(vmesa->front.Base.InternalFormat);
assert(vmesa->front.Base.AllocStorage);
if (fb->Visual.doubleBufferMode) {
- assert(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
- assert(vmesa->front.Base.AllocStorage);
+ assert(vmesa->back.Base.AllocStorage);
}
if (fb->Visual.depthBits) {
- assert(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
assert(vmesa->depth.Base.AllocStorage);
}
@@ -352,19 +356,11 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
- calculate_buffer_parameters( vmesa, drawbuffer );
+ calculate_buffer_parameters(vmesa, drawbuffer, vmesa->driDrawable);
_mesa_resize_framebuffer(ctx, drawbuffer, width, height);
}
-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[] =
@@ -481,7 +477,7 @@ viaCreateContext(const __GLcontextModes *visual,
/* Parse configuration files.
*/
driParseConfigFiles (&vmesa->optionCache, &viaScreen->optionCache,
- sPriv->myNum, "via");
+ sPriv->myNum, "unichrome");
/* pick back buffer */
vmesa->hasBack = visual->doubleBufferMode;
@@ -557,8 +553,12 @@ viaCreateContext(const __GLcontextModes *visual,
driContextPriv->driverPrivate = vmesa;
ctx = vmesa->glCtx;
-
- ctx->Const.MaxTextureLevels = 10;
+
+ if (driQueryOptionb(&vmesa->optionCache, "excess_mipmap"))
+ ctx->Const.MaxTextureLevels = 11;
+ else
+ ctx->Const.MaxTextureLevels = 10;
+
ctx->Const.MaxTextureUnits = 2;
ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
@@ -575,8 +575,6 @@ viaCreateContext(const __GLcontextModes *visual,
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;
@@ -657,20 +655,14 @@ viaCreateContext(const __GLcontextModes *visual,
VIA_DEBUG = driParseDebugString( getenv( "VIA_DEBUG" ),
debug_control );
- if (getenv("VIA_NO_RAST"))
+ if (getenv("VIA_NO_RAST") ||
+ driQueryOptionb(&vmesa->optionCache, "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;
@@ -728,57 +720,81 @@ viaDestroyContext(__DRIcontextPrivate *driContextPriv)
assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]));
assert (is_empty_list(&vmesa->freed_tex_buffers));
- FREE(vmesa);
+ driDestroyOptionCache(&vmesa->optionCache);
+
+ FREE(vmesa);
}
}
void viaXMesaWindowMoved(struct via_context *vmesa)
{
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ __DRIdrawablePrivate *const drawable = vmesa->driDrawable;
+ __DRIdrawablePrivate *const readable = vmesa->driReadable;
+ struct via_renderbuffer *const draw_buffer =
+ (struct via_renderbuffer *) drawable->driverPrivate;
+ struct via_renderbuffer *const read_buffer =
+ (struct via_renderbuffer *) readable->driverPrivate;
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
- if (!dPriv)
+ if (!drawable)
return;
switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
case BUFFER_BIT_BACK_LEFT:
- if (dPriv->numBackClipRects == 0) {
- vmesa->numClipRects = dPriv->numClipRects;
- vmesa->pClipRects = dPriv->pClipRects;
+ if (drawable->numBackClipRects == 0) {
+ vmesa->numClipRects = drawable->numClipRects;
+ vmesa->pClipRects = drawable->pClipRects;
}
else {
- vmesa->numClipRects = dPriv->numBackClipRects;
- vmesa->pClipRects = dPriv->pBackClipRects;
+ vmesa->numClipRects = drawable->numBackClipRects;
+ vmesa->pClipRects = drawable->pBackClipRects;
}
break;
case BUFFER_BIT_FRONT_LEFT:
- vmesa->numClipRects = dPriv->numClipRects;
- vmesa->pClipRects = dPriv->pClipRects;
+ vmesa->numClipRects = drawable->numClipRects;
+ vmesa->pClipRects = drawable->pClipRects;
break;
default:
vmesa->numClipRects = 0;
break;
}
- if (vmesa->drawW != dPriv->w ||
- vmesa->drawH != dPriv->h)
- calculate_buffer_parameters( vmesa, vmesa->glCtx->DrawBuffer );
+ if ((draw_buffer->drawW != drawable->w)
+ || (draw_buffer->drawH != drawable->h)) {
+ calculate_buffer_parameters(vmesa, vmesa->glCtx->DrawBuffer,
+ drawable);
+ }
- vmesa->drawXoff = (GLuint)(((dPriv->x * bytePerPixel) & 0x1f) /
+ draw_buffer->drawXoff = (GLuint)(((drawable->x * bytePerPixel) & 0x1f) /
bytePerPixel);
- vmesa->drawX = dPriv->x - vmesa->drawXoff;
- vmesa->drawY = dPriv->y;
- vmesa->drawW = dPriv->w;
- vmesa->drawH = dPriv->h;
+ draw_buffer->drawX = drawable->x - draw_buffer->drawXoff;
+ draw_buffer->drawY = drawable->y;
+ draw_buffer->drawW = drawable->w;
+ draw_buffer->drawH = drawable->h;
+
+ if (drawable != readable) {
+ if ((read_buffer->drawW != readable->w)
+ || (read_buffer->drawH != readable->h)) {
+ calculate_buffer_parameters(vmesa, vmesa->glCtx->ReadBuffer,
+ readable);
+ }
+
+ read_buffer->drawXoff = (GLuint)(((readable->x * bytePerPixel) & 0x1f) /
+ bytePerPixel);
+ read_buffer->drawX = readable->x - read_buffer->drawXoff;
+ read_buffer->drawY = readable->y;
+ read_buffer->drawW = readable->w;
+ read_buffer->drawH = readable->h;
+ }
vmesa->front.orig = (vmesa->front.offset +
- vmesa->drawY * vmesa->front.pitch +
- vmesa->drawX * bytePerPixel);
+ draw_buffer->drawY * vmesa->front.pitch +
+ draw_buffer->drawX * bytePerPixel);
vmesa->front.origMap = (vmesa->front.map +
- vmesa->drawY * vmesa->front.pitch +
- vmesa->drawX * bytePerPixel);
+ draw_buffer->drawY * vmesa->front.pitch +
+ draw_buffer->drawX * bytePerPixel);
vmesa->back.orig = vmesa->back.offset;
vmesa->depth.orig = vmesa->depth.offset;
@@ -814,14 +830,41 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
- if ( vmesa->driDrawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv, vmesa->vblank_flags );
- vmesa->driDrawable = driDrawPriv;
- if ( ! calculate_buffer_parameters( vmesa, drawBuffer ) ) {
- return GL_FALSE;
- }
+ if (vmesa->driDrawable != driDrawPriv) {
+ driDrawableInitVBlank(driDrawPriv, vmesa->vblank_flags,
+ &vmesa->vbl_seq);
}
+ if ((vmesa->driDrawable != driDrawPriv)
+ || (vmesa->driReadable != driReadPriv)) {
+ vmesa->driDrawable = driDrawPriv;
+ vmesa->driReadable = driReadPriv;
+
+ if ((drawBuffer->Width != driDrawPriv->w)
+ || (drawBuffer->Height != driDrawPriv->h)) {
+ _mesa_resize_framebuffer(ctx, drawBuffer,
+ driDrawPriv->w, driDrawPriv->h);
+ drawBuffer->Initialized = GL_TRUE;
+ }
+
+ if (!calculate_buffer_parameters(vmesa, drawBuffer, driDrawPriv)) {
+ return GL_FALSE;
+ }
+
+ if (driDrawPriv != driReadPriv) {
+ if ((readBuffer->Width != driReadPriv->w)
+ || (readBuffer->Height != driReadPriv->h)) {
+ _mesa_resize_framebuffer(ctx, readBuffer,
+ driReadPriv->w, driReadPriv->h);
+ readBuffer->Initialized = GL_TRUE;
+ }
+
+ if (!calculate_buffer_parameters(vmesa, readBuffer, driReadPriv)) {
+ return GL_FALSE;
+ }
+ }
+ }
+
_mesa_make_current(vmesa->glCtx, drawBuffer, readBuffer);
ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
@@ -847,7 +890,10 @@ void viaGetLock(struct via_context *vmesa, GLuint flags)
drmGetLock(vmesa->driFd, vmesa->hHWContext, flags);
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
+ if (dPriv != vmesa->driReadable) {
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, vmesa->driReadable);
+ }
if (vmesa->sarea->ctxOwner != vmesa->hHWContext) {
vmesa->sarea->ctxOwner = vmesa->hHWContext;
diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h
index 9d7a0e6cb64..77161a8d5df 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.h
+++ b/src/mesa/drivers/dri/unichrome/via_context.h
@@ -98,6 +98,18 @@ struct via_renderbuffer {
* at (drawX,drawY) in screen space.
*/
char *origMap;
+
+ 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.
+ */
+
+ __DRIdrawablePrivate *dPriv;
};
@@ -272,16 +284,6 @@ struct via_context {
struct via_renderbuffer *drawBuffer;
- 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;
@@ -294,7 +296,16 @@ struct via_context {
int driFd;
__DRInativeDisplay *display;
- __DRIdrawablePrivate *driDrawable;
+ /**
+ * DRI drawable bound to this context for drawing.
+ */
+ __DRIdrawablePrivate *driDrawable;
+
+ /**
+ * DRI drawable bound to this context for reading.
+ */
+ __DRIdrawablePrivate *driReadable;
+
__DRIscreenPrivate *driScreen;
viaScreenPrivate *viaScreen;
drm_via_sarea_t *sarea;
diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c
index c8c6dc01933..5d102de93ed 100644
--- a/src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c
@@ -182,8 +182,8 @@ static void viaFillBuffer(struct via_context *vmesa,
GLuint i;
for (i = 0; i < nboxes ; i++) {
- int x = pbox[i].x1 - vmesa->drawX;
- int y = pbox[i].y1 - vmesa->drawY;
+ int x = pbox[i].x1 - buffer->drawX;
+ int y = pbox[i].y1 - buffer->drawY;
int w = pbox[i].x2 - pbox[i].x1;
int h = pbox[i].y2 - pbox[i].y1;
@@ -202,11 +202,12 @@ static void viaFillBuffer(struct via_context *vmesa,
-static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
+static void viaClear(GLcontext *ctx, GLbitfield mask)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
int flag = 0;
GLuint i = 0;
GLuint clear_depth_mask = 0xf << 28;
@@ -261,13 +262,22 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
if (flag) {
drm_clip_rect_t *boxes, *tmp_boxes = 0;
int nr = 0;
+ GLint cx, cy, cw, ch;
+ GLboolean all;
LOCK_HARDWARE(vmesa);
+ /* get region after locking: */
+ cx = ctx->DrawBuffer->_Xmin;
+ cy = ctx->DrawBuffer->_Ymin;
+ cw = ctx->DrawBuffer->_Xmax - cx;
+ ch = ctx->DrawBuffer->_Ymax - cy;
+ all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height);
+
/* flip top to bottom */
cy = dPriv->h - cy - ch;
- cx += vmesa->drawX + vmesa->drawXoff;
- cy += vmesa->drawY;
+ cx += vrb->drawX + vrb->drawXoff;
+ cy += vrb->drawY;
if (!all) {
drm_clip_rect_t *b = vmesa->pClipRects;
@@ -328,7 +338,7 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear(ctx, mask, all, cx, cy, cw, ch);
+ _swrast_Clear(ctx, mask);
}
@@ -344,8 +354,8 @@ static void viaDoSwapBuffers(struct via_context *vmesa,
GLuint i;
for (i = 0; i < nbox; i++, b++) {
- GLint x = b->x1 - vmesa->drawX;
- GLint y = b->y1 - vmesa->drawY;
+ GLint x = b->x1 - back->drawX;
+ GLint y = b->y1 - back->drawY;
GLint w = b->x2 - b->x1;
GLint h = b->y2 - b->y1;
@@ -758,7 +768,7 @@ static void via_emit_cliprect(struct via_context *vmesa,
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[6] = (HC_SubA_HSPXYOS << 24) | ((31 - buffer->drawXoff) << HC_HSPXOS_SHIFT);
vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch;
}
@@ -873,21 +883,25 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags)
}
else if (vmesa->numClipRects) {
drm_clip_rect_t *pbox = vmesa->pClipRects;
-
+ __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
+
+
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;
+ b.x1 = pbox[i].x1 - (vrb->drawX + vrb->drawXoff);
+ b.x2 = pbox[i].x2 - (vrb->drawX + vrb->drawXoff);
+ b.y1 = pbox[i].y1 - vrb->drawY;
+ b.y2 = pbox[i].y2 - vrb->drawY;
if (vmesa->scissor &&
!intersect_rect(&b, &b, &vmesa->scissorRect))
continue;
- b.x1 += vmesa->drawXoff;
- b.x2 += vmesa->drawXoff;
+ b.x1 += vrb->drawXoff;
+ b.x2 += vrb->drawXoff;
via_emit_cliprect(vmesa, &b);
diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c
index 4f137c8ceb8..28e1f9451e6 100644
--- a/src/mesa/drivers/dri/unichrome/via_screen.c
+++ b/src/mesa/drivers/dri/unichrome/via_screen.c
@@ -46,16 +46,16 @@
#include "GL/internal/dri_interface.h"
#include "drirenderbuffer.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_QUALITY
+ DRI_CONF_EXCESS_MIPMAP(false)
+ DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_NO_RAST(false)
DRI_CONF_SECTION_END
@@ -131,7 +131,6 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
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);
@@ -183,6 +182,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
+ (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
}
@@ -201,6 +201,8 @@ viaDestroyScreen(__DRIscreenPrivate *sPriv)
via_free_empty_buffers(viaScreen->bufs);
+ driDestroyOptionInfo(&viaScreen->optionCache);
+
FREE(viaScreen);
sPriv->private = NULL;
}
diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c
index 6ff95cc444c..f1ed98036bf 100644
--- a/src/mesa/drivers/dri/unichrome/via_span.c
+++ b/src/mesa/drivers/dri/unichrome/via_span.c
@@ -41,13 +41,12 @@
#undef LOCAL_VARS
#define LOCAL_VARS \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb; \
+ __DRIdrawablePrivate *dPriv = vrb->dPriv; \
GLuint pitch = vrb->pitch; \
GLuint height = dPriv->h; \
GLint p = 0; \
- char *buf = (char *)(vrb->origMap + vmesa->drawXoff * vrb->bpp); \
+ char *buf = (char *)(vrb->origMap + vrb->drawXoff * vrb->bpp); \
(void) p;
/* ================================================================
@@ -79,12 +78,11 @@
/* 16 bit depthbuffer functions.
*/
#define LOCAL_DEPTH_VARS \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb; \
+ __DRIdrawablePrivate *dPriv = vrb->dPriv; \
GLuint depth_pitch = vrb->pitch; \
GLuint height = dPriv->h; \
- char *buf = (char *)(vrb->map + (vmesa->drawXoff * vrb->bpp/8))
+ char *buf = (char *)(vrb->map + (vrb->drawXoff * vrb->bpp/8))
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c
index 6a2a99df3bc..2c9cfca522e 100644
--- a/src/mesa/drivers/dri/unichrome/via_state.c
+++ b/src/mesa/drivers/dri/unichrome/via_state.c
@@ -328,8 +328,8 @@ void viaEmitState(struct via_context *vmesa)
/* KW: This test never succeeds:
*/
if (t->regTexFM == HC_HTXnFM_Index8) {
- struct gl_color_table *table = &texObj->Palette;
- GLfloat *tableF = (GLfloat *)table->Table;
+ const struct gl_color_table *table = &texObj->Palette;
+ const GLfloat *tableF = table->TableF;
BEGIN_RING(2 + table->Size);
OUT_RING( HC_HEADER2 );
@@ -453,8 +453,8 @@ void viaEmitState(struct via_context *vmesa)
/* KW: This test never succeeds:
*/
if (t->regTexFM == HC_HTXnFM_Index8) {
- struct gl_color_table *table = &texObj->Palette;
- GLfloat *tableF = (GLfloat *)table->Table;
+ const struct gl_color_table *table = &texObj->Palette;
+ const GLfloat *tableF = table->TableF;
BEGIN_RING(2 + table->Size);
OUT_RING( HC_HEADER2 );
@@ -476,6 +476,9 @@ void viaEmitState(struct via_context *vmesa)
*/
if (ctx->Polygon.StippleFlag) {
GLuint *stipple = &ctx->PolygonStipple[0];
+ __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
GLint i;
BEGIN_RING(38);
@@ -498,9 +501,9 @@ void viaEmitState(struct via_context *vmesa)
OUT_RING( HC_HEADER2 );
OUT_RING( (HC_ParaType_NotTex << 16) );
OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32- vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
+ (((32- vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32 - vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
+ (((32 - vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
ADVANCE_RING();
}
@@ -720,15 +723,18 @@ static void viaColorMask(GLcontext *ctx,
void viaCalcViewport(GLcontext *ctx)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
+ __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
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_TX] = v[MAT_TX] + SUBPIXEL_X + vrb->drawXoff;
m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + vmesa->driDrawable->h + SUBPIXEL_Y;
+ m[MAT_TY] = - v[MAT_TY] + dPriv->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);
}
@@ -1524,19 +1530,6 @@ void viaInitStateFuncs(GLcontext *ctx)
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;
+ /* XXX this should go away */
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/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c
index b344c009318..0261a3ff177 100644
--- a/src/mesa/drivers/dri/unichrome/via_tex.c
+++ b/src/mesa/drivers/dri/unichrome/via_tex.c
@@ -33,6 +33,7 @@
#include "colortab.h"
#include "convolve.h"
#include "context.h"
+#include "mipmap.h"
#include "simple_list.h"
#include "texcompress.h"
#include "texformat.h"
@@ -512,6 +513,13 @@ static GLboolean viaSetTexImages(GLcontext *ctx,
numLevels = lastLevel - firstLevel + 1;
+ /* The hardware supports only 10 mipmap levels; ignore higher levels.
+ */
+ if ((numLevels > 10) && (ctx->Const.MaxTextureLevels > 10)) {
+ lastLevel -= numLevels - 10;
+ numLevels = 10;
+ }
+
/* save these values, check if they effect the residency of the
* texture:
*/
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index 3a6b452065b..bd9d3ac0ad9 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -157,11 +157,27 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer;
+
+ buffer = ctx->WinSysDrawBuffer;
+ get_buffer_size( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
+
+ buffer = ctx->WinSysReadBuffer;
+ get_buffer_size( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c
index 64312204c54..47d7f2bdb99 100644
--- a/src/mesa/drivers/ggi/ggimesa.c
+++ b/src/mesa/drivers/ggi/ggimesa.c
@@ -257,10 +257,18 @@ static void gl_ggiGetSize(GLframebuffer *fb, GLuint *width, GLuint *height)
printf("returning %d, %d\n", *width, *height);
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
static void gl_ggiViewport(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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ gl_ggiGetSize( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
@@ -305,10 +313,14 @@ static void gl_ggiSetClearColor(GLcontext *ctx, const GLfloat color[4])
ggi_ctx->clearcolor = col;
}
-static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height)
+static void gl_ggiClear(GLcontext *ctx, GLbitfield mask)
{
ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int w = ctx->DrawBuffer->_Xmax - x;
+ int h = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (w == ctx->DrawBuffer->Width && h == ctx->DrawBuffer->height)
GGIMESADPRINT_CORE("gl_ggiClear() called\n");
@@ -328,7 +340,7 @@ static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT);
}
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
}
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 1614a7a43a7..ef60602c832 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -123,11 +123,19 @@ fxDDGetBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ fxDDGetBufferSize( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
@@ -154,9 +162,7 @@ fxDDClearColor(GLcontext * ctx, const GLfloat color[4])
/* Clear the color and/or depth buffers */
-static void fxDDClear( GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+static void fxDDClear( GLcontext *ctx, GLbitfield mask )
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
@@ -165,8 +171,7 @@ static void fxDDClear( GLcontext *ctx,
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 );
+ fprintf( stderr, "fxDDClear\n");
}
/* we can't clear accum buffers nor stereo */
@@ -381,7 +386,7 @@ static void fxDDClear( GLcontext *ctx,
grRenderBuffer(fxMesa->currentFB);
if (softwareMask)
- _swrast_Clear( ctx, softwareMask, all, x, y, width, height );
+ _swrast_Clear( ctx, softwareMask );
}
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 942692c8bb0..0b027eddec5 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -64,8 +64,6 @@ struct osmesa_context
struct gl_renderbuffer *rb; /*< The user's colorbuffer */
GLframebuffer *gl_buffer; /*< The framebuffer, containing user's rb */
GLenum format; /*< User-specified context format */
- GLint width, height; /*< size of image buffer */
- GLint rowlength; /*< number of pixels per row */
GLint userRowLength; /*< user-specified number of pixels per row */
GLint rInd, gInd, bInd, aInd;/*< index offsets for RGBA formats */
GLvoid *rowaddr[MAX_HEIGHT]; /*< address of first pixel in each image row */
@@ -117,23 +115,6 @@ osmesa_update_state( GLcontext *ctx, GLuint new_state )
}
-/**
- * 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 *****/
@@ -597,7 +578,9 @@ 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 (osmesa->rb->DataType != GL_UNSIGNED_BYTE)
+ return NULL;
+
if (ctx->RenderMode != GL_RENDER) return NULL;
if (ctx->Line.SmoothFlag) return NULL;
if (ctx->Texture._EnabledUnits) return NULL;
@@ -706,7 +689,9 @@ 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 (osmesa->rb->DataType != GL_UNSIGNED_BYTE)
+ 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;
@@ -759,6 +744,72 @@ osmesa_choose_line( GLcontext *ctx )
}
+
+/**
+ * Recompute the values of the context's rowaddr array.
+ */
+static void
+compute_row_addresses( OSMesaContext osmesa )
+{
+ GLint bytesPerPixel, bytesPerRow, i;
+ GLubyte *origin = (GLubyte *) osmesa->rb->Data;
+ GLint bpc; /* bytes per channel */
+ GLint rowlength; /* in pixels */
+ GLint height = osmesa->rb->Height;
+
+ if (osmesa->userRowLength)
+ rowlength = osmesa->userRowLength;
+ else
+ rowlength = osmesa->rb->Width;
+
+ if (osmesa->rb->DataType == GL_UNSIGNED_BYTE)
+ bpc = 1;
+ else if (osmesa->rb->DataType == GL_UNSIGNED_SHORT)
+ bpc = 2;
+ else if (osmesa->rb->DataType == GL_FLOAT)
+ bpc = 4;
+ else {
+ _mesa_problem(&osmesa->mesa,
+ "Unexpected datatype in osmesa::compute_row_addresses");
+ return;
+ }
+
+ if (osmesa->format == OSMESA_COLOR_INDEX) {
+ /* CI mode */
+ bytesPerPixel = 1 * sizeof(GLubyte);
+ }
+ else if ((osmesa->format == OSMESA_RGB) || (osmesa->format == OSMESA_BGR)) {
+ /* RGB mode */
+ bytesPerPixel = 3 * bpc;
+ }
+ else if (osmesa->format == OSMESA_RGB_565) {
+ /* 5/6/5 RGB pixel in 16 bits */
+ bytesPerPixel = 2;
+ }
+ else {
+ /* RGBA mode */
+ bytesPerPixel = 4 * bpc;
+ }
+
+ bytesPerRow = rowlength * bytesPerPixel;
+
+ if (osmesa->yup) {
+ /* Y=0 is bottom line of window */
+ for (i = 0; i < height; i++) {
+ osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + i * bytesPerRow);
+ }
+ }
+ else {
+ /* Y=0 is top line of window */
+ for (i = 0; i < height; i++) {
+ GLint j = height - i - 1;
+ osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + j * bytesPerRow);
+ }
+ }
+}
+
+
+
/**
* Don't use _mesa_delete_renderbuffer since we can't free rb->Data.
*/
@@ -788,6 +839,11 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
else
bpc = 32;
+ rb->RedBits =
+ rb->GreenBits =
+ rb->BlueBits =
+ rb->AlphaBits = bpc;
+
/* Note: we can ignoring internalFormat for "window-system" renderbuffers */
(void) internalFormat;
@@ -970,6 +1026,8 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->Width = width;
rb->Height = height;
+ compute_row_addresses( osmesa );
+
return GL_TRUE;
}
@@ -1003,65 +1061,6 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type)
}
-
-/**
- * Recompute the values of the context's rowaddr array.
- */
-static void
-compute_row_addresses( OSMesaContext osmesa )
-{
- GLint bytesPerPixel, bytesPerRow, i;
- GLubyte *origin = (GLubyte *) osmesa->rb->Data;
- GLint bpc; /* bytes per channel */
-
- if (osmesa->rb->DataType == GL_UNSIGNED_BYTE)
- bpc = 1;
- else if (osmesa->rb->DataType == GL_UNSIGNED_SHORT)
- bpc = 2;
- else if (osmesa->rb->DataType == GL_FLOAT)
- bpc = 4;
- else {
- _mesa_problem(&osmesa->mesa,
- "Unexpected datatype in osmesa::compute_row_addresses");
- return;
- }
-
- if (osmesa->format == OSMESA_COLOR_INDEX) {
- /* CI mode */
- bytesPerPixel = 1 * sizeof(GLubyte);
- }
- else if ((osmesa->format == OSMESA_RGB) || (osmesa->format == OSMESA_BGR)) {
- /* RGB mode */
- bytesPerPixel = 3 * bpc;
- }
- else if (osmesa->format == OSMESA_RGB_565) {
- /* 5/6/5 RGB pixel in 16 bits */
- bytesPerPixel = 2;
- }
- else {
- /* RGBA mode */
- bytesPerPixel = 4 * bpc;
- }
-
- bytesPerRow = osmesa->rowlength * bytesPerPixel;
-
- if (osmesa->yup) {
- /* Y=0 is bottom line of window */
- for (i = 0; i < MAX_HEIGHT; i++) {
- osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + i * bytesPerRow);
- }
- }
- else {
- /* Y=0 is top line of window */
- for (i = 0; i < MAX_HEIGHT; i++) {
- GLint j = osmesa->height - i - 1;
- osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + j * bytesPerRow);
- }
- }
-}
-
-
-
/**********************************************************************/
/***** Public Functions *****/
/**********************************************************************/
@@ -1210,7 +1209,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
/* override with our functions */
functions.GetString = get_string;
functions.UpdateState = osmesa_update_state;
- functions.GetBufferSize = get_buffer_size;
+ functions.GetBufferSize = NULL;
if (!_mesa_initialize_context(&osmesa->mesa,
osmesa->gl_visual,
@@ -1248,10 +1247,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
GL_FALSE /* aux */ );
osmesa->format = format;
- osmesa->width = 0;
- osmesa->height = 0;
osmesa->userRowLength = 0;
- osmesa->rowlength = 0;
osmesa->yup = GL_TRUE;
osmesa->rInd = rind;
osmesa->gInd = gind;
@@ -1354,20 +1350,14 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type,
return GL_FALSE;
}
+#if 0
if (!(type == GL_UNSIGNED_BYTE ||
(type == GL_UNSIGNED_SHORT && CHAN_BITS >= 16) ||
(type == GL_FLOAT && CHAN_BITS == 32))) {
/* i.e. is sizeof(type) * 8 > CHAN_BITS? */
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():
- */
- osmesa->width = width;
- osmesa->height = height;
+#endif
osmesa_update_state( &osmesa->mesa, 0 );
@@ -1376,23 +1366,23 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type,
*/
_glapi_check_multithread();
- _mesa_make_current( &osmesa->mesa, osmesa->gl_buffer, osmesa->gl_buffer );
-
- if (osmesa->userRowLength)
- osmesa->rowlength = osmesa->userRowLength;
- else
- osmesa->rowlength = width;
-
+ /* Set renderbuffer fields. Set width/height = 0 to force
+ * osmesa_renderbuffer_storage() being called by _mesa_resize_framebuffer()
+ */
osmesa->rb->Data = buffer;
osmesa->rb->DataType = type;
- compute_row_addresses( osmesa );
+ osmesa->rb->Width = osmesa->rb->Height = 0;
+
+ /* Set the framebuffer's size. This causes the
+ * osmesa_renderbuffer_storage() function to get called.
+ */
+ _mesa_resize_framebuffer(&osmesa->mesa, osmesa->gl_buffer, width, height);
+ osmesa->gl_buffer->Initialized = GL_TRUE; /* XXX TEMPORARY? */
- /* update the color renderbuffer's format, type, width, height */
- osmesa_renderbuffer_storage(&osmesa->mesa, osmesa->rb,
- osmesa->rb->InternalFormat, width, height);
+ _mesa_make_current( &osmesa->mesa, osmesa->gl_buffer, osmesa->gl_buffer );
/* Remove renderbuffer attachment, then re-add. This installs the
- * renderbuffer adaptor/wrapper if needed.
+ * renderbuffer adaptor/wrapper if needed (for bpp conversion).
*/
_mesa_remove_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT);
_mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, osmesa->rb);
@@ -1434,7 +1424,6 @@ OSMesaPixelStore( GLint pname, GLint value )
return;
}
osmesa->userRowLength = value;
- osmesa->rowlength = value ? value : osmesa->width;
break;
case OSMESA_Y_UP:
osmesa->yup = value ? GL_TRUE : GL_FALSE;
@@ -1455,10 +1444,16 @@ OSMesaGetIntegerv( GLint pname, GLint *value )
switch (pname) {
case OSMESA_WIDTH:
- *value = osmesa->width;
+ if (osmesa->gl_buffer)
+ *value = osmesa->gl_buffer->Width;
+ else
+ *value = 0;
return;
case OSMESA_HEIGHT:
- *value = osmesa->height;
+ if (osmesa->gl_buffer)
+ *value = osmesa->gl_buffer->Height;
+ else
+ *value = 0;
return;
case OSMESA_FORMAT:
*value = osmesa->format;
@@ -1516,8 +1511,8 @@ OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
return GL_FALSE;
}
else {
- *width = c->gl_buffer->Width;
- *height = c->gl_buffer->Height;
+ *width = rb->Width;
+ *height = rb->Height;
if (c->gl_visual->depthBits <= 16)
*bytesPerValue = sizeof(GLushort);
else
diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c
index 09330e78ab5..0dd9a144fe8 100644
--- a/src/mesa/drivers/svga/svgamesa.c
+++ b/src/mesa/drivers/svga/svgamesa.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa.c,v 1.26 2005/09/07 23:26:01 brianp Exp $ */
+/* $Id: svgamesa.c,v 1.27 2006/10/15 18:51:22 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -213,10 +213,18 @@ static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *heigh
*height = SVGAMesa->height = vga_getydim();
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ get_buffer_size( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
static void set_buffer( GLcontext *ctx, GLframebuffer *colorBuffer,
diff --git a/src/mesa/drivers/svga/svgamesa15.c b/src/mesa/drivers/svga/svgamesa15.c
index 54b6c977a7b..a4c0901e38f 100644
--- a/src/mesa/drivers/svga/svgamesa15.c
+++ b/src/mesa/drivers/svga/svgamesa15.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa15.c,v 1.11 2002/11/11 18:42:39 brianp Exp $ */
+/* $Id: svgamesa15.c,v 1.12 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -66,10 +66,14 @@ void __clear_color15( GLcontext *ctx, const GLfloat color[4] )
/* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/
}
-void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear15( GLcontext *ctx, GLbitfield mask )
{
int i, j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
GLshort *shortBuffer=(void *)SVGABuffer.FrontBuffer;
@@ -105,7 +109,7 @@ void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y,
diff --git a/src/mesa/drivers/svga/svgamesa16.c b/src/mesa/drivers/svga/svgamesa16.c
index 72ac8183294..999c6331c9c 100644
--- a/src/mesa/drivers/svga/svgamesa16.c
+++ b/src/mesa/drivers/svga/svgamesa16.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa16.c,v 1.11 2002/11/11 18:42:40 brianp Exp $ */
+/* $Id: svgamesa16.c,v 1.12 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -69,10 +69,14 @@ void __clear_color16( GLcontext *ctx, const GLfloat color[4] )
/* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */
}
-void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear16( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
@@ -108,7 +112,7 @@ void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y,
diff --git a/src/mesa/drivers/svga/svgamesa24.c b/src/mesa/drivers/svga/svgamesa24.c
index 07491cc67ac..93c84167ebb 100644
--- a/src/mesa/drivers/svga/svgamesa24.c
+++ b/src/mesa/drivers/svga/svgamesa24.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa24.c,v 1.12 2002/11/11 18:42:41 brianp Exp $ */
+/* $Id: svgamesa24.c,v 1.13 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -91,10 +91,14 @@ void __clear_color24( GLcontext *ctx, const GLfloat color[4] )
/* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */
}
-void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear24( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
@@ -140,7 +144,7 @@ void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y,
diff --git a/src/mesa/drivers/svga/svgamesa32.c b/src/mesa/drivers/svga/svgamesa32.c
index 8a366998d6b..5a3a6776ce7 100644
--- a/src/mesa/drivers/svga/svgamesa32.c
+++ b/src/mesa/drivers/svga/svgamesa32.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa32.c,v 1.12 2002/11/11 18:42:42 brianp Exp $ */
+/* $Id: svgamesa32.c,v 1.13 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -85,10 +85,14 @@ void __clear_color32( GLcontext *ctx, const GLfloat color[4] )
SVGAMesa->clear_truecolor = (col[0] << 16) | (col[1] << 8) | col[2];
}
-void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear32( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
@@ -124,7 +128,7 @@ void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y,
diff --git a/src/mesa/drivers/svga/svgamesa8.c b/src/mesa/drivers/svga/svgamesa8.c
index fd880ef85ad..e3f5eaebf6a 100644
--- a/src/mesa/drivers/svga/svgamesa8.c
+++ b/src/mesa/drivers/svga/svgamesa8.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa8.c,v 1.9 2005/05/04 20:11:39 brianp Exp $ */
+/* $Id: svgamesa8.c,v 1.10 2006/11/01 19:35:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -60,10 +60,14 @@ void __clear_index8( GLcontext *ctx, GLuint index )
SVGAMesa->clear_index = index;
}
-void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+void __clear8( GLcontext *ctx, GLbitfield mask )
{
int i,j;
+ int x = ctx->DrawBuffer->_Xmin;
+ int y = ctx->DrawBuffer->_Ymin;
+ int width = ctx->DrawBuffer->_Xmax - x;
+ int height = ctx->DrawBuffer->_Ymax - y;
+ GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
if (mask & DD_FRONT_LEFT_BIT) {
if (all) {
@@ -95,7 +99,7 @@ void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
+ _swrast_Clear( ctx, mask );
}
void __write_ci32_span8( const GLcontext *ctx, struct gl_renderbuffer *rb,
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index 78e3d9ec8d1..8c3229ab14c 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -281,13 +281,13 @@ static void clear_color(GLcontext *ctx, const GLfloat color[4])
* Clearing of the other non-color buffers is left to the swrast.
*/
-static void clear(GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint x, GLint y,
- GLint width, GLint height)
+static void clear(GLcontext *ctx, GLbitfield mask)
{
#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
+ const GLint x = ctx->DrawBuffer->_Xmin;
+ const GLint y = ctx->DrawBuffer->_Ymin;
+ const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+ const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
WMesaContext pwc = wmesa_context(ctx);
WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
@@ -299,7 +299,7 @@ static void clear(GLcontext *ctx,
ctx->Color.ColorMask[1] != 0xff ||
ctx->Color.ColorMask[2] != 0xff ||
ctx->Color.ColorMask[3] != 0xff) {
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
return;
}
@@ -318,7 +318,8 @@ static void clear(GLcontext *ctx,
/* Try for a fast clear - clearing entire buffer with a single
* byte value. */
- if (all) { /* entire buffer */
+ if (width == ctx->DrawBuffer->Width &&
+ height == ctx->DrawBuffer->Height) { /* entire buffer */
/* Now check for an easy clear value */
switch (bytesPerPixel) {
case 1:
@@ -431,7 +432,7 @@ static void clear(GLcontext *ctx,
/* Call swrast if there is anything left to clear (like DEPTH) */
if (mask)
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
#undef FLIP
}
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c
deleted file mode 100644
index cad299540d7..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c
+++ /dev/null
@@ -1,1196 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Driver interface code to Mesa
-*
-****************************************************************************/
-
-//#include <windows.h>
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx7.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-extern BOOL dglSwapBuffers(HDC hDC);
-
-// HACK: Hack the _33 member of the OpenGL perspective projection matrix
-const float _fPersp_33 = 1.6f;
-
-//---------------------------------------------------------------------------
-// Internal functions
-//---------------------------------------------------------------------------
-
-void _gld_mesa_warning(
- __GLcontext *gc,
- char *str)
-{
- // Intercept Mesa's internal warning mechanism
- gldLogPrintf(GLDLOG_WARN, "Mesa warning: %s", str);
-}
-
-//---------------------------------------------------------------------------
-
-void _gld_mesa_fatal(
- __GLcontext *gc,
- char *str)
-{
- // Intercept Mesa's internal fatal-message mechanism
- gldLogPrintf(GLDLOG_CRITICAL, "Mesa FATAL: %s", str);
-
- // Mesa calls abort(0) here.
- ddlogClose();
- exit(0);
-}
-
-//---------------------------------------------------------------------------
-
-D3DSTENCILOP _gldConvertStencilOp(
- GLenum StencilOp)
-{
- // Used by Stencil: pass, fail and zfail
-
- switch (StencilOp) {
- case GL_KEEP:
- return D3DSTENCILOP_KEEP;
- case GL_ZERO:
- return D3DSTENCILOP_ZERO;
- case GL_REPLACE:
- return D3DSTENCILOP_REPLACE;
- case GL_INCR:
- return D3DSTENCILOP_INCRSAT;
- case GL_DECR:
- return D3DSTENCILOP_DECRSAT;
- case GL_INVERT:
- return D3DSTENCILOP_INVERT;
- case GL_INCR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_INCR;
- case GL_DECR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_DECR;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertStencilOp: Unknown StencilOp\n");
-#endif
-
- return D3DSTENCILOP_KEEP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DCMPFUNC _gldConvertCompareFunc(
- GLenum CmpFunc)
-{
- // Used for Alpha func, depth func and stencil func.
-
- switch (CmpFunc) {
- case GL_NEVER:
- return D3DCMP_NEVER;
- case GL_LESS:
- return D3DCMP_LESS;
- case GL_EQUAL:
- return D3DCMP_EQUAL;
- case GL_LEQUAL:
- return D3DCMP_LESSEQUAL;
- case GL_GREATER:
- return D3DCMP_GREATER;
- case GL_NOTEQUAL:
- return D3DCMP_NOTEQUAL;
- case GL_GEQUAL:
- return D3DCMP_GREATEREQUAL;
- case GL_ALWAYS:
- return D3DCMP_ALWAYS;
- };
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertCompareFunc: Unknown CompareFunc\n");
-#endif
-
- return D3DCMP_ALWAYS;
-}
-
-//---------------------------------------------------------------------------
-
-D3DBLEND _gldConvertBlendFunc(
- GLenum blend,
- GLenum DefaultBlend)
-{
- switch (blend) {
- case GL_ZERO:
- return D3DBLEND_ZERO;
- case GL_ONE:
- return D3DBLEND_ONE;
- case GL_DST_COLOR:
- return D3DBLEND_DESTCOLOR;
- case GL_SRC_COLOR:
- return D3DBLEND_SRCCOLOR;
- case GL_ONE_MINUS_DST_COLOR:
- return D3DBLEND_INVDESTCOLOR;
- case GL_ONE_MINUS_SRC_COLOR:
- return D3DBLEND_INVSRCCOLOR;
- case GL_SRC_ALPHA:
- return D3DBLEND_SRCALPHA;
- case GL_ONE_MINUS_SRC_ALPHA:
- return D3DBLEND_INVSRCALPHA;
- case GL_DST_ALPHA:
- return D3DBLEND_DESTALPHA;
- case GL_ONE_MINUS_DST_ALPHA:
- return D3DBLEND_INVDESTALPHA;
- case GL_SRC_ALPHA_SATURATE:
- return D3DBLEND_SRCALPHASAT;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertBlendFunc: Unknown BlendFunc\n");
-#endif
-
- return DefaultBlend;
-}
-
-//---------------------------------------------------------------------------
-// Misc. functions
-//---------------------------------------------------------------------------
-
-void gld_Noop_DX7(
- GLcontext *ctx)
-{
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "gld_Noop called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Error_DX7(
- GLcontext *ctx)
-{
-#ifdef _DEBUG
- // Quite useless.
-// gldLogMessage(GLDLOG_ERROR, "ctx->Driver.Error called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Required Mesa functions
-//---------------------------------------------------------------------------
-
-static GLboolean gld_set_draw_buffer_DX7(
- GLcontext *ctx,
- GLenum mode)
-{
- (void) ctx;
- if ((mode==GL_FRONT_LEFT) || (mode == GL_BACK_LEFT)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_set_read_buffer_DX7(
- GLcontext *ctx,
- GLframebuffer *buffer,
- GLenum mode)
-{
- /* separate read buffer not supported */
-/*
- ASSERT(buffer == ctx->DrawBuffer);
- ASSERT(mode == GL_FRONT_LEFT);
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Clear_DX7(
- GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint x,
- GLint y,
- GLint width,
- GLint height)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DCOLOR Color = 0;
- float Z = 0.0f;
- DWORD Stencil = 0;
- D3DRECT d3dClearRect;
-
- // TODO: Colourmask
- const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
-
- if (!gld->pDev)
- return;
-
- if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
- GLubyte col[4];
- CLAMPED_FLOAT_TO_UBYTE(col[0], ctx->Color.ClearColor[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], ctx->Color.ClearColor[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], ctx->Color.ClearColor[2]);
- CLAMPED_FLOAT_TO_UBYTE(col[3], ctx->Color.ClearColor[3]);
- dwFlags |= D3DCLEAR_TARGET;
- Color = D3DCOLOR_RGBA(col[0], col[1], col[2], col[3]);
-// ctx->Color.ClearColor[1],
-// ctx->Color.ClearColor[2],
-// ctx->Color.ClearColor[3]);
- }
-
- if (mask & DD_DEPTH_BIT) {
- // D3D7 will fail the Clear call if we try and clear a
- // depth buffer and we haven't created one.
- // Also, some apps try and clear a depth buffer,
- // when a depth buffer hasn't been requested by the app.
- if (ctx->Visual.depthBits == 0) {
- mask &= ~DD_DEPTH_BIT; // Remove depth bit from mask
- } else {
- dwFlags |= D3DCLEAR_ZBUFFER;
- Z = ctx->Depth.Clear;
- }
- }
-
- if (mask & DD_STENCIL_BIT) {
- if (ctx->Visual.stencilBits == 0) {
- // No stencil bits in depth buffer
- mask &= ~DD_STENCIL_BIT; // Remove stencil bit from mask
- } else {
- dwFlags |= D3DCLEAR_STENCIL;
- Stencil = ctx->Stencil.Clear;
- }
- }
-
- // Some apps do really weird things with the rect, such as Quake3.
- if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0)) {
- all = GL_TRUE;
- }
-
- if (!all) {
- // Calculate clear subrect
- d3dClearRect.x1 = x;
- d3dClearRect.y1 = gldCtx->dwHeight - (y + height);
- d3dClearRect.x2 = x + width;
- d3dClearRect.y2 = d3dClearRect.y1 + height;
- }
-
- // dwFlags will be zero if there's nothing to clear
- if (dwFlags) {
- _GLD_DX7_DEV(Clear(
- gld->pDev,
- all ? 0 : 1,
- all ? NULL : &d3dClearRect,
- dwFlags,
- Color, Z, Stencil));
- }
-
- if (mask & DD_ACCUM_BIT) {
- // Clear accumulation buffer
- }
-}
-
-//---------------------------------------------------------------------------
-
-// Mesa 5: Parameter change
-static void gld_buffer_size_DX7(
-// GLcontext *ctx,
- GLframebuffer *fb,
- GLuint *width,
- GLuint *height)
-{
-// GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
-
- *width = fb->Width; // gldCtx->dwWidth;
- *height = fb->Height; // gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Finish_DX7(
- GLcontext *ctx)
-{
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Flush_DX7(
- GLcontext *ctx)
-{
- GLD_context *gld = GLD_GET_CONTEXT(ctx);
-
- // TODO: Detect apps that glFlush() then SwapBuffers() ?
-
- if (gld->EmulateSingle) {
- // Emulating a single-buffered context.
- // [Direct3D doesn't allow rendering to front buffer]
- dglSwapBuffers(gld->hDC);
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_STENCIL(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- // Two-sided stencil. New for Mesa 5
- const GLuint uiFace = 0UL;
-
- struct gl_stencil_attrib *pStencil = &ctx->Stencil;
-
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILENABLE, pStencil->Enabled ? TRUE : FALSE));
- if (pStencil->Enabled) {
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILFUNC, _gldConvertCompareFunc(pStencil->Function[uiFace])));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILREF, pStencil->Ref[uiFace]));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILMASK, pStencil->ValueMask[uiFace]));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILWRITEMASK, pStencil->WriteMask[uiFace]));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILFAIL, _gldConvertStencilOp(pStencil->FailFunc[uiFace])));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILZFAIL, _gldConvertStencilOp(pStencil->ZFailFunc[uiFace])));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILPASS, _gldConvertStencilOp(pStencil->ZPassFunc[uiFace])));
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_COLOR(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DBLEND src;
- D3DBLEND dest;
-
- // Alpha func
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAFUNC, _gldConvertCompareFunc(ctx->Color.AlphaFunc)));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAREF, (DWORD)ctx->Color.AlphaRef));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHATESTENABLE, ctx->Color.AlphaEnabled));
-
- // Blend func
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHABLENDENABLE, ctx->Color.BlendEnabled));
- src = _gldConvertBlendFunc(ctx->Color.BlendSrcRGB, GL_ONE);
- dest = _gldConvertBlendFunc(ctx->Color.BlendDstRGB, GL_ZERO);
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SRCBLEND, src));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_DESTBLEND, dest));
-
-/*
- // Color mask - unsupported by DX7
- if (ctx->Color.ColorMask[0]) dwFlags |= D3DCOLORWRITEENABLE_RED;
- if (ctx->Color.ColorMask[1]) dwFlags |= D3DCOLORWRITEENABLE_GREEN;
- if (ctx->Color.ColorMask[2]) dwFlags |= D3DCOLORWRITEENABLE_BLUE;
- if (ctx->Color.ColorMask[3]) dwFlags |= D3DCOLORWRITEENABLE_ALPHA;
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_COLORWRITEENABLE, dwFlags));
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_DEPTH(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZENABLE, ctx->Depth.Test ? D3DZB_TRUE : D3DZB_FALSE));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZFUNC, _gldConvertCompareFunc(ctx->Depth.Func)));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZWRITEENABLE, ctx->Depth.Mask ? TRUE : FALSE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_POLYGON(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- D3DFILLMODE d3dFillMode = D3DFILL_SOLID;
- D3DCULL d3dCullMode = D3DCULL_NONE;
- int iOffset = 0;
-
- // Fillmode
- switch (ctx->Polygon.FrontMode) {
- case GL_POINT:
- d3dFillMode = D3DFILL_POINT;
- break;
- case GL_LINE:
- d3dFillMode = D3DFILL_WIREFRAME;
- break;
- case GL_FILL:
- d3dFillMode = D3DFILL_SOLID;
- break;
- }
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FILLMODE, d3dFillMode));
-
- if (ctx->Polygon.CullFlag) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_BACK:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CW;
- else
- d3dCullMode = D3DCULL_CCW;
- break;
- case GL_FRONT:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CCW;
- else
- d3dCullMode = D3DCULL_CW;
- break;
- case GL_FRONT_AND_BACK:
- d3dCullMode = D3DCULL_NONE;
- break;
- default:
- break;
- }
- } else {
- d3dCullMode = D3DCULL_NONE;
- }
-// d3dCullMode = D3DCULL_NONE; // TODO: DEBUGGING
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CULLMODE, d3dCullMode));
-
- // Polygon offset
- // ZBIAS ranges from 0 to 16 and can only move towards the viewer
- // Mesa5: ctx->Polygon._OffsetAny removed
- if (ctx->Polygon.OffsetFill) {
- iOffset = (int)ctx->Polygon.OffsetUnits;
- if (iOffset < 0)
- iOffset = -iOffset;
- else
- iOffset = 0; // D3D can't push away
- }
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZBIAS, iOffset));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_FOG(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- D3DCOLOR d3dFogColour;
- D3DFOGMODE d3dFogMode = D3DFOG_LINEAR;
-
- // TODO: Fog is calculated seperately in the Mesa pipeline
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGENABLE, FALSE));
- return;
-
- // Fog enable
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGENABLE, ctx->Fog.Enabled));
- if (!ctx->Fog.Enabled) {
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE));
- return; // If disabled, don't bother setting any fog state
- }
-
- // Fog colour
- d3dFogColour = D3DCOLOR_COLORVALUE( ctx->Fog.Color[0],
- ctx->Fog.Color[1],
- ctx->Fog.Color[2],
- ctx->Fog.Color[3]);
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGCOLOR, d3dFogColour));
-
- // Fog density
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGDENSITY, *((DWORD*) (&ctx->Fog.Density))));
-
- // Fog start
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGSTART, *((DWORD*) (&ctx->Fog.Start))));
-
- // Fog end
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGEND, *((DWORD*) (&ctx->Fog.End))));
-
- // Fog mode
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- d3dFogMode = D3DFOG_LINEAR;
- break;
- case GL_EXP:
- d3dFogMode = D3DFOG_EXP;
- break;
- case GL_EXP2:
- d3dFogMode = D3DFOG_EXP2;
- break;
- }
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGTABLEMODE, d3dFogMode));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_LIGHT(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
- DWORD dwSpecularEnable;
-
- // Shademode
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SHADEMODE, (ctx->Light.ShadeModel == GL_SMOOTH) ? D3DSHADE_GOURAUD : D3DSHADE_FLAT));
-
- // Separate specular colour
- if (ctx->Light.Enabled)
- dwSpecularEnable = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TRUE: FALSE;
- else
- dwSpecularEnable = FALSE;
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SPECULARENABLE, dwSpecularEnable));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_MODELVIEW(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ModelView.m;
- // Mesa5: Model-view is now a stack
- GLfloat *pM = ctx->ModelviewMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10];
- m._34 = pM[11];
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14];
- m._44 = pM[15];
-/* m[0][0] = pM[0];
- m[0][1] = pM[1];
- m[0][2] = pM[2];
- m[0][3] = pM[3];
- m[1][0] = pM[4];
- m[1][1] = pM[5];
- m[1][2] = pM[6];
- m[1][3] = pM[7];
- m[2][0] = pM[8];
- m[2][1] = pM[9];
- m[2][2] = pM[10];
- m[2][3] = pM[11];
- m[3][0] = pM[12];
- m[3][1] = pM[13];
- m[3][2] = pM[14];
- m[3][3] = pM[15];*/
-
- gld->matModelView = m;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_PROJECTION(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ProjectionMatrix.m;
- // Mesa 5: Now a stack
- GLfloat *pM = ctx->ProjectionMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
-
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
-
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10] / _fPersp_33; // / 1.6f;
- m._34 = pM[11];
-
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14] / 2.0f;
- m._44 = pM[15];
-
- gld->matProjection = m;
-}
-
-//---------------------------------------------------------------------------
-/*
-void gldFrustumHook_DX7(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Frustum(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = farval / (nearval - farval);
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Frustum: %f", farval/nearval);
-}
-
-//---------------------------------------------------------------------------
-
-void gldOrthoHook_DX7(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Ortho(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = 1.6f;
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Ortho: %f", farval/nearval);
-}
-*/
-//---------------------------------------------------------------------------
-
-void gld_NEW_VIEWPORT(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- D3DVIEWPORT7 d3dvp;
-// GLint x, y;
-// GLsizei w, h;
-
- // Set depth range
- _GLD_DX7_DEV(GetViewport(gld->pDev, &d3dvp));
- // D3D can't do Quake1/Quake2 z-trick
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.dvMinZ = ctx->Viewport.Near;
- d3dvp.dvMaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.dvMinZ = ctx->Viewport.Far;
- d3dvp.dvMaxZ = ctx->Viewport.Near;
- }
-/* x = ctx->Viewport.X;
- y = ctx->Viewport.Y;
- w = ctx->Viewport.Width;
- h = ctx->Viewport.Height;
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
- d3dvp.X = x;
- d3dvp.Y = gldCtx->dwHeight - (y + h);
- d3dvp.Width = w;
- d3dvp.Height = h;*/
- _GLD_DX7_DEV(SetViewport(gld->pDev, &d3dvp));
-
-// gld->fFlipWindowY = (float)gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-__inline BOOL _gldAnyEvalEnabled(
- GLcontext *ctx)
-{
- struct gl_eval_attrib *eval = &ctx->Eval;
-
- if ((eval->AutoNormal) ||
- (eval->Map1Color4) ||
- (eval->Map1Index) ||
- (eval->Map1Normal) ||
- (eval->Map1TextureCoord1) ||
- (eval->Map1TextureCoord2) ||
- (eval->Map1TextureCoord3) ||
- (eval->Map1TextureCoord4) ||
- (eval->Map1Vertex3) ||
- (eval->Map1Vertex4) ||
- (eval->Map2Color4) ||
- (eval->Map2Index) ||
- (eval->Map2Normal) ||
- (eval->Map2TextureCoord1) ||
- (eval->Map2TextureCoord2) ||
- (eval->Map2TextureCoord3) ||
- (eval->Map2TextureCoord4) ||
- (eval->Map2Vertex3) ||
- (eval->Map2Vertex4)
- )
- return TRUE;
-
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL _gldChooseInternalPipeline(
- GLcontext *ctx,
- GLD_driver_dx7 *gld)
-{
-// return TRUE; // DEBUGGING: ALWAYS USE MESA
-// return FALSE; // DEBUGGING: ALWAYS USE D3D
-
- if ((glb.dwTnL == GLDS_TNL_MESA) || (gld->bHasHWTnL == FALSE))
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE; // Force Mesa TnL
- }
-
- if ((ctx->Light.Enabled) ||
- (1) ||
- (ctx->Texture._TexGenEnabled) ||
- (ctx->Texture._TexMatEnabled) ||
-// (ctx->Transform._AnyClip) ||
- (ctx->Scissor.Enabled) ||
- _gldAnyEvalEnabled(ctx) // Put this last so we can early-out
- )
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE;
- }
-
- gld->PipelineUsage.qwD3DFVF.QuadPart++;
- return FALSE;
-
-/* // Force Mesa pipeline?
- if (glb.dwTnL == GLDS_TNL_MESA) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Test for functionality not exposed in the D3D pathways
- if ((ctx->Texture._GenFlags)) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Now decide if vertex shader can be used.
- // If two sided lighting is enabled then we must either
- // use Mesa TnL or the vertex shader
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
- if (gld->VStwosidelight.hShader && !ctx->Fog.Enabled) {
- // Use Vertex Shader
- gld->PipelineUsage.dwD3D2SVS.QuadPart++;
- return GLD_PIPELINE_D3D_VS_TWOSIDE;
- } else {
- // Use Mesa TnL
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
- }
-
- // Must be D3D fixed-function pipeline
- gld->PipelineUsage.dwD3DFVF.QuadPart++;
- return GLD_PIPELINE_D3D_FVF;
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_update_state_DX7(
- GLcontext *ctx,
- GLuint new_state)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLD_pb_dx7 *gldPB;
-
- if (!gld || !gld->pDev)
- return;
-
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-
- // SetupIndex will be used in the pipelines for choosing setup function
- if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) ||
- (ctx->Fog.Enabled))
- {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT_EXTRAS;
- else
- gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS;
- } else {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture
- else
- gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture
- }
-
- gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld);
- if (gld->bUseMesaTnL) {
- gldPB = &gld->PB2d;
- // DX7 Does not implement D3DRS_SOFTWAREVERTEXPROCESSING
-// _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, TRUE));
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, FALSE));
-// _GLD_DX7_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF));
- } else {
- gldPB = &gld->PB3d;
- _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, TRUE));
-// if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) {
-// _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware));
-// _GLD_DX7_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
-// } else {
- // DX7 Does not implement D3DRS_SOFTWAREVERTEXPROCESSING
-// _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL));
-// _GLD_DX7_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF));
-// }
- }
-
-#define _GLD_TEST_STATE(a) \
- if (new_state & (a)) { \
- gld##a(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_TEST_STATE_DX7(a) \
- if (new_state & (a)) { \
- gld##a##_DX7(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_IGNORE_STATE(a) new_state &= ~(a);
-
-// if (!gld->bUseMesaTnL) {
- // Not required if Mesa is doing the TnL.
- // Problem: If gld->bUseMesaTnL is TRUE when these are signaled,
- // then we'll miss updating the D3D TnL pipeline.
- // Therefore, don't test for gld->bUseMesaTnL
- _GLD_TEST_STATE(_NEW_MODELVIEW);
- _GLD_TEST_STATE(_NEW_PROJECTION);
-// }
-
- _GLD_TEST_STATE_DX7(_NEW_TEXTURE); // extern, so guard with _DX7
- _GLD_TEST_STATE(_NEW_COLOR);
- _GLD_TEST_STATE(_NEW_DEPTH);
- _GLD_TEST_STATE(_NEW_POLYGON);
- _GLD_TEST_STATE(_NEW_STENCIL);
- _GLD_TEST_STATE(_NEW_FOG);
- _GLD_TEST_STATE(_NEW_LIGHT);
- _GLD_TEST_STATE(_NEW_VIEWPORT);
-
- _GLD_IGNORE_STATE(_NEW_TRANSFORM);
-
-
-// Stubs for future use.
-/* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_STATE(_NEW_ACCUM);
- _GLD_TEST_STATE(_NEW_EVAL);
- _GLD_TEST_STATE(_NEW_HINT);
- _GLD_TEST_STATE(_NEW_LINE);
- _GLD_TEST_STATE(_NEW_PIXEL);
- _GLD_TEST_STATE(_NEW_POINT);
- _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE);
- _GLD_TEST_STATE(_NEW_SCISSOR);
- _GLD_TEST_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_STATE(_NEW_ARRAY);
- _GLD_TEST_STATE(_NEW_RENDERMODE);
- _GLD_TEST_STATE(_NEW_BUFFERS);
- _GLD_TEST_STATE(_NEW_MULTISAMPLE);
-*/
-
-// For debugging.
-#if 0
-#define _GLD_TEST_UNHANDLED_STATE(a) \
- if (new_state & (a)) { \
- gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \
- }
- _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_ACCUM);
- _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_HINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_LINE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY);
- _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS);
- _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE);
-#undef _GLD_UNHANDLED_STATE
-#endif
-
-#undef _GLD_TEST_STATE
-}
-
-//---------------------------------------------------------------------------
-// Viewport
-//---------------------------------------------------------------------------
-
-void gld_Viewport_DX7(
- GLcontext *ctx,
- GLint x,
- GLint y,
- GLsizei w,
- GLsizei h)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- D3DVIEWPORT7 d3dvp;
-
- if (!gld || !gld->pDev)
- return;
-
- // This is a hack. When the app is minimized, Mesa passes
- // w=1 and h=1 for viewport dimensions. Without this test
- // we get a GPF in gld_wgl_resize_buffers().
- if ((w==1) && (h==1))
- return;
-
- // Call ResizeBuffersMESA. This function will early-out
- // if no resize is needed.
- //ctx->Driver.ResizeBuffersMESA(ctx);
- // Mesa 5: Changed parameters
- ctx->Driver.ResizeBuffers(gldCtx->glBuffer);
-
-#if 0
- ddlogPrintf(GLDLOG_SYSTEM, ">> Viewport x=%d y=%d w=%d h=%d", x,y,w,h);
-#endif
-
- // ** D3D viewport must not be outside the render target surface **
- // Sanity check the GL viewport dimensions
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
-
- d3dvp.dwX = x;
- d3dvp.dwY = gldCtx->dwHeight - (y + h);
- d3dvp.dwWidth = w;
- d3dvp.dwHeight = h;
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.dvMinZ = ctx->Viewport.Near;
- d3dvp.dvMaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.dvMinZ = ctx->Viewport.Far;
- d3dvp.dvMaxZ = ctx->Viewport.Near;
- }
-
- // TODO: DEBUGGING
-// d3dvp.MinZ = 0.0f;
-// d3dvp.MaxZ = 1.0f;
-
- _GLD_DX7_DEV(SetViewport(gld->pDev, &d3dvp));
-
-}
-
-//---------------------------------------------------------------------------
-
-extern BOOL dglWglResizeBuffers(GLcontext *ctx, BOOL bDefaultDriver);
-
-// Mesa 5: Parameter change
-void gldResizeBuffers_DX7(
-// GLcontext *ctx)
- GLframebuffer *fb)
-{
- GET_CURRENT_CONTEXT(ctx);
- dglWglResizeBuffers(ctx, TRUE);
-}
-
-//---------------------------------------------------------------------------
-#ifdef _DEBUG
-// This is only for debugging.
-// To use, plug into ctx->Driver.Enable pointer below.
-void gld_Enable(
- GLcontext *ctx,
- GLenum e,
- GLboolean b)
-{
- char buf[1024];
- sprintf(buf, "Enable: %s (%s)\n", _mesa_lookup_enum_by_nr(e), b?"TRUE":"FALSE");
- ddlogMessage(DDLOG_SYSTEM, buf);
-}
-#endif
-//---------------------------------------------------------------------------
-// Driver pointer setup
-//---------------------------------------------------------------------------
-
-extern const GLubyte* _gldGetStringGeneric(GLcontext*, GLenum);
-
-void gldSetupDriverPointers_DX7(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- // Mandatory functions
- ctx->Driver.GetString = _gldGetStringGeneric;
- ctx->Driver.UpdateState = gld_update_state_DX7;
- ctx->Driver.Clear = gld_Clear_DX7;
- ctx->Driver.DrawBuffer = gld_set_draw_buffer_DX7;
- ctx->Driver.GetBufferSize = gld_buffer_size_DX7;
- ctx->Driver.Finish = gld_Finish_DX7;
- ctx->Driver.Flush = gld_Flush_DX7;
- ctx->Driver.Error = gld_Error_DX7;
-
- // Hardware accumulation buffer
- ctx->Driver.Accum = NULL; // TODO: gld_Accum;
-
- // Bitmap functions
- ctx->Driver.CopyPixels = gld_CopyPixels_DX7;
- ctx->Driver.DrawPixels = gld_DrawPixels_DX7;
- ctx->Driver.ReadPixels = gld_ReadPixels_DX7;
- ctx->Driver.Bitmap = gld_Bitmap_DX7;
-
- // Buffer resize
- ctx->Driver.ResizeBuffers = gldResizeBuffers_DX7;
-
- // Texture image functions
- ctx->Driver.ChooseTextureFormat = gld_ChooseTextureFormat_DX7;
- ctx->Driver.TexImage1D = gld_TexImage1D_DX7;
- ctx->Driver.TexImage2D = gld_TexImage2D_DX7;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage1D = gld_TexSubImage1D_DX7;
- ctx->Driver.TexSubImage2D = gld_TexSubImage2D_DX7;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
-
- ctx->Driver.CopyTexImage1D = gldCopyTexImage1D_DX7; //NULL;
- ctx->Driver.CopyTexImage2D = gldCopyTexImage2D_DX7; //NULL;
- ctx->Driver.CopyTexSubImage1D = gldCopyTexSubImage1D_DX7; //NULL;
- ctx->Driver.CopyTexSubImage2D = gldCopyTexSubImage2D_DX7; //NULL;
- ctx->Driver.CopyTexSubImage3D = gldCopyTexSubImage3D_DX7;
- ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
-
- // Texture object functions
- ctx->Driver.BindTexture = NULL;
- ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!;
- ctx->Driver.DeleteTexture = gld_DeleteTexture_DX7;
- ctx->Driver.PrioritizeTexture = NULL;
-
- // Imaging functionality
- ctx->Driver.CopyColorTable = NULL;
- ctx->Driver.CopyColorSubTable = NULL;
- ctx->Driver.CopyConvolutionFilter1D = NULL;
- ctx->Driver.CopyConvolutionFilter2D = NULL;
-
- // State changing functions
- ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc;
- ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc;
- ctx->Driver.ClearColor = NULL; //gld_ClearColor;
- ctx->Driver.ClearDepth = NULL; //gld_ClearDepth;
- ctx->Driver.ClearStencil = NULL; //gld_ClearStencil;
- ctx->Driver.ColorMask = NULL; //gld_ColorMask;
- ctx->Driver.CullFace = NULL; //gld_CullFace;
- ctx->Driver.ClipPlane = NULL; //gld_ClipPlane;
- ctx->Driver.FrontFace = NULL; //gld_FrontFace;
- ctx->Driver.DepthFunc = NULL; //gld_DepthFunc;
- ctx->Driver.DepthMask = NULL; //gld_DepthMask;
- ctx->Driver.DepthRange = NULL;
- ctx->Driver.Enable = NULL; //gld_Enable;
- ctx->Driver.Fogfv = NULL; //gld_Fogfv;
- ctx->Driver.Hint = NULL; //gld_Hint;
- ctx->Driver.Lightfv = NULL; //gld_Lightfv;
- ctx->Driver.LightModelfv = NULL; //gld_LightModelfv;
- ctx->Driver.LineStipple = NULL; //gld_LineStipple;
- ctx->Driver.LineWidth = NULL; //gld_LineWidth;
- ctx->Driver.LogicOpcode = NULL; //gld_LogicOpcode;
- ctx->Driver.PointParameterfv = NULL; //gld_PointParameterfv;
- ctx->Driver.PointSize = NULL; //gld_PointSize;
- ctx->Driver.PolygonMode = NULL; //gld_PolygonMode;
- ctx->Driver.PolygonOffset = NULL; //gld_PolygonOffset;
- ctx->Driver.PolygonStipple = NULL; //gld_PolygonStipple;
- ctx->Driver.RenderMode = NULL; //gld_RenderMode;
- ctx->Driver.Scissor = NULL; //gld_Scissor;
- ctx->Driver.ShadeModel = NULL; //gld_ShadeModel;
- ctx->Driver.StencilFunc = NULL; //gld_StencilFunc;
- ctx->Driver.StencilMask = NULL; //gld_StencilMask;
- ctx->Driver.StencilOp = NULL; //gld_StencilOp;
- ctx->Driver.TexGen = NULL; //gld_TexGen;
- ctx->Driver.TexEnv = NULL;
- ctx->Driver.TexParameter = NULL;
- ctx->Driver.TextureMatrix = NULL; //gld_TextureMatrix;
- ctx->Driver.Viewport = gld_Viewport_DX7;
-
- _swsetup_Wakeup(ctx);
-
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- tnl->Driver.Render.ResetLineStipple = gld_ResetLineStipple_DX7;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
-
- // Hook into glFrustum() and glOrtho()
-// ctx->Exec->Frustum = gldFrustumHook_DX7;
-// ctx->Exec->Ortho = gldOrthoHook_DX7;
-
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h b/src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h
deleted file mode 100644
index b5a491e41b1..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h
+++ /dev/null
@@ -1,292 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 7.0a header file
-*
-****************************************************************************/
-
-#ifndef _GLD_DX7_H
-#define _GLD_DX7_H
-
-//---------------------------------------------------------------------------
-// Windows includes
-//---------------------------------------------------------------------------
-
-#define DIRECTDRAW_VERSION 0x0700
-#define DIRECT3D_VERSION 0x0700
-#include <d3d.h>
-#include <d3dx.h>
-
-// Typedef for obtaining function from d3d7.dll
-//typedef IDirect3D7* (WINAPI *FNDIRECT3DCREATE7) (UINT);
-
-
-//---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-
-#ifdef _DEBUG
-// Debug build tests the return value of D3D calls
-#define _GLD_TEST_HRESULT(h) \
-{ \
- HRESULT _hr = (h); \
- if (FAILED(_hr)) { \
- gldLogError(GLDLOG_ERROR, #h, _hr); \
- } \
-}
-#define _GLD_DX7(func) _GLD_TEST_HRESULT(IDirect3D7_##func##)
-#define _GLD_DX7_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice7_##func##)
-#define _GLD_DX7_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer7_##func##)
-#define _GLD_DX7_TEX(func) _GLD_TEST_HRESULT(IDirectDrawSurface7_##func##)
-#else
-#define _GLD_DX7(func) IDirect3D7_##func
-#define _GLD_DX7_DEV(func) IDirect3DDevice7_##func
-#define _GLD_DX7_VB(func) IDirect3DVertexBuffer7_##func
-#define _GLD_DX7_TEX(func) IDirectDrawSurface7_##func
-#endif
-
-#define SAFE_RELEASE(p) \
-{ \
- if (p) { \
- (p)->lpVtbl->Release(p); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_VB7(p) \
-{ \
- if (p) { \
- IDirect3DVertexBuffer7_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_SURFACE7(p) \
-{ \
- if (p) { \
- IDirectDrawSurface7_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-// Emulate some DX8 defines
-#define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
-#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
-#define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
-
-
-// Setup index.
-enum {
- GLD_SI_FLAT = 0,
- GLD_SI_SMOOTH = 1,
- GLD_SI_FLAT_EXTRAS = 2,
- GLD_SI_SMOOTH_EXTRAS = 3,
-};
-
-//---------------------------------------------------------------------------
-// Vertex definitions for Fixed-Function pipeline
-//---------------------------------------------------------------------------
-
-//
-// NOTE: If the number of texture units is altered then most of
-// the texture code will need to be revised.
-//
-
-#define GLD_MAX_TEXTURE_UNITS_DX7 2
-
-//
-// 2D vertex transformed by Mesa
-//
-#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \
- D3DFVF_DIFFUSE | \
- D3DFVF_SPECULAR | \
- D3DFVF_TEX2)
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT sz; // Screen Z (depth)
- FLOAT rhw; // Reciprocal homogenous W
- DWORD diffuse; // Diffuse colour
- DWORD specular; // For separate-specular support
- FLOAT t0_u, t0_v; // 1st set of texture coords
- FLOAT t1_u, t1_v; // 2nd set of texture coords
-} GLD_2D_VERTEX;
-
-
-//
-// 3D vertex transformed by Direct3D
-//
-#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \
- D3DFVF_DIFFUSE | \
- D3DFVF_TEX2)
-
-typedef struct {
- D3DXVECTOR3 Position; // XYZ Vector in object space
- D3DCOLOR Diffuse; // Diffuse colour
- D3DXVECTOR2 TexUnit0; // Texture unit 0
- D3DXVECTOR2 TexUnit1; // Texture unit 1
-} GLD_3D_VERTEX;
-
-//---------------------------------------------------------------------------
-// Structs
-//---------------------------------------------------------------------------
-
-// This keeps a count of how many times we choose each individual internal
-// pathway. Useful for seeing if a certain pathway was ever used by an app, and
-// how much each pathway is biased.
-// Zero the members at context creation and dump stats at context deletion.
-typedef struct {
- // Note: DWORD is probably too small
- ULARGE_INTEGER qwMesa; // Mesa TnL pipeline
- ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline
-} GLD_pipeline_usage;
-
-// GLDirect Primitive Buffer (points, lines, triangles and quads)
-typedef struct {
- // Data for IDirect3D7::CreateVertexBuffer()
- DWORD dwStride; // Stride of vertex
- DWORD dwCreateFlags; // Create flags
- DWORD dwFVF; // Direct3D Flexible Vertex Format
-
- IDirect3DVertexBuffer7 *pVB; // Holds points, lines, tris and quads.
-
- // Point list is assumed to be at start of buffer
- DWORD iFirstLine; // Index of start of line list
- DWORD iFirstTriangle; // Index of start of triangle list
-
- BYTE *pPoints; // Pointer to next free point
- BYTE *pLines; // Pointer to next free line
- BYTE *pTriangles; // Pointer to next free triangle
-
- DWORD nPoints; // Number of points ready to render
- DWORD nLines; // Number of lines ready to render
- DWORD nTriangles; // Number of triangles ready to render
-} GLD_pb_dx7;
-
-// GLDirect DX7 driver data
-typedef struct {
- // GLDirect vars
- BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered)
- BOOL bDepthStencil; // Depth buffer needed (stencil optional)
- D3DX_SURFACEFORMAT RenderFormat; // Format of back/front buffer
- D3DX_SURFACEFORMAT DepthFormat; // Format of depth/stencil
-
- // Direct3D vars
- DDCAPS ddCaps;
- D3DDEVICEDESC7 d3dCaps;
- BOOL bHasHWTnL; // Device has Hardware Transform/Light?
- ID3DXContext *pD3DXContext; // Base D3DX context
- IDirectDraw7 *pDD; // DirectDraw7 interface
- IDirect3D7 *pD3D; // Base Direct3D7 interface
- IDirect3DDevice7 *pDev; // Direct3D7 Device interface
- GLD_pb_dx7 PB2d; // Vertices transformed by Mesa
- GLD_pb_dx7 PB3d; // Vertices transformed by Direct3D
- D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type
- D3DMATRIX matProjection; // Projection matrix for D3D TnL
- D3DMATRIX matModelView; // Model/View matrix for D3D TnL
- int iSetupFunc; // Which setup functions to use
- BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL
-
- GLD_pipeline_usage PipelineUsage;
-} GLD_driver_dx7;
-
-#define GLD_GET_DX7_DRIVER(c) (GLD_driver_dx7*)(c)->glPriv
-
-//---------------------------------------------------------------------------
-// Function prototypes
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX7(LPCSTR a);
-void gldEnableExtensions_DX7(GLcontext *ctx);
-void gldInstallPipeline_DX7(GLcontext *ctx);
-void gldSetupDriverPointers_DX7(GLcontext *ctx);
-void gldResizeBuffers_DX7(GLframebuffer *fb);
-
-
-// Texture functions
-
-void gldCopyTexImage1D_DX7(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-void gldCopyTexImage2D_DX7(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void gldCopyTexSubImage1D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
-void gldCopyTexSubImage2D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-void gldCopyTexSubImage3D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-
-void gld_NEW_TEXTURE_DX7(GLcontext *ctx);
-void gld_DrawPixels_DX7(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels);
-void gld_ReadPixels_DX7(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest);
-void gld_CopyPixels_DX7(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type);
-void gld_Bitmap_DX7(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
-const struct gl_texture_format* gld_ChooseTextureFormat_DX7(GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType);
-void gld_TexImage2D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *tObj, struct gl_texture_image *texImage);
-void gld_TexImage1D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage2D_DX7( GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage1D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage);
-void gld_DeleteTexture_DX7(GLcontext *ctx, struct gl_texture_object *tObj);
-void gld_ResetLineStipple_DX7(GLcontext *ctx);
-
-// 2D primitive functions
-
-void gld_Points2D_DX7(GLcontext *ctx, GLuint first, GLuint last);
-
-void gld_Line2DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1);
-
-void gld_Triangle2DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DFlatExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-
-void gld_Quad2DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DFlatExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// 3D primitive functions
-
-void gld_Points3D_DX7(GLcontext *ctx, GLuint first, GLuint last);
-void gld_Line3DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Line3DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// Primitive functions for Two-sided-lighting Vertex Shader
-
-void gld_Points2DTwoside_DX7(GLcontext *ctx, GLuint first, GLuint last);
-void gld_Line2DFlatTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmoothTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle2DFlatTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad2DFlatTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-#endif
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h b/src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h
deleted file mode 100644
index df6fceb43e6..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*==========================================================================;
- *
- *
- * File: dxerr8.h
- * Content: DirectX Error Library Include File
- *
- ****************************************************************************/
-
-#ifndef _GLD_DXERR7_H_
-#define _GLD_DXERR7_H_
-
-
-#include <d3d.h>
-
-//
-// DXGetErrorString8
-//
-// Desc: Converts an DirectX HRESULT to a string
-//
-// Args: HRESULT hr Can be any error code from
-// DPLAY D3D8 D3DX8 DMUSIC DSOUND
-//
-// Return: Converted string
-//
-const char* __stdcall DXGetErrorString8A(HRESULT hr);
-const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr);
-
-#ifdef UNICODE
- #define DXGetErrorString8 DXGetErrorString8W
-#else
- #define DXGetErrorString8 DXGetErrorString8A
-#endif
-
-
-//
-// DXTrace
-//
-// Desc: Outputs a formatted error message to the debug stream
-//
-// Args: CHAR* strFile The current file, typically passed in using the
-// __FILE__ macro.
-// DWORD dwLine The current line number, typically passed in using the
-// __LINE__ macro.
-// HRESULT hr An HRESULT that will be traced to the debug stream.
-// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
-// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
-//
-// Return: The hr that was passed in.
-//
-//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
-//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
-HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
-HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
-
-#ifdef UNICODE
- #define DXTrace DXTraceW
-#else
- #define DXTrace DXTraceA
-#endif
-
-
-//
-// Helper macros
-//
-#if defined(DEBUG) | defined(_DEBUG)
- #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
- #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
- #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
-#else
- #define DXTRACE_MSG(str) (0L)
- #define DXTRACE_ERR(str,hr) (hr)
- #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
-#endif
-
-
-#endif
-
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c
deleted file mode 100644
index 6be41a80dd3..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GL extensions
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "../gld_settings.h"
-
-#include <windows.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-//#include "ddlog.h"
-//#include "gld_dx8.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "dglcontext.h"
-#include "extensions.h"
-
-// For some reason this is not defined in an above header...
-extern void _mesa_enable_imaging_extensions(GLcontext *ctx);
-
-//---------------------------------------------------------------------------
-// Hack for the SGIS_multitexture extension that was removed from Mesa
-// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel
-
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // To enable, uncomment:
- // _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
-//---------------------------------------------------------------------------
-
-enum {
- /* Quake2 GL_SGIS_multitexture */
- GL_SELECTED_TEXTURE_SGIS = 0x835B,
- GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C,
- GL_MAX_TEXTURES_SGIS = 0x835D,
- GL_TEXTURE0_SGIS = 0x835E,
- GL_TEXTURE1_SGIS = 0x835F,
- GL_TEXTURE2_SGIS = 0x8360,
- GL_TEXTURE3_SGIS = 0x8361,
- GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363,
-};
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldSelectTextureSGIS(
- GLenum target)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glActiveTextureARB(ARB_target);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fSGIS(
- GLenum target,
- GLfloat s,
- GLfloat t)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fARB(ARB_target, s, t);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fvSGIS(
- GLenum target,
- const GLfloat *v)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fvARB(ARB_target, v);
-}
-
-//---------------------------------------------------------------------------
-// Extensions
-//---------------------------------------------------------------------------
-
-typedef struct {
- PROC proc;
- char *name;
-} GLD_extension;
-
-GLD_extension GLD_extList[] = {
-#ifdef GL_EXT_polygon_offset
- { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
-#endif
- { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
- { (PROC)glBlendColorEXT, "glBlendColorExt" },
- { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
- { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
- { (PROC)glColorPointerEXT, "glColorPointerEXT" },
- { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
- { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
- { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
- { (PROC)glGetPointervEXT, "glGetPointervEXT" },
- { (PROC)glArrayElementEXT, "glArrayElementEXT" },
- { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
- { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
- { (PROC)glBindTextureEXT, "glBindTextureEXT" },
- { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
- { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
- { (PROC)glIsTextureEXT, "glIsTextureEXT" },
- { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
- { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
- { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
- { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
- { (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
- { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
-
- { (PROC)glLockArraysEXT, "glLockArraysEXT" },
- { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
- { NULL, "\0" }
-};
-
-GLD_extension GLD_multitexList[] = {
-/*
- { (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" },
- { (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" },
- { (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" },
- { (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" },
- { (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" },
- { (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" },
- { (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" },
- { (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" },
- { (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" },
- { (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" },
- { (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
- { (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" },
- { (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" },
- { (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" },
- { (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" },
- { (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" },
- { (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" },
- { (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" },
- { (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" },
- { (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" },
- { (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" },
- { (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" },
- { (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" },
- { (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" },
- { (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" },
- { (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" },
- { (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" },
- { (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" },
- { (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" },
- { (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" },
- { (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" },
- { (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" },
- { (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" },
-*/
- { (PROC)glActiveTextureARB, "glActiveTextureARB" },
- { (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" },
- { (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" },
- { (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" },
- { (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" },
- { (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" },
- { (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" },
- { (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" },
- { (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" },
- { (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" },
- { (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" },
- { (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" },
- { (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" },
- { (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" },
- { (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" },
- { (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" },
- { (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" },
- { (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" },
- { (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" },
- { (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" },
- { (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" },
- { (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" },
- { (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" },
- { (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" },
- { (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" },
- { (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" },
- { (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" },
- { (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" },
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" },
- { (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" },
- { (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" },
- { (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" },
- { (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" },
- { (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" },
-
- // Descent3 doesn't use correct string, hence this hack
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" },
-
- // Quake2 SGIS multitexture
- { (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
-
- { NULL, "\0" }
-};
-
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX(
- LPCSTR a)
-{
- int i;
- PROC proc = NULL;
-
- for (i=0; GLD_extList[i].proc; i++) {
- if (!strcmp(a, GLD_extList[i].name)) {
- proc = GLD_extList[i].proc;
- break;
- }
- }
-
- if (glb.bMultitexture) {
- for (i=0; GLD_multitexList[i].proc; i++) {
- if (!strcmp(a, GLD_multitexList[i].name)) {
- proc = GLD_multitexList[i].proc;
- break;
- }
- }
- }
-
- gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
-
- return proc;
-}
-
-//---------------------------------------------------------------------------
-
-void gldEnableExtensions_DX7(
- GLcontext *ctx)
-{
- GLuint i;
-
- // Mesa enables some extensions by default.
- // This table decides which ones we want to switch off again.
-
- // NOTE: GL_EXT_compiled_vertex_array appears broken.
-
- const char *gld_disable_extensions[] = {
-// "GL_ARB_transpose_matrix",
-// "GL_EXT_compiled_vertex_array",
-// "GL_EXT_polygon_offset",
-// "GL_EXT_rescale_normal",
- "GL_EXT_texture3D",
-// "GL_NV_texgen_reflection",
- "GL_EXT_abgr",
- "GL_EXT_bgra",
- NULL
- };
-
- const char *gld_multitex_extensions[] = {
- "GL_ARB_multitexture", // Quake 3
- NULL
- };
-
- // Quake 2 engines
- const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture";
-
- const char *gld_enable_extensions[] = {
- "GL_EXT_texture_env_add", // Quake 3
- "GL_ARB_texture_env_add", // Quake 3
- NULL
- };
-
- for (i=0; gld_disable_extensions[i]; i++) {
- _mesa_disable_extension(ctx, gld_disable_extensions[i]);
- }
-
- for (i=0; gld_enable_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_enable_extensions[i]);
- }
-
- if (glb.bMultitexture) {
- for (i=0; gld_multitex_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_multitex_extensions[i]);
- }
-
- // GL_SGIS_multitexture
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // Fair bit slower on GeForce256,
- // Much slower on 3dfx Voodoo5 5500.
-// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
- }
-
- _mesa_enable_imaging_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
- _mesa_enable_1_4_extensions(ctx);
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c
deleted file mode 100644
index 9ccec69b98a..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Mesa transformation pipeline with GLDirect fastpath
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx7.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-
-extern struct tnl_pipeline_stage _gld_d3d_render_stage;
-extern struct tnl_pipeline_stage _gld_mesa_render_stage;
-
-static const struct tnl_pipeline_stage *gld_pipeline[] = {
- &_gld_d3d_render_stage, // Direct3D TnL
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
- &_gld_mesa_render_stage, // Mesa TnL, D3D rendering
- 0,
-};
-
-//---------------------------------------------------------------------------
-
-void gldInstallPipeline_DX7(
- GLcontext *ctx)
-{
- // Remove any existing pipeline stages,
- // then install GLDirect pipeline stages.
-
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, gld_pipeline);
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c
deleted file mode 100644
index 5da25003c08..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c
+++ /dev/null
@@ -1,1448 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Primitive (points/lines/tris/quads) rendering
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx7.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "swrast/s_context.h"
-#include "swrast/s_depth.h"
-#include "swrast/s_lines.h"
-#include "swrast/s_triangle.h"
-#include "swrast/s_trispan.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-// Disable compiler complaints about unreferenced local variables
-#pragma warning (disable:4101)
-
-//---------------------------------------------------------------------------
-// Helper defines for primitives
-//---------------------------------------------------------------------------
-
-//static const float ooZ = 1.0f / 65536.0f; // One over Z
-
-#define GLD_COLOUR (D3DCOLOR_RGBA(swv->color[0], swv->color[1], swv->color[2], swv->color[3]))
-#define GLD_SPECULAR (D3DCOLOR_RGBA(swv->specular[0], swv->specular[1], swv->specular[2], swv->specular[3]))
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-//---------------------------------------------------------------------------
-// 2D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_2D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pPoints; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pLines; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_TRIANGLES \
- BOOL bFog = ctx->Fog.Enabled; \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pTriangles; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour; \
- GLuint facing = 0; \
- struct vertex_buffer *VB; \
- GLchan (*vbcolor)[4]; \
- GLchan (*vbspec)[4]
-
-#define GLD_SETUP_GET_SWVERT(s) \
- swv = &ss->verts[##s]
-
-#define GLD_SETUP_2D_VERTEX \
- pV->x = swv->win[0]; \
- pV->y = GLD_FLIP_Y(swv->win[1]); \
- pV->rhw = swv->win[3]
-
-#define GLD_SETUP_SMOOTH_COLOUR \
- pV->diffuse = GLD_COLOUR
-
-#define GLD_SETUP_GET_FLAT_COLOUR \
- dwFlatColour = GLD_COLOUR
-#define GLD_SETUP_GET_FLAT_FOG_COLOUR \
- dwFlatColour = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_USE_FLAT_COLOUR \
- pV->diffuse = dwFlatColour
-
-#define GLD_SETUP_GET_FLAT_SPECULAR \
- dwSpecularColour= GLD_SPECULAR
-
-#define GLD_SETUP_USE_FLAT_SPECULAR \
- pV->specular = dwSpecularColour
-
-#define GLD_SETUP_DEPTH \
- pV->sz = swv->win[2] / ctx->DepthMaxF
-// pV->z = swv->win[2] * ooZ;
-
-#define GLD_SETUP_SPECULAR \
- pV->specular = GLD_SPECULAR
-
-#define GLD_SETUP_FOG \
- pV->diffuse = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_TEX0 \
- pV->t0_u = swv->texcoord[0][0]; \
- pV->t0_v = swv->texcoord[0][1]
-
-#define GLD_SETUP_TEX1 \
- pV->t1_u = swv->texcoord[1][0]; \
- pV->t1_v = swv->texcoord[1][1]
-
-#define GLD_SETUP_LIGHTING(v) \
- if (facing == 1) { \
- pV->diffuse = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- pV->specular = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- } else { \
- if (bFog) \
- GLD_SETUP_FOG; \
- else \
- GLD_SETUP_SMOOTH_COLOUR; \
- GLD_SETUP_SPECULAR; \
- }
-
-#define GLD_SETUP_GET_FLAT_LIGHTING(v) \
- if (facing == 1) { \
- dwFlatColour = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- dwSpecularColour = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- }
-
-#define GLD_SETUP_TWOSIDED_LIGHTING \
- /* Two-sided lighting */ \
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { \
- SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; \
- SWvertex *v[3]; \
- GLfloat ex,ey,fx,fy,cc; \
- /* Get vars for later */ \
- VB = &TNL_CONTEXT(ctx)->vb; \
- vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \
- if (VB->SecondaryColorPtr[1]) { \
- vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
- } else { \
- vbspec = NULL; \
- } \
- v[0] = &verts[v0]; \
- v[1] = &verts[v1]; \
- v[2] = &verts[v2]; \
- ex = v[0]->win[0] - v[2]->win[0]; \
- ey = v[0]->win[1] - v[2]->win[1]; \
- fx = v[1]->win[0] - v[2]->win[0]; \
- fy = v[1]->win[1] - v[2]->win[1]; \
- cc = ex*fy - ey*fx; \
- facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; \
- }
-
-//---------------------------------------------------------------------------
-// 3D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_3D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pPoints; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pLines; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_TRIANGLES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pTriangles; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VERTEX(v) \
- p4f = VB->ObjPtr->data; \
- pV->Position.x = p4f[##v][0]; \
- pV->Position.y = p4f[##v][1]; \
- pV->Position.z = p4f[##v][2];
-
-#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
- pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-
-#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
- dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-#define GLD_SETUP_USE_FLAT_COLOUR_3D \
- pV->Diffuse = dwColor;
-
-#define GLD_SETUP_TEX0_3D(v) \
- if (VB->TexCoordPtr[0]) { \
- tc = VB->TexCoordPtr[0]->data; \
- pV->TexUnit0.x = tc[##v][0]; \
- pV->TexUnit0.y = tc[##v][1]; \
- }
-
-#define GLD_SETUP_TEX1_3D(v) \
- if (VB->TexCoordPtr[1]) { \
- tc = VB->TexCoordPtr[1]->data; \
- pV->TexUnit1.x = tc[##v][0]; \
- pV->TexUnit1.y = tc[##v][1]; \
- }
-
-//---------------------------------------------------------------------------
-// Helper functions
-//---------------------------------------------------------------------------
-
-__inline DWORD _gldComputeFog(
- GLcontext *ctx,
- SWvertex *swv)
-{
- // Full fog calculation.
- // Based on Mesa code.
-
- GLchan rFog, gFog, bFog;
- GLchan fR, fG, fB;
- const GLfloat f = swv->fog;
- const GLfloat g = 1.0 - f;
-
- UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]);
- fR = f * swv->color[0] + g * rFog;
- fG = f * swv->color[1] + g * gFog;
- fB = f * swv->color[2] + g * bFog;
- return D3DCOLOR_RGBA(fR, fG, fB, swv->color[3]);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ResetLineStipple_DX7(
- GLcontext *ctx)
-{
- // TODO: Fake stipple with a 32x32 texture.
-}
-
-//---------------------------------------------------------------------------
-// 2D (post-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points2D_DX7(
- GLcontext *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_2D_VARS_POINTS;
-
- unsigned i;
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- // Not supported by DX7
-// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
- GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- } else {
- GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, swv++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- }
-
- gld->PB2d.pPoints = (BYTE*)pV;
- gld->PB2d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlat_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmooth_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlat_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmooth_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
-
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatExtras_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v2);
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v2);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothExtras_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlat_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmooth_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatExtras_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v3);
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v3);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothExtras_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v3);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// 3D (pre-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points3D_DX7(
- GLcontext *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_3D_VARS_POINTS
-
- unsigned i;
-// struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- // Not supported by DX7
-// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
-// GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_3D_VERTEX(VB->Elts[i])
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- } else {
-// GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- }
-/*
- for (i=first; i<last; i++, pV++) {
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
-*/
- gld->PB3d.pPoints = (BYTE*)pV;
- gld->PB3d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-// Line functions
-//---------------------------------------------------------------------------
-
-void gld_Line3DFlat_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line3DSmooth_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-// Triangle functions
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DFlat_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DSmooth_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-// Quad functions
-//---------------------------------------------------------------------------
-
-void gld_Quad3DFlat_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad3DSmooth_DX7(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_SMOOTH_COLOUR_3D(v3)
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// Vertex setup for two-sided-lighting vertex shader
-//---------------------------------------------------------------------------
-
-/*
-
-void gld_Points2DTwoside_DX8(GLcontext *ctx, GLuint first, GLuint last)
-{
- // NOTE: Two-sided lighting does not apply to Points
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-*/
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c
deleted file mode 100644
index bbe673516d6..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c
+++ /dev/null
@@ -1,2196 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Texture / Bitmap functions
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx7.h"
-
-//#include <d3dx8tex.h>
-
-#include "texformat.h"
-#include "colormac.h"
-#include "texstore.h"
-#include "image.h"
-// #include "mem.h"
-
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_HEIGHT(y,h) (gldCtx->dwHeight - (y) - (h))
-
-D3DX_SURFACEFORMAT _gldD3DXFormatFromSurface(IDirectDrawSurface7 *pSurface);
-
-//---------------------------------------------------------------------------
-// 1D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + (i) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (i) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (i))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (i))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 2D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + ((t)->Width * (j) + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 3D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz)
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// Direct3D texture formats that have no Mesa equivalent
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format _gld_texformat_X8R8G8B8 = {
- MESA_FORMAT_ARGB8888, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 8, /* RedBits */
- 8, /* GreenBits */
- 8, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 4, /* TexelBytes */
- _mesa_texstore_argb8888, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X8R8G8B8, /* FetchTexel1D */
- gld_fetch_2d_texel_X8R8G8B8, /* FetchTexel2D */
- gld_fetch_3d_texel_X8R8G8B8, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X8R8G8B8, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X8R8G8B8, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X8R8G8B8, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X1R5G5B5 = {
- MESA_FORMAT_ARGB1555, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 5, /* RedBits */
- 5, /* GreenBits */
- 5, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb1555, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X1R5G5B5, /* FetchTexel1D */
- gld_fetch_2d_texel_X1R5G5B5, /* FetchTexel2D */
- gld_fetch_3d_texel_X1R5G5B5, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X1R5G5B5, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X1R5G5B5, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X1R5G5B5, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X4R4G4B4 = {
- MESA_FORMAT_ARGB4444, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 4, /* RedBits */
- 4, /* GreenBits */
- 4, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb4444, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X4R4G4B4, /* FetchTexel1D */
- gld_fetch_2d_texel_X4R4G4B4, /* FetchTexel2D */
- gld_fetch_3d_texel_X4R4G4B4, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X4R4G4B4, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X4R4G4B4, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X4R4G4B4, /* FetchTexel3Df */
-};
-
-//---------------------------------------------------------------------------
-// Texture unit constants
-//---------------------------------------------------------------------------
-
-// List of possible combinations of texture environments.
-// Example: GLD_TEXENV_MODULATE_RGBA means
-// GL_MODULATE, GL_RGBA base internal format.
-#define GLD_TEXENV_DECAL_RGB 0
-#define GLD_TEXENV_DECAL_RGBA 1
-#define GLD_TEXENV_DECAL_ALPHA 2
-#define GLD_TEXENV_REPLACE_RGB 3
-#define GLD_TEXENV_REPLACE_RGBA 4
-#define GLD_TEXENV_REPLACE_ALPHA 5
-#define GLD_TEXENV_MODULATE_RGB 6
-#define GLD_TEXENV_MODULATE_RGBA 7
-#define GLD_TEXENV_MODULATE_ALPHA 8
-#define GLD_TEXENV_BLEND_RGB 9
-#define GLD_TEXENV_BLEND_RGBA 10
-#define GLD_TEXENV_BLEND_ALPHA 11
-#define GLD_TEXENV_ADD_RGB 12
-#define GLD_TEXENV_ADD_RGBA 13
-#define GLD_TEXENV_ADD_ALPHA 14
-
-// Per-stage (i.e. per-unit) texture environment
-typedef struct {
- DWORD ColorArg1; // Colour argument 1
- D3DTEXTUREOP ColorOp; // Colour operation
- DWORD ColorArg2; // Colour argument 2
- DWORD AlphaArg1; // Alpha argument 1
- D3DTEXTUREOP AlphaOp; // Alpha operation
- DWORD AlphaArg2; // Alpha argument 2
-} GLD_texenv;
-
-// TODO: Do we really need to set ARG1 and ARG2 every time?
-// They seem to always be TEXTURE and CURRENT respectively.
-
-// C = Colour out
-// A = Alpha out
-// Ct = Colour from Texture
-// Cf = Colour from fragment (diffuse)
-// At = Alpha from Texture
-// Af = Alpha from fragment (diffuse)
-// Cc = GL_TEXTURE_ENV_COLOUR (GL_BLEND)
-const GLD_texenv gldTexEnv[] = {
- // DECAL_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_RGBA: C=Cf(1-At)+CtAt, A=Af
- {D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_ALPHA: <undefined> use DECAL_RGB
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
-
- // REPLACE_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // REPLACE_RGBA: C=Ct, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
- // REPLACE_ALPHA: C=Cf, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
-
- // MODULATE_RGB: C=CfCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // MODULATE_RGBA: C=CfCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // MODULATE_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- //
- // DX7 Does not support D3DTOP_LERP
- // Emulate(?) via D3DTOP_ADDSMOOTH
- //
-#if 0
- // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-#else
- // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_ADDSMOOTH, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_ADDSMOOTH, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-#endif
- // BLEND_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- // ADD_RGB: C=Cf+Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // ADD_RGBA: C=Cf+Ct, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // ADD_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-};
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREADDRESS _gldConvertWrap(
- GLenum wrap)
-{
-// ASSERT(wrap==GL_CLAMP || wrap==GL_REPEAT);
- return (wrap == GL_CLAMP) ? D3DTADDRESS_CLAMP : D3DTADDRESS_WRAP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREMAGFILTER _gldConvertMagFilter(
- GLenum magfilter)
-{
- ASSERT(magfilter==GL_LINEAR || magfilter==GL_NEAREST);
- return (magfilter == GL_LINEAR) ? D3DTFG_LINEAR : D3DTFG_POINT;
-}
-
-//---------------------------------------------------------------------------
-
-void _gldConvertMinFilter(
- GLenum minfilter,
- D3DTEXTUREMINFILTER *min_filter,
- D3DTEXTUREMIPFILTER *mip_filter)
-{
- switch (minfilter) {
- case GL_NEAREST:
- *min_filter = D3DTFN_POINT;
- *mip_filter = D3DTFP_NONE;
- break;
- case GL_LINEAR:
- *min_filter = D3DTFN_LINEAR;
- *mip_filter = D3DTFP_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- *min_filter = D3DTFN_POINT;
- *mip_filter = D3DTFP_POINT;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- *min_filter = D3DTFN_LINEAR;
- *mip_filter = D3DTFP_POINT;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- *min_filter = D3DTFN_POINT;
- *mip_filter = D3DTFP_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- *min_filter = D3DTFN_LINEAR;
- *mip_filter = D3DTFP_LINEAR;
- break;
- default:
- ASSERT(0);
- }
-}
-
-//---------------------------------------------------------------------------
-
-D3DX_SURFACEFORMAT _gldGLFormatToD3DFormat(
- GLenum internalFormat)
-{
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- // LUNIMANCE != INTENSITY, but D3D doesn't have I8 textures
- return D3DX_SF_L8;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return D3DX_SF_L8;
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return D3DX_SF_A8;
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return D3DX_SF_X8R8G8B8;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return D3DX_SF_A8L8;
- case GL_R3_G3_B2:
- // TODO: Mesa does not support RGB332 internally
- return D3DX_SF_X4R4G4B4; //D3DFMT_R3G3B2;
- case GL_RGB4:
- return D3DX_SF_X4R4G4B4;
- case GL_RGB5:
- return D3DX_SF_R5G5B5;
- case 3:
- case GL_RGB:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return D3DX_SF_R8G8B8;
- case GL_RGBA4:
- return D3DX_SF_A4R4G4B4;
- case 4:
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return D3DX_SF_A8R8G8B8;
- case GL_RGB5_A1:
- return D3DX_SF_A1R5G5B5;
- }
-
- ASSERT(0);
-
- // Return an acceptable default
- return D3DX_SF_A8R8G8B8;
-}
-
-//---------------------------------------------------------------------------
-
-GLenum _gldDecodeBaseFormat(
- IDirectDrawSurface7 *pTex)
-{
- // Examine Direct3D texture and return base OpenGL internal texture format
- // NOTE: We can't use any base format info from Mesa because D3D might have
- // used a different texture format when we used D3DXCreateTexture().
-
- // Base internal format is one of (Red Book p355):
- // GL_ALPHA,
- // GL_LUMINANCE,
- // GL_LUMINANCE_ALPHA,
- // GL_INTENSITY,
- // GL_RGB,
- // GL_RGBA
-
- // NOTE: INTENSITY not used (not supported by Direct3D)
- // LUMINANCE has same texture functions as RGB
- // LUMINANCE_ALPHA has same texture functions as RGBA
-
- // TODO: cache format instead of using GetLevelDesc()
-// D3DSURFACE_DESC desc;
-// _GLD_DX7_TEX(GetLevelDesc(pTex, 0, &desc));
-
- D3DX_SURFACEFORMAT sf;
-
- sf = _gldD3DXFormatFromSurface(pTex);
-
- switch (sf) {
- case D3DX_SF_R8G8B8:
- case D3DX_SF_X8R8G8B8:
- case D3DX_SF_R5G6B5:
- case D3DX_SF_R5G5B5:
- case D3DX_SF_R3G3B2:
- case D3DX_SF_X4R4G4B4:
- case D3DX_SF_PALETTE8:
- case D3DX_SF_L8:
- return GL_RGB;
- case D3DX_SF_A8R8G8B8:
- case D3DX_SF_A1R5G5B5:
- case D3DX_SF_A4R4G4B4:
-// case D3DX_SF_A8R3G3B2: // Unsupported by DX7
-// case D3DX_SF_A8P8: // Unsupported by DX7
- case D3DX_SF_A8L8:
-// case D3DX_SF_A4L4: // Unsupported by DX7
- return GL_RGBA;
- case D3DX_SF_A8:
- return GL_ALPHA;
- // Compressed texture formats. Need to check these...
- case D3DX_SF_DXT1:
- return GL_RGBA;
-// case D3DX_SF_DXT2: // Unsupported by DX7
- return GL_RGB;
- case D3DX_SF_DXT3:
- return GL_RGBA;
-// case D3DX_SF_DXT4: // Unsupported by DX7
- return GL_RGB;
- case D3DX_SF_DXT5:
- return GL_RGBA;
- }
-
- // Fell through. Return arbitary default.
- ASSERT(0); // BANG!
- return GL_RGBA;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* _gldMesaFormatForD3DFormat(
- D3DX_SURFACEFORMAT d3dfmt)
-{
- switch (d3dfmt) {
- case D3DX_SF_A8R8G8B8:
- return &_mesa_texformat_argb8888;
- case D3DX_SF_R8G8B8:
- return &_mesa_texformat_rgb888;
- case D3DX_SF_R5G6B5:
- return &_mesa_texformat_rgb565;
- case D3DX_SF_A4R4G4B4:
- return &_mesa_texformat_argb4444;
- case D3DX_SF_A1R5G5B5:
- return &_mesa_texformat_argb1555;
- case D3DX_SF_A8L8:
- return &_mesa_texformat_al88;
- case D3DX_SF_R3G3B2:
- return &_mesa_texformat_rgb332;
- case D3DX_SF_A8:
- return &_mesa_texformat_a8;
- case D3DX_SF_L8:
- return &_mesa_texformat_l8;
- case D3DX_SF_X8R8G8B8:
- return &_gld_texformat_X8R8G8B8;
- case D3DX_SF_R5G5B5:
- return &_gld_texformat_X1R5G5B5;
- case D3DX_SF_X4R4G4B4:
- return &_gld_texformat_X4R4G4B4;
- }
-
- // If we reach here then we've made an error somewhere else
- // by allowing a format that is not supported.
- ASSERT(0);
-
- return NULL; // Shut up compiler warning
-}
-
-//---------------------------------------------------------------------------
-
-D3DX_SURFACEFORMAT _gldD3DXFormatFromSurface(
- IDirectDrawSurface7 *pSurface)
-{
- DDPIXELFORMAT ddpf;
-
- ddpf.dwSize = sizeof(ddpf);
-
- // Obtain pixel format of surface
- _GLD_DX7_TEX(GetPixelFormat(pSurface, &ddpf));
- // Decode to D3DX surface format
- return D3DXMakeSurfaceFormat(&ddpf);
-}
-
-//---------------------------------------------------------------------------
-
-void _gldClearSurface(
- IDirectDrawSurface *pSurface,
- D3DCOLOR dwColour)
-{
- DDBLTFX bltFX; // Used for colour fill
-
- // Initialise struct
- bltFX.dwSize = sizeof(bltFX);
- // Set clear colour
- bltFX.dwFillColor = dwColour;
- // Clear surface. HW accelerated if available.
- IDirectDrawSurface7_Blt(pSurface, NULL, NULL, NULL, DDBLT_COLORFILL, &bltFX);
-}
-
-//---------------------------------------------------------------------------
-// Copy* functions
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage1D_DX7(
- GLcontext *ctx,
- GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y,
- GLsizei width, GLint border )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage2D_DX7(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLenum internalFormat,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- GLint border)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage1D_DX7(
- GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage2D_DX7(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage3D_DX7(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height )
-{
- // TODO ?
-}
-
-//---------------------------------------------------------------------------
-// Bitmap/Pixel functions
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-#define _GLD_FVF_IMAGE (D3DFVF_XYZRHW | D3DFVF_TEX1)
-
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT z; // depth value
- FLOAT rhw; // reciprocal homogenous W (always 1.0f)
- FLOAT tu, tv; // texture coords
-} _GLD_IMAGE_VERTEX;
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldDrawPixels(
- GLcontext *ctx,
- BOOL bChromakey, // Alpha test for glBitmap() images
- GLint x, // GL x position
- GLint y, // GL y position (needs flipping)
- GLsizei width, // Width of input image
- GLsizei height, // Height of input image
- IDirectDrawSurface7 *pImage)
-{
- //
- // Draw input image as texture implementing PixelZoom and clipping.
- // Any fragment operations currently enabled will be used.
- //
-
- // NOTE: This DX7 version does not create a new texture in which
- // to copy the input image, as the image is already a texture.
-
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- DDSURFACEDESC2 ddsd;
- _GLD_IMAGE_VERTEX v[4];
-
- float ZoomWidth, ZoomHeight;
- float ScaleWidth, ScaleHeight;
-
- // Fixup for rasterisation rules
- const float cfEpsilon = 1.0f / (float)height;
-
- //
- // Set up the quad like this (ascii-art ahead!)
- //
- // 3--2
- // | |
- // 0--1
- //
- //
-
- // Set depth
- v[0].z = v[1].z = v[2].z = v[3].z = ctx->Current.RasterPos[2];
- // Set Reciprocal Homogenous W
- v[0].rhw = v[1].rhw = v[2].rhw = v[3].rhw = 1.0f;
-
- // Set texcoords
- // Examine texture size - if different to input width and height
- // then we'll need to munge the texcoords to fit.
- ddsd.dwSize = sizeof(DDSURFACEDESC2);
- IDirectDrawSurface7_GetSurfaceDesc(pImage, &ddsd);
- ScaleWidth = (float)width / (float)ddsd.dwWidth;
- ScaleHeight = (float)height / (float)ddsd.dwHeight;
- v[0].tu = 0.0f; v[0].tv = 0.0f;
- v[1].tu = ScaleWidth; v[1].tv = 0.0f;
- v[2].tu = ScaleWidth; v[2].tv = ScaleHeight;
- v[3].tu = 0.0f; v[3].tv = ScaleHeight;
-
- // Set raster positions
- ZoomWidth = (float)width * ctx->Pixel.ZoomX;
- ZoomHeight = (float)height * ctx->Pixel.ZoomY;
-
- v[0].x = x; v[0].y = GLD_FLIP_Y(y+cfEpsilon);
- v[1].x = x+ZoomWidth; v[1].y = GLD_FLIP_Y(y+cfEpsilon);
- v[2].x = x+ZoomWidth; v[2].y = GLD_FLIP_Y(y+ZoomHeight+cfEpsilon);
- v[3].x = x; v[3].y = GLD_FLIP_Y(y+ZoomHeight+cfEpsilon);
-
- // Draw image with full HW acceleration
- // NOTE: Be nice to use a State Block for all this state...
- IDirect3DDevice7_SetTexture(gld->pDev, 0, pImage);
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, TRUE);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_MINFILTER, D3DTFN_POINT);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_MIPFILTER, D3DTFP_POINT);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_MAGFILTER, D3DTFG_POINT);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- // Ensure texture unit 1 is disabled
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 1, D3DTSS_COLOROP, D3DTOP_DISABLE);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
-
- //
- // Emulate Chromakey with an Alpha Test.
- // [Alpha Test is more widely supported anyway]
- //
- if (bChromakey) {
- // Switch on alpha testing
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHATESTENABLE, TRUE);
- // Fragment passes is alpha is greater than reference value
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAFUNC, D3DCMP_GREATER);
- // Set alpha reference value between Bitmap alpha values of
- // zero (transparent) and one (opaque).
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAREF, 0x7f);
- }
-
- IDirect3DDevice7_DrawPrimitive(gld->pDev, D3DPT_TRIANGLEFAN, _GLD_FVF_IMAGE, &v, 4, 0);
-
- // Reset state to before we messed it up
- FLUSH_VERTICES(ctx, _NEW_ALL);
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DrawPixels_DX7(
- GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- GLD_context *gldCtx;
- GLD_driver_dx7 *gld;
-
- IDirectDrawSurface7 *pImage;
- HRESULT hr;
- DDSURFACEDESC2 ddsd;
- DWORD dwFlags;
- D3DX_SURFACEFORMAT sf;
- DWORD dwMipmaps;
-
- const struct gl_texture_format *MesaFormat;
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- dwFlags = D3DX_TEXTURE_NOMIPMAP;
- sf = D3DX_SF_A8R8G8B8;
- dwMipmaps = 1;
-
- hr = D3DXCreateTexture(
- gld->pDev,
- &dwFlags,
- &width, &height,
- &sf, // format
- NULL, // palette
- &pImage, // Output texture
- &dwMipmaps);
- if (FAILED(hr)) {
- return;
- }
-
- // D3DXCreateTexture() may not clear the texture is creates.
- _gldClearSurface(pImage, 0);
-
- //
- // Use Mesa to fill in image
- //
-
- // Lock all of surface
- ddsd.dwSize = sizeof(DDSURFACEDESC2);
- dwFlags = DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT;
- hr = IDirectDrawSurface7_Lock(pImage, NULL, &ddsd, dwFlags, NULL);
- if (FAILED(hr)) {
- SAFE_RELEASE_SURFACE7(pImage);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- MesaFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA,
- &_mesa_texformat_argb8888,
- ddsd.lpSurface,
- width, height, 1, 0, 0, 0,
- ddsd.lPitch,
- 0, /* dstImageStride */
- format, type, pixels, unpack);
-
- IDirectDrawSurface7_Unlock(pImage, NULL);
-
- _gldDrawPixels(ctx, FALSE, x, y, width, height, pImage);
-
- SAFE_RELEASE_SURFACE7(pImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ReadPixels_DX7(
- GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest)
-{
-// TODO
-#if 0
- GLD_context *gldCtx;
- GLD_driver_dx7 *gld;
-
- IDirect3DSurface8 *pBackbuffer = NULL;
- IDirect3DSurface8 *pNativeImage = NULL;
- IDirect3DSurface8 *pCanonicalImage = NULL;
-
- D3DSURFACE_DESC d3dsd;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- struct gl_pixelstore_attrib srcPacking;
- int i;
- GLint DstRowStride;
- const struct gl_texture_format *MesaFormat;
-
- switch (format) {
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- return;
- }
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
- DstRowStride = _mesa_image_row_stride(pack, width, format, type);
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice8_GetBackBuffer(
- gld->pDev,
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX7_return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- &pNativeImage);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX7_return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, x, GLD_FLIP_HEIGHT(y, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels.
- //
- // This intermediate surface ensure that we can use CopyRects()
- // instead of relying on D3DXLoadSurfaceFromSurface(), which may
- // try and lock the backbuffer. This way seems safer.
- //
- hr = IDirect3DDevice8_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pNativeImage,
- &ptDst);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX7_return;
- }
-
- // Create an RGBA8888 surface
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- &pCanonicalImage);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX7_return;
- }
-
- // Convert to RGBA8888
- hr = D3DXLoadSurfaceFromSurface(
- pCanonicalImage, // Dest surface
- NULL, NULL, // Dest palette, RECT
- pNativeImage, // Src surface
- NULL, NULL, // Src palette, RECT
- D3DX_FILTER_NONE, // Filter
- 0); // Colourkey
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX7_return;
- }
-
- srcPacking.Alignment = 1;
- srcPacking.ImageHeight = height;
- srcPacking.LsbFirst = GL_FALSE;
- srcPacking.RowLength = 0;
- srcPacking.SkipImages = 0;
- srcPacking.SkipPixels = 0;
- srcPacking.SkipRows = 0;
- srcPacking.SwapBytes = GL_FALSE;
-
- // Lock all of image
- hr = IDirect3DSurface8_LockRect(pCanonicalImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX7_return;
- }
-
- // We need to flip the data. Yuck.
- // Perhaps Mesa has a span packer we can use in future...
- for (i=0; i<height; i++) {
- BYTE *pDestRow = (BYTE*)_mesa_image_address(2,pack, dest, width, height, format, type, 0, i, 0);
- BYTE *pSrcRow = (BYTE*)d3dLockedRect.pBits + (d3dLockedRect.Pitch * (height-i-1));
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA, // base format
- MesaFormat, // dst format
- pDestRow, // dest addr
- width, 1, 1, 0, 0, 0, // src x,y,z & dst offsets x,y,z
- DstRowStride, // dst row stride
- 0, // dstImageStride
- GL_BGRA, // src format
- GL_UNSIGNED_BYTE, // src type
- pSrcRow, // src addr
- &srcPacking); // packing params of source image
- }
-
- IDirect3DSurface8_UnlockRect(pCanonicalImage);
-
-gld_ReadPixels_DX7_return:
- SAFE_RELEASE_SURFACE8(pCanonicalImage);
- SAFE_RELEASE_SURFACE8(pNativeImage);
- SAFE_RELEASE_SURFACE8(pBackbuffer);
-#endif
-}
-
-//---------------------------------------------------------------------------
-
-void gld_CopyPixels_DX7(
- GLcontext *ctx,
- GLint srcx,
- GLint srcy,
- GLsizei width,
- GLsizei height,
- GLint dstx,
- GLint dsty,
- GLenum type)
-{
-// TODO
-#if 0
- //
- // NOTE: Not allowed to copy vidmem to vidmem!
- // Therefore we use an intermediate image surface.
- //
-
- GLD_context *gldCtx;
- GLD_driver_dx7 *gld;
-
- IDirect3DSurface8 *pBackbuffer;
- D3DSURFACE_DESC d3dsd;
- IDirect3DSurface8 *pImage;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
-
- // Only backbuffer
- if (type != GL_COLOR)
- return;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice8_GetBackBuffer(
- gld->pDev,
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pBackbuffer);
- return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- &pImage);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pBackbuffer);
- return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, srcx, GLD_FLIP_HEIGHT(srcy, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels
- hr = IDirect3DDevice8_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pImage,
- &ptDst);
- IDirect3DSurface8_Release(pBackbuffer);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pImage);
- return;
- }
-
- _gldDrawPixels(ctx, FALSE, dstx, dsty, width, height, pImage);
-
- IDirect3DSurface8_Release(pImage);
-#endif
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Bitmap_DX7(
- GLcontext *ctx,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap)
-{
- GLD_context *gldCtx;
- GLD_driver_dx7 *gld;
-
- IDirectDrawSurface7 *pImage; // Bitmap texture
- HRESULT hr;
- BYTE *pTempBitmap; // Pointer to unpacked bitmap
- D3DCOLOR clBitmapOne; // Opaque bitmap colour
- D3DCOLOR clBitmapZero; // Transparent bitmap colour
- D3DCOLOR *pBits; // Pointer to texture surface
- const GLubyte *src;
- int i, j, k;
-
- DDSURFACEDESC2 ddsd; // Surface desc returned by lock call
- DWORD dwFlags;
- D3DX_SURFACEFORMAT sf;
- DWORD dwMipmaps;
-
- // Keep a copy of width/height as D3DXCreateTexture() call may alter input dimensions
- GLsizei dwWidth = width;
- GLsizei dwHeight = height;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- // Bail if no bitmap (only raster pos is updated)
- if ((bitmap == NULL) && (width==0) && (height==0))
- return;
-
- //
- // TODO: Detect conditions when created texture (pImage) is non-pow2.
- // Texture coords may need to be adjusted to compensate.
- //
-
- clBitmapZero = D3DCOLOR_RGBA(0,0,0,0); // NOTE: Alpha is Zero
- clBitmapOne = D3DCOLOR_COLORVALUE(
- ctx->Current.RasterColor[0],
- ctx->Current.RasterColor[1],
- ctx->Current.RasterColor[2],
- 1.0f); // NOTE: Alpha is One
-
- // Use Mesa to unpack bitmap into a canonical format
- pTempBitmap = _mesa_unpack_bitmap(width, height, bitmap, unpack);
- if (pTempBitmap == NULL)
- return;
-
- // Flags for texture creation
- dwFlags = D3DX_TEXTURE_NOMIPMAP;
- sf = D3DX_SF_A8R8G8B8;
- dwMipmaps = 1;
-
- // Create a D3D texture to hold the bitmap
- hr = D3DXCreateTexture(
- gld->pDev,
- &dwFlags,
- &dwWidth, &dwHeight,
- &sf, // format
- NULL, // palette
- &pImage, // Output texture
- &dwMipmaps);
- if (FAILED(hr)) {
- FREE(pTempBitmap);
- return;
- }
-
- // D3DXCreateTexture may return a texture bigger than we asked for
- // (i.e. padded to POW2) so let's clear the entire image bitmap.
- // Additional: Looks like this is not strictly necessary.
-// _gldClearSurface(pImage, clBitmapZero);
-
- ddsd.dwSize = sizeof(DDSURFACEDESC2);
- dwFlags = DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT;
- hr = IDirectDrawSurface7_Lock(pImage, NULL, &ddsd, dwFlags, NULL);
- if (FAILED(hr)) {
- FREE(pTempBitmap);
- SAFE_RELEASE_SURFACE7(pImage);
- return;
- }
-
-#if 0
- // DEBUG CODE
- if (!(width==ddsd.dwWidth && height==ddsd.dwHeight))
- ddlogPrintf(GLDLOG_WARN, "gld_Bitmap: In=%d,%d / Tex=%d,%d", width,height,ddsd.dwWidth,ddsd.dwHeight);
-#endif
-
-#if 0
- // DEBUG CODE
- ddlogPrintf(GLDLOG_SYSTEM, "gld_Bitmap: In=%d,%d / Tex=%d,%d", width,height,ddsd.dwWidth,ddsd.dwHeight);
- ddlogPrintf(GLDLOG_SYSTEM, "gld_Bitmap: bpp=%d", ddsd.ddpfPixelFormat.dwRGBBitCount);
-#endif
-
- // Cast texel pointer to texture surface.
- // We can do this because we used D3DX_SF_A8R8G8B8 as the format
- pBits = (D3DCOLOR*)ddsd.lpSurface;
-
-
- // Copy from the input bitmap into the texture
- for (i=0; i<height; i++) {
- GLubyte byte;
- pBits = (D3DCOLOR*)((BYTE*)ddsd.lpSurface + (i*ddsd.lPitch));
- src = (const GLubyte *) _mesa_image_address(2,
- &ctx->DefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
- 0, i, 0);
- for (j=0; j<(width>>3); j++) {
- byte = *src++;
- for (k=0; k<8; k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- // Fill remaining bits from bitmap
- if (width & 7) {
- byte = *src;
- for (k=0; k<(width & 7); k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- }
-
- // We're done with the unpacked bitmap
- FREE(pTempBitmap);
-
- // Finished with texture surface - unlock it
- IDirectDrawSurface7_Unlock(pImage, NULL);
-
- // Use internal function to draw bitmap onto rendertarget
- _gldDrawPixels(ctx, TRUE, x, y, width, height, pImage);
-
- // We're done with the bitmap texure - release it
- IDirectDrawSurface7_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-// Texture functions
-//---------------------------------------------------------------------------
-
-void _gldAllocateTexture(
- GLcontext *ctx,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- HRESULT hr;
- IDirectDrawSurface7 *pTex;
- D3DX_SURFACEFORMAT d3dFormat;
- DWORD dwFlags;
- DWORD dwMipmaps;
- DWORD dwWidth, dwHeight;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirectDrawSurface7*)tObj->DriverData;
- if (pTex) {
- // Decide whether we can keep existing D3D texture
- // by examining top-level surface.
- DDSURFACEDESC2 ddsd;
- ddsd.dwSize = sizeof(DDSURFACEDESC2);
- _GLD_DX7_TEX(GetSurfaceDesc(pTex, &ddsd));
- // Release existing texture if not compatible
- if ((ddsd.dwWidth == texImage->Width) ||
- (ddsd.dwHeight == texImage->Height))
- {
- return; // Keep the existing texture
- }
- tObj->DriverData = NULL;
- _GLD_DX7_TEX(Release(pTex));
- }
-
- dwFlags = (glb.bUseMipmaps) ? 0 : D3DX_TEXTURE_NOMIPMAP;
- dwMipmaps = (glb.bUseMipmaps) ? D3DX_DEFAULT : 1;
- dwWidth = texImage->Width;
- dwHeight = texImage->Height;
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->IntFormat);
- hr = D3DXCreateTexture(
- gld->pDev,
- &dwFlags,
- &dwWidth,
- &dwHeight,
- &d3dFormat,
- NULL,
- &pTex,
- &dwMipmaps);
- if (FAILED(hr)) {
- gldLogError(GLDLOG_ERROR, "AllocateTexture failed", hr);
- }
- tObj->DriverData = pTex;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* gld_ChooseTextureFormat_DX7(
- GLcontext *ctx,
- GLint internalFormat,
- GLenum srcFormat,
- GLenum srcType)
-{
- // [Based on mesa_choose_tex_format()]
- //
- // We will choose only texture formats that are supported
- // by Direct3D. If the hardware doesn't support a particular
- // texture format, then the D3DX texture calls that we use
- // will automatically use a HW supported format.
- //
- // The most critical aim is to reduce copying; if we can use
- // texture-image data directly then it will be a big performance assist.
- //
-
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return &_mesa_texformat_a8; // D3DFMT_A8
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_rgb565; // D3DFMT_R5G6B5
- // Mesa will convert this for us later...
- // return &_mesa_texformat_ci8; // D3DFMT_R5G6B5
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return &_mesa_texformat_al88; // D3DFMT_A8L8
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb332; // D3DFMT_R3G3B2
- case GL_RGB4:
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444; // D3DFMT_A4R4G4B4
- case 3:
- case GL_RGB:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return &_mesa_texformat_rgb565;
- case 4:
- case GL_RGBA:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return &_mesa_texformat_argb8888;
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
- default:
- _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat");
- return NULL;
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
-// Safer(?), slower version.
-void gld_TexImage2D_DX7(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- IDirect3DTexture8 *pTex;
- IDirect3DSurface8 *pSurface;
- RECT rcSrcRect;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
-
- if (!tObj || !texImage)
- return;
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture8_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface8_Release(pSurface);
- return;
- }
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- SetRect(&rcSrcRect, 0, 0, width, height);
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- NULL,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface8_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexImage2D_DX7(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- IDirectDrawSurface7 *pTex = NULL;
- IDirectDrawSurface7 *pSurface = NULL;
- HRESULT hr;
- DDSURFACEDESC2 ddsd;
- int i;
- DDSCAPS2 ddsCaps;
-
- if (!tObj || !texImage)
- return;
-
- // GLQUAKE FIX
- // Test for input alpha data with non-alpha internalformat
- if (((internalFormat==3) || (internalFormat==GL_RGB)) && (format==GL_RGBA)) {
- // Input format has alpha, but a non-alpha format has been requested.
- texImage->IntFormat = GL_RGBA;
- internalFormat = GL_RGBA;
- }
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirectDrawSurface7*)tObj->DriverData;
- if (!pTex) {
- ASSERT(0);
- return; // Texture has not been created
- }
-
- pSurface = pTex;
- if (level != 0) {
- ddsd.dwSize = sizeof(ddsd);
- _GLD_DX7_TEX(GetSurfaceDesc(pTex, &ddsd));
- if ((level > 0) && (level >= ddsd.dwMipMapCount))
- return; // Level does not exist
- ZeroMemory(&ddsCaps, sizeof(ddsCaps));
- for (i=0; i<level; i++) {
- ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_MIPMAP;
- hr = IDirectDrawSurface7_GetAttachedSurface(
- pSurface,
- &ddsCaps,
- &pSurface);
- if (SUCCEEDED(hr)) {
- IDirectDrawSurface7_Release(pSurface);
- } else {
- ;
- }
- }
- }
-
- // Lock all of surface
- ddsd.dwSize = sizeof(ddsd);
- hr = IDirectDrawSurface7_Lock(pSurface, NULL, &ddsd, 0, 0);
- if (FAILED(hr)) {
- IDirectDrawSurface7_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- texImage->Format,
- //_gldMesaFormatForD3DFormat(d3dsd.Format),
- _gldMesaFormatForD3DFormat(_gldD3DXFormatFromSurface(pSurface)),
- ddsd.lpSurface,
- width, height, 1, 0, 0, 0,
- ddsd.lPitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- IDirectDrawSurface7_Unlock(pSurface, NULL);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexImage1D_DX7(GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- // A 1D texture is a 2D texture with a height of zero
- gld_TexImage2D_DX7(ctx, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-/*
-void gld_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_GET_CONTEXT
- IDirect3DTexture8 *pTex;
- IDirect3DSurface8 *pSurface;
- D3DFORMAT d3dFormat;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
- RECT rcSrcRect;
- RECT rcDstRect;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= _GLD_DX8_TEX(GetLevelCount(pTex))
- return; // Level does not exist
- hr = _GLD_DX8_TEX(GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->Format);
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface8_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- // Source rectangle is whole of input image
- SetRect(&rcSrcRect, 0, 0, width, height);
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- &rcDstRect,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface8_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexSubImage2D_DX7( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- IDirectDrawSurface7 *pTex;
- IDirectDrawSurface7 *pSurface;
- HRESULT hr;
- RECT rcDstRect;
- DDSURFACEDESC2 ddsd;
- int i;
- DDSCAPS2 ddsCaps;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirectDrawSurface7*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
-
- __try {
-
- ddsd.dwSize = sizeof(ddsd);
- _GLD_DX7_TEX(GetSurfaceDesc(pTex, &ddsd));
- if ((level > 0) && (level >= ddsd.dwMipMapCount))
- return; // Level does not exist
-
- ZeroMemory(&ddsCaps, sizeof(ddsCaps));
- pSurface = pTex;
- for (i=0; i<level; i++) {
- ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_MIPMAP;
- hr = IDirectDrawSurface7_GetAttachedSurface(
- pSurface,
- &ddsCaps,
- &pSurface);
- if(SUCCEEDED(hr)) {
- IDirectDrawSurface7_Release(pSurface);
- } else {
- return;
- }
- }
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- // Lock sub-rect of surface
- hr = IDirectDrawSurface7_Lock(pSurface, &rcDstRect, &ddsd, 0, 0);
- if (FAILED(hr)) {
- IDirectDrawSurface7_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- _gldMesaFormatForD3DFormat(_gldD3DXFormatFromSurface(pSurface)),
- ddsd.lpSurface,
- width, height, 1,
- 0, 0, 0, // NOTE: d3dLockedRect.pBits is already offset!!!
- ddsd.lPitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
-
- IDirectDrawSurface7_Unlock(pSurface, &rcDstRect);
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- ;
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexSubImage1D_DX7( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gld_TexSubImage2D_DX7(ctx, target, level, xoffset, 0, width, 1, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DeleteTexture_DX7(
- GLcontext *ctx,
- struct gl_texture_object *tObj)
-{
- GLD_context *gld = (GLD_context*)(ctx->DriverCtx);
-
- __try {
-
- if (tObj) {
- IDirectDrawSurface7 *pTex = (IDirectDrawSurface7*)tObj->DriverData;
- if (pTex) {
-/* // Make sure texture is not bound to a stage before releasing it
- for (int i=0; i<MAX_TEXTURE_UNITS; i++) {
- if (gld->CurrentTexture[i] == pTex) {
- gld->pDev->SetTexture(i, NULL);
- gld->CurrentTexture[i] = NULL;
- }
- }*/
- _GLD_DX7_TEX(Release(pTex));
- tObj->DriverData = NULL;
- }
- }
-
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- ;
- }
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetColorOps(
- const GLD_driver_dx7 *gld,
- GLuint unit,
- DWORD ColorArg1,
- D3DTEXTUREOP ColorOp,
- DWORD ColorArg2)
-{
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG1, ColorArg1));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLOROP, ColorOp));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG2, ColorArg2));
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetAlphaOps(
- const GLD_driver_dx7 *gld,
- GLuint unit,
- DWORD AlphaArg1,
- D3DTEXTUREOP AlphaOp,
- DWORD AlphaArg2)
-{
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG1, AlphaArg1));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAOP, AlphaOp));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG2, AlphaArg2));
-}
-
-//---------------------------------------------------------------------------
-
-void gldUpdateTextureUnit(
- GLcontext *ctx,
- GLuint unit,
- BOOL bPassThrough)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- D3DTEXTUREMINFILTER minfilter;
- D3DTEXTUREMIPFILTER mipfilter;
- GLenum BaseFormat;
- DWORD dwColorArg0;
- int iTexEnv = 0;
- GLD_texenv *pTexenv;
-
- // NOTE: If bPassThrough is FALSE then texture stage can be
- // disabled otherwise it must pass-through it's current fragment.
-
- const struct gl_texture_unit *pUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *tObj = pUnit->_Current;
-
- IDirectDrawSurface7 *pTex = NULL;
- if (tObj) {
- pTex = (IDirectDrawSurface7*)tObj->DriverData;
- }
-
- __try {
-
- // Enable texturing if unit is enabled and a valid D3D texture exists
- // Mesa 5: TEXTUREn_x altered to TEXTURE_nD_BIT
- //if (pTex && (pUnit->Enabled & (TEXTURE0_1D | TEXTURE0_2D))) {
- if (pTex && (pUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT))) {
- // Enable texturing
- _GLD_DX7_DEV(SetTexture(gld->pDev, unit, pTex));
- } else {
- // Disable texturing, then return
- _GLD_DX7_DEV(SetTexture(gld->pDev, unit, NULL));
- if (bPassThrough) {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- } else {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- }
- return;
- }
-
- // Texture parameters
- _gldConvertMinFilter(tObj->MinFilter, &minfilter, &mipfilter);
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MINFILTER, minfilter));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MIPFILTER, mipfilter));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter)));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSU, _gldConvertWrap(tObj->WrapS)));
- _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSV, _gldConvertWrap(tObj->WrapT)));
-
- // Texture priority
- _GLD_DX7_TEX(SetPriority(pTex, (DWORD)(tObj->Priority*65535.0f)));
-
- // Texture environment
- // TODO: Examine input texture for alpha and use specific alpha/non-alpha ops.
- // See Page 355 of the Red Book.
- BaseFormat = _gldDecodeBaseFormat(pTex);
-
- switch (BaseFormat) {
- case GL_RGB:
- iTexEnv = 0;
- break;
- case GL_RGBA:
- iTexEnv = 1;
- break;
- case GL_ALPHA:
- iTexEnv = 2;
- break;
- }
-
- switch (pUnit->EnvMode) {
- case GL_DECAL:
- iTexEnv += 0;
- break;
- case GL_REPLACE:
- iTexEnv += 3;
- break;
- case GL_MODULATE:
- iTexEnv += 6;
- break;
- case GL_BLEND:
- // Set blend colour
- // Unsupported by DX7
-// dwColorArg0 = D3DCOLOR_COLORVALUE(pUnit->EnvColor[0], pUnit->EnvColor[1], pUnit->EnvColor[2], pUnit->EnvColor[3]);
-// _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG0, dwColorArg0));
-// gldLogMessage(GLDLOG_WARN, "GL_BLEND\n");
- iTexEnv += 9;
- break;
- case GL_ADD:
- iTexEnv += 12;
- break;
- }
- pTexenv = (GLD_texenv*)&gldTexEnv[iTexEnv];
- _gldSetColorOps(gld, unit, pTexenv->ColorArg1, pTexenv->ColorOp, pTexenv->ColorArg2);
- _gldSetAlphaOps(gld, unit, pTexenv->AlphaArg1, pTexenv->AlphaOp, pTexenv->AlphaArg2);
-
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- ;
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_TEXTURE_DX7(
- GLcontext *ctx)
-{
- // TODO: Support for three (ATI Radeon) or more (nVidia GeForce3) texture units
-
- BOOL bUnit0Enabled;
- BOOL bUnit1Enabled;
-
- if (!ctx)
- return; // Sanity check
-
- if (ctx->Const.MaxTextureUnits == 1) {
- gldUpdateTextureUnit(ctx, 0, TRUE);
- return;
- }
-
- //
- // NOTE: THE FOLLOWING RELATES TO TWO TEXTURE UNITS, AND TWO ONLY!!
- //
-
- // Mesa 5: Texture Units altered
- bUnit0Enabled = (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
- bUnit1Enabled = (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
-
- // If Unit0 is disabled and Unit1 is enabled then we must pass-though
- gldUpdateTextureUnit(ctx, 0, (!bUnit0Enabled && bUnit1Enabled) ? TRUE : FALSE);
- // We can always disable the last texture unit
- gldUpdateTextureUnit(ctx, 1, FALSE);
-
-#ifdef _DEBUG
- {
- // Find out whether device supports current renderstates
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- DWORD dwPasses;
- _GLD_DX7_DEV(ValidateDevice(gld->pDev, &dwPasses));
-#if 0
- if (FAILED(hr)) {
- gldLogError(GLDLOG_ERROR, "ValidateDevice failed", hr);
- }
-#endif
- if (dwPasses != 1) {
- gldLogMessage(GLDLOG_ERROR, "ValidateDevice: Can't do in one pass\n");
- }
- }
-#endif
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c
deleted file mode 100644
index a85620dde8d..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect fastpath pipeline stage
-*
-****************************************************************************/
-
-//---------------------------------------------------------------------------
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx7.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-// #include "mem.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-/*
-__inline void _gldSetVertexShaderConstants(
- GLcontext *ctx,
- GLD_driver_dx8 *gld)
-{
- D3DXMATRIX mat, matView, matProj;
- GLfloat *pM;
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ModelView.m;
- pM = ctx->ModelviewMatrixStack.Top->m;
- matView._11 = pM[0];
- matView._12 = pM[1];
- matView._13 = pM[2];
- matView._14 = pM[3];
- matView._21 = pM[4];
- matView._22 = pM[5];
- matView._23 = pM[6];
- matView._24 = pM[7];
- matView._31 = pM[8];
- matView._32 = pM[9];
- matView._33 = pM[10];
- matView._34 = pM[11];
- matView._41 = pM[12];
- matView._42 = pM[13];
- matView._43 = pM[14];
- matView._44 = pM[15];
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ProjectionMatrix.m;
- pM = ctx->ProjectionMatrixStack.Top->m;
- matProj._11 = pM[0];
- matProj._12 = pM[1];
- matProj._13 = pM[2];
- matProj._14 = pM[3];
- matProj._21 = pM[4];
- matProj._22 = pM[5];
- matProj._23 = pM[6];
- matProj._24 = pM[7];
- matProj._31 = pM[8];
- matProj._32 = pM[9];
- matProj._33 = pM[10];
- matProj._34 = pM[11];
- matProj._41 = pM[12];
- matProj._42 = pM[13];
- matProj._43 = pM[14];
- matProj._44 = pM[15];
-
- D3DXMatrixMultiply( &mat, &matView, &matProj );
- D3DXMatrixTranspose( &mat, &mat );
-
- _GLD_DX8_DEV(SetVertexShaderConstant(gld->pDev, 0, &mat, 4));
-}
-*/
-//---------------------------------------------------------------------------
-
-static GLboolean gld_d3d_render_stage_run(
- GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- TNLcontext *tnl;
- struct vertex_buffer *VB;
- tnl_render_func *tab;
- GLint pass;
- GLD_pb_dx7 *gldPB = &gld->PB3d;
- DWORD dwFlags;
-
-/*
- static int count = 0;
- count++;
- if (count != 2)
- return GL_FALSE;
-*/
- // The "check" function should disable this stage,
- // but we'll test gld->bUseMesaTnL anyway.
- if (gld->bUseMesaTnL) {
- // Do nothing in this stage, but continue pipeline
- return GL_TRUE;
- }
-
- tnl = TNL_CONTEXT(ctx);
- VB = &tnl->vb;
- pass = 0;
-
- tnl->Driver.Render.Start( ctx );
-
-#if 0
- // For debugging: Useful to see if an app passes colour data in
- // an unusual format.
- switch (VB->ColorPtr[0]->Type) {
- case GL_FLOAT:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
- break;
- case GL_UNSIGNED_BYTE:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n");
- break;
- default:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n");
- break;
- }
-#endif
-
- tnl->Driver.Render.Points = gld_Points3D_DX7;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- tnl->Driver.Render.Line = gld_Line3DFlat_DX7;
- tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX7;
- tnl->Driver.Render.Quad = gld_Quad3DFlat_DX7;
- } else {
- tnl->Driver.Render.Line = gld_Line3DSmooth_DX7;
- tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX7;
- tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX7;
- }
-
-// _GLD_DX7_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
- dwFlags = DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY;
- _GLD_DX7_VB(Lock(gldPB->pVB, dwFlags, &gldPB->pPoints, NULL));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
- // Allocate primitive pointers
- // gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts);
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length)
- {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
- _GLD_DX7_VB(Unlock(gldPB->pVB));
-
-// _GLD_DX7_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride));
-
- _GLD_DX7_DEV(SetTransform(gld->pDev, D3DTRANSFORMSTATE_PROJECTION, &gld->matProjection));
- _GLD_DX7_DEV(SetTransform(gld->pDev, D3DTRANSFORMSTATE_WORLD, &gld->matModelView));
-
- if (gldPB->nPoints) {
-// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
- _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_POINTLIST, gldPB->pVB, 0, gldPB->nPoints, 0));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
-// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
- _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_LINELIST, gldPB->pVB, gldPB->iFirstLine, gldPB->nLines, 0));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
-// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
- _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_TRIANGLELIST, gldPB->pVB, gldPB->iFirstTriangle, gldPB->nTriangles, 0));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-//---------------------------------------------------------------------------
-
-const struct tnl_pipeline_stage _gld_d3d_render_stage =
-{
- "gld_d3d_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- gld_d3d_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c
deleted file mode 100644
index ecc40e8f8b6..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/* $Id: gld_vb_mesa_render_dx7.c,v 1.6 2005/08/27 13:56:08 brianp 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:
- * Keith Whitwell <keithw@valinux.com>
- */
-
-
-/*
- * Render whole vertex buffers, including projection of vertices from
- * clip space and clipping of primitives.
- *
- * This file makes calls to project vertices and to the point, line
- * and triangle rasterizers via the function pointers:
- *
- * context->Driver.Render.*
- *
- */
-
-
-//---------------------------------------------------------------------------
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx7.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-// #include "mem.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-/**********************************************************************/
-/* Clip single primitives */
-/**********************************************************************/
-
-
-#if defined(USE_IEEE)
-#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
-//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
-#else
-#define NEGATIVE(x) (x < 0)
-//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
-/* Could just use (x*y<0) except for the flatshading requirements.
- * Maybe there's a better way?
- */
-#endif
-
-
-#define W(i) coord[i][3]
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 4
-#define TAG(x) x##_4
-#include "tnl/t_vb_cliptmp.h"
-
-
-
-/**********************************************************************/
-/* Clip and render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, with the possibility of clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte ormask = c1|c2; \
- if (!ormask) \
- LineFunc( ctx, v1, v2 ); \
- else if (!(c1 & c2 & 0x3f)) \
- clip_line_4( ctx, v1, v2, ormask ); \
-} while (0)
-
-#define RENDER_TRI( v1, v2, v3 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
- GLubyte ormask = c1|c2|c3; \
- if (!ormask) \
- TriangleFunc( ctx, v1, v2, v3 ); \
- else if (!(c1 & c2 & c3 & 0x3f)) \
- clip_tri_4( ctx, v1, v2, v3, ormask ); \
-} while (0)
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte c3 = mask[v3], c4 = mask[v4]; \
- GLubyte ormask = c1|c2|c3|c4; \
- if (!ormask) \
- QuadFunc( ctx, v1, v2, v3, v4 ); \
- else if (!(c1 & c2 & c3 & c4 & 0x3f)) \
- clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \
-} while (0)
-
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const GLubyte *mask = VB->ClipMask; \
- const GLuint sz = VB->ClipPtr->size; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt; (void) mask; (void) sz; (void) stipple;
-
-#define TAG(x) clip_##x##_verts
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-
-/* Elts, with the possibility of clipping.
- */
-#undef ELT
-#undef TAG
-#define ELT(x) elt[x]
-#define TAG(x) clip_##x##_elts
-#include "tnl/t_vb_rendertmp.h"
-
-/* TODO: do this for all primitives, verts and elts:
- */
-static void clip_elt_triangles( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES];
- struct vertex_buffer *VB = &tnl->vb;
- const GLuint * const elt = VB->Elts;
- GLubyte *mask = VB->ClipMask;
- GLuint last = count-2;
- GLuint j;
- (void) flags;
-
- tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES );
-
- for (j=start; j < last; j+=3 ) {
- GLubyte c1 = mask[elt[j]];
- GLubyte c2 = mask[elt[j+1]];
- GLubyte c3 = mask[elt[j+2]];
- GLubyte ormask = c1|c2|c3;
- if (ormask) {
- if (start < j)
- render_tris( ctx, start, j, 0 );
- if (!(c1&c2&c3&0x3f))
- clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
- start = j+3;
- }
- }
-
- if (start < j)
- render_tris( ctx, start, j, 0 );
-}
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, no clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
- LineFunc( ctx, v1, v2 )
-
-#define RENDER_TRI( v1, v2, v3 ) \
- TriangleFunc( ctx, v1, v2, v3 )
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
- QuadFunc( ctx, v1, v2, v3, v4 )
-
-#define TAG(x) _gld_tnl_##x##_verts
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt;
-
-#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx )
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RENDER_TAB_QUALIFIER
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-/* Elts, no clipping.
- */
-#undef ELT
-#define TAG(x) _gld_tnl_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Helper functions for drivers */
-/**********************************************************************/
-/*
-void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint *tmp = VB->Elts;
-
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
-}
-
-void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-*/
-
-
-/**********************************************************************/
-/* Clip and render whole vertex buffers */
-/**********************************************************************/
-
-tnl_points_func _gldSetupPoints[4] = {
- gld_Points2D_DX7,
- gld_Points2D_DX7,
- gld_Points2D_DX7,
- gld_Points2D_DX7
-};
-tnl_line_func _gldSetupLine[4] = {
- gld_Line2DFlat_DX7,
- gld_Line2DSmooth_DX7,
- gld_Line2DFlat_DX7,
- gld_Line2DSmooth_DX7,
-};
-tnl_triangle_func _gldSetupTriangle[4] = {
- gld_Triangle2DFlat_DX7,
- gld_Triangle2DSmooth_DX7,
- gld_Triangle2DFlatExtras_DX7,
- gld_Triangle2DSmoothExtras_DX7
-};
-tnl_quad_func _gldSetupQuad[4] = {
- gld_Quad2DFlat_DX7,
- gld_Quad2DSmooth_DX7,
- gld_Quad2DFlatExtras_DX7,
- gld_Quad2DSmoothExtras_DX7
-};
-
-//---------------------------------------------------------------------------
-
-static GLboolean _gld_mesa_render_stage_run(
- GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- tnl_render_func *tab;
- GLint pass = 0;
- GLD_pb_dx7 *gldPB;
- DWORD dwFlags;
-
- /* Allow the drivers to lock before projected verts are built so
- * that window coordinates are guarenteed not to change before
- * rendering.
- */
- ASSERT(tnl->Driver.Render.Start);
-
- tnl->Driver.Render.Start( ctx );
-
- gldPB = &gld->PB2d;
- tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc];
- tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc];
- tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc];
- tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc];
-
- dwFlags = DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY;
- _GLD_DX7_VB(Lock(gldPB->pVB, dwFlags, &gldPB->pPoints, NULL));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
-
- // Allocate primitive pointers - gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
-
- if (VB->ClipOrMask) {
- tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts;
- clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
- }
- else {
- tab = (VB->Elts ?
- tnl->Driver.Render.PrimTabElts :
- tnl->Driver.Render.PrimTabVerts);
- }
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length) {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
-
-// tnl->Driver.Render.Finish( ctx );
-
- _GLD_DX7_VB(Unlock(gldPB->pVB));
-
- if (gldPB->nPoints) {
- _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_POINTLIST, gldPB->pVB, 0, gldPB->nPoints, 0));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
- _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_LINELIST, gldPB->pVB, gldPB->iFirstLine, gldPB->nLines*2, 0));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
- _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_TRIANGLELIST, gldPB->pVB, gldPB->iFirstTriangle, gldPB->nTriangles*3, 0));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-
-const struct tnl_pipeline_stage _gld_mesa_render_stage =
-{
- "gld_mesa_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- _gld_mesa_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c
deleted file mode 100644
index 0f8fe33eb15..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c
+++ /dev/null
@@ -1,1611 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 8.x WGL (WindowsGL)
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "gld_driver.h"
-//#include "gld_dxerr8.h"
-#include "gld_dx7.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-// Copied from dglcontect.c
-#define GLDERR_NONE 0
-#define GLDERR_MEM 1
-#define GLDERR_DDRAW 2
-#define GLDERR_D3D 3
-#define GLDERR_BPP 4
-#define GLDERR_DDS 5
-// This external var keeps track of any error
-extern int nContextError;
-
-// Uncomment this for persistant resources
-//#define _GLD_PERSISTANT
-
-#define DDLOG_CRITICAL_OR_WARN DDLOG_CRITICAL
-
-extern void _gld_mesa_warning(GLcontext *, char *);
-extern void _gld_mesa_fatal(GLcontext *, char *);
-
-//---------------------------------------------------------------------------
-
-static char szColorDepthWarning[] =
-"GLDirect does not support the current desktop\n\
-color depth.\n\n\
-You may need to change the display resolution to\n\
-16 bits per pixel or higher color depth using\n\
-the Windows Display Settings control panel\n\
-before running this OpenGL application.\n";
-
-// The only depth-stencil formats currently supported by Direct3D
-// Surface Format Depth Stencil Total Bits
-// D3DFMT_D32 32 - 32
-// D3DFMT_D15S1 15 1 16
-// D3DFMT_D24S8 24 8 32
-// D3DFMT_D16 16 - 16
-// D3DFMT_D24X8 24 - 32
-// D3DFMT_D24X4S4 24 4 32
-
-// This pixel format will be used as a template when compiling the list
-// of pixel formats supported by the hardware. Many fields will be
-// filled in at runtime.
-// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM
-static DGL_pixelFormat pfTemplateHW =
-{
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
- 1, // Structure version - should be 1
- // Flags:
- PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
- PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
- PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
- PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
- PFD_DOUBLEBUFFER | // The buffer is double-buffered.
- 0, // Placeholder for easy commenting of above flags
- PFD_TYPE_RGBA, // Pixel type RGBA.
- 16, // Total colour bitplanes (excluding alpha bitplanes)
- 5, 0, // Red bits, shift
- 5, 0, // Green bits, shift
- 5, 0, // Blue bits, shift
- 0, 0, // Alpha bits, shift (destination alpha)
- 0, // Accumulator bits (total)
- 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha
- 0, // Depth bits
- 0, // Stencil bits
- 0, // Number of auxiliary buffers
- 0, // Layer type
- 0, // Specifies the number of overlay and underlay planes.
- 0, // Layer mask
- 0, // Specifies the transparent color or index of an underlay plane.
- 0 // Damage mask
- },
- D3DX_SF_UNKNOWN, // No depth/stencil buffer
-};
-
-//---------------------------------------------------------------------------
-// Vertex Shaders
-//---------------------------------------------------------------------------
-/*
-// Vertex Shader Declaration
-static DWORD dwTwoSidedLightingDecl[] =
-{
- D3DVSD_STREAM(0),
- D3DVSD_REG(0, D3DVSDT_FLOAT3), // XYZ position
- D3DVSD_REG(1, D3DVSDT_FLOAT3), // XYZ normal
- D3DVSD_REG(2, D3DVSDT_D3DCOLOR), // Diffuse color
- D3DVSD_REG(3, D3DVSDT_D3DCOLOR), // Specular color
- D3DVSD_REG(4, D3DVSDT_FLOAT2), // 2D texture unit 0
- D3DVSD_REG(5, D3DVSDT_FLOAT2), // 2D texture unit 1
- D3DVSD_END()
-};
-
-// Vertex Shader for two-sided lighting
-static char *szTwoSidedLightingVS =
-// This is a test shader!
-"vs.1.0\n"
-"m4x4 oPos,v0,c0\n"
-"mov oD0,v2\n"
-"mov oD1,v3\n"
-"mov oT0,v4\n"
-"mov oT1,v5\n"
-;
-*/
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-typedef struct {
-// HINSTANCE hD3D8DLL; // Handle to d3d8.dll
-// FNDIRECT3DCREATE7 fnDirect3DCreate7; // Direct3DCreate8 function prototype
-// BOOL bDirect3D; // Persistant Direct3D7 exists
-// BOOL bDirect3DDevice; // Persistant Direct3DDevice7 exists
-// IDirect3D7 *pD3D; // Persistant Direct3D7
-// IDirect3DDevice7 *pDev; // Persistant Direct3DDevice7
- BOOL bD3DXStarted;
-} GLD_dx7_globals;
-
-// These are "global" to all DX7 contexts. KeithH
-static GLD_dx7_globals dx7Globals;
-
-// Added for correct clipping of multiple open windows. (DaveM)
-LPDIRECTDRAWSURFACE7 lpDDSPrimary = NULL;
-LPDIRECTDRAWCLIPPER lpDDClipper = NULL;
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-BOOL gldGetDXErrorString_DX(
- HRESULT hr,
- char *buf,
- int nBufSize)
-{
- //
- // Return a string describing the input HRESULT error code
- //
-
- D3DXGetErrorString(hr, nBufSize, buf);
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-//
-// DX7 does not support multisample
-/*
-static D3DMULTISAMPLE_TYPE _gldGetDeviceMultiSampleType(
- IDirect3D8 *pD3D8,
- D3DFORMAT SurfaceFormat,
- D3DDEVTYPE d3dDevType,
- BOOL Windowed)
-{
- int i;
- HRESULT hr;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_NONE)
- return D3DMULTISAMPLE_NONE;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_FASTEST) {
- // Find fastest multisample
- for (i=2; i<17; i++) {
- hr = IDirect3D8_CheckDeviceMultiSampleType(
- pD3D8,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- } else {
- // Find nicest multisample
- for (i=16; i>1; i--) {
- hr = IDirect3D8_CheckDeviceMultiSampleType(
- pD3D8,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- }
-
- // Nothing found - return default
- return D3DMULTISAMPLE_NONE;
-}
-*/
-//---------------------------------------------------------------------------
-
-void _gldDestroyPrimitiveBuffer(
- GLD_pb_dx7 *gldVB)
-{
- SAFE_RELEASE(gldVB->pVB);
-
- // Sanity check...
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
-}
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldCreatePrimitiveBuffer(
- GLcontext *ctx,
- GLD_driver_dx7 *lpCtx,
- GLD_pb_dx7 *gldVB)
-{
- HRESULT hResult;
- char *szCreateVertexBufferFailed = "CreateVertexBuffer failed";
- DWORD dwMaxVertices; // Max number of vertices in vertex buffer
- DWORD dwVBSize; // Total size of vertex buffer
- D3DVERTEXBUFFERDESC vbdesc;
-
- // If CVA (Compiled Vertex Array) is used by an OpenGL app, then we
- // will need enough vertices to cater for Mesa::Const.MaxArrayLockSize.
- // We'll use IMM_SIZE if it's larger (which it should not be).
- dwMaxVertices = MAX_ARRAY_LOCK_SIZE;
-
- // Max vertex buffer size limited in DX7. (DaveM)
- if (dwMaxVertices*9 > D3DMAXNUMVERTICES)
- dwMaxVertices = D3DMAXNUMVERTICES/9;
-
- // Now calculate how many vertices to allow for in total
- // 1 per point, 2 per line, 6 per quad = 9
- dwVBSize = dwMaxVertices * 9 * gldVB->dwStride;
-
- vbdesc.dwSize = sizeof(vbdesc);
- vbdesc.dwCaps = gldVB->dwCreateFlags;
- vbdesc.dwFVF = gldVB->dwFVF;
- vbdesc.dwNumVertices = dwMaxVertices * 9;
-
-/* hResult = IDirect3DDevice8_CreateVertexBuffer(
- lpCtx->pDev,
- dwVBSize,
-RAgldVB->dwUsage,
- gldVB->dwFVF,
- gldVB->dwPool,
- &gldVB->pVB);*/
- hResult = IDirect3D7_CreateVertexBuffer(
- lpCtx->pD3D,
- &vbdesc,
- &gldVB->pVB,
- 0);
- if (FAILED(hResult)) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, szCreateVertexBufferFailed);
- return hResult;
- }
-
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
- gldVB->pPoints = gldVB->pLines = gldVB->pTriangles = NULL;
- gldVB->iFirstLine = dwMaxVertices; // Index of first line in VB
- gldVB->iFirstTriangle = dwMaxVertices*3; // Index of first triangle in VB
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-// Function: _gldCreateVertexShaders
-// Create DX8 Vertex Shaders.
-//---------------------------------------------------------------------------
-/*
-void _gldCreateVertexShaders(
- GLD_driver_dx8 *gld)
-{
- DWORD dwFlags;
- LPD3DXBUFFER pVSOpcodeBuffer; // Vertex Shader opcode buffer
- HRESULT hr;
-
-#ifdef _DEBUG
- dwFlags = D3DXASM_DEBUG;
-#else
- dwFlags = 0; // D3DXASM_SKIPVALIDATION;
-#endif
-
- ddlogMessage(DDLOG_INFO, "Creating shaders...\n");
-
- // Init the shader handle
- gld->VStwosidelight.hShader = 0;
-
- if (gld->d3dCaps8.MaxStreams == 0) {
- // Lame DX8 driver doesn't support streams
- // Not fatal, as defaults will be used
- ddlogMessage(DDLOG_WARN, "Driver doesn't support Vertex Shaders (MaxStreams==0)\n");
- return;
- }
-
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-// return;
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-
- //
- // Two-sided lighting
- //
-
-#if 0
- //
- // DEBUGGING: Load shader from a text file
- //
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- hr = D3DXAssembleShaderFromFile(
- "twoside.vsh",
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#else
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- // Assemble ascii shader text into shader opcodes
- hr = D3DXAssembleShader(
- szTwoSidedLightingVS,
- strlen(szTwoSidedLightingVS),
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#endif
- if (FAILED(hr)) {
- ddlogError(DDLOG_WARN, "AssembleShader failed", hr);
- SAFE_RELEASE(pVSOpcodeBuffer);
- return;
- }
-
-// This is for debugging. Remove to enable vertex shaders in HW
-#define _GLD_FORCE_SW_VS 0
-
- if (_GLD_FORCE_SW_VS) {
- // _GLD_FORCE_SW_VS should be disabled for Final Release
- ddlogMessage(DDLOG_SYSTEM, "[Forcing shaders in SW]\n");
- }
-
- // Try and create shader in hardware.
- // NOTE: The D3D Ref device appears to succeed when trying to
- // create the device in hardware, but later complains
- // when trying to set it with SetVertexShader(). Go figure.
- if (_GLD_FORCE_SW_VS || glb.dwDriver == GLDS_DRIVER_REF) {
- // Don't try and create a hardware shader with the Ref device
- hr = E_FAIL; // COM error/fail result
- } else {
- gld->VStwosidelight.bHardware = TRUE;
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- 0);
- }
- if (FAILED(hr)) {
- ddlogMessage(DDLOG_INFO, "... HW failed, trying SW...\n");
- // Failed. Try and create shader for software processing
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- D3DUSAGE_SOFTWAREPROCESSING);
- if (FAILED(hr)) {
- gld->VStwosidelight.hShader = 0; // Sanity check
- ddlogError(DDLOG_WARN, "CreateVertexShader failed", hr);
- return;
- }
- // Succeeded, but for software processing
- gld->VStwosidelight.bHardware = FALSE;
- }
-
- SAFE_RELEASE(pVSOpcodeBuffer);
-
- ddlogMessage(DDLOG_INFO, "... OK\n");
-}
-
-//---------------------------------------------------------------------------
-
-void _gldDestroyVertexShaders(
- GLD_driver_dx8 *gld)
-{
- if (gld->VStwosidelight.hShader) {
- IDirect3DDevice8_DeleteVertexShader(gld->pDev, gld->VStwosidelight.hShader);
- gld->VStwosidelight.hShader = 0;
- }
-}
-*/
-//---------------------------------------------------------------------------
-
-BOOL gldCreateDrawable_DX(
- DGL_ctx *ctx,
-// BOOL bDefaultDriver,
- BOOL bDirectDrawPersistant,
- BOOL bPersistantBuffers)
-{
- //
- // bDirectDrawPersistant: applies to IDirect3D8
- // bPersistantBuffers: applies to IDirect3DDevice8
- //
-
-// D3DDEVTYPE d3dDevType;
-// D3DPRESENT_PARAMETERS d3dpp;
-// D3DDISPLAYMODE d3ddm;
-// DWORD dwBehaviourFlags;
-// D3DADAPTER_IDENTIFIER8 d3dIdent;
-
- HRESULT hr;
- GLD_driver_dx7 *lpCtx = NULL;
- D3DX_VIDMODEDESC d3ddm;
-
- // Parameters for D3DXCreateContextEx
- // These will be different for fullscreen and windowed
- DWORD dwDeviceIndex;
- DWORD dwFlags;
- HWND hwnd;
- HWND hwndFocus;
- DWORD numColorBits;
- DWORD numAlphaBits;
- DWORD numDepthBits;
- DWORD numStencilBits;
- DWORD numBackBuffers;
- DWORD dwWidth;
- DWORD dwHeight;
- DWORD refreshRate;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- if (ctx->glPriv) {
- lpCtx = ctx->glPriv;
- // Release any existing interfaces (in reverse order)
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- lpCtx->pD3DXContext->lpVtbl->Release(lpCtx->pD3DXContext);
- lpCtx->pD3DXContext = NULL;
- } else {
- lpCtx = (GLD_driver_dx7*)malloc(sizeof(GLD_driver_dx7));
- ZeroMemory(lpCtx, sizeof(lpCtx));
- }
-
-// d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- // Use REF device if requested. Otherwise D3DX_DEFAULT will choose highest level
- // of HW acceleration.
- dwDeviceIndex = (glb.dwDriver == GLDS_DRIVER_REF) ? D3DX_HWLEVEL_REFERENCE : D3DX_DEFAULT;
-
- // TODO: Check this
-// if (bDefaultDriver)
-// d3dDevType = D3DDEVTYPE_REF;
-
-#ifdef _GLD_PERSISTANT
- // Use persistant interface if needed
- if (bDirectDrawPersistant && dx7Globals.bDirect3D) {
- lpCtx->pD3D = dx7Globals.pD3D;
- IDirect3D7_AddRef(lpCtx->pD3D);
- goto SkipDirectDrawCreate;
- }
-#endif
-/*
- // Create Direct3D7 object
- lpCtx->pD3D = dx7Globals.fnDirect3DCreate8(D3D_SDK_VERSION_DX8_SUPPORT_WIN95);
- if (lpCtx->pD3D == NULL) {
- MessageBox(NULL, "Unable to initialize Direct3D8", "GLDirect", MB_OK);
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D8 interface");
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-*/
-
-#ifdef _GLD_PERSISTANT
- // Cache Direct3D interface for subsequent GLRCs
- if (bDirectDrawPersistant && !dx8Globals.bDirect3D) {
- dx7Globals.pD3D = lpCtx->pD3D;
- IDirect3D7_AddRef(dx7Globals.pD3D);
- dx7Globals.bDirect3D = TRUE;
- }
-SkipDirectDrawCreate:
-#endif
-/*
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-*/
-
-#if 0
- // Get device caps
- hResult = IDirect3D8_GetDeviceCaps(lpCtx->pD3D, glb.dwAdapter, d3dDevType, &lpCtx->d3dCaps8);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_GetDeviceCaps failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Check for hardware transform & lighting
- lpCtx->bHasHWTnL = lpCtx->d3dCaps8.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE;
-
- // If this flag is present then we can't default to Mesa
- // SW rendering between BeginScene() and EndScene().
- if (lpCtx->d3dCaps8.Caps2 & D3DCAPS2_NO2DDURING3DSCENE) {
- ddlogMessage(DDLOG_WARN,
- "Warning : No 2D allowed during 3D scene.\n");
- }
-#endif
-
- //
- // Create the Direct3D context
- //
-
-#ifdef _GLD_PERSISTANT
- // Re-use original IDirect3DDevice if persistant buffers exist.
- // Note that we test for persistant IDirect3D8 as well
- // bDirectDrawPersistant == persistant IDirect3D8 (DirectDraw8 does not exist)
- if (bDirectDrawPersistant && bPersistantBuffers && dx7Globals.pD3D && dx7Globals.pDev) {
- lpCtx->pDev = dx7Globals.pDev;
- IDirect3DDevice7_AddRef(dx7Globals.pDev);
- goto skip_direct3ddevice_create;
- }
-#endif
-/*
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(lpCtx->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
-
- // Support for vertical retrace synchronisation.
- // Set default presentation interval in case caps bits are missing
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- if (glb.bWaitForRetrace) {
- if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE;
- } else {
- if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- }
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- // FullScreen_PresentationInterval must be default for Windowed mode
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- }
-
- // Decide if we can use hardware TnL
- dwBehaviourFlags = (lpCtx->bHasHWTnL) ?
- D3DCREATE_MIXED_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING;
- // Add flag to tell D3D to be thread-safe
- if (glb.bMultiThreaded)
- dwBehaviourFlags |= D3DCREATE_MULTITHREADED;
- hResult = IDirect3D8_CreateDevice(lpCtx->pD3D,
- glb.dwAdapter,
- d3dDevType,
- ctx->hWnd,
- dwBehaviourFlags,
- &d3dpp,
- &lpCtx->pDev);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_CreateDevice failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-*/
-
- // Create D3DX context
- if (ctx->bFullscreen) {
- //
- // FULLSCREEN
- //
-
- // Get display mode
- D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm);
-
- // Fullscreen Parameters
- dwFlags = D3DX_CONTEXT_FULLSCREEN;
- hwnd = ctx->hWnd;
- hwndFocus = ctx->hWnd;
- numColorBits = ctx->lpPF->pfd.cColorBits;
- numAlphaBits = ctx->lpPF->pfd.cAlphaBits;
- numDepthBits = ctx->lpPF->pfd.cDepthBits + ctx->lpPF->pfd.cStencilBits;
- numStencilBits = ctx->lpPF->pfd.cStencilBits;
- numBackBuffers = D3DX_DEFAULT; // Default is 1 backbuffer
- dwWidth = d3ddm.width;
- dwHeight = d3ddm.height;
- refreshRate = d3ddm.refreshRate; // D3DX_DEFAULT;
- } else {
- //
- // WINDOWED
- //
-
- // Windowed Parameters
- dwFlags = 0; // No flags means "windowed"
- hwnd = ctx->hWnd;
- hwndFocus = (HWND)D3DX_DEFAULT;
- numColorBits = D3DX_DEFAULT; // Use Desktop depth
- numAlphaBits = ctx->lpPF->pfd.cAlphaBits;
- numDepthBits = ctx->lpPF->pfd.cDepthBits + ctx->lpPF->pfd.cStencilBits;
- numStencilBits = ctx->lpPF->pfd.cStencilBits;
- numBackBuffers = D3DX_DEFAULT; // Default is 1 backbuffer
- dwWidth = ctx->dwWidth;
- dwHeight = ctx->dwHeight;
- refreshRate = D3DX_DEFAULT;
- }
- hr = D3DXCreateContextEx(dwDeviceIndex, dwFlags, hwnd, hwndFocus,
- numColorBits, numAlphaBits, numDepthBits, numStencilBits,
- numBackBuffers,
- dwWidth, dwHeight, refreshRate,
- &lpCtx->pD3DXContext);
- if (FAILED(hr)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "D3DXCreateContextEx failed", hr);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Obtain D3D7 interfaces from ID3DXContext
-// lpCtx->pDD = ID3DXContext_GetDD(lpCtx->pD3DXContext);
- lpCtx->pDD = lpCtx->pD3DXContext->lpVtbl->GetDD(lpCtx->pD3DXContext);
- if (lpCtx->pDD == NULL)
- goto return_with_error;
- lpCtx->pD3D = lpCtx->pD3DXContext->lpVtbl->GetD3D(lpCtx->pD3DXContext);
- if (lpCtx->pD3D == NULL)
- goto return_with_error;
- lpCtx->pDev = lpCtx->pD3DXContext->lpVtbl->GetD3DDevice(lpCtx->pD3DXContext);
- if (lpCtx->pDev == NULL)
- goto return_with_error;
-
- // Need to manage clipper manually for multiple windows
- // since DX7 D3DX utility lib does not appear to do that. (DaveM)
- if (!ctx->bFullscreen) {
- // Get primary surface too
- lpDDSPrimary = lpCtx->pD3DXContext->lpVtbl->GetPrimary(lpCtx->pD3DXContext);
- if (lpDDSPrimary == NULL) {
- ddlogPrintf(DDLOG_WARN, "GetPrimary");
- goto return_with_error;
- }
- // Create clipper for correct window updates
- if (IDirectDraw7_CreateClipper(lpCtx->pDD, 0, &lpDDClipper, NULL) != DD_OK) {
- ddlogPrintf(DDLOG_WARN, "CreateClipper");
- goto return_with_error;
- }
- // Set the window that the clipper belongs to
- if (IDirectDrawClipper_SetHWnd(lpDDClipper, 0, hwnd) != DD_OK) {
- ddlogPrintf(DDLOG_WARN, "SetHWnd");
- goto return_with_error;
- }
- // Attach the clipper to the primary surface
- if (IDirectDrawSurface7_SetClipper(lpDDSPrimary, lpDDClipper) != DD_OK) {
- ddlogPrintf(DDLOG_WARN, "SetClipper");
- goto return_with_error;
- }
- }
-
- // Get device caps
- IDirect3DDevice7_GetCaps(lpCtx->pDev, &lpCtx->d3dCaps);
-
- // Determine HW TnL
- lpCtx->bHasHWTnL = lpCtx->d3dCaps.dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE;
-
-#ifdef _GLD_PERSISTANT
- if (bDirectDrawPersistant && bPersistantBuffers && dx7Globals.pD3D) {
- dx7Globals.pDev = lpCtx->pDev;
- dx7Globals.bDirect3DDevice = TRUE;
- }
-#endif
-
-#if 0
- // Dump some useful stats
- hResult = IDirect3D8_GetAdapterIdentifier(
- lpCtx->pD3D,
- glb.dwAdapter,
- D3DENUM_NO_WHQL_LEVEL, // Avoids 1 to 2 second delay
- &d3dIdent);
- if (SUCCEEDED(hResult)) {
- ddlogPrintf(DDLOG_INFO, "[Driver Description: %s]", &d3dIdent.Description);
- ddlogPrintf(DDLOG_INFO, "[Driver file: %s %d.%d.%02d.%d]",
- d3dIdent.Driver,
- HIWORD(d3dIdent.DriverVersion.HighPart),
- LOWORD(d3dIdent.DriverVersion.HighPart),
- HIWORD(d3dIdent.DriverVersion.LowPart),
- LOWORD(d3dIdent.DriverVersion.LowPart));
- ddlogPrintf(DDLOG_INFO, "[VendorId: 0x%X, DeviceId: 0x%X, SubSysId: 0x%X, Revision: 0x%X]",
- d3dIdent.VendorId, d3dIdent.DeviceId, d3dIdent.SubSysId, d3dIdent.Revision);
- }
-#endif
-
- // Init projection matrix for D3D TnL
- D3DXMatrixIdentity((D3DXMATRIX*)&lpCtx->matProjection);
- lpCtx->matModelView = lpCtx->matProjection;
-// gld->bUseMesaProjection = TRUE;
-
-skip_direct3ddevice_create:
-
- // Create buffers to hold primitives
- lpCtx->PB2d.dwFVF = GLD_FVF_2D_VERTEX;
-// lpCtx->PB2d.dwPool = D3DPOOL_SYSTEMMEM;
- lpCtx->PB2d.dwStride = sizeof(GLD_2D_VERTEX);
- lpCtx->PB2d.dwCreateFlags = D3DVBCAPS_DONOTCLIP |
- D3DVBCAPS_SYSTEMMEMORY |
- D3DVBCAPS_WRITEONLY;
- hr = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB2d);
- if (FAILED(hr))
- goto return_with_error;
-
- lpCtx->PB3d.dwFVF = GLD_FVF_3D_VERTEX;
-// lpCtx->PB3d.dwPool = D3DPOOL_DEFAULT;
- lpCtx->PB3d.dwStride = sizeof(GLD_3D_VERTEX);
- lpCtx->PB3d.dwCreateFlags = D3DVBCAPS_WRITEONLY;
-
- hr = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB3d);
- if (FAILED(hr))
- goto return_with_error;
-
- // Zero the pipeline usage counters
- lpCtx->PipelineUsage.qwMesa.QuadPart =
-// lpCtx->PipelineUsage.dwD3D2SVS.QuadPart =
- lpCtx->PipelineUsage.qwD3DFVF.QuadPart = 0;
-
- // Assign drawable to GL private
- ctx->glPriv = lpCtx;
- return TRUE;
-
-return_with_error:
- // Clean up and bail
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- //SAFE_RELEASE(lpCtx->pD3DXContext);
- lpCtx->pD3DXContext->lpVtbl->Release(lpCtx->pD3DXContext);
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldResizeDrawable_DX(
- DGL_ctx *ctx,
- BOOL bDefaultDriver,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- GLD_driver_dx7 *gld = NULL;
-// D3DDEVTYPE d3dDevType;
-// D3DPRESENT_PARAMETERS d3dpp;
-// D3DDISPLAYMODE d3ddm;
- D3DX_VIDMODEDESC d3ddm;
- HRESULT hr;
- DWORD dwWidth, dwHeight;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (ctx->bSceneStarted) {
- IDirect3DDevice7_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-/*
- d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- if (!bDefaultDriver)
- d3dDevType = D3DDEVTYPE_REF; // Force Direct3D Reference Rasterise (software)
-
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D8_GetAdapterDisplayMode(gld->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
-// goto return_with_error;
- return FALSE;
- }
-*/
- // Release objects before Reset()
- _gldDestroyPrimitiveBuffer(&gld->PB3d);
- _gldDestroyPrimitiveBuffer(&gld->PB2d);
-
-/*
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(gld->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- // TODO: Sync to refresh
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- // Get better benchmark results? KeithH
-// d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_UNLIMITED;
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- }
- hResult = IDirect3DDevice8_Reset(gld->pDev, &d3dpp);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Reset failed", hResult);
- return FALSE;
- //goto cleanup_and_return_with_error;
- }
-*/
- // Obtain dimensions of 'window'
- if (ctx->bFullscreen) {
- D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm);
- dwWidth = d3ddm.width;
- dwHeight = d3ddm.height;
- } else {
- dwWidth = ctx->dwWidth;
- dwHeight = ctx->dwHeight;
- }
-
- // Resize context
- hr = gld->pD3DXContext->lpVtbl->Resize(gld->pD3DXContext, dwWidth, dwHeight);
- if (FAILED(hr)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "gldResizeDrawable_DX: Resize failed", hr);
- return FALSE;
- }
-
- // Clear the resized surface (DaveM)
- {
- D3DVIEWPORT7 vp1, vp2;
- IDirect3DDevice7_GetViewport(gld->pDev, &vp1);
- IDirect3DDevice7_GetViewport(gld->pDev, &vp2);
- vp2.dwX = 0;
- vp2.dwY = 0;
- vp2.dwWidth = dwWidth;
- vp2.dwHeight = dwHeight;
- IDirect3DDevice7_SetViewport(gld->pDev, &vp2);
- hr = gld->pD3DXContext->lpVtbl->Clear(gld->pD3DXContext, D3DCLEAR_TARGET);
- if (FAILED(hr))
- ddlogError(DDLOG_WARN, "gldResizeDrawable_DX: Clear failed", hr);
- IDirect3DDevice7_SetViewport(gld->pDev, &vp1);
- }
-
- //
- // Recreate objects
- //
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d);
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB3d);
-
- // Signal a complete state update
- ctx->glCtx->Driver.UpdateState(ctx->glCtx, _NEW_ALL);
-
- // Begin a new scene
- IDirect3DDevice7_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyDrawable_DX(
- DGL_ctx *ctx)
-{
- GLD_driver_dx7 *lpCtx = NULL;
-
- // Error if context is NULL.
- if (!ctx)
- return FALSE;
-
- // Error if the drawable does not exist.
- if (!ctx->glPriv)
- return FALSE;
-
- lpCtx = ctx->glPriv;
-
-#ifdef _DEBUG
- // Dump out stats
- ddlogPrintf(DDLOG_SYSTEM, "Usage: M:0x%X%X, D:0x%X%X",
- lpCtx->PipelineUsage.qwMesa.HighPart,
- lpCtx->PipelineUsage.qwMesa.LowPart,
- lpCtx->PipelineUsage.qwD3DFVF.HighPart,
- lpCtx->PipelineUsage.qwD3DFVF.LowPart);
-#endif
-
- // Destroy Primtive Buffers
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- // Release DX interfaces (in reverse order)
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- //SAFE_RELEASE(lpCtx->pD3DXContext);
- lpCtx->pD3DXContext->lpVtbl->Release(lpCtx->pD3DXContext);
-
- // Free the private drawable data
- free(ctx->glPriv);
- ctx->glPriv = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldCreatePrivateGlobals_DX(void)
-{
-/*
- ZeroMemory(&dx7Globals, sizeof(dx7Globals));
-
- // Load d3d8.dll
- dx8Globals.hD3D8DLL = LoadLibrary("D3D8.DLL");
- if (dx8Globals.hD3D8DLL == NULL)
- return FALSE;
-
- // Now try and obtain Direct3DCreate8
- dx8Globals.fnDirect3DCreate8 = (FNDIRECT3DCREATE8)GetProcAddress(dx8Globals.hD3D8DLL, "Direct3DCreate8");
- if (dx8Globals.fnDirect3DCreate8 == NULL) {
- FreeLibrary(dx8Globals.hD3D8DLL);
- return FALSE;
- }
-*/
-
- // Initialise D3DX
- return FAILED(D3DXInitialize()) ? FALSE : TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyPrivateGlobals_DX(void)
-{
-/*
- if (dx7Globals.bDirect3DDevice) {
- SAFE_RELEASE(dx7Globals.pDev);
- dx7Globals.bDirect3DDevice = FALSE;
- }
- if (dx7Globals.bDirect3D) {
- SAFE_RELEASE(dx7Globals.pD3D);
- dx7Globals.bDirect3D = FALSE;
- }
-
- FreeLibrary(dx8Globals.hD3D8DLL);
- dx8Globals.hD3D8DLL = NULL;
- dx8Globals.fnDirect3DCreate8 = NULL;
-*/
- return FAILED(D3DXUninitialize()) ? FALSE : TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDisplayFormat(
- D3DX_SURFACEFORMAT fmt,
- BYTE *cColorBits,
- BYTE *cRedBits,
- BYTE *cGreenBits,
- BYTE *cBlueBits,
- BYTE *cAlphaBits)
-{
- switch (fmt) {
-/* case D3DX_SF_X1R5G5B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 5;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;*/
- case D3DX_SF_R5G5B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 5;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DX_SF_R5G6B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 6;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DX_SF_X8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
- return;
- case D3DX_SF_A8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 8;
- return;
- }
-
- // Should not get here!
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDepthStencilFormat(
- D3DX_SURFACEFORMAT fmt,
- BYTE *cDepthBits,
- BYTE *cStencilBits)
-{
- // NOTE: GL expects either 32 or 16 as depth bits.
- switch (fmt) {
- case D3DX_SF_Z16S0:
- *cDepthBits = 16;
- *cStencilBits = 0;
- return;
- case D3DX_SF_Z32S0:
- *cDepthBits = 32;
- *cStencilBits = 0;
- return;
- case D3DX_SF_Z15S1:
- *cDepthBits = 15;
- *cStencilBits = 1;
- return;
- case D3DX_SF_Z24S8:
- *cDepthBits = 24;
- *cStencilBits = 8;
- return;
- case D3DX_SF_S1Z15:
- *cDepthBits = 15;
- *cStencilBits = 1;
- return;
- case D3DX_SF_S8Z24:
- *cDepthBits = 24;
- *cStencilBits = 8;
- return;
- }
-}
-
-//---------------------------------------------------------------------------
-/*
-BOOL GLD_CheckDepthStencilMatch(
- DWORD dwDeviceIndex,
- D3DX_SURFACEFORMAT sfWant)
-{
- // Emulate function built in to DX9
- D3DX_SURFACEFORMAT sfFound;
- int i;
- int nFormats = D3DXGetMaxSurfaceFormats(dwDeviceIndex, NULL, D3DX_SC_DEPTHBUFFER);
- if (nFormats) {
- for (i=0; i<nFormats; i++) {
- D3DXGetSurfaceFormat(dwDeviceIndex, NULL, D3DX_SC_DEPTHBUFFER, i, &sfFound); }
- if (sfFound == sfWant)
- return TRUE;
- }
-
- return FALSE;
-}
-*/
-//---------------------------------------------------------------------------
-
-D3DX_SURFACEFORMAT _gldFindCompatibleDepthStencilFormat(
- DWORD dwDeviceIndex)
-{
- // Jump through some hoops...
-
- ID3DXContext *pD3DXContext = NULL;
- IDirectDrawSurface7 *pZBuffer = NULL;
- DDPIXELFORMAT ddpf;
- HWND hWnd;
-
- // Get an HWND - use Desktop's
- hWnd = GetDesktopWindow();
-
- // Create a fully specified default context.
- D3DXCreateContextEx(dwDeviceIndex, 0, hWnd, (HWND)D3DX_DEFAULT,
- D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT,
- D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT,
- &pD3DXContext);
-
- // Obtain depth buffer that was created in context
- pZBuffer = pD3DXContext->lpVtbl->GetZBuffer(pD3DXContext);
-
- // Get pixel format of depth buffer
- ddpf.dwSize = sizeof(ddpf);
- pZBuffer->lpVtbl->GetPixelFormat(pZBuffer, &ddpf);
- // Done with surface - release it
- pZBuffer->lpVtbl->Release(pZBuffer);
-
- // Done with D3DX context
- pD3DXContext->lpVtbl->Release(pD3DXContext);
-
- // Convert and return
- return D3DXMakeSurfaceFormat(&ddpf);
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldBuildPixelformatList_DX(void)
-{
- D3DX_DEVICEDESC d3dxdd;
- D3DX_VIDMODEDESC d3ddm;
- D3DX_SURFACEFORMAT fmt[64]; // 64 should be enough...
- DWORD dwDeviceIndex;
- DWORD surfClassFlags;
-// IDirect3D7 *pD3D = NULL;
- HRESULT hr;
- int nSupportedFormats = 0; // Total formats
- int nDepthOnlyFormats = 0;
- int nDepthStencilFormats = 0;
- int i;
- DGL_pixelFormat *pPF;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-// char buf[128];
-// char cat[8];
-
- // Direct3D (SW or HW)
- // These are arranged so that 'best' pixelformat
- // is higher in the list (for ChoosePixelFormat).
-/* const D3DFORMAT DepthStencil[4] = {
- D3DX_SF_Z16S0, //D3DX_SF_D16,
- D3DX_SF_Z15S1, //D3DX_SF_D15S1,
- D3DX_SF_Z32S0, //D3DX_SF_D32,
- D3DX_SF_Z24S8, //D3DX_SF_D24S8,
- //D3DX_SF_D24X8,
- //D3DX_SF_D24X4S4,
- };*/
-
- // Dump DX version
- ddlogMessage(GLDLOG_SYSTEM, "DirectX Version : 7.0\n");
-
- // Release any existing pixelformat list
- if (glb.lpPF) {
- free(glb.lpPF);
- }
-
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL;
-
- //
- // Pixelformats for Direct3D (SW or HW) rendering
- //
-
- dwDeviceIndex = (glb.dwDriver == GLDS_DRIVER_REF) ? D3DX_HWLEVEL_REFERENCE : D3DX_DEFAULT;
-
- // Dump description
- D3DXGetDeviceDescription(dwDeviceIndex, &d3dxdd);
- ddlogPrintf(GLDLOG_SYSTEM, "Device: %s", d3dxdd.driverDesc);
-
- // Get display mode
- D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm);
-
-#if 0
- // Phooey - this don't work...
-/*
- // Since D3DXGetMaxSurfaceFormats() can lie to us, we'll need a workaround.
- // Explicitly test for matching depth/stencil to display bpp.
- if (d3ddm.bpp <= 16) {
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z16S0))
- fmt[nSupportedFormats++] = D3DX_SF_Z16S0;
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z15S1))
- fmt[nSupportedFormats++] = D3DX_SF_Z15S1;
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_S1Z15))
- fmt[nSupportedFormats++] = D3DX_SF_S1Z15;
- // Didn't find anything? Try default
- if (nSupportedFormats == 0) {
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z32S0))
- fmt[nSupportedFormats++] = D3DX_SF_Z32S0;
- }
- } else {
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z32S0))
- fmt[nSupportedFormats++] = D3DX_SF_Z32S0;
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z24S8))
- fmt[nSupportedFormats++] = D3DX_SF_Z24S8;
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_S8Z24))
- fmt[nSupportedFormats++] = D3DX_SF_S8Z24;
- // Didn't find anything? Try default
- if (nSupportedFormats == 0) {
- if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z16S0))
- fmt[nSupportedFormats++] = D3DX_SF_Z16S0;
- }
- }
-*/
- // Go the Whole Hog...
- fmt[nSupportedFormats++] = _gldFindCompatibleDepthStencilFormat(dwDeviceIndex);
-#else
- //
- // Depth buffer formats WITHOUT stencil
- //
- surfClassFlags = D3DX_SC_DEPTHBUFFER;
- nDepthOnlyFormats = D3DXGetMaxSurfaceFormats(dwDeviceIndex, NULL, surfClassFlags);
- //
- // Depth buffer formats WITH stencil
- //
- surfClassFlags = D3DX_SC_DEPTHBUFFER | D3DX_SC_STENCILBUFFER;
- nDepthStencilFormats = D3DXGetMaxSurfaceFormats(dwDeviceIndex, NULL, surfClassFlags);
-
- // Work out how many formats we have in total
- if ((nDepthOnlyFormats + nDepthStencilFormats) == 0)
- return FALSE; // Bail: no compliant pixelformats
-
- // Get depth buffer formats WITHOUT stencil
- surfClassFlags = D3DX_SC_DEPTHBUFFER;
- for (i=0; i<nDepthOnlyFormats; i++) {
- D3DXGetSurfaceFormat(dwDeviceIndex, NULL, surfClassFlags, i, &fmt[nSupportedFormats++]);
- }
- // NOTE: For some reason we already get stencil formats when only specifying D3DX_SC_DEPTHBUFFER
- /*
- // Get depth buffer formats WITH stencil
- surfClassFlags = D3DX_SC_DEPTHBUFFER | D3DX_SC_STENCILBUFFER;
- for (i=0; i<nDepthStencilFormats; i++) {
- D3DXGetSurfaceFormat(dwDeviceIndex, NULL, surfClassFlags, i, &fmt[nSupportedFormats++]);
- }
- */
-#endif
-
- // Total count of pixelformats is:
- // (nSupportedFormats+1)*2
- glb.lpPF = (DGL_pixelFormat *)calloc((nSupportedFormats)*2, sizeof(DGL_pixelFormat));
- glb.nPixelFormatCount = (nSupportedFormats)*2;
- if (glb.lpPF == NULL) {
- glb.nPixelFormatCount = 0;
- return FALSE;
- }
-
- // Get a copy of pointer that we can alter
- pPF = glb.lpPF;
-
- // Cache colour bits from display format
-// _BitsFromDisplayFormat(d3ddm.Format, &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
- // Get display mode
- D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm);
- cColorBits = d3ddm.bpp;
- cAlphaBits = 0;
- switch (d3ddm.bpp) {
- case 15:
- cRedBits = 5; cGreenBits = 5; cBlueBits = 5;
- break;
- case 16:
- cRedBits = 5; cGreenBits = 6; cBlueBits = 5;
- break;
- case 24:
- case 32:
- cRedBits = 8; cGreenBits = 8; cBlueBits = 8;
- break;
- default:
- cRedBits = 5; cGreenBits = 5; cBlueBits = 5;
- }
-
- //
- // Add single-buffer formats
- //
-
-/* // Single-buffer, no depth-stencil buffer
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DX_SF_UNKNOWN;
- pPF++;*/
-
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- //
- // Add double-buffer formats
- //
-
-/* memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DX_SF_UNKNOWN;
- pPF++;*/
-
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- // Popup warning message if non RGB color mode
- {
- // This is a hack. KeithH
- HDC hdcDesktop = GetDC(NULL);
- DWORD dwDisplayBitDepth = GetDeviceCaps(hdcDesktop, BITSPIXEL);
- ReleaseDC(0, hdcDesktop);
- if (dwDisplayBitDepth <= 8) {
- ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth);
- MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING);
- }
- }
-
- // Mark list as 'current'
- glb.bPixelformatsDirty = FALSE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldInitialiseMesa_DX(
- DGL_ctx *lpCtx)
-{
- GLD_driver_dx7 *gld = NULL;
- int MaxTextureSize, TextureLevels;
- BOOL bSoftwareTnL;
-
- if (lpCtx == NULL)
- return FALSE;
-
- gld = lpCtx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (glb.bMultitexture) {
- lpCtx->glCtx->Const.MaxTextureUnits = gld->d3dCaps.wMaxSimultaneousTextures;
- // Only support MAX_TEXTURE_UNITS texture units.
- // ** If this is altered then the FVF formats must be reviewed **.
- if (lpCtx->glCtx->Const.MaxTextureUnits > GLD_MAX_TEXTURE_UNITS_DX7)
- lpCtx->glCtx->Const.MaxTextureUnits = GLD_MAX_TEXTURE_UNITS_DX7;
- } else {
- // Multitexture override
- lpCtx->glCtx->Const.MaxTextureUnits = 1;
- }
-
- // max texture size
-// MaxTextureSize = min(gld->d3dCaps8.MaxTextureHeight, gld->d3dCaps8.MaxTextureWidth);
- MaxTextureSize = min(gld->d3dCaps.dwMaxTextureHeight, gld->d3dCaps.dwMaxTextureWidth);
- if (MaxTextureSize == 0)
- MaxTextureSize = 256; // Sanity check
-
- //
- // HACK!!
- if (MaxTextureSize > 1024)
- MaxTextureSize = 1024; // HACK - CLAMP TO 1024
- // HACK!!
- //
-
- // TODO: Check this again for Mesa 5
- // Got to set MAX_TEXTURE_SIZE as max levels.
- // Who thought this stupid idea up? ;)
- TextureLevels = 0;
- // Calculate power-of-two.
- while (MaxTextureSize) {
- TextureLevels++;
- MaxTextureSize >>= 1;
- }
- lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8;
-
- // Defaults
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_LIGHTING, FALSE);
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_DITHERENABLE, TRUE);
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD);
-
- // Set texture coord set to be used with each stage
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_TEXCOORDINDEX, 0);
- IDirect3DDevice7_SetTextureStageState(gld->pDev, 1, D3DTSS_TEXCOORDINDEX, 1);
-
- // Set up Depth buffer
- IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ZENABLE,
- (lpCtx->lpPF->dwDriverData!=D3DX_SF_UNKNOWN) ? D3DZB_TRUE : D3DZB_FALSE);
-
- // Set the view matrix
- {
- D3DXMATRIX vm;
-#if 1
- D3DXMatrixIdentity(&vm);
-#else
- D3DXVECTOR3 Eye(0.0f, 0.0f, 0.0f);
- D3DXVECTOR3 At(0.0f, 0.0f, -1.0f);
- D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f);
- D3DXMatrixLookAtRH(&vm, &Eye, &At, &Up);
- vm._31 = -vm._31;
- vm._32 = -vm._32;
- vm._33 = -vm._33;
- vm._34 = -vm._34;
-#endif
- IDirect3DDevice7_SetTransform(gld->pDev, D3DTRANSFORMSTATE_VIEW, &vm);
- }
-
-// DX7 does not support D3DRS_SOFTWAREVERTEXPROCESSING
-/*
- if (gld->bHasHWTnL) {
- if (glb.dwTnL == GLDS_TNL_DEFAULT)
- bSoftwareTnL = FALSE; // HW TnL
- else {
- bSoftwareTnL = ((glb.dwTnL == GLDS_TNL_MESA) || (glb.dwTnL == GLDS_TNL_D3DSW)) ? TRUE : FALSE;
- }
- } else {
- // No HW TnL, so no choice possible
- bSoftwareTnL = TRUE;
- }
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, bSoftwareTnL);
-*/
-
-// Dump this in a Release build as well, now.
-//#ifdef _DEBUG
- ddlogPrintf(DDLOG_INFO, "HW TnL: %s",
-// gld->bHasHWTnL ? (bSoftwareTnL ? "Disabled" : "Enabled") : "Unavailable");
- gld->bHasHWTnL ? "Enabled" : "Unavailable");
-//#endif
-
- // Set up interfaces to Mesa
- gldEnableExtensions_DX7(lpCtx->glCtx);
- gldInstallPipeline_DX7(lpCtx->glCtx);
- gldSetupDriverPointers_DX7(lpCtx->glCtx);
-
- // Signal a complete state update
- lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL);
-
- // Start a scene
- IDirect3DDevice7_BeginScene(gld->pDev);
- lpCtx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldSwapBuffers_DX(
- DGL_ctx *ctx,
- HDC hDC,
- HWND hWnd)
-{
- HRESULT hr;
- GLD_driver_dx7 *gld = NULL;
- DWORD dwFlags;
-
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
-
- // End the scene if one is started
- if (ctx->bSceneStarted) {
- IDirect3DDevice7_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-
- // Needed by D3DX for MDI multi-window apps (DaveM)
- if (lpDDClipper)
- IDirectDrawClipper_SetHWnd(lpDDClipper, 0, hWnd);
-
- // Swap the buffers. hWnd may override the hWnd used for CreateDevice()
-// hr = IDirect3DDevice8_Present(gld->pDev, NULL, NULL, hWnd, NULL);
-
- // Set refresh sync flag
- dwFlags = glb.bWaitForRetrace ? 0 : D3DX_UPDATE_NOVSYNC;
- // Render and show frame
- hr = gld->pD3DXContext->lpVtbl->UpdateFrame(gld->pD3DXContext, dwFlags);
- if (FAILED(hr))
- ddlogError(DDLOG_WARN, "gldSwapBuffers_DX: UpdateFrame", hr);
-
- if (hr == DDERR_SURFACELOST) {
- hr = gld->pD3DXContext->lpVtbl->RestoreSurfaces(gld->pD3DXContext);
- if (FAILED(hr))
- ddlogError(DDLOG_WARN, "gldSwapBuffers_DX: RestoreSurfaces", hr);
- }
-
-exit_swap:
- // Begin a new scene
- IDirect3DDevice7_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
- return (FAILED(hr)) ? FALSE : TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldGetDisplayMode_DX(
- DGL_ctx *ctx,
- GLD_displayMode *glddm)
-{
-// D3DDISPLAYMODE d3ddm;
- D3DX_VIDMODEDESC d3ddm;
- HRESULT hr;
- GLD_driver_dx7 *lpCtx = NULL;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-
- if ((glddm == NULL) || (ctx == NULL))
- return FALSE;
-
- lpCtx = ctx->glPriv;
- if (lpCtx == NULL)
- return FALSE;
-
- if (lpCtx->pD3D == NULL)
- return FALSE;
-
-// hr = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- hr = D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm);
- if (FAILED(hr))
- return FALSE;
-
- // Get info from the display format
-// _BitsFromDisplayFormat(d3ddm.Format,
-// &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
-
- glddm->Width = d3ddm.width;
- glddm->Height = d3ddm.height;
- glddm->BPP = d3ddm.bpp;
- glddm->Refresh = d3ddm.refreshRate;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c
deleted file mode 100644
index 0a6d9f8555c..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c
+++ /dev/null
@@ -1,1176 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Driver interface code to Mesa
-*
-****************************************************************************/
-
-//#include <windows.h>
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx8.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-extern BOOL dglSwapBuffers(HDC hDC);
-
-// HACK: Hack the _33 member of the OpenGL perspective projection matrix
-const float _fPersp_33 = 1.6f;
-
-//---------------------------------------------------------------------------
-// Internal functions
-//---------------------------------------------------------------------------
-
-void _gld_mesa_warning(
- __GLcontext *gc,
- char *str)
-{
- // Intercept Mesa's internal warning mechanism
- gldLogPrintf(GLDLOG_WARN, "Mesa warning: %s", str);
-}
-
-//---------------------------------------------------------------------------
-
-void _gld_mesa_fatal(
- __GLcontext *gc,
- char *str)
-{
- // Intercept Mesa's internal fatal-message mechanism
- gldLogPrintf(GLDLOG_CRITICAL, "Mesa FATAL: %s", str);
-
- // Mesa calls abort(0) here.
- ddlogClose();
- exit(0);
-}
-
-//---------------------------------------------------------------------------
-
-D3DSTENCILOP _gldConvertStencilOp(
- GLenum StencilOp)
-{
- // Used by Stencil: pass, fail and zfail
-
- switch (StencilOp) {
- case GL_KEEP:
- return D3DSTENCILOP_KEEP;
- case GL_ZERO:
- return D3DSTENCILOP_ZERO;
- case GL_REPLACE:
- return D3DSTENCILOP_REPLACE;
- case GL_INCR:
- return D3DSTENCILOP_INCRSAT;
- case GL_DECR:
- return D3DSTENCILOP_DECRSAT;
- case GL_INVERT:
- return D3DSTENCILOP_INVERT;
- case GL_INCR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_INCR;
- case GL_DECR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_DECR;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertStencilOp: Unknown StencilOp\n");
-#endif
-
- return D3DSTENCILOP_KEEP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DCMPFUNC _gldConvertCompareFunc(
- GLenum CmpFunc)
-{
- // Used for Alpha func, depth func and stencil func.
-
- switch (CmpFunc) {
- case GL_NEVER:
- return D3DCMP_NEVER;
- case GL_LESS:
- return D3DCMP_LESS;
- case GL_EQUAL:
- return D3DCMP_EQUAL;
- case GL_LEQUAL:
- return D3DCMP_LESSEQUAL;
- case GL_GREATER:
- return D3DCMP_GREATER;
- case GL_NOTEQUAL:
- return D3DCMP_NOTEQUAL;
- case GL_GEQUAL:
- return D3DCMP_GREATEREQUAL;
- case GL_ALWAYS:
- return D3DCMP_ALWAYS;
- };
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertCompareFunc: Unknown CompareFunc\n");
-#endif
-
- return D3DCMP_ALWAYS;
-}
-
-//---------------------------------------------------------------------------
-
-D3DBLEND _gldConvertBlendFunc(
- GLenum blend,
- GLenum DefaultBlend)
-{
- switch (blend) {
- case GL_ZERO:
- return D3DBLEND_ZERO;
- case GL_ONE:
- return D3DBLEND_ONE;
- case GL_DST_COLOR:
- return D3DBLEND_DESTCOLOR;
- case GL_SRC_COLOR:
- return D3DBLEND_SRCCOLOR;
- case GL_ONE_MINUS_DST_COLOR:
- return D3DBLEND_INVDESTCOLOR;
- case GL_ONE_MINUS_SRC_COLOR:
- return D3DBLEND_INVSRCCOLOR;
- case GL_SRC_ALPHA:
- return D3DBLEND_SRCALPHA;
- case GL_ONE_MINUS_SRC_ALPHA:
- return D3DBLEND_INVSRCALPHA;
- case GL_DST_ALPHA:
- return D3DBLEND_DESTALPHA;
- case GL_ONE_MINUS_DST_ALPHA:
- return D3DBLEND_INVDESTALPHA;
- case GL_SRC_ALPHA_SATURATE:
- return D3DBLEND_SRCALPHASAT;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertBlendFunc: Unknown BlendFunc\n");
-#endif
-
- return DefaultBlend;
-}
-
-//---------------------------------------------------------------------------
-// Misc. functions
-//---------------------------------------------------------------------------
-
-void gld_Noop_DX8(
- GLcontext *ctx)
-{
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "gld_Noop called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Error_DX8(
- GLcontext *ctx)
-{
-#ifdef _DEBUG
- // Quite useless.
-// gldLogMessage(GLDLOG_ERROR, "ctx->Driver.Error called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Required Mesa functions
-//---------------------------------------------------------------------------
-
-static GLboolean gld_set_draw_buffer_DX8(
- GLcontext *ctx,
- GLenum mode)
-{
- (void) ctx;
- if ((mode==GL_FRONT_LEFT) || (mode == GL_BACK_LEFT)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_set_read_buffer_DX8(
- GLcontext *ctx,
- GLframebuffer *buffer,
- GLenum mode)
-{
- /* separate read buffer not supported */
-/*
- ASSERT(buffer == ctx->DrawBuffer);
- ASSERT(mode == GL_FRONT_LEFT);
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Clear_DX8(
- GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint x,
- GLint y,
- GLint width,
- GLint height)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DCOLOR Color = 0;
- float Z = 0.0f;
- DWORD Stencil = 0;
- D3DRECT d3dClearRect;
-
- // TODO: Colourmask
- const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
-
- if (!gld->pDev)
- return;
-
- if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
- GLubyte col[4];
- CLAMPED_FLOAT_TO_UBYTE(col[0], ctx->Color.ClearColor[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], ctx->Color.ClearColor[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], ctx->Color.ClearColor[2]);
- CLAMPED_FLOAT_TO_UBYTE(col[3], ctx->Color.ClearColor[3]);
- dwFlags |= D3DCLEAR_TARGET;
- Color = D3DCOLOR_RGBA(col[0], col[1], col[2], col[3]);
-// ctx->Color.ClearColor[1],
-// ctx->Color.ClearColor[2],
-// ctx->Color.ClearColor[3]);
- }
-
- if (mask & DD_DEPTH_BIT) {
- // D3D8 will fail the Clear call if we try and clear a
- // depth buffer and we haven't created one.
- // Also, some apps try and clear a depth buffer,
- // when a depth buffer hasn't been requested by the app.
- if (ctx->Visual.depthBits == 0) {
- mask &= ~DD_DEPTH_BIT; // Remove depth bit from mask
- } else {
- dwFlags |= D3DCLEAR_ZBUFFER;
- Z = ctx->Depth.Clear;
- }
- }
-
- if (mask & DD_STENCIL_BIT) {
- if (ctx->Visual.stencilBits == 0) {
- // No stencil bits in depth buffer
- mask &= ~DD_STENCIL_BIT; // Remove stencil bit from mask
- } else {
- dwFlags |= D3DCLEAR_STENCIL;
- Stencil = ctx->Stencil.Clear;
- }
- }
-
- // Some apps do really weird things with the rect, such as Quake3.
- if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0)) {
- all = GL_TRUE;
- }
-
- if (!all) {
- // Calculate clear subrect
- d3dClearRect.x1 = x;
- d3dClearRect.y1 = gldCtx->dwHeight - (y + height);
- d3dClearRect.x2 = x + width;
- d3dClearRect.y2 = d3dClearRect.y1 + height;
- }
-
- // dwFlags will be zero if there's nothing to clear
- if (dwFlags) {
- _GLD_DX8_DEV(Clear(
- gld->pDev,
- all ? 0 : 1,
- all ? NULL : &d3dClearRect,
- dwFlags,
- Color, Z, Stencil));
- }
-
- if (mask & DD_ACCUM_BIT) {
- // Clear accumulation buffer
- }
-}
-
-//---------------------------------------------------------------------------
-
-// Mesa 5: Parameter change
-static void gld_buffer_size_DX8(
-// GLcontext *ctx,
- GLframebuffer *fb,
- GLuint *width,
- GLuint *height)
-{
-// GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
-
- *width = fb->Width; // gldCtx->dwWidth;
- *height = fb->Height; // gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Finish_DX8(
- GLcontext *ctx)
-{
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Flush_DX8(
- GLcontext *ctx)
-{
- GLD_context *gld = GLD_GET_CONTEXT(ctx);
-
- // TODO: Detect apps that glFlush() then SwapBuffers() ?
-
- if (gld->EmulateSingle) {
- // Emulating a single-buffered context.
- // [Direct3D doesn't allow rendering to front buffer]
- dglSwapBuffers(gld->hDC);
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_STENCIL(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- // Two-sided stencil. New for Mesa 5
- const GLuint uiFace = 0UL;
-
- struct gl_stencil_attrib *pStencil = &ctx->Stencil;
-
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILENABLE, pStencil->Enabled ? TRUE : FALSE));
- if (pStencil->Enabled) {
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFUNC, _gldConvertCompareFunc(pStencil->Function[uiFace])));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILREF, pStencil->Ref[uiFace]));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILMASK, pStencil->ValueMask[uiFace]));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILWRITEMASK, pStencil->WriteMask[uiFace]));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFAIL, _gldConvertStencilOp(pStencil->FailFunc[uiFace])));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILZFAIL, _gldConvertStencilOp(pStencil->ZFailFunc[uiFace])));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILPASS, _gldConvertStencilOp(pStencil->ZPassFunc[uiFace])));
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_COLOR(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DBLEND src;
- D3DBLEND dest;
-
- // Alpha func
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, _gldConvertCompareFunc(ctx->Color.AlphaFunc)));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAREF, (DWORD)ctx->Color.AlphaRef));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, ctx->Color.AlphaEnabled));
-
- // Blend func
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHABLENDENABLE, ctx->Color.BlendEnabled));
- src = _gldConvertBlendFunc(ctx->Color.BlendSrcRGB, GL_ONE);
- dest = _gldConvertBlendFunc(ctx->Color.BlendDstRGB, GL_ZERO);
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SRCBLEND, src));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_DESTBLEND, dest));
-
- // Color mask
- if (ctx->Color.ColorMask[0]) dwFlags |= D3DCOLORWRITEENABLE_RED;
- if (ctx->Color.ColorMask[1]) dwFlags |= D3DCOLORWRITEENABLE_GREEN;
- if (ctx->Color.ColorMask[2]) dwFlags |= D3DCOLORWRITEENABLE_BLUE;
- if (ctx->Color.ColorMask[3]) dwFlags |= D3DCOLORWRITEENABLE_ALPHA;
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_COLORWRITEENABLE, dwFlags));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_DEPTH(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZENABLE, ctx->Depth.Test ? D3DZB_TRUE : D3DZB_FALSE));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZFUNC, _gldConvertCompareFunc(ctx->Depth.Func)));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZWRITEENABLE, ctx->Depth.Mask ? TRUE : FALSE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_POLYGON(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- D3DFILLMODE d3dFillMode = D3DFILL_SOLID;
- D3DCULL d3dCullMode = D3DCULL_NONE;
- int iOffset = 0;
-
- // Fillmode
- switch (ctx->Polygon.FrontMode) {
- case GL_POINT:
- d3dFillMode = D3DFILL_POINT;
- break;
- case GL_LINE:
- d3dFillMode = D3DFILL_WIREFRAME;
- break;
- case GL_FILL:
- d3dFillMode = D3DFILL_SOLID;
- break;
- }
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FILLMODE, d3dFillMode));
-
- if (ctx->Polygon.CullFlag) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_BACK:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CW;
- else
- d3dCullMode = D3DCULL_CCW;
- break;
- case GL_FRONT:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CCW;
- else
- d3dCullMode = D3DCULL_CW;
- break;
- case GL_FRONT_AND_BACK:
- d3dCullMode = D3DCULL_NONE;
- break;
- default:
- break;
- }
- } else {
- d3dCullMode = D3DCULL_NONE;
- }
-// d3dCullMode = D3DCULL_NONE; // TODO: DEBUGGING
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_CULLMODE, d3dCullMode));
-
- // Polygon offset
- // ZBIAS ranges from 0 to 16 and can only move towards the viewer
- // Mesa5: ctx->Polygon._OffsetAny removed
- if (ctx->Polygon.OffsetFill) {
- iOffset = (int)ctx->Polygon.OffsetUnits;
- if (iOffset < 0)
- iOffset = -iOffset;
- else
- iOffset = 0; // D3D can't push away
- }
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZBIAS, iOffset));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_FOG(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- D3DCOLOR d3dFogColour;
- D3DFOGMODE d3dFogMode = D3DFOG_LINEAR;
-
- // TODO: Fog is calculated seperately in the Mesa pipeline
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, FALSE));
- return;
-
- // Fog enable
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, ctx->Fog.Enabled));
- if (!ctx->Fog.Enabled) {
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, D3DFOG_NONE));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE));
- return; // If disabled, don't bother setting any fog state
- }
-
- // Fog colour
- d3dFogColour = D3DCOLOR_COLORVALUE( ctx->Fog.Color[0],
- ctx->Fog.Color[1],
- ctx->Fog.Color[2],
- ctx->Fog.Color[3]);
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGCOLOR, d3dFogColour));
-
- // Fog density
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGDENSITY, *((DWORD*) (&ctx->Fog.Density))));
-
- // Fog start
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGSTART, *((DWORD*) (&ctx->Fog.Start))));
-
- // Fog end
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGEND, *((DWORD*) (&ctx->Fog.End))));
-
- // Fog mode
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- d3dFogMode = D3DFOG_LINEAR;
- break;
- case GL_EXP:
- d3dFogMode = D3DFOG_EXP;
- break;
- case GL_EXP2:
- d3dFogMode = D3DFOG_EXP2;
- break;
- }
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, d3dFogMode));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_LIGHT(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- DWORD dwSpecularEnable;
-
- // Shademode
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SHADEMODE, (ctx->Light.ShadeModel == GL_SMOOTH) ? D3DSHADE_GOURAUD : D3DSHADE_FLAT));
-
- // Separate specular colour
- if (ctx->Light.Enabled)
- dwSpecularEnable = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TRUE: FALSE;
- else
- dwSpecularEnable = FALSE;
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SPECULARENABLE, dwSpecularEnable));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_MODELVIEW(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ModelView.m;
- // Mesa5: Model-view is now a stack
- GLfloat *pM = ctx->ModelviewMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10];
- m._34 = pM[11];
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14];
- m._44 = pM[15];
-
- gld->matModelView = m;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_PROJECTION(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ProjectionMatrix.m;
- // Mesa 5: Now a stack
- GLfloat *pM = ctx->ProjectionMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
-
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
-
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10] / _fPersp_33; // / 1.6f;
- m._34 = pM[11];
-
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14] / 2.0f;
- m._44 = pM[15];
-
- gld->matProjection = m;
-}
-
-//---------------------------------------------------------------------------
-/*
-void gldFrustumHook_DX8(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Frustum(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = farval / (nearval - farval);
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Frustum: %f", farval/nearval);
-}
-
-//---------------------------------------------------------------------------
-
-void gldOrthoHook_DX8(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Ortho(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = 1.6f;
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Ortho: %f", farval/nearval);
-}
-*/
-//---------------------------------------------------------------------------
-
-void gld_NEW_VIEWPORT(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- D3DVIEWPORT8 d3dvp;
-// GLint x, y;
-// GLsizei w, h;
-
- // Set depth range
- _GLD_DX8_DEV(GetViewport(gld->pDev, &d3dvp));
- // D3D can't do Quake1/Quake2 z-trick
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.MinZ = ctx->Viewport.Near;
- d3dvp.MaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.MinZ = ctx->Viewport.Far;
- d3dvp.MaxZ = ctx->Viewport.Near;
- }
-/* x = ctx->Viewport.X;
- y = ctx->Viewport.Y;
- w = ctx->Viewport.Width;
- h = ctx->Viewport.Height;
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
- d3dvp.X = x;
- d3dvp.Y = gldCtx->dwHeight - (y + h);
- d3dvp.Width = w;
- d3dvp.Height = h;*/
- _GLD_DX8_DEV(SetViewport(gld->pDev, &d3dvp));
-
-// gld->fFlipWindowY = (float)gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-__inline BOOL _gldAnyEvalEnabled(
- GLcontext *ctx)
-{
- struct gl_eval_attrib *eval = &ctx->Eval;
-
- if ((eval->AutoNormal) ||
- (eval->Map1Color4) ||
- (eval->Map1Index) ||
- (eval->Map1Normal) ||
- (eval->Map1TextureCoord1) ||
- (eval->Map1TextureCoord2) ||
- (eval->Map1TextureCoord3) ||
- (eval->Map1TextureCoord4) ||
- (eval->Map1Vertex3) ||
- (eval->Map1Vertex4) ||
- (eval->Map2Color4) ||
- (eval->Map2Index) ||
- (eval->Map2Normal) ||
- (eval->Map2TextureCoord1) ||
- (eval->Map2TextureCoord2) ||
- (eval->Map2TextureCoord3) ||
- (eval->Map2TextureCoord4) ||
- (eval->Map2Vertex3) ||
- (eval->Map2Vertex4)
- )
- return TRUE;
-
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL _gldChooseInternalPipeline(
- GLcontext *ctx,
- GLD_driver_dx8 *gld)
-{
-// return TRUE; // DEBUGGING: ALWAYS USE MESA
-// return FALSE; // DEBUGGING: ALWAYS USE D3D
-
- if ((glb.dwTnL == GLDS_TNL_MESA) || (gld->bHasHWTnL == FALSE))
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE; // Force Mesa TnL
- }
-
- if ((ctx->Light.Enabled) ||
- (1) ||
- (ctx->Texture._TexGenEnabled) ||
- (ctx->Texture._TexMatEnabled) ||
-// (ctx->Transform._AnyClip) ||
- (ctx->Scissor.Enabled) ||
- _gldAnyEvalEnabled(ctx) // Put this last so we can early-out
- )
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE;
- }
-
- gld->PipelineUsage.qwD3DFVF.QuadPart++;
- return FALSE;
-
-/* // Force Mesa pipeline?
- if (glb.dwTnL == GLDS_TNL_MESA) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Test for functionality not exposed in the D3D pathways
- if ((ctx->Texture._GenFlags)) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Now decide if vertex shader can be used.
- // If two sided lighting is enabled then we must either
- // use Mesa TnL or the vertex shader
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
- if (gld->VStwosidelight.hShader && !ctx->Fog.Enabled) {
- // Use Vertex Shader
- gld->PipelineUsage.dwD3D2SVS.QuadPart++;
- return GLD_PIPELINE_D3D_VS_TWOSIDE;
- } else {
- // Use Mesa TnL
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
- }
-
- // Must be D3D fixed-function pipeline
- gld->PipelineUsage.dwD3DFVF.QuadPart++;
- return GLD_PIPELINE_D3D_FVF;
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_update_state_DX8(
- GLcontext *ctx,
- GLuint new_state)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLD_pb_dx8 *gldPB;
-
- if (!gld || !gld->pDev)
- return;
-
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-
- // SetupIndex will be used in the pipelines for choosing setup function
- if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) ||
- (ctx->Fog.Enabled))
- {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT_EXTRAS;
- else
- gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS;
- } else {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture
- else
- gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture
- }
-
- gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld);
- if (gld->bUseMesaTnL) {
- gldPB = &gld->PB2d;
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE));
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, FALSE));
- _GLD_DX8_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF));
- } else {
- gldPB = &gld->PB3d;
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE));
-// if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) {
-// _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware));
-// _GLD_DX8_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
-// } else {
- _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL));
- _GLD_DX8_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF));
-// }
- }
-
-#define _GLD_TEST_STATE(a) \
- if (new_state & (a)) { \
- gld##a(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_TEST_STATE_DX8(a) \
- if (new_state & (a)) { \
- gld##a##_DX8(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_IGNORE_STATE(a) new_state &= ~(a);
-
-// if (!gld->bUseMesaTnL) {
- // Not required if Mesa is doing the TnL.
- // Problem: If gld->bUseMesaTnL is TRUE when these are signaled,
- // then we'll miss updating the D3D TnL pipeline.
- // Therefore, don't test for gld->bUseMesaTnL
- _GLD_TEST_STATE(_NEW_MODELVIEW);
- _GLD_TEST_STATE(_NEW_PROJECTION);
-// }
-
- _GLD_TEST_STATE_DX8(_NEW_TEXTURE); // extern, so guard with _DX8
- _GLD_TEST_STATE(_NEW_COLOR);
- _GLD_TEST_STATE(_NEW_DEPTH);
- _GLD_TEST_STATE(_NEW_POLYGON);
- _GLD_TEST_STATE(_NEW_STENCIL);
- _GLD_TEST_STATE(_NEW_FOG);
- _GLD_TEST_STATE(_NEW_LIGHT);
- _GLD_TEST_STATE(_NEW_VIEWPORT);
-
- _GLD_IGNORE_STATE(_NEW_TRANSFORM);
-
-
-// Stubs for future use.
-/* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_STATE(_NEW_ACCUM);
- _GLD_TEST_STATE(_NEW_EVAL);
- _GLD_TEST_STATE(_NEW_HINT);
- _GLD_TEST_STATE(_NEW_LINE);
- _GLD_TEST_STATE(_NEW_PIXEL);
- _GLD_TEST_STATE(_NEW_POINT);
- _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE);
- _GLD_TEST_STATE(_NEW_SCISSOR);
- _GLD_TEST_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_STATE(_NEW_ARRAY);
- _GLD_TEST_STATE(_NEW_RENDERMODE);
- _GLD_TEST_STATE(_NEW_BUFFERS);
- _GLD_TEST_STATE(_NEW_MULTISAMPLE);
-*/
-
-// For debugging.
-#if 0
-#define _GLD_TEST_UNHANDLED_STATE(a) \
- if (new_state & (a)) { \
- gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \
- }
- _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_ACCUM);
- _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_HINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_LINE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY);
- _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS);
- _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE);
-#undef _GLD_UNHANDLED_STATE
-#endif
-
-#undef _GLD_TEST_STATE
-}
-
-//---------------------------------------------------------------------------
-// Viewport
-//---------------------------------------------------------------------------
-
-void gld_Viewport_DX8(
- GLcontext *ctx,
- GLint x,
- GLint y,
- GLsizei w,
- GLsizei h)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- D3DVIEWPORT8 d3dvp;
-
- if (!gld || !gld->pDev)
- return;
-
- // This is a hack. When the app is minimized, Mesa passes
- // w=1 and h=1 for viewport dimensions. Without this test
- // we get a GPF in gld_wgl_resize_buffers().
- if ((w==1) && (h==1))
- return;
-
- // Call ResizeBuffersMESA. This function will early-out
- // if no resize is needed.
- //ctx->Driver.ResizeBuffersMESA(ctx);
- // Mesa 5: Changed parameters
- ctx->Driver.ResizeBuffers(gldCtx->glBuffer);
-
-#if 0
- ddlogPrintf(GLDLOG_SYSTEM, ">> Viewport x=%d y=%d w=%d h=%d", x,y,w,h);
-#endif
-
- // ** D3D viewport must not be outside the render target surface **
- // Sanity check the GL viewport dimensions
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
-
- d3dvp.X = x;
- d3dvp.Y = gldCtx->dwHeight - (y + h);
- d3dvp.Width = w;
- d3dvp.Height = h;
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.MinZ = ctx->Viewport.Near;
- d3dvp.MaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.MinZ = ctx->Viewport.Far;
- d3dvp.MaxZ = ctx->Viewport.Near;
- }
-
- // TODO: DEBUGGING
-// d3dvp.MinZ = 0.0f;
-// d3dvp.MaxZ = 1.0f;
-
- _GLD_DX8_DEV(SetViewport(gld->pDev, &d3dvp));
-
-}
-
-//---------------------------------------------------------------------------
-
-extern BOOL dglWglResizeBuffers(GLcontext *ctx, BOOL bDefaultDriver);
-
-// Mesa 5: Parameter change
-void gldResizeBuffers_DX8(
-// GLcontext *ctx)
- GLframebuffer *fb)
-{
- GET_CURRENT_CONTEXT(ctx);
- dglWglResizeBuffers(ctx, TRUE);
-}
-
-//---------------------------------------------------------------------------
-#ifdef _DEBUG
-// This is only for debugging.
-// To use, plug into ctx->Driver.Enable pointer below.
-void gld_Enable(
- GLcontext *ctx,
- GLenum e,
- GLboolean b)
-{
- char buf[1024];
- sprintf(buf, "Enable: %s (%s)\n", _mesa_lookup_enum_by_nr(e), b?"TRUE":"FALSE");
- ddlogMessage(DDLOG_SYSTEM, buf);
-}
-#endif
-//---------------------------------------------------------------------------
-// Driver pointer setup
-//---------------------------------------------------------------------------
-
-extern const GLubyte* _gldGetStringGeneric(GLcontext*, GLenum);
-
-void gldSetupDriverPointers_DX8(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- // Mandatory functions
- ctx->Driver.GetString = _gldGetStringGeneric;
- ctx->Driver.UpdateState = gld_update_state_DX8;
- ctx->Driver.Clear = gld_Clear_DX8;
- ctx->Driver.DrawBuffer = gld_set_draw_buffer_DX8;
- ctx->Driver.GetBufferSize = gld_buffer_size_DX8;
- ctx->Driver.Finish = gld_Finish_DX8;
- ctx->Driver.Flush = gld_Flush_DX8;
- ctx->Driver.Error = gld_Error_DX8;
-
- // Hardware accumulation buffer
- ctx->Driver.Accum = NULL; // TODO: gld_Accum;
-
- // Bitmap functions
- ctx->Driver.CopyPixels = gld_CopyPixels_DX8;
- ctx->Driver.DrawPixels = gld_DrawPixels_DX8;
- ctx->Driver.ReadPixels = gld_ReadPixels_DX8;
- ctx->Driver.Bitmap = gld_Bitmap_DX8;
-
- // Buffer resize
- ctx->Driver.ResizeBuffers = gldResizeBuffers_DX8;
-
- // Texture image functions
- ctx->Driver.ChooseTextureFormat = gld_ChooseTextureFormat_DX8;
- ctx->Driver.TexImage1D = gld_TexImage1D_DX8;
- ctx->Driver.TexImage2D = gld_TexImage2D_DX8;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage1D = gld_TexSubImage1D_DX8;
- ctx->Driver.TexSubImage2D = gld_TexSubImage2D_DX8;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
-
- ctx->Driver.CopyTexImage1D = gldCopyTexImage1D_DX8; //NULL;
- ctx->Driver.CopyTexImage2D = gldCopyTexImage2D_DX8; //NULL;
- ctx->Driver.CopyTexSubImage1D = gldCopyTexSubImage1D_DX8; //NULL;
- ctx->Driver.CopyTexSubImage2D = gldCopyTexSubImage2D_DX8; //NULL;
- ctx->Driver.CopyTexSubImage3D = gldCopyTexSubImage3D_DX8;
- ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
-
- // Texture object functions
- ctx->Driver.BindTexture = NULL;
- ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!;
- ctx->Driver.DeleteTexture = gld_DeleteTexture_DX8;
- ctx->Driver.PrioritizeTexture = NULL;
-
- // Imaging functionality
- ctx->Driver.CopyColorTable = NULL;
- ctx->Driver.CopyColorSubTable = NULL;
- ctx->Driver.CopyConvolutionFilter1D = NULL;
- ctx->Driver.CopyConvolutionFilter2D = NULL;
-
- // State changing functions
- ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc;
- ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc;
- ctx->Driver.ClearColor = NULL; //gld_ClearColor;
- ctx->Driver.ClearDepth = NULL; //gld_ClearDepth;
- ctx->Driver.ClearStencil = NULL; //gld_ClearStencil;
- ctx->Driver.ColorMask = NULL; //gld_ColorMask;
- ctx->Driver.CullFace = NULL; //gld_CullFace;
- ctx->Driver.ClipPlane = NULL; //gld_ClipPlane;
- ctx->Driver.FrontFace = NULL; //gld_FrontFace;
- ctx->Driver.DepthFunc = NULL; //gld_DepthFunc;
- ctx->Driver.DepthMask = NULL; //gld_DepthMask;
- ctx->Driver.DepthRange = NULL;
- ctx->Driver.Enable = NULL; //gld_Enable;
- ctx->Driver.Fogfv = NULL; //gld_Fogfv;
- ctx->Driver.Hint = NULL; //gld_Hint;
- ctx->Driver.Lightfv = NULL; //gld_Lightfv;
- ctx->Driver.LightModelfv = NULL; //gld_LightModelfv;
- ctx->Driver.LineStipple = NULL; //gld_LineStipple;
- ctx->Driver.LineWidth = NULL; //gld_LineWidth;
- ctx->Driver.LogicOpcode = NULL; //gld_LogicOpcode;
- ctx->Driver.PointParameterfv = NULL; //gld_PointParameterfv;
- ctx->Driver.PointSize = NULL; //gld_PointSize;
- ctx->Driver.PolygonMode = NULL; //gld_PolygonMode;
- ctx->Driver.PolygonOffset = NULL; //gld_PolygonOffset;
- ctx->Driver.PolygonStipple = NULL; //gld_PolygonStipple;
- ctx->Driver.RenderMode = NULL; //gld_RenderMode;
- ctx->Driver.Scissor = NULL; //gld_Scissor;
- ctx->Driver.ShadeModel = NULL; //gld_ShadeModel;
- ctx->Driver.StencilFunc = NULL; //gld_StencilFunc;
- ctx->Driver.StencilMask = NULL; //gld_StencilMask;
- ctx->Driver.StencilOp = NULL; //gld_StencilOp;
- ctx->Driver.TexGen = NULL; //gld_TexGen;
- ctx->Driver.TexEnv = NULL;
- ctx->Driver.TexParameter = NULL;
- ctx->Driver.TextureMatrix = NULL; //gld_TextureMatrix;
- ctx->Driver.Viewport = gld_Viewport_DX8;
-
- _swsetup_Wakeup(ctx);
-
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- tnl->Driver.Render.ResetLineStipple = gld_ResetLineStipple_DX8;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
-
- // Hook into glFrustum() and glOrtho()
-// ctx->Exec->Frustum = gldFrustumHook_DX8;
-// ctx->Exec->Ortho = gldOrthoHook_DX8;
-
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h b/src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h
deleted file mode 100644
index 7efec7cae80..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 8.0 header file
-*
-****************************************************************************/
-
-#ifndef _GLD_DX8_H
-#define _GLD_DX8_H
-
-//---------------------------------------------------------------------------
-// Windows includes
-//---------------------------------------------------------------------------
-
-//#ifndef STRICT
-//#define STRICT
-//#endif
-
-//#define WIN32_LEAN_AND_MEAN
-//#include <windows.h>
-#include <d3d8.h>
-#include <d3dx8.h>
-
-// MS screwed up with the DX8.1 SDK - there's no compile-time
-// method of compiling for 8.0 via the 8.1 SDK unless you
-// "make sure you don't use any 8.1 interfaces".
-// We CAN use 8.1 D3DX static functions, though - just not new 8.1 interfaces.
-//
-// D3D_SDK_VERSION is 120 for 8.0 (supported by Windows 95).
-// D3D_SDK_VERSION is 220 for 8.1 (NOT supported by Windows 95).
-//
-#define D3D_SDK_VERSION_DX8_SUPPORT_WIN95 120
-
-// Typedef for obtaining function from d3d8.dll
-typedef IDirect3D8* (WINAPI *FNDIRECT3DCREATE8) (UINT);
-
-
-//---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-
-#ifdef _DEBUG
-#define _GLD_TEST_HRESULT(h) \
-{ \
- HRESULT _hr = (h); \
- if (FAILED(_hr)) { \
- gldLogError(GLDLOG_ERROR, #h, _hr); \
- } \
-}
-#define _GLD_DX8(func) _GLD_TEST_HRESULT(IDirect3D8_##func##)
-#define _GLD_DX8_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice8_##func##)
-#define _GLD_DX8_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer8_##func##)
-#define _GLD_DX8_TEX(func) _GLD_TEST_HRESULT(IDirect3DTexture8_##func##)
-#else
-#define _GLD_DX8(func) IDirect3D8_##func
-#define _GLD_DX8_DEV(func) IDirect3DDevice8_##func
-#define _GLD_DX8_VB(func) IDirect3DVertexBuffer8_##func
-#define _GLD_DX8_TEX(func) IDirect3DTexture8_##func
-#endif
-
-#define SAFE_RELEASE(p) \
-{ \
- if (p) { \
- (p)->lpVtbl->Release(p); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_VB8(p) \
-{ \
- if (p) { \
- IDirect3DVertexBuffer8_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_SURFACE8(p) \
-{ \
- if (p) { \
- IDirect3DSurface8_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-// Setup index.
-enum {
- GLD_SI_FLAT = 0,
- GLD_SI_SMOOTH = 1,
- GLD_SI_FLAT_EXTRAS = 2,
- GLD_SI_SMOOTH_EXTRAS = 3,
-};
-/*
-// Internal pipeline
-typedef enum {
- GLD_PIPELINE_MESA = 0, // Mesa pipeline
- GLD_PIPELINE_D3D_FVF = 1, // Direct3D Fixed-function pipeline
- GLD_PIPELINE_D3D_VS_TWOSIDE = 2 // Direct3D two-sided-lighting vertex shader
-} GLD_tnl_pipeline;
-*/
-//---------------------------------------------------------------------------
-// Vertex definitions for Fixed-Function pipeline
-//---------------------------------------------------------------------------
-
-//
-// NOTE: If the number of texture units is altered then most of
-// the texture code will need to be revised.
-//
-
-#define GLD_MAX_TEXTURE_UNITS_DX8 2
-
-//
-// 2D vertex transformed by Mesa
-//
-#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \
- D3DFVF_DIFFUSE | \
- D3DFVF_SPECULAR | \
- D3DFVF_TEX2)
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT sz; // Screen Z (depth)
- FLOAT rhw; // Reciprocal homogenous W
- DWORD diffuse; // Diffuse colour
- DWORD specular; // For separate-specular support
- FLOAT t0_u, t0_v; // 1st set of texture coords
- FLOAT t1_u, t1_v; // 2nd set of texture coords
-} GLD_2D_VERTEX;
-
-
-//
-// 3D vertex transformed by Direct3D
-//
-#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \
- D3DFVF_DIFFUSE | \
- D3DFVF_TEX2)
-
-typedef struct {
- D3DXVECTOR3 Position; // XYZ Vector in object space
- D3DCOLOR Diffuse; // Diffuse colour
- D3DXVECTOR2 TexUnit0; // Texture unit 0
- D3DXVECTOR2 TexUnit1; // Texture unit 1
-} GLD_3D_VERTEX;
-
-//---------------------------------------------------------------------------
-// Vertex Shaders
-//---------------------------------------------------------------------------
-/*
-// DX8 Vertex Shader
-typedef struct {
- DWORD hShader; // If NULL, shader is invalid and cannot be used
- BOOL bHardware; // If TRUE then shader was created for hardware,
- // otherwise shader was created for software.
-} GLD_vertexShader;
-*/
-//---------------------------------------------------------------------------
-// Structs
-//---------------------------------------------------------------------------
-
-// This keeps a count of how many times we choose each individual internal
-// pathway. Useful for seeing if a certain pathway was ever used by an app, and
-// how much each pathway is biased.
-// Zero the members at context creation and dump stats at context deletion.
-typedef struct {
- // Note: DWORD is probably too small
- ULARGE_INTEGER qwMesa; // Mesa TnL pipeline
- ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline
-// ULARGE_INTEGER dwD3D2SVS; // Direct3D Two-Sided Vertex Shader pipeline
-} GLD_pipeline_usage;
-
-// GLDirect Primitive Buffer (points, lines, triangles and quads)
-typedef struct {
- // Data for IDirect3DDevice8::CreateVertexBuffer()
- DWORD dwStride; // Stride of vertex
- DWORD dwUsage; // Usage flags
- DWORD dwFVF; // Direct3D Flexible Vertex Format
- DWORD dwPool; // Pool flags
-
- IDirect3DVertexBuffer8 *pVB; // Holds points, lines, tris and quads.
-
- // Point list is assumed to be at start of buffer
- DWORD iFirstLine; // Index of start of line list
- DWORD iFirstTriangle; // Index of start of triangle list
-
- BYTE *pPoints; // Pointer to next free point
- BYTE *pLines; // Pointer to next free line
- BYTE *pTriangles; // Pointer to next free triangle
-
- DWORD nPoints; // Number of points ready to render
- DWORD nLines; // Number of lines ready to render
- DWORD nTriangles; // Number of triangles ready to render
-} GLD_pb_dx8;
-
-// GLDirect DX8 driver data
-typedef struct {
- // GLDirect vars
- BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered)
- BOOL bDepthStencil; // Depth buffer needed (stencil optional)
- D3DFORMAT RenderFormat; // Format of back/front buffer
- D3DFORMAT DepthFormat; // Format of depth/stencil
-// float fFlipWindowY; // Value for flipping viewport Y coord
-
- // Direct3D vars
- D3DCAPS8 d3dCaps8;
- BOOL bHasHWTnL; // Device has Hardware Transform/Light?
- IDirect3D8 *pD3D; // Base Direct3D8 interface
- IDirect3DDevice8 *pDev; // Direct3D8 Device interface
- GLD_pb_dx8 PB2d; // Vertices transformed by Mesa
- GLD_pb_dx8 PB3d; // Vertices transformed by Direct3D
- D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type
- D3DXMATRIX matProjection; // Projection matrix for D3D TnL
- D3DXMATRIX matModelView; // Model/View matrix for D3D TnL
- int iSetupFunc; // Which setup functions to use
- BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL
-
- // Direct3D vars for two-sided lighting
-// GLD_vertexShader VStwosidelight; // Vertex Shader for two-sided lighting
-// D3DXMATRIX matWorldViewProj;// World/View/Projection matrix for shaders
-
-
-// GLD_tnl_pipeline TnLPipeline; // Index of current internal pipeline
- GLD_pipeline_usage PipelineUsage;
-} GLD_driver_dx8;
-
-#define GLD_GET_DX8_DRIVER(c) (GLD_driver_dx8*)(c)->glPriv
-
-//---------------------------------------------------------------------------
-// Function prototypes
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX8(LPCSTR a);
-void gldEnableExtensions_DX8(GLcontext *ctx);
-void gldInstallPipeline_DX8(GLcontext *ctx);
-void gldSetupDriverPointers_DX8(GLcontext *ctx);
-//void gldResizeBuffers_DX8(GLcontext *ctx);
-void gldResizeBuffers_DX8(GLframebuffer *fb);
-
-
-// Texture functions
-
-void gldCopyTexImage1D_DX8(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-void gldCopyTexImage2D_DX8(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void gldCopyTexSubImage1D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
-void gldCopyTexSubImage2D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-void gldCopyTexSubImage3D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-
-void gld_NEW_TEXTURE_DX8(GLcontext *ctx);
-void gld_DrawPixels_DX8(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels);
-void gld_ReadPixels_DX8(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest);
-void gld_CopyPixels_DX8(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type);
-void gld_Bitmap_DX8(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
-const struct gl_texture_format* gld_ChooseTextureFormat_DX8(GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType);
-void gld_TexImage2D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *tObj, struct gl_texture_image *texImage);
-void gld_TexImage1D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage2D_DX8( GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage1D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage);
-void gld_DeleteTexture_DX8(GLcontext *ctx, struct gl_texture_object *tObj);
-void gld_ResetLineStipple_DX8(GLcontext *ctx);
-
-// 2D primitive functions
-
-void gld_Points2D_DX8(GLcontext *ctx, GLuint first, GLuint last);
-
-void gld_Line2DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1);
-
-void gld_Triangle2DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DFlatExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-
-void gld_Quad2DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DFlatExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// 3D primitive functions
-
-void gld_Points3D_DX8(GLcontext *ctx, GLuint first, GLuint last);
-void gld_Line3DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Line3DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// Primitive functions for Two-sided-lighting Vertex Shader
-
-void gld_Points2DTwoside_DX8(GLcontext *ctx, GLuint first, GLuint last);
-void gld_Line2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-#endif
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h b/src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h
deleted file mode 100644
index f8e92b936e8..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*==========================================================================;
- *
- *
- * File: dxerr8.h
- * Content: DirectX Error Library Include File
- *
- ****************************************************************************/
-
-#ifndef _GLD_DXERR8_H_
-#define _GLD_DXERR8_H_
-
-
-#include <d3d8.h>
-
-//
-// DXGetErrorString8
-//
-// Desc: Converts an DirectX HRESULT to a string
-//
-// Args: HRESULT hr Can be any error code from
-// DPLAY D3D8 D3DX8 DMUSIC DSOUND
-//
-// Return: Converted string
-//
-const char* __stdcall DXGetErrorString8A(HRESULT hr);
-const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr);
-
-#ifdef UNICODE
- #define DXGetErrorString8 DXGetErrorString8W
-#else
- #define DXGetErrorString8 DXGetErrorString8A
-#endif
-
-
-//
-// DXTrace
-//
-// Desc: Outputs a formatted error message to the debug stream
-//
-// Args: CHAR* strFile The current file, typically passed in using the
-// __FILE__ macro.
-// DWORD dwLine The current line number, typically passed in using the
-// __LINE__ macro.
-// HRESULT hr An HRESULT that will be traced to the debug stream.
-// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
-// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
-//
-// Return: The hr that was passed in.
-//
-//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
-//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
-HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
-HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
-
-#ifdef UNICODE
- #define DXTrace DXTraceW
-#else
- #define DXTrace DXTraceA
-#endif
-
-
-//
-// Helper macros
-//
-#if defined(DEBUG) | defined(_DEBUG)
- #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
- #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
- #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
-#else
- #define DXTRACE_MSG(str) (0L)
- #define DXTRACE_ERR(str,hr) (hr)
- #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
-#endif
-
-
-#endif
-
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c
deleted file mode 100644
index 108f12a9d16..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GL extensions
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "../gld_settings.h"
-
-#include <windows.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-//#include "ddlog.h"
-//#include "gld_dx8.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "dglcontext.h"
-#include "extensions.h"
-
-// For some reason this is not defined in an above header...
-extern void _mesa_enable_imaging_extensions(GLcontext *ctx);
-
-//---------------------------------------------------------------------------
-// Hack for the SGIS_multitexture extension that was removed from Mesa
-// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel
-
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // To enable, uncomment:
- // _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
-//---------------------------------------------------------------------------
-
-enum {
- /* Quake2 GL_SGIS_multitexture */
- GL_SELECTED_TEXTURE_SGIS = 0x835B,
- GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C,
- GL_MAX_TEXTURES_SGIS = 0x835D,
- GL_TEXTURE0_SGIS = 0x835E,
- GL_TEXTURE1_SGIS = 0x835F,
- GL_TEXTURE2_SGIS = 0x8360,
- GL_TEXTURE3_SGIS = 0x8361,
- GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363,
-};
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldSelectTextureSGIS(
- GLenum target)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glActiveTextureARB(ARB_target);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fSGIS(
- GLenum target,
- GLfloat s,
- GLfloat t)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fARB(ARB_target, s, t);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fvSGIS(
- GLenum target,
- const GLfloat *v)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fvARB(ARB_target, v);
-}
-
-//---------------------------------------------------------------------------
-// Extensions
-//---------------------------------------------------------------------------
-
-typedef struct {
- PROC proc;
- char *name;
-} GLD_extension;
-
-GLD_extension GLD_extList[] = {
-#ifdef GL_EXT_polygon_offset
- { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
-#endif
- { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
- { (PROC)glBlendColorEXT, "glBlendColorExt" },
- { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
- { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
- { (PROC)glColorPointerEXT, "glColorPointerEXT" },
- { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
- { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
- { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
- { (PROC)glGetPointervEXT, "glGetPointervEXT" },
- { (PROC)glArrayElementEXT, "glArrayElementEXT" },
- { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
- { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
- { (PROC)glBindTextureEXT, "glBindTextureEXT" },
- { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
- { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
- { (PROC)glIsTextureEXT, "glIsTextureEXT" },
- { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
- { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
- { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
- { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
- { (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
- { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
-
- { (PROC)glLockArraysEXT, "glLockArraysEXT" },
- { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
- { NULL, "\0" }
-};
-
-GLD_extension GLD_multitexList[] = {
-/*
- { (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" },
- { (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" },
- { (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" },
- { (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" },
- { (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" },
- { (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" },
- { (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" },
- { (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" },
- { (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" },
- { (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" },
- { (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
- { (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" },
- { (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" },
- { (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" },
- { (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" },
- { (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" },
- { (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" },
- { (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" },
- { (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" },
- { (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" },
- { (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" },
- { (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" },
- { (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" },
- { (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" },
- { (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" },
- { (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" },
- { (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" },
- { (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" },
- { (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" },
- { (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" },
- { (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" },
- { (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" },
- { (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" },
-*/
- { (PROC)glActiveTextureARB, "glActiveTextureARB" },
- { (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" },
- { (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" },
- { (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" },
- { (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" },
- { (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" },
- { (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" },
- { (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" },
- { (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" },
- { (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" },
- { (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" },
- { (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" },
- { (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" },
- { (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" },
- { (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" },
- { (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" },
- { (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" },
- { (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" },
- { (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" },
- { (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" },
- { (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" },
- { (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" },
- { (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" },
- { (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" },
- { (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" },
- { (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" },
- { (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" },
- { (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" },
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" },
- { (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" },
- { (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" },
- { (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" },
- { (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" },
- { (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" },
-
- // Descent3 doesn't use correct string, hence this hack
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" },
-
- // Quake2 SGIS multitexture
- { (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
-
- { NULL, "\0" }
-};
-
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX(
- LPCSTR a)
-{
- int i;
- PROC proc = NULL;
-
- for (i=0; GLD_extList[i].proc; i++) {
- if (!strcmp(a, GLD_extList[i].name)) {
- proc = GLD_extList[i].proc;
- break;
- }
- }
-
- if (glb.bMultitexture) {
- for (i=0; GLD_multitexList[i].proc; i++) {
- if (!strcmp(a, GLD_multitexList[i].name)) {
- proc = GLD_multitexList[i].proc;
- break;
- }
- }
- }
-
- gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
-
- return proc;
-}
-
-//---------------------------------------------------------------------------
-
-void gldEnableExtensions_DX8(
- GLcontext *ctx)
-{
- GLuint i;
-
- // Mesa enables some extensions by default.
- // This table decides which ones we want to switch off again.
-
- // NOTE: GL_EXT_compiled_vertex_array appears broken.
-
- const char *gld_disable_extensions[] = {
-// "GL_ARB_transpose_matrix",
-// "GL_EXT_compiled_vertex_array",
-// "GL_EXT_polygon_offset",
-// "GL_EXT_rescale_normal",
- "GL_EXT_texture3D",
-// "GL_NV_texgen_reflection",
- NULL
- };
-
- const char *gld_multitex_extensions[] = {
- "GL_ARB_multitexture", // Quake 3
- NULL
- };
-
- // Quake 2 engines
- const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture";
-
- const char *gld_enable_extensions[] = {
- "GL_EXT_texture_env_add", // Quake 3
- "GL_ARB_texture_env_add", // Quake 3
- NULL
- };
-
- for (i=0; gld_disable_extensions[i]; i++) {
- _mesa_disable_extension(ctx, gld_disable_extensions[i]);
- }
-
- for (i=0; gld_enable_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_enable_extensions[i]);
- }
-
- if (glb.bMultitexture) {
- for (i=0; gld_multitex_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_multitex_extensions[i]);
- }
-
- // GL_SGIS_multitexture
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // Fair bit slower on GeForce256,
- // Much slower on 3dfx Voodoo5 5500.
-// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
- }
-
- _mesa_enable_imaging_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
- _mesa_enable_1_4_extensions(ctx);
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c
deleted file mode 100644
index 2baea57443c..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Mesa transformation pipeline with GLDirect fastpath
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx8.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-
-extern struct tnl_pipeline_stage _gld_d3d_render_stage;
-extern struct tnl_pipeline_stage _gld_mesa_render_stage;
-
-static const struct tnl_pipeline_stage *gld_pipeline[] = {
- &_gld_d3d_render_stage, // Direct3D TnL
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
- &_gld_mesa_render_stage, // Mesa TnL, D3D rendering
- 0,
-};
-
-//---------------------------------------------------------------------------
-
-void gldInstallPipeline_DX8(
- GLcontext *ctx)
-{
- // Remove any existing pipeline stages,
- // then install GLDirect pipeline stages.
-
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, gld_pipeline);
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c
deleted file mode 100644
index 700b5200862..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c
+++ /dev/null
@@ -1,1446 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Primitive (points/lines/tris/quads) rendering
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx8.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "swrast/s_context.h"
-#include "swrast/s_depth.h"
-#include "swrast/s_lines.h"
-#include "swrast/s_triangle.h"
-#include "swrast/s_trispan.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-// Disable compiler complaints about unreferenced local variables
-#pragma warning (disable:4101)
-
-//---------------------------------------------------------------------------
-// Helper defines for primitives
-//---------------------------------------------------------------------------
-
-//static const float ooZ = 1.0f / 65536.0f; // One over Z
-
-#define GLD_COLOUR (D3DCOLOR_RGBA(swv->color[0], swv->color[1], swv->color[2], swv->color[3]))
-#define GLD_SPECULAR (D3DCOLOR_RGBA(swv->specular[0], swv->specular[1], swv->specular[2], swv->specular[3]))
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-//---------------------------------------------------------------------------
-// 2D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_2D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pPoints; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pLines; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_TRIANGLES \
- BOOL bFog = ctx->Fog.Enabled; \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pTriangles; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour; \
- GLuint facing = 0; \
- struct vertex_buffer *VB; \
- GLchan (*vbcolor)[4]; \
- GLchan (*vbspec)[4]
-
-#define GLD_SETUP_GET_SWVERT(s) \
- swv = &ss->verts[##s]
-
-#define GLD_SETUP_2D_VERTEX \
- pV->x = swv->win[0]; \
- pV->y = GLD_FLIP_Y(swv->win[1]); \
- pV->rhw = swv->win[3]
-
-#define GLD_SETUP_SMOOTH_COLOUR \
- pV->diffuse = GLD_COLOUR
-
-#define GLD_SETUP_GET_FLAT_COLOUR \
- dwFlatColour = GLD_COLOUR
-#define GLD_SETUP_GET_FLAT_FOG_COLOUR \
- dwFlatColour = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_USE_FLAT_COLOUR \
- pV->diffuse = dwFlatColour
-
-#define GLD_SETUP_GET_FLAT_SPECULAR \
- dwSpecularColour= GLD_SPECULAR
-
-#define GLD_SETUP_USE_FLAT_SPECULAR \
- pV->specular = dwSpecularColour
-
-#define GLD_SETUP_DEPTH \
- pV->sz = swv->win[2] / ctx->DepthMaxF
-// pV->z = swv->win[2] * ooZ;
-
-#define GLD_SETUP_SPECULAR \
- pV->specular = GLD_SPECULAR
-
-#define GLD_SETUP_FOG \
- pV->diffuse = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_TEX0 \
- pV->t0_u = swv->texcoord[0][0]; \
- pV->t0_v = swv->texcoord[0][1]
-
-#define GLD_SETUP_TEX1 \
- pV->t1_u = swv->texcoord[1][0]; \
- pV->t1_v = swv->texcoord[1][1]
-
-#define GLD_SETUP_LIGHTING(v) \
- if (facing == 1) { \
- pV->diffuse = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- pV->specular = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- } else { \
- if (bFog) \
- GLD_SETUP_FOG; \
- else \
- GLD_SETUP_SMOOTH_COLOUR; \
- GLD_SETUP_SPECULAR; \
- }
-
-#define GLD_SETUP_GET_FLAT_LIGHTING(v) \
- if (facing == 1) { \
- dwFlatColour = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- dwSpecularColour = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- }
-
-#define GLD_SETUP_TWOSIDED_LIGHTING \
- /* Two-sided lighting */ \
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { \
- SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; \
- SWvertex *v[3]; \
- GLfloat ex,ey,fx,fy,cc; \
- /* Get vars for later */ \
- VB = &TNL_CONTEXT(ctx)->vb; \
- vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \
- if (VB->SecondaryColorPtr[1]) { \
- vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
- } else { \
- vbspec = NULL; \
- } \
- v[0] = &verts[v0]; \
- v[1] = &verts[v1]; \
- v[2] = &verts[v2]; \
- ex = v[0]->win[0] - v[2]->win[0]; \
- ey = v[0]->win[1] - v[2]->win[1]; \
- fx = v[1]->win[0] - v[2]->win[0]; \
- fy = v[1]->win[1] - v[2]->win[1]; \
- cc = ex*fy - ey*fx; \
- facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; \
- }
-
-//---------------------------------------------------------------------------
-// 3D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_3D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pPoints; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pLines; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_TRIANGLES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pTriangles; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VERTEX(v) \
- p4f = VB->ObjPtr->data; \
- pV->Position.x = p4f[##v][0]; \
- pV->Position.y = p4f[##v][1]; \
- pV->Position.z = p4f[##v][2];
-
-#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
- pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-
-#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
- dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-#define GLD_SETUP_USE_FLAT_COLOUR_3D \
- pV->Diffuse = dwColor;
-
-#define GLD_SETUP_TEX0_3D(v) \
- if (VB->TexCoordPtr[0]) { \
- tc = VB->TexCoordPtr[0]->data; \
- pV->TexUnit0.x = tc[##v][0]; \
- pV->TexUnit0.y = tc[##v][1]; \
- }
-
-#define GLD_SETUP_TEX1_3D(v) \
- if (VB->TexCoordPtr[1]) { \
- tc = VB->TexCoordPtr[1]->data; \
- pV->TexUnit1.x = tc[##v][0]; \
- pV->TexUnit1.y = tc[##v][1]; \
- }
-
-//---------------------------------------------------------------------------
-// Helper functions
-//---------------------------------------------------------------------------
-
-__inline DWORD _gldComputeFog(
- GLcontext *ctx,
- SWvertex *swv)
-{
- // Full fog calculation.
- // Based on Mesa code.
-
- GLchan rFog, gFog, bFog;
- GLchan fR, fG, fB;
- const GLfloat f = swv->fog;
- const GLfloat g = 1.0f - f;
-
- UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]);
- fR = f * swv->color[0] + g * rFog;
- fG = f * swv->color[1] + g * gFog;
- fB = f * swv->color[2] + g * bFog;
- return D3DCOLOR_RGBA(fR, fG, fB, swv->color[3]);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ResetLineStipple_DX8(
- GLcontext *ctx)
-{
- // TODO: Fake stipple with a 32x32 texture.
-}
-
-//---------------------------------------------------------------------------
-// 2D (post-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points2D_DX8(
- GLcontext *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_2D_VARS_POINTS;
-
- unsigned i;
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
- GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- } else {
- GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, swv++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- }
-
- gld->PB2d.pPoints = (BYTE*)pV;
- gld->PB2d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlat_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmooth_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlat_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmooth_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
-
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatExtras_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v2);
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v2);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothExtras_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlat_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmooth_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatExtras_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v3);
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v3);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothExtras_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v3);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// 3D (pre-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points3D_DX8(
- GLcontext *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_3D_VARS_POINTS
-
- unsigned i;
-// struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
-// GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_3D_VERTEX(VB->Elts[i])
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- } else {
-// GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- }
-/*
- for (i=first; i<last; i++, pV++) {
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
-*/
- gld->PB3d.pPoints = (BYTE*)pV;
- gld->PB3d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-// Line functions
-//---------------------------------------------------------------------------
-
-void gld_Line3DFlat_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line3DSmooth_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-// Triangle functions
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DFlat_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DSmooth_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-// Quad functions
-//---------------------------------------------------------------------------
-
-void gld_Quad3DFlat_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad3DSmooth_DX8(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_SMOOTH_COLOUR_3D(v3)
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// Vertex setup for two-sided-lighting vertex shader
-//---------------------------------------------------------------------------
-
-/*
-
-void gld_Points2DTwoside_DX8(GLcontext *ctx, GLuint first, GLuint last)
-{
- // NOTE: Two-sided lighting does not apply to Points
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-*/
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c
deleted file mode 100644
index f24b3cfb74d..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c
+++ /dev/null
@@ -1,2046 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Texture / Bitmap functions
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx8.h"
-
-#include <d3dx8tex.h>
-
-#include "texformat.h"
-#include "colormac.h"
-#include "texstore.h"
-#include "image.h"
-// #include "mem.h"
-
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_HEIGHT(y,h) (gldCtx->dwHeight - (y) - (h))
-
-//---------------------------------------------------------------------------
-// 1D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + (i) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (i) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (i))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (i))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 2D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + ((t)->Width * (j) + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 3D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz)
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// Direct3D texture formats that have no Mesa equivalent
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format _gld_texformat_X8R8G8B8 = {
- MESA_FORMAT_ARGB8888, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 8, /* RedBits */
- 8, /* GreenBits */
- 8, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 4, /* TexelBytes */
- _mesa_texstore_argb8888, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X8R8G8B8, /* FetchTexel1D */
- gld_fetch_2d_texel_X8R8G8B8, /* FetchTexel2D */
- gld_fetch_3d_texel_X8R8G8B8, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X8R8G8B8, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X8R8G8B8, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X8R8G8B8, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X1R5G5B5 = {
- MESA_FORMAT_ARGB1555, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 5, /* RedBits */
- 5, /* GreenBits */
- 5, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb1555, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X1R5G5B5, /* FetchTexel1D */
- gld_fetch_2d_texel_X1R5G5B5, /* FetchTexel2D */
- gld_fetch_3d_texel_X1R5G5B5, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X1R5G5B5, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X1R5G5B5, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X1R5G5B5, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X4R4G4B4 = {
- MESA_FORMAT_ARGB4444, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 4, /* RedBits */
- 4, /* GreenBits */
- 4, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb4444, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X4R4G4B4, /* FetchTexel1D */
- gld_fetch_2d_texel_X4R4G4B4, /* FetchTexel2D */
- gld_fetch_3d_texel_X4R4G4B4, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X4R4G4B4, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X4R4G4B4, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X4R4G4B4, /* FetchTexel3Df */
-};
-
-//---------------------------------------------------------------------------
-// Texture unit constants
-//---------------------------------------------------------------------------
-
-// List of possible combinations of texture environments.
-// Example: GLD_TEXENV_MODULATE_RGBA means
-// GL_MODULATE, GL_RGBA base internal format.
-#define GLD_TEXENV_DECAL_RGB 0
-#define GLD_TEXENV_DECAL_RGBA 1
-#define GLD_TEXENV_DECAL_ALPHA 2
-#define GLD_TEXENV_REPLACE_RGB 3
-#define GLD_TEXENV_REPLACE_RGBA 4
-#define GLD_TEXENV_REPLACE_ALPHA 5
-#define GLD_TEXENV_MODULATE_RGB 6
-#define GLD_TEXENV_MODULATE_RGBA 7
-#define GLD_TEXENV_MODULATE_ALPHA 8
-#define GLD_TEXENV_BLEND_RGB 9
-#define GLD_TEXENV_BLEND_RGBA 10
-#define GLD_TEXENV_BLEND_ALPHA 11
-#define GLD_TEXENV_ADD_RGB 12
-#define GLD_TEXENV_ADD_RGBA 13
-#define GLD_TEXENV_ADD_ALPHA 14
-
-// Per-stage (i.e. per-unit) texture environment
-typedef struct {
- DWORD ColorArg1; // Colour argument 1
- D3DTEXTUREOP ColorOp; // Colour operation
- DWORD ColorArg2; // Colour argument 2
- DWORD AlphaArg1; // Alpha argument 1
- D3DTEXTUREOP AlphaOp; // Alpha operation
- DWORD AlphaArg2; // Alpha argument 2
-} GLD_texenv;
-
-// TODO: Do we really need to set ARG1 and ARG2 every time?
-// They seem to always be TEXTURE and CURRENT respectively.
-
-// C = Colour out
-// A = Alpha out
-// Ct = Colour from Texture
-// Cf = Colour from fragment (diffuse)
-// At = Alpha from Texture
-// Af = Alpha from fragment (diffuse)
-// Cc = GL_TEXTURE_ENV_COLOUR (GL_BLEND)
-const GLD_texenv gldTexEnv[] = {
- // DECAL_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_RGBA: C=Cf(1-At)+CtAt, A=Af
- {D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_ALPHA: <undefined> use DECAL_RGB
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
-
- // REPLACE_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // REPLACE_RGBA: C=Ct, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
- // REPLACE_ALPHA: C=Cf, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
-
- // MODULATE_RGB: C=CfCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // MODULATE_RGBA: C=CfCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // MODULATE_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // BLEND_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- // ADD_RGB: C=Cf+Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // ADD_RGBA: C=Cf+Ct, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // ADD_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-};
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREADDRESS _gldConvertWrap(
- GLenum wrap)
-{
- return (wrap == GL_CLAMP) ? D3DTADDRESS_CLAMP : D3DTADDRESS_WRAP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREFILTERTYPE _gldConvertMagFilter(
- GLenum magfilter)
-{
- return (magfilter == GL_LINEAR) ? D3DTEXF_LINEAR : D3DTEXF_POINT;
-}
-
-//---------------------------------------------------------------------------
-
-void _gldConvertMinFilter(
- GLenum minfilter,
- D3DTEXTUREFILTERTYPE *min_filter,
- D3DTEXTUREFILTERTYPE *mip_filter)
-{
- switch (minfilter) {
- case GL_NEAREST:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_NONE;
- break;
- case GL_LINEAR:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_POINT;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_POINT;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_LINEAR;
- break;
- }
-}
-
-//---------------------------------------------------------------------------
-
-D3DFORMAT _gldGLFormatToD3DFormat(
- GLenum internalFormat)
-{
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- // LUNIMANCE != INTENSITY, but D3D doesn't have I8 textures
- return D3DFMT_L8;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return D3DFMT_L8;
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return D3DFMT_A8;
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return D3DFMT_X8R8G8B8;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return D3DFMT_A8L8;
- case GL_R3_G3_B2:
- // TODO: Mesa does not support RGB332 internally
- return D3DFMT_X4R4G4B4; //D3DFMT_R3G3B2;
- case GL_RGB4:
- return D3DFMT_X4R4G4B4;
- case GL_RGB5:
- return D3DFMT_X1R5G5B5;
- case 3:
- case GL_RGB:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return D3DFMT_R8G8B8;
- case GL_RGBA4:
- return D3DFMT_A4R4G4B4;
- case 4:
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return D3DFMT_A8R8G8B8;
- case GL_RGB5_A1:
- return D3DFMT_A1R5G5B5;
- }
-
- // Return an acceptable default
- return D3DFMT_A8R8G8B8;
-}
-
-//---------------------------------------------------------------------------
-
-GLenum _gldDecodeBaseFormat(
- IDirect3DTexture8 *pTex)
-{
- // Examine Direct3D texture and return base OpenGL internal texture format
- // NOTE: We can't use any base format info from Mesa because D3D might have
- // used a different texture format when we used D3DXCreateTexture().
-
- // Base internal format is one of (Red Book p355):
- // GL_ALPHA,
- // GL_LUMINANCE,
- // GL_LUMINANCE_ALPHA,
- // GL_INTENSITY,
- // GL_RGB,
- // GL_RGBA
-
- // NOTE: INTENSITY not used (not supported by Direct3D)
- // LUMINANCE has same texture functions as RGB
- // LUMINANCE_ALPHA has same texture functions as RGBA
-
- // TODO: cache format instead of using GetLevelDesc()
- D3DSURFACE_DESC desc;
- _GLD_DX8_TEX(GetLevelDesc(pTex, 0, &desc));
-
- switch (desc.Format) {
- case D3DFMT_R8G8B8:
- case D3DFMT_X8R8G8B8:
- case D3DFMT_R5G6B5:
- case D3DFMT_X1R5G5B5:
- case D3DFMT_R3G3B2:
- case D3DFMT_X4R4G4B4:
- case D3DFMT_P8:
- case D3DFMT_L8:
- return GL_RGB;
- case D3DFMT_A8R8G8B8:
- case D3DFMT_A1R5G5B5:
- case D3DFMT_A4R4G4B4:
- case D3DFMT_A8R3G3B2:
- case D3DFMT_A8P8:
- case D3DFMT_A8L8:
- case D3DFMT_A4L4:
- return GL_RGBA;
- case D3DFMT_A8:
- return GL_ALPHA;
- // Compressed texture formats. Need to check these...
- case D3DFMT_DXT1:
- return GL_RGBA;
- case D3DFMT_DXT2:
- return GL_RGB;
- case D3DFMT_DXT3:
- return GL_RGBA;
- case D3DFMT_DXT4:
- return GL_RGB;
- case D3DFMT_DXT5:
- return GL_RGBA;
- }
-
- // Fell through. Return arbitary default.
- return GL_RGBA;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* _gldMesaFormatForD3DFormat(
- D3DFORMAT d3dfmt)
-{
- switch (d3dfmt) {
- case D3DFMT_A8R8G8B8:
- return &_mesa_texformat_argb8888;
- case D3DFMT_R8G8B8:
- return &_mesa_texformat_rgb888;
- case D3DFMT_R5G6B5:
- return &_mesa_texformat_rgb565;
- case D3DFMT_A4R4G4B4:
- return &_mesa_texformat_argb4444;
- case D3DFMT_A1R5G5B5:
- return &_mesa_texformat_argb1555;
- case D3DFMT_A8L8:
- return &_mesa_texformat_al88;
- case D3DFMT_R3G3B2:
- return &_mesa_texformat_rgb332;
- case D3DFMT_A8:
- return &_mesa_texformat_a8;
- case D3DFMT_L8:
- return &_mesa_texformat_l8;
- case D3DFMT_X8R8G8B8:
- return &_gld_texformat_X8R8G8B8;
- case D3DFMT_X1R5G5B5:
- return &_gld_texformat_X1R5G5B5;
- case D3DFMT_X4R4G4B4:
- return &_gld_texformat_X4R4G4B4;
- }
-
- // If we reach here then we've made an error somewhere else
- // by allowing a format that is not supported.
- assert(0);
-
- return NULL; // Shut up compiler warning
-}
-
-//---------------------------------------------------------------------------
-// Copy* functions
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage1D_DX8(
- GLcontext *ctx,
- GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y,
- GLsizei width, GLint border )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage2D_DX8(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLenum internalFormat,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- GLint border)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage1D_DX8(
- GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage2D_DX8(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage3D_DX8(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height )
-{
- // TODO ?
-}
-
-//---------------------------------------------------------------------------
-// Bitmap/Pixel functions
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-#define _GLD_FVF_IMAGE (D3DFVF_XYZRHW | D3DFVF_TEX1)
-
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT z; // depth value
- FLOAT rhw; // reciprocal homogenous W (always 1.0f)
- FLOAT tu, tv; // texture coords
-} _GLD_IMAGE_VERTEX;
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldDrawPixels(
- GLcontext *ctx,
- BOOL bChromakey, // Alpha test for glBitmap() images
- GLint x, // GL x position
- GLint y, // GL y position (needs flipping)
- GLsizei width, // Width of input image
- GLsizei height, // Height of input image
- IDirect3DSurface8 *pImage)
-{
- //
- // Draw input image as texture implementing PixelZoom and clipping.
- // Any fragment operations currently enabled will be used.
- //
-
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- IDirect3DTexture8 *pTexture;
- D3DSURFACE_DESC d3dsd;
- IDirect3DSurface8 *pSurface;
- _GLD_IMAGE_VERTEX v[4];
- HRESULT hr;
-
- float ZoomWidth, ZoomHeight;
- float ScaleWidth, ScaleHeight;
-
- // Create a texture to hold image
- hr = D3DXCreateTexture(
- gld->pDev,
- width, height,
- 1, // miplevels
- 0, // usage
- D3DFMT_A8R8G8B8, // format
- D3DPOOL_MANAGED, // pool
- &pTexture);
- if (FAILED(hr))
- return hr;
-
- hr = IDirect3DTexture8_GetSurfaceLevel(pTexture, 0, &pSurface);
- if (FAILED(hr)) {
- IDirect3DTexture8_Release(pTexture);
- return hr;
- }
-
- // Copy image into texture
- hr = D3DXLoadSurfaceFromSurface(
- pSurface, NULL, NULL, // Dest surface
- pImage, NULL, NULL, // Src surface
- D3DX_FILTER_NONE,
- 0);
- IDirect3DSurface8_Release(pSurface);
- if (FAILED(hr)) {
- IDirect3DTexture8_Release(pTexture);
- return hr;
- }
-
- //
- // Set up the quad like this (ascii-art ahead!)
- //
- // 3--2
- // | |
- // 0--1
- //
- //
-
- // Set depth
- v[0].z = v[1].z = v[2].z = v[3].z = ctx->Current.RasterPos[2];
- // Set Reciprocal Homogenous W
- v[0].rhw = v[1].rhw = v[2].rhw = v[3].rhw = 1.0f;
-
- // Set texcoords
- // Examine texture size - if different to input width and height
- // then we'll need to munge the texcoords to fit.
- IDirect3DTexture8_GetLevelDesc(pTexture, 0, &d3dsd);
- ScaleWidth = (float)width / (float)d3dsd.Width;
- ScaleHeight = (float)height / (float)d3dsd.Height;
- v[0].tu = 0.0f; v[0].tv = 0.0f;
- v[1].tu = ScaleWidth; v[1].tv = 0.0f;
- v[2].tu = ScaleWidth; v[2].tv = ScaleHeight;
- v[3].tu = 0.0f; v[3].tv = ScaleHeight;
-
- // Set raster positions
- ZoomWidth = (float)width * ctx->Pixel.ZoomX;
- ZoomHeight = (float)height * ctx->Pixel.ZoomY;
-
- v[0].x = x; v[0].y = GLD_FLIP_Y(y);
- v[1].x = x+ZoomWidth; v[1].y = GLD_FLIP_Y(y);
- v[2].x = x+ZoomWidth; v[2].y = GLD_FLIP_Y(y+ZoomHeight);
- v[3].x = x; v[3].y = GLD_FLIP_Y(y+ZoomHeight);
-
- // Draw image with full HW acceleration
- // NOTE: Be nice to use a State Block for all this state...
- IDirect3DDevice8_SetTexture(gld->pDev, 0, pTexture);
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_MINFILTER, D3DTEXF_POINT);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_MAGFILTER, D3DTEXF_POINT);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 1, D3DTSS_COLOROP, D3DTOP_DISABLE);
- IDirect3DDevice8_SetTextureStageState(gld->pDev, 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
- IDirect3DDevice8_SetVertexShader(gld->pDev, _GLD_FVF_IMAGE);
-
- //
- // Emulate Chromakey with an Alpha Test.
- // [Alpha Test is more widely supported anyway]
- //
- if (bChromakey) {
- // Switch on alpha testing
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, TRUE);
- // Fragment passes is alpha is greater than reference value
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, D3DCMP_GREATER);
- // Set alpha reference value between Bitmap alpha values of
- // zero (transparent) and one (opaque).
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ALPHAREF, 0x7f);
- }
-
- IDirect3DDevice8_DrawPrimitiveUP(gld->pDev, D3DPT_TRIANGLEFAN, 2, &v, sizeof(_GLD_IMAGE_VERTEX));
-
- // Release texture
- IDirect3DDevice8_SetTexture(gld->pDev, 0, NULL);
- IDirect3DTexture8_Release(pTexture);
-
- // Reset state to before we messed it up
- FLUSH_VERTICES(ctx, _NEW_ALL);
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DrawPixels_DX8(
- GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- GLD_context *gldCtx;
- GLD_driver_dx8 *gld;
-
- IDirect3DSurface8 *pImage;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
-
- const struct gl_texture_format *MesaFormat;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- &pImage);
- if (FAILED(hr)) {
- return;
- }
-
- //
- // Use Mesa to fill in image
- //
-
- // Lock all of surface
- hr = IDirect3DSurface8_LockRect(pImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pImage);
- return;
- }
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
-
- // unpack image, apply transfer ops and store directly in texture
- MesaFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA,
- &_mesa_texformat_argb8888,
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, /* dstImageStride */
- format, type, pixels, unpack);
-
- IDirect3DSurface8_UnlockRect(pImage);
-
- _gldDrawPixels(ctx, FALSE, x, y, width, height, pImage);
-
- IDirect3DSurface8_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ReadPixels_DX8(
- GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest)
-{
-
- GLD_context *gldCtx;
- GLD_driver_dx8 *gld;
-
- IDirect3DSurface8 *pBackbuffer = NULL;
- IDirect3DSurface8 *pNativeImage = NULL;
- IDirect3DSurface8 *pCanonicalImage = NULL;
-
- D3DSURFACE_DESC d3dsd;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- struct gl_pixelstore_attrib srcPacking;
- int i;
- GLint DstRowStride;
- const struct gl_texture_format *MesaFormat;
-
- switch (format) {
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- return;
- }
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
- DstRowStride = _mesa_image_row_stride(pack, width, format, type);
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice8_GetBackBuffer(
- gld->pDev,
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX8_return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- &pNativeImage);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX8_return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, x, GLD_FLIP_HEIGHT(y, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels.
- //
- // This intermediate surface ensure that we can use CopyRects()
- // instead of relying on D3DXLoadSurfaceFromSurface(), which may
- // try and lock the backbuffer. This way seems safer.
- //
- hr = IDirect3DDevice8_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pNativeImage,
- &ptDst);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX8_return;
- }
-
- // Create an RGBA8888 surface
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- &pCanonicalImage);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX8_return;
- }
-
- // Convert to RGBA8888
- hr = D3DXLoadSurfaceFromSurface(
- pCanonicalImage, // Dest surface
- NULL, NULL, // Dest palette, RECT
- pNativeImage, // Src surface
- NULL, NULL, // Src palette, RECT
- D3DX_FILTER_NONE, // Filter
- 0); // Colourkey
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX8_return;
- }
-
- srcPacking.Alignment = 1;
- srcPacking.ImageHeight = height;
- srcPacking.LsbFirst = GL_FALSE;
- srcPacking.RowLength = 0;
- srcPacking.SkipImages = 0;
- srcPacking.SkipPixels = 0;
- srcPacking.SkipRows = 0;
- srcPacking.SwapBytes = GL_FALSE;
-
- // Lock all of image
- hr = IDirect3DSurface8_LockRect(pCanonicalImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX8_return;
- }
-
- // We need to flip the data. Yuck.
- // Perhaps Mesa has a span packer we can use in future...
- for (i=0; i<height; i++) {
- BYTE *pDestRow = (BYTE*)_mesa_image_address(2,pack, dest, width, height, format, type, 0, i, 0);
- BYTE *pSrcRow = (BYTE*)d3dLockedRect.pBits + (d3dLockedRect.Pitch * (height-i-1));
- MesaFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA, // base format
- MesaFormat, // dst format
- pDestRow, // dest addr
- width, 1, 1, 0, 0, 0, // src x,y,z & dst offsets x,y,z
- DstRowStride, // dst row stride
- 0, // dstImageStride
- GL_BGRA, // src format
- GL_UNSIGNED_BYTE, // src type
- pSrcRow, // src addr
- &srcPacking); // packing params of source image
- }
-
- IDirect3DSurface8_UnlockRect(pCanonicalImage);
-
-gld_ReadPixels_DX8_return:
- SAFE_RELEASE_SURFACE8(pCanonicalImage);
- SAFE_RELEASE_SURFACE8(pNativeImage);
- SAFE_RELEASE_SURFACE8(pBackbuffer);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_CopyPixels_DX8(
- GLcontext *ctx,
- GLint srcx,
- GLint srcy,
- GLsizei width,
- GLsizei height,
- GLint dstx,
- GLint dsty,
- GLenum type)
-{
- //
- // NOTE: Not allowed to copy vidmem to vidmem!
- // Therefore we use an intermediate image surface.
- //
-
- GLD_context *gldCtx;
- GLD_driver_dx8 *gld;
-
- IDirect3DSurface8 *pBackbuffer;
- D3DSURFACE_DESC d3dsd;
- IDirect3DSurface8 *pImage;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
-
- // Only backbuffer
- if (type != GL_COLOR)
- return;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice8_GetBackBuffer(
- gld->pDev,
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pBackbuffer);
- return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- &pImage);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pBackbuffer);
- return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, srcx, GLD_FLIP_HEIGHT(srcy, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels
- hr = IDirect3DDevice8_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pImage,
- &ptDst);
- IDirect3DSurface8_Release(pBackbuffer);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pImage);
- return;
- }
-
- _gldDrawPixels(ctx, FALSE, dstx, dsty, width, height, pImage);
-
- IDirect3DSurface8_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Bitmap_DX8(
- GLcontext *ctx,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap)
-{
- GLD_context *gldCtx;
- GLD_driver_dx8 *gld;
-
- IDirect3DSurface8 *pImage;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- BYTE *pTempBitmap;
- D3DCOLOR clBitmapOne, clBitmapZero;
- D3DCOLOR *pBits;
- const GLubyte *src;
- int i, j, k;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- clBitmapZero = D3DCOLOR_RGBA(0,0,0,0); // NOTE: Alpha is Zero
- clBitmapOne = D3DCOLOR_COLORVALUE(
- ctx->Current.RasterColor[0],
- ctx->Current.RasterColor[1],
- ctx->Current.RasterColor[2],
- 1.0f); // NOTE: Alpha is One
-
- hr = IDirect3DDevice8_CreateImageSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- &pImage);
- if (FAILED(hr)) {
- return;
- }
-
- // Lock all of surface
- hr = IDirect3DSurface8_LockRect(pImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pImage);
- return;
- }
-
- pTempBitmap = _mesa_unpack_bitmap(width, height, bitmap, unpack);
- if (pTempBitmap == NULL) {
- IDirect3DSurface8_Release(pImage);
- return;
- }
-
- pBits = (D3DCOLOR*)d3dLockedRect.pBits;
-
- for (i=0; i<height; i++) {
- GLubyte byte;
- pBits = (D3DCOLOR*)((BYTE*)d3dLockedRect.pBits + (i*d3dLockedRect.Pitch));
- src = (const GLubyte *) _mesa_image_address(2,
- &ctx->DefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
- 0, i, 0);
- for (j=0; j<(width>>3); j++) {
- byte = *src++;
- for (k=0; k<8; k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- // Fill remaining bits from bitmap
- if (width & 7) {
- byte = *src;
- for (k=0; k<(width & 7); k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- }
-
- FREE(pTempBitmap);
-
-/*
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- GL_BITMAP,
- &_mesa_texformat_argb8888,
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- GL_BITMAP, GL_COLOR_INDEX, bitmap, unpack);
-*/
- IDirect3DSurface8_UnlockRect(pImage);
-
- _gldDrawPixels(ctx, TRUE, x, y, width, height, pImage);
-
- IDirect3DSurface8_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-// Texture functions
-//---------------------------------------------------------------------------
-
-void _gldAllocateTexture(
- GLcontext *ctx,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- IDirect3DTexture8 *pTex;
- D3DFORMAT d3dFormat;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (pTex) {
- // Decide whether we can keep existing D3D texture
- // by examining top-level surface.
- D3DSURFACE_DESC d3dsd;
- _GLD_DX8_TEX(GetLevelDesc(pTex, 0, &d3dsd));
- // Release existing texture if not compatible
- if ((d3dsd.Width == texImage->Width) ||
- (d3dsd.Height == texImage->Height))
- {
- return; // Keep the existing texture
- }
- tObj->DriverData = NULL;
- _GLD_DX8_TEX(Release(pTex));
- }
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->IntFormat);
- D3DXCreateTexture(
- gld->pDev,
- texImage->Width,
- texImage->Height,
- // TODO: Re-evaluate mipmapping
- (glb.bUseMipmaps) ? D3DX_DEFAULT : 1,
- 0, // Usage
- d3dFormat,
- D3DPOOL_MANAGED,
- &pTex);
- tObj->DriverData = pTex;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* gld_ChooseTextureFormat_DX8(
- GLcontext *ctx,
- GLint internalFormat,
- GLenum srcFormat,
- GLenum srcType)
-{
- // [Based on mesa_choose_tex_format()]
- //
- // We will choose only texture formats that are supported
- // by Direct3D. If the hardware doesn't support a particular
- // texture format, then the D3DX texture calls that we use
- // will automatically use a HW supported format.
- //
- // The most critical aim is to reduce copying; if we can use
- // texture-image data directly then it will be a big performance assist.
- //
-
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return &_mesa_texformat_a8; // D3DFMT_A8
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_rgb565; // D3DFMT_R5G6B5
- // Mesa will convert this for us later...
- // return &_mesa_texformat_ci8; // D3DFMT_R5G6B5
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return &_mesa_texformat_al88; // D3DFMT_A8L8
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb332; // D3DFMT_R3G3B2
- case GL_RGB4:
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444; // D3DFMT_A4R4G4B4
- case 3:
- case GL_RGB:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return &_mesa_texformat_rgb565;
- case 4:
- case GL_RGBA:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return &_mesa_texformat_argb8888;
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
- default:
- _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat");
- return NULL;
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
-// Safer(?), slower version.
-void gld_TexImage2D_DX8(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- IDirect3DTexture8 *pTex;
- IDirect3DSurface8 *pSurface;
- RECT rcSrcRect;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
-
- if (!tObj || !texImage)
- return;
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture8_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface8_Release(pSurface);
- return;
- }
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- SetRect(&rcSrcRect, 0, 0, width, height);
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- NULL,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface8_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexImage2D_DX8(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- IDirect3DTexture8 *pTex;
- IDirect3DSurface8 *pSurface;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- D3DSURFACE_DESC d3dsd;
-
- if (!tObj || !texImage)
- return;
-
- // GLQUAKE FIX
- // Test for input alpha data with non-alpha internalformat
- if (((internalFormat==3) || (internalFormat==GL_RGB)) && (format==GL_RGBA)) {
- // Input format has alpha, but a non-alpha format has been requested.
- texImage->IntFormat = GL_RGBA;
- internalFormat = GL_RGBA;
- }
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture8_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- IDirect3DSurface8_GetDesc(pSurface, &d3dsd);
-
- // Lock all of surface
- hr = IDirect3DSurface8_LockRect(pSurface, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- texImage->Format,
- _gldMesaFormatForD3DFormat(d3dsd.Format),
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- IDirect3DSurface8_UnlockRect(pSurface);
- IDirect3DSurface8_Release(pSurface);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexImage1D_DX8(GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- // A 1D texture is a 2D texture with a height of zero
- gld_TexImage2D_DX8(ctx, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-/*
-void gld_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_GET_CONTEXT
- IDirect3DTexture8 *pTex;
- IDirect3DSurface8 *pSurface;
- D3DFORMAT d3dFormat;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
- RECT rcSrcRect;
- RECT rcDstRect;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= _GLD_DX8_TEX(GetLevelCount(pTex))
- return; // Level does not exist
- hr = _GLD_DX8_TEX(GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->Format);
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface8_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- // Source rectangle is whole of input image
- SetRect(&rcSrcRect, 0, 0, width, height);
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- &rcDstRect,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface8_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexSubImage2D_DX8( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- IDirect3DTexture8 *pTex;
- IDirect3DSurface8 *pSurface;
- HRESULT hr;
- RECT rcDstRect;
- D3DLOCKED_RECT d3dLockedRect;
- D3DSURFACE_DESC d3dsd;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture8_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- IDirect3DSurface8_GetDesc(pSurface, &d3dsd);
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- // Lock sub-rect of surface
- hr = IDirect3DSurface8_LockRect(pSurface, &d3dLockedRect, &rcDstRect, 0);
- if (FAILED(hr)) {
- IDirect3DSurface8_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- _gldMesaFormatForD3DFormat(d3dsd.Format),
- d3dLockedRect.pBits,
- width, height, 1,
- 0, 0, 0, // NOTE: d3dLockedRect.pBits is already offset!!!
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
-
- IDirect3DSurface8_UnlockRect(pSurface);
- IDirect3DSurface8_Release(pSurface);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexSubImage1D_DX8( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gld_TexSubImage2D_DX8(ctx, target, level, xoffset, 0, width, 1, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DeleteTexture_DX8(
- GLcontext *ctx,
- struct gl_texture_object *tObj)
-{
- GLD_context *gld = (GLD_context*)(ctx->DriverCtx);
-
- if (tObj) {
- IDirect3DTexture8 *pTex = (IDirect3DTexture8*)tObj->DriverData;
- if (pTex) {
-/* // Make sure texture is not bound to a stage before releasing it
- for (int i=0; i<MAX_TEXTURE_UNITS; i++) {
- if (gld->CurrentTexture[i] == pTex) {
- gld->pDev->SetTexture(i, NULL);
- gld->CurrentTexture[i] = NULL;
- }
- }*/
- _GLD_DX8_TEX(Release(pTex));
- tObj->DriverData = NULL;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetColorOps(
- const GLD_driver_dx8 *gld,
- GLuint unit,
- DWORD ColorArg1,
- D3DTEXTUREOP ColorOp,
- DWORD ColorArg2)
-{
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG1, ColorArg1));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLOROP, ColorOp));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG2, ColorArg2));
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetAlphaOps(
- const GLD_driver_dx8 *gld,
- GLuint unit,
- DWORD AlphaArg1,
- D3DTEXTUREOP AlphaOp,
- DWORD AlphaArg2)
-{
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG1, AlphaArg1));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAOP, AlphaOp));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG2, AlphaArg2));
-}
-
-//---------------------------------------------------------------------------
-
-void gldUpdateTextureUnit(
- GLcontext *ctx,
- GLuint unit,
- BOOL bPassThrough)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- D3DTEXTUREFILTERTYPE minfilter;
- D3DTEXTUREFILTERTYPE mipfilter;
- GLenum BaseFormat;
- DWORD dwColorArg0;
- int iTexEnv = 0;
- GLD_texenv *pTexenv;
-
- // NOTE: If bPassThrough is FALSE then texture stage can be
- // disabled otherwise it must pass-through it's current fragment.
-
- const struct gl_texture_unit *pUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *tObj = pUnit->_Current;
-
- IDirect3DTexture8 *pTex = NULL;
- if (tObj) {
- pTex = (IDirect3DTexture8*)tObj->DriverData;
- }
-
- // Enable texturing if unit is enabled and a valid D3D texture exists
- // Mesa 5: TEXTUREn_x altered to TEXTURE_nD_BIT
- //if (pTex && (pUnit->Enabled & (TEXTURE0_1D | TEXTURE0_2D))) {
- if (pTex && (pUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT))) {
- // Enable texturing
- _GLD_DX8_DEV(SetTexture(gld->pDev, unit, pTex));
- } else {
- // Disable texturing, then return
- _GLD_DX8_DEV(SetTexture(gld->pDev, unit, NULL));
- if (bPassThrough) {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- } else {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- }
- return;
- }
-
- // Texture parameters
- _gldConvertMinFilter(tObj->MinFilter, &minfilter, &mipfilter);
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MINFILTER, minfilter));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MIPFILTER, mipfilter));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter)));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSU, _gldConvertWrap(tObj->WrapS)));
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSV, _gldConvertWrap(tObj->WrapT)));
-
- // Texture priority
- _GLD_DX8_TEX(SetPriority(pTex, (DWORD)(tObj->Priority*65535.0f)));
-
- // Texture environment
- // TODO: Examine input texture for alpha and use specific alpha/non-alpha ops.
- // See Page 355 of the Red Book.
- BaseFormat = _gldDecodeBaseFormat(pTex);
-
- switch (BaseFormat) {
- case GL_RGB:
- iTexEnv = 0;
- break;
- case GL_RGBA:
- iTexEnv = 1;
- break;
- case GL_ALPHA:
- iTexEnv = 2;
- break;
- }
-
- switch (pUnit->EnvMode) {
- case GL_DECAL:
- iTexEnv += 0;
- break;
- case GL_REPLACE:
- iTexEnv += 3;
- break;
- case GL_MODULATE:
- iTexEnv += 6;
- break;
- case GL_BLEND:
- // Set blend colour
- dwColorArg0 = D3DCOLOR_COLORVALUE(pUnit->EnvColor[0], pUnit->EnvColor[1], pUnit->EnvColor[2], pUnit->EnvColor[3]);
- _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG0, dwColorArg0));
- iTexEnv += 9;
- break;
- case GL_ADD:
- iTexEnv += 12;
- break;
- }
- pTexenv = (GLD_texenv*)&gldTexEnv[iTexEnv];
- _gldSetColorOps(gld, unit, pTexenv->ColorArg1, pTexenv->ColorOp, pTexenv->ColorArg2);
- _gldSetAlphaOps(gld, unit, pTexenv->AlphaArg1, pTexenv->AlphaOp, pTexenv->AlphaArg2);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_TEXTURE_DX8(
- GLcontext *ctx)
-{
- // TODO: Support for three (ATI Radeon) or more (nVidia GeForce3) texture units
-
- BOOL bUnit0Enabled;
- BOOL bUnit1Enabled;
-
- if (!ctx)
- return; // Sanity check
-
- if (ctx->Const.MaxTextureUnits == 1) {
- gldUpdateTextureUnit(ctx, 0, TRUE);
- return;
- }
-
- //
- // NOTE: THE FOLLOWING RELATES TO TWO TEXTURE UNITS, AND TWO ONLY!!
- //
-
- // Mesa 5: Texture Units altered
- //bUnit0Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D)) ? TRUE : FALSE;
- //bUnit1Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE1_1D | TEXTURE1_2D)) ? TRUE : FALSE;
- bUnit0Enabled = (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
- bUnit1Enabled = (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
-
- // If Unit0 is disabled and Unit1 is enabled then we must pass-though
- gldUpdateTextureUnit(ctx, 0, (!bUnit0Enabled && bUnit1Enabled) ? TRUE : FALSE);
- // We can always disable the last texture unit
- gldUpdateTextureUnit(ctx, 1, FALSE);
-
-#ifdef _DEBUG
- {
- // Find out whether device supports current renderstates
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-// GLD_context *gld = GLD_GET_CONTEXT(ctx);
-
- DWORD dwPasses;
- _GLD_DX8_DEV(ValidateDevice(gld->pDev, &dwPasses));
-// if (FAILED(hr)) {
-// gldLogError(GLDLOG_ERROR, "ValidateDevice failed", hr);
-// }
- if (dwPasses != 1) {
- gldLogMessage(GLDLOG_ERROR, "ValidateDevice: Can't do in one pass\n");
- }
- }
-#endif
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c
deleted file mode 100644
index cafbf4f5c50..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect fastpath pipeline stage
-*
-****************************************************************************/
-
-//---------------------------------------------------------------------------
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx8.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-// #include "mem.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetVertexShaderConstants(
- GLcontext *ctx,
- GLD_driver_dx8 *gld)
-{
- D3DXMATRIX mat, matView, matProj;
- GLfloat *pM;
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ModelView.m;
- pM = ctx->ModelviewMatrixStack.Top->m;
- matView._11 = pM[0];
- matView._12 = pM[1];
- matView._13 = pM[2];
- matView._14 = pM[3];
- matView._21 = pM[4];
- matView._22 = pM[5];
- matView._23 = pM[6];
- matView._24 = pM[7];
- matView._31 = pM[8];
- matView._32 = pM[9];
- matView._33 = pM[10];
- matView._34 = pM[11];
- matView._41 = pM[12];
- matView._42 = pM[13];
- matView._43 = pM[14];
- matView._44 = pM[15];
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ProjectionMatrix.m;
- pM = ctx->ProjectionMatrixStack.Top->m;
- matProj._11 = pM[0];
- matProj._12 = pM[1];
- matProj._13 = pM[2];
- matProj._14 = pM[3];
- matProj._21 = pM[4];
- matProj._22 = pM[5];
- matProj._23 = pM[6];
- matProj._24 = pM[7];
- matProj._31 = pM[8];
- matProj._32 = pM[9];
- matProj._33 = pM[10];
- matProj._34 = pM[11];
- matProj._41 = pM[12];
- matProj._42 = pM[13];
- matProj._43 = pM[14];
- matProj._44 = pM[15];
-
- D3DXMatrixMultiply( &mat, &matView, &matProj );
- D3DXMatrixTranspose( &mat, &mat );
-
- _GLD_DX8_DEV(SetVertexShaderConstant(gld->pDev, 0, &mat, 4));
-}
-
-//---------------------------------------------------------------------------
-
-static GLboolean gld_d3d_render_stage_run(
- GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- TNLcontext *tnl;
- struct vertex_buffer *VB;
- tnl_render_func *tab;
- GLint pass;
- GLD_pb_dx8 *gldPB = &gld->PB3d;
-/*
- static int count = 0;
- count++;
- if (count != 2)
- return GL_FALSE;
-*/
- // The "check" function should disable this stage,
- // but we'll test gld->bUseMesaTnL anyway.
- if (gld->bUseMesaTnL) {
- // Do nothing in this stage, but continue pipeline
- return GL_TRUE;
- }
-
- tnl = TNL_CONTEXT(ctx);
- VB = &tnl->vb;
- pass = 0;
-
- tnl->Driver.Render.Start( ctx );
-
-#if 0
- // For debugging: Useful to see if an app passes colour data in
- // an unusual format.
- switch (VB->ColorPtr[0]->Type) {
- case GL_FLOAT:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
- break;
- case GL_UNSIGNED_BYTE:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n");
- break;
- default:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n");
- break;
- }
-#endif
-
- tnl->Driver.Render.Points = gld_Points3D_DX8;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- tnl->Driver.Render.Line = gld_Line3DFlat_DX8;
- tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX8;
- tnl->Driver.Render.Quad = gld_Quad3DFlat_DX8;
- } else {
- tnl->Driver.Render.Line = gld_Line3DSmooth_DX8;
- tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX8;
- tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX8;
- }
-
- _GLD_DX8_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
- // Allocate primitive pointers
- // gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts);
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length)
- {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
- _GLD_DX8_VB(Unlock(gldPB->pVB));
-
- _GLD_DX8_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride));
-
- _GLD_DX8_DEV(SetTransform(gld->pDev, D3DTS_PROJECTION, &gld->matProjection));
- _GLD_DX8_DEV(SetTransform(gld->pDev, D3DTS_WORLD, &gld->matModelView));
-
- if (gldPB->nPoints) {
- _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
- _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
- _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-//---------------------------------------------------------------------------
-
-const struct tnl_pipeline_stage _gld_d3d_render_stage =
-{
- "gld_d3d_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- gld_d3d_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c
deleted file mode 100644
index 414a2f64bf7..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c
+++ /dev/null
@@ -1,449 +0,0 @@
-/* $Id: gld_vb_mesa_render_dx8.c,v 1.6 2005/08/27 13:56:08 brianp 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:
- * Keith Whitwell <keithw@valinux.com>
- */
-
-
-/*
- * Render whole vertex buffers, including projection of vertices from
- * clip space and clipping of primitives.
- *
- * This file makes calls to project vertices and to the point, line
- * and triangle rasterizers via the function pointers:
- *
- * context->Driver.Render.*
- *
- */
-
-
-//---------------------------------------------------------------------------
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx8.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-// #include "mem.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-/**********************************************************************/
-/* Clip single primitives */
-/**********************************************************************/
-
-
-#if defined(USE_IEEE)
-#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
-//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
-#else
-#define NEGATIVE(x) (x < 0)
-//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
-/* Could just use (x*y<0) except for the flatshading requirements.
- * Maybe there's a better way?
- */
-#endif
-
-
-#define W(i) coord[i][3]
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 4
-#define TAG(x) x##_4
-#include "tnl/t_vb_cliptmp.h"
-
-
-
-/**********************************************************************/
-/* Clip and render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, with the possibility of clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte ormask = c1|c2; \
- if (!ormask) \
- LineFunc( ctx, v1, v2 ); \
- else if (!(c1 & c2 & 0x3f)) \
- clip_line_4( ctx, v1, v2, ormask ); \
-} while (0)
-
-#define RENDER_TRI( v1, v2, v3 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
- GLubyte ormask = c1|c2|c3; \
- if (!ormask) \
- TriangleFunc( ctx, v1, v2, v3 ); \
- else if (!(c1 & c2 & c3 & 0x3f)) \
- clip_tri_4( ctx, v1, v2, v3, ormask ); \
-} while (0)
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte c3 = mask[v3], c4 = mask[v4]; \
- GLubyte ormask = c1|c2|c3|c4; \
- if (!ormask) \
- QuadFunc( ctx, v1, v2, v3, v4 ); \
- else if (!(c1 & c2 & c3 & c4 & 0x3f)) \
- clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \
-} while (0)
-
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const GLubyte *mask = VB->ClipMask; \
- const GLuint sz = VB->ClipPtr->size; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt; (void) mask; (void) sz; (void) stipple;
-
-#define TAG(x) clip_##x##_verts
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-
-/* Elts, with the possibility of clipping.
- */
-#undef ELT
-#undef TAG
-#define ELT(x) elt[x]
-#define TAG(x) clip_##x##_elts
-#include "tnl/t_vb_rendertmp.h"
-
-/* TODO: do this for all primitives, verts and elts:
- */
-static void clip_elt_triangles( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES];
- struct vertex_buffer *VB = &tnl->vb;
- const GLuint * const elt = VB->Elts;
- GLubyte *mask = VB->ClipMask;
- GLuint last = count-2;
- GLuint j;
- (void) flags;
-
- tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES );
-
- for (j=start; j < last; j+=3 ) {
- GLubyte c1 = mask[elt[j]];
- GLubyte c2 = mask[elt[j+1]];
- GLubyte c3 = mask[elt[j+2]];
- GLubyte ormask = c1|c2|c3;
- if (ormask) {
- if (start < j)
- render_tris( ctx, start, j, 0 );
- if (!(c1&c2&c3&0x3f))
- clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
- start = j+3;
- }
- }
-
- if (start < j)
- render_tris( ctx, start, j, 0 );
-}
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, no clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
- LineFunc( ctx, v1, v2 )
-
-#define RENDER_TRI( v1, v2, v3 ) \
- TriangleFunc( ctx, v1, v2, v3 )
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
- QuadFunc( ctx, v1, v2, v3, v4 )
-
-#define TAG(x) _gld_tnl_##x##_verts
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt;
-
-#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx )
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RENDER_TAB_QUALIFIER
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-/* Elts, no clipping.
- */
-#undef ELT
-#define TAG(x) _gld_tnl_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Helper functions for drivers */
-/**********************************************************************/
-/*
-void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint *tmp = VB->Elts;
-
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
-}
-
-void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-*/
-
-
-/**********************************************************************/
-/* Clip and render whole vertex buffers */
-/**********************************************************************/
-
-tnl_points_func _gldSetupPoints[4] = {
- gld_Points2D_DX8,
- gld_Points2D_DX8,
- gld_Points2D_DX8,
- gld_Points2D_DX8
-};
-tnl_line_func _gldSetupLine[4] = {
- gld_Line2DFlat_DX8,
- gld_Line2DSmooth_DX8,
- gld_Line2DFlat_DX8,
- gld_Line2DSmooth_DX8,
-};
-tnl_triangle_func _gldSetupTriangle[4] = {
- gld_Triangle2DFlat_DX8,
- gld_Triangle2DSmooth_DX8,
- gld_Triangle2DFlatExtras_DX8,
- gld_Triangle2DSmoothExtras_DX8
-};
-tnl_quad_func _gldSetupQuad[4] = {
- gld_Quad2DFlat_DX8,
- gld_Quad2DSmooth_DX8,
- gld_Quad2DFlatExtras_DX8,
- gld_Quad2DSmoothExtras_DX8
-};
-
-//---------------------------------------------------------------------------
-
-static GLboolean _gld_mesa_render_stage_run(
- GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- tnl_render_func *tab;
- GLint pass = 0;
- GLD_pb_dx8 *gldPB;
-
- /* Allow the drivers to lock before projected verts are built so
- * that window coordinates are guarenteed not to change before
- * rendering.
- */
- ASSERT(tnl->Driver.Render.Start);
-
- tnl->Driver.Render.Start( ctx );
-
- // NOTE: Setting D3DRS_SOFTWAREVERTEXPROCESSING for a mixed-mode device resets
- // stream, indices and shader to default values of NULL or 0.
-/* if ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) &&
- gld->VStwosidelight.hShader &&
- !ctx->Fog.Enabled)
- {
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware);
- _GLD_DX8_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
- gldPB = &gld->PBtwosidelight;
- tnl->Driver.Render.Points = gld_Points2DTwoside_DX8;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- tnl->Driver.Render.Line = gld_Line2DFlatTwoside_DX8;
- tnl->Driver.Render.Triangle = gld_Triangle2DFlatTwoside_DX8;
- tnl->Driver.Render.Quad = gld_Quad2DFlatTwoside_DX8;
- } else {
- tnl->Driver.Render.Line = gld_Line2DSmoothTwoside_DX8;
- tnl->Driver.Render.Triangle = gld_Triangle2DSmoothTwoside_DX8;
- tnl->Driver.Render.Quad = gld_Quad2DSmoothTwoside_DX8;
- }
- } else {*/
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE);
- gldPB = &gld->PB2d;
- _GLD_DX8_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF));
- tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc];
- tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc];
- tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc];
- tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc];
-// }
-
- _GLD_DX8_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
- // Allocate primitive pointers
- // gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
-
- if (VB->ClipOrMask) {
- tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts;
- clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
- }
- else {
- tab = (VB->Elts ?
- tnl->Driver.Render.PrimTabElts :
- tnl->Driver.Render.PrimTabVerts);
- }
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length) {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
-
-// tnl->Driver.Render.Finish( ctx );
-
- _GLD_DX8_VB(Unlock(gldPB->pVB));
-
- _GLD_DX8_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride));
-
- if (gldPB->nPoints) {
- _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
- _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
- _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-
-
-//---------------------------------------------------------------------------
-
-const struct tnl_pipeline_stage _gld_mesa_render_stage =
-{
- "gld_mesa_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- _gld_mesa_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c
deleted file mode 100644
index 690f68b68f1..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c
+++ /dev/null
@@ -1,1335 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 8.x WGL (WindowsGL)
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "gld_driver.h"
-#include "gld_dxerr8.h"
-#include "gld_dx8.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-// Copied from dglcontect.c
-#define GLDERR_NONE 0
-#define GLDERR_MEM 1
-#define GLDERR_DDRAW 2
-#define GLDERR_D3D 3
-#define GLDERR_BPP 4
-#define GLDERR_DDS 5
-// This external var keeps track of any error
-extern int nContextError;
-
-#define DDLOG_CRITICAL_OR_WARN DDLOG_CRITICAL
-
-extern void _gld_mesa_warning(GLcontext *, char *);
-extern void _gld_mesa_fatal(GLcontext *, char *);
-
-//---------------------------------------------------------------------------
-
-static char szColorDepthWarning[] =
-"GLDirect does not support the current desktop\n\
-color depth.\n\n\
-You may need to change the display resolution to\n\
-16 bits per pixel or higher color depth using\n\
-the Windows Display Settings control panel\n\
-before running this OpenGL application.\n";
-
-// The only depth-stencil formats currently supported by Direct3D
-// Surface Format Depth Stencil Total Bits
-// D3DFMT_D32 32 - 32
-// D3DFMT_D15S1 15 1 16
-// D3DFMT_D24S8 24 8 32
-// D3DFMT_D16 16 - 16
-// D3DFMT_D24X8 24 - 32
-// D3DFMT_D24X4S4 24 4 32
-
-// This pixel format will be used as a template when compiling the list
-// of pixel formats supported by the hardware. Many fields will be
-// filled in at runtime.
-// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM
-static DGL_pixelFormat pfTemplateHW =
-{
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
- 1, // Structure version - should be 1
- // Flags:
- PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
- PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
- PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
- PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
- PFD_DOUBLEBUFFER | // The buffer is double-buffered.
- 0, // Placeholder for easy commenting of above flags
- PFD_TYPE_RGBA, // Pixel type RGBA.
- 16, // Total colour bitplanes (excluding alpha bitplanes)
- 5, 0, // Red bits, shift
- 5, 0, // Green bits, shift
- 5, 0, // Blue bits, shift
- 0, 0, // Alpha bits, shift (destination alpha)
- 0, // Accumulator bits (total)
- 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha
- 0, // Depth bits
- 0, // Stencil bits
- 0, // Number of auxiliary buffers
- 0, // Layer type
- 0, // Specifies the number of overlay and underlay planes.
- 0, // Layer mask
- 0, // Specifies the transparent color or index of an underlay plane.
- 0 // Damage mask
- },
- D3DFMT_UNKNOWN, // No depth/stencil buffer
-};
-
-//---------------------------------------------------------------------------
-// Vertex Shaders
-//---------------------------------------------------------------------------
-
-// Vertex Shader Declaration
-static DWORD dwTwoSidedLightingDecl[] =
-{
- D3DVSD_STREAM(0),
- D3DVSD_REG(0, D3DVSDT_FLOAT3), // XYZ position
- D3DVSD_REG(1, D3DVSDT_FLOAT3), // XYZ normal
- D3DVSD_REG(2, D3DVSDT_D3DCOLOR), // Diffuse color
- D3DVSD_REG(3, D3DVSDT_D3DCOLOR), // Specular color
- D3DVSD_REG(4, D3DVSDT_FLOAT2), // 2D texture unit 0
- D3DVSD_REG(5, D3DVSDT_FLOAT2), // 2D texture unit 1
- D3DVSD_END()
-};
-
-// Vertex Shader for two-sided lighting
-static char *szTwoSidedLightingVS =
-// This is a test shader!
-"vs.1.0\n"
-"m4x4 oPos,v0,c0\n"
-"mov oD0,v2\n"
-"mov oD1,v3\n"
-"mov oT0,v4\n"
-"mov oT1,v5\n"
-;
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-typedef struct {
- HINSTANCE hD3D8DLL; // Handle to d3d8.dll
- FNDIRECT3DCREATE8 fnDirect3DCreate8; // Direct3DCreate8 function prototype
- BOOL bDirect3D; // Persistant Direct3D8 exists
- BOOL bDirect3DDevice; // Persistant Direct3DDevice8 exists
- IDirect3D8 *pD3D; // Persistant Direct3D8
- IDirect3DDevice8 *pDev; // Persistant Direct3DDevice8
-} GLD_dx8_globals;
-
-// These are "global" to all DX8 contexts. KeithH
-static GLD_dx8_globals dx8Globals;
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-BOOL gldGetDXErrorString_DX(
- HRESULT hr,
- char *buf,
- int nBufSize)
-{
- //
- // Return a string describing the input HRESULT error code
- //
-
- D3DXGetErrorString(hr, buf, nBufSize);
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-static D3DMULTISAMPLE_TYPE _gldGetDeviceMultiSampleType(
- IDirect3D8 *pD3D8,
- D3DFORMAT SurfaceFormat,
- D3DDEVTYPE d3dDevType,
- BOOL Windowed)
-{
- int i;
- HRESULT hr;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_NONE)
- return D3DMULTISAMPLE_NONE;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_FASTEST) {
- // Find fastest multisample
- for (i=2; i<17; i++) {
- hr = IDirect3D8_CheckDeviceMultiSampleType(
- pD3D8,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- } else {
- // Find nicest multisample
- for (i=16; i>1; i--) {
- hr = IDirect3D8_CheckDeviceMultiSampleType(
- pD3D8,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- }
-
- // Nothing found - return default
- return D3DMULTISAMPLE_NONE;
-}
-
-//---------------------------------------------------------------------------
-
-void _gldDestroyPrimitiveBuffer(
- GLD_pb_dx8 *gldVB)
-{
- SAFE_RELEASE(gldVB->pVB);
-
- // Sanity check...
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
-}
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldCreatePrimitiveBuffer(
- GLcontext *ctx,
- GLD_driver_dx8 *lpCtx,
- GLD_pb_dx8 *gldVB)
-{
- HRESULT hResult;
- char *szCreateVertexBufferFailed = "CreateVertexBuffer failed";
- DWORD dwMaxVertices; // Max number of vertices in vertex buffer
- DWORD dwVBSize; // Total size of vertex buffer
-
- // If CVA (Compiled Vertex Array) is used by an OpenGL app, then we
- // will need enough vertices to cater for Mesa::Const.MaxArrayLockSize.
- // We'll use IMM_SIZE if it's larger (which it should not be).
- dwMaxVertices = MAX_ARRAY_LOCK_SIZE;
-
- // Now calculate how many vertices to allow for in total
- // 1 per point, 2 per line, 6 per quad = 9
- dwVBSize = dwMaxVertices * 9 * gldVB->dwStride;
-
- hResult = IDirect3DDevice8_CreateVertexBuffer(
- lpCtx->pDev,
- dwVBSize,
- gldVB->dwUsage,
- gldVB->dwFVF,
- gldVB->dwPool,
- &gldVB->pVB);
- if (FAILED(hResult)) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, szCreateVertexBufferFailed);
- return hResult;
- }
-
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
- gldVB->pPoints = gldVB->pLines = gldVB->pTriangles = NULL;
- gldVB->iFirstLine = dwMaxVertices; // Index of first line in VB
- gldVB->iFirstTriangle = dwMaxVertices*3; // Index of first triangle in VB
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-// Function: _gldCreateVertexShaders
-// Create DX8 Vertex Shaders.
-//---------------------------------------------------------------------------
-/*
-void _gldCreateVertexShaders(
- GLD_driver_dx8 *gld)
-{
- DWORD dwFlags;
- LPD3DXBUFFER pVSOpcodeBuffer; // Vertex Shader opcode buffer
- HRESULT hr;
-
-#ifdef _DEBUG
- dwFlags = D3DXASM_DEBUG;
-#else
- dwFlags = 0; // D3DXASM_SKIPVALIDATION;
-#endif
-
- ddlogMessage(DDLOG_INFO, "Creating shaders...\n");
-
- // Init the shader handle
- gld->VStwosidelight.hShader = 0;
-
- if (gld->d3dCaps8.MaxStreams == 0) {
- // Lame DX8 driver doesn't support streams
- // Not fatal, as defaults will be used
- ddlogMessage(DDLOG_WARN, "Driver doesn't support Vertex Shaders (MaxStreams==0)\n");
- return;
- }
-
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-// return;
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-
- //
- // Two-sided lighting
- //
-
-#if 0
- //
- // DEBUGGING: Load shader from a text file
- //
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- hr = D3DXAssembleShaderFromFile(
- "twoside.vsh",
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#else
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- // Assemble ascii shader text into shader opcodes
- hr = D3DXAssembleShader(
- szTwoSidedLightingVS,
- strlen(szTwoSidedLightingVS),
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#endif
- if (FAILED(hr)) {
- ddlogError(DDLOG_WARN, "AssembleShader failed", hr);
- SAFE_RELEASE(pVSOpcodeBuffer);
- return;
- }
-
-// This is for debugging. Remove to enable vertex shaders in HW
-#define _GLD_FORCE_SW_VS 0
-
- if (_GLD_FORCE_SW_VS) {
- // _GLD_FORCE_SW_VS should be disabled for Final Release
- ddlogMessage(DDLOG_SYSTEM, "[Forcing shaders in SW]\n");
- }
-
- // Try and create shader in hardware.
- // NOTE: The D3D Ref device appears to succeed when trying to
- // create the device in hardware, but later complains
- // when trying to set it with SetVertexShader(). Go figure.
- if (_GLD_FORCE_SW_VS || glb.dwDriver == GLDS_DRIVER_REF) {
- // Don't try and create a hardware shader with the Ref device
- hr = E_FAIL; // COM error/fail result
- } else {
- gld->VStwosidelight.bHardware = TRUE;
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- 0);
- }
- if (FAILED(hr)) {
- ddlogMessage(DDLOG_INFO, "... HW failed, trying SW...\n");
- // Failed. Try and create shader for software processing
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- D3DUSAGE_SOFTWAREPROCESSING);
- if (FAILED(hr)) {
- gld->VStwosidelight.hShader = 0; // Sanity check
- ddlogError(DDLOG_WARN, "CreateVertexShader failed", hr);
- return;
- }
- // Succeeded, but for software processing
- gld->VStwosidelight.bHardware = FALSE;
- }
-
- SAFE_RELEASE(pVSOpcodeBuffer);
-
- ddlogMessage(DDLOG_INFO, "... OK\n");
-}
-
-//---------------------------------------------------------------------------
-
-void _gldDestroyVertexShaders(
- GLD_driver_dx8 *gld)
-{
- if (gld->VStwosidelight.hShader) {
- IDirect3DDevice8_DeleteVertexShader(gld->pDev, gld->VStwosidelight.hShader);
- gld->VStwosidelight.hShader = 0;
- }
-}
-*/
-//---------------------------------------------------------------------------
-
-LPVOID lpOpaque1 = NULL;
-LPVOID lpOpaque2 = NULL;
-
-BOOL gldCreateDrawable_DX(
- DGL_ctx *ctx,
-// BOOL bDefaultDriver,
- BOOL bDirectDrawPersistant,
- BOOL bPersistantBuffers)
-{
- //
- // bDirectDrawPersistant: applies to IDirect3D8
- // bPersistantBuffers: applies to IDirect3DDevice8
- //
-
- HRESULT hResult;
- GLD_driver_dx8 *lpCtx = NULL;
- D3DDEVTYPE d3dDevType;
- D3DPRESENT_PARAMETERS d3dpp;
- D3DDISPLAYMODE d3ddm;
- DWORD dwBehaviourFlags;
- D3DADAPTER_IDENTIFIER8 d3dIdent;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- if (ctx->glPriv) {
- lpCtx = ctx->glPriv;
- // Release any existing interfaces
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- } else {
- lpCtx = (GLD_driver_dx8*)malloc(sizeof(GLD_driver_dx8));
- ZeroMemory(lpCtx, sizeof(lpCtx));
- }
-
- d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- // TODO: Check this
-// if (bDefaultDriver)
-// d3dDevType = D3DDEVTYPE_REF;
-
- // Use persistant interface if needed
- if (bDirectDrawPersistant && dx8Globals.bDirect3D) {
- lpCtx->pD3D = dx8Globals.pD3D;
- IDirect3D8_AddRef(lpCtx->pD3D);
- goto SkipDirectDrawCreate;
- }
-
- // Create Direct3D8 object
- lpCtx->pD3D = dx8Globals.fnDirect3DCreate8(D3D_SDK_VERSION_DX8_SUPPORT_WIN95);
- if (lpCtx->pD3D == NULL) {
- MessageBox(NULL, "Unable to initialize Direct3D8", "GLDirect", MB_OK);
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D8 interface");
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Cache Direct3D interface for subsequent GLRCs
- if (bDirectDrawPersistant && !dx8Globals.bDirect3D) {
- dx8Globals.pD3D = lpCtx->pD3D;
- IDirect3D8_AddRef(dx8Globals.pD3D);
- dx8Globals.bDirect3D = TRUE;
- }
-SkipDirectDrawCreate:
-
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Get device caps
- hResult = IDirect3D8_GetDeviceCaps(lpCtx->pD3D, glb.dwAdapter, d3dDevType, &lpCtx->d3dCaps8);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_GetDeviceCaps failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Check for hardware transform & lighting
- lpCtx->bHasHWTnL = lpCtx->d3dCaps8.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE;
-
- // If this flag is present then we can't default to Mesa
- // SW rendering between BeginScene() and EndScene().
- if (lpCtx->d3dCaps8.Caps2 & D3DCAPS2_NO2DDURING3DSCENE) {
- ddlogMessage(DDLOG_WARN,
- "Warning : No 2D allowed during 3D scene.\n");
- }
-
- //
- // Create the Direct3D context
- //
-
- // Re-use original IDirect3DDevice if persistant buffers exist.
- // Note that we test for persistant IDirect3D8 as well
- // bDirectDrawPersistant == persistant IDirect3D8 (DirectDraw8 does not exist)
- if (bDirectDrawPersistant && bPersistantBuffers && dx8Globals.pD3D && dx8Globals.pDev) {
- lpCtx->pDev = dx8Globals.pDev;
- IDirect3DDevice8_AddRef(dx8Globals.pDev);
- goto skip_direct3ddevice_create;
- }
-
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(lpCtx->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
-
- // Support for vertical retrace synchronisation.
- // Set default presentation interval in case caps bits are missing
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- if (glb.bWaitForRetrace) {
- if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE;
- } else {
- if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- }
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- // FullScreen_PresentationInterval must be default for Windowed mode
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- }
-
- // Decide if we can use hardware TnL
- dwBehaviourFlags = (lpCtx->bHasHWTnL) ?
- D3DCREATE_MIXED_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING;
- // Add flag to tell D3D to be thread-safe
- if (glb.bMultiThreaded)
- dwBehaviourFlags |= D3DCREATE_MULTITHREADED;
- // Add flag to tell D3D to be FPU-safe
- if (!glb.bFastFPU)
- dwBehaviourFlags |= D3DCREATE_FPU_PRESERVE;
- hResult = IDirect3D8_CreateDevice(lpCtx->pD3D,
- glb.dwAdapter,
- d3dDevType,
- ctx->hWnd,
- dwBehaviourFlags,
- &d3dpp,
- &lpCtx->pDev);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_CreateDevice failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- if (bDirectDrawPersistant && bPersistantBuffers && dx8Globals.pD3D) {
- dx8Globals.pDev = lpCtx->pDev;
- dx8Globals.bDirect3DDevice = TRUE;
- }
-
-/*
- // See if DDraw interfaces are available (DaveM)
- hResult = IDirect3D8_QueryInterface(lpCtx->pDev,
- &IID_IDirectDraw7, (LPVOID*)&lpOpaque1);
- if (FAILED(hResult) || lpOpaque1 == NULL) {
- ddlogMessage(DDLOG_INFO, "DirectDraw QueryInterface unavailable\n");
- }
-
- hResult = IDirect3DDevice8_QueryInterface(lpCtx->pDev,
- &IID_IDirectDrawSurface7, (LPVOID*)&lpOpaque2);
- if (FAILED(hResult) || lpOpaque2 == NULL) {
- ddlogMessage(DDLOG_INFO, "DirectDrawSurface QueryInterface unavialable\n");
- }
-*/
- // Dump some useful stats
- hResult = IDirect3D8_GetAdapterIdentifier(
- lpCtx->pD3D,
- glb.dwAdapter,
- D3DENUM_NO_WHQL_LEVEL, // Avoids 1 to 2 second delay
- &d3dIdent);
- if (SUCCEEDED(hResult)) {
- ddlogPrintf(DDLOG_INFO, "[Driver Description: %s]", &d3dIdent.Description);
- ddlogPrintf(DDLOG_INFO, "[Driver file: %s %d.%d.%02d.%d]",
- d3dIdent.Driver,
- HIWORD(d3dIdent.DriverVersion.HighPart),
- LOWORD(d3dIdent.DriverVersion.HighPart),
- HIWORD(d3dIdent.DriverVersion.LowPart),
- LOWORD(d3dIdent.DriverVersion.LowPart));
- ddlogPrintf(DDLOG_INFO, "[VendorId: 0x%X, DeviceId: 0x%X, SubSysId: 0x%X, Revision: 0x%X]",
- d3dIdent.VendorId, d3dIdent.DeviceId, d3dIdent.SubSysId, d3dIdent.Revision);
- }
-
- // Init projection matrix for D3D TnL
- D3DXMatrixIdentity(&lpCtx->matProjection);
- lpCtx->matModelView = lpCtx->matProjection;
-// gld->bUseMesaProjection = TRUE;
-
-skip_direct3ddevice_create:
-
- // Create buffers to hold primitives
- lpCtx->PB2d.dwFVF = GLD_FVF_2D_VERTEX;
- lpCtx->PB2d.dwPool = D3DPOOL_SYSTEMMEM;
- lpCtx->PB2d.dwStride = sizeof(GLD_2D_VERTEX);
- lpCtx->PB2d.dwUsage = D3DUSAGE_DONOTCLIP |
- D3DUSAGE_DYNAMIC |
- D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB2d);
- if (FAILED(hResult))
- goto return_with_error;
-
- lpCtx->PB3d.dwFVF = GLD_FVF_3D_VERTEX;
- lpCtx->PB3d.dwPool = D3DPOOL_DEFAULT;
- lpCtx->PB3d.dwStride = sizeof(GLD_3D_VERTEX);
- lpCtx->PB3d.dwUsage = D3DUSAGE_DYNAMIC |
- D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB3d);
- if (FAILED(hResult))
- goto return_with_error;
-
-/* // NOTE: A FVF code of zero indicates a non-FVF vertex buffer (for vertex shaders)
- lpCtx->PBtwosidelight.dwFVF = 0; //GLD_FVF_TWOSIDED_VERTEX;
- lpCtx->PBtwosidelight.dwPool = D3DPOOL_DEFAULT;
- lpCtx->PBtwosidelight.dwStride = sizeof(GLD_TWOSIDED_VERTEX);
- lpCtx->PBtwosidelight.dwUsage = D3DUSAGE_DONOTCLIP |
- D3DUSAGE_DYNAMIC |
- D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PBtwosidelight);
- if (FAILED(hResult))
- goto return_with_error;*/
-
- // Now try and create the DX8 Vertex Shaders
-// _gldCreateVertexShaders(lpCtx);
-
- // Zero the pipeline usage counters
- lpCtx->PipelineUsage.qwMesa.QuadPart =
-// lpCtx->PipelineUsage.dwD3D2SVS.QuadPart =
- lpCtx->PipelineUsage.qwD3DFVF.QuadPart = 0;
-
- // Assign drawable to GL private
- ctx->glPriv = lpCtx;
- return TRUE;
-
-return_with_error:
- // Clean up and bail
-
-// _gldDestroyVertexShaders(lpCtx);
-
-// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldResizeDrawable_DX(
- DGL_ctx *ctx,
- BOOL bDefaultDriver,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- GLD_driver_dx8 *gld = NULL;
- D3DDEVTYPE d3dDevType;
- D3DPRESENT_PARAMETERS d3dpp;
- D3DDISPLAYMODE d3ddm;
- HRESULT hResult;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (ctx->bSceneStarted) {
- IDirect3DDevice8_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-
- d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- if (!bDefaultDriver)
- d3dDevType = D3DDEVTYPE_REF; // Force Direct3D Reference Rasterise (software)
-
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D8_GetAdapterDisplayMode(gld->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
-// goto return_with_error;
- return FALSE;
- }
-
- // Destroy DX8 Vertex Shaders before Reset()
-// _gldDestroyVertexShaders(gld);
-
- // Release POOL_DEFAULT objects before Reset()
- if (gld->PB2d.dwPool == D3DPOOL_DEFAULT)
- _gldDestroyPrimitiveBuffer(&gld->PB2d);
- if (gld->PB3d.dwPool == D3DPOOL_DEFAULT)
- _gldDestroyPrimitiveBuffer(&gld->PB3d);
-// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT)
-// _gldDestroyPrimitiveBuffer(&gld->PBtwosidelight);
-
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(gld->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- // TODO: Sync to refresh
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- // Get better benchmark results? KeithH
-// d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_UNLIMITED;
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- }
- hResult = IDirect3DDevice8_Reset(gld->pDev, &d3dpp);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Reset failed", hResult);
- return FALSE;
- //goto cleanup_and_return_with_error;
- }
-
- // Explicitly Clear resized surfaces (DaveM)
- {
- D3DVIEWPORT8 d3dvp1, d3dvp2;
- IDirect3DDevice8_GetViewport(gld->pDev, &d3dvp1);
- IDirect3DDevice8_GetViewport(gld->pDev, &d3dvp2);
- d3dvp1.X = 0;
- d3dvp1.Y = 0;
- d3dvp1.Width = ctx->dwWidth;
- d3dvp1.Height = ctx->dwHeight;
- IDirect3DDevice8_SetViewport(gld->pDev, &d3dvp1);
- IDirect3DDevice8_Clear(gld->pDev,0,NULL,D3DCLEAR_TARGET,0,0,0);
- IDirect3DDevice8_SetViewport(gld->pDev, &d3dvp2);
- }
-
- //
- // Recreate POOL_DEFAULT objects
- //
- if (gld->PB2d.dwPool == D3DPOOL_DEFAULT) {
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d);
- }
- if (gld->PB3d.dwPool == D3DPOOL_DEFAULT) {
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB3d);
- }
-// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT) {
-// _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d);
-// }
-
- // Recreate DX8 Vertex Shaders
-// _gldCreateVertexShaders(gld);
-
- // Signal a complete state update
- ctx->glCtx->Driver.UpdateState(ctx->glCtx, _NEW_ALL);
-
- // Begin a new scene
- IDirect3DDevice8_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyDrawable_DX(
- DGL_ctx *ctx)
-{
- GLD_driver_dx8 *lpCtx = NULL;
-
- // Error if context is NULL.
- if (!ctx)
- return FALSE;
-
- // Error if the drawable does not exist.
- if (!ctx->glPriv)
- return FALSE;
-
- lpCtx = ctx->glPriv;
-
-#ifdef _DEBUG
- // Dump out stats
- ddlogPrintf(DDLOG_SYSTEM, "Usage: M:0x%X%X, D:0x%X%X",
- lpCtx->PipelineUsage.qwMesa.HighPart,
- lpCtx->PipelineUsage.qwMesa.LowPart,
- lpCtx->PipelineUsage.qwD3DFVF.HighPart,
- lpCtx->PipelineUsage.qwD3DFVF.LowPart);
-#endif
-
-// _gldDestroyVertexShaders(lpCtx);
-
-// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
-
- // Free the private drawable data
- free(ctx->glPriv);
- ctx->glPriv = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldCreatePrivateGlobals_DX(void)
-{
- ZeroMemory(&dx8Globals, sizeof(dx8Globals));
-
- // Load d3d8.dll
- dx8Globals.hD3D8DLL = LoadLibrary("D3D8.DLL");
- if (dx8Globals.hD3D8DLL == NULL)
- return FALSE;
-
- // Now try and obtain Direct3DCreate8
- dx8Globals.fnDirect3DCreate8 = (FNDIRECT3DCREATE8)GetProcAddress(dx8Globals.hD3D8DLL, "Direct3DCreate8");
- if (dx8Globals.fnDirect3DCreate8 == NULL) {
- FreeLibrary(dx8Globals.hD3D8DLL);
- return FALSE;
- }
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyPrivateGlobals_DX(void)
-{
- if (dx8Globals.bDirect3DDevice) {
- SAFE_RELEASE(dx8Globals.pDev);
- dx8Globals.bDirect3DDevice = FALSE;
- }
- if (dx8Globals.bDirect3D) {
- SAFE_RELEASE(dx8Globals.pD3D);
- dx8Globals.bDirect3D = FALSE;
- }
-
- FreeLibrary(dx8Globals.hD3D8DLL);
- dx8Globals.hD3D8DLL = NULL;
- dx8Globals.fnDirect3DCreate8 = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDisplayFormat(
- D3DFORMAT fmt,
- BYTE *cColorBits,
- BYTE *cRedBits,
- BYTE *cGreenBits,
- BYTE *cBlueBits,
- BYTE *cAlphaBits)
-{
- switch (fmt) {
- case D3DFMT_X1R5G5B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 5;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DFMT_R5G6B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 6;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DFMT_X8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
- return;
- case D3DFMT_A8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 8;
- return;
- }
-
- // Should not get here!
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDepthStencilFormat(
- D3DFORMAT fmt,
- BYTE *cDepthBits,
- BYTE *cStencilBits)
-{
- // NOTE: GL expects either 32 or 16 as depth bits.
- switch (fmt) {
- case D3DFMT_D32:
- *cDepthBits = 32;
- *cStencilBits = 0;
- return;
- case D3DFMT_D15S1:
- *cDepthBits = 16;
- *cStencilBits = 1;
- return;
- case D3DFMT_D24S8:
- *cDepthBits = 32;
- *cStencilBits = 8;
- return;
- case D3DFMT_D16:
- *cDepthBits = 16;
- *cStencilBits = 0;
- return;
- case D3DFMT_D24X8:
- *cDepthBits = 32;
- *cStencilBits = 0;
- return;
- case D3DFMT_D24X4S4:
- *cDepthBits = 32;
- *cStencilBits = 4;
- return;
- }
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldBuildPixelformatList_DX(void)
-{
- D3DDISPLAYMODE d3ddm;
- D3DFORMAT fmt[6];
- IDirect3D8 *pD3D = NULL;
- HRESULT hr;
- int nSupportedFormats = 0;
- int i;
- DGL_pixelFormat *pPF;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-// char buf[128];
-// char cat[8];
-
- // Direct3D (SW or HW)
- // These are arranged so that 'best' pixelformat
- // is higher in the list (for ChoosePixelFormat).
- const D3DFORMAT DepthStencil[6] = {
- D3DFMT_D15S1,
- D3DFMT_D16,
- D3DFMT_D24X8,
- D3DFMT_D24X4S4,
- D3DFMT_D24S8,
- D3DFMT_D32,
- };
-
- // Dump DX version
- ddlogMessage(GLDLOG_SYSTEM, "DirectX Version : 8.0\n");
-
- // Release any existing pixelformat list
- if (glb.lpPF) {
- free(glb.lpPF);
- }
-
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL;
-
- //
- // Pixelformats for Direct3D (SW or HW) rendering
- //
-
- // Get a Direct3D 8.0 interface
- pD3D = dx8Globals.fnDirect3DCreate8(D3D_SDK_VERSION_DX8_SUPPORT_WIN95);
- if (!pD3D) {
- return FALSE;
- }
-
- // We will use the display mode format when finding compliant
- // rendertarget/depth-stencil surfaces.
- hr = IDirect3D8_GetAdapterDisplayMode(pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hr)) {
- IDirect3D8_Release(pD3D);
- return FALSE;
- }
-
- // Run through the possible formats and detect supported formats
- for (i=0; i<6; i++) {
- hr = IDirect3D8_CheckDeviceFormat(
- pD3D,
- glb.dwAdapter,
- glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF,
- d3ddm.Format,
- D3DUSAGE_DEPTHSTENCIL,
- D3DRTYPE_SURFACE,
- DepthStencil[i]);
- if (FAILED(hr))
- // A failure here is not fatal.
- continue;
-
- // Verify that the depth format is compatible.
- hr = IDirect3D8_CheckDepthStencilMatch(
- pD3D,
- glb.dwAdapter,
- glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF,
- d3ddm.Format,
- d3ddm.Format,
- DepthStencil[i]);
- if (FAILED(hr))
- // A failure here is not fatal, just means depth-stencil
- // format is not compatible with this display mode.
- continue;
-
- fmt[nSupportedFormats++] = DepthStencil[i];
- }
-
- IDirect3D8_Release(pD3D);
-
- if (nSupportedFormats == 0)
- return FALSE; // Bail: no compliant pixelformats
-
- // Total count of pixelformats is:
- // (nSupportedFormats+1)*2
- glb.lpPF = (DGL_pixelFormat *)calloc((nSupportedFormats)*2, sizeof(DGL_pixelFormat));
- glb.nPixelFormatCount = (nSupportedFormats)*2;
- if (glb.lpPF == NULL) {
- glb.nPixelFormatCount = 0;
- return FALSE;
- }
-
- // Get a copy of pointer that we can alter
- pPF = glb.lpPF;
-
- // Cache colour bits from display format
- _BitsFromDisplayFormat(d3ddm.Format, &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
-
- //
- // Add single-buffer formats
- //
-
- // Single-buffer, no depth-stencil buffer
-/* memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DFMT_UNKNOWN;
- pPF++;*/
-
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- //
- // Add double-buffer formats
- //
-
-/* memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DFMT_UNKNOWN;
- pPF++;*/
-
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- // Popup warning message if non RGB color mode
- {
- // This is a hack. KeithH
- HDC hdcDesktop = GetDC(NULL);
- DWORD dwDisplayBitDepth = GetDeviceCaps(hdcDesktop, BITSPIXEL);
- ReleaseDC(0, hdcDesktop);
- if (dwDisplayBitDepth <= 8) {
- ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth);
- MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING);
- }
- }
-
- // Mark list as 'current'
- glb.bPixelformatsDirty = FALSE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldInitialiseMesa_DX(
- DGL_ctx *lpCtx)
-{
- GLD_driver_dx8 *gld = NULL;
- int MaxTextureSize, TextureLevels;
- BOOL bSoftwareTnL;
-
- if (lpCtx == NULL)
- return FALSE;
-
- gld = lpCtx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (glb.bMultitexture) {
- lpCtx->glCtx->Const.MaxTextureUnits = gld->d3dCaps8.MaxSimultaneousTextures;
- // Only support MAX_TEXTURE_UNITS texture units.
- // ** If this is altered then the FVF formats must be reviewed **.
- if (lpCtx->glCtx->Const.MaxTextureUnits > GLD_MAX_TEXTURE_UNITS_DX8)
- lpCtx->glCtx->Const.MaxTextureUnits = GLD_MAX_TEXTURE_UNITS_DX8;
- } else {
- // Multitexture override
- lpCtx->glCtx->Const.MaxTextureUnits = 1;
- }
-
- // max texture size
- MaxTextureSize = min(gld->d3dCaps8.MaxTextureHeight, gld->d3dCaps8.MaxTextureWidth);
- if (MaxTextureSize == 0)
- MaxTextureSize = 256; // Sanity check
-
- //
- // HACK!!
- if (MaxTextureSize > 1024)
- MaxTextureSize = 1024; // HACK - CLAMP TO 1024
- // HACK!!
- //
-
- // Got to set MAX_TEXTURE_SIZE as max levels.
- // Who thought this stupid idea up? ;)
- TextureLevels = 0;
- // Calculate power-of-two.
- while (MaxTextureSize) {
- TextureLevels++;
- MaxTextureSize >>= 1;
- }
- lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8;
-
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE);
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_DITHERENABLE, TRUE);
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SHADEMODE, D3DSHADE_GOURAUD);
-
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ZENABLE,
- (lpCtx->lpPF->dwDriverData!=D3DFMT_UNKNOWN) ? D3DZB_TRUE : D3DZB_FALSE);
-
- // Set the view matrix
- {
- D3DXMATRIX vm;
-#if 1
- D3DXMatrixIdentity(&vm);
-#else
- D3DXVECTOR3 Eye(0.0f, 0.0f, 0.0f);
- D3DXVECTOR3 At(0.0f, 0.0f, -1.0f);
- D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f);
- D3DXMatrixLookAtRH(&vm, &Eye, &At, &Up);
- vm._31 = -vm._31;
- vm._32 = -vm._32;
- vm._33 = -vm._33;
- vm._34 = -vm._34;
-#endif
- IDirect3DDevice8_SetTransform(gld->pDev, D3DTS_VIEW, &vm);
- }
-
- if (gld->bHasHWTnL) {
- if (glb.dwTnL == GLDS_TNL_DEFAULT)
- bSoftwareTnL = FALSE; // HW TnL
- else {
- bSoftwareTnL = ((glb.dwTnL == GLDS_TNL_MESA) || (glb.dwTnL == GLDS_TNL_D3DSW)) ? TRUE : FALSE;
- }
- } else {
- // No HW TnL, so no choice possible
- bSoftwareTnL = TRUE;
- }
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, bSoftwareTnL);
-
-// Dump this in a Release build as well, now.
-//#ifdef _DEBUG
- ddlogPrintf(DDLOG_INFO, "HW TnL: %s",
- gld->bHasHWTnL ? (bSoftwareTnL ? "Disabled" : "Enabled") : "Unavailable");
-//#endif
-
- gldEnableExtensions_DX8(lpCtx->glCtx);
- gldInstallPipeline_DX8(lpCtx->glCtx);
- gldSetupDriverPointers_DX8(lpCtx->glCtx);
-
- // Signal a complete state update
- lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL);
-
- // Start a scene
- IDirect3DDevice8_BeginScene(gld->pDev);
- lpCtx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldSwapBuffers_DX(
- DGL_ctx *ctx,
- HDC hDC,
- HWND hWnd)
-{
- HRESULT hr;
- GLD_driver_dx8 *gld = NULL;
-
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (ctx->bSceneStarted) {
- IDirect3DDevice8_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-
- // Swap the buffers. hWnd may override the hWnd used for CreateDevice()
- hr = IDirect3DDevice8_Present(gld->pDev, NULL, NULL, hWnd, NULL);
-
- IDirect3DDevice8_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
- return (FAILED(hr)) ? FALSE : TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldGetDisplayMode_DX(
- DGL_ctx *ctx,
- GLD_displayMode *glddm)
-{
- D3DDISPLAYMODE d3ddm;
- HRESULT hr;
- GLD_driver_dx8 *lpCtx = NULL;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-
- if ((glddm == NULL) || (ctx == NULL))
- return FALSE;
-
- lpCtx = ctx->glPriv;
- if (lpCtx == NULL)
- return FALSE;
-
- if (lpCtx->pD3D == NULL)
- return FALSE;
-
- hr = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hr))
- return FALSE;
-
- // Get info from the display format
- _BitsFromDisplayFormat(d3ddm.Format,
- &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
-
- glddm->Width = d3ddm.Width;
- glddm->Height = d3ddm.Height;
- glddm->BPP = cColorBits;
- glddm->Refresh = d3ddm.RefreshRate;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c
deleted file mode 100644
index 1b01cb1f7f3..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c
+++ /dev/null
@@ -1,1206 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Driver interface code to Mesa
-*
-****************************************************************************/
-
-//#include <windows.h>
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-extern BOOL dglSwapBuffers(HDC hDC);
-
-// HACK: Hack the _33 member of the OpenGL perspective projection matrix
-const float _fPersp_33 = 1.6f;
-
-//---------------------------------------------------------------------------
-// Internal functions
-//---------------------------------------------------------------------------
-
-void _gld_mesa_warning(
- __GLcontext *gc,
- char *str)
-{
- // Intercept Mesa's internal warning mechanism
- gldLogPrintf(GLDLOG_WARN, "Mesa warning: %s", str);
-}
-
-//---------------------------------------------------------------------------
-
-void _gld_mesa_fatal(
- __GLcontext *gc,
- char *str)
-{
- // Intercept Mesa's internal fatal-message mechanism
- gldLogPrintf(GLDLOG_CRITICAL, "Mesa FATAL: %s", str);
-
- // Mesa calls abort(0) here.
- ddlogClose();
- exit(0);
-}
-
-//---------------------------------------------------------------------------
-
-D3DSTENCILOP _gldConvertStencilOp(
- GLenum StencilOp)
-{
- // Used by Stencil: pass, fail and zfail
-
- switch (StencilOp) {
- case GL_KEEP:
- return D3DSTENCILOP_KEEP;
- case GL_ZERO:
- return D3DSTENCILOP_ZERO;
- case GL_REPLACE:
- return D3DSTENCILOP_REPLACE;
- case GL_INCR:
- return D3DSTENCILOP_INCRSAT;
- case GL_DECR:
- return D3DSTENCILOP_DECRSAT;
- case GL_INVERT:
- return D3DSTENCILOP_INVERT;
- case GL_INCR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_INCR;
- case GL_DECR_WRAP_EXT: // GL_EXT_stencil_wrap
- return D3DSTENCILOP_DECR;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertStencilOp: Unknown StencilOp\n");
-#endif
-
- return D3DSTENCILOP_KEEP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DCMPFUNC _gldConvertCompareFunc(
- GLenum CmpFunc)
-{
- // Used for Alpha func, depth func and stencil func.
-
- switch (CmpFunc) {
- case GL_NEVER:
- return D3DCMP_NEVER;
- case GL_LESS:
- return D3DCMP_LESS;
- case GL_EQUAL:
- return D3DCMP_EQUAL;
- case GL_LEQUAL:
- return D3DCMP_LESSEQUAL;
- case GL_GREATER:
- return D3DCMP_GREATER;
- case GL_NOTEQUAL:
- return D3DCMP_NOTEQUAL;
- case GL_GEQUAL:
- return D3DCMP_GREATEREQUAL;
- case GL_ALWAYS:
- return D3DCMP_ALWAYS;
- };
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertCompareFunc: Unknown CompareFunc\n");
-#endif
-
- return D3DCMP_ALWAYS;
-}
-
-//---------------------------------------------------------------------------
-
-D3DBLEND _gldConvertBlendFunc(
- GLenum blend,
- GLenum DefaultBlend)
-{
- switch (blend) {
- case GL_ZERO:
- return D3DBLEND_ZERO;
- case GL_ONE:
- return D3DBLEND_ONE;
- case GL_DST_COLOR:
- return D3DBLEND_DESTCOLOR;
- case GL_SRC_COLOR:
- return D3DBLEND_SRCCOLOR;
- case GL_ONE_MINUS_DST_COLOR:
- return D3DBLEND_INVDESTCOLOR;
- case GL_ONE_MINUS_SRC_COLOR:
- return D3DBLEND_INVSRCCOLOR;
- case GL_SRC_ALPHA:
- return D3DBLEND_SRCALPHA;
- case GL_ONE_MINUS_SRC_ALPHA:
- return D3DBLEND_INVSRCALPHA;
- case GL_DST_ALPHA:
- return D3DBLEND_DESTALPHA;
- case GL_ONE_MINUS_DST_ALPHA:
- return D3DBLEND_INVDESTALPHA;
- case GL_SRC_ALPHA_SATURATE:
- return D3DBLEND_SRCALPHASAT;
- }
-
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "_gldConvertBlendFunc: Unknown BlendFunc\n");
-#endif
-
- return DefaultBlend;
-}
-
-//---------------------------------------------------------------------------
-// Misc. functions
-//---------------------------------------------------------------------------
-
-void gld_Noop_DX9(
- GLcontext *ctx)
-{
-#ifdef _DEBUG
- gldLogMessage(GLDLOG_ERROR, "gld_Noop called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Error_DX9(
- GLcontext *ctx)
-{
-#ifdef _DEBUG
- // Quite useless.
-// gldLogMessage(GLDLOG_ERROR, "ctx->Driver.Error called!\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Required Mesa functions
-//---------------------------------------------------------------------------
-
-static GLboolean gld_set_draw_buffer_DX9(
- GLcontext *ctx,
- GLenum mode)
-{
- (void) ctx;
- if ((mode==GL_FRONT_LEFT) || (mode == GL_BACK_LEFT)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_set_read_buffer_DX9(
- GLcontext *ctx,
- GLframebuffer *buffer,
- GLenum mode)
-{
- /* separate read buffer not supported */
-/*
- ASSERT(buffer == ctx->DrawBuffer);
- ASSERT(mode == GL_FRONT_LEFT);
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Clear_DX9(
- GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint x,
- GLint y,
- GLint width,
- GLint height)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DCOLOR Color = 0;
- float Z = 0.0f;
- DWORD Stencil = 0;
- D3DRECT d3dClearRect;
-
- // TODO: Colourmask
- const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
-
- if (!gld->pDev)
- return;
-
- if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
- GLubyte col[4];
- CLAMPED_FLOAT_TO_UBYTE(col[0], ctx->Color.ClearColor[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], ctx->Color.ClearColor[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], ctx->Color.ClearColor[2]);
- CLAMPED_FLOAT_TO_UBYTE(col[3], ctx->Color.ClearColor[3]);
- dwFlags |= D3DCLEAR_TARGET;
- Color = D3DCOLOR_RGBA(col[0], col[1], col[2], col[3]);
- }
-
- if (mask & DD_DEPTH_BIT) {
- // D3D8 will fail the Clear call if we try and clear a
- // depth buffer and we haven't created one.
- // Also, some apps try and clear a depth buffer,
- // when a depth buffer hasn't been requested by the app.
- if (ctx->Visual.depthBits == 0) {
- mask &= ~DD_DEPTH_BIT; // Remove depth bit from mask
- } else {
- dwFlags |= D3DCLEAR_ZBUFFER;
- Z = ctx->Depth.Clear;
- }
- }
-
- if (mask & DD_STENCIL_BIT) {
- if (ctx->Visual.stencilBits == 0) {
- // No stencil bits in depth buffer
- mask &= ~DD_STENCIL_BIT; // Remove stencil bit from mask
- } else {
- dwFlags |= D3DCLEAR_STENCIL;
- Stencil = ctx->Stencil.Clear;
- }
- }
-
- // Some apps do really weird things with the rect, such as Quake3.
- if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0)) {
- all = GL_TRUE;
- }
-
- if (!all) {
- // Calculate clear subrect
- d3dClearRect.x1 = x;
- d3dClearRect.y1 = gldCtx->dwHeight - (y + height);
- d3dClearRect.x2 = x + width;
- d3dClearRect.y2 = d3dClearRect.y1 + height;
-// gldLogPrintf(GLDLOG_INFO, "Rect %d,%d %d,%d", x,y,width,height);
- }
-
- // dwFlags will be zero if there's nothing to clear
- if (dwFlags) {
- _GLD_DX9_DEV(Clear(
- gld->pDev,
- all ? 0 : 1,
- all ? NULL : &d3dClearRect,
- dwFlags,
- Color, Z, Stencil));
- }
-
- if (mask & DD_ACCUM_BIT) {
- // Clear accumulation buffer
- }
-}
-
-//---------------------------------------------------------------------------
-
-// Mesa 5: Parameter change
-static void gld_buffer_size_DX9(
-// GLcontext *ctx,
- GLframebuffer *fb,
- GLuint *width,
- GLuint *height)
-{
-// GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
-
- *width = fb->Width; // gldCtx->dwWidth;
- *height = fb->Height; // gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Finish_DX9(
- GLcontext *ctx)
-{
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_Flush_DX9(
- GLcontext *ctx)
-{
- GLD_context *gld = GLD_GET_CONTEXT(ctx);
-
- // TODO: Detect apps that glFlush() then SwapBuffers() ?
-
- if (gld->EmulateSingle) {
- // Emulating a single-buffered context.
- // [Direct3D doesn't allow rendering to front buffer]
- dglSwapBuffers(gld->hDC);
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_STENCIL(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Two-sided stencil. New for Mesa 5
- const GLuint uiFace = 0UL;
-
- struct gl_stencil_attrib *pStencil = &ctx->Stencil;
-
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILENABLE, pStencil->Enabled ? TRUE : FALSE));
- if (pStencil->Enabled) {
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFUNC, _gldConvertCompareFunc(pStencil->Function[uiFace])));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILREF, pStencil->Ref[uiFace]));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILMASK, pStencil->ValueMask[uiFace]));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILWRITEMASK, pStencil->WriteMask[uiFace]));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFAIL, _gldConvertStencilOp(pStencil->FailFunc[uiFace])));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILZFAIL, _gldConvertStencilOp(pStencil->ZFailFunc[uiFace])));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILPASS, _gldConvertStencilOp(pStencil->ZPassFunc[uiFace])));
- }
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_COLOR(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- DWORD dwFlags = 0;
- D3DBLEND src;
- D3DBLEND dest;
-
- // Alpha func
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, _gldConvertCompareFunc(ctx->Color.AlphaFunc)));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAREF, (DWORD)ctx->Color.AlphaRef));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, ctx->Color.AlphaEnabled));
-
- // Blend func
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHABLENDENABLE, ctx->Color.BlendEnabled));
- src = _gldConvertBlendFunc(ctx->Color.BlendSrcRGB, GL_ONE);
- dest = _gldConvertBlendFunc(ctx->Color.BlendDstRGB, GL_ZERO);
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SRCBLEND, src));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_DESTBLEND, dest));
-
- // Color mask
- if (ctx->Color.ColorMask[0]) dwFlags |= D3DCOLORWRITEENABLE_RED;
- if (ctx->Color.ColorMask[1]) dwFlags |= D3DCOLORWRITEENABLE_GREEN;
- if (ctx->Color.ColorMask[2]) dwFlags |= D3DCOLORWRITEENABLE_BLUE;
- if (ctx->Color.ColorMask[3]) dwFlags |= D3DCOLORWRITEENABLE_ALPHA;
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_COLORWRITEENABLE, dwFlags));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_DEPTH(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZENABLE, ctx->Depth.Test ? D3DZB_TRUE : D3DZB_FALSE));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZFUNC, _gldConvertCompareFunc(ctx->Depth.Func)));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZWRITEENABLE, ctx->Depth.Mask ? TRUE : FALSE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_POLYGON(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DFILLMODE d3dFillMode = D3DFILL_SOLID;
- D3DCULL d3dCullMode = D3DCULL_NONE;
- float fOffset = 0; // Changed from int to float for DX9
-
- // Fillmode
- switch (ctx->Polygon.FrontMode) {
- case GL_POINT:
- d3dFillMode = D3DFILL_POINT;
- break;
- case GL_LINE:
- d3dFillMode = D3DFILL_WIREFRAME;
- break;
- case GL_FILL:
- d3dFillMode = D3DFILL_SOLID;
- break;
- }
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FILLMODE, d3dFillMode));
-
- if (ctx->Polygon.CullFlag) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_BACK:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CW;
- else
- d3dCullMode = D3DCULL_CCW;
- break;
- case GL_FRONT:
- if (ctx->Polygon.FrontFace == GL_CCW)
- d3dCullMode = D3DCULL_CCW;
- else
- d3dCullMode = D3DCULL_CW;
- break;
- case GL_FRONT_AND_BACK:
- d3dCullMode = D3DCULL_NONE;
- break;
- default:
- break;
- }
- } else {
- d3dCullMode = D3DCULL_NONE;
- }
-// d3dCullMode = D3DCULL_NONE; // FOR DEBUGGING
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CULLMODE, d3dCullMode));
-
- // Polygon offset
- // ZBIAS ranges from 0 to 16 and can only move towards the viewer
- // Mesa5: ctx->Polygon._OffsetAny removed
- if (ctx->Polygon.OffsetFill) {
- fOffset = ctx->Polygon.OffsetUnits;
-// if (iOffset < 0.0f)
-// iOffset = -iOffset;
-// else
-// iOffset = 0.0f; // D3D can't push away
- }
- // NOTE: SetRenderState() required a DWORD, so need to cast
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_DEPTHBIAS, *((DWORD*)&fOffset)));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_FOG(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DCOLOR d3dFogColour;
- D3DFOGMODE d3dFogMode = D3DFOG_LINEAR;
-
- // TODO: Fog is calculated seperately in the Mesa pipeline
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, FALSE));
- return;
-
- // Fog enable
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, ctx->Fog.Enabled));
- if (!ctx->Fog.Enabled) {
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, D3DFOG_NONE));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE));
- return; // If disabled, don't bother setting any fog state
- }
-
- // Fog colour
- d3dFogColour = D3DCOLOR_COLORVALUE( ctx->Fog.Color[0],
- ctx->Fog.Color[1],
- ctx->Fog.Color[2],
- ctx->Fog.Color[3]);
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGCOLOR, d3dFogColour));
-
- // Fog density
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGDENSITY, *((DWORD*) (&ctx->Fog.Density))));
-
- // Fog start
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGSTART, *((DWORD*) (&ctx->Fog.Start))));
-
- // Fog end
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGEND, *((DWORD*) (&ctx->Fog.End))));
-
- // Fog mode
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- d3dFogMode = D3DFOG_LINEAR;
- break;
- case GL_EXP:
- d3dFogMode = D3DFOG_EXP;
- break;
- case GL_EXP2:
- d3dFogMode = D3DFOG_EXP2;
- break;
- }
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, d3dFogMode));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_LIGHT(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- DWORD dwSpecularEnable;
-
- // Shademode
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SHADEMODE, (ctx->Light.ShadeModel == GL_SMOOTH) ? D3DSHADE_GOURAUD : D3DSHADE_FLAT));
-
- // Separate specular colour
- if (ctx->Light.Enabled)
- dwSpecularEnable = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TRUE: FALSE;
- else
- dwSpecularEnable = FALSE;
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SPECULARENABLE, dwSpecularEnable));
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_MODELVIEW(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ModelView.m;
- // Mesa5: Model-view is now a stack
- GLfloat *pM = ctx->ModelviewMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10];
- m._34 = pM[11];
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14];
- m._44 = pM[15];
-
- gld->matModelView = m;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_PROJECTION(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DMATRIX m;
- //GLfloat *pM = ctx->ProjectionMatrix.m;
- // Mesa 5: Now a stack
- GLfloat *pM = ctx->ProjectionMatrixStack.Top->m;
- m._11 = pM[0];
- m._12 = pM[1];
- m._13 = pM[2];
- m._14 = pM[3];
-
- m._21 = pM[4];
- m._22 = pM[5];
- m._23 = pM[6];
- m._24 = pM[7];
-
- m._31 = pM[8];
- m._32 = pM[9];
- m._33 = pM[10] / _fPersp_33; // / 1.6f;
- m._34 = pM[11];
-
- m._41 = pM[12];
- m._42 = pM[13];
- m._43 = pM[14] / 2.0f;
- m._44 = pM[15];
-
- gld->matProjection = m;
-}
-
-//---------------------------------------------------------------------------
-/*
-void gldFrustumHook_DX9(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Frustum(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = farval / (nearval - farval);
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Frustum: %f", farval/nearval);
-}
-
-//---------------------------------------------------------------------------
-
-void gldOrthoHook_DX9(
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top,
- GLdouble nearval,
- GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Pass values on to Mesa first (in case we mess with them)
- _mesa_Ortho(left, right, bottom, top, nearval, farval);
-
- _fPersp_33 = 1.6f;
-
-// ddlogPrintf(GLDLOG_SYSTEM, "Ortho: %f", farval/nearval);
-}
-*/
-//---------------------------------------------------------------------------
-
-void gld_NEW_VIEWPORT(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DVIEWPORT9 d3dvp;
-// GLint x, y;
-// GLsizei w, h;
-
- // Set depth range
- _GLD_DX9_DEV(GetViewport(gld->pDev, &d3dvp));
- // D3D can't do Quake1/Quake2 z-trick
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.MinZ = ctx->Viewport.Near;
- d3dvp.MaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.MinZ = ctx->Viewport.Far;
- d3dvp.MaxZ = ctx->Viewport.Near;
- }
-/* x = ctx->Viewport.X;
- y = ctx->Viewport.Y;
- w = ctx->Viewport.Width;
- h = ctx->Viewport.Height;
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
- d3dvp.X = x;
- d3dvp.Y = gldCtx->dwHeight - (y + h);
- d3dvp.Width = w;
- d3dvp.Height = h;*/
- _GLD_DX9_DEV(SetViewport(gld->pDev, &d3dvp));
-
-// gld->fFlipWindowY = (float)gldCtx->dwHeight;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_SCISSOR(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Bail if IHV driver cannot scissor
- if (!gld->bCanScissor)
- return;
-
- // Set scissor rect
- if (ctx->Scissor.Enabled) {
- RECT rcRect;
- // Keep in mind that RECT's need an extra row and column
- rcRect.left = ctx->Scissor.X;
- rcRect.right = ctx->Scissor.X + ctx->Scissor.Width; // + 1;
- rcRect.top = gldCtx->dwHeight - (ctx->Scissor.Y + ctx->Scissor.Height);
- rcRect.bottom = rcRect.top + ctx->Scissor.Height;
- IDirect3DDevice9_SetScissorRect(gld->pDev, &rcRect);
- }
-
- // Enable/disable scissor as required
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SCISSORTESTENABLE, ctx->Scissor.Enabled));
-}
-
-//---------------------------------------------------------------------------
-
-__inline BOOL _gldAnyEvalEnabled(
- GLcontext *ctx)
-{
- struct gl_eval_attrib *eval = &ctx->Eval;
-
- if ((eval->AutoNormal) ||
- (eval->Map1Color4) ||
- (eval->Map1Index) ||
- (eval->Map1Normal) ||
- (eval->Map1TextureCoord1) ||
- (eval->Map1TextureCoord2) ||
- (eval->Map1TextureCoord3) ||
- (eval->Map1TextureCoord4) ||
- (eval->Map1Vertex3) ||
- (eval->Map1Vertex4) ||
- (eval->Map2Color4) ||
- (eval->Map2Index) ||
- (eval->Map2Normal) ||
- (eval->Map2TextureCoord1) ||
- (eval->Map2TextureCoord2) ||
- (eval->Map2TextureCoord3) ||
- (eval->Map2TextureCoord4) ||
- (eval->Map2Vertex3) ||
- (eval->Map2Vertex4)
- )
- return TRUE;
-
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL _gldChooseInternalPipeline(
- GLcontext *ctx,
- GLD_driver_dx9 *gld)
-{
-// return TRUE; // DEBUGGING: ALWAYS USE MESA
-// return FALSE; // DEBUGGING: ALWAYS USE D3D
-
- if ((glb.dwTnL == GLDS_TNL_MESA) || (gld->bHasHWTnL == FALSE))
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE; // Force Mesa TnL
- }
-
- if ((ctx->Light.Enabled) ||
- (1) ||
- (ctx->Texture._TexGenEnabled) ||
- (ctx->Texture._TexMatEnabled) ||
-// (ctx->Transform._AnyClip) ||
- (ctx->Scissor.Enabled) ||
- _gldAnyEvalEnabled(ctx) // Put this last so we can early-out
- )
- {
- gld->PipelineUsage.qwMesa.QuadPart++;
- return TRUE;
- }
-
- gld->PipelineUsage.qwD3DFVF.QuadPart++;
- return FALSE;
-
-/* // Force Mesa pipeline?
- if (glb.dwTnL == GLDS_TNL_MESA) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Test for functionality not exposed in the D3D pathways
- if ((ctx->Texture._GenFlags)) {
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
-
- // Now decide if vertex shader can be used.
- // If two sided lighting is enabled then we must either
- // use Mesa TnL or the vertex shader
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
- if (gld->VStwosidelight.hShader && !ctx->Fog.Enabled) {
- // Use Vertex Shader
- gld->PipelineUsage.dwD3D2SVS.QuadPart++;
- return GLD_PIPELINE_D3D_VS_TWOSIDE;
- } else {
- // Use Mesa TnL
- gld->PipelineUsage.dwMesa.QuadPart++;
- return GLD_PIPELINE_MESA;
- }
- }
-
- // Must be D3D fixed-function pipeline
- gld->PipelineUsage.dwD3DFVF.QuadPart++;
- return GLD_PIPELINE_D3D_FVF;
-*/
-}
-
-//---------------------------------------------------------------------------
-
-void gld_update_state_DX9(
- GLcontext *ctx,
- GLuint new_state)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLD_pb_dx9 *gldPB;
-
- if (!gld || !gld->pDev)
- return;
-
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-
- // SetupIndex will be used in the pipelines for choosing setup function
- if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) ||
- (ctx->Fog.Enabled))
- {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT_EXTRAS;
- else
- gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS;
- } else {
- if (ctx->_TriangleCaps & DD_FLATSHADE)
- gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture
- else
- gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture
- }
-
- gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld);
- if (gld->bUseMesaTnL) {
- gldPB = &gld->PB2d;
- _GLD_DX9_DEV(SetSoftwareVertexProcessing(gld->pDev, TRUE));
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, FALSE));
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL));
- _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF));
- } else {
- gldPB = &gld->PB3d;
- _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE));
-// if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) {
-// _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware));
-// _GLD_DX9_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
-// } else {
-// _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL));
- _GLD_DX9_DEV(SetSoftwareVertexProcessing(gld->pDev, !gld->bHasHWTnL));
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL));
- _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF));
-// }
- }
-
-#define _GLD_TEST_STATE(a) \
- if (new_state & (a)) { \
- gld##a(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_TEST_STATE_DX9(a) \
- if (new_state & (a)) { \
- gld##a##_DX9(ctx); \
- new_state &= ~(a); \
- }
-
-#define _GLD_IGNORE_STATE(a) new_state &= ~(a);
-
-// if (!gld->bUseMesaTnL) {
- // Not required if Mesa is doing the TnL.
- // Problem: If gld->bUseMesaTnL is TRUE when these are signaled,
- // then we'll miss updating the D3D TnL pipeline.
- // Therefore, don't test for gld->bUseMesaTnL
- _GLD_TEST_STATE(_NEW_MODELVIEW);
- _GLD_TEST_STATE(_NEW_PROJECTION);
-// }
-
- _GLD_TEST_STATE_DX9(_NEW_TEXTURE); // extern, so guard with _DX9
- _GLD_TEST_STATE(_NEW_COLOR);
- _GLD_TEST_STATE(_NEW_DEPTH);
- _GLD_TEST_STATE(_NEW_POLYGON);
- _GLD_TEST_STATE(_NEW_STENCIL);
- _GLD_TEST_STATE(_NEW_FOG);
- _GLD_TEST_STATE(_NEW_LIGHT);
- _GLD_TEST_STATE(_NEW_VIEWPORT);
-
- _GLD_IGNORE_STATE(_NEW_TRANSFORM);
-
- // Scissor Test: New for DX9
- _GLD_TEST_STATE(_NEW_SCISSOR);
-
-// Stubs for future use.
-/* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_STATE(_NEW_ACCUM);
- _GLD_TEST_STATE(_NEW_EVAL);
- _GLD_TEST_STATE(_NEW_HINT);
- _GLD_TEST_STATE(_NEW_LINE);
- _GLD_TEST_STATE(_NEW_PIXEL);
- _GLD_TEST_STATE(_NEW_POINT);
- _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE);
- _GLD_TEST_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_STATE(_NEW_ARRAY);
- _GLD_TEST_STATE(_NEW_RENDERMODE);
- _GLD_TEST_STATE(_NEW_BUFFERS);
- _GLD_TEST_STATE(_NEW_MULTISAMPLE);
-*/
-
-// For debugging.
-#if 0
-#define _GLD_TEST_UNHANDLED_STATE(a) \
- if (new_state & (a)) { \
- gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \
- }
- _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX);
- _GLD_TEST_UNHANDLED_STATE(_NEW_ACCUM);
- _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_HINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_LINE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POINT);
- _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE);
-// _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR);
- _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK);
- _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY);
- _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE);
- _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS);
- _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE);
-#undef _GLD_UNHANDLED_STATE
-#endif
-
-#undef _GLD_TEST_STATE
-}
-
-//---------------------------------------------------------------------------
-// Viewport
-//---------------------------------------------------------------------------
-
-void gld_Viewport_DX9(
- GLcontext *ctx,
- GLint x,
- GLint y,
- GLsizei w,
- GLsizei h)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DVIEWPORT9 d3dvp;
-
- if (!gld || !gld->pDev)
- return;
-
- // This is a hack. When the app is minimized, Mesa passes
- // w=1 and h=1 for viewport dimensions. Without this test
- // we get a GPF in gld_wgl_resize_buffers().
- if ((w==1) && (h==1))
- return;
-
- // Call ResizeBuffersMESA. This function will early-out
- // if no resize is needed.
- //ctx->Driver.ResizeBuffersMESA(ctx);
- // Mesa 5: Changed parameters
- ctx->Driver.ResizeBuffers(gldCtx->glBuffer);
-
-#if 0
- ddlogPrintf(GLDLOG_SYSTEM, ">> Viewport x=%d y=%d w=%d h=%d", x,y,w,h);
-#endif
-
- // ** D3D viewport must not be outside the render target surface **
- // Sanity check the GL viewport dimensions
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- if (w > gldCtx->dwWidth) w = gldCtx->dwWidth;
- if (h > gldCtx->dwHeight) h = gldCtx->dwHeight;
- // Ditto for D3D viewport dimensions
- if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x;
- if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y;
-
- d3dvp.X = x;
- d3dvp.Y = gldCtx->dwHeight - (y + h);
- d3dvp.Width = w;
- d3dvp.Height = h;
- if (ctx->Viewport.Near <= ctx->Viewport.Far) {
- d3dvp.MinZ = ctx->Viewport.Near;
- d3dvp.MaxZ = ctx->Viewport.Far;
- } else {
- d3dvp.MinZ = ctx->Viewport.Far;
- d3dvp.MaxZ = ctx->Viewport.Near;
- }
-
- // TODO: DEBUGGING
-// d3dvp.MinZ = 0.0f;
-// d3dvp.MaxZ = 1.0f;
-
- _GLD_DX9_DEV(SetViewport(gld->pDev, &d3dvp));
-
-}
-
-//---------------------------------------------------------------------------
-
-extern BOOL dglWglResizeBuffers(GLcontext *ctx, BOOL bDefaultDriver);
-
-// Mesa 5: Parameter change
-void gldResizeBuffers_DX9(
-// GLcontext *ctx)
- GLframebuffer *fb)
-{
- GET_CURRENT_CONTEXT(ctx);
- dglWglResizeBuffers(ctx, TRUE);
-}
-
-//---------------------------------------------------------------------------
-#ifdef _DEBUG
-// This is only for debugging.
-// To use, plug into ctx->Driver.Enable pointer below.
-void gld_Enable(
- GLcontext *ctx,
- GLenum e,
- GLboolean b)
-{
- char buf[1024];
- sprintf(buf, "Enable: %s (%s)\n", _mesa_lookup_enum_by_nr(e), b?"TRUE":"FALSE");
- ddlogMessage(DDLOG_SYSTEM, buf);
-}
-#endif
-//---------------------------------------------------------------------------
-// Driver pointer setup
-//---------------------------------------------------------------------------
-
-extern const GLubyte* _gldGetStringGeneric(GLcontext*, GLenum);
-
-void gldSetupDriverPointers_DX9(
- GLcontext *ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- // Mandatory functions
- ctx->Driver.GetString = _gldGetStringGeneric;
- ctx->Driver.UpdateState = gld_update_state_DX9;
- ctx->Driver.Clear = gld_Clear_DX9;
- ctx->Driver.DrawBuffer = gld_set_draw_buffer_DX9;
- ctx->Driver.GetBufferSize = gld_buffer_size_DX9;
- ctx->Driver.Finish = gld_Finish_DX9;
- ctx->Driver.Flush = gld_Flush_DX9;
- ctx->Driver.Error = gld_Error_DX9;
-
- // Hardware accumulation buffer
- ctx->Driver.Accum = NULL; // TODO: gld_Accum;
-
- // Bitmap functions
- ctx->Driver.CopyPixels = gld_CopyPixels_DX9;
- ctx->Driver.DrawPixels = gld_DrawPixels_DX9;
- ctx->Driver.ReadPixels = gld_ReadPixels_DX9;
- ctx->Driver.Bitmap = gld_Bitmap_DX9;
-
- // Buffer resize
- ctx->Driver.ResizeBuffers = gldResizeBuffers_DX9;
-
- // Texture image functions
- ctx->Driver.ChooseTextureFormat = gld_ChooseTextureFormat_DX9;
- ctx->Driver.TexImage1D = gld_TexImage1D_DX9;
- ctx->Driver.TexImage2D = gld_TexImage2D_DX9;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage1D = gld_TexSubImage1D_DX9;
- ctx->Driver.TexSubImage2D = gld_TexSubImage2D_DX9;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
-
- ctx->Driver.CopyTexImage1D = gldCopyTexImage1D_DX9; //NULL;
- ctx->Driver.CopyTexImage2D = gldCopyTexImage2D_DX9; //NULL;
- ctx->Driver.CopyTexSubImage1D = gldCopyTexSubImage1D_DX9; //NULL;
- ctx->Driver.CopyTexSubImage2D = gldCopyTexSubImage2D_DX9; //NULL;
- ctx->Driver.CopyTexSubImage3D = gldCopyTexSubImage3D_DX9;
- ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
-
- // Texture object functions
- ctx->Driver.BindTexture = NULL;
- ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!;
- ctx->Driver.DeleteTexture = gld_DeleteTexture_DX9;
- ctx->Driver.PrioritizeTexture = NULL;
-
- // Imaging functionality
- ctx->Driver.CopyColorTable = NULL;
- ctx->Driver.CopyColorSubTable = NULL;
- ctx->Driver.CopyConvolutionFilter1D = NULL;
- ctx->Driver.CopyConvolutionFilter2D = NULL;
-
- // State changing functions
- ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc;
- ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc;
- ctx->Driver.ClearColor = NULL; //gld_ClearColor;
- ctx->Driver.ClearDepth = NULL; //gld_ClearDepth;
- ctx->Driver.ClearStencil = NULL; //gld_ClearStencil;
- ctx->Driver.ColorMask = NULL; //gld_ColorMask;
- ctx->Driver.CullFace = NULL; //gld_CullFace;
- ctx->Driver.ClipPlane = NULL; //gld_ClipPlane;
- ctx->Driver.FrontFace = NULL; //gld_FrontFace;
- ctx->Driver.DepthFunc = NULL; //gld_DepthFunc;
- ctx->Driver.DepthMask = NULL; //gld_DepthMask;
- ctx->Driver.DepthRange = NULL;
- ctx->Driver.Enable = NULL; //gld_Enable;
- ctx->Driver.Fogfv = NULL; //gld_Fogfv;
- ctx->Driver.Hint = NULL; //gld_Hint;
- ctx->Driver.Lightfv = NULL; //gld_Lightfv;
- ctx->Driver.LightModelfv = NULL; //gld_LightModelfv;
- ctx->Driver.LineStipple = NULL; //gld_LineStipple;
- ctx->Driver.LineWidth = NULL; //gld_LineWidth;
- ctx->Driver.LogicOpcode = NULL; //gld_LogicOpcode;
- ctx->Driver.PointParameterfv = NULL; //gld_PointParameterfv;
- ctx->Driver.PointSize = NULL; //gld_PointSize;
- ctx->Driver.PolygonMode = NULL; //gld_PolygonMode;
- ctx->Driver.PolygonOffset = NULL; //gld_PolygonOffset;
- ctx->Driver.PolygonStipple = NULL; //gld_PolygonStipple;
- ctx->Driver.RenderMode = NULL; //gld_RenderMode;
- ctx->Driver.Scissor = NULL; //gld_Scissor;
- ctx->Driver.ShadeModel = NULL; //gld_ShadeModel;
- ctx->Driver.StencilFunc = NULL; //gld_StencilFunc;
- ctx->Driver.StencilMask = NULL; //gld_StencilMask;
- ctx->Driver.StencilOp = NULL; //gld_StencilOp;
- ctx->Driver.TexGen = NULL; //gld_TexGen;
- ctx->Driver.TexEnv = NULL;
- ctx->Driver.TexParameter = NULL;
- ctx->Driver.TextureMatrix = NULL; //gld_TextureMatrix;
- ctx->Driver.Viewport = gld_Viewport_DX9;
-
- _swsetup_Wakeup(ctx);
-
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- tnl->Driver.Render.ResetLineStipple = gld_ResetLineStipple_DX9;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
-
- // Hook into glFrustum() and glOrtho()
-// ctx->Exec->Frustum = gldFrustumHook_DX9;
-// ctx->Exec->Ortho = gldOrthoHook_DX9;
-
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h b/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h
deleted file mode 100644
index aec40ac9dd1..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 9.0 header file
-*
-****************************************************************************/
-
-#ifndef _GLD_DX9_H
-#define _GLD_DX9_H
-
-//---------------------------------------------------------------------------
-// Windows includes
-//---------------------------------------------------------------------------
-
-//#ifndef STRICT
-//#define STRICT
-//#endif
-
-//#define WIN32_LEAN_AND_MEAN
-//#include <windows.h>
-#include <d3d9.h>
-#include <d3dx9.h>
-
-// MS screwed up with the DX8.1 SDK - there's no compile-time
-// method of compiling for 8.0 via the 8.1 SDK unless you
-// "make sure you don't use any 8.1 interfaces".
-// We CAN use 8.1 D3DX static functions, though - just not new 8.1 interfaces.
-//
-// D3D_SDK_VERSION is 120 for 8.0 (supported by Windows 95).
-// D3D_SDK_VERSION is 220 for 8.1 (NOT supported by Windows 95).
-//
-//#define D3D_SDK_VERSION_DX9_SUPPORT_WIN95 120
-//#define D3D_SDK_VERSION_DX91 220
-
-// Typedef for obtaining function from d3d8.dll
-typedef IDirect3D9* (WINAPI *FNDIRECT3DCREATE9) (UINT);
-
-
-//---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-
-#ifdef _DEBUG
-#define _GLD_TEST_HRESULT(h) \
-{ \
- HRESULT _hr = (h); \
- if (FAILED(_hr)) { \
- gldLogError(GLDLOG_ERROR, #h, _hr); \
- } \
-}
-#define _GLD_DX9(func) _GLD_TEST_HRESULT(IDirect3D9_##func##)
-#define _GLD_DX9_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice9_##func##)
-#define _GLD_DX9_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer9_##func##)
-#define _GLD_DX9_TEX(func) _GLD_TEST_HRESULT(IDirect3DTexture9_##func##)
-#else
-#define _GLD_DX9(func) IDirect3D9_##func
-#define _GLD_DX9_DEV(func) IDirect3DDevice9_##func
-#define _GLD_DX9_VB(func) IDirect3DVertexBuffer9_##func
-#define _GLD_DX9_TEX(func) IDirect3DTexture9_##func
-#endif
-
-#define SAFE_RELEASE(p) \
-{ \
- if (p) { \
- (p)->lpVtbl->Release(p); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_VB9(p) \
-{ \
- if (p) { \
- IDirect3DVertexBuffer9_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-#define SAFE_RELEASE_SURFACE9(p) \
-{ \
- if (p) { \
- IDirect3DSurface9_Release((p)); \
- (p) = NULL; \
- } \
-}
-
-// Setup index.
-enum {
- GLD_SI_FLAT = 0,
- GLD_SI_SMOOTH = 1,
- GLD_SI_FLAT_EXTRAS = 2,
- GLD_SI_SMOOTH_EXTRAS = 3,
-};
-/*
-// Internal pipeline
-typedef enum {
- GLD_PIPELINE_MESA = 0, // Mesa pipeline
- GLD_PIPELINE_D3D_FVF = 1, // Direct3D Fixed-function pipeline
- GLD_PIPELINE_D3D_VS_TWOSIDE = 2 // Direct3D two-sided-lighting vertex shader
-} GLD_tnl_pipeline;
-*/
-//---------------------------------------------------------------------------
-// Vertex definitions for Fixed-Function pipeline
-//---------------------------------------------------------------------------
-
-//
-// NOTE: If the number of texture units is altered then most of
-// the texture code will need to be revised.
-//
-
-#define GLD_MAX_TEXTURE_UNITS_DX9 2
-
-//
-// 2D vertex transformed by Mesa
-//
-#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \
- D3DFVF_DIFFUSE | \
- D3DFVF_SPECULAR | \
- D3DFVF_TEX2)
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT sz; // Screen Z (depth)
- FLOAT rhw; // Reciprocal homogenous W
- DWORD diffuse; // Diffuse colour
- DWORD specular; // For separate-specular support
- FLOAT t0_u, t0_v; // 1st set of texture coords
- FLOAT t1_u, t1_v; // 2nd set of texture coords
-} GLD_2D_VERTEX;
-
-
-//
-// 3D vertex transformed by Direct3D
-//
-#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \
- D3DFVF_DIFFUSE | \
- D3DFVF_TEX2)
-
-typedef struct {
- D3DXVECTOR3 Position; // XYZ Vector in object space
- D3DCOLOR Diffuse; // Diffuse colour
- D3DXVECTOR2 TexUnit0; // Texture unit 0
- D3DXVECTOR2 TexUnit1; // Texture unit 1
-} GLD_3D_VERTEX;
-
-//---------------------------------------------------------------------------
-// Vertex Shaders
-//---------------------------------------------------------------------------
-/*
-// DX8 Vertex Shader
-typedef struct {
- DWORD hShader; // If NULL, shader is invalid and cannot be used
- BOOL bHardware; // If TRUE then shader was created for hardware,
- // otherwise shader was created for software.
-} GLD_vertexShader;
-*/
-//---------------------------------------------------------------------------
-// Structs
-//---------------------------------------------------------------------------
-
-// This keeps a count of how many times we choose each individual internal
-// pathway. Useful for seeing if a certain pathway was ever used by an app, and
-// how much each pathway is biased.
-// Zero the members at context creation and dump stats at context deletion.
-typedef struct {
- // Note: DWORD is probably too small
- ULARGE_INTEGER qwMesa; // Mesa TnL pipeline
- ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline
-// ULARGE_INTEGER dwD3D2SVS; // Direct3D Two-Sided Vertex Shader pipeline
-} GLD_pipeline_usage;
-
-// GLDirect Primitive Buffer (points, lines, triangles and quads)
-typedef struct {
- // Data for IDirect3DDevice9::CreateVertexBuffer()
- DWORD dwStride; // Stride of vertex
- DWORD dwUsage; // Usage flags
- DWORD dwFVF; // Direct3D Flexible Vertex Format
- DWORD dwPool; // Pool flags
-
- IDirect3DVertexBuffer9 *pVB; // Holds points, lines, tris and quads.
-
- // Point list is assumed to be at start of buffer
- DWORD iFirstLine; // Index of start of line list
- DWORD iFirstTriangle; // Index of start of triangle list
-
- BYTE *pPoints; // Pointer to next free point
- BYTE *pLines; // Pointer to next free line
- BYTE *pTriangles; // Pointer to next free triangle
-
- DWORD nPoints; // Number of points ready to render
- DWORD nLines; // Number of lines ready to render
- DWORD nTriangles; // Number of triangles ready to render
-} GLD_pb_dx9;
-
-// GLDirect DX9 driver data
-typedef struct {
- // GLDirect vars
- BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered)
- BOOL bDepthStencil; // Depth buffer needed (stencil optional)
- D3DFORMAT RenderFormat; // Format of back/front buffer
- D3DFORMAT DepthFormat; // Format of depth/stencil
-// float fFlipWindowY; // Value for flipping viewport Y coord
-
- // Direct3D vars
- D3DCAPS9 d3dCaps9;
- BOOL bHasHWTnL; // Device has Hardware Transform/Light?
- IDirect3D9 *pD3D; // Base Direct3D9 interface
- IDirect3DDevice9 *pDev; // Direct3D9 Device interface
- GLD_pb_dx9 PB2d; // Vertices transformed by Mesa
- GLD_pb_dx9 PB3d; // Vertices transformed by Direct3D
- D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type
- D3DXMATRIX matProjection; // Projection matrix for D3D TnL
- D3DXMATRIX matModelView; // Model/View matrix for D3D TnL
- int iSetupFunc; // Which setup functions to use
- BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL
-
- // Direct3D vars for two-sided lighting
-// GLD_vertexShader VStwosidelight; // Vertex Shader for two-sided lighting
-// D3DXMATRIX matWorldViewProj;// World/View/Projection matrix for shaders
-
-
-// GLD_tnl_pipeline TnLPipeline; // Index of current internal pipeline
- GLD_pipeline_usage PipelineUsage;
-
- BOOL bCanScissor; // Scissor test - new for DX9
-} GLD_driver_dx9;
-
-#define GLD_GET_DX9_DRIVER(c) (GLD_driver_dx9*)(c)->glPriv
-
-//---------------------------------------------------------------------------
-// Function prototypes
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX9(LPCSTR a);
-void gldEnableExtensions_DX9(GLcontext *ctx);
-void gldInstallPipeline_DX9(GLcontext *ctx);
-void gldSetupDriverPointers_DX9(GLcontext *ctx);
-//void gldResizeBuffers_DX9(GLcontext *ctx);
-void gldResizeBuffers_DX9(GLframebuffer *fb);
-
-
-// Texture functions
-
-void gldCopyTexImage1D_DX9(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-void gldCopyTexImage2D_DX9(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void gldCopyTexSubImage1D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
-void gldCopyTexSubImage2D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-void gldCopyTexSubImage3D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-
-void gld_NEW_TEXTURE_DX9(GLcontext *ctx);
-void gld_DrawPixels_DX9(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels);
-void gld_ReadPixels_DX9(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest);
-void gld_CopyPixels_DX9(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type);
-void gld_Bitmap_DX9(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
-const struct gl_texture_format* gld_ChooseTextureFormat_DX9(GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType);
-void gld_TexImage2D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *tObj, struct gl_texture_image *texImage);
-void gld_TexImage1D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage2D_DX9( GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
-void gld_TexSubImage1D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage);
-void gld_DeleteTexture_DX9(GLcontext *ctx, struct gl_texture_object *tObj);
-void gld_ResetLineStipple_DX9(GLcontext *ctx);
-
-// 2D primitive functions
-
-void gld_Points2D_DX9(GLcontext *ctx, GLuint first, GLuint last);
-
-void gld_Line2DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1);
-
-void gld_Triangle2DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DFlatExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-
-void gld_Quad2DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DFlatExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// 3D primitive functions
-
-void gld_Points3D_DX9(GLcontext *ctx, GLuint first, GLuint last);
-void gld_Line3DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Line3DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle3DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad3DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-// Primitive functions for Two-sided-lighting Vertex Shader
-
-void gld_Points2DTwoside_DX9(GLcontext *ctx, GLuint first, GLuint last);
-void gld_Line2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Line2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1);
-void gld_Triangle2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Triangle2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2);
-void gld_Quad2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void gld_Quad2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-#endif
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h b/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h
deleted file mode 100644
index 1d6b7b1c760..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*==========================================================================;
- *
- *
- * File: dxerr9.h
- * Content: DirectX Error Library Include File
- *
- ****************************************************************************/
-
-#ifndef _GLD_DXERR9_H_
-#define _GLD_DXERR9_H_
-
-
-#include <d3d9.h>
-
-//
-// DXGetErrorString9
-//
-// Desc: Converts an DirectX HRESULT to a string
-//
-// Args: HRESULT hr Can be any error code from
-// DPLAY D3D8 D3DX8 DMUSIC DSOUND
-//
-// Return: Converted string
-//
-const char* __stdcall DXGetErrorString9A(HRESULT hr);
-const WCHAR* __stdcall DXGetErrorString9W(HRESULT hr);
-
-#ifdef UNICODE
- #define DXGetErrorString9 DXGetErrorString9W
-#else
- #define DXGetErrorString9 DXGetErrorString9A
-#endif
-
-
-//
-// DXTrace
-//
-// Desc: Outputs a formatted error message to the debug stream
-//
-// Args: CHAR* strFile The current file, typically passed in using the
-// __FILE__ macro.
-// DWORD dwLine The current line number, typically passed in using the
-// __LINE__ macro.
-// HRESULT hr An HRESULT that will be traced to the debug stream.
-// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
-// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
-//
-// Return: The hr that was passed in.
-//
-//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
-//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
-HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
-HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
-
-#ifdef UNICODE
- #define DXTrace DXTraceW
-#else
- #define DXTrace DXTraceA
-#endif
-
-
-//
-// Helper macros
-//
-#if defined(DEBUG) | defined(_DEBUG)
- #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
- #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
- #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
-#else
- #define DXTRACE_MSG(str) (0L)
- #define DXTRACE_ERR(str,hr) (hr)
- #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
-#endif
-
-
-#endif
-
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c
deleted file mode 100644
index 745c987602b..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GL extensions
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "../gld_settings.h"
-
-#include <windows.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-//#include "ddlog.h"
-//#include "gld_dx8.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "dglcontext.h"
-#include "extensions.h"
-
-// For some reason this is not defined in an above header...
-extern void _mesa_enable_imaging_extensions(GLcontext *ctx);
-
-//---------------------------------------------------------------------------
-// Hack for the SGIS_multitexture extension that was removed from Mesa
-// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel
-
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // To enable, uncomment:
- // _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
-//---------------------------------------------------------------------------
-
-enum {
- /* Quake2 GL_SGIS_multitexture */
- GL_SELECTED_TEXTURE_SGIS = 0x835B,
- GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C,
- GL_MAX_TEXTURES_SGIS = 0x835D,
- GL_TEXTURE0_SGIS = 0x835E,
- GL_TEXTURE1_SGIS = 0x835F,
- GL_TEXTURE2_SGIS = 0x8360,
- GL_TEXTURE3_SGIS = 0x8361,
- GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363,
-};
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldSelectTextureSGIS(
- GLenum target)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glActiveTextureARB(ARB_target);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fSGIS(
- GLenum target,
- GLfloat s,
- GLfloat t)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fARB(ARB_target, s, t);
-}
-
-//---------------------------------------------------------------------------
-
-void APIENTRY gldMTexCoord2fvSGIS(
- GLenum target,
- const GLfloat *v)
-{
- GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
- glMultiTexCoord2fvARB(ARB_target, v);
-}
-
-//---------------------------------------------------------------------------
-// Extensions
-//---------------------------------------------------------------------------
-
-typedef struct {
- PROC proc;
- char *name;
-} GLD_extension;
-
-GLD_extension GLD_extList[] = {
-#ifdef GL_EXT_polygon_offset
- { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
-#endif
- { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
- { (PROC)glBlendColorEXT, "glBlendColorExt" },
- { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
- { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
- { (PROC)glColorPointerEXT, "glColorPointerEXT" },
- { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
- { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
- { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
- { (PROC)glGetPointervEXT, "glGetPointervEXT" },
- { (PROC)glArrayElementEXT, "glArrayElementEXT" },
- { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
- { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
- { (PROC)glBindTextureEXT, "glBindTextureEXT" },
- { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
- { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
- { (PROC)glIsTextureEXT, "glIsTextureEXT" },
- { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
- { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
- { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
- { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
- { (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
- { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
-
- { (PROC)glLockArraysEXT, "glLockArraysEXT" },
- { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
- { NULL, "\0" }
-};
-
-GLD_extension GLD_multitexList[] = {
-/*
- { (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" },
- { (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" },
- { (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" },
- { (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" },
- { (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" },
- { (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" },
- { (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" },
- { (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" },
- { (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" },
- { (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" },
- { (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
- { (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" },
- { (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" },
- { (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" },
- { (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" },
- { (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" },
- { (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" },
- { (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" },
- { (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" },
- { (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" },
- { (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" },
- { (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" },
- { (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" },
- { (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" },
- { (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" },
- { (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" },
- { (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" },
- { (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" },
- { (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" },
- { (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" },
- { (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" },
- { (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" },
- { (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" },
-*/
- { (PROC)glActiveTextureARB, "glActiveTextureARB" },
- { (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" },
- { (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" },
- { (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" },
- { (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" },
- { (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" },
- { (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" },
- { (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" },
- { (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" },
- { (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" },
- { (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" },
- { (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" },
- { (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" },
- { (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" },
- { (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" },
- { (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" },
- { (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" },
- { (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" },
- { (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" },
- { (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" },
- { (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" },
- { (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" },
- { (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" },
- { (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" },
- { (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" },
- { (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" },
- { (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" },
- { (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" },
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" },
- { (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" },
- { (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" },
- { (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" },
- { (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" },
- { (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" },
-
- // Descent3 doesn't use correct string, hence this hack
- { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" },
-
- // Quake2 SGIS multitexture
- { (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" },
- { (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" },
- { (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
-
- { NULL, "\0" }
-};
-
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_DX(
- LPCSTR a)
-{
- int i;
- PROC proc = NULL;
-
- for (i=0; GLD_extList[i].proc; i++) {
- if (!strcmp(a, GLD_extList[i].name)) {
- proc = GLD_extList[i].proc;
- break;
- }
- }
-
- if (glb.bMultitexture) {
- for (i=0; GLD_multitexList[i].proc; i++) {
- if (!strcmp(a, GLD_multitexList[i].name)) {
- proc = GLD_multitexList[i].proc;
- break;
- }
- }
- }
-
- gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
-
- return proc;
-}
-
-//---------------------------------------------------------------------------
-
-void gldEnableExtensions_DX9(
- GLcontext *ctx)
-{
- GLuint i;
-
- // Mesa enables some extensions by default.
- // This table decides which ones we want to switch off again.
-
- // NOTE: GL_EXT_compiled_vertex_array appears broken.
-
- const char *gld_disable_extensions[] = {
-// "GL_ARB_transpose_matrix",
-// "GL_EXT_compiled_vertex_array",
-// "GL_EXT_polygon_offset",
-// "GL_EXT_rescale_normal",
- "GL_EXT_texture3D",
-// "GL_NV_texgen_reflection",
- NULL
- };
-
- const char *gld_multitex_extensions[] = {
- "GL_ARB_multitexture", // Quake 3
- NULL
- };
-
- // Quake 2 engines
- const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture";
-
- const char *gld_enable_extensions[] = {
- "GL_EXT_texture_env_add", // Quake 3
- "GL_ARB_texture_env_add", // Quake 3
- NULL
- };
-
- for (i=0; gld_disable_extensions[i]; i++) {
- _mesa_disable_extension(ctx, gld_disable_extensions[i]);
- }
-
- for (i=0; gld_enable_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_enable_extensions[i]);
- }
-
- if (glb.bMultitexture) {
- for (i=0; gld_multitex_extensions[i]; i++) {
- _mesa_enable_extension(ctx, gld_multitex_extensions[i]);
- }
-
- // GL_SGIS_multitexture
- // NOTE: Quake2 ran *slower* with this enabled, so I've
- // disabled it for now.
- // Fair bit slower on GeForce256,
- // Much slower on 3dfx Voodoo5 5500.
-// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
-
- }
-
- _mesa_enable_imaging_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
- _mesa_enable_1_4_extensions(ctx);
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c
deleted file mode 100644
index 2b272aa6281..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Mesa transformation pipeline with GLDirect fastpath
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-
-extern struct tnl_pipeline_stage _gld_d3d_render_stage;
-extern struct tnl_pipeline_stage _gld_mesa_render_stage;
-
-static const struct tnl_pipeline_stage *gld_pipeline[] = {
- &_gld_d3d_render_stage, // Direct3D TnL
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
- &_gld_mesa_render_stage, // Mesa TnL, D3D rendering
- 0,
-};
-
-//---------------------------------------------------------------------------
-
-void gldInstallPipeline_DX9(
- GLcontext *ctx)
-{
- // Remove any existing pipeline stages,
- // then install GLDirect pipeline stages.
-
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, gld_pipeline);
-}
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
deleted file mode 100644
index 65fd821276e..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
+++ /dev/null
@@ -1,1446 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Primitive (points/lines/tris/quads) rendering
-*
-****************************************************************************/
-
-//#include "../GLDirect.h"
-
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "swrast/s_context.h"
-#include "swrast/s_depth.h"
-#include "swrast/s_lines.h"
-#include "swrast/s_triangle.h"
-#include "swrast/s_trispan.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-// Disable compiler complaints about unreferenced local variables
-#pragma warning (disable:4101)
-
-//---------------------------------------------------------------------------
-// Helper defines for primitives
-//---------------------------------------------------------------------------
-
-//static const float ooZ = 1.0f / 65536.0f; // One over Z
-
-#define GLD_COLOUR (D3DCOLOR_RGBA(swv->color[0], swv->color[1], swv->color[2], swv->color[3]))
-#define GLD_SPECULAR (D3DCOLOR_RGBA(swv->specular[0], swv->specular[1], swv->specular[2], swv->specular[3]))
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-//---------------------------------------------------------------------------
-// 2D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_2D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pPoints; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pLines; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour
-
-#define GLD_SETUP_2D_VARS_TRIANGLES \
- BOOL bFog = ctx->Fog.Enabled; \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pTriangles; \
- SScontext *ss = SWSETUP_CONTEXT(ctx); \
- SWvertex *swv; \
- DWORD dwSpecularColour; \
- DWORD dwFlatColour; \
- GLuint facing = 0; \
- struct vertex_buffer *VB; \
- GLchan (*vbcolor)[4]; \
- GLchan (*vbspec)[4]
-
-#define GLD_SETUP_GET_SWVERT(s) \
- swv = &ss->verts[##s]
-
-#define GLD_SETUP_2D_VERTEX \
- pV->x = swv->win[0]; \
- pV->y = GLD_FLIP_Y(swv->win[1]); \
- pV->rhw = swv->win[3]
-
-#define GLD_SETUP_SMOOTH_COLOUR \
- pV->diffuse = GLD_COLOUR
-
-#define GLD_SETUP_GET_FLAT_COLOUR \
- dwFlatColour = GLD_COLOUR
-#define GLD_SETUP_GET_FLAT_FOG_COLOUR \
- dwFlatColour = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_USE_FLAT_COLOUR \
- pV->diffuse = dwFlatColour
-
-#define GLD_SETUP_GET_FLAT_SPECULAR \
- dwSpecularColour= GLD_SPECULAR
-
-#define GLD_SETUP_USE_FLAT_SPECULAR \
- pV->specular = dwSpecularColour
-
-#define GLD_SETUP_DEPTH \
- pV->sz = swv->win[2] / ctx->DepthMaxF
-// pV->z = swv->win[2] * ooZ;
-
-#define GLD_SETUP_SPECULAR \
- pV->specular = GLD_SPECULAR
-
-#define GLD_SETUP_FOG \
- pV->diffuse = _gldComputeFog(ctx, swv)
-
-#define GLD_SETUP_TEX0 \
- pV->t0_u = swv->texcoord[0][0]; \
- pV->t0_v = swv->texcoord[0][1]
-
-#define GLD_SETUP_TEX1 \
- pV->t1_u = swv->texcoord[1][0]; \
- pV->t1_v = swv->texcoord[1][1]
-
-#define GLD_SETUP_LIGHTING(v) \
- if (facing == 1) { \
- pV->diffuse = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- pV->specular = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- } else { \
- if (bFog) \
- GLD_SETUP_FOG; \
- else \
- GLD_SETUP_SMOOTH_COLOUR; \
- GLD_SETUP_SPECULAR; \
- }
-
-#define GLD_SETUP_GET_FLAT_LIGHTING(v) \
- if (facing == 1) { \
- dwFlatColour = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \
- if (vbspec) { \
- dwSpecularColour = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \
- } \
- }
-
-#define GLD_SETUP_TWOSIDED_LIGHTING \
- /* Two-sided lighting */ \
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { \
- SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; \
- SWvertex *v[3]; \
- GLfloat ex,ey,fx,fy,cc; \
- /* Get vars for later */ \
- VB = &TNL_CONTEXT(ctx)->vb; \
- vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \
- if (VB->SecondaryColorPtr[1]) { \
- vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
- } else { \
- vbspec = NULL; \
- } \
- v[0] = &verts[v0]; \
- v[1] = &verts[v1]; \
- v[2] = &verts[v2]; \
- ex = v[0]->win[0] - v[2]->win[0]; \
- ey = v[0]->win[1] - v[2]->win[1]; \
- fx = v[1]->win[0] - v[2]->win[0]; \
- fy = v[1]->win[1] - v[2]->win[1]; \
- cc = ex*fy - ey*fx; \
- facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; \
- }
-
-//---------------------------------------------------------------------------
-// 3D vertex setup
-//---------------------------------------------------------------------------
-
-#define GLD_SETUP_3D_VARS_POINTS \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pPoints; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_LINES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pLines; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VARS_TRIANGLES \
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \
- GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pTriangles; \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- GLfloat (*p4f)[4]; \
- GLfloat (*tc)[4]; \
- DWORD dwColor;
-
-#define GLD_SETUP_3D_VERTEX(v) \
- p4f = VB->ObjPtr->data; \
- pV->Position.x = p4f[##v][0]; \
- pV->Position.y = p4f[##v][1]; \
- pV->Position.z = p4f[##v][2];
-
-#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
- pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-
-#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
- dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
-
-#define GLD_SETUP_USE_FLAT_COLOUR_3D \
- pV->Diffuse = dwColor;
-
-#define GLD_SETUP_TEX0_3D(v) \
- if (VB->TexCoordPtr[0]) { \
- tc = VB->TexCoordPtr[0]->data; \
- pV->TexUnit0.x = tc[##v][0]; \
- pV->TexUnit0.y = tc[##v][1]; \
- }
-
-#define GLD_SETUP_TEX1_3D(v) \
- if (VB->TexCoordPtr[1]) { \
- tc = VB->TexCoordPtr[1]->data; \
- pV->TexUnit1.x = tc[##v][0]; \
- pV->TexUnit1.y = tc[##v][1]; \
- }
-
-//---------------------------------------------------------------------------
-// Helper functions
-//---------------------------------------------------------------------------
-
-__inline DWORD _gldComputeFog(
- GLcontext *ctx,
- SWvertex *swv)
-{
- // Full fog calculation.
- // Based on Mesa code.
-
- GLchan rFog, gFog, bFog;
- GLchan fR, fG, fB;
- const GLfloat f = swv->fog;
- const GLfloat g = 1.0 - f;
-
- UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]);
- fR = f * swv->color[0] + g * rFog;
- fG = f * swv->color[1] + g * gFog;
- fB = f * swv->color[2] + g * bFog;
- return D3DCOLOR_RGBA(fR, fG, fB, swv->color[3]);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ResetLineStipple_DX9(
- GLcontext *ctx)
-{
- // TODO: Fake stipple with a 32x32 texture.
-}
-
-//---------------------------------------------------------------------------
-// 2D (post-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points2D_DX9(
- GLcontext *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_2D_VARS_POINTS;
-
- unsigned i;
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
- GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- } else {
- GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, swv++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- }
- }
- }
-
- gld->PB2d.pPoints = (BYTE*)pV;
- gld->PB2d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlat_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmooth_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_2D_VARS_LINES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_SPECULAR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pLines = (BYTE*)pV;
- gld->PB2d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlat_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmooth_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
-
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatExtras_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v2);
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v2);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothExtras_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlat_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmooth_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_SMOOTH_COLOUR;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatExtras_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v3);
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- if (bFog)
- GLD_SETUP_GET_FLAT_FOG_COLOUR;
- else
- GLD_SETUP_GET_FLAT_COLOUR;
- GLD_SETUP_GET_FLAT_SPECULAR;
- GLD_SETUP_GET_FLAT_LIGHTING(v3);
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_USE_FLAT_COLOUR;
- GLD_SETUP_USE_FLAT_SPECULAR;
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothExtras_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_2D_VARS_TRIANGLES;
-
- GLD_SETUP_TWOSIDED_LIGHTING(v0);
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v1);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v1);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v2);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v2);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v3);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v3);
- pV++;
-
- GLD_SETUP_GET_SWVERT(v0);
- GLD_SETUP_2D_VERTEX;
- GLD_SETUP_DEPTH;
- GLD_SETUP_TEX0;
- GLD_SETUP_TEX1;
- GLD_SETUP_LIGHTING(v0);
- pV++;
-
- gld->PB2d.pTriangles = (BYTE*)pV;
- gld->PB2d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// 3D (pre-transformed) primitives
-//---------------------------------------------------------------------------
-
-void gld_Points3D_DX9(
- GLcontext *ctx,
- GLuint first,
- GLuint last)
-{
- GLD_SETUP_3D_VARS_POINTS
-
- unsigned i;
-// struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- // _Size is already clamped to MaxPointSize and MinPointSize
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size));
-
- if (VB->Elts) {
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[VB->Elts[i]] == 0) {
-// _swrast_Point( ctx, &verts[VB->Elts[i]] );
-// GLD_SETUP_GET_SWVERT(VB->Elts[i]);
- GLD_SETUP_3D_VERTEX(VB->Elts[i])
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- } else {
-// GLD_SETUP_GET_SWVERT(first);
- for (i=first; i<last; i++, pV++) {
- if (VB->ClipMask[i] == 0) {
-// _swrast_Point( ctx, &verts[i] );
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
- }
- }
-/*
- for (i=first; i<last; i++, pV++) {
- GLD_SETUP_3D_VERTEX(i)
- GLD_SETUP_SMOOTH_COLOUR_3D(i)
- GLD_SETUP_TEX0_3D(i)
- GLD_SETUP_TEX1_3D(i)
- }
-*/
- gld->PB3d.pPoints = (BYTE*)pV;
- gld->PB3d.nPoints += (last-first);
-}
-
-//---------------------------------------------------------------------------
-// Line functions
-//---------------------------------------------------------------------------
-
-void gld_Line3DFlat_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line3DSmooth_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1)
-{
- GLD_SETUP_3D_VARS_LINES
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pLines = (BYTE*)pV;
- gld->PB3d.nLines++;
-}
-
-//---------------------------------------------------------------------------
-// Triangle functions
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DFlat_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle3DSmooth_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-// Quad functions
-//---------------------------------------------------------------------------
-
-void gld_Quad3DFlat_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_GET_FLAT_COLOUR_3D(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_USE_FLAT_COLOUR_3D
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad3DSmooth_DX9(
- GLcontext *ctx,
- GLuint v0,
- GLuint v1,
- GLuint v2,
- GLuint v3)
-{
- GLD_SETUP_3D_VARS_TRIANGLES
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v1)
- GLD_SETUP_SMOOTH_COLOUR_3D(v1)
- GLD_SETUP_TEX0_3D(v1)
- GLD_SETUP_TEX1_3D(v1)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v2)
- GLD_SETUP_SMOOTH_COLOUR_3D(v2)
- GLD_SETUP_TEX0_3D(v2)
- GLD_SETUP_TEX1_3D(v2)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v3)
- GLD_SETUP_SMOOTH_COLOUR_3D(v3)
- GLD_SETUP_TEX0_3D(v3)
- GLD_SETUP_TEX1_3D(v3)
- pV++;
-
- GLD_SETUP_3D_VERTEX(v0)
- GLD_SETUP_SMOOTH_COLOUR_3D(v0)
- GLD_SETUP_TEX0_3D(v0)
- GLD_SETUP_TEX1_3D(v0)
- pV++;
-
- gld->PB3d.pTriangles = (BYTE*)pV;
- gld->PB3d.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-// Vertex setup for two-sided-lighting vertex shader
-//---------------------------------------------------------------------------
-
-/*
-
-void gld_Points2DTwoside_DX9(GLcontext *ctx, GLuint first, GLuint last)
-{
- // NOTE: Two-sided lighting does not apply to Points
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Line2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1)
-{
- // NOTE: Two-sided lighting does not apply to Lines
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Triangle2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles++;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Quad2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles;
- SScontext *ss = SWSETUP_CONTEXT(ctx);
- SWvertex *swv;
- DWORD dwSpecularColour;
- DWORD dwFlatColour;
- GLuint facing = 0;
- struct vertex_buffer *VB;
- GLchan (*vbcolor)[4];
- GLchan (*vbspec)[4];
-
- // Reciprocal of DepthMax
- const float ooDepthMax = 1.0f / ctx->DepthMaxF;
-
- // 1st vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 2nd vert
- swv = &ss->verts[v1];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 3rd vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 4th vert
- swv = &ss->verts[v2];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 5th vert
- swv = &ss->verts[v3];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- // 6th vert
- swv = &ss->verts[v0];
- pV->Position.x = swv->win[0];
- pV->Position.y = GLD_FLIP_Y(swv->win[1]);
- pV->Position.z = swv->win[2] * ooDepthMax;
- pV->Position.w = swv->win[3];
- pV->TexUnit0.x = swv->texcoord[0][0];
- pV->TexUnit0.y = swv->texcoord[0][1];
- pV->TexUnit1.x = swv->texcoord[1][0];
- pV->TexUnit1.y = swv->texcoord[1][1];
- pV->FrontDiffuse = GLD_COLOUR;
- pV->FrontSpecular = GLD_SPECULAR;
- pV++;
-
- gld->PBtwosidelight.pTriangles = (BYTE*)pV;
- gld->PBtwosidelight.nTriangles += 2;
-}
-
-//---------------------------------------------------------------------------
-
-*/
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c
deleted file mode 100644
index 5a822356164..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c
+++ /dev/null
@@ -1,2104 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Texture / Bitmap functions
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-#include <d3dx9tex.h>
-
-#include "texformat.h"
-#include "colormac.h"
-#include "texstore.h"
-#include "image.h"
-// #include "mem.h"
-
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_HEIGHT(y,h) (gldCtx->dwHeight - (y) - (h))
-
-//---------------------------------------------------------------------------
-// 1D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + (i) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (i) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (i))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (i))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_1d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 2D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + ((t)->Width * (j) + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_2d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// 3D texture fetch
-//---------------------------------------------------------------------------
-
-#define CHAN_SRC( t, i, j, k, sz ) \
- (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz)
-#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz))
-#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- GLchan *rgba = (GLchan *)texel;
- rgba[RCOMP] = src[2];
- rgba[GCOMP] = src[1];
- rgba[BCOMP] = src[0];
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X8R8G8B8(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 );
- texel[RCOMP] = CHAN_TO_FLOAT(src[0]);
- texel[GCOMP] = CHAN_TO_FLOAT(src[1]);
- texel[BCOMP] = CHAN_TO_FLOAT(src[2]);
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X1R5G5B5(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLchan *rgba = (GLchan *) texel; GLushort s = *src;
- rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf );
- rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf );
- rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf );
- rgba[ACOMP] = CHAN_MAX;
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_fetch_3d_texel_f_X4R4G4B4(
- const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = USHORT_SRC( texImage, i, j, k );
- GLushort s = *src;
- texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf );
- texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf );
- texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf );
- texel[ACOMP] = 1.f;
-}
-
-//---------------------------------------------------------------------------
-
-#undef CHAN_SRC
-#undef UBYTE_SRC
-#undef USHORT_SRC
-#undef FLOAT_SRC
-
-//---------------------------------------------------------------------------
-// Direct3D texture formats that have no Mesa equivalent
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format _gld_texformat_X8R8G8B8 = {
- MESA_FORMAT_ARGB8888, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 8, /* RedBits */
- 8, /* GreenBits */
- 8, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 4, /* TexelBytes */
- _mesa_texstore_argb8888, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X8R8G8B8, /* FetchTexel1D */
- gld_fetch_2d_texel_X8R8G8B8, /* FetchTexel2D */
- gld_fetch_3d_texel_X8R8G8B8, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X8R8G8B8, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X8R8G8B8, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X8R8G8B8, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X1R5G5B5 = {
- MESA_FORMAT_ARGB1555, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 5, /* RedBits */
- 5, /* GreenBits */
- 5, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb1555, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X1R5G5B5, /* FetchTexel1D */
- gld_fetch_2d_texel_X1R5G5B5, /* FetchTexel2D */
- gld_fetch_3d_texel_X1R5G5B5, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X1R5G5B5, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X1R5G5B5, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X1R5G5B5, /* FetchTexel3Df */
-};
-
-const struct gl_texture_format _gld_texformat_X4R4G4B4 = {
- MESA_FORMAT_ARGB4444, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 4, /* RedBits */
- 4, /* GreenBits */
- 4, /* BlueBits */
- 0, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _mesa_texstore_argb4444, /* StoreTexImageFunc */
- gld_fetch_1d_texel_X4R4G4B4, /* FetchTexel1D */
- gld_fetch_2d_texel_X4R4G4B4, /* FetchTexel2D */
- gld_fetch_3d_texel_X4R4G4B4, /* FetchTexel3D */
- gld_fetch_1d_texel_f_X4R4G4B4, /* FetchTexel1Df */
- gld_fetch_2d_texel_f_X4R4G4B4, /* FetchTexel2Df */
- gld_fetch_3d_texel_f_X4R4G4B4, /* FetchTexel3Df */
-};
-
-//---------------------------------------------------------------------------
-// Texture unit constants
-//---------------------------------------------------------------------------
-
-// List of possible combinations of texture environments.
-// Example: GLD_TEXENV_MODULATE_RGBA means
-// GL_MODULATE, GL_RGBA base internal format.
-#define GLD_TEXENV_DECAL_RGB 0
-#define GLD_TEXENV_DECAL_RGBA 1
-#define GLD_TEXENV_DECAL_ALPHA 2
-#define GLD_TEXENV_REPLACE_RGB 3
-#define GLD_TEXENV_REPLACE_RGBA 4
-#define GLD_TEXENV_REPLACE_ALPHA 5
-#define GLD_TEXENV_MODULATE_RGB 6
-#define GLD_TEXENV_MODULATE_RGBA 7
-#define GLD_TEXENV_MODULATE_ALPHA 8
-#define GLD_TEXENV_BLEND_RGB 9
-#define GLD_TEXENV_BLEND_RGBA 10
-#define GLD_TEXENV_BLEND_ALPHA 11
-#define GLD_TEXENV_ADD_RGB 12
-#define GLD_TEXENV_ADD_RGBA 13
-#define GLD_TEXENV_ADD_ALPHA 14
-
-// Per-stage (i.e. per-unit) texture environment
-typedef struct {
- DWORD ColorArg1; // Colour argument 1
- D3DTEXTUREOP ColorOp; // Colour operation
- DWORD ColorArg2; // Colour argument 2
- DWORD AlphaArg1; // Alpha argument 1
- D3DTEXTUREOP AlphaOp; // Alpha operation
- DWORD AlphaArg2; // Alpha argument 2
-} GLD_texenv;
-
-// TODO: Do we really need to set ARG1 and ARG2 every time?
-// They seem to always be TEXTURE and CURRENT respectively.
-
-// C = Colour out
-// A = Alpha out
-// Ct = Colour from Texture
-// Cf = Colour from fragment (diffuse)
-// At = Alpha from Texture
-// Af = Alpha from fragment (diffuse)
-// Cc = GL_TEXTURE_ENV_COLOUR (GL_BLEND)
-const GLD_texenv gldTexEnv[] = {
- // DECAL_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_RGBA: C=Cf(1-At)+CtAt, A=Af
- {D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // DECAL_ALPHA: <undefined> use DECAL_RGB
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
-
- // REPLACE_RGB: C=Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // REPLACE_RGBA: C=Ct, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
- // REPLACE_ALPHA: C=Cf, A=At
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT},
-
- // MODULATE_RGB: C=CfCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // MODULATE_RGBA: C=CfCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // MODULATE_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // BLEND_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-
- // ADD_RGB: C=Cf+Ct, A=Af
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT},
- // ADD_RGBA: C=Cf+Ct, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
- // ADD_ALPHA: C=Cf, A=AfAt
- {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT,
- D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT},
-};
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREADDRESS _gldConvertWrap(
- GLenum wrap)
-{
- return (wrap == GL_CLAMP) ? D3DTADDRESS_CLAMP : D3DTADDRESS_WRAP;
-}
-
-//---------------------------------------------------------------------------
-
-D3DTEXTUREFILTERTYPE _gldConvertMagFilter(
- GLenum magfilter)
-{
- return (magfilter == GL_LINEAR) ? D3DTEXF_LINEAR : D3DTEXF_POINT;
-}
-
-//---------------------------------------------------------------------------
-
-void _gldConvertMinFilter(
- GLenum minfilter,
- D3DTEXTUREFILTERTYPE *min_filter,
- D3DTEXTUREFILTERTYPE *mip_filter)
-{
- switch (minfilter) {
- case GL_NEAREST:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_NONE;
- break;
- case GL_LINEAR:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_POINT;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_POINT;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- *min_filter = D3DTEXF_POINT;
- *mip_filter = D3DTEXF_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- *min_filter = D3DTEXF_LINEAR;
- *mip_filter = D3DTEXF_LINEAR;
- break;
- }
-}
-
-//---------------------------------------------------------------------------
-
-D3DFORMAT _gldGLFormatToD3DFormat(
- GLenum internalFormat)
-{
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- // LUNIMANCE != INTENSITY, but D3D doesn't have I8 textures
- return D3DFMT_L8;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return D3DFMT_L8;
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return D3DFMT_A8;
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return D3DFMT_X8R8G8B8;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return D3DFMT_A8L8;
- case GL_R3_G3_B2:
- // TODO: Mesa does not support RGB332 internally
- return D3DFMT_X4R4G4B4; //D3DFMT_R3G3B2;
- case GL_RGB4:
- return D3DFMT_X4R4G4B4;
- case GL_RGB5:
- return D3DFMT_X1R5G5B5;
- case 3:
- case GL_RGB:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return D3DFMT_R8G8B8;
- case GL_RGBA4:
- return D3DFMT_A4R4G4B4;
- case 4:
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return D3DFMT_A8R8G8B8;
- case GL_RGB5_A1:
- return D3DFMT_A1R5G5B5;
- }
-
- // Return an acceptable default
- return D3DFMT_A8R8G8B8;
-}
-
-//---------------------------------------------------------------------------
-
-GLenum _gldDecodeBaseFormat(
- IDirect3DTexture9 *pTex)
-{
- // Examine Direct3D texture and return base OpenGL internal texture format
- // NOTE: We can't use any base format info from Mesa because D3D might have
- // used a different texture format when we used D3DXCreateTexture().
-
- // Base internal format is one of (Red Book p355):
- // GL_ALPHA,
- // GL_LUMINANCE,
- // GL_LUMINANCE_ALPHA,
- // GL_INTENSITY,
- // GL_RGB,
- // GL_RGBA
-
- // NOTE: INTENSITY not used (not supported by Direct3D)
- // LUMINANCE has same texture functions as RGB
- // LUMINANCE_ALPHA has same texture functions as RGBA
-
- // TODO: cache format instead of using GetLevelDesc()
- D3DSURFACE_DESC desc;
- _GLD_DX9_TEX(GetLevelDesc(pTex, 0, &desc));
-
- switch (desc.Format) {
- case D3DFMT_R8G8B8:
- case D3DFMT_X8R8G8B8:
- case D3DFMT_R5G6B5:
- case D3DFMT_X1R5G5B5:
- case D3DFMT_R3G3B2:
- case D3DFMT_X4R4G4B4:
- case D3DFMT_P8:
- case D3DFMT_L8:
- return GL_RGB;
- case D3DFMT_A8R8G8B8:
- case D3DFMT_A1R5G5B5:
- case D3DFMT_A4R4G4B4:
- case D3DFMT_A8R3G3B2:
- case D3DFMT_A8P8:
- case D3DFMT_A8L8:
- case D3DFMT_A4L4:
- return GL_RGBA;
- case D3DFMT_A8:
- return GL_ALPHA;
- // Compressed texture formats. Need to check these...
- case D3DFMT_DXT1:
- return GL_RGBA;
- case D3DFMT_DXT2:
- return GL_RGB;
- case D3DFMT_DXT3:
- return GL_RGBA;
- case D3DFMT_DXT4:
- return GL_RGB;
- case D3DFMT_DXT5:
- return GL_RGBA;
- }
-
- // Fell through. Return arbitary default.
- return GL_RGBA;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* _gldMesaFormatForD3DFormat(
- D3DFORMAT d3dfmt)
-{
- switch (d3dfmt) {
- case D3DFMT_A8R8G8B8:
- return &_mesa_texformat_argb8888;
- case D3DFMT_R8G8B8:
- return &_mesa_texformat_rgb888;
- case D3DFMT_R5G6B5:
- return &_mesa_texformat_rgb565;
- case D3DFMT_A4R4G4B4:
- return &_mesa_texformat_argb4444;
- case D3DFMT_A1R5G5B5:
- return &_mesa_texformat_argb1555;
- case D3DFMT_A8L8:
- return &_mesa_texformat_al88;
- case D3DFMT_R3G3B2:
- return &_mesa_texformat_rgb332;
- case D3DFMT_A8:
- return &_mesa_texformat_a8;
- case D3DFMT_L8:
- return &_mesa_texformat_l8;
- case D3DFMT_X8R8G8B8:
- return &_gld_texformat_X8R8G8B8;
- case D3DFMT_X1R5G5B5:
- return &_gld_texformat_X1R5G5B5;
- case D3DFMT_X4R4G4B4:
- return &_gld_texformat_X4R4G4B4;
- }
-
- // If we reach here then we've made an error somewhere else
- // by allowing a format that is not supported.
- assert(0);
-
- return NULL; // Shut up compiler warning
-}
-
-//---------------------------------------------------------------------------
-// Copy* functions
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage1D_DX9(
- GLcontext *ctx,
- GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y,
- GLsizei width, GLint border )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexImage2D_DX9(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLenum internalFormat,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- GLint border)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage1D_DX9(
- GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage2D_DX9(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height)
-{
- // TODO
-}
-
-//---------------------------------------------------------------------------
-
-void gldCopyTexSubImage3D_DX9(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height )
-{
- // TODO ?
-}
-
-//---------------------------------------------------------------------------
-// Bitmap/Pixel functions
-//---------------------------------------------------------------------------
-
-#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y))
-
-#define _GLD_FVF_IMAGE (D3DFVF_XYZRHW | D3DFVF_TEX1)
-
-typedef struct {
- FLOAT x, y; // 2D raster coords
- FLOAT z; // depth value
- FLOAT rhw; // reciprocal homogenous W (always 1.0f)
- FLOAT tu, tv; // texture coords
-} _GLD_IMAGE_VERTEX;
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldDrawPixels(
- GLcontext *ctx,
- BOOL bChromakey, // Alpha test for glBitmap() images
- GLint x, // GL x position
- GLint y, // GL y position (needs flipping)
- GLsizei width, // Width of input image
- GLsizei height, // Height of input image
- IDirect3DSurface9 *pImage)
-{
- //
- // Draw input image as texture implementing PixelZoom and clipping.
- // Any fragment operations currently enabled will be used.
- //
-
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTexture;
- D3DSURFACE_DESC d3dsd;
- IDirect3DSurface9 *pSurface;
- _GLD_IMAGE_VERTEX v[4];
- HRESULT hr;
-
- float ZoomWidth, ZoomHeight;
- float ScaleWidth, ScaleHeight;
-
- // Create a texture to hold image
- hr = D3DXCreateTexture(
- gld->pDev,
- width, height,
- 1, // miplevels
- 0, // usage
- D3DFMT_A8R8G8B8, // format
- D3DPOOL_MANAGED, // pool
- &pTexture);
- if (FAILED(hr))
- return hr;
-
- hr = IDirect3DTexture9_GetSurfaceLevel(pTexture, 0, &pSurface);
- if (FAILED(hr)) {
- IDirect3DTexture9_Release(pTexture);
- return hr;
- }
-
- // Copy image into texture
- hr = D3DXLoadSurfaceFromSurface(
- pSurface, NULL, NULL, // Dest surface
- pImage, NULL, NULL, // Src surface
- D3DX_FILTER_NONE,
- 0);
- IDirect3DSurface9_Release(pSurface);
- if (FAILED(hr)) {
- IDirect3DTexture9_Release(pTexture);
- return hr;
- }
-
- //
- // Set up the quad like this (ascii-art ahead!)
- //
- // 3--2
- // | |
- // 0--1
- //
- //
-
- // Set depth
- v[0].z = v[1].z = v[2].z = v[3].z = ctx->Current.RasterPos[2];
- // Set Reciprocal Homogenous W
- v[0].rhw = v[1].rhw = v[2].rhw = v[3].rhw = 1.0f;
-
- // Set texcoords
- // Examine texture size - if different to input width and height
- // then we'll need to munge the texcoords to fit.
- IDirect3DTexture9_GetLevelDesc(pTexture, 0, &d3dsd);
- ScaleWidth = (float)width / (float)d3dsd.Width;
- ScaleHeight = (float)height / (float)d3dsd.Height;
- v[0].tu = 0.0f; v[0].tv = 0.0f;
- v[1].tu = ScaleWidth; v[1].tv = 0.0f;
- v[2].tu = ScaleWidth; v[2].tv = ScaleHeight;
- v[3].tu = 0.0f; v[3].tv = ScaleHeight;
-
- // Set raster positions
- ZoomWidth = (float)width * ctx->Pixel.ZoomX;
- ZoomHeight = (float)height * ctx->Pixel.ZoomY;
-
- v[0].x = x; v[0].y = GLD_FLIP_Y(y);
- v[1].x = x+ZoomWidth; v[1].y = GLD_FLIP_Y(y);
- v[2].x = x+ZoomWidth; v[2].y = GLD_FLIP_Y(y+ZoomHeight);
- v[3].x = x; v[3].y = GLD_FLIP_Y(y+ZoomHeight);
-
- // Draw image with full HW acceleration
- // NOTE: Be nice to use a State Block for all this state...
- IDirect3DDevice9_SetTexture(gld->pDev, 0, pTexture);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE);
-
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MINFILTER, D3DTEXF_POINT);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MAGFILTER, D3DTEXF_POINT);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
-// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
- IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
-
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 1, D3DTSS_COLOROP, D3DTOP_DISABLE);
- IDirect3DDevice9_SetTextureStageState(gld->pDev, 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
-
- IDirect3DDevice9_SetVertexShader(gld->pDev, NULL);
- IDirect3DDevice9_SetFVF(gld->pDev, _GLD_FVF_IMAGE);
-
- //
- // Emulate Chromakey with an Alpha Test.
- // [Alpha Test is more widely supported anyway]
- //
- if (bChromakey) {
- // Switch on alpha testing
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, TRUE);
- // Fragment passes is alpha is greater than reference value
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, D3DCMP_GREATER);
- // Set alpha reference value between Bitmap alpha values of
- // zero (transparent) and one (opaque).
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHAREF, 0x7f);
- }
-
- IDirect3DDevice9_DrawPrimitiveUP(gld->pDev, D3DPT_TRIANGLEFAN, 2, &v, sizeof(_GLD_IMAGE_VERTEX));
-
- // Release texture
- IDirect3DDevice9_SetTexture(gld->pDev, 0, NULL);
- IDirect3DTexture9_Release(pTexture);
-
- // Reset state to before we messed it up
- FLUSH_VERTICES(ctx, _NEW_ALL);
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DrawPixels_DX9(
- GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pImage;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
-
- const struct gl_texture_format *MesaFormat;
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
-
- // Mesa does not currently handle this format.
- if (format == GL_BGR)
- return;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- D3DPOOL_SCRATCH,
- &pImage,
- NULL);
- if (FAILED(hr)) {
- return;
- }
-
- //
- // Use Mesa to fill in image
- //
-
- // Lock all of surface
- hr = IDirect3DSurface9_LockRect(pImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- MesaFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA,
- &_mesa_texformat_argb8888,
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, /* dstImageStride */
- format, type, pixels, unpack);
-
- IDirect3DSurface9_UnlockRect(pImage);
-
- _gldDrawPixels(ctx, FALSE, x, y, width, height, pImage);
-
- IDirect3DSurface9_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_ReadPixels_DX9(
- GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest)
-{
-
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pBackbuffer = NULL;
- IDirect3DSurface9 *pNativeImage = NULL;
- IDirect3DSurface9 *pCanonicalImage = NULL;
-
- D3DSURFACE_DESC d3dsd;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- struct gl_pixelstore_attrib srcPacking;
- int i;
- GLint DstRowStride;
- const struct gl_texture_format *MesaFormat;
-
- switch (format) {
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- return;
- }
-
- MesaFormat = _mesa_choose_tex_format(ctx, format, format, type);
- DstRowStride = _mesa_image_row_stride(pack, width, format, type);
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice9_GetBackBuffer(
- gld->pDev,
- 0, // First swapchain
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface9_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- D3DPOOL_SCRATCH,
- &pNativeImage,
- NULL);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, x, GLD_FLIP_HEIGHT(y, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels.
- //
- // This intermediate surface ensure that we can use CopyRects()
- // instead of relying on D3DXLoadSurfaceFromSurface(), which may
- // try and lock the backbuffer. This way seems safer.
- //
- // CopyRects has been removed for DX9.
- //
-/* hr = IDirect3DDevice9_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pNativeImage,
- &ptDst);*/
- hr = D3DXLoadSurfaceFromSurface(
- pNativeImage, // Dest surface
- NULL, // Dest palette
- &rcSrc, // Dest rect
- pBackbuffer, // Src surface
- NULL, // Src palette
- &rcSrc, // Src rect
- D3DX_FILTER_NONE, // Filter
- 0 // Colorkey (0=no colorkey)
- );
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Create an RGBA8888 surface
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- D3DPOOL_SCRATCH,
- &pCanonicalImage,
- NULL);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // Convert to RGBA8888
- hr = D3DXLoadSurfaceFromSurface(
- pCanonicalImage, // Dest surface
- NULL, NULL, // Dest palette, RECT
- pNativeImage, // Src surface
- NULL, NULL, // Src palette, RECT
- D3DX_FILTER_NONE, // Filter
- 0); // Colourkey
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- srcPacking.Alignment = 1;
- srcPacking.ImageHeight = height;
- srcPacking.LsbFirst = GL_FALSE;
- srcPacking.RowLength = 0;
- srcPacking.SkipImages = 0;
- srcPacking.SkipPixels = 0;
- srcPacking.SkipRows = 0;
- srcPacking.SwapBytes = GL_FALSE;
-
- // Lock all of image
- hr = IDirect3DSurface9_LockRect(pCanonicalImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- goto gld_ReadPixels_DX9_return;
- }
-
- // We need to flip the data. Yuck.
- // Perhaps Mesa has a span packer we can use in future...
- for (i=0; i<height; i++) {
- BYTE *pDestRow = (BYTE*)_mesa_image_address(2,pack, dest, width, height, format, type, 0, i, 0);
- BYTE *pSrcRow = (BYTE*)d3dLockedRect.pBits + (d3dLockedRect.Pitch * (height-i-1));
- MesaFormat->StoreImage(
- ctx,
- 2,
- GL_RGBA, // base format
- MesaFormat, // dst format
- pDestRow, // dest addr
- width, 1, 1, 0, 0, 0, // src x,y,z & dst offsets x,y,z
- DstRowStride, // dst row stride
- 0, // dstImageStride
- GL_BGRA, // src format
- GL_UNSIGNED_BYTE, // src type
- pSrcRow, // src addr
- &srcPacking); // packing params of source image
- }
-
- IDirect3DSurface9_UnlockRect(pCanonicalImage);
-
-gld_ReadPixels_DX9_return:
- SAFE_RELEASE_SURFACE9(pCanonicalImage);
- SAFE_RELEASE_SURFACE9(pNativeImage);
- SAFE_RELEASE_SURFACE9(pBackbuffer);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_CopyPixels_DX9(
- GLcontext *ctx,
- GLint srcx,
- GLint srcy,
- GLsizei width,
- GLsizei height,
- GLint dstx,
- GLint dsty,
- GLenum type)
-{
- //
- // NOTE: Not allowed to copy vidmem to vidmem!
- // Therefore we use an intermediate image surface.
- //
-
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pBackbuffer;
- D3DSURFACE_DESC d3dsd;
- IDirect3DSurface9 *pImage;
- RECT rcSrc; // Source rect
- POINT ptDst; // Dest point
- HRESULT hr;
-
- // Only backbuffer
- if (type != GL_COLOR)
- return;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // Get backbuffer
- hr = IDirect3DDevice9_GetBackBuffer(
- gld->pDev,
- 0, // First swapchain
- 0, // First backbuffer
- D3DBACKBUFFER_TYPE_MONO,
- &pBackbuffer);
- if (FAILED(hr))
- return;
-
- // Get backbuffer description
- hr = IDirect3DSurface9_GetDesc(pBackbuffer, &d3dsd);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pBackbuffer);
- return;
- }
-
- // Create a surface compatible with backbuffer
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- d3dsd.Format,
- D3DPOOL_SCRATCH,
- &pImage,
- NULL);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pBackbuffer);
- return;
- }
-
- // Compute source rect and dest point
- SetRect(&rcSrc, 0, 0, width, height);
- OffsetRect(&rcSrc, srcx, GLD_FLIP_HEIGHT(srcy, height));
- ptDst.x = ptDst.y = 0;
-
- // Get source pixels
-/* hr = IDirect3DDevice8_CopyRects(
- gld->pDev,
- pBackbuffer,
- &rcSrc,
- 1,
- pImage,
- &ptDst);*/
- hr = D3DXLoadSurfaceFromSurface(
- pImage, // Dest surface
- NULL, // Dest palette
- &rcSrc, // Dest rect
- pBackbuffer, // Src surface
- NULL, // Src palette
- &rcSrc, // Src rect
- D3DX_FILTER_NONE, // Filter
- 0 // Colorkey (0=no colorkey)
- );
- IDirect3DSurface9_Release(pBackbuffer);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- _gldDrawPixels(ctx, FALSE, dstx, dsty, width, height, pImage);
-
- IDirect3DSurface9_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_Bitmap_DX9(
- GLcontext *ctx,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap)
-{
- GLD_context *gldCtx;
- GLD_driver_dx9 *gld;
-
- IDirect3DSurface9 *pImage;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- BYTE *pTempBitmap;
- D3DCOLOR clBitmapOne, clBitmapZero;
- D3DCOLOR *pBits;
- const GLubyte *src;
- int i, j, k;
-
- gldCtx = GLD_GET_CONTEXT(ctx);
- gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- // A NULL bitmap is valid, but merely advances the raster position
- if ((bitmap == NULL) || (width == 0) || (height == 0))
- return;
-
- clBitmapZero = D3DCOLOR_RGBA(0,0,0,0); // NOTE: Alpha is Zero
- clBitmapOne = D3DCOLOR_COLORVALUE(
- ctx->Current.RasterColor[0],
- ctx->Current.RasterColor[1],
- ctx->Current.RasterColor[2],
- 1.0f); // NOTE: Alpha is One
-
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(
- gld->pDev,
- width,
- height,
- D3DFMT_A8R8G8B8,
- D3DPOOL_SCRATCH,
- &pImage,
- NULL);
- if (FAILED(hr)) {
- return;
- }
-
- // Lock all of surface
- hr = IDirect3DSurface9_LockRect(pImage, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- pTempBitmap = _mesa_unpack_bitmap(width, height, bitmap, unpack);
- if (pTempBitmap == NULL) {
- IDirect3DSurface9_Release(pImage);
- return;
- }
-
- pBits = (D3DCOLOR*)d3dLockedRect.pBits;
-
- for (i=0; i<height; i++) {
- GLubyte byte;
- pBits = (D3DCOLOR*)((BYTE*)d3dLockedRect.pBits + (i*d3dLockedRect.Pitch));
- src = (const GLubyte *) _mesa_image_address(2,
- &ctx->DefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
- 0, i, 0);
- for (j=0; j<(width>>3); j++) {
- byte = *src++;
- for (k=0; k<8; k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- // Fill remaining bits from bitmap
- if (width & 7) {
- byte = *src;
- for (k=0; k<(width & 7); k++) {
- *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero;
- byte <<= 1;
- }
- }
- }
-
- FREE(pTempBitmap);
-
-/*
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- GL_BITMAP,
- &_mesa_texformat_argb8888,
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- GL_BITMAP, GL_COLOR_INDEX, bitmap, unpack);
-*/
- IDirect3DSurface9_UnlockRect(pImage);
-
- _gldDrawPixels(ctx, TRUE, x, y, width, height, pImage);
-
- IDirect3DSurface9_Release(pImage);
-}
-
-//---------------------------------------------------------------------------
-// Texture functions
-//---------------------------------------------------------------------------
-
-void _gldAllocateTexture(
- GLcontext *ctx,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- D3DFORMAT d3dFormat;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (pTex) {
- // Decide whether we can keep existing D3D texture
- // by examining top-level surface.
- D3DSURFACE_DESC d3dsd;
- _GLD_DX9_TEX(GetLevelDesc(pTex, 0, &d3dsd));
- // Release existing texture if not compatible
- if ((d3dsd.Width == texImage->Width) ||
- (d3dsd.Height == texImage->Height))
- {
- return; // Keep the existing texture
- }
- tObj->DriverData = NULL;
- _GLD_DX9_TEX(Release(pTex));
- }
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->IntFormat);
- D3DXCreateTexture(
- gld->pDev,
- texImage->Width,
- texImage->Height,
- // TODO: Re-evaluate mipmapping
- (glb.bUseMipmaps) ? D3DX_DEFAULT : 1,
- 0, // Usage
- d3dFormat,
- D3DPOOL_MANAGED,
- &pTex);
- tObj->DriverData = pTex;
-}
-
-//---------------------------------------------------------------------------
-
-const struct gl_texture_format* gld_ChooseTextureFormat_DX9(
- GLcontext *ctx,
- GLint internalFormat,
- GLenum srcFormat,
- GLenum srcType)
-{
- // [Based on mesa_choose_tex_format()]
- //
- // We will choose only texture formats that are supported
- // by Direct3D. If the hardware doesn't support a particular
- // texture format, then the D3DX texture calls that we use
- // will automatically use a HW supported format.
- //
- // The most critical aim is to reduce copying; if we can use
- // texture-image data directly then it will be a big performance assist.
- //
-
- switch (internalFormat) {
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return &_mesa_texformat_l8; // D3DFMT_L8
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return &_mesa_texformat_a8; // D3DFMT_A8
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_rgb565; // D3DFMT_R5G6B5
- // Mesa will convert this for us later...
- // return &_mesa_texformat_ci8; // D3DFMT_R5G6B5
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return &_mesa_texformat_al88; // D3DFMT_A8L8
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb332; // D3DFMT_R3G3B2
- case GL_RGB4:
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444; // D3DFMT_A4R4G4B4
- case 3:
- case GL_RGB:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return &_mesa_texformat_rgb565;
- case 4:
- case GL_RGBA:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return &_mesa_texformat_argb8888;
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
- default:
- _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat");
- return NULL;
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
-// Safer(?), slower version.
-void gld_TexImage2D_DX9(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- RECT rcSrcRect;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
-
- if (!tObj || !texImage)
- return;
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture9_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface9_Release(pSurface);
- return;
- }
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- SetRect(&rcSrcRect, 0, 0, width, height);
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- NULL,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface9_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexImage2D_DX9(
- GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint internalFormat,
- GLint width,
- GLint height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- HRESULT hr;
- D3DLOCKED_RECT d3dLockedRect;
- D3DSURFACE_DESC d3dsd;
-
- if (!tObj || !texImage)
- return;
-
- // GLQUAKE FIX
- // Test for input alpha data with non-alpha internalformat
- if (((internalFormat==3) || (internalFormat==GL_RGB)) && (format==GL_RGBA)) {
- // Input format has alpha, but a non-alpha format has been requested.
- texImage->IntFormat = GL_RGBA;
- internalFormat = GL_RGBA;
- }
-
- if (level == 0) {
- _gldAllocateTexture(ctx, tObj, texImage);
- }
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture9_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- IDirect3DSurface9_GetDesc(pSurface, &d3dsd);
-
- // Lock all of surface
- hr = IDirect3DSurface9_LockRect(pSurface, &d3dLockedRect, NULL, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(
- ctx,
- 2,
- texImage->Format,
- _gldMesaFormatForD3DFormat(d3dsd.Format),
- d3dLockedRect.pBits,
- width, height, 1, 0, 0, 0,
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- IDirect3DSurface9_UnlockRect(pSurface);
- IDirect3DSurface9_Release(pSurface);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexImage1D_DX9(GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- // A 1D texture is a 2D texture with a height of zero
- gld_TexImage2D_DX9(ctx, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-/*
-void gld_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_GET_CONTEXT
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- D3DFORMAT d3dFormat;
- HRESULT hr;
- GLint texelBytes = 4;
- GLvoid *tempImage;
- RECT rcSrcRect;
- RECT rcDstRect;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= _GLD_DX9_TEX(GetLevelCount(pTex))
- return; // Level does not exist
- hr = _GLD_DX9_TEX(GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- d3dFormat = _gldGLFormatToD3DFormat(texImage->Format);
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- IDirect3DSurface9_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store in tempImage
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- &_mesa_texformat_argb8888, // dest format
- tempImage,
- width, height, 1, 0, 0, 0,
- width * texelBytes,
- 0, // dstImageStride
- format, type, pixels, packing);
-
- // Source rectangle is whole of input image
- SetRect(&rcSrcRect, 0, 0, width, height);
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- D3DXLoadSurfaceFromMemory(
- pSurface,
- NULL,
- &rcDstRect,
- tempImage,
- D3DFMT_A8R8G8B8,
- width * texelBytes,
- NULL,
- &rcSrcRect,
- D3DX_FILTER_NONE,
- 0);
-
- FREE(tempImage);
- IDirect3DSurface9_Release(pSurface);
-}
-*/
-
-//---------------------------------------------------------------------------
-
-// Faster, more efficient version.
-// Copies subimage straight to dest texture
-void gld_TexSubImage2D_DX9( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *tObj,
- struct gl_texture_image *texImage )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- IDirect3DTexture9 *pTex;
- IDirect3DSurface9 *pSurface;
- HRESULT hr;
- RECT rcDstRect;
- D3DLOCKED_RECT d3dLockedRect;
- D3DSURFACE_DESC d3dsd;
-
- if (!tObj || !texImage)
- return;
-
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (!pTex)
- return; // Texture has not been created
- if (level >= IDirect3DTexture9_GetLevelCount(pTex))
- return; // Level does not exist
- hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface);
- if (FAILED(hr))
- return; // Surface level doesn't exist (or just a plain error)
-
- IDirect3DSurface9_GetDesc(pSurface, &d3dsd);
-
- // Dest rectangle must be offset to dest image
- SetRect(&rcDstRect, 0, 0, width, height);
- OffsetRect(&rcDstRect, xoffset, yoffset);
-
- // Lock sub-rect of surface
- hr = IDirect3DSurface9_LockRect(pSurface, &d3dLockedRect, &rcDstRect, 0);
- if (FAILED(hr)) {
- IDirect3DSurface9_Release(pSurface);
- return;
- }
-
- // unpack image, apply transfer ops and store directly in texture
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- _gldMesaFormatForD3DFormat(d3dsd.Format),
- d3dLockedRect.pBits,
- width, height, 1,
- 0, 0, 0, // NOTE: d3dLockedRect.pBits is already offset!!!
- d3dLockedRect.Pitch,
- 0, // dstImageStride
- format, type, pixels, packing);
-
-
- IDirect3DSurface9_UnlockRect(pSurface);
- IDirect3DSurface9_Release(pSurface);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_TexSubImage1D_DX9( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gld_TexSubImage2D_DX9(ctx, target, level, xoffset, 0, width, 1, format, type, pixels, packing, texObj, texImage);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_DeleteTexture_DX9(
- GLcontext *ctx,
- struct gl_texture_object *tObj)
-{
- GLD_context *gld = (GLD_context*)(ctx->DriverCtx);
-
- if (tObj) {
- IDirect3DTexture9 *pTex = (IDirect3DTexture9*)tObj->DriverData;
- if (pTex) {
-/* // Make sure texture is not bound to a stage before releasing it
- for (int i=0; i<MAX_TEXTURE_UNITS; i++) {
- if (gld->CurrentTexture[i] == pTex) {
- gld->pDev->SetTexture(i, NULL);
- gld->CurrentTexture[i] = NULL;
- }
- }*/
- _GLD_DX9_TEX(Release(pTex));
- tObj->DriverData = NULL;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetColorOps(
- const GLD_driver_dx9 *gld,
- GLuint unit,
- DWORD ColorArg1,
- D3DTEXTUREOP ColorOp,
- DWORD ColorArg2)
-{
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG1, ColorArg1));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLOROP, ColorOp));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG2, ColorArg2));
-}
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetAlphaOps(
- const GLD_driver_dx9 *gld,
- GLuint unit,
- DWORD AlphaArg1,
- D3DTEXTUREOP AlphaOp,
- DWORD AlphaArg2)
-{
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG1, AlphaArg1));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAOP, AlphaOp));
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG2, AlphaArg2));
-}
-
-//---------------------------------------------------------------------------
-
-void gldUpdateTextureUnit(
- GLcontext *ctx,
- GLuint unit,
- BOOL bPassThrough)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- D3DTEXTUREFILTERTYPE minfilter;
- D3DTEXTUREFILTERTYPE mipfilter;
- GLenum BaseFormat;
- DWORD dwColorArg0;
- int iTexEnv = 0;
- GLD_texenv *pTexenv;
-
- // NOTE: If bPassThrough is FALSE then texture stage can be
- // disabled otherwise it must pass-through it's current fragment.
-
- const struct gl_texture_unit *pUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *tObj = pUnit->_Current;
-
- IDirect3DTexture9 *pTex = NULL;
- if (tObj) {
- pTex = (IDirect3DTexture9*)tObj->DriverData;
- }
-
- // Enable texturing if unit is enabled and a valid D3D texture exists
- // Mesa 5: TEXTUREn_x altered to TEXTURE_nD_BIT
- //if (pTex && (pUnit->Enabled & (TEXTURE0_1D | TEXTURE0_2D))) {
- if (pTex && (pUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT))) {
- // Enable texturing
- _GLD_DX9_DEV(SetTexture(gld->pDev, unit, pTex));
- } else {
- // Disable texturing, then return
- _GLD_DX9_DEV(SetTexture(gld->pDev, unit, NULL));
- if (bPassThrough) {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE);
- } else {
- _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE);
- }
- return;
- }
-
- // Texture parameters
- _gldConvertMinFilter(tObj->MinFilter, &minfilter, &mipfilter);
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MINFILTER, minfilter));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MIPFILTER, mipfilter));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter)));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSU, _gldConvertWrap(tObj->WrapS)));
-// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSV, _gldConvertWrap(tObj->WrapT)));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MINFILTER, minfilter));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MIPFILTER, mipfilter));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter)));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_ADDRESSU, _gldConvertWrap(tObj->WrapS)));
- _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_ADDRESSV, _gldConvertWrap(tObj->WrapT)));
-
- // Texture priority
- _GLD_DX9_TEX(SetPriority(pTex, (DWORD)(tObj->Priority*65535.0f)));
-
- // Texture environment
- // TODO: Examine input texture for alpha and use specific alpha/non-alpha ops.
- // See Page 355 of the Red Book.
- BaseFormat = _gldDecodeBaseFormat(pTex);
-
- switch (BaseFormat) {
- case GL_RGB:
- iTexEnv = 0;
- break;
- case GL_RGBA:
- iTexEnv = 1;
- break;
- case GL_ALPHA:
- iTexEnv = 2;
- break;
- }
-
- switch (pUnit->EnvMode) {
- case GL_DECAL:
- iTexEnv += 0;
- break;
- case GL_REPLACE:
- iTexEnv += 3;
- break;
- case GL_MODULATE:
- iTexEnv += 6;
- break;
- case GL_BLEND:
- // Set blend colour
- dwColorArg0 = D3DCOLOR_COLORVALUE(pUnit->EnvColor[0], pUnit->EnvColor[1], pUnit->EnvColor[2], pUnit->EnvColor[3]);
- _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG0, dwColorArg0));
- iTexEnv += 9;
- break;
- case GL_ADD:
- iTexEnv += 12;
- break;
- }
- pTexenv = (GLD_texenv*)&gldTexEnv[iTexEnv];
- _gldSetColorOps(gld, unit, pTexenv->ColorArg1, pTexenv->ColorOp, pTexenv->ColorArg2);
- _gldSetAlphaOps(gld, unit, pTexenv->AlphaArg1, pTexenv->AlphaOp, pTexenv->AlphaArg2);
-}
-
-//---------------------------------------------------------------------------
-
-void gld_NEW_TEXTURE_DX9(
- GLcontext *ctx)
-{
- // TODO: Support for three (ATI Radeon) or more (nVidia GeForce3) texture units
-
- BOOL bUnit0Enabled;
- BOOL bUnit1Enabled;
-
- if (!ctx)
- return; // Sanity check
-
- if (ctx->Const.MaxTextureUnits == 1) {
- gldUpdateTextureUnit(ctx, 0, TRUE);
- return;
- }
-
- //
- // NOTE: THE FOLLOWING RELATES TO TWO TEXTURE UNITS, AND TWO ONLY!!
- //
-
- // Mesa 5: Texture Units altered
- //bUnit0Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D)) ? TRUE : FALSE;
- //bUnit1Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE1_1D | TEXTURE1_2D)) ? TRUE : FALSE;
- bUnit0Enabled = (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
- bUnit1Enabled = (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE;
-
- // If Unit0 is disabled and Unit1 is enabled then we must pass-though
- gldUpdateTextureUnit(ctx, 0, (!bUnit0Enabled && bUnit1Enabled) ? TRUE : FALSE);
- // We can always disable the last texture unit
- gldUpdateTextureUnit(ctx, 1, FALSE);
-
-#ifdef _DEBUG
-#if 0
- {
- // Find out whether device supports current renderstates
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-// GLD_context *gld = GLD_GET_CONTEXT(ctx);
-
- DWORD dwPasses;
- _GLD_DX9_DEV(ValidateDevice(gld->pDev, &dwPasses));
-// if (FAILED(hr)) {
-// gldLogError(GLDLOG_ERROR, "ValidateDevice failed", hr);
-// }
- if (dwPasses != 1) {
- gldLogMessage(GLDLOG_ERROR, "ValidateDevice: Can't do in one pass\n");
- }
- }
-#endif
-#endif
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c
deleted file mode 100644
index 4fa6bcaf1ab..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect fastpath pipeline stage
-*
-****************************************************************************/
-
-//---------------------------------------------------------------------------
-
-//#include "../GLDirect.h"
-//#include "../gld_log.h"
-//#include "gld_dx8.h"
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-// #include "mem.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-//---------------------------------------------------------------------------
-
-__inline void _gldSetVertexShaderConstants(
- GLcontext *ctx,
- GLD_driver_dx9 *gld)
-{
- D3DXMATRIX mat, matView, matProj;
- GLfloat *pM;
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ModelView.m;
- pM = ctx->ModelviewMatrixStack.Top->m;
- matView._11 = pM[0];
- matView._12 = pM[1];
- matView._13 = pM[2];
- matView._14 = pM[3];
- matView._21 = pM[4];
- matView._22 = pM[5];
- matView._23 = pM[6];
- matView._24 = pM[7];
- matView._31 = pM[8];
- matView._32 = pM[9];
- matView._33 = pM[10];
- matView._34 = pM[11];
- matView._41 = pM[12];
- matView._42 = pM[13];
- matView._43 = pM[14];
- matView._44 = pM[15];
-
- // Mesa 5: Altered to a Stack
- //pM = ctx->ProjectionMatrix.m;
- pM = ctx->ProjectionMatrixStack.Top->m;
- matProj._11 = pM[0];
- matProj._12 = pM[1];
- matProj._13 = pM[2];
- matProj._14 = pM[3];
- matProj._21 = pM[4];
- matProj._22 = pM[5];
- matProj._23 = pM[6];
- matProj._24 = pM[7];
- matProj._31 = pM[8];
- matProj._32 = pM[9];
- matProj._33 = pM[10];
- matProj._34 = pM[11];
- matProj._41 = pM[12];
- matProj._42 = pM[13];
- matProj._43 = pM[14];
- matProj._44 = pM[15];
-
- D3DXMatrixMultiply( &mat, &matView, &matProj );
- D3DXMatrixTranspose( &mat, &mat );
-
- _GLD_DX9_DEV(SetVertexShaderConstantF(gld->pDev, 0, (float*)&mat, 4));
-}
-
-//---------------------------------------------------------------------------
-
-static GLboolean gld_d3d_render_stage_run(
- GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- TNLcontext *tnl;
- struct vertex_buffer *VB;
- tnl_render_func *tab;
- GLint pass;
- GLD_pb_dx9 *gldPB = &gld->PB3d;
-/*
- static int count = 0;
- count++;
- if (count != 2)
- return GL_FALSE;
-*/
- // The "check" function should disable this stage,
- // but we'll test gld->bUseMesaTnL anyway.
- if (gld->bUseMesaTnL) {
- // Do nothing in this stage, but continue pipeline
- return GL_TRUE;
- }
-
- tnl = TNL_CONTEXT(ctx);
- VB = &tnl->vb;
- pass = 0;
-
- tnl->Driver.Render.Start( ctx );
-
-#if 0
- // For debugging: Useful to see if an app passes colour data in
- // an unusual format.
- switch (VB->ColorPtr[0]->Type) {
- case GL_FLOAT:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
- break;
- case GL_UNSIGNED_BYTE:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n");
- break;
- default:
- ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n");
- break;
- }
-#endif
-
- tnl->Driver.Render.Points = gld_Points3D_DX9;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- tnl->Driver.Render.Line = gld_Line3DFlat_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX9;
- tnl->Driver.Render.Quad = gld_Quad3DFlat_DX9;
- } else {
- tnl->Driver.Render.Line = gld_Line3DSmooth_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX9;
- tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX9;
- }
-
- _GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
- // Allocate primitive pointers
- // gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts);
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length)
- {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
- _GLD_DX9_VB(Unlock(gldPB->pVB));
-
- _GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride));
-
- _GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_PROJECTION, &gld->matProjection));
- _GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_WORLD, &gld->matModelView));
-
- if (gldPB->nPoints) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-//---------------------------------------------------------------------------
-
-static void gld_d3d_render_stage_check(
- GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
- // Is this thread safe?
- stage->active = (gld->bUseMesaTnL) ? GL_FALSE : GL_TRUE;
- return;
-}
-
-
-//---------------------------------------------------------------------------
-
-const struct tnl_pipeline_stage _gld_d3d_render_stage =
-{
- "gld_d3d_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- gld_d3d_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c
deleted file mode 100644
index c71fdefbae8..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c
+++ /dev/null
@@ -1,444 +0,0 @@
-/* $Id: gld_vb_mesa_render_dx9.c,v 1.6 2005/08/27 13:56:08 brianp 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:
- * Keith Whitwell <keithw@valinux.com>
- */
-
-
-/*
- * Render whole vertex buffers, including projection of vertices from
- * clip space and clipping of primitives.
- *
- * This file makes calls to project vertices and to the point, line
- * and triangle rasterizers via the function pointers:
- *
- * context->Driver.Render.*
- *
- */
-
-
-//---------------------------------------------------------------------------
-
-#include "dglcontext.h"
-#include "ddlog.h"
-#include "gld_dx9.h"
-
-//---------------------------------------------------------------------------
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "mtypes.h"
-//#include "mmath.h"
-
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-
-#include "tnl/t_pipeline.h"
-
-/**********************************************************************/
-/* Clip single primitives */
-/**********************************************************************/
-
-
-#if defined(USE_IEEE)
-#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
-//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
-#else
-#define NEGATIVE(x) (x < 0)
-//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
-/* Could just use (x*y<0) except for the flatshading requirements.
- * Maybe there's a better way?
- */
-#endif
-
-
-#define W(i) coord[i][3]
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 4
-#define TAG(x) x##_4
-#include "tnl/t_vb_cliptmp.h"
-
-
-
-/**********************************************************************/
-/* Clip and render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, with the possibility of clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte ormask = c1|c2; \
- if (!ormask) \
- LineFunc( ctx, v1, v2 ); \
- else if (!(c1 & c2 & 0x3f)) \
- clip_line_4( ctx, v1, v2, ormask ); \
-} while (0)
-
-#define RENDER_TRI( v1, v2, v3 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
- GLubyte ormask = c1|c2|c3; \
- if (!ormask) \
- TriangleFunc( ctx, v1, v2, v3 ); \
- else if (!(c1 & c2 & c3 & 0x3f)) \
- clip_tri_4( ctx, v1, v2, v3, ormask ); \
-} while (0)
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
-do { \
- GLubyte c1 = mask[v1], c2 = mask[v2]; \
- GLubyte c3 = mask[v3], c4 = mask[v4]; \
- GLubyte ormask = c1|c2|c3|c4; \
- if (!ormask) \
- QuadFunc( ctx, v1, v2, v3, v4 ); \
- else if (!(c1 & c2 & c3 & c4 & 0x3f)) \
- clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \
-} while (0)
-
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const GLubyte *mask = VB->ClipMask; \
- const GLuint sz = VB->ClipPtr->size; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt; (void) mask; (void) sz; (void) stipple;
-
-#define TAG(x) clip_##x##_verts
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-
-/* Elts, with the possibility of clipping.
- */
-#undef ELT
-#undef TAG
-#define ELT(x) elt[x]
-#define TAG(x) clip_##x##_elts
-#include "tnl/t_vb_rendertmp.h"
-
-/* TODO: do this for all primitives, verts and elts:
- */
-static void clip_elt_triangles( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES];
- struct vertex_buffer *VB = &tnl->vb;
- const GLuint * const elt = VB->Elts;
- GLubyte *mask = VB->ClipMask;
- GLuint last = count-2;
- GLuint j;
- (void) flags;
-
- tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES );
-
- for (j=start; j < last; j+=3 ) {
- GLubyte c1 = mask[elt[j]];
- GLubyte c2 = mask[elt[j+1]];
- GLubyte c3 = mask[elt[j+2]];
- GLubyte ormask = c1|c2|c3;
- if (ormask) {
- if (start < j)
- render_tris( ctx, start, j, 0 );
- if (!(c1&c2&c3&0x3f))
- clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
- start = j+3;
- }
- }
-
- if (start < j)
- render_tris( ctx, start, j, 0 );
-}
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
-#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
-
-
-/* Vertices, no clipping.
- */
-#define RENDER_POINTS( start, count ) \
- tnl->Driver.Render.Points( ctx, start, count )
-
-#define RENDER_LINE( v1, v2 ) \
- LineFunc( ctx, v1, v2 )
-
-#define RENDER_TRI( v1, v2, v3 ) \
- TriangleFunc( ctx, v1, v2, v3 )
-
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
- QuadFunc( ctx, v1, v2, v3, v4 )
-
-#define TAG(x) _gld_tnl_##x##_verts
-
-#define LOCAL_VARS \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- struct vertex_buffer *VB = &tnl->vb; \
- const GLuint * const elt = VB->Elts; \
- const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
- const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
- const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
- (void) (LineFunc && TriangleFunc && QuadFunc); \
- (void) elt;
-
-#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx )
-#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
-#define RENDER_TAB_QUALIFIER
-#define PRESERVE_VB_DEFS
-#include "tnl/t_vb_rendertmp.h"
-
-
-/* Elts, no clipping.
- */
-#undef ELT
-#define TAG(x) _gld_tnl_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Helper functions for drivers */
-/**********************************************************************/
-/*
-void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint *tmp = VB->Elts;
-
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
-}
-
-void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-*/
-
-
-/**********************************************************************/
-/* Clip and render whole vertex buffers */
-/**********************************************************************/
-
-tnl_points_func _gldSetupPoints[4] = {
- gld_Points2D_DX9,
- gld_Points2D_DX9,
- gld_Points2D_DX9,
- gld_Points2D_DX9
-};
-tnl_line_func _gldSetupLine[4] = {
- gld_Line2DFlat_DX9,
- gld_Line2DSmooth_DX9,
- gld_Line2DFlat_DX9,
- gld_Line2DSmooth_DX9,
-};
-tnl_triangle_func _gldSetupTriangle[4] = {
- gld_Triangle2DFlat_DX9,
- gld_Triangle2DSmooth_DX9,
- gld_Triangle2DFlatExtras_DX9,
- gld_Triangle2DSmoothExtras_DX9
-};
-tnl_quad_func _gldSetupQuad[4] = {
- gld_Quad2DFlat_DX9,
- gld_Quad2DSmooth_DX9,
- gld_Quad2DFlatExtras_DX9,
- gld_Quad2DSmoothExtras_DX9
-};
-
-//---------------------------------------------------------------------------
-
-static GLboolean _gld_mesa_render_stage_run(
- GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
-
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- tnl_render_func *tab;
- GLint pass = 0;
- GLD_pb_dx9 *gldPB;
-
- /* Allow the drivers to lock before projected verts are built so
- * that window coordinates are guarenteed not to change before
- * rendering.
- */
- ASSERT(tnl->Driver.Render.Start);
-
- tnl->Driver.Render.Start( ctx );
-
- // NOTE: Setting D3DRS_SOFTWAREVERTEXPROCESSING for a mixed-mode device resets
- // stream, indices and shader to default values of NULL or 0.
-/* if ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) &&
- gld->VStwosidelight.hShader &&
- !ctx->Fog.Enabled)
- {
- IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware);
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
- gldPB = &gld->PBtwosidelight;
- tnl->Driver.Render.Points = gld_Points2DTwoside_DX9;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- tnl->Driver.Render.Line = gld_Line2DFlatTwoside_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle2DFlatTwoside_DX9;
- tnl->Driver.Render.Quad = gld_Quad2DFlatTwoside_DX9;
- } else {
- tnl->Driver.Render.Line = gld_Line2DSmoothTwoside_DX9;
- tnl->Driver.Render.Triangle = gld_Triangle2DSmoothTwoside_DX9;
- tnl->Driver.Render.Quad = gld_Quad2DSmoothTwoside_DX9;
- }
- } else {*/
-// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE);
- IDirect3DDevice9_SetSoftwareVertexProcessing(gld->pDev, TRUE);
- gldPB = &gld->PB2d;
- _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL));
- _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF));
- tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc];
- tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc];
- tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc];
- tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc];
-// }
-
- _GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
- gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
- // Allocate primitive pointers
- // gldPB->pPoints is always first
- gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
- gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
-
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
-
- tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
-
- if (VB->ClipOrMask) {
- tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts;
- clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
- }
- else {
- tab = (VB->Elts ?
- tnl->Driver.Render.PrimTabElts :
- tnl->Driver.Render.PrimTabVerts);
- }
-
- do {
- GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_END) ; i += length) {
- flags = VB->Primitive[i].mode;
- length= VB->Primitive[i].count;
- ASSERT(length || (flags & PRIM_END));
- ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
- if (length)
- tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
- }
- } while (tnl->Driver.Render.Multipass &&
- tnl->Driver.Render.Multipass( ctx, ++pass ));
-
-
-// tnl->Driver.Render.Finish( ctx );
-
- _GLD_DX9_VB(Unlock(gldPB->pVB));
-
- _GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride));
-
- if (gldPB->nPoints) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
- gldPB->nPoints = 0;
- }
-
- if (gldPB->nLines) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
- gldPB->nLines = 0;
- }
-
- if (gldPB->nTriangles) {
- _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
- gldPB->nTriangles = 0;
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-
-
-const struct tnl_pipeline_stage _gld_mesa_render_stage =
-{
- "gld_mesa_render_stage",
- NULL,
- NULL,
- NULL,
- NULL,
- _gld_mesa_render_stage_run /* run */
-};
-
-//---------------------------------------------------------------------------
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c
deleted file mode 100644
index dc465c54185..00000000000
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c
+++ /dev/null
@@ -1,1345 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: GLDirect Direct3D 8.x WGL (WindowsGL)
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-#include "gld_driver.h"
-#include "gld_dxerr9.h"
-#include "gld_dx9.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-// Copied from dglcontect.c
-#define GLDERR_NONE 0
-#define GLDERR_MEM 1
-#define GLDERR_DDRAW 2
-#define GLDERR_D3D 3
-#define GLDERR_BPP 4
-#define GLDERR_DDS 5
-// This external var keeps track of any error
-extern int nContextError;
-
-#define DDLOG_CRITICAL_OR_WARN DDLOG_CRITICAL
-
-extern void _gld_mesa_warning(GLcontext *, char *);
-extern void _gld_mesa_fatal(GLcontext *, char *);
-
-//---------------------------------------------------------------------------
-
-static char szColorDepthWarning[] =
-"GLDirect does not support the current desktop\n\
-color depth.\n\n\
-You may need to change the display resolution to\n\
-16 bits per pixel or higher color depth using\n\
-the Windows Display Settings control panel\n\
-before running this OpenGL application.\n";
-
-// The only depth-stencil formats currently supported by Direct3D
-// Surface Format Depth Stencil Total Bits
-// D3DFMT_D32 32 - 32
-// D3DFMT_D15S1 15 1 16
-// D3DFMT_D24S8 24 8 32
-// D3DFMT_D16 16 - 16
-// D3DFMT_D24X8 24 - 32
-// D3DFMT_D24X4S4 24 4 32
-
-// This pixel format will be used as a template when compiling the list
-// of pixel formats supported by the hardware. Many fields will be
-// filled in at runtime.
-// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM
-static DGL_pixelFormat pfTemplateHW =
-{
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
- 1, // Structure version - should be 1
- // Flags:
- PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
- PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
- PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
- PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
- PFD_DOUBLEBUFFER | // The buffer is double-buffered.
- 0, // Placeholder for easy commenting of above flags
- PFD_TYPE_RGBA, // Pixel type RGBA.
- 16, // Total colour bitplanes (excluding alpha bitplanes)
- 5, 0, // Red bits, shift
- 5, 0, // Green bits, shift
- 5, 0, // Blue bits, shift
- 0, 0, // Alpha bits, shift (destination alpha)
- 0, // Accumulator bits (total)
- 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha
- 0, // Depth bits
- 0, // Stencil bits
- 0, // Number of auxiliary buffers
- 0, // Layer type
- 0, // Specifies the number of overlay and underlay planes.
- 0, // Layer mask
- 0, // Specifies the transparent color or index of an underlay plane.
- 0 // Damage mask
- },
- D3DFMT_UNKNOWN, // No depth/stencil buffer
-};
-
-//---------------------------------------------------------------------------
-// Vertex Shaders
-//---------------------------------------------------------------------------
-/*
-// Vertex Shader Declaration
-static DWORD dwTwoSidedLightingDecl[] =
-{
- D3DVSD_STREAM(0),
- D3DVSD_REG(0, D3DVSDT_FLOAT3), // XYZ position
- D3DVSD_REG(1, D3DVSDT_FLOAT3), // XYZ normal
- D3DVSD_REG(2, D3DVSDT_D3DCOLOR), // Diffuse color
- D3DVSD_REG(3, D3DVSDT_D3DCOLOR), // Specular color
- D3DVSD_REG(4, D3DVSDT_FLOAT2), // 2D texture unit 0
- D3DVSD_REG(5, D3DVSDT_FLOAT2), // 2D texture unit 1
- D3DVSD_END()
-};
-
-// Vertex Shader for two-sided lighting
-static char *szTwoSidedLightingVS =
-// This is a test shader!
-"vs.1.0\n"
-"m4x4 oPos,v0,c0\n"
-"mov oD0,v2\n"
-"mov oD1,v3\n"
-"mov oT0,v4\n"
-"mov oT1,v5\n"
-;
-*/
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-typedef struct {
- HINSTANCE hD3D9DLL; // Handle to d3d9.dll
- FNDIRECT3DCREATE9 fnDirect3DCreate9; // Direct3DCreate9 function prototype
- BOOL bDirect3D; // Persistant Direct3D9 exists
- BOOL bDirect3DDevice; // Persistant Direct3DDevice9 exists
- IDirect3D9 *pD3D; // Persistant Direct3D9
- IDirect3DDevice9 *pDev; // Persistant Direct3DDevice9
-} GLD_dx9_globals;
-
-// These are "global" to all DX9 contexts. KeithH
-static GLD_dx9_globals dx9Globals;
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-BOOL gldGetDXErrorString_DX(
- HRESULT hr,
- char *buf,
- int nBufSize)
-{
- //
- // Return a string describing the input HRESULT error code
- //
-
- const char *pStr = DXGetErrorString9(hr);
-
- if (pStr == NULL)
- return FALSE;
-
- if (strlen(pStr) > nBufSize)
- strncpy(buf, pStr, nBufSize);
- else
- strcpy(buf, pStr);
-
-// D3DXGetErrorString(hr, buf, nBufSize);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-static D3DMULTISAMPLE_TYPE _gldGetDeviceMultiSampleType(
- IDirect3D9 *pD3D9,
- D3DFORMAT SurfaceFormat,
- D3DDEVTYPE d3dDevType,
- BOOL Windowed)
-{
- int i;
- HRESULT hr;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_NONE)
- return D3DMULTISAMPLE_NONE;
-
- if (glb.dwMultisample == GLDS_MULTISAMPLE_FASTEST) {
- // Find fastest multisample
- for (i=2; i<17; i++) {
- hr = IDirect3D9_CheckDeviceMultiSampleType(
- pD3D9,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i,
- NULL);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- } else {
- // Find nicest multisample
- for (i=16; i>1; i--) {
- hr = IDirect3D9_CheckDeviceMultiSampleType(
- pD3D9,
- glb.dwAdapter,
- d3dDevType,
- SurfaceFormat,
- Windowed,
- (D3DMULTISAMPLE_TYPE)i,
- NULL);
- if (SUCCEEDED(hr)) {
- return (D3DMULTISAMPLE_TYPE)i;
- }
- }
- }
-
- // Nothing found - return default
- return D3DMULTISAMPLE_NONE;
-}
-
-//---------------------------------------------------------------------------
-
-void _gldDestroyPrimitiveBuffer(
- GLD_pb_dx9 *gldVB)
-{
- SAFE_RELEASE(gldVB->pVB);
-
- // Sanity check...
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
-}
-
-//---------------------------------------------------------------------------
-
-HRESULT _gldCreatePrimitiveBuffer(
- GLcontext *ctx,
- GLD_driver_dx9 *lpCtx,
- GLD_pb_dx9 *gldVB)
-{
- HRESULT hResult;
- char *szCreateVertexBufferFailed = "CreateVertexBuffer failed";
- DWORD dwMaxVertices; // Max number of vertices in vertex buffer
- DWORD dwVBSize; // Total size of vertex buffer
-
- // If CVA (Compiled Vertex Array) is used by an OpenGL app, then we
- // will need enough vertices to cater for Mesa::Const.MaxArrayLockSize.
- // We'll use IMM_SIZE if it's larger (which it should not be).
- dwMaxVertices = MAX_ARRAY_LOCK_SIZE;
-
- // Now calculate how many vertices to allow for in total
- // 1 per point, 2 per line, 6 per quad = 9
- dwVBSize = dwMaxVertices * 9 * gldVB->dwStride;
-
- hResult = IDirect3DDevice9_CreateVertexBuffer(
- lpCtx->pDev,
- dwVBSize,
- gldVB->dwUsage,
- gldVB->dwFVF,
- gldVB->dwPool,
- &gldVB->pVB,
- NULL);
- if (FAILED(hResult)) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, szCreateVertexBufferFailed);
- return hResult;
- }
-
- gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0;
- gldVB->pPoints = gldVB->pLines = gldVB->pTriangles = NULL;
- gldVB->iFirstLine = dwMaxVertices; // Index of first line in VB
- gldVB->iFirstTriangle = dwMaxVertices*3; // Index of first triangle in VB
-
- return S_OK;
-}
-
-//---------------------------------------------------------------------------
-// Function: _gldCreateVertexShaders
-// Create DX9 Vertex Shaders.
-//---------------------------------------------------------------------------
-/*
-void _gldCreateVertexShaders(
- GLD_driver_dx9 *gld)
-{
- DWORD dwFlags;
- LPD3DXBUFFER pVSOpcodeBuffer; // Vertex Shader opcode buffer
- HRESULT hr;
-
-#ifdef _DEBUG
- dwFlags = D3DXASM_DEBUG;
-#else
- dwFlags = 0; // D3DXASM_SKIPVALIDATION;
-#endif
-
- ddlogMessage(DDLOG_INFO, "Creating shaders...\n");
-
- // Init the shader handle
- gld->VStwosidelight.hShader = 0;
-
- if (gld->d3dCaps8.MaxStreams == 0) {
- // Lame DX8 driver doesn't support streams
- // Not fatal, as defaults will be used
- ddlogMessage(DDLOG_WARN, "Driver doesn't support Vertex Shaders (MaxStreams==0)\n");
- return;
- }
-
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-// return;
- // ** THIS DISABLES VERTEX SHADER SUPPORT **
-
- //
- // Two-sided lighting
- //
-
-#if 0
- //
- // DEBUGGING: Load shader from a text file
- //
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- hr = D3DXAssembleShaderFromFile(
- "twoside.vsh",
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#else
- {
- LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer
- // Assemble ascii shader text into shader opcodes
- hr = D3DXAssembleShader(
- szTwoSidedLightingVS,
- strlen(szTwoSidedLightingVS),
- dwFlags,
- NULL, // No constants
- &pVSOpcodeBuffer,
- &pVSErrorBuffer);
- if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer))
- ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer));
- SAFE_RELEASE(pVSErrorBuffer);
- }
-#endif
- if (FAILED(hr)) {
- ddlogError(DDLOG_WARN, "AssembleShader failed", hr);
- SAFE_RELEASE(pVSOpcodeBuffer);
- return;
- }
-
-// This is for debugging. Remove to enable vertex shaders in HW
-#define _GLD_FORCE_SW_VS 0
-
- if (_GLD_FORCE_SW_VS) {
- // _GLD_FORCE_SW_VS should be disabled for Final Release
- ddlogMessage(DDLOG_SYSTEM, "[Forcing shaders in SW]\n");
- }
-
- // Try and create shader in hardware.
- // NOTE: The D3D Ref device appears to succeed when trying to
- // create the device in hardware, but later complains
- // when trying to set it with SetVertexShader(). Go figure.
- if (_GLD_FORCE_SW_VS || glb.dwDriver == GLDS_DRIVER_REF) {
- // Don't try and create a hardware shader with the Ref device
- hr = E_FAIL; // COM error/fail result
- } else {
- gld->VStwosidelight.bHardware = TRUE;
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- 0);
- }
- if (FAILED(hr)) {
- ddlogMessage(DDLOG_INFO, "... HW failed, trying SW...\n");
- // Failed. Try and create shader for software processing
- hr = IDirect3DDevice8_CreateVertexShader(
- gld->pDev,
- dwTwoSidedLightingDecl,
- pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer),
- &gld->VStwosidelight.hShader,
- D3DUSAGE_SOFTWAREPROCESSING);
- if (FAILED(hr)) {
- gld->VStwosidelight.hShader = 0; // Sanity check
- ddlogError(DDLOG_WARN, "CreateVertexShader failed", hr);
- return;
- }
- // Succeeded, but for software processing
- gld->VStwosidelight.bHardware = FALSE;
- }
-
- SAFE_RELEASE(pVSOpcodeBuffer);
-
- ddlogMessage(DDLOG_INFO, "... OK\n");
-}
-
-//---------------------------------------------------------------------------
-
-void _gldDestroyVertexShaders(
- GLD_driver_dx9 *gld)
-{
- if (gld->VStwosidelight.hShader) {
- IDirect3DDevice8_DeleteVertexShader(gld->pDev, gld->VStwosidelight.hShader);
- gld->VStwosidelight.hShader = 0;
- }
-}
-*/
-//---------------------------------------------------------------------------
-
-BOOL gldCreateDrawable_DX(
- DGL_ctx *ctx,
-// BOOL bDefaultDriver,
- BOOL bDirectDrawPersistant,
- BOOL bPersistantBuffers)
-{
- //
- // bDirectDrawPersistant: applies to IDirect3D9
- // bPersistantBuffers: applies to IDirect3DDevice9
- //
-
- HRESULT hResult;
- GLD_driver_dx9 *lpCtx = NULL;
- D3DDEVTYPE d3dDevType;
- D3DPRESENT_PARAMETERS d3dpp;
- D3DDISPLAYMODE d3ddm;
- DWORD dwBehaviourFlags;
- D3DADAPTER_IDENTIFIER9 d3dIdent;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- if (ctx->glPriv) {
- lpCtx = ctx->glPriv;
- // Release any existing interfaces
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- } else {
- lpCtx = (GLD_driver_dx9*)malloc(sizeof(GLD_driver_dx9));
- ZeroMemory(lpCtx, sizeof(lpCtx));
- }
-
- d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- // TODO: Check this
-// if (bDefaultDriver)
-// d3dDevType = D3DDEVTYPE_REF;
-
- // Use persistant interface if needed
- if (bDirectDrawPersistant && dx9Globals.bDirect3D) {
- lpCtx->pD3D = dx9Globals.pD3D;
- IDirect3D9_AddRef(lpCtx->pD3D);
- goto SkipDirectDrawCreate;
- }
-
- // Create Direct3D9 object
- lpCtx->pD3D = dx9Globals.fnDirect3DCreate9(D3D_SDK_VERSION);
- if (lpCtx->pD3D == NULL) {
- MessageBox(NULL, "Unable to initialize Direct3D9", "GLDirect", MB_OK);
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D9 interface");
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Cache Direct3D interface for subsequent GLRCs
- if (bDirectDrawPersistant && !dx9Globals.bDirect3D) {
- dx9Globals.pD3D = lpCtx->pD3D;
- IDirect3D9_AddRef(dx9Globals.pD3D);
- dx9Globals.bDirect3D = TRUE;
- }
-SkipDirectDrawCreate:
-
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D9_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Get device caps
- hResult = IDirect3D9_GetDeviceCaps(lpCtx->pD3D, glb.dwAdapter, d3dDevType, &lpCtx->d3dCaps9);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D9_GetDeviceCaps failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Check for hardware transform & lighting
- lpCtx->bHasHWTnL = lpCtx->d3dCaps9.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE;
-
-/*
- //
- // GONE FOR DX9?
- //
- // If this flag is present then we can't default to Mesa
- // SW rendering between BeginScene() and EndScene().
- if (lpCtx->d3dCaps9.Caps2 & D3DCAPS2_NO2DDURING3DSCENE) {
- ddlogMessage(DDLOG_WARN,
- "Warning : No 2D allowed during 3D scene.\n");
- }
-*/
-
- //
- // Create the Direct3D context
- //
-
- // Re-use original IDirect3DDevice if persistant buffers exist.
- // Note that we test for persistant IDirect3D9 as well
- // bDirectDrawPersistant == persistant IDirect3D9 (DirectDraw9 does not exist)
- if (bDirectDrawPersistant && bPersistantBuffers && dx9Globals.pD3D && dx9Globals.pDev) {
- lpCtx->pDev = dx9Globals.pDev;
- IDirect3DDevice9_AddRef(dx9Globals.pDev);
- goto skip_direct3ddevice_create;
- }
-
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 2; //1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(lpCtx->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
-
- // Support for vertical retrace synchronisation.
- // Set default presentation interval in case caps bits are missing
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- if (glb.bWaitForRetrace) {
- if (lpCtx->d3dCaps9.PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
- } else {
- if (lpCtx->d3dCaps9.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- }
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- // PresentationInterval Windowed mode is optional now in DX9 (DaveM)
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- if (glb.bWaitForRetrace) {
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
- } else {
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- }
- }
-
- // Decide if we can use hardware TnL
- dwBehaviourFlags = (lpCtx->bHasHWTnL) ?
- D3DCREATE_MIXED_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING;
- // Add flag to tell D3D to be thread-safe
- if (glb.bMultiThreaded)
- dwBehaviourFlags |= D3DCREATE_MULTITHREADED;
- // Add flag to tell D3D to be FPU-safe
- if (!glb.bFastFPU)
- dwBehaviourFlags |= D3DCREATE_FPU_PRESERVE;
- hResult = IDirect3D9_CreateDevice(lpCtx->pD3D,
- glb.dwAdapter,
- d3dDevType,
- ctx->hWnd,
- dwBehaviourFlags,
- &d3dpp,
- &lpCtx->pDev);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D9_CreateDevice failed", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- if (bDirectDrawPersistant && bPersistantBuffers && dx9Globals.pD3D) {
- dx9Globals.pDev = lpCtx->pDev;
- dx9Globals.bDirect3DDevice = TRUE;
- }
-
- // Dump some useful stats
- hResult = IDirect3D9_GetAdapterIdentifier(
- lpCtx->pD3D,
- glb.dwAdapter,
- 0, // No WHQL detection (avoid few seconds delay)
- &d3dIdent);
- if (SUCCEEDED(hResult)) {
- ddlogPrintf(DDLOG_INFO, "[Driver Description: %s]", &d3dIdent.Description);
- ddlogPrintf(DDLOG_INFO, "[Driver file: %s %d.%d.%02d.%d]",
- d3dIdent.Driver,
- HIWORD(d3dIdent.DriverVersion.HighPart),
- LOWORD(d3dIdent.DriverVersion.HighPart),
- HIWORD(d3dIdent.DriverVersion.LowPart),
- LOWORD(d3dIdent.DriverVersion.LowPart));
- ddlogPrintf(DDLOG_INFO, "[VendorId: 0x%X, DeviceId: 0x%X, SubSysId: 0x%X, Revision: 0x%X]",
- d3dIdent.VendorId, d3dIdent.DeviceId, d3dIdent.SubSysId, d3dIdent.Revision);
- }
-
- // Test to see if IHV driver exposes Scissor Test (new for DX9)
- lpCtx->bCanScissor = lpCtx->d3dCaps9.RasterCaps & D3DPRASTERCAPS_SCISSORTEST;
- ddlogPrintf(DDLOG_INFO, "Can Scissor: %s", lpCtx->bCanScissor ? "Yes" : "No");
-
- // Init projection matrix for D3D TnL
- D3DXMatrixIdentity(&lpCtx->matProjection);
- lpCtx->matModelView = lpCtx->matProjection;
-// gld->bUseMesaProjection = TRUE;
-
-skip_direct3ddevice_create:
-
- // Create buffers to hold primitives
- lpCtx->PB2d.dwFVF = GLD_FVF_2D_VERTEX;
- lpCtx->PB2d.dwPool = D3DPOOL_SYSTEMMEM;
- lpCtx->PB2d.dwStride = sizeof(GLD_2D_VERTEX);
- lpCtx->PB2d.dwUsage = D3DUSAGE_DONOTCLIP |
- D3DUSAGE_DYNAMIC |
- D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB2d);
- if (FAILED(hResult))
- goto return_with_error;
-
- lpCtx->PB3d.dwFVF = GLD_FVF_3D_VERTEX;
- lpCtx->PB3d.dwPool = D3DPOOL_DEFAULT;
- lpCtx->PB3d.dwStride = sizeof(GLD_3D_VERTEX);
- lpCtx->PB3d.dwUsage = D3DUSAGE_DYNAMIC |
-//DaveM D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB3d);
- if (FAILED(hResult))
- goto return_with_error;
-
-/* // NOTE: A FVF code of zero indicates a non-FVF vertex buffer (for vertex shaders)
- lpCtx->PBtwosidelight.dwFVF = 0; //GLD_FVF_TWOSIDED_VERTEX;
- lpCtx->PBtwosidelight.dwPool = D3DPOOL_DEFAULT;
- lpCtx->PBtwosidelight.dwStride = sizeof(GLD_TWOSIDED_VERTEX);
- lpCtx->PBtwosidelight.dwUsage = D3DUSAGE_DONOTCLIP |
- D3DUSAGE_DYNAMIC |
- D3DUSAGE_SOFTWAREPROCESSING |
- D3DUSAGE_WRITEONLY;
- hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PBtwosidelight);
- if (FAILED(hResult))
- goto return_with_error;*/
-
- // Now try and create the DX9 Vertex Shaders
-// _gldCreateVertexShaders(lpCtx);
-
- // Zero the pipeline usage counters
- lpCtx->PipelineUsage.qwMesa.QuadPart =
-// lpCtx->PipelineUsage.dwD3D2SVS.QuadPart =
- lpCtx->PipelineUsage.qwD3DFVF.QuadPart = 0;
-
- // Assign drawable to GL private
- ctx->glPriv = lpCtx;
- return TRUE;
-
-return_with_error:
- // Clean up and bail
-
-// _gldDestroyVertexShaders(lpCtx);
-
-// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
- return FALSE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldResizeDrawable_DX(
- DGL_ctx *ctx,
- BOOL bDefaultDriver,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- GLD_driver_dx9 *gld = NULL;
- D3DDEVTYPE d3dDevType;
- D3DPRESENT_PARAMETERS d3dpp;
- D3DDISPLAYMODE d3ddm;
- HRESULT hResult;
-
- // Error if context is NULL.
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (ctx->bSceneStarted) {
- IDirect3DDevice9_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-
- d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF;
- if (!bDefaultDriver)
- d3dDevType = D3DDEVTYPE_REF; // Force Direct3D Reference Rasterise (software)
-
- // Get the display mode so we can make a compatible backbuffer
- hResult = IDirect3D9_GetAdapterDisplayMode(gld->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hResult)) {
- nContextError = GLDERR_D3D;
-// goto return_with_error;
- return FALSE;
- }
-
- // Destroy DX9 Vertex Shaders before Reset()
-// _gldDestroyVertexShaders(gld);
-
- // Release POOL_DEFAULT objects before Reset()
- if (gld->PB2d.dwPool == D3DPOOL_DEFAULT)
- _gldDestroyPrimitiveBuffer(&gld->PB2d);
- if (gld->PB3d.dwPool == D3DPOOL_DEFAULT)
- _gldDestroyPrimitiveBuffer(&gld->PB3d);
-// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT)
-// _gldDestroyPrimitiveBuffer(&gld->PBtwosidelight);
-
- // Clear the presentation parameters (sets all members to zero)
- ZeroMemory(&d3dpp, sizeof(d3dpp));
-
- // Recommended by MS; needed for MultiSample.
- // Be careful if altering this for FullScreenBlit
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
- d3dpp.BackBufferFormat = d3ddm.Format;
- d3dpp.BackBufferCount = 1;
- d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(gld->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen);
- d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData;
- d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE;
-
- // TODO: Sync to refresh
-
- if (ctx->bFullscreen) {
- ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen
- d3dpp.Windowed = FALSE;
- d3dpp.BackBufferWidth = d3ddm.Width;
- d3dpp.BackBufferHeight = d3ddm.Height;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- // Get better benchmark results? KeithH
-// d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_UNLIMITED;
- } else {
- ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages
- d3dpp.Windowed = TRUE;
- d3dpp.BackBufferWidth = ctx->dwWidth;
- d3dpp.BackBufferHeight = ctx->dwHeight;
- d3dpp.hDeviceWindow = ctx->hWnd;
- d3dpp.FullScreen_RefreshRateInHz = 0;
- d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
- }
- hResult = IDirect3DDevice9_Reset(gld->pDev, &d3dpp);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Reset failed", hResult);
- return FALSE;
- //goto cleanup_and_return_with_error;
- }
-
- //
- // Recreate POOL_DEFAULT objects
- //
- if (gld->PB2d.dwPool == D3DPOOL_DEFAULT) {
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d);
- }
- if (gld->PB3d.dwPool == D3DPOOL_DEFAULT) {
- _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB3d);
- }
-// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT) {
-// _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d);
-// }
-
- // Recreate DX9 Vertex Shaders
-// _gldCreateVertexShaders(gld);
-
- // Signal a complete state update
- ctx->glCtx->Driver.UpdateState(ctx->glCtx, _NEW_ALL);
-
- // Begin a new scene
- IDirect3DDevice9_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyDrawable_DX(
- DGL_ctx *ctx)
-{
- GLD_driver_dx9 *lpCtx = NULL;
-
- // Error if context is NULL.
- if (!ctx)
- return FALSE;
-
- // Error if the drawable does not exist.
- if (!ctx->glPriv)
- return FALSE;
-
- lpCtx = ctx->glPriv;
-
-#ifdef _DEBUG
- // Dump out stats
- ddlogPrintf(DDLOG_SYSTEM, "Usage: M:0x%X%X, D:0x%X%X",
- lpCtx->PipelineUsage.qwMesa.HighPart,
- lpCtx->PipelineUsage.qwMesa.LowPart,
- lpCtx->PipelineUsage.qwD3DFVF.HighPart,
- lpCtx->PipelineUsage.qwD3DFVF.LowPart);
-#endif
-
-// _gldDestroyVertexShaders(lpCtx);
-
-// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB3d);
- _gldDestroyPrimitiveBuffer(&lpCtx->PB2d);
-
- SAFE_RELEASE(lpCtx->pDev);
- SAFE_RELEASE(lpCtx->pD3D);
-
- // Free the private drawable data
- free(ctx->glPriv);
- ctx->glPriv = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldCreatePrivateGlobals_DX(void)
-{
- ZeroMemory(&dx9Globals, sizeof(dx9Globals));
-
- // Load d3d9.dll
- dx9Globals.hD3D9DLL = LoadLibrary("D3D9.DLL");
- if (dx9Globals.hD3D9DLL == NULL)
- return FALSE;
-
- // Now try and obtain Direct3DCreate9
- dx9Globals.fnDirect3DCreate9 = (FNDIRECT3DCREATE9)GetProcAddress(dx9Globals.hD3D9DLL, "Direct3DCreate9");
- if (dx9Globals.fnDirect3DCreate9 == NULL) {
- FreeLibrary(dx9Globals.hD3D9DLL);
- return FALSE;
- }
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyPrivateGlobals_DX(void)
-{
- if (dx9Globals.bDirect3DDevice) {
- SAFE_RELEASE(dx9Globals.pDev);
- dx9Globals.bDirect3DDevice = FALSE;
- }
- if (dx9Globals.bDirect3D) {
- SAFE_RELEASE(dx9Globals.pD3D);
- dx9Globals.bDirect3D = FALSE;
- }
-
- FreeLibrary(dx9Globals.hD3D9DLL);
- dx9Globals.hD3D9DLL = NULL;
- dx9Globals.fnDirect3DCreate9 = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDisplayFormat(
- D3DFORMAT fmt,
- BYTE *cColorBits,
- BYTE *cRedBits,
- BYTE *cGreenBits,
- BYTE *cBlueBits,
- BYTE *cAlphaBits)
-{
- switch (fmt) {
- case D3DFMT_X1R5G5B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 5;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DFMT_R5G6B5:
- *cColorBits = 16;
- *cRedBits = 5;
- *cGreenBits = 6;
- *cBlueBits = 5;
- *cAlphaBits = 0;
- return;
- case D3DFMT_X8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
- return;
- case D3DFMT_A8R8G8B8:
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 8;
- return;
- }
-
- // Should not get here!
- *cColorBits = 32;
- *cRedBits = 8;
- *cGreenBits = 8;
- *cBlueBits = 8;
- *cAlphaBits = 0;
-}
-
-//---------------------------------------------------------------------------
-
-static void _BitsFromDepthStencilFormat(
- D3DFORMAT fmt,
- BYTE *cDepthBits,
- BYTE *cStencilBits)
-{
- // NOTE: GL expects either 32 or 16 as depth bits.
- switch (fmt) {
- case D3DFMT_D32:
- *cDepthBits = 32;
- *cStencilBits = 0;
- return;
- case D3DFMT_D15S1:
- *cDepthBits = 16;
- *cStencilBits = 1;
- return;
- case D3DFMT_D24S8:
- *cDepthBits = 32;
- *cStencilBits = 8;
- return;
- case D3DFMT_D16:
- *cDepthBits = 16;
- *cStencilBits = 0;
- return;
- case D3DFMT_D24X8:
- *cDepthBits = 32;
- *cStencilBits = 0;
- return;
- case D3DFMT_D24X4S4:
- *cDepthBits = 32;
- *cStencilBits = 4;
- return;
- }
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldBuildPixelformatList_DX(void)
-{
- D3DDISPLAYMODE d3ddm;
- D3DFORMAT fmt[6];
- IDirect3D9 *pD3D = NULL;
- HRESULT hr;
- int nSupportedFormats = 0;
- int i;
- DGL_pixelFormat *pPF;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-// char buf[128];
-// char cat[8];
-
- // Direct3D (SW or HW)
- // These are arranged so that 'best' pixelformat
- // is higher in the list (for ChoosePixelFormat).
- const D3DFORMAT DepthStencil[6] = {
-// New order: increaing Z, then increasing stencil
- D3DFMT_D15S1,
- D3DFMT_D16,
- D3DFMT_D24X4S4,
- D3DFMT_D24X8,
- D3DFMT_D24S8,
- D3DFMT_D32,
- };
-
- // Dump DX version
- ddlogMessage(GLDLOG_SYSTEM, "DirectX Version : 9.0\n");
-
- // Release any existing pixelformat list
- if (glb.lpPF) {
- free(glb.lpPF);
- }
-
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL;
-
- //
- // Pixelformats for Direct3D (SW or HW) rendering
- //
-
- // Get a Direct3D 9.0 interface
- pD3D = dx9Globals.fnDirect3DCreate9(D3D_SDK_VERSION);
- if (!pD3D) {
- return FALSE;
- }
-
- // We will use the display mode format when finding compliant
- // rendertarget/depth-stencil surfaces.
- hr = IDirect3D9_GetAdapterDisplayMode(pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hr)) {
- IDirect3D9_Release(pD3D);
- return FALSE;
- }
-
- // Run through the possible formats and detect supported formats
- for (i=0; i<6; i++) {
- hr = IDirect3D9_CheckDeviceFormat(
- pD3D,
- glb.dwAdapter,
- glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF,
- d3ddm.Format,
- D3DUSAGE_DEPTHSTENCIL,
- D3DRTYPE_SURFACE,
- DepthStencil[i]);
- if (FAILED(hr))
- // A failure here is not fatal.
- continue;
-
- // Verify that the depth format is compatible.
- hr = IDirect3D9_CheckDepthStencilMatch(
- pD3D,
- glb.dwAdapter,
- glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF,
- d3ddm.Format,
- d3ddm.Format,
- DepthStencil[i]);
- if (FAILED(hr))
- // A failure here is not fatal, just means depth-stencil
- // format is not compatible with this display mode.
- continue;
-
- fmt[nSupportedFormats++] = DepthStencil[i];
- }
-
- IDirect3D9_Release(pD3D);
-
- if (nSupportedFormats == 0)
- return FALSE; // Bail: no compliant pixelformats
-
- // Total count of pixelformats is:
- // (nSupportedFormats+1)*2
- // UPDATED: nSupportedFormats*2
- glb.lpPF = (DGL_pixelFormat *)calloc(nSupportedFormats*2, sizeof(DGL_pixelFormat));
- glb.nPixelFormatCount = nSupportedFormats*2;
- if (glb.lpPF == NULL) {
- glb.nPixelFormatCount = 0;
- return FALSE;
- }
-
- // Get a copy of pointer that we can alter
- pPF = glb.lpPF;
-
- // Cache colour bits from display format
- _BitsFromDisplayFormat(d3ddm.Format, &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
-
- //
- // Add single-buffer formats
- //
-/*
- // NOTE: No longer returning pixelformats that don't contain depth
- // Single-buffer, no depth-stencil buffer
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DFMT_UNKNOWN;
- pPF++;
-*/
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- //
- // Add double-buffer formats
- //
-
- // NOTE: No longer returning pixelformats that don't contain depth
-/*
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- pPF->pfd.cDepthBits = 0;
- pPF->pfd.cStencilBits = 0;
- pPF->dwDriverData = D3DFMT_UNKNOWN;
- pPF++;
-*/
- for (i=0; i<nSupportedFormats; i++, pPF++) {
- memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
- pPF->pfd.cColorBits = cColorBits;
- pPF->pfd.cRedBits = cRedBits;
- pPF->pfd.cGreenBits = cGreenBits;
- pPF->pfd.cBlueBits = cBlueBits;
- pPF->pfd.cAlphaBits = cAlphaBits;
- _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits);
- pPF->dwDriverData = fmt[i];
- }
-
- // Popup warning message if non RGB color mode
- {
- // This is a hack. KeithH
- HDC hdcDesktop = GetDC(NULL);
- DWORD dwDisplayBitDepth = GetDeviceCaps(hdcDesktop, BITSPIXEL);
- ReleaseDC(0, hdcDesktop);
- if (dwDisplayBitDepth <= 8) {
- ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth);
- MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING);
- }
- }
-
- // Mark list as 'current'
- glb.bPixelformatsDirty = FALSE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldInitialiseMesa_DX(
- DGL_ctx *lpCtx)
-{
- GLD_driver_dx9 *gld = NULL;
- int MaxTextureSize, TextureLevels;
- BOOL bSoftwareTnL;
-
- if (lpCtx == NULL)
- return FALSE;
-
- gld = lpCtx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (glb.bMultitexture) {
- lpCtx->glCtx->Const.MaxTextureUnits = gld->d3dCaps9.MaxSimultaneousTextures;
- // Only support MAX_TEXTURE_UNITS texture units.
- // ** If this is altered then the FVF formats must be reviewed **.
- if (lpCtx->glCtx->Const.MaxTextureUnits > GLD_MAX_TEXTURE_UNITS_DX9)
- lpCtx->glCtx->Const.MaxTextureUnits = GLD_MAX_TEXTURE_UNITS_DX9;
- } else {
- // Multitexture override
- lpCtx->glCtx->Const.MaxTextureUnits = 1;
- }
-
- // max texture size
- MaxTextureSize = min(gld->d3dCaps9.MaxTextureHeight, gld->d3dCaps9.MaxTextureWidth);
- if (MaxTextureSize == 0)
- MaxTextureSize = 256; // Sanity check
-
- //
- // HACK!!
- if (MaxTextureSize > 1024)
- MaxTextureSize = 1024; // HACK - CLAMP TO 1024
- // HACK!!
- //
-
- // Got to set MAX_TEXTURE_SIZE as max levels.
- // Who thought this stupid idea up? ;)
- TextureLevels = 0;
- // Calculate power-of-two.
- while (MaxTextureSize) {
- TextureLevels++;
- MaxTextureSize >>= 1;
- }
- lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8;
-
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_DITHERENABLE, TRUE);
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_SHADEMODE, D3DSHADE_GOURAUD);
-
- IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ZENABLE,
- (lpCtx->lpPF->dwDriverData!=D3DFMT_UNKNOWN) ? D3DZB_TRUE : D3DZB_FALSE);
-
- // Set the view matrix
- {
- D3DXMATRIX vm;
-#if 1
- D3DXMatrixIdentity(&vm);
-#else
- D3DXVECTOR3 Eye(0.0f, 0.0f, 0.0f);
- D3DXVECTOR3 At(0.0f, 0.0f, -1.0f);
- D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f);
- D3DXMatrixLookAtRH(&vm, &Eye, &At, &Up);
- vm._31 = -vm._31;
- vm._32 = -vm._32;
- vm._33 = -vm._33;
- vm._34 = -vm._34;
-#endif
- IDirect3DDevice9_SetTransform(gld->pDev, D3DTS_VIEW, &vm);
- }
-
- if (gld->bHasHWTnL) {
- if (glb.dwTnL == GLDS_TNL_DEFAULT)
- bSoftwareTnL = FALSE; // HW TnL
- else {
- bSoftwareTnL = ((glb.dwTnL == GLDS_TNL_MESA) || (glb.dwTnL == GLDS_TNL_D3DSW)) ? TRUE : FALSE;
- }
- } else {
- // No HW TnL, so no choice possible
- bSoftwareTnL = TRUE;
- }
-// IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, bSoftwareTnL);
- IDirect3DDevice9_SetSoftwareVertexProcessing(gld->pDev, bSoftwareTnL);
-
-// Dump this in a Release build as well, now.
-//#ifdef _DEBUG
- ddlogPrintf(DDLOG_INFO, "HW TnL: %s",
- gld->bHasHWTnL ? (bSoftwareTnL ? "Disabled" : "Enabled") : "Unavailable");
-//#endif
-
- gldEnableExtensions_DX9(lpCtx->glCtx);
- gldInstallPipeline_DX9(lpCtx->glCtx);
- gldSetupDriverPointers_DX9(lpCtx->glCtx);
-
- // Signal a complete state update
- lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL);
-
- // Start a scene
- IDirect3DDevice9_BeginScene(gld->pDev);
- lpCtx->bSceneStarted = TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldSwapBuffers_DX(
- DGL_ctx *ctx,
- HDC hDC,
- HWND hWnd)
-{
- HRESULT hr;
- GLD_driver_dx9 *gld = NULL;
-
- if (ctx == NULL)
- return FALSE;
-
- gld = ctx->glPriv;
- if (gld == NULL)
- return FALSE;
-
- if (ctx->bSceneStarted) {
- IDirect3DDevice9_EndScene(gld->pDev);
- ctx->bSceneStarted = FALSE;
- }
-
- // Swap the buffers. hWnd may override the hWnd used for CreateDevice()
- hr = IDirect3DDevice9_Present(gld->pDev, NULL, NULL, hWnd, NULL);
-
-exit_swap:
-
- IDirect3DDevice9_BeginScene(gld->pDev);
- ctx->bSceneStarted = TRUE;
-
-// Debugging code
-#ifdef _DEBUG
-// ddlogMessage(GLDLOG_WARN, "SwapBuffers\n");
-#endif
-
- return (FAILED(hr)) ? FALSE : TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldGetDisplayMode_DX(
- DGL_ctx *ctx,
- GLD_displayMode *glddm)
-{
- D3DDISPLAYMODE d3ddm;
- HRESULT hr;
- GLD_driver_dx9 *lpCtx = NULL;
- BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits;
-
- if ((glddm == NULL) || (ctx == NULL))
- return FALSE;
-
- lpCtx = ctx->glPriv;
- if (lpCtx == NULL)
- return FALSE;
-
- if (lpCtx->pD3D == NULL)
- return FALSE;
-
- hr = IDirect3D9_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm);
- if (FAILED(hr))
- return FALSE;
-
- // Get info from the display format
- _BitsFromDisplayFormat(d3ddm.Format,
- &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits);
-
- glddm->Width = d3ddm.Width;
- glddm->Height = d3ddm.Height;
- glddm->BPP = cColorBits;
- glddm->Refresh = d3ddm.RefreshRate;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
diff --git a/src/mesa/drivers/windows/gldirect/mesasw/colors.h b/src/mesa/drivers/windows/gldirect/mesasw/colors.h
deleted file mode 100644
index 17371a96cce..00000000000
--- a/src/mesa/drivers/windows/gldirect/mesasw/colors.h
+++ /dev/null
@@ -1,523 +0,0 @@
-/* File name : colors.h
- * Version : 2.3
- *
- * Header file for display driver for Mesa 2.3 under
- * Windows95 and WindowsNT
- * This file defines macros and global variables needed
- * for converting color format
- *
- * Copyright (C) 1996- Li Wei
- * Address : Institute of Artificial Intelligence
- * : & Robotics
- * : Xi'an Jiaotong University
- * Email : liwei@aiar.xjtu.edu.cn
- * Web page : http://sun.aiar.xjtu.edu.cn
- *
- * This file and its associations are partially based on the
- * Windows NT driver for Mesa, written by Mark Leaming
- * (mark@rsinc.com).
- */
-
-/* $Log: ddcolors.h 1997/6/14 by Li Wei(liwei@aiar.xjtu.edu.cn)
- * Macros for pixel format defined
- */
-
-/*
- * $Log: colors.h,v $
- * Revision 1.1 2004/04/20 11:13:11 alanh
- * add SciTech's GLDirect driver for Windows.
- *
- * This code is donated to Mesa which allows the usage of
- * a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
- *
- * No build system exists for this code yet, that will come.....
- *
- * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
- * Imported sources
- *
- * Revision 1.2 1999/01/03 03:08:57 brianp
- * Ted Jump's changes
- *
- * Revision 1.1 1999/01/03 03:08:12 brianp
- * Initial revision
- *
- * Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
- * Add LUTs need for dithering
- */
-
-/*
- * $Log: colors.h,v $
- * Revision 1.1 2004/04/20 11:13:11 alanh
- * add SciTech's GLDirect driver for Windows.
- *
- * This code is donated to Mesa which allows the usage of
- * a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
- *
- * No build system exists for this code yet, that will come.....
- *
- * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
- * Imported sources
- *
- * Revision 1.2 1999/01/03 03:08:57 brianp
- * Ted Jump's changes
- *
- * Revision 1.1 1999/01/03 03:08:12 brianp
- * Initial revision
- *
- * Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
- * Add BGR8 Macro
- */
-
-/*
- * $Log: colors.h,v $
- * Revision 1.1 2004/04/20 11:13:11 alanh
- * add SciTech's GLDirect driver for Windows.
- *
- * This code is donated to Mesa which allows the usage of
- * a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
- *
- * No build system exists for this code yet, that will come.....
- *
- * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
- * Imported sources
- *
- * Revision 1.2 1999/01/03 03:08:57 brianp
- * Ted Jump's changes
- *
- * Revision 1.1 1999/01/03 03:08:12 brianp
- * Initial revision
- *
- * Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
- * Initial revision
- */
-/* Values for wmesa->pixelformat: */
-
-#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
-#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */
-#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
-#define PF_DITHER8 6 /* Dithered RGB using a lookup table */
-#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */
-#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */
-#define PF_BADFORMAT 11
-#define PF_INDEX8 12
-
-char ColorMap16[] = {
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
-0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
-0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
-0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
-0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,
-0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,
-0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
-0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
-0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,
-0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,
-0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,
-0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
-0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,
-0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,
-0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
-0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
-0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
-0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
-0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,
-0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
-0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,
-0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,
-0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
-0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,
-0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
-0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,
-0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,
-0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
-
-#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5)))
-#ifdef DDRAW
-#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11)))
-#else
-#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10)))
-#endif
-#define BGR24(r,g,b) (unsigned long)(((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8)
-#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))
-
-
-
-/*
- * If pixelformat==PF_8A8B8G8R:
- */
-#define PACK_8A8B8G8R( R, G, B, A ) \
- ( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) )
-
-
-/*
- * If pixelformat==PF_8R8G8B:
- */
-#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) )
-
-
-/*
- * If pixelformat==PF_5R6G5B:
- */
-
-
-#ifdef DDRAW
-#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11)))
-#else
-#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10)))
-#endif
-/*----------------------------------------------------------------------------
-
-Division lookup tables. These tables compute 0-255 divided by 51 and
-modulo 51. These tables could approximate gamma correction.
-
-*/
-
-char unsigned const aDividedBy51Rounded[256] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-};
-
-char unsigned const aDividedBy51[256] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
-};
-
-char unsigned const aModulo51[256] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0,
-};
-
-/*----------------------------------------------------------------------------
-
-Multiplication LUTs. These compute 0-5 times 6 and 36.
-
-*/
-
-char unsigned const aTimes6[6] =
-{
- 0, 6, 12, 18, 24, 30
-};
-
-char unsigned const aTimes36[6] =
-{
- 0, 36, 72, 108, 144, 180
-};
-
-
-/*----------------------------------------------------------------------------
-
-Dither matrices for 8 bit to 2.6 bit halftones.
-
-*/
-
-char unsigned const aHalftone16x16[256] =
-{
- 0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43,
- 34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21,
- 38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6,
- 22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34,
- 2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42,
- 37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20,
- 40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4,
- 24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32,
- 2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41,
- 37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19,
- 40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3,
- 24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31,
- 1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43,
- 36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21,
- 39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5,
- 23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33,
-};
-
-char unsigned const aHalftone8x8[64] =
-{
- 0, 38, 9, 47, 2, 40, 11, 50,
- 25, 12, 35, 22, 27, 15, 37, 24,
- 6, 44, 3, 41, 8, 47, 5, 43,
- 31, 19, 28, 15, 34, 21, 31, 18,
- 1, 39, 11, 49, 0, 39, 10, 48,
- 27, 14, 36, 23, 26, 13, 35, 23,
- 7, 46, 4, 43, 7, 45, 3, 42,
- 33, 20, 30, 17, 32, 19, 29, 16,
-};
-
-char unsigned const aHalftone4x4_1[16] =
-{
- 0, 25, 6, 31,
- 38, 12, 44, 19,
- 9, 35, 3, 28,
- 47, 22, 41, 15
-};
-
-char unsigned const aHalftone4x4_2[16] =
-{
- 41, 3, 9, 28,
- 35, 15, 22, 47,
- 6, 25, 38, 0,
- 19, 44, 31, 12
-};
-
-/***************************************************************************
- aWinGHalftoneTranslation
-
- Translates a 2.6 bit-per-pixel halftoned representation into the
- slightly rearranged WinG Halftone Palette.
-*/
-
-char unsigned const aWinGHalftoneTranslation[216] =
-{
- 0,
- 29,
- 30,
- 31,
- 32,
- 249,
- 33,
- 34,
- 35,
- 36,
- 37,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 46,
- 47,
- 48,
- 49,
- 50,
- 51,
- 52,
- 53,
- 54,
- 55,
- 56,
- 250,
- 250,
- 57,
- 58,
- 59,
- 251,
- 60,
- 61,
- 62,
- 63,
- 64,
- 65,
- 66,
- 67,
- 68,
- 69,
- 70,
- 71,
- 72,
- 73,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 82,
- 83,
- 84,
- 85,
- 86,
- 87,
- 88,
- 89,
- 250,
- 90,
- 91,
- 92,
- 93,
- 94,
- 95,
- 96,
- 97,
- 98,
- 99,
- 100,
- 101,
- 102,
- 103,
- 104,
- 105,
- 106,
- 107,
- 108,
- 109,
- 110,
- 111,
- 227,
- 112,
- 113,
- 114,
- 115,
- 116,
- 117,
- 118,
- 119,
- 151,
- 120,
- 121,
- 122,
- 123,
- 124,
- 228,
- 125,
- 126,
- 229,
- 133,
- 162,
- 135,
- 131,
- 132,
- 137,
- 166,
- 134,
- 140,
- 130,
- 136,
- 143,
- 138,
- 139,
- 174,
- 141,
- 142,
- 177,
- 129,
- 144,
- 145,
- 146,
- 147,
- 148,
- 149,
- 150,
- 157,
- 152,
- 153,
- 154,
- 155,
- 156,
- 192,
- 158,
- 159,
- 160,
- 161,
- 196,
- 163,
- 164,
- 165,
- 127,
- 199,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 207,
- 175,
- 176,
- 210,
- 178,
- 179,
- 180,
- 181,
- 182,
- 183,
- 184,
- 185,
- 186,
- 187,
- 188,
- 189,
- 190,
- 191,
- 224,
- 193,
- 194,
- 195,
- 252,
- 252,
- 197,
- 198,
- 128,
- 253,
- 252,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 230,
- 208,
- 209,
- 231,
- 211,
- 212,
- 213,
- 214,
- 215,
- 216,
- 217,
- 218,
- 219,
- 220,
- 221,
- 222,
- 254,
- 223,
- 232,
- 225,
- 226,
- 255,
-}; \ No newline at end of file
diff --git a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
deleted file mode 100644
index 0f11b4fe513..00000000000
--- a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
+++ /dev/null
@@ -1,1719 +0,0 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x/2000/XP/XBox (Win32)
-*
-* Description: Mesa Software WGL (WindowsGL)
-*
-****************************************************************************/
-
-#include <windows.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-#include "glheader.h"
-#include "colors.h"
-#include "context.h"
-#include "colormac.h"
-#include "dd.h"
-#include "depth.h"
-#include "extensions.h"
-#include "macros.h"
-#include "matrix.h"
-// #include "mem.h"
-//#include "mmath.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "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 "swrast/s_trispan.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "dglcontext.h"
-#include "gld_driver.h"
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-DGL_pixelFormat pfTemplateMesaSW =
-{
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
- 1, // Structure version - should be 1
- // Flags:
- PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
- PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
- PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
- PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
- PFD_DOUBLEBUFFER | // The buffer is double-buffered.
- 0, // Placeholder for easy commenting of above flags
- PFD_TYPE_RGBA, // Pixel type RGBA.
- 32, // Total colour bitplanes (excluding alpha bitplanes)
- 8, 0, // Red bits, shift
- 8, 8, // Green bits, shift
- 8, 16, // Blue bits, shift
- 8, 24, // Alpha bits, shift (destination alpha)
- 64, // Accumulator bits (total)
- 16, 16, 16, 16, // Accumulator bits: Red, Green, Blue, Alpha
- 16, // Depth bits
- 8, // Stencil bits
- 0, // Number of auxiliary buffers
- 0, // Layer type
- 0, // Specifies the number of overlay and underlay planes.
- 0, // Layer mask
- 0, // Specifies the transparent color or index of an underlay plane.
- 0 // Damage mask
- },
- 0, // Unused
-};
-
-//---------------------------------------------------------------------------
-// Extensions
-//---------------------------------------------------------------------------
-
-typedef struct {
- PROC proc;
- char *name;
-} GLD_extension;
-
-static GLD_extension GLD_extList[] = {
-#ifdef GL_EXT_polygon_offset
- { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
-#endif
- { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
- { (PROC)glBlendColorEXT, "glBlendColorExt" },
- { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
- { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
- { (PROC)glColorPointerEXT, "glColorPointerEXT" },
- { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
- { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
- { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
- { (PROC)glGetPointervEXT, "glGetPointervEXT" },
- { (PROC)glArrayElementEXT, "glArrayElementEXT" },
- { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
- { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
- { (PROC)glBindTextureEXT, "glBindTextureEXT" },
- { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
- { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
- { (PROC)glIsTextureEXT, "glIsTextureEXT" },
- { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
- { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
- { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
- { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
- { (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
- { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
- { (PROC)glLockArraysEXT, "glLockArraysEXT" },
- { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
- { NULL, "\0" }
-};
-
-//---------------------------------------------------------------------------
-// WMesa Internal Functions
-//---------------------------------------------------------------------------
-
-#define PAGE_FILE 0xffffffff
-
-#define REDBITS 0x03
-#define REDSHIFT 0x00
-#define GREENBITS 0x03
-#define GREENSHIFT 0x03
-#define BLUEBITS 0x02
-#define BLUESHIFT 0x06
-
-typedef struct _dibSection {
- HDC hDC;
- HANDLE hFileMap;
- BOOL fFlushed;
- LPVOID base;
-} WMDIBSECTION, *PWMDIBSECTION;
-
-typedef struct wmesa_context {
- HWND Window;
- HDC hDC;
- HPALETTE hPalette;
- HPALETTE hOldPalette;
- HPEN hPen;
- HPEN hOldPen;
- HCURSOR hOldCursor;
- COLORREF crColor;
- // 3D projection stuff
- RECT drawRect;
- UINT uiDIBoffset;
- // OpenGL stuff
- HPALETTE hGLPalette;
- GLuint width;
- GLuint height;
- GLuint ScanWidth;
- GLboolean db_flag; //* double buffered?
- GLboolean rgb_flag; //* RGB mode?
- GLboolean dither_flag; //* use dither when 256 color mode for RGB?
- GLuint depth; //* bits per pixel (1, 8, 24, etc)
- ULONG pixel; // current color index or RGBA pixel value
- ULONG clearpixel; //* pixel for clearing the color buffers
- PBYTE ScreenMem; // WinG memory
- BITMAPINFO *IndexFormat;
- HPALETTE hPal; // Current Palette
- HPALETTE hPalHalfTone;
-
-
- WMDIBSECTION dib;
- BITMAPINFO bmi;
- HBITMAP hbmDIB;
- HBITMAP hOldBitmap;
- HBITMAP Old_Compat_BM;
- HBITMAP Compat_BM; // Bitmap for double buffering
- PBYTE pbPixels;
- int nColors;
- BYTE cColorBits;
- int pixelformat;
-
- RECT rectOffScreen;
- RECT rectSurface;
-// HWND hwnd;
- DWORD pitch;
- PBYTE addrOffScreen;
-
- // We always double-buffer, for performance reasons, but
- // we need to know which of SwapBuffers() or glFlush() to
- // handle. If we're emulating, then we update on Flush(),
- // otherwise we update on SwapBufers(). KeithH
- BOOL bEmulateSingleBuffer;
-} WMesaContext, *PWMC;
-
-#define GLD_GET_WMESA_DRIVER(c) (WMesaContext*)(c)->glPriv
-
-// TODO:
-GLint stereo_flag = 0 ;
-
-/* If we are double-buffering, we want to get the DC for the
- * off-screen DIB, otherwise the DC for the window.
- */
-#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC )
-#define DD_RELEASEDC
-
-#define FLIP(Y) (Current->height-(Y)-1)
-
-struct DISPLAY_OPTIONS {
- int stereo;
- int fullScreen;
- int mode;
- int bpp;
-};
-
-struct DISPLAY_OPTIONS displayOptions;
-
-//---------------------------------------------------------------------------
-
-static unsigned char threeto8[8] = {
- 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377
-};
-
-static unsigned char twoto8[4] = {
- 0, 0x55, 0xaa, 0xff
-};
-
-static unsigned char oneto8[2] = {
- 0, 255
-};
-
-//---------------------------------------------------------------------------
-
-BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline)
-{
- char unsigned redtemp, greentemp, bluetemp, paletteindex;
-
- //*** now, look up each value in the halftone matrix
- //*** using an 8x8 ordered dither.
- redtemp = aDividedBy51[red]
- + (aModulo51[red] > aHalftone8x8[(pixel%8)*8
- + scanline%8]);
- greentemp = aDividedBy51[(char unsigned)green]
- + (aModulo51[green] > aHalftone8x8[
- (pixel%8)*8 + scanline%8]);
- bluetemp = aDividedBy51[(char unsigned)blue]
- + (aModulo51[blue] > aHalftone8x8[
- (pixel%8)*8 +scanline%8]);
-
- //*** recombine the halftoned rgb values into a palette index
- paletteindex =
- redtemp + aTimes6[greentemp] + aTimes36[bluetemp];
-
- //*** and translate through the wing halftone palette
- //*** translation vector to give the correct value.
- return aWinGHalftoneTranslation[paletteindex];
-}
-
-//---------------------------------------------------------------------------
-
-static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift)
-{
- unsigned char val;
-
- val = i >> shift;
- switch (nbits) {
-
- case 1:
- val &= 0x1;
- return oneto8[val];
-
- case 2:
- val &= 0x3;
- return twoto8[val];
-
- case 3:
- val &= 0x7;
- return threeto8[val];
-
- default:
- return 0;
- }
-}
-
-//---------------------------------------------------------------------------
-
-
-void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b)
-{
- WMesaContext *Current = pwc;
-
- // Test for invalid scanline parameter. KeithH
- if ((iScanLine < 0) || (iScanLine >= pwc->height))
- return;
-
- if (Current->db_flag) {
- LPBYTE lpb = pwc->pbPixels;
- UINT nBypp = pwc->cColorBits >> 3;
- UINT nOffset = iPixel % nBypp;
-
- lpb += pwc->ScanWidth * iScanLine;
- lpb += iPixel * nBypp;
-
- if(nBypp == 1){
- if(pwc->dither_flag)
- *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel);
- else
- *lpb = BGR8(r,g,b);
- }
- else if(nBypp == 2)
- *((LPWORD)lpb) = BGR16(r,g,b);
- else if (nBypp == 3)
- *((LPDWORD)lpb) = BGR24(r,g,b);
- else if (nBypp == 4)
- *((LPDWORD)lpb) = BGR32(r,g,b);
- }
- else{
- SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b));
- }
-}
-
-//---------------------------------------------------------------------------
-
-void wmCreateDIBSection(
- HDC hDC,
- PWMC pwc, // handle of device context
- CONST BITMAPINFO *pbmi, // bitmap size, format, and color data
- UINT iUsage // color data type indicator: RGB values or palette indices
- )
-{
- DWORD dwSize = 0;
- DWORD dwScanWidth;
- UINT nBypp = pwc->cColorBits / 8;
- HDC hic;
-
- dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3);
-
- pwc->ScanWidth =pwc->pitch = dwScanWidth;
-
- if (stereo_flag)
- pwc->ScanWidth = 2* pwc->pitch;
-
- dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height);
-
- pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE,
- NULL,
- PAGE_READWRITE | SEC_COMMIT,
- 0,
- dwSize,
- NULL);
-
- if (!pwc->dib.hFileMap)
- return;
-
- pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap,
- FILE_MAP_ALL_ACCESS,
- 0,
- 0,
- 0);
-
- if(!pwc->dib.base){
- CloseHandle(pwc->dib.hFileMap);
- return;
- }
-
-
- CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO));
-
- hic = CreateIC("display", NULL, NULL, NULL);
- pwc->dib.hDC = CreateCompatibleDC(hic);
-
-
- pwc->hbmDIB = CreateDIBSection(hic,
- &(pwc->bmi),
- (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS),
- &(pwc->pbPixels),
- pwc->dib.hFileMap,
- 0);
- pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels;
- pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB);
-
- DeleteDC(hic);
-
- return;
-
-}
-
-//---------------------------------------------------------------------------
-
-void wmCreatePalette( PWMC pwdc )
-{
- /* Create a compressed and re-expanded 3:3:2 palette */
- int i;
- LOGPALETTE *pPal;
- BYTE rb, rs, gb, gs, bb, bs;
-
- pwdc->nColors = 0x100;
-
- pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) +
- pwdc->nColors * sizeof(PALETTEENTRY));
- memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) );
-
- pPal->palVersion = 0x300;
-
- rb = REDBITS;
- rs = REDSHIFT;
- gb = GREENBITS;
- gs = GREENSHIFT;
- bb = BLUEBITS;
- bs = BLUESHIFT;
-
- if (pwdc->db_flag) {
-
- /* Need to make two palettes: one for the screen DC and one for the DIB. */
- pPal->palNumEntries = pwdc->nColors;
- for (i = 0; i < pwdc->nColors; i++) {
- pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs );
- pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs );
- pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs );
- pPal->palPalEntry[i].peFlags = 0;
- }
- pwdc->hGLPalette = CreatePalette( pPal );
- pwdc->hPalette = CreatePalette( pPal );
- }
-
- else {
- pPal->palNumEntries = pwdc->nColors;
- for (i = 0; i < pwdc->nColors; i++) {
- pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs );
- pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs );
- pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs );
- pPal->palPalEntry[i].peFlags = 0;
- }
- pwdc->hGLPalette = CreatePalette( pPal );
- }
-
- free(pPal);
-
-}
-
-//---------------------------------------------------------------------------
-
-/* This function sets the color table of a DIB section
- * to match that of the destination DC
- */
-BOOL wmSetDibColors(PWMC pwc)
-{
- RGBQUAD *pColTab, *pRGB;
- PALETTEENTRY *pPal, *pPE;
- int i, nColors;
- BOOL bRet=TRUE;
- DWORD dwErr=0;
-
- /* Build a color table in the DIB that maps to the
- * selected palette in the DC.
- */
- nColors = 1 << pwc->cColorBits;
- pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY));
- memset( pPal, 0, nColors * sizeof(PALETTEENTRY) );
- GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal );
- pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD));
- for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) {
- pRGB->rgbRed = pPE->peRed;
- pRGB->rgbGreen = pPE->peGreen;
- pRGB->rgbBlue = pPE->peBlue;
- }
- if(pwc->db_flag)
- bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab );
-
- if(!bRet)
- dwErr = GetLastError();
-
- free( pColTab );
- free( pPal );
-
- return bRet;
-}
-
-//---------------------------------------------------------------------------
-
-static void wmSetPixelFormat( PWMC wc, HDC hDC)
-{
- if(wc->rgb_flag)
- wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL);
- else
- wc->cColorBits = 8;
- switch(wc->cColorBits){
- case 8:
- if(wc->dither_flag != GL_TRUE)
- wc->pixelformat = PF_INDEX8;
- else
- wc->pixelformat = PF_DITHER8;
- break;
- case 16:
- wc->pixelformat = PF_5R6G5B;
- break;
- case 32:
- wc->pixelformat = PF_8R8G8B;
- break;
- default:
- wc->pixelformat = PF_BADFORMAT;
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * This function creates the DIB section that is used for combined
- * GL and GDI calls
- */
-BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize)
-{
- HDC hdc = pwc->hDC;
- LPBITMAPINFO pbmi = &(pwc->bmi);
- int iUsage;
-
- pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- pbmi->bmiHeader.biWidth = lxSize;
- pbmi->bmiHeader.biHeight= -lySize;
- pbmi->bmiHeader.biPlanes = 1;
- if(pwc->rgb_flag)
- pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL);
- else
- pbmi->bmiHeader.biBitCount = 8;
- pbmi->bmiHeader.biCompression = BI_RGB;
- pbmi->bmiHeader.biSizeImage = 0;
- pbmi->bmiHeader.biXPelsPerMeter = 0;
- pbmi->bmiHeader.biYPelsPerMeter = 0;
- pbmi->bmiHeader.biClrUsed = 0;
- pbmi->bmiHeader.biClrImportant = 0;
-
- iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS;
-
- pwc->cColorBits = pbmi->bmiHeader.biBitCount;
- pwc->ScanWidth = pwc->pitch = lxSize;
- pwc->width = lxSize;
- pwc->height = lySize;
-
- wmCreateDIBSection(hdc, pwc, pbmi, iUsage);
-
- if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) {
- wmCreatePalette( pwc );
- wmSetDibColors( pwc );
- }
- wmSetPixelFormat(pwc, pwc->hDC);
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * Free up the dib section that was created
- */
-BOOL wmDeleteBackingStore(PWMC pwc)
-{
- SelectObject(pwc->dib.hDC, pwc->hOldBitmap);
- DeleteDC(pwc->dib.hDC);
- DeleteObject(pwc->hbmDIB);
- UnmapViewOfFile(pwc->dib.base);
- CloseHandle(pwc->dib.hFileMap);
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * Blit memory DC to screen DC
- */
-BOOL wmFlush(PWMC pwc, HDC hDC)
-{
- BOOL bRet = 0;
- DWORD dwErr = 0;
-
-// Now using bEmulateSingleBuffer in the calling function. KeithH
-
-// if(pwc->db_flag){
- bRet = BitBlt(hDC, 0, 0, pwc->width, pwc->height,
- pwc->dib.hDC, 0, 0, SRCCOPY);
-// }
-
- return bRet;
-
-}
-
-//---------------------------------------------------------------------------
-// Support Functions
-//---------------------------------------------------------------------------
-
-static void flush(GLcontext* ctx)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
-/*
- if((Current->rgb_flag &&!(Current->db_flag))
- ||(!Current->rgb_flag))
- {
- wmFlush(Current, Current->hDC);
- }
-*/
- // Only flush if we're not in double-buffer mode. KeithH
- // The demo fractal.c calls glutSwapBuffers() then glFlush()!
- if (Current->bEmulateSingleBuffer) {
- wmFlush(Current, Current->hDC);
- }
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Set the color index used to clear the color buffer.
- */
-static void clear_index(GLcontext* ctx, GLuint index)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- Current->clearpixel = index;
-}
-
-
-
-//---------------------------------------------------------------------------
-
-/*
- * Set the color used to clear the color buffer.
- */
-//static void clear_color( GLcontext* ctx, const GLchan color[4] )
-// Changed for Mesa 5.x. KeithH
-static void clear_color(
- GLcontext* ctx,
- const GLfloat color[4])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLubyte col[4];
- CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
- Current->clearpixel = RGB(col[0], col[1], col[2]);
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Clear the specified region of the color buffer using the clear color
- * or index as specified by one of the two functions above.
- *
- * This procedure clears either the front and/or the back COLOR buffers.
- * Only the "left" buffer is cleared since we are not stereo.
- * Clearing of the other non-color buffers is left to the swrast.
- * We also only clear the color buffers if the color masks are all 1's.
- * Otherwise, we let swrast do it.
- */
-
-static clear(GLcontext* ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- DWORD dwColor;
- WORD wColor;
- BYTE bColor;
- LPDWORD lpdw = (LPDWORD)Current->pbPixels;
- LPWORD lpw = (LPWORD)Current->pbPixels;
- LPBYTE lpb = Current->pbPixels;
- int lines;
- const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
-
- if (all){
- x=y=0;
- width=Current->width;
- height=Current->height;
- }
-
-
- /* sanity check - can't have right(stereo) buffers */
- assert((mask & (DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT)) == 0);
-
- /* clear alpha */
- if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_RIGHT_BIT)) &&
- ctx->DrawBuffer->UseSoftwareAlphaBuffers &&
- ctx->Color.ColorMask[ACOMP]) {
- _swrast_clear_alpha_buffers( ctx );
- }
-
- if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
- if (mask & DD_BACK_LEFT_BIT) {
- /* Double-buffering - clear back buffer */
- UINT nBypp = Current->cColorBits / 8;
- int i = 0;
- int iSize = 0;
-
- assert(Current->db_flag==GL_TRUE); /* we'd better be double buffer */
- if(nBypp ==1 ){
- iSize = Current->width/4;
- bColor = BGR8(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- wColor = MAKEWORD(bColor,bColor);
- dwColor = MAKELONG(wColor, wColor);
- }
- if(nBypp == 2){
- iSize = Current->width / 2;
- wColor = BGR16(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- dwColor = MAKELONG(wColor, wColor);
- }
- else if(nBypp == 4){
- iSize = Current->width;
- dwColor = BGR32(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- }
-
- /* clear a line */
- while(i < iSize){
- *lpdw = dwColor;
- lpdw++;
- i++;
- }
-
- /* This is the 24bit case */
- if (nBypp == 3) {
- iSize = Current->width *3/4;
- dwColor = BGR24(GetRValue(Current->clearpixel),
- GetGValue(Current->clearpixel),
- GetBValue(Current->clearpixel));
- while(i < iSize){
- *lpdw = dwColor;
- lpb += nBypp;
- lpdw = (LPDWORD)lpb;
- i++;
- }
- }
-
- i = 0;
- if (stereo_flag)
- lines = height /2;
- else
- lines = height;
- /* copy cleared line to other lines in buffer */
- do {
- memcpy(lpb, Current->pbPixels, iSize*4);
- lpb += Current->ScanWidth;
- i++;
- }
- while (i<lines-1);
- mask &= ~DD_BACK_LEFT_BIT;
- } /* double-buffer */
-
- if (mask & DD_FRONT_LEFT_BIT) {
- /* single-buffer */
- HDC DC=DD_GETDC;
- HPEN Pen=CreatePen(PS_SOLID,1,Current->clearpixel);
- HBRUSH Brush=CreateSolidBrush(Current->clearpixel);
- HPEN Old_Pen=SelectObject(DC,Pen);
- HBRUSH Old_Brush=SelectObject(DC,Brush);
- Rectangle(DC,x,y,x+width,y+height);
- SelectObject(DC,Old_Pen);
- SelectObject(DC,Old_Brush);
- DeleteObject(Pen);
- DeleteObject(Brush);
- DD_RELEASEDC;
- mask &= ~DD_FRONT_LEFT_BIT;
- } /* single-buffer */
- } /* if masks are all 1's */
-
- /* Call swrast if there is anything left to clear (like DEPTH) */
- if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
-}
-
-
-//---------------------------------------------------------------------------
-
-
-static void enable( GLcontext* ctx, GLenum pname, GLboolean enable )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
-
- if (!Current)
- return;
-
- if (pname == GL_DITHER) {
- if(enable == GL_FALSE){
- Current->dither_flag = GL_FALSE;
- if(Current->cColorBits == 8)
- Current->pixelformat = PF_INDEX8;
- }
- else{
- if (Current->rgb_flag && Current->cColorBits == 8){
- Current->pixelformat = PF_DITHER8;
- Current->dither_flag = GL_TRUE;
- }
- else
- Current->dither_flag = GL_FALSE;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode )
-{
- /* TODO: this could be better */
- if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-//---------------------------------------------------------------------------
-
-
-static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum buffer )
-{
- /* XXX todo */
- return;
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/* Return characteristics of the output buffer. */
-//static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height )
-// Altered for Mesa 5.x. KeithH
-static void buffer_size(
- GLframebuffer *buffer,
- GLuint *width,
- GLuint *height)
-{
- // For some reason the context is not passed into this function.
- // Therefore we have to explicitly retrieve it.
- GET_CURRENT_CONTEXT(ctx);
-
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- int New_Size;
- RECT CR;
-
- GetClientRect(Current->Window,&CR);
-
- *width=CR.right;
- *height=CR.bottom;
-
- New_Size=((*width)!=Current->width) || ((*height)!=Current->height);
-
- if (New_Size){
- Current->width=*width;
- Current->height=*height;
- Current->ScanWidth=Current->width;
- if ((Current->ScanWidth%sizeof(long))!=0)
- Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long)));
-
- if (Current->db_flag){
- if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){
- wmDeleteBackingStore(Current);
- wmCreateBackingStore(Current, Current->width, Current->height);
- }
- }
-
- }
-}
-
-
-
-/**********************************************************************/
-/***** Accelerated point, line, polygon rendering *****/
-/**********************************************************************/
-
-/* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */
-
-static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last )
-{
-}
-
-//---------------------------------------------------------------------------
-
-/* Return pointer to accelerated points function */
-extern tnl_points_func choose_points_function( GLcontext* ctx )
-{
- return NULL;
-}
-
-//---------------------------------------------------------------------------
-
-static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0,
- GLuint v1, GLuint pv )
-{
-}
-
-//---------------------------------------------------------------------------
-
-static tnl_line_func choose_line_function( GLcontext* ctx )
-{
-}
-
-
-/**********************************************************************/
-/***** Span-based pixel drawing *****/
-/**********************************************************************/
-
-
-/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */
-static void write_ci32_span( const GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- const GLuint index[],
- const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i]=index[i];
-}
-
-
-//---------------------------------------------------------------------------
-
-/* Write a horizontal span of 8-bit color-index pixels with a boolean mask. */
-static void write_ci8_span( const GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- const GLubyte index[],
- const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i]=index[i];
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current
- * color index is used for all pixels.
- */
-static void write_mono_ci_span(const GLcontext* ctx,
- GLuint n,GLint x,GLint y,
- GLuint colorIndex, const GLubyte mask[])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- BYTE *Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i]=colorIndex;
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * To improve the performance of this routine, frob the data into an actual
- * scanline and call bitblt on the complete scan line instead of SetPixel.
- */
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span( const GLcontext* ctx, GLuint n, GLint x, GLint y,
- const GLubyte rgba[][4], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- PWMC pwc = Current;
-
- if (pwc->rgb_flag==GL_TRUE)
- {
- GLuint i;
- HDC DC=DD_GETDC;
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, y, x + i,
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- wmSetPixel(pwc, y, x + i,
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
- }
- DD_RELEASEDC;
- }
- else
- {
- GLuint i;
- BYTE *Mem=Current->ScreenMem+y*Current->ScanWidth+x;
- y = FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgba[i][RCOMP],
- rgba[i][GCOMP],
- rgba[i][BCOMP]));
- }
- else {
- for (i=0; i<n; i++)
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgba[i][RCOMP],
- rgba[i][GCOMP],
- rgba[i][BCOMP]));
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-/* Write a horizontal span of RGB color pixels with a boolean mask. */
-static void write_rgb_span( const GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- const GLubyte rgb[][3], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- PWMC pwc = Current;
-
- if (pwc->rgb_flag==GL_TRUE)
- {
- GLuint i;
- HDC DC=DD_GETDC;
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, y, x + i,
- rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- wmSetPixel(pwc, y, x + i,
- rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP] );
- }
- DD_RELEASEDC;
- }
- else
- {
- GLuint i;
- BYTE *Mem=Current->ScreenMem+y*Current->ScanWidth+x;
- y = FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgb[i][RCOMP],
- rgb[i][GCOMP],
- rgb[i][BCOMP]));
- }
- else {
- for (i=0; i<n; i++)
- Mem[i] = GetNearestPaletteIndex(Current->hPal,
- RGB(rgb[i][RCOMP],
- rgb[i][GCOMP],
- rgb[i][BCOMP]));
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_span( const GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- const GLchan color[4], const GLubyte mask[])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] );
- GLuint i;
- HDC DC=DD_GETDC;
- PWMC pwc = Current;
- assert(Current->rgb_flag==GL_TRUE);
- y=FLIP(y);
- if(Current->rgb_flag==GL_TRUE){
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc,y,x+i,color[RCOMP], color[GCOMP], color[BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(DC, y, x+i, pixel);
- }
- DD_RELEASEDC;
-}
-
-
-
-/**********************************************************************/
-/***** Array-based pixel drawing *****/
-/**********************************************************************/
-
-
-/* Write an array of 32-bit index pixels with a boolean mask. */
-static void write_ci32_pixels( const GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLuint index[], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- BYTE *Mem=Current->ScreenMem+FLIP(y[i])*Current->ScanWidth+x[i];
- *Mem = index[i];
- }
- }
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * index is used for all pixels.
- */
-static void write_mono_ci_pixels( const GLcontext* ctx,
- GLuint n,
- const GLint x[], const GLint y[],
- GLuint colorIndex, const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- BYTE *Mem=Current->ScreenMem+FLIP(y[i])*Current->ScanWidth+x[i];
- *Mem = colorIndex;
- }
- }
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels( const GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLubyte rgba[][4], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PWMC pwc = Current;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
- DD_RELEASEDC;
-}
-
-
-//---------------------------------------------------------------------------
-
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_pixels( const GLcontext* ctx,
- GLuint n,
- const GLint x[], const GLint y[],
- const GLchan color[4],
- const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- PWMC pwc = Current;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- for (i=0; i<n; i++)
- if (mask[i])
- wmSetPixel(pwc, FLIP(y[i]),x[i],color[RCOMP],
- color[GCOMP], color[BCOMP]);
- DD_RELEASEDC;
-}
-
-/**********************************************************************/
-/***** Read spans/arrays of pixels *****/
-/**********************************************************************/
-
-/* Read a horizontal span of color-index pixels. */
-static void read_ci32_span( const GLcontext* ctx, GLuint n, GLint x, GLint y,
- GLuint index[])
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- BYTE *Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- index[i]=Mem[i];
-}
-
-//---------------------------------------------------------------------------
-
-/* Read an array of color index pixels. */
-static void read_ci32_pixels( const GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint indx[], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- indx[i]=*(Current->ScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]);
- }
- }
-}
-
-//---------------------------------------------------------------------------
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span( const GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- GLubyte rgba[][4] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- UINT i;
- COLORREF Color;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- y = Current->height - y - 1;
- for (i=0; i<n; i++) {
- Color=GetPixel(DC,x+i,y);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
- DD_RELEASEDC;
-}
-
-//---------------------------------------------------------------------------
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels( const GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLubyte rgba[][4], const GLubyte mask[] )
-{
- GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
- WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
- GLuint i;
- COLORREF Color;
- HDC DC=DD_GETDC;
- assert(Current->rgb_flag==GL_TRUE);
- for (i=0; i<n; i++) {
- if (mask[i]) {
- GLint y2 = Current->height - y[i] - 1;
- Color=GetPixel(DC,x[i],y2);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
- }
- DD_RELEASEDC;
-}
-
-//---------------------------------------------------------------------------
-
-static void wmesa_update_state(
- GLcontext *ctx,
- GLuint new_state)
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-//---------------------------------------------------------------------------
-
-static void wmesa_viewport(
- GLcontext *ctx,
- GLint x,
- GLint y,
- GLsizei w,
- GLsizei h)
-{
-// ctx->Driver.ResizeBuffersMESA(ctx);
-}
-
-//---------------------------------------------------------------------------
-
-static void wmesa_update_state_first_time(
- GLcontext *ctx,
- GLuint new_state)
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- /*
- * XXX these function pointers could be initialized just once during
- * context creation since they don't depend on any state changes.
- * kws - This is true - this function gets called a lot and it
- * would be good to minimize setting all this when not needed.
- */
- // Good idea, so I'll do it. KeithH. :-)
-
- ctx->Driver.GetString = _gldGetStringGeneric;
- ctx->Driver.UpdateState = wmesa_update_state;
- ctx->Driver.DrawBuffer = set_draw_buffer;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
- ctx->Driver.GetBufferSize = buffer_size;
-
- ctx->Driver.Viewport = wmesa_viewport;
-
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.Clear = clear;
-
- ctx->Driver.Flush = flush;
- ctx->Driver.ClearIndex = clear_index;
- ctx->Driver.ClearColor = clear_color;
- ctx->Driver.Enable = enable;
-
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format;
- ctx->Driver.TexImage1D = _mesa_store_teximage1d;
- ctx->Driver.TexImage2D = _mesa_store_teximage2d;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d;
- ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
- ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
-
- ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;
- ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;
- ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;
- ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
- ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-
- // Does not apply for Mesa 5.x
- //ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat;
- //ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size;
- //ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage;
-
- swdd->SetBuffer = set_read_buffer;
-
-
- /* Pixel/span writing functions: */
- swdd->WriteRGBASpan = write_rgba_span;
- swdd->WriteRGBSpan = write_rgb_span;
- swdd->WriteMonoRGBASpan = write_mono_rgba_span;
- swdd->WriteRGBAPixels = write_rgba_pixels;
- swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels;
- swdd->WriteCI32Span = write_ci32_span;
- swdd->WriteCI8Span = write_ci8_span;
- swdd->WriteMonoCISpan = write_mono_ci_span;
- swdd->WriteCI32Pixels = write_ci32_pixels;
- swdd->WriteMonoCIPixels = write_mono_ci_pixels;
-
- swdd->ReadCI32Span = read_ci32_span;
- swdd->ReadRGBASpan = read_rgba_span;
- swdd->ReadCI32Pixels = read_ci32_pixels;
- swdd->ReadRGBAPixels = read_rgba_pixels;
-
-
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
-
- wmesa_update_state(ctx, new_state);
-}
-
-//---------------------------------------------------------------------------
-// Driver interface functions
-//---------------------------------------------------------------------------
-
-BOOL gldCreateDrawable_MesaSW(
- DGL_ctx *pCtx,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- WMesaContext *c;
- GLboolean true_color_flag;
- GLboolean rgb_flag = GL_TRUE;
- GLboolean db_flag = GL_TRUE;
-
- if (pCtx == NULL)
- return FALSE;
-
- c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context));
- if (!c)
- return FALSE;
-
- pCtx->glPriv = c;
-
- c->hDC = pCtx->hDC;
- c->Window = pCtx->hWnd;
-
- true_color_flag = GetDeviceCaps(pCtx->hDC, BITSPIXEL) > 8;
-
-
-#ifdef DITHER
- if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){
- c->dither_flag = GL_TRUE;
- c->hPalHalfTone = WinGCreateHalftonePalette();
- }
- else
- c->dither_flag = GL_FALSE;
-#else
- c->dither_flag = GL_FALSE;
-#endif
-
-
- if (rgb_flag==GL_FALSE)
- {
- c->rgb_flag = GL_FALSE;
-#if 0
- /* Old WinG stuff???? */
- c->db_flag = db_flag =GL_TRUE; /* WinG requires double buffering */
- printf("Single buffer is not supported in color index mode, ",
- "setting to double buffer.\n");
-#endif
- }
- else
- {
- c->rgb_flag = GL_TRUE;
- }
-
-// db_flag = pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER ? GL_TRUE : GL_FALSE;
- db_flag = GL_TRUE; // Force double-buffer
- if (db_flag) {
- c->db_flag = 1;
- /* Double buffered */
- {
- wmCreateBackingStore(c, pCtx->dwWidth, pCtx->dwHeight);
-
- }
- } else {
- /* Single Buffered */
- if (c->rgb_flag)
- c->db_flag = 0;
- }
-
- c->bEmulateSingleBuffer = (pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER)
- ? FALSE : TRUE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldResizeDrawable_MesaSW(
- DGL_ctx *ctx,
- BOOL bDefaultDriver,
- BOOL bPersistantInterface,
- BOOL bPersistantBuffers)
-{
- WMesaContext *c;
-
- if (ctx == NULL)
- return FALSE;
-
- c = ctx->glPriv;
- if (c == NULL)
- return FALSE;
-
- c->hDC = ctx->hDC;
- c->Window = ctx->hWnd;
-// c->width = ctx->dwWidth;
-// c->height = ctx->dwHeight;
-
- if (c->db_flag) {
- wmDeleteBackingStore(c);
- wmCreateBackingStore(c, ctx->dwWidth, ctx->dwHeight);
- }
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyDrawable_MesaSW(
- DGL_ctx *ctx)
-{
- WMesaContext *c;
-
- if (ctx == NULL)
- return FALSE;
-
- c = ctx->glPriv;
- if (c == NULL)
- return FALSE;
-
- if (c->hPalHalfTone != NULL)
- DeleteObject(c->hPalHalfTone);
-
- if (c->db_flag)
- wmDeleteBackingStore(c);
-
- free(c);
-
- ctx->glPriv = NULL;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldCreatePrivateGlobals_MesaSW(void)
-{
- // Mesa Software driver needs no private globals
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldDestroyPrivateGlobals_MesaSW(void)
-{
- // Mesa Software driver needs no private globals
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldBuildPixelformatList_MesaSW(void)
-{
- // Release any existing pixelformat list
- if (glb.lpPF) {
- free(glb.lpPF);
- }
-
- glb.nPixelFormatCount = 0;
- glb.lpPF = NULL;
-
- glb.lpPF = (DGL_pixelFormat *)calloc(2, sizeof(DGL_pixelFormat));
- if (glb.lpPF == NULL)
- return FALSE;
- // Single-buffered
- memcpy(&glb.lpPF[0], &pfTemplateMesaSW, sizeof(DGL_pixelFormat));
- glb.lpPF[0].pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag
- // Double-buffered
- memcpy(&glb.lpPF[1], &pfTemplateMesaSW, sizeof(DGL_pixelFormat));
- glb.nPixelFormatCount = 2;
-
- // Mark list as 'current'
- glb.bPixelformatsDirty = FALSE;
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldInitialiseMesa_MesaSW(
- DGL_ctx *gld)
-{
- GLcontext *ctx;
-
- if (gld == NULL)
- return FALSE;
-
- ctx = gld->glCtx;
-
- // Set max texture size to 256
- ctx->Const.MaxTextureLevels = 8;
-
- // Multitexture enable/disable
- ctx->Const.MaxTextureUnits = (glb.bMultitexture) ? MAX_TEXTURE_UNITS : 1;
-
- /* Initialize the software rasterizer and helper modules.*/
-
- // Added this to force max texture diminsion to 256. KeithH
- ctx->Const.MaxTextureLevels = 8;
-
- _mesa_enable_sw_extensions(ctx);
- _mesa_enable_imaging_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
-
-// _swrast_CreateContext( ctx );
-// _ac_CreateContext( ctx );
-// _tnl_CreateContext( ctx );
-// _swsetup_CreateContext( ctx );
-
- _swsetup_Wakeup( ctx );
-
- wmesa_update_state_first_time(ctx, ~0);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldSwapBuffers_MesaSW(
- DGL_ctx *ctx,
- HDC hDC,
- HWND hWnd)
-{
- WMesaContext *c;
-
- if (ctx == NULL)
- return FALSE;
-
- c = ctx->glPriv;
- if (c == NULL)
- return FALSE;
-
- /* If we're swapping the buffer associated with the current context
- * we have to flush any pending rendering commands first.
- */
-
- // Altered to respect bEmulateSingleBuffer. KeithH
-// if (c->db_flag)
- if (!c->bEmulateSingleBuffer)
- wmFlush(c, hDC);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
-PROC gldGetProcAddress_MesaSW(
- LPCSTR a)
-{
- int i;
- PROC proc = NULL;
-
- for (i=0; GLD_extList[i].proc; i++) {
- if (!strcmp(a, GLD_extList[i].name)) {
- proc = GLD_extList[i].proc;
- break;
- }
- }
-
- gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
-
- return proc;
-}
-
-//---------------------------------------------------------------------------
-
-BOOL gldGetDisplayMode_MesaSW(
- DGL_ctx *ctx,
- GLD_displayMode *glddm)
-{
- HDC hdcDesktop;
-
- if (glddm == NULL)
- return FALSE;
-
- //
- // A bit hacky... KeithH
- //
-
- hdcDesktop = GetDC(NULL);
- glddm->Width = GetDeviceCaps(hdcDesktop, HORZRES);
- glddm->Height = GetDeviceCaps(hdcDesktop, VERTRES);
- glddm->BPP = GetDeviceCaps(hdcDesktop, BITSPIXEL);
- glddm->Refresh = 0;
- ReleaseDC(0, hdcDesktop);
-
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
-
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index bc779a94a9e..eecd52aa32b 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -1388,7 +1388,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
xmvis = create_glx_visual( dpy, visinfo );
if (!xmvis) {
/* unusable visual */
- FREE(glxCtx);
+ _mesa_free(glxCtx);
return NULL;
}
}
@@ -1396,7 +1396,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
- FREE(glxCtx);
+ _mesa_free(glxCtx);
return NULL;
}
@@ -1617,6 +1617,7 @@ Fake_glXDestroyContext( Display *dpy, GLXContext ctx )
MakeCurrent_PrevReadBuffer = 0;
XMesaDestroyContext( glxCtx->xmesaContext );
XMesaGarbageCollect();
+ _mesa_free(glxCtx);
}
@@ -2277,7 +2278,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config,
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
- FREE(glxCtx);
+ _mesa_free(glxCtx);
return NULL;
}
@@ -2500,7 +2501,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int re
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
- FREE(glxCtx);
+ _mesa_free(glxCtx);
return NULL;
}
diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c
index 4f3dca8f484..7945f1c5b06 100644
--- a/src/mesa/drivers/x11/glxapi.c
+++ b/src/mesa/drivers/x11/glxapi.c
@@ -124,9 +124,30 @@ get_dispatch(Display *dpy)
-/* Set by glXMakeCurrent() and glXMakeContextCurrent() only */
+/**
+ * GLX API current context.
+ */
+#if defined(GLX_USE_TLS)
+PUBLIC __thread void * CurrentContext
+ __attribute__((tls_model("initial-exec")));
+#elif defined(THREADS)
+static _glthread_TSD ContextTSD; /**< Per-thread context pointer */
+#else
static GLXContext CurrentContext = 0;
-#define __glXGetCurrentContext() CurrentContext;
+#endif
+
+
+static void
+SetCurrentContext(GLXContext c)
+{
+#if defined(GLX_USE_TLS)
+ CurrentContext = context;
+#elif defined(THREADS)
+ _glthread_SetTSD(&ContextTSD, c);
+#else
+ CurrentContext = c;
+#endif
+}
/*
@@ -186,6 +207,8 @@ glXDestroyContext(Display *dpy, GLXContext ctx)
GET_DISPATCH(dpy, t);
if (!t)
return;
+ if (glXGetCurrentContext() == ctx)
+ SetCurrentContext(NULL);
(t->DestroyContext)(dpy, ctx);
}
@@ -215,7 +238,13 @@ glXGetConfig(Display *dpy, XVisualInfo *visinfo, int attrib, int *value)
GLXContext PUBLIC
glXGetCurrentContext(void)
{
+#if defined(GLX_USE_TLS)
return CurrentContext;
+#elif defined(THREADS)
+ return _glthread_GetTSD(&ContextTSD);
+#else
+ return CurrentContext;
+#endif
}
@@ -249,7 +278,7 @@ glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
}
b = (*t->MakeCurrent)(dpy, drawable, ctx);
if (b) {
- CurrentContext = ctx;
+ SetCurrentContext(ctx);
}
return b;
}
@@ -524,7 +553,7 @@ glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXConte
return False;
b = (t->MakeContextCurrent)(dpy, draw, read, ctx);
if (b) {
- CurrentContext = ctx;
+ SetCurrentContext(ctx);
}
return b;
}
diff --git a/src/mesa/drivers/x11/sources b/src/mesa/drivers/x11/sources
new file mode 100644
index 00000000000..d76d65eaad1
--- /dev/null
+++ b/src/mesa/drivers/x11/sources
@@ -0,0 +1,8 @@
+# Note: only listing sources needed for X server renderer
+MESA_DRIVER_X11_SOURCES = \
+xm_api.c \
+xm_buffer.c \
+xm_dd.c \
+xm_line.c \
+xm_span.c \
+xm_tri.c
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index dea23fcf59b..b50c4757afc 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -22,8 +22,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/*
- * This file contains the implementations of all the XMesa* functions.
+/**
+ * \file xm_api.c
+ *
+ * All the XMesa* API functions.
*
*
* NOTES:
@@ -68,13 +70,8 @@
#include "framebuffer.h"
#include "glthread.h"
#include "imports.h"
-#include "matrix.h"
-#include "mtypes.h"
#include "macros.h"
#include "renderbuffer.h"
-#include "texformat.h"
-#include "texobj.h"
-#include "texstore.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "array_cache/acache.h"
@@ -87,14 +84,14 @@
#include <GL/glxtokens.h>
#endif
-/*
+/**
* Global X driver lock
*/
_glthread_Mutex _xmesa_lock;
-/*
+/**
* Lookup tables for HPCR pixel format:
*/
static short hpcr_rgbTbl[3][256] = {
@@ -161,7 +158,7 @@ static short hpcr_rgbTbl[3][256] = {
/**********************************************************************/
-/*
+/**
* Return the host's byte order as LSBFirst or MSBFirst ala X.
*/
#ifndef XFree86Server
@@ -174,23 +171,7 @@ static int host_byte_order( void )
#endif
-/*
- * Error handling.
- */
-#ifndef XFree86Server
-static volatile int mesaXErrorFlag = 0;
-
-static int mesaHandleXError( XMesaDisplay *dpy, XErrorEvent *event )
-{
- (void) dpy;
- (void) event;
- mesaXErrorFlag = 1;
- return 0;
-}
-#endif
-
-
-/*
+/**
* Check if the X Shared Memory extension is available.
* Return: 0 = not available
* 1 = shared XImage support available
@@ -222,11 +203,12 @@ static int check_for_xshm( XMesaDisplay *display )
}
-/*
+/**
* Apply gamma correction to an intensity value in [0..max]. Return the
* new intensity value.
*/
-static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max )
+static GLint
+gamma_adjust( GLfloat gamma, GLint value, GLint max )
{
if (gamma == 1.0) {
return value;
@@ -239,7 +221,7 @@ static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max )
-/*
+/**
* Return the true number of bits per pixel for XImages.
* For example, if we request a 24-bit deep visual we may actually need/get
* 32bpp XImages. This function returns the appropriate bpp.
@@ -247,10 +229,10 @@ static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max )
* visinfo - desribes the visual to be used for XImages
* Return: true number of bits per pixel for XImages
*/
-#ifdef XFree86Server
-
-static int bits_per_pixel( XMesaVisual xmv )
+static int
+bits_per_pixel( XMesaVisual xmv )
{
+#ifdef XFree86Server
const int depth = xmv->nplanes;
int i;
assert(depth > 0);
@@ -259,12 +241,7 @@ static int bits_per_pixel( XMesaVisual xmv )
return screenInfo.formats[i].bitsPerPixel;
}
return depth; /* should never get here, but this should be safe */
-}
-
#else
-
-static int bits_per_pixel( XMesaVisual xmv )
-{
XMesaDisplay *dpy = xmv->display;
XMesaVisualInfo visinfo = xmv->visinfo;
XMesaImage *img;
@@ -285,8 +262,8 @@ static int bits_per_pixel( XMesaVisual xmv )
img->data = NULL;
XMesaDestroyImage( img );
return bitsPerPixel;
-}
#endif
+}
@@ -325,6 +302,45 @@ static GLboolean window_exists( XMesaDisplay *dpy, Window win )
+/**
+ * Return the size of the window (or pixmap) that corresponds to the
+ * given XMesaBuffer.
+ * \param width returns width in pixels
+ * \param height returns height in pixels
+ */
+void
+xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b,
+ GLuint *width, GLuint *height)
+{
+#ifdef XFree86Server
+ *width = MIN2(b->frontxrb->drawable->width, MAX_WIDTH);
+ *height = MIN2(b->frontxrb->drawable->height, MAX_HEIGHT);
+#else
+ Window root;
+ Status stat;
+ int xpos, ypos;
+ unsigned int w, h, bw, depth;
+
+ _glthread_LOCK_MUTEX(_xmesa_lock);
+ XSync(b->xm_visual->display, 0); /* added for Chromium */
+ stat = XGetGeometry(dpy, b->frontxrb->pixmap, &root, &xpos, &ypos,
+ &w, &h, &bw, &depth);
+ _glthread_UNLOCK_MUTEX(_xmesa_lock);
+
+ if (stat) {
+ *width = w;
+ *height = h;
+ }
+ else {
+ /* probably querying a window that's recently been destroyed */
+ _mesa_warning(NULL, "XGetGeometry failed!\n");
+ *width = *height = 1;
+ }
+#endif
+}
+
+
+
/**********************************************************************/
/***** Linked list of XMesaBuffers *****/
/**********************************************************************/
@@ -333,80 +349,110 @@ static XMesaBuffer XMesaBufferList = NULL;
/**
- * Allocate a new XMesaBuffer, initialize basic fields and add to
- * the list of all buffers.
+ * Allocate a new XMesaBuffer object which corresponds to the given drawable.
+ * Note that XMesaBuffer is derived from GLframebuffer.
+ * The new XMesaBuffer will not have any size (Width=Height=0).
+ *
+ * \param d the corresponding X drawable (window or pixmap)
+ * \param type either WINDOW, PIXMAP or PBUFFER, describing d
+ * \param vis the buffer's visual
+ * \param cmap the window's colormap, if known.
+ * \return new XMesaBuffer or NULL if any problem
*/
static XMesaBuffer
-alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap)
+create_xmesa_buffer(XMesaDrawable d, BufferType type,
+ XMesaVisual vis, XMesaColormap cmap)
{
- XMesaBuffer b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer);
- if (b) {
- GLboolean swAlpha;
+ GLboolean swAlpha;
+ XMesaBuffer b;
+
+ ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER);
- b->display = vis->display;
- b->xm_visual = vis;
- b->type = type;
- b->cmap = cmap;
+ b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer);
+ if (!b)
+ return NULL;
- _mesa_initialize_framebuffer(&b->mesa_buffer, &vis->mesa_visual);
+ b->display = vis->display;
+ b->xm_visual = vis;
+ b->type = type;
+ b->cmap = cmap;
- /* Allocate the framebuffer's renderbuffers */
- assert(!b->mesa_buffer.Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
- assert(!b->mesa_buffer.Attachment[BUFFER_BACK_LEFT].Renderbuffer);
+ _mesa_initialize_framebuffer(&b->mesa_buffer, &vis->mesa_visual);
- /* front renderbuffer */
- b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual,
+ /*
+ * Front renderbuffer
+ */
+ b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual,
GL_FALSE);
- _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT,
- &b->frontxrb->Base);
-
- /* back renderbuffer */
- if (vis->mesa_visual.doubleBufferMode) {
- b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual,
- GL_TRUE);
- /* determine back buffer implementation */
- b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP;
-
- _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT,
- &b->backxrb->Base);
- }
+ if (!b->frontxrb) {
+ _mesa_free(b);
+ return NULL;
+ }
+ b->frontxrb->Parent = b;
+ b->frontxrb->drawable = d;
+ b->frontxrb->pixmap = (XMesaPixmap) d;
+ _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT,
+ &b->frontxrb->Base);
- /* determine if we need software alpha planes */
- if (vis->mesa_visual.alphaBits > 0
- && vis->undithered_pf != PF_8A8B8G8R
- && vis->undithered_pf != PF_8A8R8G8B) {
- /* Visual has alpha, but pixel format doesn't support it.
- * We'll use an alpha renderbuffer wrapper.
- */
- swAlpha = GL_TRUE;
- }
- else {
- swAlpha = GL_FALSE;
+ /*
+ * Back renderbuffer
+ */
+ if (vis->mesa_visual.doubleBufferMode) {
+ b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual,
+ GL_TRUE);
+ if (!b->backxrb) {
+ /* XXX free front xrb too */
+ _mesa_free(b);
+ return NULL;
}
+ b->backxrb->Parent = b;
+ /* determine back buffer implementation */
+ b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP;
+
+ _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT,
+ &b->backxrb->Base);
+ }
- _mesa_add_soft_renderbuffers(&b->mesa_buffer,
- GL_FALSE, /* color */
- vis->mesa_visual.haveDepthBuffer,
- vis->mesa_visual.haveStencilBuffer,
- vis->mesa_visual.haveAccumBuffer,
- swAlpha,
- vis->mesa_visual.numAuxBuffers > 0 );
-
- /* insert into linked list */
- b->Next = XMesaBufferList;
- XMesaBufferList = b;
+ /*
+ * Software alpha planes
+ */
+ if (vis->mesa_visual.alphaBits > 0
+ && vis->undithered_pf != PF_8A8B8G8R
+ && vis->undithered_pf != PF_8A8R8G8B) {
+ /* Visual has alpha, but pixel format doesn't support it.
+ * We'll use an alpha renderbuffer wrapper.
+ */
+ swAlpha = GL_TRUE;
+ }
+ else {
+ swAlpha = GL_FALSE;
}
+
+ /*
+ * Other renderbuffer (depth, stencil, etc)
+ */
+ _mesa_add_soft_renderbuffers(&b->mesa_buffer,
+ GL_FALSE, /* color */
+ vis->mesa_visual.haveDepthBuffer,
+ vis->mesa_visual.haveStencilBuffer,
+ vis->mesa_visual.haveAccumBuffer,
+ swAlpha,
+ vis->mesa_visual.numAuxBuffers > 0 );
+
+ /* insert buffer into linked list */
+ b->Next = XMesaBufferList;
+ XMesaBufferList = b;
+
return b;
}
-/*
+/**
* Find an XMesaBuffer by matching X display and colormap but NOT matching
* the notThis buffer.
*/
-static XMesaBuffer find_xmesa_buffer(XMesaDisplay *dpy,
- XMesaColormap cmap,
- XMesaBuffer notThis)
+static XMesaBuffer
+find_xmesa_buffer(XMesaDisplay *dpy, XMesaColormap cmap, XMesaBuffer notThis)
{
XMesaBuffer b;
for (b=XMesaBufferList; b; b=b->Next) {
@@ -418,11 +464,12 @@ static XMesaBuffer find_xmesa_buffer(XMesaDisplay *dpy,
}
-/*
+/**
* Free an XMesaBuffer, remove from linked list, perhaps free X colormap
* entries.
*/
-static void free_xmesa_buffer(int client, XMesaBuffer buffer)
+static void
+free_xmesa_buffer(int client, XMesaBuffer buffer)
{
XMesaBuffer prev = NULL, b;
(void) client;
@@ -461,8 +508,11 @@ static void free_xmesa_buffer(int client, XMesaBuffer buffer)
}
-/* Copy X color table stuff from one XMesaBuffer to another. */
-static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src)
+/**
+ * Copy X color table stuff from one XMesaBuffer to another.
+ */
+static void
+copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src)
{
MEMCPY(dst->color_table, src->color_table, sizeof(src->color_table));
MEMCPY(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r));
@@ -481,198 +531,6 @@ static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src)
/**
- * Allocate a shared memory XImage back buffer for the given XMesaBuffer.
- * Return: GL_TRUE if success, GL_FALSE if error
- */
-#ifndef XFree86Server
-static GLboolean
-alloc_shm_back_buffer(XMesaBuffer b, GLuint width, GLuint height)
-{
-#ifdef USE_XSHM
- /*
- * We have to do a _lot_ of error checking here to be sure we can
- * really use the XSHM extension. It seems different servers trigger
- * errors at different points if the extension won't work. Therefore
- * we have to be very careful...
- */
- GC gc;
- int (*old_handler)( XMesaDisplay *, XErrorEvent * );
-
- if (width == 0 || height == 0) {
- /* this will be true the first time we're called on 'b' */
- return GL_FALSE;
- }
-
- b->backxrb->ximage = XShmCreateImage(b->xm_visual->display,
- b->xm_visual->visinfo->visual,
- b->xm_visual->visinfo->depth,
- ZPixmap, NULL, &b->shminfo,
- width, height);
- if (b->backxrb->ximage == NULL) {
- _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (XShmCreateImage), disabling.\n");
- b->shm = 0;
- return GL_FALSE;
- }
-
- b->shminfo.shmid = shmget( IPC_PRIVATE, b->backxrb->ximage->bytes_per_line
- * b->backxrb->ximage->height, IPC_CREAT|0777 );
- if (b->shminfo.shmid < 0) {
- _mesa_warning(NULL, "shmget failed while allocating back buffer.\n");
- XDestroyImage( b->backxrb->ximage );
- b->backxrb->ximage = NULL;
- _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmget), disabling.\n");
- b->shm = 0;
- return GL_FALSE;
- }
-
- b->shminfo.shmaddr = b->backxrb->ximage->data
- = (char*)shmat( b->shminfo.shmid, 0, 0 );
- if (b->shminfo.shmaddr == (char *) -1) {
- _mesa_warning(NULL, "shmat() failed while allocating back buffer.\n");
- XDestroyImage( b->backxrb->ximage );
- shmctl( b->shminfo.shmid, IPC_RMID, 0 );
- b->backxrb->ximage = NULL;
- _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmat), disabling.\n");
- b->shm = 0;
- return GL_FALSE;
- }
-
- b->shminfo.readOnly = False;
- mesaXErrorFlag = 0;
- old_handler = XSetErrorHandler( mesaHandleXError );
- /* This may trigger the X protocol error we're ready to catch: */
- XShmAttach( b->xm_visual->display, &b->shminfo );
- XSync( b->xm_visual->display, False );
-
- if (mesaXErrorFlag) {
- /* we are on a remote display, this error is normal, don't print it */
- XFlush( b->xm_visual->display );
- mesaXErrorFlag = 0;
- XDestroyImage( b->backxrb->ximage );
- shmdt( b->shminfo.shmaddr );
- shmctl( b->shminfo.shmid, IPC_RMID, 0 );
- b->backxrb->ximage = NULL;
- b->shm = 0;
- (void) XSetErrorHandler( old_handler );
- return GL_FALSE;
- }
-
- shmctl( b->shminfo.shmid, IPC_RMID, 0 ); /* nobody else needs it */
-
- /* Finally, try an XShmPutImage to be really sure the extension works */
- gc = XCreateGC( b->xm_visual->display, b->frontxrb->drawable, 0, NULL );
- XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, gc,
- b->backxrb->ximage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False );
- XSync( b->xm_visual->display, False );
- XFreeGC( b->xm_visual->display, gc );
- (void) XSetErrorHandler( old_handler );
- if (mesaXErrorFlag) {
- XFlush( b->xm_visual->display );
- mesaXErrorFlag = 0;
- XDestroyImage( b->backxrb->ximage );
- shmdt( b->shminfo.shmaddr );
- shmctl( b->shminfo.shmid, IPC_RMID, 0 );
- b->backxrb->ximage = NULL;
- b->shm = 0;
- return GL_FALSE;
- }
-
- return GL_TRUE;
-#else
- /* Can't compile XSHM support */
- return GL_FALSE;
-#endif
-}
-#endif
-
-
-
-
-/*
- * Setup an off-screen pixmap or Ximage to use as the back buffer.
- * Input: b - the X/Mesa buffer
- */
-void
-xmesa_alloc_back_buffer( XMesaBuffer b, GLuint width, GLuint height )
-{
- if (width == 0 || height == 0)
- return;
-
- if (b->db_mode == BACK_XIMAGE) {
- /* Deallocate the old backxrb->ximage, if any */
- if (b->backxrb->ximage) {
-#if defined(USE_XSHM) && !defined(XFree86Server)
- if (b->shm) {
- XShmDetach( b->xm_visual->display, &b->shminfo );
- XDestroyImage( b->backxrb->ximage );
- shmdt( b->shminfo.shmaddr );
- }
- else
-#endif
- XMesaDestroyImage( b->backxrb->ximage );
- b->backxrb->ximage = NULL;
- }
-
- /* Allocate new back buffer */
-#ifdef XFree86Server
- /* Allocate a regular XImage for the back buffer. */
- b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel,
- width, height, NULL);
- {
-#else
- if (b->shm == 0 || !alloc_shm_back_buffer(b, width, height)) {
- /* Allocate a regular XImage for the back buffer. */
- b->backxrb->ximage = XCreateImage( b->xm_visual->display,
- b->xm_visual->visinfo->visual,
- GET_VISUAL_DEPTH(b->xm_visual),
- ZPixmap, 0, /* format, offset */
- NULL,
- width, height,
- 8, 0 ); /* pad, bytes_per_line */
-#endif
- if (!b->backxrb->ximage) {
- _mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed.\n");
- return;
- }
- b->backxrb->ximage->data = (char *) MALLOC( b->backxrb->ximage->height
- * b->backxrb->ximage->bytes_per_line );
- if (!b->backxrb->ximage->data) {
- _mesa_warning(NULL, "alloc_back_buffer: MALLOC failed.\n");
- XMesaDestroyImage( b->backxrb->ximage );
- b->backxrb->ximage = NULL;
- }
- else {
- /* this call just updates the width/origin fields in the xrb */
- b->backxrb->Base.AllocStorage(NULL, &b->backxrb->Base,
- b->backxrb->Base.InternalFormat,
- b->backxrb->ximage->width,
- b->backxrb->ximage->height);
- }
- }
- b->backxrb->pixmap = None;
- }
- else if (b->db_mode == BACK_PIXMAP) {
- if (!width)
- width = 1;
- if (!height)
- height = 1;
-
- /* Free the old back pixmap */
- if (b->backxrb->pixmap) {
- XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap );
- }
- /* Allocate new back pixmap */
- b->backxrb->pixmap = XMesaCreatePixmap( b->xm_visual->display,
- b->frontxrb->drawable,
- width, height,
- GET_VISUAL_DEPTH(b->xm_visual) );
- b->backxrb->ximage = NULL;
- }
-}
-
-
-
-/*
* A replacement for XAllocColor. This function should never
* fail to allocate a color. When XAllocColor fails, we return
* the nearest matching color. If we have to allocate many colors
@@ -715,10 +573,11 @@ noFaultXAllocColor( int client,
if (AllocColor(cmap,
&color->red, &color->green, &color->blue,
&color->pixel,
- client) == Success) {
+ client) == Success)
#else
- if (XAllocColor(dpy, cmap, color)) {
+ if (XAllocColor(dpy, cmap, color))
#endif
+ {
*exact = 1;
*alloced = 1;
return;
@@ -808,13 +667,13 @@ noFaultXAllocColor( int client,
-
-/*
+/**
* Do setup for PF_GRAYSCALE pixel format.
* Note that buffer may be NULL.
*/
-static GLboolean setup_grayscale( int client, XMesaVisual v,
- XMesaBuffer buffer, XMesaColormap cmap )
+static GLboolean
+setup_grayscale(int client, XMesaVisual v,
+ XMesaBuffer buffer, XMesaColormap cmap)
{
if (GET_VISUAL_DEPTH(v)<4 || GET_VISUAL_DEPTH(v)>16) {
return GL_FALSE;
@@ -893,7 +752,7 @@ static GLboolean setup_grayscale( int client, XMesaVisual v,
-/*
+/**
* Setup RGB rendering for a window with a PseudoColor, StaticColor,
* or 8-bit TrueColor visual visual. We try to allocate a palette of 225
* colors (5 red, 9 green, 5 blue) and dither to approximate a 24-bit RGB
@@ -901,8 +760,9 @@ static GLboolean setup_grayscale( int client, XMesaVisual v,
* visuals, it has also proven to work from 4-bit up to 16-bit visuals.
* Dithering code contributed by Bob Mercier.
*/
-static GLboolean setup_dithered_color( int client, XMesaVisual v,
- XMesaBuffer buffer, XMesaColormap cmap )
+static GLboolean
+setup_dithered_color(int client, XMesaVisual v,
+ XMesaBuffer buffer, XMesaColormap cmap)
{
if (GET_VISUAL_DEPTH(v)<4 || GET_VISUAL_DEPTH(v)>16) {
return GL_FALSE;
@@ -972,12 +832,13 @@ static GLboolean setup_dithered_color( int client, XMesaVisual v,
}
-/*
+/**
* Setup for Hewlett Packard Color Recovery 8-bit TrueColor mode.
* HPCR simulates 24-bit color fidelity with an 8-bit frame buffer.
* Special dithering tables have to be initialized.
*/
-static void setup_8bit_hpcr( XMesaVisual v )
+static void
+setup_8bit_hpcr(XMesaVisual v)
{
/* HP Color Recovery contributed by: Alex De Bruyn (ad@lms.be)
* To work properly, the atom _HP_RGB_SMOOTH_MAP_LIST must be defined
@@ -1027,11 +888,11 @@ static void setup_8bit_hpcr( XMesaVisual v )
}
-/*
+/**
* Setup RGB rendering for a window with a True/DirectColor visual.
*/
-static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer,
- XMesaColormap cmap )
+static void
+setup_truecolor(XMesaVisual v, XMesaBuffer buffer, XMesaColormap cmap)
{
unsigned long rmask, gmask, bmask;
(void) buffer;
@@ -1171,10 +1032,11 @@ static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer,
-/*
+/**
* Setup RGB rendering for a window with a monochrome visual.
*/
-static void setup_monochrome( XMesaVisual v, XMesaBuffer b )
+static void
+setup_monochrome( XMesaVisual v, XMesaBuffer b )
{
(void) b;
v->dithered_pf = v->undithered_pf = PF_1Bit;
@@ -1184,46 +1046,28 @@ static void setup_monochrome( XMesaVisual v, XMesaBuffer b )
-/*
- * When a context is "made current" for the first time, we can finally
- * finish initializing the context's visual and buffer information.
- * Input: v - the XMesaVisual to initialize
- * b - the XMesaBuffer to initialize (may be NULL)
- * rgb_flag - TRUE = RGBA mode, FALSE = color index mode
- * window - the window/pixmap we're rendering into
- * cmap - the colormap associated with the window/pixmap
- * Return: GL_TRUE=success, GL_FALSE=failure
+/**
+ * When a context is bound for the first time, we can finally finish
+ * initializing the context's visual and buffer information.
+ * \param v the XMesaVisual to initialize
+ * \param b the XMesaBuffer to initialize (may be NULL)
+ * \param rgb_flag TRUE = RGBA mode, FALSE = color index mode
+ * \param window the window/pixmap we're rendering into
+ * \param cmap the colormap associated with the window/pixmap
+ * \return GL_TRUE=success, GL_FALSE=failure
*/
-static GLboolean initialize_visual_and_buffer( int client,
- XMesaVisual v,
- XMesaBuffer b,
- GLboolean rgb_flag,
- XMesaDrawable window,
- XMesaColormap cmap )
+static GLboolean
+initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b,
+ GLboolean rgb_flag, XMesaDrawable window,
+ XMesaColormap cmap)
{
- struct xmesa_renderbuffer *front_xrb, *back_xrb;
-#ifndef XFree86Server
- XGCValues gcvalues;
-#endif
-
- if (b) {
- assert(b->xm_visual == v);
- }
-
- if (b) {
- front_xrb = b->frontxrb;
- back_xrb = b->backxrb;
- }
- else {
- front_xrb = back_xrb = NULL;
- }
+ ASSERT(!b || b->xm_visual == v);
/* Save true bits/pixel */
v->BitsPerPixel = bits_per_pixel(v);
assert(v->BitsPerPixel > 0);
-
- if (rgb_flag==GL_FALSE) {
+ if (rgb_flag == GL_FALSE) {
/* COLOR-INDEXED WINDOW:
* Even if the visual is TrueColor or DirectColor we treat it as
* being color indexed. This is weird but might be useful to someone.
@@ -1236,18 +1080,18 @@ static GLboolean initialize_visual_and_buffer( int client,
* We support RGB rendering into almost any kind of visual.
*/
const int xclass = v->mesa_visual.visualType;
- if (xclass==GLX_TRUE_COLOR || xclass==GLX_DIRECT_COLOR) {
+ if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) {
setup_truecolor( v, b, cmap );
}
- else if (xclass==GLX_STATIC_GRAY && GET_VISUAL_DEPTH(v)==1) {
+ else if (xclass == GLX_STATIC_GRAY && GET_VISUAL_DEPTH(v) == 1) {
setup_monochrome( v, b );
}
- else if (xclass==GLX_GRAY_SCALE || xclass==GLX_STATIC_GRAY) {
+ else if (xclass == GLX_GRAY_SCALE || xclass == GLX_STATIC_GRAY) {
if (!setup_grayscale( client, v, b, cmap )) {
return GL_FALSE;
}
}
- else if ((xclass==GLX_PSEUDO_COLOR || xclass==GLX_STATIC_COLOR)
+ else if ((xclass == GLX_PSEUDO_COLOR || xclass == GLX_STATIC_COLOR)
&& GET_VISUAL_DEPTH(v)>=4 && GET_VISUAL_DEPTH(v)<=16) {
if (!setup_dithered_color( client, v, b, cmap )) {
return GL_FALSE;
@@ -1282,14 +1126,14 @@ static GLboolean initialize_visual_and_buffer( int client,
if (b && window) {
/* Do window-specific initializations */
- b->frontxrb->drawable = window;
- b->frontxrb->pixmap = (XMesaPixmap) window;
+ /* these should have been set in create_xmesa_buffer */
+ ASSERT(b->frontxrb->drawable == window);
+ ASSERT(b->frontxrb->pixmap == (XMesaPixmap) window);
/* Setup for single/double buffering */
if (v->mesa_visual.doubleBufferMode) {
/* Double buffered */
b->shm = check_for_xshm( v->display );
- xmesa_alloc_back_buffer(b, b->mesa_buffer.Width, b->mesa_buffer.Height);
}
/* X11 graphics contexts */
@@ -1320,9 +1164,12 @@ static GLboolean initialize_visual_and_buffer( int client,
dixChangeGC(NullClient, b->swapgc, GCGraphicsExposures, v, NULL);
}
#else
- gcvalues.graphics_exposures = False;
- b->swapgc = XCreateGC( v->display, window,
- GCGraphicsExposures, &gcvalues);
+ {
+ XGCValues gcvalues;
+ gcvalues.graphics_exposures = False;
+ b->swapgc = XCreateGC(v->display, window,
+ GCGraphicsExposures, &gcvalues);
+ }
#endif
XMesaSetFunction( v->display, b->swapgc, GXcopy );
/*
@@ -1331,17 +1178,16 @@ static GLboolean initialize_visual_and_buffer( int client,
* Initialize whole stuff
* Patch contributed by Jacques Leroy March 8, 1998.
*/
- if (v->hpcr_clear_flag && back_xrb->pixmap) {
- int i;
- for (i=0; i<16; i++)
- {
- XMesaPutPixel(v->hpcr_clear_ximage, i, 0, 0);
- XMesaPutPixel(v->hpcr_clear_ximage, i, 1, 0);
- }
- XMesaPutImage(b->display, (XMesaDrawable) v->hpcr_clear_pixmap,
- b->cleargc, v->hpcr_clear_ximage, 0, 0, 0, 0, 16, 2);
- XMesaSetFillStyle( v->display, b->cleargc, FillTiled);
- XMesaSetTile( v->display, b->cleargc, v->hpcr_clear_pixmap );
+ if (v->hpcr_clear_flag && b->backxrb && b->backxrb->pixmap) {
+ int i;
+ for (i = 0; i < 16; i++) {
+ XMesaPutPixel(v->hpcr_clear_ximage, i, 0, 0);
+ XMesaPutPixel(v->hpcr_clear_ximage, i, 1, 0);
+ }
+ XMesaPutImage(b->display, (XMesaDrawable) v->hpcr_clear_pixmap,
+ b->cleargc, v->hpcr_clear_ximage, 0, 0, 0, 0, 16, 2);
+ XMesaSetFillStyle( v->display, b->cleargc, FillTiled);
+ XMesaSetTile( v->display, b->cleargc, v->hpcr_clear_pixmap );
}
/* Initialize the row buffer XImage for use in write_color_span() */
@@ -1504,18 +1350,16 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
XMesaVisual v;
GLint red_bits, green_bits, blue_bits, alpha_bits;
+#ifndef XFree86Server
/* For debugging only */
if (_mesa_getenv("MESA_XSYNC")) {
/* This makes debugging X easier.
* In your debugger, set a breakpoint on _XError to stop when an
* X protocol error is generated.
*/
-#ifdef XFree86Server
- /* NOT_NEEDED */
-#else
XSynchronize( display, 1 );
-#endif
}
+#endif
v = (XMesaVisual) CALLOC_STRUCT(xmesa_visual);
if (!v) {
@@ -1592,7 +1436,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
{
const int xclass = v->mesa_visual.visualType;
- if (xclass==GLX_TRUE_COLOR || xclass==GLX_DIRECT_COLOR) {
+ if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) {
red_bits = _mesa_bitcount(GET_REDMASK(v));
green_bits = _mesa_bitcount(GET_GREENMASK(v));
blue_bits = _mesa_bitcount(GET_BLUEMASK(v));
@@ -1750,13 +1594,13 @@ void XMesaDestroyContext( XMesaContext c )
-/*
- * XXX this isn't a public function! It's a hack for the 3Dfx driver.
- * Create a new XMesaBuffer from an X window.
- * Input: v - the XMesaVisual
- * w - the window
- * c - the context
- * Return: new XMesaBuffer or NULL if error
+/**
+ * Private function for creating an XMesaBuffer which corresponds to an
+ * X window or pixmap.
+ * \param v the window's XMesaVisual
+ * \param w the window we're wrapping
+ * \param c context used to initialize the buffer if 3Dfx mode in use.
+ * \return new XMesaBuffer or NULL if error
*/
XMesaBuffer
XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c)
@@ -1772,6 +1616,7 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c)
XMesaColormap cmap;
assert(v);
+ assert(w);
(void) c;
/* Check that window depth matches visual depth */
@@ -1808,10 +1653,9 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c)
}
#endif
- b = alloc_xmesa_buffer(v, WINDOW, cmap);
- if (!b) {
+ b = create_xmesa_buffer((XMesaDrawable) w, WINDOW, v, cmap);
+ if (!b)
return NULL;
- }
if (!initialize_visual_and_buffer( client, v, b, v->mesa_visual.rgbMode,
(XMesaDrawable) w, cmap )) {
@@ -1926,10 +1770,9 @@ XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap)
assert(v);
- b = alloc_xmesa_buffer(v, PIXMAP, cmap);
- if (!b) {
+ b = create_xmesa_buffer((XMesaDrawable) p, PIXMAP, v, cmap);
+ if (!b)
return NULL;
- }
#ifdef XFree86Server
client = CLIENT_ID(((XMesaDrawable)p)->id);
@@ -1958,14 +1801,16 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
XMesaDrawable drawable; /* X Pixmap Drawable */
XMesaBuffer b;
- b = alloc_xmesa_buffer(v, PBUFFER, cmap);
- if (!b) {
- return NULL;
- }
-
/* allocate pixmap for front buffer */
root = RootWindow( v->display, v->visinfo->screen );
- drawable = XCreatePixmap( v->display, root, width, height, v->visinfo->depth );
+ drawable = XCreatePixmap(v->display, root, width, height,
+ v->visinfo->depth);
+ if (!drawable)
+ return NULL;
+
+ b = create_xmesa_buffer(drawable, PBUFFER, v, cmap);
+ if (!b)
+ return NULL;
if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode,
drawable, cmap)) {
@@ -2027,6 +1872,27 @@ void XMesaDestroyBuffer( XMesaBuffer b )
}
+/**
+ * Query the current window size and update the corresponding GLframebuffer
+ * and all attached renderbuffers.
+ * Called when:
+ * 1. the first time a buffer is bound to a context.
+ * 2. from glViewport to poll for window size changes
+ * 3. from the XMesaResizeBuffers() API function.
+ */
+void
+xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer)
+{
+ GLuint width, height;
+ xmesa_get_window_size(xmctx->display, drawBuffer, &width, &height);
+ if (drawBuffer->mesa_buffer.Width != width ||
+ drawBuffer->mesa_buffer.Height != height) {
+ _mesa_resize_framebuffer(&(xmctx->mesa),
+ &(drawBuffer->mesa_buffer), width, height);
+ }
+ drawBuffer->mesa_buffer.Initialized = GL_TRUE; /* XXX TEMPORARY? */
+}
+
/*
* Bind buffer b to context c and make c the current rendering context.
@@ -2059,7 +1925,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
if (&(c->mesa) == _mesa_get_current_context()
&& c->mesa.DrawBuffer == &drawBuffer->mesa_buffer
&& c->mesa.ReadBuffer == &readBuffer->mesa_buffer
- && ((XMesaBuffer) c->mesa.DrawBuffer)->wasCurrent) {
+ && XMESA_BUFFER(c->mesa.DrawBuffer)->wasCurrent) {
/* same context and buffer, do nothing */
return GL_TRUE;
}
@@ -2071,6 +1937,10 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
*/
_glapi_check_multithread();
+ xmesa_check_and_update_buffer_size(c, drawBuffer);
+ if (readBuffer != drawBuffer)
+ xmesa_check_and_update_buffer_size(c, readBuffer);
+
_mesa_make_current(&(c->mesa),
&drawBuffer->mesa_buffer,
&readBuffer->mesa_buffer);
@@ -2141,7 +2011,7 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void )
{
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
- return (XMesaBuffer) (ctx->ReadBuffer);
+ return XMESA_BUFFER(ctx->ReadBuffer);
}
else {
return 0;
@@ -2230,9 +2100,7 @@ static void FXgetImage( XMesaBuffer b )
GET_CURRENT_CONTEXT(ctx);
static unsigned short pixbuf[MAX_WIDTH];
GLuint x, y;
- int xpos, ypos;
- XMesaWindow root;
- unsigned int bw, depth, width, height;
+ GLuint width, height;
XMesaContext xmesa = XMESA_CONTEXT(ctx);
#ifdef XFree86Server
@@ -2242,15 +2110,14 @@ static void FXgetImage( XMesaBuffer b )
height = b->frontxrb->pixmap->height;
depth = b->frontxrb->pixmap->depth;
#else
- XGetGeometry( b->xm_visual->display, b->frontxrb->pixmap,
- &root, &xpos, &ypos, &width, &height, &bw, &depth);
+ xmesa_get_window_size(b->display, b, &width, &height);
+ x = y = 0;
#endif
if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) {
b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width);
b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height);
if (b->mesa_buffer.Width & 1)
b->mesa_buffer.Width--; /* prevent odd width */
- xmesa_alloc_back_buffer(b, b->mesa_buffer.Width, b->mesa_buffer.Height);
}
/* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */
@@ -2664,24 +2531,11 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
* This is typically called when the window size changes and we need
* to reallocate the buffer's back/depth/stencil/accum buffers.
*/
-void XMesaResizeBuffers( XMesaBuffer b )
+void
+XMesaResizeBuffers( XMesaBuffer b )
{
-#ifdef XFree86Server
- GLuint winwidth, winheight;
GET_CURRENT_CONTEXT(ctx);
-
- winwidth = MIN2(b->frontxrb->drawable->width, MAX_WIDTH);
- winheight = MIN2(b->frontxrb->drawable->height, MAX_HEIGHT);
-
- xmesa_resize_buffers(ctx, &(b->mesa_buffer), winwidth, winheight);
-#else
- Window root;
- int xpos, ypos;
- unsigned int width, height, bw, depth;
- GET_CURRENT_CONTEXT(ctx);
- XGetGeometry( b->xm_visual->display, b->frontxrb->pixmap,
- &root, &xpos, &ypos, &width, &height, &bw, &depth);
- xmesa_resize_buffers(ctx, &(b->mesa_buffer), width, height);
-#endif
+ XMesaContext xmctx = XMESA_CONTEXT(ctx);
+ xmesa_check_and_update_buffer_size(xmctx, b);
}
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index 2a44e126f78..490c4796767 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -23,6 +23,12 @@
*/
+/**
+ * \file xm_buffer.h
+ * Framebuffer and renderbuffer-related functions.
+ */
+
+
#include "glxheader.h"
#include "GL/xmesa.h"
#include "xmesaP.h"
@@ -30,6 +36,206 @@
#include "renderbuffer.h"
+#ifndef XFree86Server
+static volatile int mesaXErrorFlag = 0;
+
+/**
+ * Catches potential Xlib errors.
+ */
+static int
+mesaHandleXError(XMesaDisplay *dpy, XErrorEvent *event)
+{
+ (void) dpy;
+ (void) event;
+ mesaXErrorFlag = 1;
+ return 0;
+}
+#endif
+
+
+/**
+ * Allocate a shared memory XImage back buffer for the given XMesaBuffer.
+ * Return: GL_TRUE if success, GL_FALSE if error
+ */
+#ifndef XFree86Server
+static GLboolean
+alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height)
+{
+#ifdef USE_XSHM
+ /*
+ * We have to do a _lot_ of error checking here to be sure we can
+ * really use the XSHM extension. It seems different servers trigger
+ * errors at different points if the extension won't work. Therefore
+ * we have to be very careful...
+ */
+ GC gc;
+ int (*old_handler)(XMesaDisplay *, XErrorEvent *);
+
+ if (width == 0 || height == 0) {
+ /* this will be true the first time we're called on 'b' */
+ return GL_FALSE;
+ }
+
+ b->backxrb->ximage = XShmCreateImage(b->xm_visual->display,
+ b->xm_visual->visinfo->visual,
+ b->xm_visual->visinfo->depth,
+ ZPixmap, NULL, &b->shminfo,
+ width, height);
+ if (b->backxrb->ximage == NULL) {
+ _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (XShmCreateImage), disabling.\n");
+ b->shm = 0;
+ return GL_FALSE;
+ }
+
+ b->shminfo.shmid = shmget(IPC_PRIVATE, b->backxrb->ximage->bytes_per_line
+ * b->backxrb->ximage->height, IPC_CREAT|0777);
+ if (b->shminfo.shmid < 0) {
+ _mesa_warning(NULL, "shmget failed while allocating back buffer.\n");
+ XDestroyImage(b->backxrb->ximage);
+ b->backxrb->ximage = NULL;
+ _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmget), disabling.\n");
+ b->shm = 0;
+ return GL_FALSE;
+ }
+
+ b->shminfo.shmaddr = b->backxrb->ximage->data
+ = (char*)shmat(b->shminfo.shmid, 0, 0);
+ if (b->shminfo.shmaddr == (char *) -1) {
+ _mesa_warning(NULL, "shmat() failed while allocating back buffer.\n");
+ XDestroyImage(b->backxrb->ximage);
+ shmctl(b->shminfo.shmid, IPC_RMID, 0);
+ b->backxrb->ximage = NULL;
+ _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmat), disabling.\n");
+ b->shm = 0;
+ return GL_FALSE;
+ }
+
+ b->shminfo.readOnly = False;
+ mesaXErrorFlag = 0;
+ old_handler = XSetErrorHandler(mesaHandleXError);
+ /* This may trigger the X protocol error we're ready to catch: */
+ XShmAttach(b->xm_visual->display, &b->shminfo);
+ XSync(b->xm_visual->display, False);
+
+ if (mesaXErrorFlag) {
+ /* we are on a remote display, this error is normal, don't print it */
+ XFlush(b->xm_visual->display);
+ mesaXErrorFlag = 0;
+ XDestroyImage(b->backxrb->ximage);
+ shmdt(b->shminfo.shmaddr);
+ shmctl(b->shminfo.shmid, IPC_RMID, 0);
+ b->backxrb->ximage = NULL;
+ b->shm = 0;
+ (void) XSetErrorHandler(old_handler);
+ return GL_FALSE;
+ }
+
+ shmctl(b->shminfo.shmid, IPC_RMID, 0); /* nobody else needs it */
+
+ /* Finally, try an XShmPutImage to be really sure the extension works */
+ gc = XCreateGC(b->xm_visual->display, b->frontxrb->drawable, 0, NULL);
+ XShmPutImage(b->xm_visual->display, b->frontxrb->drawable, gc,
+ b->backxrb->ximage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False);
+ XSync(b->xm_visual->display, False);
+ XFreeGC(b->xm_visual->display, gc);
+ (void) XSetErrorHandler(old_handler);
+ if (mesaXErrorFlag) {
+ XFlush(b->xm_visual->display);
+ mesaXErrorFlag = 0;
+ XDestroyImage(b->backxrb->ximage);
+ shmdt(b->shminfo.shmaddr);
+ shmctl(b->shminfo.shmid, IPC_RMID, 0);
+ b->backxrb->ximage = NULL;
+ b->shm = 0;
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+#else
+ /* Can't compile XSHM support */
+ return GL_FALSE;
+#endif
+}
+#endif
+
+
+
+/**
+ * Setup an off-screen pixmap or Ximage to use as the back buffer.
+ * Input: b - the X/Mesa buffer
+ */
+static void
+alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height)
+{
+ if (width == 0 || height == 0)
+ return;
+
+ if (b->db_mode == BACK_XIMAGE) {
+ /* Deallocate the old backxrb->ximage, if any */
+ if (b->backxrb->ximage) {
+#if defined(USE_XSHM) && !defined(XFree86Server)
+ if (b->shm) {
+ XShmDetach(b->xm_visual->display, &b->shminfo);
+ XDestroyImage(b->backxrb->ximage);
+ shmdt(b->shminfo.shmaddr);
+ }
+ else
+#endif
+ XMesaDestroyImage(b->backxrb->ximage);
+ b->backxrb->ximage = NULL;
+ }
+
+ /* Allocate new back buffer */
+#ifdef XFree86Server
+ /* Allocate a regular XImage for the back buffer. */
+ b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel,
+ width, height, NULL);
+ {
+#else
+ if (b->shm == 0 || !alloc_back_shm_ximage(b, width, height)) {
+ /* Allocate a regular XImage for the back buffer. */
+ b->backxrb->ximage = XCreateImage(b->xm_visual->display,
+ b->xm_visual->visinfo->visual,
+ GET_VISUAL_DEPTH(b->xm_visual),
+ ZPixmap, 0, /* format, offset */
+ NULL,
+ width, height,
+ 8, 0); /* pad, bytes_per_line */
+#endif
+ if (!b->backxrb->ximage) {
+ _mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed.\n");
+ return;
+ }
+ b->backxrb->ximage->data = (char *) MALLOC(b->backxrb->ximage->height
+ * b->backxrb->ximage->bytes_per_line);
+ if (!b->backxrb->ximage->data) {
+ _mesa_warning(NULL, "alloc_back_buffer: MALLOC failed.\n");
+ XMesaDestroyImage(b->backxrb->ximage);
+ b->backxrb->ximage = NULL;
+ }
+ }
+ b->backxrb->pixmap = None;
+ }
+ else if (b->db_mode == BACK_PIXMAP) {
+ if (!width)
+ width = 1;
+ if (!height)
+ height = 1;
+
+ /* Free the old back pixmap */
+ if (b->backxrb->pixmap) {
+ XMesaFreePixmap(b->xm_visual->display, b->backxrb->pixmap);
+ }
+ /* Allocate new back pixmap */
+ b->backxrb->pixmap = XMesaCreatePixmap(b->xm_visual->display,
+ b->frontxrb->drawable,
+ width, height,
+ GET_VISUAL_DEPTH(b->xm_visual));
+ b->backxrb->ximage = NULL;
+ }
+}
+
+
static void
xmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
{
@@ -68,7 +274,6 @@ xmesa_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
/**
* Reallocate renderbuffer storage for back color buffer.
- * XXX we should resize the back pixmap/ximage here.
*/
static GLboolean
xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
@@ -76,7 +281,12 @@ xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
{
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
+ /* reallocate the back buffer XImage or Pixmap */
+ assert(xrb->Parent);
+ alloc_back_buffer(xrb->Parent, width, height);
+
/* same as front buffer */
+ /* XXX why is this here? */
(void) xmesa_alloc_front_storage(ctx, rb, internalFormat, width, height);
/* plus... */
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 11d323082e6..d272630d18a 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -23,6 +23,11 @@
*/
+/**
+ * \file xm_dd.h
+ * General device driver functions for Xlib driver.
+ */
+
#include "glxheader.h"
#include "bufferobj.h"
#include "buffers.h"
@@ -89,50 +94,6 @@ const int xmesa_kernel1[16] = {
};
-/*
- * Return the size (width, height) of the X window for the given GLframebuffer.
- * Output: width - width of buffer in pixels.
- * height - height of buffer in pixels.
- */
-static void
-get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
-{
- /* We can do this cast because the first field in the XMesaBuffer
- * struct is a GLframebuffer struct. If this weren't true, we'd
- * need a pointer from the GLframebuffer to the XMesaBuffer.
- */
- const XMesaBuffer xmBuffer = (XMesaBuffer) buffer;
- unsigned int winwidth, winheight;
-#ifdef XFree86Server
- /* XFree86 GLX renderer */
- winwidth = MIN2(xmBuffer->frontxrb->drawable->width, MAX_WIDTH);
- winheight = MIN2(xmBuffer->frontxrb->drawable->height, MAX_HEIGHT);
-#else
- Window root;
- Status stat;
- int winx, winy;
- unsigned int bw, d;
-
- _glthread_LOCK_MUTEX(_xmesa_lock);
- XSync(xmBuffer->xm_visual->display, 0); /* added for Chromium */
-
- stat = XGetGeometry( xmBuffer->xm_visual->display, xmBuffer->frontxrb->pixmap,
- &root, &winx, &winy, &winwidth, &winheight, &bw, &d );
- _glthread_UNLOCK_MUTEX(_xmesa_lock);
-
- if (!stat) {
- /* probably querying a window that's recently been destroyed */
- _mesa_warning(NULL, "XGetGeometry failed!\n");
- *width = *height = 1;
- return;
- }
-#endif
-
- *width = winwidth;
- *height = winheight;
-}
-
-
static void
finish_or_flush( GLcontext *ctx )
{
@@ -250,7 +211,7 @@ color_mask(GLcontext *ctx,
* Clear the front or back color buffer, if it's implemented with a pixmap.
*/
static void
-clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLboolean all,
+clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
@@ -263,92 +224,41 @@ clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLboolean all,
assert(xrb->pixmap);
assert(xmbuf->cleargc);
- if (all) {
- XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc,
- 0, 0, xrb->Base.Width + 1, xrb->Base.Height + 1 );
- }
- else {
- XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc,
- x, xrb->Base.Height - y - height,
- width, height );
- }
+ XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc,
+ x, xrb->Base.Height - y - height,
+ width, height );
}
static void
clear_8bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
- GLboolean all, GLint x, GLint y, GLint width, GLint height )
+ GLint x, GLint y, GLint width, GLint height )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
-
- if (all) {
- const size_t n = xrb->ximage->bytes_per_line * xrb->Base.Height;
- MEMSET( xrb->ximage->data, xmesa->clearpixel, n );
- }
- else {
- GLint i;
- for (i=0;i<height;i++) {
- GLubyte *ptr = PIXEL_ADDR1(xrb, x, y + i);
- MEMSET( ptr, xmesa->clearpixel, width );
- }
+ GLint i;
+ for (i = 0; i < height; i++) {
+ GLubyte *ptr = PIXEL_ADDR1(xrb, x, y + i);
+ MEMSET( ptr, xmesa->clearpixel, width );
}
}
static void
clear_HPCR_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
- GLboolean all, GLint x, GLint y, GLint width, GLint height )
+ GLint x, GLint y, GLint width, GLint height )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
-
- if (all) {
- const GLuint c16 = xrb->ximage->bytes_per_line & ~0xf;
- GLuint i;
- GLubyte *ptr = (GLubyte *) xrb->ximage->data;
- for (i = 0; i < xrb->Base.Height; i++) {
- GLuint j;
- const GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
- if (i&1) {
- sptr += 16;
- }
- for (j=0; j<c16; j+=16) {
- ptr[0] = sptr[0];
- ptr[1] = sptr[1];
- ptr[2] = sptr[2];
- ptr[3] = sptr[3];
- ptr[4] = sptr[4];
- ptr[5] = sptr[5];
- ptr[6] = sptr[6];
- ptr[7] = sptr[7];
- ptr[8] = sptr[8];
- ptr[9] = sptr[9];
- ptr[10] = sptr[10];
- ptr[11] = sptr[11];
- ptr[12] = sptr[12];
- ptr[13] = sptr[13];
- ptr[14] = sptr[14];
- ptr[15] = sptr[15];
- ptr += 16;
- }
- for (; j < (GLuint) xrb->ximage->bytes_per_line; j++) {
- *ptr = sptr[j&15];
- ptr++;
- }
+ GLint i;
+ for (i = y; i < y + height; i++) {
+ GLubyte *ptr = PIXEL_ADDR1( xrb, x, i );
+ int j;
+ const GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
+ if (i & 1) {
+ sptr += 16;
}
- }
- else {
- GLint i;
- for (i=y; i<y+height; i++) {
- GLubyte *ptr = PIXEL_ADDR1( xrb, x, i );
- int j;
- const GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
- if (i&1) {
- sptr += 16;
- }
- for (j=x; j<x+width; j++) {
- *ptr = sptr[j&15];
- ptr++;
- }
+ for (j = x; j < x + width; j++) {
+ *ptr = sptr[j&15];
+ ptr++;
}
}
}
@@ -356,42 +266,20 @@ clear_HPCR_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
clear_16bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
+ GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
- register GLuint pixel = (GLuint) xmesa->clearpixel;
+ GLuint pixel = (GLuint) xmesa->clearpixel;
+ GLint i, j;
if (xmesa->swapbytes) {
pixel = ((pixel >> 8) & 0x00ff) | ((pixel << 8) & 0xff00);
}
- if (all) {
- GLuint *ptr4 = (GLuint *) xrb->ximage->data;
- if ((pixel & 0xff) == ((pixel >> 8) & 0xff)) {
- /* low and high bytes are equal so use memset() */
- const GLuint n = xrb->ximage->bytes_per_line * xrb->Base.Height;
- MEMSET( ptr4, pixel & 0xff, n );
- }
- else {
- const GLuint n = xrb->ximage->bytes_per_line * xrb->Base.Height / 4;
- GLuint i;
- pixel = pixel | (pixel<<16);
- for (i = 0; i < n; i++) {
- ptr4[i] = pixel;
- }
- ptr4 += n;
- /* might be one last GLushort to set */
- if ((xrb->ximage->bytes_per_line * xrb->Base.Height) & 0x2)
- *(GLushort *)ptr4 = pixel & 0xffff;
- }
- }
- else {
- GLint i, j;
- for (j=0;j<height;j++) {
- GLushort *ptr2 = PIXEL_ADDR2(xrb, x, y + j);
- for (i=0;i<width;i++) {
- *ptr2++ = pixel;
- }
+ for (j = 0; j < height; j++) {
+ GLushort *ptr2 = PIXEL_ADDR2(xrb, x, y + j);
+ for (i = 0; i < width; i++) {
+ ptr2[i] = pixel;
}
}
}
@@ -400,61 +288,31 @@ clear_16bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
/* Optimized code provided by Nozomi Ytow <noz@xfree86.org> */
static void
clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
+ GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const GLubyte r = xmesa->clearcolor[0];
const GLubyte g = xmesa->clearcolor[1];
const GLubyte b = xmesa->clearcolor[2];
- if (all) {
- if (r == g && g == b) {
- /* same value for all three components (gray) */
- const GLint w3 = xrb->Base.Width * 3;
- const GLint h = xrb->Base.Height;
- GLint i;
- for (i = 0; i < h; i++) {
- bgr_t *ptr3 = PIXEL_ADDR3(xrb, 0, i);
- MEMSET(ptr3, r, w3);
- }
- }
- else {
- /* the usual case */
- const GLint w = xrb->Base.Width;
- const GLint h = xrb->Base.Height;
- GLint i, j;
- for (i = 0; i < h; i++) {
- bgr_t *ptr3 = PIXEL_ADDR3(xrb, 0, i);
- for (j = 0; j < w; j++) {
- ptr3->r = r;
- ptr3->g = g;
- ptr3->b = b;
- ptr3++;
- }
- }
+ if (r == g && g == b) {
+ /* same value for all three components (gray) */
+ GLint j;
+ for (j = 0; j < height; j++) {
+ bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j);
+ MEMSET(ptr3, r, 3 * width);
}
}
else {
- /* only clear subrect of color buffer */
- if (r == g && g == b) {
- /* same value for all three components (gray) */
- GLint j;
- for (j=0;j<height;j++) {
- bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j);
- MEMSET(ptr3, r, 3 * width);
- }
- }
- else {
- /* non-gray clear color */
- GLint i, j;
- for (j = 0; j < height; j++) {
- bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j);
- for (i = 0; i < width; i++) {
- ptr3->r = r;
- ptr3->g = g;
- ptr3->b = b;
- ptr3++;
- }
+ /* non-gray clear color */
+ GLint i, j;
+ for (j = 0; j < height; j++) {
+ bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j);
+ for (i = 0; i < width; i++) {
+ ptr3->r = r;
+ ptr3->g = g;
+ ptr3->b = b;
+ ptr3++;
}
}
}
@@ -463,7 +321,7 @@ clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
+ GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
register GLuint pixel = (GLuint) xmesa->clearpixel;
@@ -478,10 +336,12 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
| ((pixel << 24) & 0xff000000);
}
- if (all) {
+ if (width == xrb->Base.Width && height == xrb->Base.Height) {
+ /* clearing whole buffer */
const GLuint n = xrb->Base.Width * xrb->Base.Height;
GLuint *ptr4 = (GLuint *) xrb->ximage->data;
if (pixel == 0) {
+ /* common case */
_mesa_memset(ptr4, pixel, 4 * n);
}
else {
@@ -491,6 +351,7 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
}
}
else {
+ /* clearing scissored region */
GLint i, j;
for (j = 0; j < height; j++) {
GLuint *ptr4 = PIXEL_ADDR4(xrb, x, y + j);
@@ -504,15 +365,12 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
+ GLint x, GLint y, GLint width, GLint height)
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaImage *img = xrb->ximage;
GLint i, j;
- /* We can ignore 'all' here - x, y, width, height are always right */
- (void) all;
-
/* TODO: optimize this */
y = YFLIP(xrb, y);
for (j = 0; j < height; j++) {
@@ -525,65 +383,46 @@ clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
static void
-clear_buffers( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y, GLint width, GLint height )
+clear_buffers(GLcontext *ctx, GLbitfield buffers)
{
if (ctx->DrawBuffer->Name == 0) {
/* this is a window system framebuffer */
const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
XMesaBuffer b = XMESA_BUFFER(ctx->DrawBuffer);
+ const GLint x = ctx->DrawBuffer->_Xmin;
+ const GLint y = ctx->DrawBuffer->_Ymin;
+ const GLint width = ctx->DrawBuffer->_Xmax - x;
+ const GLint height = ctx->DrawBuffer->_Ymax - y;
/* we can't handle color or index masking */
if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
- if (mask & BUFFER_BIT_FRONT_LEFT) {
+ if (buffers & BUFFER_BIT_FRONT_LEFT) {
/* clear front color buffer */
struct gl_renderbuffer *frontRb
= ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
if (b->frontxrb == xmesa_renderbuffer(frontRb)) {
/* renderbuffer is not wrapped - great! */
- b->frontxrb->clearFunc(ctx, b->frontxrb, all, x, y,
- width, height);
- mask &= ~BUFFER_BIT_FRONT_LEFT;
+ b->frontxrb->clearFunc(ctx, b->frontxrb, x, y, width, height);
+ buffers &= ~BUFFER_BIT_FRONT_LEFT;
}
else {
/* we can't directly clear an alpha-wrapped color buffer */
}
}
- if (mask & BUFFER_BIT_BACK_LEFT) {
+ if (buffers & BUFFER_BIT_BACK_LEFT) {
/* clear back color buffer */
struct gl_renderbuffer *backRb
= ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
if (b->backxrb == xmesa_renderbuffer(backRb)) {
/* renderbuffer is not wrapped - great! */
- b->backxrb->clearFunc(ctx, b->backxrb, all, x, y,
- width, height);
- mask &= ~BUFFER_BIT_BACK_LEFT;
+ b->backxrb->clearFunc(ctx, b->backxrb, x, y, width, height);
+ buffers &= ~BUFFER_BIT_BACK_LEFT;
}
}
}
}
- if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
-}
-
-
-/**
- * Called by ctx->Driver.ResizeBuffers()
- * Resize the front/back colorbuffers to match the latest window size.
- */
-void
-xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer,
- GLuint width, GLuint height)
-{
- /* We can do this cast because the first field in the XMesaBuffer
- * struct is a GLframebuffer struct. If this weren't true, we'd
- * need a pointer from the GLframebuffer to the XMesaBuffer.
- */
- XMesaBuffer xmBuffer = (XMesaBuffer) buffer;
-
- xmesa_alloc_back_buffer(xmBuffer, width, height);
-
- _mesa_resize_framebuffer(ctx, buffer, width, height);
+ if (buffers)
+ _swrast_Clear(ctx, buffers);
}
@@ -602,37 +441,38 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
- struct xmesa_renderbuffer *xrb
- = (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped;
-
- const XMesaContext xmesa = XMESA_CONTEXT(ctx);
const SWcontext *swrast = SWRAST_CONTEXT( ctx );
- XMesaDisplay *dpy = xmesa->xm_visual->display;
- XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
- const XMesaGC gc = xmbuf->gc;
-
- ASSERT(dpy);
- ASSERT(gc);
- ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
- ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb->Wrapped;
if (swrast->NewState)
_swrast_validate_derived( ctx );
- if (xrb->pixmap &&
- xrb->Base.AlphaBits == 0 &&
+ if (ctx->DrawBuffer->Name == 0 &&
format == GL_BGRA &&
type == GL_UNSIGNED_BYTE &&
(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) {
+ ctx->Pixel.ZoomY == 1.0 &&
+ xrb->pixmap &&
+ xrb->Base.AlphaBits == 0)
+ {
+ const XMesaContext xmesa = XMESA_CONTEXT(ctx);
+ XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
+ XMesaDisplay *dpy = xmesa->xm_visual->display;
+ const XMesaGC gc = xmbuf->gc;
int dstX = x;
int dstY = y;
int w = width;
int h = height;
struct gl_pixelstore_attrib clippedUnpack = *unpack;
+ ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
+ ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
+ ASSERT(dpy);
+ ASSERT(gc);
+
if (unpack->BufferObj->Name) {
/* unpack from PBO */
GLubyte *buf;
@@ -1120,33 +960,6 @@ choose_tex_format( GLcontext *ctx, GLint internalFormat,
/**
- * Get the current drawing (and reading) window's size and update the
- * corresponding gl_framebuffer(s) if needed.
- */
-static void
-update_framebuffer_size(GLcontext *ctx)
-{
- struct gl_framebuffer *fb = ctx->WinSysDrawBuffer;
- GLuint newWidth, newHeight;
- get_buffer_size(fb, &newWidth, &newHeight);
- if (newWidth != fb->Width || newHeight != fb->Height) {
- xmesa_resize_buffers(ctx, fb, newWidth, newHeight);
- }
-
- if (ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) {
- /* Update readbuffer's size */
- struct gl_framebuffer *fb = ctx->WinSysReadBuffer;
- GLuint newWidth, newHeight;
- get_buffer_size(fb, &newWidth, &newHeight);
- if (newWidth != fb->Width || newHeight != fb->Height) {
- xmesa_resize_buffers(ctx, fb, newWidth, newHeight);
- ctx->NewState |= _NEW_BUFFERS;
- }
- }
-}
-
-
-/**
* Called by glViewport.
* This is a good time for us to poll the current X window size and adjust
* our renderbuffers to match the current window size.
@@ -1160,11 +973,15 @@ update_framebuffer_size(GLcontext *ctx)
static void
xmesa_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
+ XMesaContext xmctx = XMESA_CONTEXT(ctx);
+ XMesaBuffer xmdrawbuf = XMESA_BUFFER(ctx->WinSysDrawBuffer);
+ XMesaBuffer xmreadbuf = XMESA_BUFFER(ctx->WinSysReadBuffer);
+ xmesa_check_and_update_buffer_size(xmctx, xmdrawbuf);
+ xmesa_check_and_update_buffer_size(xmctx, xmreadbuf);
(void) x;
(void) y;
(void) w;
(void) h;
- update_framebuffer_size(ctx);
}
@@ -1248,7 +1065,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
{
driver->GetString = get_string;
driver->UpdateState = xmesa_update_state;
- driver->GetBufferSize = get_buffer_size;
+ driver->GetBufferSize = NULL; /* OBSOLETE */
driver->Flush = finish_or_flush;
driver->Finish = finish_or_flush;
driver->ClearIndex = clear_index;
@@ -1257,7 +1074,6 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
driver->ColorMask = color_mask;
driver->Enable = enable;
driver->Clear = clear_buffers;
- driver->ResizeBuffers = xmesa_resize_buffers;
driver->Viewport = xmesa_viewport;
#ifndef XFree86Server
driver->CopyPixels = xmesa_CopyPixels;
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index ff0557800ae..a24966b3aeb 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -1453,7 +1453,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel &= 0x00ffffff;
pixel |= rgba[i][BCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffff0000;
+ pixel = *ptr4 & 0xffff0000;
pixel |= rgba[i][GCOMP];
pixel |= rgba[i][RCOMP] << 8;
*ptr4 = pixel;
@@ -1463,7 +1463,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel |= rgba[i][BCOMP] << 16;
pixel |= rgba[i][GCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffffff00;
+ pixel = *ptr4 & 0xffffff00;
pixel |= rgba[i][RCOMP];
*ptr4 = pixel;
break;
@@ -1493,7 +1493,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel &= 0x00ffffff;
pixel |= rgba[i][BCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffff0000;
+ pixel = *ptr4 & 0xffff0000;
pixel |= rgba[i][GCOMP];
pixel |= rgba[i++][RCOMP] << 8;
*ptr4 = pixel;
@@ -1504,7 +1504,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel |= rgba[i][BCOMP] << 16;
pixel |= rgba[i][GCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffffff00;
+ pixel = *ptr4 & 0xffffff00;
pixel |= rgba[i++][RCOMP];
*ptr4 = pixel;
if (0 == --w)
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index 4db0872621f..e332fb5480c 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -56,8 +56,7 @@ struct xmesa_renderbuffer;
/* Function pointer for clearing color buffers */
typedef void (*ClearFunc)( GLcontext *ctx, struct xmesa_renderbuffer *xrb,
- GLboolean all, GLint x, GLint y,
- GLint width, GLint height );
+ GLint x, GLint y, GLint width, GLint height );
@@ -81,8 +80,9 @@ enum pixel_format {
};
-/*
- * "Derived" from GLvisual. Basically corresponds to an XVisualInfo.
+/**
+ * Visual inforation, derived from GLvisual.
+ * Basically corresponds to an XVisualInfo.
*/
struct xmesa_visual {
GLvisual mesa_visual; /* Device independent visual parameters */
@@ -127,8 +127,9 @@ struct xmesa_visual {
};
-/*
- * "Derived" from __GLcontextRec. Basically corresponds to a GLXContext.
+/**
+ * Context info, dDerived from GLcontext.
+ * Basically corresponds to a GLXContext.
*/
struct xmesa_context {
GLcontext mesa; /* the core library context (containment) */
@@ -146,7 +147,9 @@ struct xmesa_context {
};
-
+/**
+ * Types of X/GLX drawables we might render into.
+ */
typedef enum {
WINDOW, /* An X window */
GLXWINDOW, /* GLX window */
@@ -155,9 +158,11 @@ typedef enum {
} BufferType;
-/* Values for db_mode: */
+/** Values for db_mode: */
+/*@{*/
#define BACK_PIXMAP 1
#define BACK_XIMAGE 2
+/*@}*/
/**
@@ -175,6 +180,7 @@ struct xmesa_renderbuffer
{
struct gl_renderbuffer Base; /* Base class */
+ XMesaBuffer Parent; /**< The XMesaBuffer this renderbuffer belongs to */
XMesaDrawable drawable; /* Usually the X window ID */
XMesaPixmap pixmap; /* Back color buffer */
XMesaImage *ximage; /* The back buffer, if not using a Pixmap */
@@ -194,8 +200,9 @@ struct xmesa_renderbuffer
};
-/*
- * "Derived" from GLframebuffer. Basically corresponds to a GLXDrawable.
+/**
+ * Framebuffer information, derived from.
+ * Basically corresponds to a GLXDrawable.
*/
struct xmesa_buffer {
GLframebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */
@@ -264,7 +271,7 @@ struct xmesa_buffer {
};
-/*
+/**
* If pixelformat==PF_TRUECOLOR:
*/
#define PACK_TRUECOLOR( PIXEL, R, G, B ) \
@@ -273,7 +280,7 @@ struct xmesa_buffer {
| xmesa->xm_visual->BtoPixel[B]; \
-/*
+/**
* If pixelformat==PF_TRUEDITHER:
*/
#define PACK_TRUEDITHER( PIXEL, X, Y, R, G, B ) \
@@ -286,14 +293,14 @@ struct xmesa_buffer {
-/*
+/**
* If pixelformat==PF_8A8B8G8R:
*/
#define PACK_8A8B8G8R( R, G, B, A ) \
( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) )
-/*
+/**
* Like PACK_8A8B8G8R() but don't use alpha. This is usually an acceptable
* shortcut.
*/
@@ -301,19 +308,19 @@ struct xmesa_buffer {
-/*
+/**
* If pixelformat==PF_8R8G8B:
*/
#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) )
-/*
+/**
* If pixelformat==PF_5R6G5B:
*/
#define PACK_5R6G5B( R, G, B) ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
-/*
+/**
* If pixelformat==PF_8A8R8G8B:
*/
#define PACK_8A8R8G8B( R, G, B, A ) \
@@ -321,7 +328,7 @@ struct xmesa_buffer {
-/*
+/**
* If pixelformat==PF_DITHER:
*
* Improved 8-bit RGB dithering code contributed by Bob Mercier
@@ -398,7 +405,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX];
-/*
+/**
* If pixelformat==PF_LOOKUP:
*/
#define _dither_lookup(C, c) (((unsigned)((DITH_N * (C - 1) + 1) * c)) >> 12)
@@ -412,8 +419,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX];
_dither_lookup(DITH_B, (B)))]
-
-/*
+/**
* If pixelformat==PF_HPCR:
*
* HP Color Recovery dithering (ad@lms.be 30/08/95)
@@ -433,7 +439,7 @@ extern const short xmesa_HPCR_DRGB[3][2][16];
-/*
+/**
* If pixelformat==PF_1BIT:
*/
extern const int xmesa_kernel1[16];
@@ -444,20 +450,20 @@ extern const int xmesa_kernel1[16];
-/*
+/**
* If pixelformat==PF_GRAYSCALE:
*/
#define GRAY_RGB( R, G, B ) XMESA_BUFFER(ctx->DrawBuffer)->color_table[((R) + (G) + (B))/3]
-/*
+/**
* Converts a GL window Y coord to an X window Y coord:
*/
#define YFLIP(XRB, Y) ((XRB)->bottom - (Y))
-/*
+/**
* Return the address of a 1, 2 or 4-byte pixel in the buffer's XImage:
* X==0 is left, Y==0 is bottom.
*/
@@ -475,23 +481,6 @@ extern const int xmesa_kernel1[16];
-
-/*
- * Return pointer to XMesaContext corresponding to a Mesa GLcontext.
- * Since we're using structure containment, it's just a cast!.
- * XXX should use inlined function for better type safety.
- */
-#define XMESA_CONTEXT(MESACTX) ((XMesaContext) (MESACTX))
-
-/*
- * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer.
- * Since we're using structure containment, it's just a cast!.
- * XXX should use inlined function for better type safety.
- */
-#define XMESA_BUFFER(MESABUFF) ((XMesaBuffer) (MESABUFF))
-
-
-
/*
* External functions:
*/
@@ -506,21 +495,25 @@ xmesa_color_to_pixel( GLcontext *ctx,
GLuint pixelFormat );
extern void
-xmesa_alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height);
+xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b,
+ GLuint *width, GLuint *height);
-extern void xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer,
- GLuint width, GLuint height);
+extern void
+xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer);
-extern void xmesa_init_driver_functions( XMesaVisual xmvisual,
- struct dd_function_table *driver );
+extern void
+xmesa_init_driver_functions( XMesaVisual xmvisual,
+ struct dd_function_table *driver );
-extern void xmesa_update_state( GLcontext *ctx, GLbitfield new_state );
+extern void
+xmesa_update_state( GLcontext *ctx, GLbitfield new_state );
extern void
xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb,
enum pixel_format pixelformat, GLint depth);
-extern void xmesa_destroy_buffers_on_display(XMesaDisplay *dpy);
+extern void
+xmesa_destroy_buffers_on_display(XMesaDisplay *dpy);
/**
@@ -533,6 +526,30 @@ xmesa_renderbuffer(struct gl_renderbuffer *rb)
}
+/**
+ * Return pointer to XMesaContext corresponding to a Mesa GLcontext.
+ * Since we're using structure containment, it's just a cast!.
+ * XXX should use inlined function for better type safety.
+ */
+static INLINE XMesaContext
+XMESA_CONTEXT(GLcontext *ctx)
+{
+ return (XMesaContext) ctx;
+}
+
+
+/**
+ * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer.
+ * Since we're using structure containment, it's just a cast!.
+ * XXX should use inlined function for better type safety.
+ */
+static INLINE XMesaBuffer
+XMESA_BUFFER(GLframebuffer *b)
+{
+ return (XMesaBuffer) b;
+}
+
+
/* Plugged into the software rasterizer. Try to use internal
* swrast-style point, line and triangle functions.
*/
diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile
index b7b1330ad14..2f8da126b8e 100644
--- a/src/mesa/glapi/Makefile
+++ b/src/mesa/glapi/Makefile
@@ -34,9 +34,11 @@ API_XML = gl_API.xml \
EXT_framebuffer_object.xml \
APPLE_vertex_array_object.xml
-COMMON = gl_XML.py license.py $(API_XML) typeexpr.py
+COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py
COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py
+INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce
+
all: $(OUTPUTS)
server: $(SERVER_OUTPUTS)
@@ -73,7 +75,7 @@ dispatch.h: $(COMMON) gl_table.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
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_send.py -m proto | indent $(INDENT_FLAGS) > ../../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
@@ -82,10 +84,10 @@ dispatch.h: $(COMMON) gl_table.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
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_h --only-set -h _INDIRECT_SIZE_H_ | indent $(INDENT_FLAGS) > ../../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
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c --only-set | indent $(INDENT_FLAGS) > ../../glx/x11/indirect_size.c
$(GLX_DIR)/indirect_dispatch.c: $(COMMON_GLX) glX_proto_recv.py
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_c > $@
@@ -97,10 +99,10 @@ $(GLX_DIR)/indirect_dispatch.h: $(COMMON_GLX) glX_proto_recv.py glX_API.xml
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_h -f gl_and_glX_API.xml -s > $@
$(GLX_DIR)/indirect_size_get.h: $(COMMON_GLX) glX_proto_size.py
- $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' > $@
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' | indent $(INDENT_FLAGS) > $@
$(GLX_DIR)/indirect_size_get.c: $(COMMON_GLX) glX_proto_size.py
- $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c > $@
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c | indent $(INDENT_FLAGS) > $@
$(GLX_DIR)/indirect_table.c: $(COMMON_GLX) glX_server_table.py glX_API.xml
$(PYTHON2) $(PYTHON_FLAGS) glX_server_table.py -f gl_and_glX_API.xml > $@
diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index 98553a2263c..a128164323a 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -1282,6 +1282,45 @@
#if !defined(IN_DRI_DRIVER)
+#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters
+#define GET_AttachShader(disp) ((disp)->AttachShader)
+#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn)
+#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters
+#define GET_CreateProgram(disp) ((disp)->CreateProgram)
+#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn)
+#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters
+#define GET_CreateShader(disp) ((disp)->CreateShader)
+#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn)
+#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters
+#define GET_DeleteProgram(disp) ((disp)->DeleteProgram)
+#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn)
+#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters
+#define GET_DeleteShader(disp) ((disp)->DeleteShader)
+#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn)
+#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters
+#define GET_DetachShader(disp) ((disp)->DetachShader)
+#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn)
+#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters
+#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders)
+#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn)
+#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters
+#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog)
+#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn)
+#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters
+#define GET_GetProgramiv(disp) ((disp)->GetProgramiv)
+#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn)
+#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters
+#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog)
+#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn)
+#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters
+#define GET_GetShaderiv(disp) ((disp)->GetShaderiv)
+#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn)
+#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters
+#define GET_IsProgram(disp) ((disp)->IsProgram)
+#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn)
+#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters
+#define GET_IsShader(disp) ((disp)->IsShader)
+#define SET_IsShader(disp, fn) ((disp)->IsShader = fn)
#define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters
#define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate)
#define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn)
@@ -1291,6 +1330,24 @@
#define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters
#define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate)
#define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn)
+#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters
+#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv)
+#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn)
+#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters
+#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv)
+#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn)
+#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters
+#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv)
+#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn)
+#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters
+#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv)
+#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn)
+#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters
+#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv)
+#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn)
+#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters
+#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv)
+#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn)
#define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters
#define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB)
#define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn)
@@ -1687,45 +1744,6 @@
#define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters
#define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT)
#define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn)
-#define CALL_GetHistogramEXT(disp, parameters) (*((disp)->GetHistogramEXT)) parameters
-#define GET_GetHistogramEXT(disp) ((disp)->GetHistogramEXT)
-#define SET_GetHistogramEXT(disp, fn) ((disp)->GetHistogramEXT = fn)
-#define CALL_GetHistogramParameterfvEXT(disp, parameters) (*((disp)->GetHistogramParameterfvEXT)) parameters
-#define GET_GetHistogramParameterfvEXT(disp) ((disp)->GetHistogramParameterfvEXT)
-#define SET_GetHistogramParameterfvEXT(disp, fn) ((disp)->GetHistogramParameterfvEXT = fn)
-#define CALL_GetHistogramParameterivEXT(disp, parameters) (*((disp)->GetHistogramParameterivEXT)) parameters
-#define GET_GetHistogramParameterivEXT(disp) ((disp)->GetHistogramParameterivEXT)
-#define SET_GetHistogramParameterivEXT(disp, fn) ((disp)->GetHistogramParameterivEXT = fn)
-#define CALL_GetMinmaxEXT(disp, parameters) (*((disp)->GetMinmaxEXT)) parameters
-#define GET_GetMinmaxEXT(disp) ((disp)->GetMinmaxEXT)
-#define SET_GetMinmaxEXT(disp, fn) ((disp)->GetMinmaxEXT = fn)
-#define CALL_GetMinmaxParameterfvEXT(disp, parameters) (*((disp)->GetMinmaxParameterfvEXT)) parameters
-#define GET_GetMinmaxParameterfvEXT(disp) ((disp)->GetMinmaxParameterfvEXT)
-#define SET_GetMinmaxParameterfvEXT(disp, fn) ((disp)->GetMinmaxParameterfvEXT = fn)
-#define CALL_GetMinmaxParameterivEXT(disp, parameters) (*((disp)->GetMinmaxParameterivEXT)) parameters
-#define GET_GetMinmaxParameterivEXT(disp) ((disp)->GetMinmaxParameterivEXT)
-#define SET_GetMinmaxParameterivEXT(disp, fn) ((disp)->GetMinmaxParameterivEXT = fn)
-#define CALL_GetConvolutionFilterEXT(disp, parameters) (*((disp)->GetConvolutionFilterEXT)) parameters
-#define GET_GetConvolutionFilterEXT(disp) ((disp)->GetConvolutionFilterEXT)
-#define SET_GetConvolutionFilterEXT(disp, fn) ((disp)->GetConvolutionFilterEXT = fn)
-#define CALL_GetConvolutionParameterfvEXT(disp, parameters) (*((disp)->GetConvolutionParameterfvEXT)) parameters
-#define GET_GetConvolutionParameterfvEXT(disp) ((disp)->GetConvolutionParameterfvEXT)
-#define SET_GetConvolutionParameterfvEXT(disp, fn) ((disp)->GetConvolutionParameterfvEXT = fn)
-#define CALL_GetConvolutionParameterivEXT(disp, parameters) (*((disp)->GetConvolutionParameterivEXT)) parameters
-#define GET_GetConvolutionParameterivEXT(disp) ((disp)->GetConvolutionParameterivEXT)
-#define SET_GetConvolutionParameterivEXT(disp, fn) ((disp)->GetConvolutionParameterivEXT = fn)
-#define CALL_GetSeparableFilterEXT(disp, parameters) (*((disp)->GetSeparableFilterEXT)) parameters
-#define GET_GetSeparableFilterEXT(disp) ((disp)->GetSeparableFilterEXT)
-#define SET_GetSeparableFilterEXT(disp, fn) ((disp)->GetSeparableFilterEXT = fn)
-#define CALL_GetColorTableParameterfvSGI(disp, parameters) (*((disp)->GetColorTableParameterfvSGI)) parameters
-#define GET_GetColorTableParameterfvSGI(disp) ((disp)->GetColorTableParameterfvSGI)
-#define SET_GetColorTableParameterfvSGI(disp, fn) ((disp)->GetColorTableParameterfvSGI = fn)
-#define CALL_GetColorTableParameterivSGI(disp, parameters) (*((disp)->GetColorTableParameterivSGI)) parameters
-#define GET_GetColorTableParameterivSGI(disp) ((disp)->GetColorTableParameterivSGI)
-#define SET_GetColorTableParameterivSGI(disp, fn) ((disp)->GetColorTableParameterivSGI = fn)
-#define CALL_GetColorTableSGI(disp, parameters) (*((disp)->GetColorTableSGI)) parameters
-#define GET_GetColorTableSGI(disp) ((disp)->GetColorTableSGI)
-#define SET_GetColorTableSGI(disp, fn) ((disp)->GetColorTableSGI = fn)
#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterfvSGIS)) parameters
#define GET_GetPixelTexGenParameterfvSGIS(disp) ((disp)->GetPixelTexGenParameterfvSGIS)
#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) ((disp)->GetPixelTexGenParameterfvSGIS = fn)
@@ -1744,15 +1762,6 @@
#define CALL_PixelTexGenParameterivSGIS(disp, parameters) (*((disp)->PixelTexGenParameterivSGIS)) parameters
#define GET_PixelTexGenParameterivSGIS(disp) ((disp)->PixelTexGenParameterivSGIS)
#define SET_PixelTexGenParameterivSGIS(disp, fn) ((disp)->PixelTexGenParameterivSGIS = fn)
-#define CALL_AreTexturesResidentEXT(disp, parameters) (*((disp)->AreTexturesResidentEXT)) parameters
-#define GET_AreTexturesResidentEXT(disp) ((disp)->AreTexturesResidentEXT)
-#define SET_AreTexturesResidentEXT(disp, fn) ((disp)->AreTexturesResidentEXT = fn)
-#define CALL_GenTexturesEXT(disp, parameters) (*((disp)->GenTexturesEXT)) parameters
-#define GET_GenTexturesEXT(disp) ((disp)->GenTexturesEXT)
-#define SET_GenTexturesEXT(disp, fn) ((disp)->GenTexturesEXT = fn)
-#define CALL_IsTextureEXT(disp, parameters) (*((disp)->IsTextureEXT)) parameters
-#define GET_IsTextureEXT(disp) ((disp)->IsTextureEXT)
-#define SET_IsTextureEXT(disp, fn) ((disp)->IsTextureEXT = fn)
#define CALL_SampleMaskSGIS(disp, parameters) (*((disp)->SampleMaskSGIS)) parameters
#define GET_SampleMaskSGIS(disp) ((disp)->SampleMaskSGIS)
#define SET_SampleMaskSGIS(disp, fn) ((disp)->SampleMaskSGIS = fn)
@@ -2338,12 +2347,6 @@
#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) (*((disp)->GetFramebufferAttachmentParameterivEXT)) parameters
#define GET_GetFramebufferAttachmentParameterivEXT(disp) ((disp)->GetFramebufferAttachmentParameterivEXT)
#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) ((disp)->GetFramebufferAttachmentParameterivEXT = fn)
-#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters
-#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT)
-#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn)
-#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters
-#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT)
-#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn)
#define CALL_GetRenderbufferParameterivEXT(disp, parameters) (*((disp)->GetRenderbufferParameterivEXT)) parameters
#define GET_GetRenderbufferParameterivEXT(disp) ((disp)->GetRenderbufferParameterivEXT)
#define SET_GetRenderbufferParameterivEXT(disp, fn) ((disp)->GetRenderbufferParameterivEXT = fn)
@@ -2365,374 +2368,422 @@
#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters
#define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT)
#define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn)
+#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters
+#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT)
+#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn)
+#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters
+#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT)
+#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn)
#else
-#define driDispatchRemapTable_size 361
+#define driDispatchRemapTable_size 364
extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
-#define StencilFuncSeparate_remap_index 0
-#define StencilMaskSeparate_remap_index 1
-#define StencilOpSeparate_remap_index 2
-#define LoadTransposeMatrixdARB_remap_index 3
-#define LoadTransposeMatrixfARB_remap_index 4
-#define MultTransposeMatrixdARB_remap_index 5
-#define MultTransposeMatrixfARB_remap_index 6
-#define SampleCoverageARB_remap_index 7
-#define CompressedTexImage1DARB_remap_index 8
-#define CompressedTexImage2DARB_remap_index 9
-#define CompressedTexImage3DARB_remap_index 10
-#define CompressedTexSubImage1DARB_remap_index 11
-#define CompressedTexSubImage2DARB_remap_index 12
-#define CompressedTexSubImage3DARB_remap_index 13
-#define GetCompressedTexImageARB_remap_index 14
-#define DisableVertexAttribArrayARB_remap_index 15
-#define EnableVertexAttribArrayARB_remap_index 16
-#define GetProgramEnvParameterdvARB_remap_index 17
-#define GetProgramEnvParameterfvARB_remap_index 18
-#define GetProgramLocalParameterdvARB_remap_index 19
-#define GetProgramLocalParameterfvARB_remap_index 20
-#define GetProgramStringARB_remap_index 21
-#define GetProgramivARB_remap_index 22
-#define GetVertexAttribdvARB_remap_index 23
-#define GetVertexAttribfvARB_remap_index 24
-#define GetVertexAttribivARB_remap_index 25
-#define ProgramEnvParameter4dARB_remap_index 26
-#define ProgramEnvParameter4dvARB_remap_index 27
-#define ProgramEnvParameter4fARB_remap_index 28
-#define ProgramEnvParameter4fvARB_remap_index 29
-#define ProgramLocalParameter4dARB_remap_index 30
-#define ProgramLocalParameter4dvARB_remap_index 31
-#define ProgramLocalParameter4fARB_remap_index 32
-#define ProgramLocalParameter4fvARB_remap_index 33
-#define ProgramStringARB_remap_index 34
-#define VertexAttrib1dARB_remap_index 35
-#define VertexAttrib1dvARB_remap_index 36
-#define VertexAttrib1fARB_remap_index 37
-#define VertexAttrib1fvARB_remap_index 38
-#define VertexAttrib1sARB_remap_index 39
-#define VertexAttrib1svARB_remap_index 40
-#define VertexAttrib2dARB_remap_index 41
-#define VertexAttrib2dvARB_remap_index 42
-#define VertexAttrib2fARB_remap_index 43
-#define VertexAttrib2fvARB_remap_index 44
-#define VertexAttrib2sARB_remap_index 45
-#define VertexAttrib2svARB_remap_index 46
-#define VertexAttrib3dARB_remap_index 47
-#define VertexAttrib3dvARB_remap_index 48
-#define VertexAttrib3fARB_remap_index 49
-#define VertexAttrib3fvARB_remap_index 50
-#define VertexAttrib3sARB_remap_index 51
-#define VertexAttrib3svARB_remap_index 52
-#define VertexAttrib4NbvARB_remap_index 53
-#define VertexAttrib4NivARB_remap_index 54
-#define VertexAttrib4NsvARB_remap_index 55
-#define VertexAttrib4NubARB_remap_index 56
-#define VertexAttrib4NubvARB_remap_index 57
-#define VertexAttrib4NuivARB_remap_index 58
-#define VertexAttrib4NusvARB_remap_index 59
-#define VertexAttrib4bvARB_remap_index 60
-#define VertexAttrib4dARB_remap_index 61
-#define VertexAttrib4dvARB_remap_index 62
-#define VertexAttrib4fARB_remap_index 63
-#define VertexAttrib4fvARB_remap_index 64
-#define VertexAttrib4ivARB_remap_index 65
-#define VertexAttrib4sARB_remap_index 66
-#define VertexAttrib4svARB_remap_index 67
-#define VertexAttrib4ubvARB_remap_index 68
-#define VertexAttrib4uivARB_remap_index 69
-#define VertexAttrib4usvARB_remap_index 70
-#define VertexAttribPointerARB_remap_index 71
-#define BindBufferARB_remap_index 72
-#define BufferDataARB_remap_index 73
-#define BufferSubDataARB_remap_index 74
-#define DeleteBuffersARB_remap_index 75
-#define GenBuffersARB_remap_index 76
-#define GetBufferParameterivARB_remap_index 77
-#define GetBufferPointervARB_remap_index 78
-#define GetBufferSubDataARB_remap_index 79
-#define IsBufferARB_remap_index 80
-#define MapBufferARB_remap_index 81
-#define UnmapBufferARB_remap_index 82
-#define BeginQueryARB_remap_index 83
-#define DeleteQueriesARB_remap_index 84
-#define EndQueryARB_remap_index 85
-#define GenQueriesARB_remap_index 86
-#define GetQueryObjectivARB_remap_index 87
-#define GetQueryObjectuivARB_remap_index 88
-#define GetQueryivARB_remap_index 89
-#define IsQueryARB_remap_index 90
-#define AttachObjectARB_remap_index 91
-#define CompileShaderARB_remap_index 92
-#define CreateProgramObjectARB_remap_index 93
-#define CreateShaderObjectARB_remap_index 94
-#define DeleteObjectARB_remap_index 95
-#define DetachObjectARB_remap_index 96
-#define GetActiveUniformARB_remap_index 97
-#define GetAttachedObjectsARB_remap_index 98
-#define GetHandleARB_remap_index 99
-#define GetInfoLogARB_remap_index 100
-#define GetObjectParameterfvARB_remap_index 101
-#define GetObjectParameterivARB_remap_index 102
-#define GetShaderSourceARB_remap_index 103
-#define GetUniformLocationARB_remap_index 104
-#define GetUniformfvARB_remap_index 105
-#define GetUniformivARB_remap_index 106
-#define LinkProgramARB_remap_index 107
-#define ShaderSourceARB_remap_index 108
-#define Uniform1fARB_remap_index 109
-#define Uniform1fvARB_remap_index 110
-#define Uniform1iARB_remap_index 111
-#define Uniform1ivARB_remap_index 112
-#define Uniform2fARB_remap_index 113
-#define Uniform2fvARB_remap_index 114
-#define Uniform2iARB_remap_index 115
-#define Uniform2ivARB_remap_index 116
-#define Uniform3fARB_remap_index 117
-#define Uniform3fvARB_remap_index 118
-#define Uniform3iARB_remap_index 119
-#define Uniform3ivARB_remap_index 120
-#define Uniform4fARB_remap_index 121
-#define Uniform4fvARB_remap_index 122
-#define Uniform4iARB_remap_index 123
-#define Uniform4ivARB_remap_index 124
-#define UniformMatrix2fvARB_remap_index 125
-#define UniformMatrix3fvARB_remap_index 126
-#define UniformMatrix4fvARB_remap_index 127
-#define UseProgramObjectARB_remap_index 128
-#define ValidateProgramARB_remap_index 129
-#define BindAttribLocationARB_remap_index 130
-#define GetActiveAttribARB_remap_index 131
-#define GetAttribLocationARB_remap_index 132
-#define DrawBuffersARB_remap_index 133
-#define PolygonOffsetEXT_remap_index 134
-#define GetHistogramEXT_remap_index 135
-#define GetHistogramParameterfvEXT_remap_index 136
-#define GetHistogramParameterivEXT_remap_index 137
-#define GetMinmaxEXT_remap_index 138
-#define GetMinmaxParameterfvEXT_remap_index 139
-#define GetMinmaxParameterivEXT_remap_index 140
-#define GetConvolutionFilterEXT_remap_index 141
-#define GetConvolutionParameterfvEXT_remap_index 142
-#define GetConvolutionParameterivEXT_remap_index 143
-#define GetSeparableFilterEXT_remap_index 144
-#define GetColorTableParameterfvSGI_remap_index 145
-#define GetColorTableParameterivSGI_remap_index 146
-#define GetColorTableSGI_remap_index 147
-#define GetPixelTexGenParameterfvSGIS_remap_index 148
-#define GetPixelTexGenParameterivSGIS_remap_index 149
-#define PixelTexGenParameterfSGIS_remap_index 150
-#define PixelTexGenParameterfvSGIS_remap_index 151
-#define PixelTexGenParameteriSGIS_remap_index 152
-#define PixelTexGenParameterivSGIS_remap_index 153
-#define AreTexturesResidentEXT_remap_index 154
-#define GenTexturesEXT_remap_index 155
-#define IsTextureEXT_remap_index 156
-#define SampleMaskSGIS_remap_index 157
-#define SamplePatternSGIS_remap_index 158
-#define ColorPointerEXT_remap_index 159
-#define EdgeFlagPointerEXT_remap_index 160
-#define IndexPointerEXT_remap_index 161
-#define NormalPointerEXT_remap_index 162
-#define TexCoordPointerEXT_remap_index 163
-#define VertexPointerEXT_remap_index 164
-#define PointParameterfEXT_remap_index 165
-#define PointParameterfvEXT_remap_index 166
-#define LockArraysEXT_remap_index 167
-#define UnlockArraysEXT_remap_index 168
-#define CullParameterdvEXT_remap_index 169
-#define CullParameterfvEXT_remap_index 170
-#define SecondaryColor3bEXT_remap_index 171
-#define SecondaryColor3bvEXT_remap_index 172
-#define SecondaryColor3dEXT_remap_index 173
-#define SecondaryColor3dvEXT_remap_index 174
-#define SecondaryColor3fEXT_remap_index 175
-#define SecondaryColor3fvEXT_remap_index 176
-#define SecondaryColor3iEXT_remap_index 177
-#define SecondaryColor3ivEXT_remap_index 178
-#define SecondaryColor3sEXT_remap_index 179
-#define SecondaryColor3svEXT_remap_index 180
-#define SecondaryColor3ubEXT_remap_index 181
-#define SecondaryColor3ubvEXT_remap_index 182
-#define SecondaryColor3uiEXT_remap_index 183
-#define SecondaryColor3uivEXT_remap_index 184
-#define SecondaryColor3usEXT_remap_index 185
-#define SecondaryColor3usvEXT_remap_index 186
-#define SecondaryColorPointerEXT_remap_index 187
-#define MultiDrawArraysEXT_remap_index 188
-#define MultiDrawElementsEXT_remap_index 189
-#define FogCoordPointerEXT_remap_index 190
-#define FogCoorddEXT_remap_index 191
-#define FogCoorddvEXT_remap_index 192
-#define FogCoordfEXT_remap_index 193
-#define FogCoordfvEXT_remap_index 194
-#define PixelTexGenSGIX_remap_index 195
-#define BlendFuncSeparateEXT_remap_index 196
-#define FlushVertexArrayRangeNV_remap_index 197
-#define VertexArrayRangeNV_remap_index 198
-#define CombinerInputNV_remap_index 199
-#define CombinerOutputNV_remap_index 200
-#define CombinerParameterfNV_remap_index 201
-#define CombinerParameterfvNV_remap_index 202
-#define CombinerParameteriNV_remap_index 203
-#define CombinerParameterivNV_remap_index 204
-#define FinalCombinerInputNV_remap_index 205
-#define GetCombinerInputParameterfvNV_remap_index 206
-#define GetCombinerInputParameterivNV_remap_index 207
-#define GetCombinerOutputParameterfvNV_remap_index 208
-#define GetCombinerOutputParameterivNV_remap_index 209
-#define GetFinalCombinerInputParameterfvNV_remap_index 210
-#define GetFinalCombinerInputParameterivNV_remap_index 211
-#define ResizeBuffersMESA_remap_index 212
-#define WindowPos2dMESA_remap_index 213
-#define WindowPos2dvMESA_remap_index 214
-#define WindowPos2fMESA_remap_index 215
-#define WindowPos2fvMESA_remap_index 216
-#define WindowPos2iMESA_remap_index 217
-#define WindowPos2ivMESA_remap_index 218
-#define WindowPos2sMESA_remap_index 219
-#define WindowPos2svMESA_remap_index 220
-#define WindowPos3dMESA_remap_index 221
-#define WindowPos3dvMESA_remap_index 222
-#define WindowPos3fMESA_remap_index 223
-#define WindowPos3fvMESA_remap_index 224
-#define WindowPos3iMESA_remap_index 225
-#define WindowPos3ivMESA_remap_index 226
-#define WindowPos3sMESA_remap_index 227
-#define WindowPos3svMESA_remap_index 228
-#define WindowPos4dMESA_remap_index 229
-#define WindowPos4dvMESA_remap_index 230
-#define WindowPos4fMESA_remap_index 231
-#define WindowPos4fvMESA_remap_index 232
-#define WindowPos4iMESA_remap_index 233
-#define WindowPos4ivMESA_remap_index 234
-#define WindowPos4sMESA_remap_index 235
-#define WindowPos4svMESA_remap_index 236
-#define MultiModeDrawArraysIBM_remap_index 237
-#define MultiModeDrawElementsIBM_remap_index 238
-#define DeleteFencesNV_remap_index 239
-#define FinishFenceNV_remap_index 240
-#define GenFencesNV_remap_index 241
-#define GetFenceivNV_remap_index 242
-#define IsFenceNV_remap_index 243
-#define SetFenceNV_remap_index 244
-#define TestFenceNV_remap_index 245
-#define AreProgramsResidentNV_remap_index 246
-#define BindProgramNV_remap_index 247
-#define DeleteProgramsNV_remap_index 248
-#define ExecuteProgramNV_remap_index 249
-#define GenProgramsNV_remap_index 250
-#define GetProgramParameterdvNV_remap_index 251
-#define GetProgramParameterfvNV_remap_index 252
-#define GetProgramStringNV_remap_index 253
-#define GetProgramivNV_remap_index 254
-#define GetTrackMatrixivNV_remap_index 255
-#define GetVertexAttribPointervNV_remap_index 256
-#define GetVertexAttribdvNV_remap_index 257
-#define GetVertexAttribfvNV_remap_index 258
-#define GetVertexAttribivNV_remap_index 259
-#define IsProgramNV_remap_index 260
-#define LoadProgramNV_remap_index 261
-#define ProgramParameter4dNV_remap_index 262
-#define ProgramParameter4dvNV_remap_index 263
-#define ProgramParameter4fNV_remap_index 264
-#define ProgramParameter4fvNV_remap_index 265
-#define ProgramParameters4dvNV_remap_index 266
-#define ProgramParameters4fvNV_remap_index 267
-#define RequestResidentProgramsNV_remap_index 268
-#define TrackMatrixNV_remap_index 269
-#define VertexAttrib1dNV_remap_index 270
-#define VertexAttrib1dvNV_remap_index 271
-#define VertexAttrib1fNV_remap_index 272
-#define VertexAttrib1fvNV_remap_index 273
-#define VertexAttrib1sNV_remap_index 274
-#define VertexAttrib1svNV_remap_index 275
-#define VertexAttrib2dNV_remap_index 276
-#define VertexAttrib2dvNV_remap_index 277
-#define VertexAttrib2fNV_remap_index 278
-#define VertexAttrib2fvNV_remap_index 279
-#define VertexAttrib2sNV_remap_index 280
-#define VertexAttrib2svNV_remap_index 281
-#define VertexAttrib3dNV_remap_index 282
-#define VertexAttrib3dvNV_remap_index 283
-#define VertexAttrib3fNV_remap_index 284
-#define VertexAttrib3fvNV_remap_index 285
-#define VertexAttrib3sNV_remap_index 286
-#define VertexAttrib3svNV_remap_index 287
-#define VertexAttrib4dNV_remap_index 288
-#define VertexAttrib4dvNV_remap_index 289
-#define VertexAttrib4fNV_remap_index 290
-#define VertexAttrib4fvNV_remap_index 291
-#define VertexAttrib4sNV_remap_index 292
-#define VertexAttrib4svNV_remap_index 293
-#define VertexAttrib4ubNV_remap_index 294
-#define VertexAttrib4ubvNV_remap_index 295
-#define VertexAttribPointerNV_remap_index 296
-#define VertexAttribs1dvNV_remap_index 297
-#define VertexAttribs1fvNV_remap_index 298
-#define VertexAttribs1svNV_remap_index 299
-#define VertexAttribs2dvNV_remap_index 300
-#define VertexAttribs2fvNV_remap_index 301
-#define VertexAttribs2svNV_remap_index 302
-#define VertexAttribs3dvNV_remap_index 303
-#define VertexAttribs3fvNV_remap_index 304
-#define VertexAttribs3svNV_remap_index 305
-#define VertexAttribs4dvNV_remap_index 306
-#define VertexAttribs4fvNV_remap_index 307
-#define VertexAttribs4svNV_remap_index 308
-#define VertexAttribs4ubvNV_remap_index 309
-#define AlphaFragmentOp1ATI_remap_index 310
-#define AlphaFragmentOp2ATI_remap_index 311
-#define AlphaFragmentOp3ATI_remap_index 312
-#define BeginFragmentShaderATI_remap_index 313
-#define BindFragmentShaderATI_remap_index 314
-#define ColorFragmentOp1ATI_remap_index 315
-#define ColorFragmentOp2ATI_remap_index 316
-#define ColorFragmentOp3ATI_remap_index 317
-#define DeleteFragmentShaderATI_remap_index 318
-#define EndFragmentShaderATI_remap_index 319
-#define GenFragmentShadersATI_remap_index 320
-#define PassTexCoordATI_remap_index 321
-#define SampleMapATI_remap_index 322
-#define SetFragmentShaderConstantATI_remap_index 323
-#define PointParameteriNV_remap_index 324
-#define PointParameterivNV_remap_index 325
-#define ActiveStencilFaceEXT_remap_index 326
-#define BindVertexArrayAPPLE_remap_index 327
-#define DeleteVertexArraysAPPLE_remap_index 328
-#define GenVertexArraysAPPLE_remap_index 329
-#define IsVertexArrayAPPLE_remap_index 330
-#define GetProgramNamedParameterdvNV_remap_index 331
-#define GetProgramNamedParameterfvNV_remap_index 332
-#define ProgramNamedParameter4dNV_remap_index 333
-#define ProgramNamedParameter4dvNV_remap_index 334
-#define ProgramNamedParameter4fNV_remap_index 335
-#define ProgramNamedParameter4fvNV_remap_index 336
-#define DepthBoundsEXT_remap_index 337
-#define BlendEquationSeparateEXT_remap_index 338
-#define BindFramebufferEXT_remap_index 339
-#define BindRenderbufferEXT_remap_index 340
-#define CheckFramebufferStatusEXT_remap_index 341
-#define DeleteFramebuffersEXT_remap_index 342
-#define DeleteRenderbuffersEXT_remap_index 343
-#define FramebufferRenderbufferEXT_remap_index 344
-#define FramebufferTexture1DEXT_remap_index 345
-#define FramebufferTexture2DEXT_remap_index 346
-#define FramebufferTexture3DEXT_remap_index 347
-#define GenFramebuffersEXT_remap_index 348
-#define GenRenderbuffersEXT_remap_index 349
-#define GenerateMipmapEXT_remap_index 350
-#define GetFramebufferAttachmentParameterivEXT_remap_index 351
-#define GetQueryObjecti64vEXT_remap_index 352
-#define GetQueryObjectui64vEXT_remap_index 353
-#define GetRenderbufferParameterivEXT_remap_index 354
-#define IsFramebufferEXT_remap_index 355
-#define IsRenderbufferEXT_remap_index 356
-#define RenderbufferStorageEXT_remap_index 357
-#define BlitFramebufferEXT_remap_index 358
-#define ProgramEnvParameters4fvEXT_remap_index 359
-#define ProgramLocalParameters4fvEXT_remap_index 360
+#define AttachShader_remap_index 0
+#define CreateProgram_remap_index 1
+#define CreateShader_remap_index 2
+#define DeleteProgram_remap_index 3
+#define DeleteShader_remap_index 4
+#define DetachShader_remap_index 5
+#define GetAttachedShaders_remap_index 6
+#define GetProgramInfoLog_remap_index 7
+#define GetProgramiv_remap_index 8
+#define GetShaderInfoLog_remap_index 9
+#define GetShaderiv_remap_index 10
+#define IsProgram_remap_index 11
+#define IsShader_remap_index 12
+#define StencilFuncSeparate_remap_index 13
+#define StencilMaskSeparate_remap_index 14
+#define StencilOpSeparate_remap_index 15
+#define UniformMatrix2x3fv_remap_index 16
+#define UniformMatrix2x4fv_remap_index 17
+#define UniformMatrix3x2fv_remap_index 18
+#define UniformMatrix3x4fv_remap_index 19
+#define UniformMatrix4x2fv_remap_index 20
+#define UniformMatrix4x3fv_remap_index 21
+#define LoadTransposeMatrixdARB_remap_index 22
+#define LoadTransposeMatrixfARB_remap_index 23
+#define MultTransposeMatrixdARB_remap_index 24
+#define MultTransposeMatrixfARB_remap_index 25
+#define SampleCoverageARB_remap_index 26
+#define CompressedTexImage1DARB_remap_index 27
+#define CompressedTexImage2DARB_remap_index 28
+#define CompressedTexImage3DARB_remap_index 29
+#define CompressedTexSubImage1DARB_remap_index 30
+#define CompressedTexSubImage2DARB_remap_index 31
+#define CompressedTexSubImage3DARB_remap_index 32
+#define GetCompressedTexImageARB_remap_index 33
+#define DisableVertexAttribArrayARB_remap_index 34
+#define EnableVertexAttribArrayARB_remap_index 35
+#define GetProgramEnvParameterdvARB_remap_index 36
+#define GetProgramEnvParameterfvARB_remap_index 37
+#define GetProgramLocalParameterdvARB_remap_index 38
+#define GetProgramLocalParameterfvARB_remap_index 39
+#define GetProgramStringARB_remap_index 40
+#define GetProgramivARB_remap_index 41
+#define GetVertexAttribdvARB_remap_index 42
+#define GetVertexAttribfvARB_remap_index 43
+#define GetVertexAttribivARB_remap_index 44
+#define ProgramEnvParameter4dARB_remap_index 45
+#define ProgramEnvParameter4dvARB_remap_index 46
+#define ProgramEnvParameter4fARB_remap_index 47
+#define ProgramEnvParameter4fvARB_remap_index 48
+#define ProgramLocalParameter4dARB_remap_index 49
+#define ProgramLocalParameter4dvARB_remap_index 50
+#define ProgramLocalParameter4fARB_remap_index 51
+#define ProgramLocalParameter4fvARB_remap_index 52
+#define ProgramStringARB_remap_index 53
+#define VertexAttrib1dARB_remap_index 54
+#define VertexAttrib1dvARB_remap_index 55
+#define VertexAttrib1fARB_remap_index 56
+#define VertexAttrib1fvARB_remap_index 57
+#define VertexAttrib1sARB_remap_index 58
+#define VertexAttrib1svARB_remap_index 59
+#define VertexAttrib2dARB_remap_index 60
+#define VertexAttrib2dvARB_remap_index 61
+#define VertexAttrib2fARB_remap_index 62
+#define VertexAttrib2fvARB_remap_index 63
+#define VertexAttrib2sARB_remap_index 64
+#define VertexAttrib2svARB_remap_index 65
+#define VertexAttrib3dARB_remap_index 66
+#define VertexAttrib3dvARB_remap_index 67
+#define VertexAttrib3fARB_remap_index 68
+#define VertexAttrib3fvARB_remap_index 69
+#define VertexAttrib3sARB_remap_index 70
+#define VertexAttrib3svARB_remap_index 71
+#define VertexAttrib4NbvARB_remap_index 72
+#define VertexAttrib4NivARB_remap_index 73
+#define VertexAttrib4NsvARB_remap_index 74
+#define VertexAttrib4NubARB_remap_index 75
+#define VertexAttrib4NubvARB_remap_index 76
+#define VertexAttrib4NuivARB_remap_index 77
+#define VertexAttrib4NusvARB_remap_index 78
+#define VertexAttrib4bvARB_remap_index 79
+#define VertexAttrib4dARB_remap_index 80
+#define VertexAttrib4dvARB_remap_index 81
+#define VertexAttrib4fARB_remap_index 82
+#define VertexAttrib4fvARB_remap_index 83
+#define VertexAttrib4ivARB_remap_index 84
+#define VertexAttrib4sARB_remap_index 85
+#define VertexAttrib4svARB_remap_index 86
+#define VertexAttrib4ubvARB_remap_index 87
+#define VertexAttrib4uivARB_remap_index 88
+#define VertexAttrib4usvARB_remap_index 89
+#define VertexAttribPointerARB_remap_index 90
+#define BindBufferARB_remap_index 91
+#define BufferDataARB_remap_index 92
+#define BufferSubDataARB_remap_index 93
+#define DeleteBuffersARB_remap_index 94
+#define GenBuffersARB_remap_index 95
+#define GetBufferParameterivARB_remap_index 96
+#define GetBufferPointervARB_remap_index 97
+#define GetBufferSubDataARB_remap_index 98
+#define IsBufferARB_remap_index 99
+#define MapBufferARB_remap_index 100
+#define UnmapBufferARB_remap_index 101
+#define BeginQueryARB_remap_index 102
+#define DeleteQueriesARB_remap_index 103
+#define EndQueryARB_remap_index 104
+#define GenQueriesARB_remap_index 105
+#define GetQueryObjectivARB_remap_index 106
+#define GetQueryObjectuivARB_remap_index 107
+#define GetQueryivARB_remap_index 108
+#define IsQueryARB_remap_index 109
+#define AttachObjectARB_remap_index 110
+#define CompileShaderARB_remap_index 111
+#define CreateProgramObjectARB_remap_index 112
+#define CreateShaderObjectARB_remap_index 113
+#define DeleteObjectARB_remap_index 114
+#define DetachObjectARB_remap_index 115
+#define GetActiveUniformARB_remap_index 116
+#define GetAttachedObjectsARB_remap_index 117
+#define GetHandleARB_remap_index 118
+#define GetInfoLogARB_remap_index 119
+#define GetObjectParameterfvARB_remap_index 120
+#define GetObjectParameterivARB_remap_index 121
+#define GetShaderSourceARB_remap_index 122
+#define GetUniformLocationARB_remap_index 123
+#define GetUniformfvARB_remap_index 124
+#define GetUniformivARB_remap_index 125
+#define LinkProgramARB_remap_index 126
+#define ShaderSourceARB_remap_index 127
+#define Uniform1fARB_remap_index 128
+#define Uniform1fvARB_remap_index 129
+#define Uniform1iARB_remap_index 130
+#define Uniform1ivARB_remap_index 131
+#define Uniform2fARB_remap_index 132
+#define Uniform2fvARB_remap_index 133
+#define Uniform2iARB_remap_index 134
+#define Uniform2ivARB_remap_index 135
+#define Uniform3fARB_remap_index 136
+#define Uniform3fvARB_remap_index 137
+#define Uniform3iARB_remap_index 138
+#define Uniform3ivARB_remap_index 139
+#define Uniform4fARB_remap_index 140
+#define Uniform4fvARB_remap_index 141
+#define Uniform4iARB_remap_index 142
+#define Uniform4ivARB_remap_index 143
+#define UniformMatrix2fvARB_remap_index 144
+#define UniformMatrix3fvARB_remap_index 145
+#define UniformMatrix4fvARB_remap_index 146
+#define UseProgramObjectARB_remap_index 147
+#define ValidateProgramARB_remap_index 148
+#define BindAttribLocationARB_remap_index 149
+#define GetActiveAttribARB_remap_index 150
+#define GetAttribLocationARB_remap_index 151
+#define DrawBuffersARB_remap_index 152
+#define PolygonOffsetEXT_remap_index 153
+#define GetPixelTexGenParameterfvSGIS_remap_index 154
+#define GetPixelTexGenParameterivSGIS_remap_index 155
+#define PixelTexGenParameterfSGIS_remap_index 156
+#define PixelTexGenParameterfvSGIS_remap_index 157
+#define PixelTexGenParameteriSGIS_remap_index 158
+#define PixelTexGenParameterivSGIS_remap_index 159
+#define SampleMaskSGIS_remap_index 160
+#define SamplePatternSGIS_remap_index 161
+#define ColorPointerEXT_remap_index 162
+#define EdgeFlagPointerEXT_remap_index 163
+#define IndexPointerEXT_remap_index 164
+#define NormalPointerEXT_remap_index 165
+#define TexCoordPointerEXT_remap_index 166
+#define VertexPointerEXT_remap_index 167
+#define PointParameterfEXT_remap_index 168
+#define PointParameterfvEXT_remap_index 169
+#define LockArraysEXT_remap_index 170
+#define UnlockArraysEXT_remap_index 171
+#define CullParameterdvEXT_remap_index 172
+#define CullParameterfvEXT_remap_index 173
+#define SecondaryColor3bEXT_remap_index 174
+#define SecondaryColor3bvEXT_remap_index 175
+#define SecondaryColor3dEXT_remap_index 176
+#define SecondaryColor3dvEXT_remap_index 177
+#define SecondaryColor3fEXT_remap_index 178
+#define SecondaryColor3fvEXT_remap_index 179
+#define SecondaryColor3iEXT_remap_index 180
+#define SecondaryColor3ivEXT_remap_index 181
+#define SecondaryColor3sEXT_remap_index 182
+#define SecondaryColor3svEXT_remap_index 183
+#define SecondaryColor3ubEXT_remap_index 184
+#define SecondaryColor3ubvEXT_remap_index 185
+#define SecondaryColor3uiEXT_remap_index 186
+#define SecondaryColor3uivEXT_remap_index 187
+#define SecondaryColor3usEXT_remap_index 188
+#define SecondaryColor3usvEXT_remap_index 189
+#define SecondaryColorPointerEXT_remap_index 190
+#define MultiDrawArraysEXT_remap_index 191
+#define MultiDrawElementsEXT_remap_index 192
+#define FogCoordPointerEXT_remap_index 193
+#define FogCoorddEXT_remap_index 194
+#define FogCoorddvEXT_remap_index 195
+#define FogCoordfEXT_remap_index 196
+#define FogCoordfvEXT_remap_index 197
+#define PixelTexGenSGIX_remap_index 198
+#define BlendFuncSeparateEXT_remap_index 199
+#define FlushVertexArrayRangeNV_remap_index 200
+#define VertexArrayRangeNV_remap_index 201
+#define CombinerInputNV_remap_index 202
+#define CombinerOutputNV_remap_index 203
+#define CombinerParameterfNV_remap_index 204
+#define CombinerParameterfvNV_remap_index 205
+#define CombinerParameteriNV_remap_index 206
+#define CombinerParameterivNV_remap_index 207
+#define FinalCombinerInputNV_remap_index 208
+#define GetCombinerInputParameterfvNV_remap_index 209
+#define GetCombinerInputParameterivNV_remap_index 210
+#define GetCombinerOutputParameterfvNV_remap_index 211
+#define GetCombinerOutputParameterivNV_remap_index 212
+#define GetFinalCombinerInputParameterfvNV_remap_index 213
+#define GetFinalCombinerInputParameterivNV_remap_index 214
+#define ResizeBuffersMESA_remap_index 215
+#define WindowPos2dMESA_remap_index 216
+#define WindowPos2dvMESA_remap_index 217
+#define WindowPos2fMESA_remap_index 218
+#define WindowPos2fvMESA_remap_index 219
+#define WindowPos2iMESA_remap_index 220
+#define WindowPos2ivMESA_remap_index 221
+#define WindowPos2sMESA_remap_index 222
+#define WindowPos2svMESA_remap_index 223
+#define WindowPos3dMESA_remap_index 224
+#define WindowPos3dvMESA_remap_index 225
+#define WindowPos3fMESA_remap_index 226
+#define WindowPos3fvMESA_remap_index 227
+#define WindowPos3iMESA_remap_index 228
+#define WindowPos3ivMESA_remap_index 229
+#define WindowPos3sMESA_remap_index 230
+#define WindowPos3svMESA_remap_index 231
+#define WindowPos4dMESA_remap_index 232
+#define WindowPos4dvMESA_remap_index 233
+#define WindowPos4fMESA_remap_index 234
+#define WindowPos4fvMESA_remap_index 235
+#define WindowPos4iMESA_remap_index 236
+#define WindowPos4ivMESA_remap_index 237
+#define WindowPos4sMESA_remap_index 238
+#define WindowPos4svMESA_remap_index 239
+#define MultiModeDrawArraysIBM_remap_index 240
+#define MultiModeDrawElementsIBM_remap_index 241
+#define DeleteFencesNV_remap_index 242
+#define FinishFenceNV_remap_index 243
+#define GenFencesNV_remap_index 244
+#define GetFenceivNV_remap_index 245
+#define IsFenceNV_remap_index 246
+#define SetFenceNV_remap_index 247
+#define TestFenceNV_remap_index 248
+#define AreProgramsResidentNV_remap_index 249
+#define BindProgramNV_remap_index 250
+#define DeleteProgramsNV_remap_index 251
+#define ExecuteProgramNV_remap_index 252
+#define GenProgramsNV_remap_index 253
+#define GetProgramParameterdvNV_remap_index 254
+#define GetProgramParameterfvNV_remap_index 255
+#define GetProgramStringNV_remap_index 256
+#define GetProgramivNV_remap_index 257
+#define GetTrackMatrixivNV_remap_index 258
+#define GetVertexAttribPointervNV_remap_index 259
+#define GetVertexAttribdvNV_remap_index 260
+#define GetVertexAttribfvNV_remap_index 261
+#define GetVertexAttribivNV_remap_index 262
+#define IsProgramNV_remap_index 263
+#define LoadProgramNV_remap_index 264
+#define ProgramParameter4dNV_remap_index 265
+#define ProgramParameter4dvNV_remap_index 266
+#define ProgramParameter4fNV_remap_index 267
+#define ProgramParameter4fvNV_remap_index 268
+#define ProgramParameters4dvNV_remap_index 269
+#define ProgramParameters4fvNV_remap_index 270
+#define RequestResidentProgramsNV_remap_index 271
+#define TrackMatrixNV_remap_index 272
+#define VertexAttrib1dNV_remap_index 273
+#define VertexAttrib1dvNV_remap_index 274
+#define VertexAttrib1fNV_remap_index 275
+#define VertexAttrib1fvNV_remap_index 276
+#define VertexAttrib1sNV_remap_index 277
+#define VertexAttrib1svNV_remap_index 278
+#define VertexAttrib2dNV_remap_index 279
+#define VertexAttrib2dvNV_remap_index 280
+#define VertexAttrib2fNV_remap_index 281
+#define VertexAttrib2fvNV_remap_index 282
+#define VertexAttrib2sNV_remap_index 283
+#define VertexAttrib2svNV_remap_index 284
+#define VertexAttrib3dNV_remap_index 285
+#define VertexAttrib3dvNV_remap_index 286
+#define VertexAttrib3fNV_remap_index 287
+#define VertexAttrib3fvNV_remap_index 288
+#define VertexAttrib3sNV_remap_index 289
+#define VertexAttrib3svNV_remap_index 290
+#define VertexAttrib4dNV_remap_index 291
+#define VertexAttrib4dvNV_remap_index 292
+#define VertexAttrib4fNV_remap_index 293
+#define VertexAttrib4fvNV_remap_index 294
+#define VertexAttrib4sNV_remap_index 295
+#define VertexAttrib4svNV_remap_index 296
+#define VertexAttrib4ubNV_remap_index 297
+#define VertexAttrib4ubvNV_remap_index 298
+#define VertexAttribPointerNV_remap_index 299
+#define VertexAttribs1dvNV_remap_index 300
+#define VertexAttribs1fvNV_remap_index 301
+#define VertexAttribs1svNV_remap_index 302
+#define VertexAttribs2dvNV_remap_index 303
+#define VertexAttribs2fvNV_remap_index 304
+#define VertexAttribs2svNV_remap_index 305
+#define VertexAttribs3dvNV_remap_index 306
+#define VertexAttribs3fvNV_remap_index 307
+#define VertexAttribs3svNV_remap_index 308
+#define VertexAttribs4dvNV_remap_index 309
+#define VertexAttribs4fvNV_remap_index 310
+#define VertexAttribs4svNV_remap_index 311
+#define VertexAttribs4ubvNV_remap_index 312
+#define AlphaFragmentOp1ATI_remap_index 313
+#define AlphaFragmentOp2ATI_remap_index 314
+#define AlphaFragmentOp3ATI_remap_index 315
+#define BeginFragmentShaderATI_remap_index 316
+#define BindFragmentShaderATI_remap_index 317
+#define ColorFragmentOp1ATI_remap_index 318
+#define ColorFragmentOp2ATI_remap_index 319
+#define ColorFragmentOp3ATI_remap_index 320
+#define DeleteFragmentShaderATI_remap_index 321
+#define EndFragmentShaderATI_remap_index 322
+#define GenFragmentShadersATI_remap_index 323
+#define PassTexCoordATI_remap_index 324
+#define SampleMapATI_remap_index 325
+#define SetFragmentShaderConstantATI_remap_index 326
+#define PointParameteriNV_remap_index 327
+#define PointParameterivNV_remap_index 328
+#define ActiveStencilFaceEXT_remap_index 329
+#define BindVertexArrayAPPLE_remap_index 330
+#define DeleteVertexArraysAPPLE_remap_index 331
+#define GenVertexArraysAPPLE_remap_index 332
+#define IsVertexArrayAPPLE_remap_index 333
+#define GetProgramNamedParameterdvNV_remap_index 334
+#define GetProgramNamedParameterfvNV_remap_index 335
+#define ProgramNamedParameter4dNV_remap_index 336
+#define ProgramNamedParameter4dvNV_remap_index 337
+#define ProgramNamedParameter4fNV_remap_index 338
+#define ProgramNamedParameter4fvNV_remap_index 339
+#define DepthBoundsEXT_remap_index 340
+#define BlendEquationSeparateEXT_remap_index 341
+#define BindFramebufferEXT_remap_index 342
+#define BindRenderbufferEXT_remap_index 343
+#define CheckFramebufferStatusEXT_remap_index 344
+#define DeleteFramebuffersEXT_remap_index 345
+#define DeleteRenderbuffersEXT_remap_index 346
+#define FramebufferRenderbufferEXT_remap_index 347
+#define FramebufferTexture1DEXT_remap_index 348
+#define FramebufferTexture2DEXT_remap_index 349
+#define FramebufferTexture3DEXT_remap_index 350
+#define GenFramebuffersEXT_remap_index 351
+#define GenRenderbuffersEXT_remap_index 352
+#define GenerateMipmapEXT_remap_index 353
+#define GetFramebufferAttachmentParameterivEXT_remap_index 354
+#define GetRenderbufferParameterivEXT_remap_index 355
+#define IsFramebufferEXT_remap_index 356
+#define IsRenderbufferEXT_remap_index 357
+#define RenderbufferStorageEXT_remap_index 358
+#define BlitFramebufferEXT_remap_index 359
+#define ProgramEnvParameters4fvEXT_remap_index 360
+#define ProgramLocalParameters4fvEXT_remap_index 361
+#define GetQueryObjecti64vEXT_remap_index 362
+#define GetQueryObjectui64vEXT_remap_index 363
+#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters)
+#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index])
+#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn)
+#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters)
+#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index])
+#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn)
+#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters)
+#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index])
+#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn)
+#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters)
+#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index])
+#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn)
+#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters)
+#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index])
+#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn)
+#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters)
+#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index])
+#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn)
+#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters)
+#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index])
+#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn)
+#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters)
+#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index])
+#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn)
+#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters)
+#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index])
+#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn)
+#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters)
+#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index])
+#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn)
+#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters)
+#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index])
+#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn)
+#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters)
+#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index])
+#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn)
+#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters)
+#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index])
+#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn)
#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters)
#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index])
#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn)
@@ -2742,6 +2793,24 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters)
#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index])
#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn)
+#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters)
+#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index])
+#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn)
+#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters)
+#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index])
+#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn)
+#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters)
+#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index])
+#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn)
+#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters)
+#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index])
+#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn)
+#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters)
+#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index])
+#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn)
+#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters)
+#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index])
+#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn)
#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters)
#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index])
#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn)
@@ -3138,45 +3207,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters)
#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index])
#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn)
-#define CALL_GetHistogramEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetHistogramEXT_remap_index], parameters)
-#define GET_GetHistogramEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramEXT_remap_index])
-#define SET_GetHistogramEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramEXT_remap_index], fn)
-#define CALL_GetHistogramParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index], parameters)
-#define GET_GetHistogramParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index])
-#define SET_GetHistogramParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index], fn)
-#define CALL_GetHistogramParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetHistogramParameterivEXT_remap_index], parameters)
-#define GET_GetHistogramParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterivEXT_remap_index])
-#define SET_GetHistogramParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterivEXT_remap_index], fn)
-#define CALL_GetMinmaxEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetMinmaxEXT_remap_index], parameters)
-#define GET_GetMinmaxEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxEXT_remap_index])
-#define SET_GetMinmaxEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxEXT_remap_index], fn)
-#define CALL_GetMinmaxParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index], parameters)
-#define GET_GetMinmaxParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index])
-#define SET_GetMinmaxParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index], fn)
-#define CALL_GetMinmaxParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index], parameters)
-#define GET_GetMinmaxParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index])
-#define SET_GetMinmaxParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index], fn)
-#define CALL_GetConvolutionFilterEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetConvolutionFilterEXT_remap_index], parameters)
-#define GET_GetConvolutionFilterEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionFilterEXT_remap_index])
-#define SET_GetConvolutionFilterEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionFilterEXT_remap_index], fn)
-#define CALL_GetConvolutionParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index], parameters)
-#define GET_GetConvolutionParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index])
-#define SET_GetConvolutionParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index], fn)
-#define CALL_GetConvolutionParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index], parameters)
-#define GET_GetConvolutionParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index])
-#define SET_GetConvolutionParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index], fn)
-#define CALL_GetSeparableFilterEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *)), driDispatchRemapTable[GetSeparableFilterEXT_remap_index], parameters)
-#define GET_GetSeparableFilterEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetSeparableFilterEXT_remap_index])
-#define SET_GetSeparableFilterEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSeparableFilterEXT_remap_index], fn)
-#define CALL_GetColorTableParameterfvSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index], parameters)
-#define GET_GetColorTableParameterfvSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index])
-#define SET_GetColorTableParameterfvSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index], fn)
-#define CALL_GetColorTableParameterivSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetColorTableParameterivSGI_remap_index], parameters)
-#define GET_GetColorTableParameterivSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivSGI_remap_index])
-#define SET_GetColorTableParameterivSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivSGI_remap_index], fn)
-#define CALL_GetColorTableSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetColorTableSGI_remap_index], parameters)
-#define GET_GetColorTableSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableSGI_remap_index])
-#define SET_GetColorTableSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableSGI_remap_index], fn)
#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters)
#define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index])
#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn)
@@ -3195,15 +3225,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters)
#define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index])
#define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn)
-#define CALL_AreTexturesResidentEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreTexturesResidentEXT_remap_index], parameters)
-#define GET_AreTexturesResidentEXT(disp) GET_by_offset(disp, driDispatchRemapTable[AreTexturesResidentEXT_remap_index])
-#define SET_AreTexturesResidentEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreTexturesResidentEXT_remap_index], fn)
-#define CALL_GenTexturesEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenTexturesEXT_remap_index], parameters)
-#define GET_GenTexturesEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenTexturesEXT_remap_index])
-#define SET_GenTexturesEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenTexturesEXT_remap_index], fn)
-#define CALL_IsTextureEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsTextureEXT_remap_index], parameters)
-#define GET_IsTextureEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsTextureEXT_remap_index])
-#define SET_IsTextureEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsTextureEXT_remap_index], fn)
#define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters)
#define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index])
#define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn)
@@ -3789,12 +3810,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters)
#define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index])
#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn)
-#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters)
-#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index])
-#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn)
-#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters)
-#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index])
-#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn)
#define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters)
#define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index])
#define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn)
@@ -3816,6 +3831,12 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters)
#define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index])
#define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn)
+#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters)
+#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index])
+#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn)
+#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters)
+#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index])
+#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn)
#endif /* !defined(IN_DRI_DRIVER) */
diff --git a/src/mesa/glapi/glX_XML.py b/src/mesa/glapi/glX_XML.py
index 7cc9d8d6649..1b5c3239e01 100644
--- a/src/mesa/glapi/glX_XML.py
+++ b/src/mesa/glapi/glX_XML.py
@@ -81,6 +81,8 @@ class glx_function(gl_XML.gl_function):
self.glx_sop = 0
self.glx_vendorpriv = 0
+ self.glx_vendorpriv_names = []
+
# If this is set to true, it means that GLdouble parameters should be
# written to the GLX protocol packet in the order they appear in the
# prototype. This is different from the "classic" ordering. In the
@@ -116,7 +118,8 @@ class glx_function(gl_XML.gl_function):
self.vectorequiv = element.nsProp( "vectorequiv", None )
- if element.nsProp( "name", None ) == self.name:
+ name = element.nsProp("name", None)
+ if name == self.name:
for param in self.parameters:
self.parameters_by_name[ param.name ] = param
@@ -137,18 +140,13 @@ class glx_function(gl_XML.gl_function):
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.glx_vendorpriv_names.append(name)
self.img_reset = child.nsProp( 'img_reset', None )
@@ -264,7 +262,7 @@ class glx_function(gl_XML.gl_function):
if param.name != self.img_reset:
param.offset = offset
- if not param.is_variable_length():
+ if not param.is_variable_length() and not param.is_client_only:
offset += param.size()
if self.pad_after( param ):
@@ -333,7 +331,7 @@ class glx_function(gl_XML.gl_function):
size = 0
for param in self.parameterIterateGlxSend(0):
- if param.name != self.img_reset:
+ if param.name != self.img_reset and not param.is_client_only:
if size == 0:
size = param.offset + param.size()
else:
@@ -447,6 +445,13 @@ class glx_function(gl_XML.gl_function):
raise RuntimeError('Function "%s" has no opcode.' % (self.name))
+ def opcode_vendor_name(self, name):
+ if name in self.glx_vendorpriv_names:
+ return "X_GLvop_%s" % (name)
+ else:
+ raise RuntimeError('Function "%s" has no VendorPrivate opcode.' % (name))
+
+
def opcode_real_name(self):
"""Get the true protocol enum name for the GLX opcode
@@ -505,6 +510,35 @@ class glx_function(gl_XML.gl_function):
return None
+ def has_different_protocol(self, name):
+ """Returns true if the named version of the function uses different protocol from the other versions.
+
+ Some functions, such as glDeleteTextures and
+ glDeleteTexturesEXT are functionally identical, but have
+ different protocol. This function returns true if the
+ named function is an alias name and that named version uses
+ different protocol from the function that is aliased.
+ """
+
+ return (name in self.glx_vendorpriv_names) and self.glx_sop
+
+
+ def static_glx_name(self, name):
+ if self.has_different_protocol(name):
+ for n in self.glx_vendorpriv_names:
+ if n in self.static_entry_points:
+ return n
+
+ return self.static_name(name)
+
+
+ def client_supported_for_indirect(self):
+ """Returns true if the function is supported on the client
+ side for indirect rendering."""
+
+ return not self.ignore and (self.offset != -1) and (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or self.client_handcode)
+
+
class glx_function_iterator:
"""Class to iterate over a list of glXFunctions"""
@@ -519,10 +553,10 @@ class glx_function_iterator:
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:
+ if f.client_supported_for_indirect():
return f
+ else:
+ return self.next()
class glx_api(gl_XML.gl_api):
diff --git a/src/mesa/glapi/glX_proto_recv.py b/src/mesa/glapi/glX_proto_recv.py
index 86bdd0ec93a..527f6f10eef 100644
--- a/src/mesa/glapi/glX_proto_recv.py
+++ b/src/mesa/glapi/glX_proto_recv.py
@@ -50,13 +50,18 @@ class PrintGlxDispatch_h(gl_XML.gl_print_base):
def printBody(self, api):
for func in api.functionIterateAll():
if not func.ignore and not func.vectorequiv:
- if func.glx_rop != 0:
+ if func.glx_rop:
print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name)
print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name)
- elif func.glx_sop != 0 or func.glx_vendorpriv != 0:
+ elif func.glx_sop or func.glx_vendorpriv:
print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
+ if func.glx_sop and func.glx_vendorpriv:
+ n = func.glx_vendorpriv_names[0]
+ print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
+ print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
+
return
@@ -129,12 +134,15 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
for func in api.functionIterateByOffset():
if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv):
- self.printFunction(func)
+ self.printFunction(func, func.name)
+ if func.glx_sop and func.glx_vendorpriv:
+ self.printFunction(func, func.glx_vendorpriv_names[0])
+
return
- def printFunction(self, f):
+ def printFunction(self, f, name):
if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0):
return
@@ -144,9 +152,9 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
base = '__glXDispSwap'
if f.glx_rop:
- print 'void %s_%s(GLbyte * pc)' % (base, f.name)
+ print 'void %s_%s(GLbyte * pc)' % (base, name)
else:
- print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, f.name)
+ print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, name)
print '{'
@@ -154,9 +162,9 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
self.printRenderFunction(f)
elif f.glx_sop or f.glx_vendorpriv:
if len(f.get_images()) == 0:
- self.printSingleFunction(f)
+ self.printSingleFunction(f, name)
else:
- print "/* Missing GLX protocol for %s. */" % (f.name)
+ print "/* Missing GLX protocol for %s. */" % (name)
print '}'
print ''
@@ -384,8 +392,8 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
return
- def printSingleFunction(self, f):
- if f.glx_sop:
+ def printSingleFunction(self, f, name):
+ if name not in f.glx_vendorpriv_names:
print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;'
else:
print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;'
@@ -398,7 +406,7 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);'
print ''
- if f.glx_sop:
+ if name not in f.glx_vendorpriv_names:
print ' pc += __GLX_SINGLE_HDR_SIZE;'
else:
print ' pc += __GLX_VENDPRIV_HDR_SIZE;'
diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py
index 3fa665dbcec..1b6a5f3890c 100644
--- a/src/mesa/glapi/glX_proto_send.py
+++ b/src/mesa/glapi/glX_proto_send.py
@@ -24,10 +24,26 @@
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
+# Jeremy Kolb <jkolb@brandeis.edu>
import gl_XML, glX_XML, glX_proto_common, license
import sys, getopt, copy, string
+def convertStringForXCB(str):
+ tmp = ""
+ special = [ "ARB" ]
+ i = 0
+ while i < len(str):
+ if str[i:i+3] in special:
+ tmp = '%s_%s' % (tmp, string.lower(str[i:i+3]))
+ i = i + 2;
+ elif str[i].isupper():
+ tmp = '%s_%s' % (tmp, string.lower(str[i]))
+ else:
+ tmp = '%s%s' % (tmp, str[i])
+ i += 1
+ return tmp
+
def hash_pixel_function(func):
"""Generate a 'unique' key for a pixel function. The key is based on
the parameters written in the command packet. This includes any
@@ -150,11 +166,14 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
print '#include "indirect.h"'
print '#include "glxclient.h"'
print '#include "indirect_size.h"'
+ print '#include "dispatch.h"'
+ print '#include "glapi.h"'
+ print '#include "glthread.h"'
print '#include <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 '#include <X11/Xlib-xcb.h>'
+ print '#include <xcb/xcb.h>'
+ print '#include <xcb/glx.h>'
print '#endif /* USE_XCB */'
print ''
@@ -325,26 +344,44 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
generated_stubs.append(h)
fake_func = glx_pixel_function_stub( func, n )
- self.printFunction( fake_func )
+ self.printFunction(fake_func, fake_func.name)
- self.printFunction( func )
+ self.printFunction(func, func.name)
+ if func.glx_sop and func.glx_vendorpriv:
+ self.printFunction(func, func.glx_vendorpriv_names[0])
return
- def printFunction(self, func):
+ def printFunction(self, func, name):
+ footer = '}\n'
if func.glx_rop == ~0:
print 'static %s' % (func.return_type)
print '%s( unsigned opcode, unsigned dim, %s )' % (func.name, func.get_parameter_string())
+ print '{'
else:
- 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())
-
+ if func.has_different_protocol(name):
+ if func.return_type == "void":
+ ret_string = ''
+ else:
+ ret_string = "return "
+
+ func_name = func.static_glx_name(name)
+ print '#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv)
+ print '%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string())
+ print '{'
+ print ' __GLXcontext * const gc = __glXGetCurrentContext();'
+ print ''
+ print ' if (gc->isDirect) {'
+ print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string())
+ print ' } else {'
+ footer = '}\n}\n'
+ else:
+ print '#define %s %d' % (func.opcode_name(), func.opcode_value())
- print '{'
+ print '%s __indirect_gl%s(%s)' % (func.return_type, name, func.get_parameter_string())
+ print '{'
if func.glx_rop != 0 or func.vectorequiv != None:
@@ -353,14 +390,12 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
else:
self.printRenderFunction(func)
elif func.glx_sop != 0 or func.glx_vendorpriv != 0:
- self.printSingleFunction(func)
+ self.printSingleFunction(func, name)
pass
else:
- print "/* Missing GLX protocol for %s. */" % (func.name)
-
- print '}'
- print ''
+ print "/* Missing GLX protocol for %s. */" % (name)
+ print footer
return
@@ -381,25 +416,25 @@ generic_%u_byte( GLint rop, const void * ptr )
return
- def common_emit_one_arg(self, p, pc, indent, adjust, extra_offset):
+ def common_emit_one_arg(self, p, pc, adjust, extra_offset):
if p.is_array():
src_ptr = p.name
else:
src_ptr = "&" + p.name
if not extra_offset:
- print '%s (void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \
- % (indent, pc, p.offset + adjust, src_ptr, p.size_string() )
+ print '(void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \
+ % (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() )
+ print '(void) memcpy((void *)(%s + %u + %s), (void *)(%s), %s);' \
+ % (pc, p.offset + adjust, extra_offset, src_ptr, p.size_string() )
- def common_emit_args(self, f, pc, indent, adjust, skip_vla):
+ def common_emit_args(self, f, pc, adjust, skip_vla):
extra_offset = None
for p in f.parameterIterateGlxSend( not skip_vla ):
if p.name != f.img_reset:
- self.common_emit_one_arg(p, pc, indent, adjust, extra_offset)
+ self.common_emit_one_arg(p, pc, adjust, extra_offset)
if p.is_variable_length():
temp = p.size_string()
@@ -411,7 +446,7 @@ generic_%u_byte( GLint rop, const void * ptr )
return
- def pixel_emit_args(self, f, pc, indent, large):
+ def pixel_emit_args(self, f, pc, large):
"""Emit the arguments for a pixel function. This differs from
common_emit_args in that pixel functions may require padding
be inserted (i.e., for the missing width field for
@@ -425,10 +460,10 @@ generic_%u_byte( GLint rop, const void * ptr )
for param in f.parameterIterateGlxSend():
if not param.is_image():
- self.common_emit_one_arg(param, pc, indent, adjust, None)
+ self.common_emit_one_arg(param, pc, adjust, None)
if f.pad_after(param):
- print '%s (void) memcpy((void *)(%s + %u), zero, 4);' % (indent, pc, (param.offset + param.size()) + adjust)
+ print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset + param.size()) + adjust)
else:
[dim, width, height, depth, extent] = param.get_dimensions()
@@ -439,9 +474,9 @@ generic_%u_byte( GLint rop, const void * ptr )
if param.img_null_flag:
if large:
- print '%s (void) memcpy((void *)(%s + %u), zero, 4);' % (indent, pc, (param.offset - 4) + adjust)
+ print '(void) memcpy((void *)(%s + %u), zero, 4);' % (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)
+ print '(void) memcpy((void *)(%s + %u), (void *)((%s == NULL) ? one : zero), 4);' % (pc, (param.offset - 4) + adjust, param.name)
pixHeaderPtr = "%s + %u" % (pc, adjust)
@@ -453,27 +488,26 @@ generic_%u_byte( GLint rop, const void * ptr )
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)
+ print 'if (%s) {' % (condition)
+ print ' (*gc->fillImage)(gc, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr)
+ print '} else {'
+ print ' (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (pixHeaderPtr, dim, dim)
+ print '}'
else:
- print '%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)
+ print '__glXSendLargeImage(gc, compsize, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr)
return
- def large_emit_begin(self, indent, f, op_name = None):
+ def large_emit_begin(self, 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)
+ print 'const GLint op = %s;' % (op_name)
+ print 'const GLuint cmdlenLarge = cmdlen + 4;'
+ print 'GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);'
+ print '(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);'
+ print '(void) memcpy((void *)(pc + 4), (void *)(&op), 4);'
return
@@ -532,21 +566,21 @@ generic_%u_byte( GLint rop, const void * ptr )
return 0
- def printSingleFunction(self, f):
+ def printSingleFunction(self, f, name):
self.common_func_print_just_start(f)
if self.debug:
print ' printf( "Enter %%s...\\n", "gl%s" );' % (f.name)
- if f.glx_vendorpriv == 0:
+ if name not in f.glx_vendorpriv_names:
# XCB specific:
print '#ifdef USE_XCB'
if self.debug:
print ' printf("\\tUsing XCB.\\n");'
- print ' XCBConnection *c = XCBConnectionOfDisplay(dpy);'
+ print ' xcb_connection_t *c = XGetXCBConnection(dpy);'
print ' (void) __glXFlushRenderBuffer(gc, gc->pc);'
- xcb_name = 'XCBGlx%s' % f.name
+ xcb_name = 'xcb_glx%s' % convertStringForXCB(name)
iparams=[]
extra_iparams = []
@@ -563,7 +597,7 @@ generic_%u_byte( GLint rop, const void * ptr )
# Hardcode this in. lsb_first param (apparently always GL_FALSE)
# also present in GetPolygonStipple, but taken care of above.
- if xcb_name == "XCBGlxReadPixels":
+ if xcb_name == "xcb_glx_read_pixels":
extra_iparams.append("0")
else:
iparams.append(p.name)
@@ -572,16 +606,16 @@ generic_%u_byte( GLint rop, const void * ptr )
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)
+ print ' %s_reply_t *reply = %s_reply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request)
if output and f.reply_always_array:
- print ' (void)memcpy(%s, %sData(reply), %sDataLength(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
+ print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
elif output and not f.reply_always_array:
if not output.is_image():
- print ' if (%sDataLength(reply) == 0)' % (xcb_name)
+ print ' if (%s_data_length(reply) == 0)' % (xcb_name)
print ' (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (output.name)
print ' else'
- print ' (void)memcpy(%s, %sData(reply), %sDataLength(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
+ print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
if f.return_type != 'void':
@@ -598,12 +632,12 @@ generic_%u_byte( GLint rop, const void * ptr )
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())
+ if name in f.glx_vendorpriv_names:
+ print ' %s __glXSetupVendorRequest(gc, %s, %s, cmdlen);' % (pc_decl, f.opcode_real_name(), f.opcode_vendor_name(name))
else:
print ' %s __glXSetupSingleRequest(gc, %s, cmdlen);' % (pc_decl, f.opcode_name())
- self.common_emit_args(f, "pc", " ", 0, 0)
+ self.common_emit_args(f, "pc", 0, 0)
images = f.get_images()
@@ -671,12 +705,12 @@ generic_%u_byte( GLint rop, const void * ptr )
print ' __indirect_glFinish();'
if self.debug:
- print ' printf( "Exit %%s.\\n", "gl%s" );' % (f.name)
+ print ' printf( "Exit %%s.\\n", "gl%s" );' % (name)
print ' UnlockDisplay(dpy); SyncHandle();'
- if f.glx_vendorpriv == 0:
+ if name not in f.glx_vendorpriv_names:
print '#endif /* USE_XCB */'
print ' }'
@@ -706,39 +740,36 @@ generic_%u_byte( GLint rop, const void * ptr )
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 += " "
+ print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {'
+ print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {'
+ print ' (void) __glXFlushRenderBuffer(gc, gc->pc);'
+ print ' }'
if f.glx_rop == ~0:
opcode = "opcode"
else:
opcode = f.opcode_real_name()
- print '%s emit_header(gc->pc, %s, cmdlen);' % (indent, opcode)
+ print 'emit_header(gc->pc, %s, cmdlen);' % (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)
+ self.pixel_emit_args( f, "gc->pc", 0 )
+ print 'gc->pc += cmdlen;'
+ print 'if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }'
if f.can_be_large:
- print '%s}' % (indent)
- print '%selse {' % (indent)
+ print '}'
+ print 'else {'
- self.large_emit_begin(indent, f, opcode)
- self.pixel_emit_args( f, "pc", indent, 1 )
+ self.large_emit_begin(f, opcode)
+ self.pixel_emit_args(f, "pc", 1)
- print '%s}' % (indent)
+ print '}'
if trailer: print trailer
return
@@ -761,42 +792,39 @@ generic_%u_byte( GLint rop, const void * ptr )
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)
+ print 'printf( "Enter %%s...\\n", "gl%s" );' % (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 'if (cmdlen <= gc->maxSmallRenderCommandSize) {'
+ print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {'
+ print ' (void) __glXFlushRenderBuffer(gc, gc->pc);'
+ print ' }'
- print '%s emit_header(gc->pc, %s, cmdlen);' % (indent, f.opcode_real_name())
+ print 'emit_header(gc->pc, %s, cmdlen);' % (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)
+ self.common_emit_args(f, "gc->pc", 4, 0)
+ print 'gc->pc += cmdlen;'
+ print 'if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }'
if f.can_be_large:
- print '%s}' % (indent)
- print '%selse {' % (indent)
+ print '}'
+ print 'else {'
- self.large_emit_begin(indent, f)
- self.common_emit_args(f, "pc", indent, 8, 1)
+ self.large_emit_begin(f)
+ self.common_emit_args(f, "pc", 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)
+ print ' __glXSendLargeCommand(gc, pc, %u, %s, %s);' % (p.offset + 8, p.name, p.size_string())
+ print '}'
if self.debug:
- print '%s __indirect_glFinish();' % (indent)
- print '%s printf( "Exit %%s.\\n", "gl%s" );' % (indent, f.name)
+ print '__indirect_glFinish();'
+ print 'printf( "Exit %%s.\\n", "gl%s" );' % (f.name)
if trailer: print trailer
return
@@ -868,87 +896,18 @@ __GLapi * __glXNewIndirectAPI( void )
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 ] = {}
+ for [name, number] in api.categoryIterate():
+ if number != None:
+ preamble = '\n /* %3u. %s */\n\n' % (int(number), name)
+ else:
+ preamble = '\n /* %s */\n\n' % (name)
- other_categories[ num ][ func.offset ] = [cat, func.name]
+ for func in api.functionIterateByCategory(name):
+ if func.client_supported_for_indirect():
+ print '%s glAPI->%s = __indirect_gl%s;' % (preamble, func.name, func.name)
+ preamble = ''
- self.printCategory( core_categories, 0 )
- self.printCategory( arb_categories, 1 )
- self.printCategory( other_categories, 1 )
return
@@ -1000,7 +959,20 @@ extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest(
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())
+ params = func.get_parameter_string()
+
+ print 'extern HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, params)
+
+ for n in func.entry_points:
+ if func.has_different_protocol(n):
+ asdf = func.static_glx_name(n)
+ if asdf not in func.static_entry_points:
+ print 'extern HIDDEN %s gl%s(%s);' % (func.return_type, asdf, params)
+ else:
+ print 'GLAPI %s GLAPIENTRY gl%s(%s);' % (func.return_type, asdf, params)
+
+ break
+
def show_usage():
diff --git a/src/mesa/glapi/glX_proto_size.py b/src/mesa/glapi/glX_proto_size.py
index 54232781d29..18bfa1b71bc 100644
--- a/src/mesa/glapi/glX_proto_size.py
+++ b/src/mesa/glapi/glX_proto_size.py
@@ -277,7 +277,7 @@ class glx_server_enum_function(glx_enum_function):
for o in keys:
p = f.parameters_by_name[ foo[o] ]
- printer.common_emit_one_arg(p, "pc", " ", 0)
+ printer.common_emit_one_arg(p, "pc", 0)
fixup.append( p.name )
@@ -544,11 +544,11 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
return
- def common_emit_one_arg(self, p, pc, indent, adjust):
+ def common_emit_one_arg(self, p, pc, adjust):
offset = p.offset
dst = p.string()
src = '(%s *)' % (p.type_string())
- print '%s%-18s = *%11s(%s + %u);' % (indent, dst, src, pc, offset + adjust);
+ print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust);
return
@@ -582,7 +582,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
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 )
+ self.common_emit_one_arg(p, "pc", 0)
fixup.append( p.name )
print ''
@@ -640,7 +640,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
self.common_func_print_just_header(f)
for p in params:
- self.common_emit_one_arg(p, "pc", " ", 0 )
+ self.common_emit_one_arg(p, "pc", 0)
print ''
diff --git a/src/mesa/glapi/glX_server_table.py b/src/mesa/glapi/glX_server_table.py
index 14d1c402587..f3962f875b0 100644
--- a/src/mesa/glapi/glX_server_table.py
+++ b/src/mesa/glapi/glX_server_table.py
@@ -207,7 +207,12 @@ class function_table:
else:
size_name = ""
- temp = [op, "__glXDisp_%s" % (func.name), "__glXDispSwap_%s" % (func.name), size, size_name]
+ if func.glx_vendorpriv == op:
+ func_name = func.glx_vendorpriv_names[0]
+ else:
+ func_name = func.name
+
+ temp = [op, "__glXDisp_%s" % (func_name), "__glXDispSwap_%s" % (func_name), size, size_name]
else:
temp = [op, "NULL", "NULL", 0, ""]
@@ -368,9 +373,9 @@ class PrintGlxDispatchTables(glX_proto_common.glx_print_proto):
if not f.ignore and f.vectorequiv == None:
if f.glx_rop != 0:
self.rop_functions.append(f.glx_rop, f)
- elif f.glx_sop != 0:
+ if f.glx_sop != 0:
self.sop_functions.append(f.glx_sop, f)
- elif f.glx_vendorpriv != 0:
+ if f.glx_vendorpriv != 0:
self.vop_functions.append(f.glx_vendorpriv, f)
self.sop_functions.Print()
diff --git a/src/mesa/glapi/gl_API.dtd b/src/mesa/glapi/gl_API.dtd
index 2f0c88aae5b..f89d3818663 100644
--- a/src/mesa/glapi/gl_API.dtd
+++ b/src/mesa/glapi/gl_API.dtd
@@ -40,6 +40,7 @@
mode (get | set) "set">
<!ATTLIST param name NMTOKEN #REQUIRED
type CDATA #REQUIRED
+ client_only (true | false) "false"
count NMTOKEN #IMPLIED
counter (true | false) "false"
count_scale NMTOKEN "1"
@@ -79,6 +80,9 @@ will just mean adding a '<glx ignore="true"/>' tag.
param:
name - name of the parameter
type - fully qualified type (e.g., with "const", etc.)
+ client_only - boolean flag set on parameters which are interpreted only
+ by the client and are not present in the protocol encoding (e.g.,
+ the stride parameters to Map1f, 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
diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml
index 11b9b5021f1..905c4a03a67 100644
--- a/src/mesa/glapi/gl_API.xml
+++ b/src/mesa/glapi/gl_API.xml
@@ -2364,9 +2364,9 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLdouble"/>
<param name="u2" type="GLdouble"/>
- <param name="stride" type="GLint"/>
+ <param name="stride" type="GLint" client_only="true"/>
<param name="order" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
+ <param name="points" type="const GLdouble *" variable_param="order"/>
<glx rop="143" handcode="true"/>
</function>
@@ -2374,9 +2374,9 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLfloat"/>
<param name="u2" type="GLfloat"/>
- <param name="stride" type="GLint"/>
+ <param name="stride" type="GLint" client_only="true"/>
<param name="order" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
+ <param name="points" type="const GLfloat *" variable_param="order"/>
<glx rop="144" handcode="true"/>
</function>
@@ -2384,13 +2384,13 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLdouble"/>
<param name="u2" type="GLdouble"/>
- <param name="ustride" type="GLint"/>
+ <param name="ustride" type="GLint" client_only="true"/>
<param name="uorder" type="GLint"/>
<param name="v1" type="GLdouble"/>
<param name="v2" type="GLdouble"/>
- <param name="vstride" type="GLint"/>
+ <param name="vstride" type="GLint" client_only="true"/>
<param name="vorder" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
+ <param name="points" type="const GLdouble *" variable_param="uorder"/>
<glx rop="145" handcode="true"/>
</function>
@@ -2398,13 +2398,13 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLfloat"/>
<param name="u2" type="GLfloat"/>
- <param name="ustride" type="GLint"/>
+ <param name="ustride" type="GLint" client_only="true"/>
<param name="uorder" type="GLint"/>
<param name="v1" type="GLfloat"/>
<param name="v2" type="GLfloat"/>
- <param name="vstride" type="GLint"/>
+ <param name="vstride" type="GLint" client_only="true"/>
<param name="vorder" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
+ <param name="points" type="const GLfloat *" variable_param="uorder"/>
<glx rop="146" handcode="true"/>
</function>
@@ -5021,13 +5021,98 @@
<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">
+ <!-- XXX some of the enums and functions probably need additional -->
+ <!-- flags/attributes. -->
+
+ <type name="char" size="1" glx_name="CARD8"/>
+
+ <enum name="GL_BLEND_EQUATION_RGB" value="0x8009"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_ENABLED" value="0x8622"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_SIZE" value="0x8623"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_STRIDE" value="0x8624"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_TYPE" value="0x8625"/>
+ <enum name="CURRENT_VERTEX_ATTRIB" value="0x8626"/>
+ <enum name="VERTEX_PROGRAM_POINT_SIZE" value="0x8642"/>
+ <enum name="VERTEX_PROGRAM_TWO_SIDE" value="0x8643"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_POINTER" value="0x8645"/>
+ <enum name="STENCIL_BACK_FUNC" value="0x8800"/>
+ <enum name="STENCIL_BACK_FAIL" value="0x8801"/>
+ <enum name="STENCIL_BACK_PASS_DEPTH_FAIL" value="0x8802"/>
+ <enum name="STENCIL_BACK_PASS_DEPTH_PASS" value="0x8803"/>
+ <enum name="MAX_DRAW_BUFFERS" value="0x8824"/>
+ <enum name="DRAW_BUFFER0" value="0x8825"/>
+ <enum name="DRAW_BUFFER1" value="0x8826"/>
+ <enum name="DRAW_BUFFER2" value="0x8827"/>
+ <enum name="DRAW_BUFFER3" value="0x8828"/>
+ <enum name="DRAW_BUFFER4" value="0x8829"/>
+ <enum name="DRAW_BUFFER5" value="0x882A"/>
+ <enum name="DRAW_BUFFER6" value="0x882B"/>
+ <enum name="DRAW_BUFFER7" value="0x882C"/>
+ <enum name="DRAW_BUFFER8" value="0x882D"/>
+ <enum name="DRAW_BUFFER9" value="0x882E"/>
+ <enum name="DRAW_BUFFER10" value="0x882F"/>
+ <enum name="DRAW_BUFFER11" value="0x8830"/>
+ <enum name="DRAW_BUFFER12" value="0x8831"/>
+ <enum name="DRAW_BUFFER13" value="0x8832"/>
+ <enum name="DRAW_BUFFER14" value="0x8833"/>
+ <enum name="DRAW_BUFFER15" value="0x8834"/>
+ <enum name="BLEND_EQUATION_ALPHA" value="0x883D"/>
+ <enum name="POINT_SPRITE" value="0x8861"/>
+ <enum name="COORD_REPLACE" value="0x8862"/>
+ <enum name="MAX_VERTEX_ATTRIBS" value="0x8869"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED" value="0x886A"/>
+ <enum name="MAX_TEXTURE_COORDS" value="0x8871"/>
+ <enum name="MAX_TEXTURE_IMAGE_UNITS" value="0x8872"/>
+ <enum name="FRAGMENT_SHADER" value="0x8B30"/>
+ <enum name="VERTEX_SHADER" value="0x8B31"/>
+ <enum name="MAX_FRAGMENT_UNIFORM_COMPONENTS" value="0x8B49"/>
+ <enum name="MAX_VERTEX_UNIFORM_COMPONENTS" value="0x8B4A"/>
+ <enum name="MAX_VARYING_FLOATS" value="0x8B4B"/>
+ <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS" value="0x8B4C"/>
+ <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS" value="0x8B4D"/>
+ <enum name="SHADER_TYPE" value="0x8B4F"/>
+ <enum name="FLOAT_VEC2" value="0x8B50"/>
+ <enum name="FLOAT_VEC3" value="0x8B51"/>
+ <enum name="FLOAT_VEC4" value="0x8B52"/>
+ <enum name="INT_VEC2" value="0x8B53"/>
+ <enum name="INT_VEC3" value="0x8B54"/>
+ <enum name="INT_VEC4" value="0x8B55"/>
+ <enum name="BOOL" value="0x8B56"/>
+ <enum name="BOOL_VEC2" value="0x8B57"/>
+ <enum name="BOOL_VEC3" value="0x8B58"/>
+ <enum name="BOOL_VEC4" value="0x8B59"/>
+ <enum name="FLOAT_MAT2" value="0x8B5A"/>
+ <enum name="FLOAT_MAT3" value="0x8B5B"/>
+ <enum name="FLOAT_MAT4" value="0x8B5C"/>
+ <enum name="SAMPLER_1D" value="0x8B5D"/>
+ <enum name="SAMPLER_2D" value="0x8B5E"/>
+ <enum name="SAMPLER_3D" value="0x8B5F"/>
+ <enum name="SAMPLER_CUBE" value="0x8B60"/>
+ <enum name="SAMPLER_1D_SHADOW" value="0x8B61"/>
+ <enum name="SAMPLER_2D_SHADOW" value="0x8B62"/>
+ <enum name="DELETE_STATUS" value="0x8B80"/>
+ <enum name="COMPILE_STATUS" value="0x8B81"/>
+ <enum name="LINK_STATUS" value="0x8B82"/>
+ <enum name="VALIDATE_STATUS" value="0x8B83"/>
+ <enum name="INFO_LOG_LENGTH" value="0x8B84"/>
+ <enum name="ATTACHED_SHADERS" value="0x8B85"/>
+ <enum name="ACTIVE_UNIFORMS" value="0x8B86"/>
+ <enum name="ACTIVE_UNIFORM_MAX_LENGTH" value="0x8B87"/>
+ <enum name="SHADER_SOURCE_LENGTH" value="0x8B88"/>
+ <enum name="ACTIVE_ATTRIBUTES" value="0x8B89"/>
+ <enum name="ACTIVE_ATTRIBUTE_MAX_LENGTH" value="0x8B8A"/>
+ <enum name="FRAGMENT_SHADER_DERIVATIVE_HINT" value="0x8B8B"/>
+ <enum name="SHADING_LANGUAGE_VERSION" value="0x8B8C"/>
+ <enum name="CURRENT_PROGRAM" value="0x8B8D"/>
+ <enum name="POINT_SPRITE_COORD_ORIGIN" count="1" value="0x8CA0">
<size name="PointParameterfvEXT"/>
<size name="PointParameterivNV"/>
</enum>
+ <enum name="LOWER_LEFT" value="0x8CA1"/>
+ <enum name="UPPER_LEFT" value="0x8CA2"/>
+ <enum name="STENCIL_BACK_REF" value="0x8CA3"/>
+ <enum name="STENCIL_BACK_VALUE_MASK" value="0x8CA4"/>
+ <enum name="STENCIL_BACK_WRITEMASK" value="0x8CA5"/>
<function name="BlendEquationSeparate" alias="BlendEquationSeparateEXT">
<param name="modeRGB" type="GLenum"/>
@@ -5044,6 +5129,7 @@
<param name="func" type="GLenum"/>
<param name="ref" type="GLint"/>
<param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
</function>
<function name="StencilOpSeparate" offset="assign">
@@ -5051,12 +5137,588 @@
<param name="fail" type="GLenum"/>
<param name="zfail" type="GLenum"/>
<param name="zpass" type="GLenum"/>
+ <glx ignore="true"/>
</function>
<function name="StencilMaskSeparate" offset="assign">
<param name="face" type="GLenum"/>
<param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="AttachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BindAttribLocation" alias="BindAttribLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CompileShader" alias="CompileShaderARB">
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateProgram" offset="assign">
+ <return type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateShader" offset="assign">
+ <param name="type" type="GLenum"/>
+ <return type="GLuint"/>
+ <glx ignore="true"/>
</function>
+
+ <function name="DeleteProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DetachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DisableVertexAttribArray" alias="DisableVertexAttribArrayARB">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="EnableVertexAttribArray" alias="EnableVertexAttribArrayARB">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveAttrib" alias="GetActiveAttribARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei "/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveUniform" alias="GetActiveUniformARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttachedShaders" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="maxCount" type="GLsizei"/>
+ <param name="count" type="GLsizei *" output="true"/>
+ <param name="obj" type="GLuint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttribLocation" alias="GetAttribLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramiv" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramInfoLog" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderiv" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderInfoLog" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderSource" alias="GetShaderSourceARB">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="source" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformLocation" alias="GetUniformLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformfv" alias="GetUniformfvARB">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformiv" alias="GetUniformivARB">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribdv" alias="GetVertexAttribdvARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribfv" alias="GetVertexAttribfvARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribiv" alias="GetVertexAttribivARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribPointerv" alias="GetVertexAttribPointervARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="pointer" type="GLvoid **" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsShader" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="LinkProgram" alias="LinkProgramARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ShaderSource" alias="ShaderSourceARB">
+ <param name="shader" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="string" type="const GLchar **"/>
+ <param name="length" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UseProgram" alias="UseProgramObjectARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1f" alias="Uniform1fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2f" alias="Uniform2fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3f" alias="Uniform3fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4f" alias="Uniform4fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="v3" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1i" alias="Uniform1iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2i" alias="Uniform2iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3i" alias="Uniform3iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4i" alias="Uniform4iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <param name="v3" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1fv" alias="Uniform1fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2fv" alias="Uniform2fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3fv" alias="Uniform3fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4fv" alias="Uniform4fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1iv" alias="Uniform1ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2iv" alias="Uniform2ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3iv" alias="Uniform3ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4iv" alias="Uniform4ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix2fv" alias="UniformMatrix2fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3fv" alias="UniformMatrix3fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4fv" alias="UniformMatrix4fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ValidateProgram" alias="ValidateProgramARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="VertexAttrib1d" alias="VertexAttrib1dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib1dv" alias="VertexAttrib1dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib1f" alias="VertexAttrib1fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib1fv" alias="VertexAttrib1fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib1s" alias="VertexAttrib1sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib1sv" alias="VertexAttrib1svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib2d" alias="VertexAttrib2dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib2dv" alias="VertexAttrib2dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib2f" alias="VertexAttrib2fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib2fv" alias="VertexAttrib2fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib2s" alias="VertexAttrib2sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib2sv" alias="VertexAttrib2svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib3d" alias="VertexAttrib3dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib3dv" alias="VertexAttrib3dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib3f" alias="VertexAttrib3fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib3fv" alias="VertexAttrib3fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib3s" alias="VertexAttrib3sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib3sv" alias="VertexAttrib3svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib4Nbv" alias="VertexAttrib4NbvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *"/>
+ </function>
+ <function name="VertexAttrib4Niv" alias="VertexAttrib4NivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+ <function name="VertexAttrib4Nsv" alias="VertexAttrib4NsvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+ <function name="VertexAttrib4Nub" alias="VertexAttrib4NubARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLubyte"/>
+ <param name="y" type="GLubyte"/>
+ <param name="z" type="GLubyte"/>
+ <param name="w" type="GLubyte"/>
+ </function>
+ <function name="VertexAttrib4Nubv" alias="VertexAttrib4NubvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *"/>
+ </function>
+ <function name="VertexAttrib4Nuiv" alias="VertexAttrib4NuivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *"/>
+ </function>
+ <function name="VertexAttrib4Nusv" alias="VertexAttrib4NusvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *"/>
+ </function>
+
+ <function name="VertexAttrib4d" alias="VertexAttrib4dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib4dv" alias="VertexAttrib4dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib4f" alias="VertexAttrib4fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib4fv" alias="VertexAttrib4fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib4s" alias="VertexAttrib4sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib4sv" alias="VertexAttrib4svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttribPointer" alias="VertexAttribPointerARB">
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="normalized" type="GLboolean"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+</category>
+
+
+<category name="2.1">
+ <!-- XXX some of the enums and functions probably need additional -->
+ <!-- flags/attributes. -->
+
+ <enum name="GL_CURRENT_RASTER_SECONDARY_COLOR" value="0x845F"/>
+ <enum name="GL_PIXEL_PACK_BUFFER" value="0x88EB"/>
+ <enum name="GL_PIXEL_UNPACK_BUFFER" value="0x88EC"/>
+ <enum name="GL_PIXEL_PACK_BUFFER_BINDING" value="0x88ED"/>
+ <enum name="GL_PIXEL_UNPACK_BUFFER_BINDING" value="0x88EF"/>
+ <enum name="GL_FLOAT_MAT2x3" value="0x8B65"/>
+ <enum name="GL_FLOAT_MAT2x4" value="0x8B66"/>
+ <enum name="GL_FLOAT_MAT3x2" value="0x8B67"/>
+ <enum name="GL_FLOAT_MAT3x4" value="0x8B68"/>
+ <enum name="GL_FLOAT_MAT4x2" value="0x8B69"/>
+ <enum name="GL_FLOAT_MAT4x3" value="0x8B6A"/>
+ <enum name="GL_SRGB" value="0x8C40"/>
+ <enum name="GL_SRGB8" value="0x8C41"/>
+ <enum name="GL_SRGB_ALPHA" value="0x8C42"/>
+ <enum name="GL_SRGB8_ALPHA8" value="0x8C43"/>
+ <enum name="GL_SLUMINANCE_ALPHA" value="0x8C44"/>
+ <enum name="GL_SLUMINANCE8_ALPHA8" value="0x8C45"/>
+ <enum name="GL_SLUMINANCE" value="0x8C46"/>
+ <enum name="GL_SLUMINANCE8" value="0x8C47"/>
+ <enum name="GL_COMPRESSED_SRGB" value="0x8C48"/>
+ <enum name="GL_COMPRESSED_SRGB_ALPHA" value="0x8C49"/>
+ <enum name="GL_COMPRESSED_SLUMINANCE" value="0x8C4A"/>
+ <enum name="GL_COMPRESSED_SLUMINANCE_ALPHA" value="0x8C4B"/>
+
+ <function name="UniformMatrix2x3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3x2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix2x4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4x2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3x4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4x3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
</category>
@@ -6834,7 +7496,7 @@
</function>
<function name="ShaderSourceARB" offset="assign">
- <param name="shaderObj" type="GLhandleARB"/>
+ <param name="shader" type="GLhandleARB"/>
<param name="count" type="GLsizei"/>
<param name="string" type="const GLcharARB **"/>
<param name="length" type="const GLint *"/>
@@ -6842,7 +7504,7 @@
</function>
<function name="CompileShaderARB" offset="assign">
- <param name="shaderObj" type="GLhandleARB"/>
+ <param name="shader" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
@@ -6858,17 +7520,17 @@
</function>
<function name="LinkProgramARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
<function name="UseProgramObjectARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
<function name="ValidateProgramARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
@@ -7043,16 +7705,16 @@
</function>
<function name="GetUniformLocationARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="name" type="const GLcharARB *"/>
<return type="GLint"/>
<glx ignore="true"/>
</function>
<function name="GetActiveUniformARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="index" type="GLuint"/>
- <param name="maxLength" type="GLsizei"/>
+ <param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="size" type="GLint *" output="true"/>
<param name="type" type="GLenum *" output="true"/>
@@ -7061,22 +7723,22 @@
</function>
<function name="GetUniformfvARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="location" type="GLint"/>
<param name="params" type="GLfloat *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetUniformivARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="location" type="GLint"/>
<param name="params" type="GLint *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetShaderSourceARB" offset="assign">
- <param name="obj" type="GLhandleARB"/>
- <param name="maxLength" type="GLsizei"/>
+ <param name="shader" type="GLhandleARB"/>
+ <param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="source" type="GLcharARB *" output="true"/>
<glx ignore="true"/>
@@ -7093,16 +7755,16 @@
<enum name="OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB" value="0x8B8A"/>
<function name="BindAttribLocationARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="index" type="GLuint"/>
<param name="name" type="const GLcharARB *"/>
<glx ignore="true"/>
</function>
<function name="GetActiveAttribARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="index" type="GLuint"/>
- <param name="maxLength" type="GLsizei"/>
+ <param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="size" type="GLint *" output="true"/>
<param name="type" type="GLenum *" output="true"/>
@@ -7111,7 +7773,7 @@
</function>
<function name="GetAttribLocationARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="name" type="const GLcharARB *"/>
<return type="GLint"/>
<glx ignore="true"/>
@@ -7486,50 +8148,50 @@
</enum>
<enum name="TABLE_TOO_LARGE_EXT" value="0x8031"/>
- <function name="GetHistogramEXT" offset="assign" static_dispatch="false">
+ <function name="GetHistogramEXT" alias="GetHistogram" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="reset" type="GLboolean"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true"/>
- <glx vendorpriv="5" handcode="true" ignore="true"/>
+ <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx vendorpriv="5" dimensions_in_reply="true" img_reset="reset"/>
</function>
- <function name="GetHistogramParameterfvEXT" offset="assign" static_dispatch="false">
+ <function name="GetHistogramParameterfvEXT" alias="GetHistogramParameterfv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="6" ignore="true"/>
+ <glx vendorpriv="6"/>
</function>
- <function name="GetHistogramParameterivEXT" offset="assign" static_dispatch="false">
+ <function name="GetHistogramParameterivEXT" alias="GetHistogramParameteriv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="7" ignore="true"/>
+ <glx vendorpriv="7"/>
</function>
- <function name="GetMinmaxEXT" offset="assign" static_dispatch="false">
+ <function name="GetMinmaxEXT" alias="GetMinmax" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="reset" type="GLboolean"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true"/>
- <glx vendorpriv="8" handcode="true" ignore="true"/>
+ <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/>
+ <glx vendorpriv="8" img_reset="reset"/>
</function>
- <function name="GetMinmaxParameterfvEXT" offset="assign" static_dispatch="false">
+ <function name="GetMinmaxParameterfvEXT" alias="GetMinmaxParameterfv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="9" ignore="true"/>
+ <glx vendorpriv="9"/>
</function>
- <function name="GetMinmaxParameterivEXT" offset="assign" static_dispatch="false">
+ <function name="GetMinmaxParameterivEXT" alias="GetMinmaxParameteriv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="10" ignore="true"/>
+ <glx vendorpriv="10"/>
</function>
<function name="HistogramEXT" alias="Histogram" static_dispatch="false">
@@ -7681,36 +8343,36 @@
<param name="height" type="GLsizei"/>
</function>
- <function name="GetConvolutionFilterEXT" offset="assign" static_dispatch="false">
+ <function name="GetConvolutionFilterEXT" alias="GetConvolutionFilter" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
- <param name="image" type="GLvoid *" output="true"/>
- <glx vendorpriv="1" handcode="true" ignore="true"/>
+ <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/>
+ <glx vendorpriv="1" dimensions_in_reply="true"/>
</function>
- <function name="GetConvolutionParameterfvEXT" offset="assign" static_dispatch="false">
+ <function name="GetConvolutionParameterfvEXT" alias="GetConvolutionParameterfv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="2" ignore="true"/>
+ <glx vendorpriv="2"/>
</function>
- <function name="GetConvolutionParameterivEXT" offset="assign" static_dispatch="false">
+ <function name="GetConvolutionParameterivEXT" alias="GetConvolutionParameteriv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="3" ignore="true"/>
+ <glx vendorpriv="3"/>
</function>
- <function name="GetSeparableFilterEXT" offset="assign" static_dispatch="false">
+ <function name="GetSeparableFilterEXT" alias="GetSeparableFilter" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="row" type="GLvoid *" output="true"/>
<param name="column" type="GLvoid *" output="true"/>
<param name="span" type="GLvoid *" output="true"/>
- <glx vendorpriv="4" handcode="true" ignore="true"/>
+ <glx vendorpriv="4" handcode="true"/>
</function>
<function name="SeparableFilter2DEXT" alias="SeparableFilter2D" static_dispatch="false">
@@ -7814,7 +8476,7 @@
<param name="width" type="GLsizei"/>
</function>
- <function name="GetColorTableSGI" offset="assign" static_dispatch="false">
+ <function name="GetColorTableSGI" alias="GetColorTable" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
@@ -7822,14 +8484,14 @@
<glx vendorpriv="4098" dimensions_in_reply="true"/>
</function>
- <function name="GetColorTableParameterfvSGI" offset="assign" static_dispatch="false">
+ <function name="GetColorTableParameterfvSGI" alias="GetColorTableParameterfv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx vendorpriv="4099"/>
</function>
- <function name="GetColorTableParameterivSGI" offset="assign" static_dispatch="false">
+ <function name="GetColorTableParameterivSGI" alias="GetColorTableParameteriv" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
@@ -7917,7 +8579,7 @@
<!-- Extension number 19 is not listed in the extension registry. -->
<category name="GL_EXT_texture_object" number="20">
- <function name="AreTexturesResidentEXT" offset="assign">
+ <function name="AreTexturesResidentEXT" alias="AreTexturesResident">
<param name="n" type="GLsizei" counter="true"/>
<param name="textures" type="const GLuint *" count="n"/>
<param name="residences" type="GLboolean *" output="true" count="n"/>
@@ -7930,22 +8592,19 @@
<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="assign">
+ <function name="GenTexturesEXT" alias="GenTextures">
<param name="n" type="GLsizei" counter="true"/>
<param name="textures" type="GLuint *" output="true" count="n"/>
<glx vendorpriv="13" always_array="true"/>
</function>
- <function name="IsTextureEXT" offset="assign">
+ <function name="IsTextureEXT" alias="IsTexture">
<param name="texture" type="GLuint"/>
<return type="GLboolean"/>
<glx vendorpriv="14"/>
@@ -8474,23 +9133,26 @@
<param name="table" type="const GLvoid *"/>
</function>
- <function name="GetColorTableEXT" alias="GetColorTableSGI">
+ <function name="GetColorTableEXT" alias="GetColorTable">
<param name="target" type="GLenum"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
- <param name="table" type="GLvoid *" output="true"/>
+ <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx vendorpriv="4098" dimensions_in_reply="true"/>
</function>
- <function name="GetColorTableParameterivEXT" alias="GetColorTableParameterivSGI">
+ <function name="GetColorTableParameterivEXT" alias="GetColorTableParameteriv">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="4100"/>
</function>
- <function name="GetColorTableParameterfvEXT" alias="GetColorTableParameterfvSGI">
+ <function name="GetColorTableParameterfvEXT" alias="GetColorTableParameterfv">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx vendorpriv="4099"/>
</function>
</category>
@@ -11433,8 +12095,6 @@
<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. -->
@@ -11443,6 +12103,27 @@
<enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
</category>
+<xi:include href="EXT_framebuffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<category name="GL_EXT_framebuffer_blit" number="316">
+ <enum name="READ_FRAMEBUFFER_EXT" value="0x8CA8"/>
+ <enum name="DRAW_FRAMEBUFFER_EXT" value="0x8CA9"/>
+ <enum name="DRAW_FRAMEBUFFER_BINDING_EXT" value="0x8CA6"/>
+ <enum name="READ_FRAMEBUFFER_BINDING_EXT" value="0x8CAA"/>
+ <function name="BlitFramebufferEXT" offset="assign" static_dispatch="false">
+ <param name="srcX0" type="GLint"/>
+ <param name="srcY0" type="GLint"/>
+ <param name="srcX1" type="GLint"/>
+ <param name="srcY1" type="GLint"/>
+ <param name="dstX0" type="GLint"/>
+ <param name="dstY0" type="GLint"/>
+ <param name="dstX1" type="GLint"/>
+ <param name="dstY1" type="GLint"/>
+ <param name="mask" type="GLbitfield"/>
+ <param name="filter" type="GLenum"/>
+ </function>
+</category>
+
<!-- Unnumbered extensions sorted by name. -->
<category name="GL_ATI_blend_equation_separate">
@@ -11452,6 +12133,38 @@
</function>
</category>
+<category name="GL_EXT_gpu_program_parameters">
+ <function name="ProgramEnvParameters4fvEXT" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="ProgramLocalParameters4fvEXT" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+</category>
+
+<category name="GL_EXT_timer_query">
+ <enum name="TIME_ELAPSED_EXT" value="0x88BF"/>
+ <type name="int64EXT" size="8"/>
+ <type name="uint64EXT" unsigned="true" size="8"/>
+ <function name="GetQueryObjecti64vEXT" offset="assign" static_dispatch="false">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint64EXT *"/>
+ </function>
+ <function name="GetQueryObjectui64vEXT" offset="assign" static_dispatch="false">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLuint64EXT *"/>
+ </function>
+</category>
+
<category name="GL_INGR_blend_func_separate">
<function name="BlendFuncSeparateINGR" alias="BlendFuncSeparateEXT" static_dispatch="false">
<param name="sfactorRGB" type="GLenum"/>
@@ -11569,55 +12282,4 @@
</function>
</category>
-<category name="GL_EXT_timer_query" number="310">
- <enum name="TIME_ELAPSED_EXT" value="0x88BF"/>
- <type name="int64EXT" size="8"/>
- <type name="uint64EXT" unsigned="true" size="8"/>
- <function name="GetQueryObjecti64vEXT" offset="assign" static_dispatch="false">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint64EXT *"/>
- </function>
- <function name="GetQueryObjectui64vEXT" offset="assign" static_dispatch="false">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint64EXT *"/>
- </function>
-</category>
-
-<category name="GL_EXT_framebuffer_blit" number="316">
- <enum name="READ_FRAMEBUFFER_EXT" value="0x8CA8"/>
- <enum name="DRAW_FRAMEBUFFER_EXT" value="0x8CA9"/>
- <enum name="DRAW_FRAMEBUFFER_BINDING_EXT" value="0x8CA6"/>
- <enum name="READ_FRAMEBUFFER_BINDING_EXT" value="0x8CAA"/>
- <function name="BlitFramebufferEXT" offset="assign" static_dispatch="false">
- <param name="srcX0" type="GLint"/>
- <param name="srcY0" type="GLint"/>
- <param name="srcX1" type="GLint"/>
- <param name="srcY1" type="GLint"/>
- <param name="dstX0" type="GLint"/>
- <param name="dstY0" type="GLint"/>
- <param name="dstX1" type="GLint"/>
- <param name="dstY1" type="GLint"/>
- <param name="mask" type="GLbitfield"/>
- <param name="filter" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_EXT_gpu_program_parameters" number="319">
- <function name="ProgramEnvParameters4fvEXT" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="ProgramLocalParameters4fvEXT" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-</category>
-
</OpenGLAPI>
diff --git a/src/mesa/glapi/gl_SPARC_asm.py b/src/mesa/glapi/gl_SPARC_asm.py
index 14db678210b..178c00a227f 100644
--- a/src/mesa/glapi/gl_SPARC_asm.py
+++ b/src/mesa/glapi/gl_SPARC_asm.py
@@ -25,7 +25,8 @@
# Authors:
# Ian Romanick <idr@us.ibm.com>
-import gl_XML, license
+import license
+import gl_XML, glX_XML
import sys, getopt
class PrintGenericStubs(gl_XML.gl_print_base):
@@ -111,7 +112,14 @@ class PrintGenericStubs(gl_XML.gl_print_base):
for n in f.entry_points:
if n != f.name:
if f.is_static_entry_point(n):
- print '\t.globl gl%s ; .type gl%s,#function ; gl%s = gl%s' % (n, n, n, f.name)
+ text = '\t.globl gl%s ; .type gl%s,#function ; gl%s = gl%s' % (n, n, n, f.name)
+
+ if f.has_different_protocol(n):
+ print '#ifndef GLX_INDIRECT_RENDERING'
+ print text
+ print '#endif'
+ else:
+ print text
return
@@ -141,6 +149,5 @@ if __name__ == '__main__':
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
+ api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
+ printer.Print(api)
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index cde9cf7a432..b7a7388400d 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -44,58 +44,11 @@ def parse_GL_API( file_name, factory = None ):
# dispatch offsets to the functions that request that their offsets
# be assigned by the scripts. Typically this means all functions
# that are not part of the ABI.
- #
- # To bring some sanity to the generated offsets, we group all
- # functions into four groups. The groups have offsets assigned to
- # their functions in order. The groups are:
- #
- # 1. Core GL versions, sorted by version number.
- # 2. ARB extensions, sorted by extension number.
- # 3. Non-ARB extensions, sorted by extension number.
- # 4. Un-numbered, non-ARB extensions, sorted by extension name.
-
- lists = [{}, {}, {}, {}]
-
- for func in api.functionIterateAll():
- if func.assign_offset:
- [cat_name, cat_number] = api.category_dict[func.name]
-
- try:
- core_version = float(cat_name)
- except Exception,e:
- core_version = 0.0
-
- if core_version > 0.0:
- func_cat_type = 0
- key = cat_name
- elif cat_name.startswith( "GL_ARB_" ):
- func_cat_type = 1
- key = int(cat_number)
- else:
- if cat_number != None:
- func_cat_type = 2
- key = int(cat_number)
- else:
- func_cat_type = 3
- key = cat_name
-
- if not lists[func_cat_type].has_key(key):
- lists[func_cat_type][key] = {}
- lists[func_cat_type][key][func.name] = func
-
- for func_cat_type in range(0,4):
- keys = lists[func_cat_type].keys()
- keys.sort()
-
- for key in keys:
- names = lists[func_cat_type][key].keys()
- names.sort()
-
- for name in names:
- func = lists[func_cat_type][key][name]
- func.offset = api.next_offset;
- api.next_offset += 1
+ for func in api.functionIterateByCategory():
+ if func.assign_offset:
+ func.offset = api.next_offset;
+ api.next_offset += 1
doc.freeDoc()
@@ -316,6 +269,41 @@ def real_category_name(c):
return c
+def classify_category(name, number):
+ """Based on the category name and number, select a numerical class for it.
+
+ Categories are divided into four classes numbered 0 through 3. The
+ classes are:
+
+ 0. Core GL versions, sorted by version number.
+ 1. ARB extensions, sorted by extension number.
+ 2. Non-ARB extensions, sorted by extension number.
+ 3. Un-numbered extensions, sorted by extension name.
+ """
+
+ try:
+ core_version = float(name)
+ except Exception,e:
+ core_version = 0.0
+
+ if core_version > 0.0:
+ cat_type = 0
+ key = name
+ elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"):
+ cat_type = 1
+ key = int(number)
+ else:
+ if number != None:
+ cat_type = 2
+ key = int(number)
+ else:
+ cat_type = 3
+ key = name
+
+
+ return [cat_type, key]
+
+
def create_parameter_string(parameters, include_names):
"""Create a parameter string from a list of gl_parameters."""
@@ -450,8 +438,9 @@ class gl_parameter:
#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' )
+ self.is_client_only = is_attr_true( element, 'client_only' )
+ self.is_counter = is_attr_true( element, 'counter' )
+ self.is_output = is_attr_true( element, 'output' )
# Pixel data has special parameters.
@@ -734,6 +723,17 @@ class gl_function( gl_item ):
return create_parameter_string( self.parameters, 1 )
+ def get_called_parameter_string(self):
+ p_string = ""
+ comma = ""
+
+ for p in self.parameterIterator():
+ p_string = p_string + comma + p.name
+ comma = ", "
+
+ return p_string
+
+
def is_static_entry_point(self, name):
return name in self.static_entry_points
@@ -773,7 +773,9 @@ class gl_api:
self.functions_by_name = {}
self.enums_by_name = {}
self.types_by_name = {}
+
self.category_dict = {}
+ self.categories = [{}, {}, {}, {}]
self.factory = factory
@@ -811,6 +813,9 @@ class gl_api:
cat_name = cat.nsProp( "name", None )
cat_number = cat.nsProp( "number", None )
+ [cat_type, key] = classify_category(cat_name, cat_number)
+ self.categories[cat_type][key] = [cat_name, cat_number]
+
child = cat.children
while child:
if child.type == "element":
@@ -844,6 +849,43 @@ class gl_api:
return
+ def functionIterateByCategory(self, cat = None):
+ """Iterate over functions by category.
+
+ If cat is None, all known functions are iterated in category
+ order. See classify_category for details of the ordering.
+ Within a category, functions are sorted by name. If cat is
+ not None, then only functions in that category are iterated.
+ """
+ lists = [{}, {}, {}, {}]
+
+ for func in self.functionIterateAll():
+ [cat_name, cat_number] = self.category_dict[func.name]
+
+ if (cat == None) or (cat == cat_name):
+ [func_cat_type, key] = classify_category(cat_name, cat_number)
+
+ if not lists[func_cat_type].has_key(key):
+ lists[func_cat_type][key] = {}
+
+ lists[func_cat_type][key][func.name] = func
+
+
+ functions = []
+ for func_cat_type in range(0,4):
+ keys = lists[func_cat_type].keys()
+ keys.sort()
+
+ for key in keys:
+ names = lists[func_cat_type][key].keys()
+ names.sort()
+
+ for name in names:
+ functions.append(lists[func_cat_type][key][name])
+
+ return functions.__iter__()
+
+
def functionIterateByOffset(self):
max_offset = -1
for func in self.functions_by_name.itervalues():
@@ -880,6 +922,25 @@ class gl_api:
return list.__iter__()
+ def categoryIterate(self):
+ """Iterate over categories.
+
+ Iterate over all known categories in the order specified by
+ classify_category. Each iterated value is a tuple of the
+ name and number (which may be None) of the category.
+ """
+
+ list = []
+ for cat_type in range(0,4):
+ keys = self.categories[cat_type].keys()
+ keys.sort()
+
+ for key in keys:
+ list.append(self.categories[cat_type][key])
+
+ return list.__iter__()
+
+
def get_category_for_name( self, name ):
if self.category_dict.has_key(name):
return self.category_dict[name]
diff --git a/src/mesa/glapi/gl_apitemp.py b/src/mesa/glapi/gl_apitemp.py
index cb87dbd62b0..6e35571e143 100644
--- a/src/mesa/glapi/gl_apitemp.py
+++ b/src/mesa/glapi/gl_apitemp.py
@@ -25,7 +25,7 @@
# Authors:
# Ian Romanick <idr@us.ibm.com>
-import gl_XML
+import gl_XML, glX_XML
import license
import sys, getopt
@@ -79,6 +79,9 @@ class PrintGlOffsets(gl_XML.gl_print_base):
else:
dispatch = "DISPATCH"
+ if f.has_different_protocol(name):
+ print '#ifndef GLX_INDIRECT_RENDERING'
+
if not f.is_static_entry_point(name):
print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name))
print ''
@@ -92,6 +95,8 @@ class PrintGlOffsets(gl_XML.gl_print_base):
print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \
% (dispatch, f.name, p_string, name, t_string, o_string)
print '}'
+ if f.has_different_protocol(name):
+ print '#endif /* GLX_INDIRECT_RENDERING */'
print ''
return
@@ -194,8 +199,14 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {"""
for n in f.entry_points:
if n != f.name:
if f.is_static_entry_point(n):
- print ' TABLE_ENTRY(%s),' % (n)
-
+ text = ' TABLE_ENTRY(%s),' % (n)
+
+ if f.has_different_protocol(n):
+ print '#ifndef GLX_INDIRECT_RENDERING'
+ print text
+ print '#endif'
+ else:
+ print text
print '};'
print '#endif /*UNUSED_TABLE_NAME*/'
print ''
@@ -233,7 +244,7 @@ if __name__ == '__main__':
if arg == "-f":
file_name = val
- api = gl_XML.parse_GL_API( file_name )
+ api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
printer = PrintGlOffsets()
printer.Print(api)
diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py
index e8c0576fd9b..0e3c57042a6 100644
--- a/src/mesa/glapi/gl_enums.py
+++ b/src/mesa/glapi/gl_enums.py
@@ -148,7 +148,7 @@ int _mesa_lookup_enum_by_name( const char *symbol )
string_offsets = {}
i = 0;
- print 'static const char enum_string_table[] = '
+ print 'LONGSTRING static const char enum_string_table[] = '
for [name, enum] in name_table:
print ' "%s\\0"' % (name)
string_offsets[ name ] = i
diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py
index 88d99d25a4e..96e59a58ca1 100644
--- a/src/mesa/glapi/gl_procs.py
+++ b/src/mesa/glapi/gl_procs.py
@@ -26,7 +26,7 @@
# Ian Romanick <idr@us.ibm.com>
import license
-import gl_XML
+import gl_XML, glX_XML
import sys, getopt
class PrintGlProcs(gl_XML.gl_print_base):
@@ -37,28 +37,34 @@ class PrintGlProcs(gl_XML.gl_print_base):
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")
+(C) Copyright IBM Corporation 2004, 2006""", "BRIAN PAUL, IBM")
def printRealHeader(self):
- print '/* This file is only included by glapi.c and is used for'
- 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 ''
+ print """
+/* This file is only included by glapi.c and is used for
+ * the GetProcAddress() function
+ */
+
+typedef struct {
+ GLint Name_offset;
+#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
+ _glapi_proc Address;
+#endif
+ GLuint Offset;
+} glprocs_table_t;
+
+#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o }
+#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o }
+#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o }
+#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o }
+#endif
+
+"""
return
def printRealFooter(self):
@@ -89,7 +95,7 @@ class PrintGlProcs(gl_XML.gl_print_base):
for func in api.functionIterateByOffset():
name = func.dispatch_name()
self.printFunctionString(func.name)
- table.append((base_offset, name, func.name))
+ table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name))
# The length of the function's name, plus 2 for "gl",
# plus 1 for the NUL.
@@ -102,7 +108,13 @@ class PrintGlProcs(gl_XML.gl_print_base):
if n != func.name:
name = func.dispatch_name()
self.printFunctionString( n )
- table.append((base_offset, name, func.name))
+
+ if func.has_different_protocol(n):
+ alt_name = "gl" + func.static_glx_name(n)
+ table.append((base_offset, "gl" + name, alt_name, alt_name, func.name))
+ else:
+ table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name))
+
base_offset += len(n) + 3
@@ -112,23 +124,33 @@ class PrintGlProcs(gl_XML.gl_print_base):
print '};'
print ''
+ print ''
+ print "#ifdef USE_MGL_NAMESPACE"
+ for func in api.functionIterateByOffset():
+ for n in func.entry_points:
+ if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)):
+ print '#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset)
+ break
+ print "#endif /* USE_MGL_NAMESPACE */"
+ print ''
+ print ''
print '/* FIXME: Having these (incorrect) prototypes here is ugly. */'
- print '#ifdef NEED_FUNCTION_POINTER'
+ print '#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)'
for func in api.functionIterateByOffset():
for n in func.entry_points:
- if not func.is_static_entry_point(func.name):
+ if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)):
print 'extern void gl_dispatch_stub_%u(void);' % (func.offset)
break
- print '#endif /* NEED_FUNCTION_POINTER */'
+ print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */'
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)
+ for info in table:
+ print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info
- print ' NAME_FUNC_OFFSET( -1, NULL, 0 )'
+ print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)'
print '};'
return
@@ -136,9 +158,9 @@ class PrintGlProcs(gl_XML.gl_print_base):
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 - Create code for compilers that can handle very"
print " long string constants. (default)"
- print " short - Create code for compilers that can only handle "
+ print " short - Create code for compilers that can only handle"
print " ANSI C89 string constants."
sys.exit(1)
@@ -162,7 +184,6 @@ if __name__ == '__main__':
else:
show_usage()
- api = gl_XML.parse_GL_API( file_name )
-
- printer = PrintGlProcs( long_string )
- printer.Print( api )
+ api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
+ printer = PrintGlProcs(long_string)
+ printer.Print(api)
diff --git a/src/mesa/glapi/gl_x86-64_asm.py b/src/mesa/glapi/gl_x86-64_asm.py
index d06e5336d10..fa45406f47b 100644
--- a/src/mesa/glapi/gl_x86-64_asm.py
+++ b/src/mesa/glapi/gl_x86-64_asm.py
@@ -25,7 +25,8 @@
# Authors:
# Ian Romanick <idr@us.ibm.com>
-import gl_XML, license
+import license
+import gl_XML, glX_XML
import sys, getopt, copy
def should_use_push(registers):
@@ -132,6 +133,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print ''
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))'
+ print '# define _glapi_Dispatch _mglapi_Dispatch'
print '# else'
print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
print '# endif'
@@ -292,7 +294,14 @@ class PrintGenericStubs(gl_XML.gl_print_base):
for n in f.entry_points:
if n != f.name:
if f.is_static_entry_point(n):
- print '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch)
+ text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch)
+
+ if f.has_different_protocol(n):
+ print '#ifndef GLX_INDIRECT_RENDERING'
+ print text
+ print '#endif'
+ else:
+ print text
return
@@ -321,6 +330,5 @@ if __name__ == '__main__':
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
+ api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
+ printer.Print(api)
diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py
index 5825960ce38..650331a0c5a 100644
--- a/src/mesa/glapi/gl_x86_asm.py
+++ b/src/mesa/glapi/gl_x86_asm.py
@@ -25,7 +25,8 @@
# Authors:
# Ian Romanick <idr@us.ibm.com>
-import gl_XML, license
+import license
+import gl_XML, glX_XML
import sys, getopt
class PrintGenericStubs(gl_XML.gl_print_base):
@@ -61,6 +62,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '#else'
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))'
+ print '# define _glapi_Dispatch _mglapi_Dispatch'
print '# else'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))'
print '# endif'
@@ -216,7 +218,14 @@ class PrintGenericStubs(gl_XML.gl_print_base):
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)
+ text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt)
+
+ if f.has_different_protocol(n):
+ print '#ifndef GLX_INDIRECT_RENDERING'
+ print text
+ print '#endif'
+ else:
+ print text
return
@@ -245,6 +254,5 @@ if __name__ == '__main__':
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
+ api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
+ printer.Print(api)
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 95edbc9071e..d1ccc5fba69 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -430,7 +430,12 @@ get_static_proc_address(const char *funcName)
{
const glprocs_table_t * const f = find_entry( funcName );
if (f) {
-#ifdef DISPATCH_FUNCTION_SIZE
+#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING)
+ return (f->Address == NULL)
+ ? (_glapi_proc) (gl_dispatch_functions_start
+ + (DISPATCH_FUNCTION_SIZE * f->Offset))
+ : f->Address;
+#elif defined(DISPATCH_FUNCTION_SIZE)
return (_glapi_proc) (gl_dispatch_functions_start
+ (DISPATCH_FUNCTION_SIZE * f->Offset));
#else
@@ -993,13 +998,6 @@ _glapi_check_table(const struct _glapi_table *table)
assert(blendColorOffset == offset);
}
{
- GLuint istextureOffset = _glapi_get_proc_offset("glIsTextureEXT");
- char *istextureFunc = (char*) &table->IsTextureEXT;
- GLuint offset = (istextureFunc - (char *) table) / sizeof(void *);
- assert(istextureOffset == _gloffset_IsTextureEXT);
- assert(istextureOffset == offset);
- }
- {
GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT");
char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT;
GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *);
diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h
index 2dc4e77f45c..cb0d21083ef 100644
--- a/src/mesa/glapi/glapioffsets.h
+++ b/src/mesa/glapi/glapioffsets.h
@@ -440,374 +440,396 @@
#if !defined(IN_DRI_DRIVER)
-#define _gloffset_StencilFuncSeparate 408
-#define _gloffset_StencilMaskSeparate 409
-#define _gloffset_StencilOpSeparate 410
-#define _gloffset_LoadTransposeMatrixdARB 411
-#define _gloffset_LoadTransposeMatrixfARB 412
-#define _gloffset_MultTransposeMatrixdARB 413
-#define _gloffset_MultTransposeMatrixfARB 414
-#define _gloffset_SampleCoverageARB 415
-#define _gloffset_CompressedTexImage1DARB 416
-#define _gloffset_CompressedTexImage2DARB 417
-#define _gloffset_CompressedTexImage3DARB 418
-#define _gloffset_CompressedTexSubImage1DARB 419
-#define _gloffset_CompressedTexSubImage2DARB 420
-#define _gloffset_CompressedTexSubImage3DARB 421
-#define _gloffset_GetCompressedTexImageARB 422
-#define _gloffset_DisableVertexAttribArrayARB 423
-#define _gloffset_EnableVertexAttribArrayARB 424
-#define _gloffset_GetProgramEnvParameterdvARB 425
-#define _gloffset_GetProgramEnvParameterfvARB 426
-#define _gloffset_GetProgramLocalParameterdvARB 427
-#define _gloffset_GetProgramLocalParameterfvARB 428
-#define _gloffset_GetProgramStringARB 429
-#define _gloffset_GetProgramivARB 430
-#define _gloffset_GetVertexAttribdvARB 431
-#define _gloffset_GetVertexAttribfvARB 432
-#define _gloffset_GetVertexAttribivARB 433
-#define _gloffset_ProgramEnvParameter4dARB 434
-#define _gloffset_ProgramEnvParameter4dvARB 435
-#define _gloffset_ProgramEnvParameter4fARB 436
-#define _gloffset_ProgramEnvParameter4fvARB 437
-#define _gloffset_ProgramLocalParameter4dARB 438
-#define _gloffset_ProgramLocalParameter4dvARB 439
-#define _gloffset_ProgramLocalParameter4fARB 440
-#define _gloffset_ProgramLocalParameter4fvARB 441
-#define _gloffset_ProgramStringARB 442
-#define _gloffset_VertexAttrib1dARB 443
-#define _gloffset_VertexAttrib1dvARB 444
-#define _gloffset_VertexAttrib1fARB 445
-#define _gloffset_VertexAttrib1fvARB 446
-#define _gloffset_VertexAttrib1sARB 447
-#define _gloffset_VertexAttrib1svARB 448
-#define _gloffset_VertexAttrib2dARB 449
-#define _gloffset_VertexAttrib2dvARB 450
-#define _gloffset_VertexAttrib2fARB 451
-#define _gloffset_VertexAttrib2fvARB 452
-#define _gloffset_VertexAttrib2sARB 453
-#define _gloffset_VertexAttrib2svARB 454
-#define _gloffset_VertexAttrib3dARB 455
-#define _gloffset_VertexAttrib3dvARB 456
-#define _gloffset_VertexAttrib3fARB 457
-#define _gloffset_VertexAttrib3fvARB 458
-#define _gloffset_VertexAttrib3sARB 459
-#define _gloffset_VertexAttrib3svARB 460
-#define _gloffset_VertexAttrib4NbvARB 461
-#define _gloffset_VertexAttrib4NivARB 462
-#define _gloffset_VertexAttrib4NsvARB 463
-#define _gloffset_VertexAttrib4NubARB 464
-#define _gloffset_VertexAttrib4NubvARB 465
-#define _gloffset_VertexAttrib4NuivARB 466
-#define _gloffset_VertexAttrib4NusvARB 467
-#define _gloffset_VertexAttrib4bvARB 468
-#define _gloffset_VertexAttrib4dARB 469
-#define _gloffset_VertexAttrib4dvARB 470
-#define _gloffset_VertexAttrib4fARB 471
-#define _gloffset_VertexAttrib4fvARB 472
-#define _gloffset_VertexAttrib4ivARB 473
-#define _gloffset_VertexAttrib4sARB 474
-#define _gloffset_VertexAttrib4svARB 475
-#define _gloffset_VertexAttrib4ubvARB 476
-#define _gloffset_VertexAttrib4uivARB 477
-#define _gloffset_VertexAttrib4usvARB 478
-#define _gloffset_VertexAttribPointerARB 479
-#define _gloffset_BindBufferARB 480
-#define _gloffset_BufferDataARB 481
-#define _gloffset_BufferSubDataARB 482
-#define _gloffset_DeleteBuffersARB 483
-#define _gloffset_GenBuffersARB 484
-#define _gloffset_GetBufferParameterivARB 485
-#define _gloffset_GetBufferPointervARB 486
-#define _gloffset_GetBufferSubDataARB 487
-#define _gloffset_IsBufferARB 488
-#define _gloffset_MapBufferARB 489
-#define _gloffset_UnmapBufferARB 490
-#define _gloffset_BeginQueryARB 491
-#define _gloffset_DeleteQueriesARB 492
-#define _gloffset_EndQueryARB 493
-#define _gloffset_GenQueriesARB 494
-#define _gloffset_GetQueryObjectivARB 495
-#define _gloffset_GetQueryObjectuivARB 496
-#define _gloffset_GetQueryivARB 497
-#define _gloffset_IsQueryARB 498
-#define _gloffset_AttachObjectARB 499
-#define _gloffset_CompileShaderARB 500
-#define _gloffset_CreateProgramObjectARB 501
-#define _gloffset_CreateShaderObjectARB 502
-#define _gloffset_DeleteObjectARB 503
-#define _gloffset_DetachObjectARB 504
-#define _gloffset_GetActiveUniformARB 505
-#define _gloffset_GetAttachedObjectsARB 506
-#define _gloffset_GetHandleARB 507
-#define _gloffset_GetInfoLogARB 508
-#define _gloffset_GetObjectParameterfvARB 509
-#define _gloffset_GetObjectParameterivARB 510
-#define _gloffset_GetShaderSourceARB 511
-#define _gloffset_GetUniformLocationARB 512
-#define _gloffset_GetUniformfvARB 513
-#define _gloffset_GetUniformivARB 514
-#define _gloffset_LinkProgramARB 515
-#define _gloffset_ShaderSourceARB 516
-#define _gloffset_Uniform1fARB 517
-#define _gloffset_Uniform1fvARB 518
-#define _gloffset_Uniform1iARB 519
-#define _gloffset_Uniform1ivARB 520
-#define _gloffset_Uniform2fARB 521
-#define _gloffset_Uniform2fvARB 522
-#define _gloffset_Uniform2iARB 523
-#define _gloffset_Uniform2ivARB 524
-#define _gloffset_Uniform3fARB 525
-#define _gloffset_Uniform3fvARB 526
-#define _gloffset_Uniform3iARB 527
-#define _gloffset_Uniform3ivARB 528
-#define _gloffset_Uniform4fARB 529
-#define _gloffset_Uniform4fvARB 530
-#define _gloffset_Uniform4iARB 531
-#define _gloffset_Uniform4ivARB 532
-#define _gloffset_UniformMatrix2fvARB 533
-#define _gloffset_UniformMatrix3fvARB 534
-#define _gloffset_UniformMatrix4fvARB 535
-#define _gloffset_UseProgramObjectARB 536
-#define _gloffset_ValidateProgramARB 537
-#define _gloffset_BindAttribLocationARB 538
-#define _gloffset_GetActiveAttribARB 539
-#define _gloffset_GetAttribLocationARB 540
-#define _gloffset_DrawBuffersARB 541
-#define _gloffset_PolygonOffsetEXT 542
-#define _gloffset_GetHistogramEXT 543
-#define _gloffset_GetHistogramParameterfvEXT 544
-#define _gloffset_GetHistogramParameterivEXT 545
-#define _gloffset_GetMinmaxEXT 546
-#define _gloffset_GetMinmaxParameterfvEXT 547
-#define _gloffset_GetMinmaxParameterivEXT 548
-#define _gloffset_GetConvolutionFilterEXT 549
-#define _gloffset_GetConvolutionParameterfvEXT 550
-#define _gloffset_GetConvolutionParameterivEXT 551
-#define _gloffset_GetSeparableFilterEXT 552
-#define _gloffset_GetColorTableParameterfvSGI 553
-#define _gloffset_GetColorTableParameterivSGI 554
-#define _gloffset_GetColorTableSGI 555
-#define _gloffset_GetPixelTexGenParameterfvSGIS 556
-#define _gloffset_GetPixelTexGenParameterivSGIS 557
-#define _gloffset_PixelTexGenParameterfSGIS 558
-#define _gloffset_PixelTexGenParameterfvSGIS 559
-#define _gloffset_PixelTexGenParameteriSGIS 560
-#define _gloffset_PixelTexGenParameterivSGIS 561
-#define _gloffset_AreTexturesResidentEXT 562
-#define _gloffset_GenTexturesEXT 563
-#define _gloffset_IsTextureEXT 564
-#define _gloffset_SampleMaskSGIS 565
-#define _gloffset_SamplePatternSGIS 566
-#define _gloffset_ColorPointerEXT 567
-#define _gloffset_EdgeFlagPointerEXT 568
-#define _gloffset_IndexPointerEXT 569
-#define _gloffset_NormalPointerEXT 570
-#define _gloffset_TexCoordPointerEXT 571
-#define _gloffset_VertexPointerEXT 572
-#define _gloffset_PointParameterfEXT 573
-#define _gloffset_PointParameterfvEXT 574
-#define _gloffset_LockArraysEXT 575
-#define _gloffset_UnlockArraysEXT 576
-#define _gloffset_CullParameterdvEXT 577
-#define _gloffset_CullParameterfvEXT 578
-#define _gloffset_SecondaryColor3bEXT 579
-#define _gloffset_SecondaryColor3bvEXT 580
-#define _gloffset_SecondaryColor3dEXT 581
-#define _gloffset_SecondaryColor3dvEXT 582
-#define _gloffset_SecondaryColor3fEXT 583
-#define _gloffset_SecondaryColor3fvEXT 584
-#define _gloffset_SecondaryColor3iEXT 585
-#define _gloffset_SecondaryColor3ivEXT 586
-#define _gloffset_SecondaryColor3sEXT 587
-#define _gloffset_SecondaryColor3svEXT 588
-#define _gloffset_SecondaryColor3ubEXT 589
-#define _gloffset_SecondaryColor3ubvEXT 590
-#define _gloffset_SecondaryColor3uiEXT 591
-#define _gloffset_SecondaryColor3uivEXT 592
-#define _gloffset_SecondaryColor3usEXT 593
-#define _gloffset_SecondaryColor3usvEXT 594
-#define _gloffset_SecondaryColorPointerEXT 595
-#define _gloffset_MultiDrawArraysEXT 596
-#define _gloffset_MultiDrawElementsEXT 597
-#define _gloffset_FogCoordPointerEXT 598
-#define _gloffset_FogCoorddEXT 599
-#define _gloffset_FogCoorddvEXT 600
-#define _gloffset_FogCoordfEXT 601
-#define _gloffset_FogCoordfvEXT 602
-#define _gloffset_PixelTexGenSGIX 603
-#define _gloffset_BlendFuncSeparateEXT 604
-#define _gloffset_FlushVertexArrayRangeNV 605
-#define _gloffset_VertexArrayRangeNV 606
-#define _gloffset_CombinerInputNV 607
-#define _gloffset_CombinerOutputNV 608
-#define _gloffset_CombinerParameterfNV 609
-#define _gloffset_CombinerParameterfvNV 610
-#define _gloffset_CombinerParameteriNV 611
-#define _gloffset_CombinerParameterivNV 612
-#define _gloffset_FinalCombinerInputNV 613
-#define _gloffset_GetCombinerInputParameterfvNV 614
-#define _gloffset_GetCombinerInputParameterivNV 615
-#define _gloffset_GetCombinerOutputParameterfvNV 616
-#define _gloffset_GetCombinerOutputParameterivNV 617
-#define _gloffset_GetFinalCombinerInputParameterfvNV 618
-#define _gloffset_GetFinalCombinerInputParameterivNV 619
-#define _gloffset_ResizeBuffersMESA 620
-#define _gloffset_WindowPos2dMESA 621
-#define _gloffset_WindowPos2dvMESA 622
-#define _gloffset_WindowPos2fMESA 623
-#define _gloffset_WindowPos2fvMESA 624
-#define _gloffset_WindowPos2iMESA 625
-#define _gloffset_WindowPos2ivMESA 626
-#define _gloffset_WindowPos2sMESA 627
-#define _gloffset_WindowPos2svMESA 628
-#define _gloffset_WindowPos3dMESA 629
-#define _gloffset_WindowPos3dvMESA 630
-#define _gloffset_WindowPos3fMESA 631
-#define _gloffset_WindowPos3fvMESA 632
-#define _gloffset_WindowPos3iMESA 633
-#define _gloffset_WindowPos3ivMESA 634
-#define _gloffset_WindowPos3sMESA 635
-#define _gloffset_WindowPos3svMESA 636
-#define _gloffset_WindowPos4dMESA 637
-#define _gloffset_WindowPos4dvMESA 638
-#define _gloffset_WindowPos4fMESA 639
-#define _gloffset_WindowPos4fvMESA 640
-#define _gloffset_WindowPos4iMESA 641
-#define _gloffset_WindowPos4ivMESA 642
-#define _gloffset_WindowPos4sMESA 643
-#define _gloffset_WindowPos4svMESA 644
-#define _gloffset_MultiModeDrawArraysIBM 645
-#define _gloffset_MultiModeDrawElementsIBM 646
-#define _gloffset_DeleteFencesNV 647
-#define _gloffset_FinishFenceNV 648
-#define _gloffset_GenFencesNV 649
-#define _gloffset_GetFenceivNV 650
-#define _gloffset_IsFenceNV 651
-#define _gloffset_SetFenceNV 652
-#define _gloffset_TestFenceNV 653
-#define _gloffset_AreProgramsResidentNV 654
-#define _gloffset_BindProgramNV 655
-#define _gloffset_DeleteProgramsNV 656
-#define _gloffset_ExecuteProgramNV 657
-#define _gloffset_GenProgramsNV 658
-#define _gloffset_GetProgramParameterdvNV 659
-#define _gloffset_GetProgramParameterfvNV 660
-#define _gloffset_GetProgramStringNV 661
-#define _gloffset_GetProgramivNV 662
-#define _gloffset_GetTrackMatrixivNV 663
-#define _gloffset_GetVertexAttribPointervNV 664
-#define _gloffset_GetVertexAttribdvNV 665
-#define _gloffset_GetVertexAttribfvNV 666
-#define _gloffset_GetVertexAttribivNV 667
-#define _gloffset_IsProgramNV 668
-#define _gloffset_LoadProgramNV 669
-#define _gloffset_ProgramParameter4dNV 670
-#define _gloffset_ProgramParameter4dvNV 671
-#define _gloffset_ProgramParameter4fNV 672
-#define _gloffset_ProgramParameter4fvNV 673
-#define _gloffset_ProgramParameters4dvNV 674
-#define _gloffset_ProgramParameters4fvNV 675
-#define _gloffset_RequestResidentProgramsNV 676
-#define _gloffset_TrackMatrixNV 677
-#define _gloffset_VertexAttrib1dNV 678
-#define _gloffset_VertexAttrib1dvNV 679
-#define _gloffset_VertexAttrib1fNV 680
-#define _gloffset_VertexAttrib1fvNV 681
-#define _gloffset_VertexAttrib1sNV 682
-#define _gloffset_VertexAttrib1svNV 683
-#define _gloffset_VertexAttrib2dNV 684
-#define _gloffset_VertexAttrib2dvNV 685
-#define _gloffset_VertexAttrib2fNV 686
-#define _gloffset_VertexAttrib2fvNV 687
-#define _gloffset_VertexAttrib2sNV 688
-#define _gloffset_VertexAttrib2svNV 689
-#define _gloffset_VertexAttrib3dNV 690
-#define _gloffset_VertexAttrib3dvNV 691
-#define _gloffset_VertexAttrib3fNV 692
-#define _gloffset_VertexAttrib3fvNV 693
-#define _gloffset_VertexAttrib3sNV 694
-#define _gloffset_VertexAttrib3svNV 695
-#define _gloffset_VertexAttrib4dNV 696
-#define _gloffset_VertexAttrib4dvNV 697
-#define _gloffset_VertexAttrib4fNV 698
-#define _gloffset_VertexAttrib4fvNV 699
-#define _gloffset_VertexAttrib4sNV 700
-#define _gloffset_VertexAttrib4svNV 701
-#define _gloffset_VertexAttrib4ubNV 702
-#define _gloffset_VertexAttrib4ubvNV 703
-#define _gloffset_VertexAttribPointerNV 704
-#define _gloffset_VertexAttribs1dvNV 705
-#define _gloffset_VertexAttribs1fvNV 706
-#define _gloffset_VertexAttribs1svNV 707
-#define _gloffset_VertexAttribs2dvNV 708
-#define _gloffset_VertexAttribs2fvNV 709
-#define _gloffset_VertexAttribs2svNV 710
-#define _gloffset_VertexAttribs3dvNV 711
-#define _gloffset_VertexAttribs3fvNV 712
-#define _gloffset_VertexAttribs3svNV 713
-#define _gloffset_VertexAttribs4dvNV 714
-#define _gloffset_VertexAttribs4fvNV 715
-#define _gloffset_VertexAttribs4svNV 716
-#define _gloffset_VertexAttribs4ubvNV 717
-#define _gloffset_AlphaFragmentOp1ATI 718
-#define _gloffset_AlphaFragmentOp2ATI 719
-#define _gloffset_AlphaFragmentOp3ATI 720
-#define _gloffset_BeginFragmentShaderATI 721
-#define _gloffset_BindFragmentShaderATI 722
-#define _gloffset_ColorFragmentOp1ATI 723
-#define _gloffset_ColorFragmentOp2ATI 724
-#define _gloffset_ColorFragmentOp3ATI 725
-#define _gloffset_DeleteFragmentShaderATI 726
-#define _gloffset_EndFragmentShaderATI 727
-#define _gloffset_GenFragmentShadersATI 728
-#define _gloffset_PassTexCoordATI 729
-#define _gloffset_SampleMapATI 730
-#define _gloffset_SetFragmentShaderConstantATI 731
-#define _gloffset_PointParameteriNV 732
-#define _gloffset_PointParameterivNV 733
-#define _gloffset_ActiveStencilFaceEXT 734
-#define _gloffset_BindVertexArrayAPPLE 735
-#define _gloffset_DeleteVertexArraysAPPLE 736
-#define _gloffset_GenVertexArraysAPPLE 737
-#define _gloffset_IsVertexArrayAPPLE 738
-#define _gloffset_GetProgramNamedParameterdvNV 739
-#define _gloffset_GetProgramNamedParameterfvNV 740
-#define _gloffset_ProgramNamedParameter4dNV 741
-#define _gloffset_ProgramNamedParameter4dvNV 742
-#define _gloffset_ProgramNamedParameter4fNV 743
-#define _gloffset_ProgramNamedParameter4fvNV 744
-#define _gloffset_DepthBoundsEXT 745
-#define _gloffset_BlendEquationSeparateEXT 746
-#define _gloffset_BindFramebufferEXT 747
-#define _gloffset_BindRenderbufferEXT 748
-#define _gloffset_CheckFramebufferStatusEXT 749
-#define _gloffset_DeleteFramebuffersEXT 750
-#define _gloffset_DeleteRenderbuffersEXT 751
-#define _gloffset_FramebufferRenderbufferEXT 752
-#define _gloffset_FramebufferTexture1DEXT 753
-#define _gloffset_FramebufferTexture2DEXT 754
-#define _gloffset_FramebufferTexture3DEXT 755
-#define _gloffset_GenFramebuffersEXT 756
-#define _gloffset_GenRenderbuffersEXT 757
-#define _gloffset_GenerateMipmapEXT 758
-#define _gloffset_GetFramebufferAttachmentParameterivEXT 759
-#define _gloffset_GetQueryObjecti64vEXT 760
-#define _gloffset_GetQueryObjectui64vEXT 761
-#define _gloffset_GetRenderbufferParameterivEXT 762
-#define _gloffset_IsFramebufferEXT 763
-#define _gloffset_IsRenderbufferEXT 764
-#define _gloffset_RenderbufferStorageEXT 765
-#define _gloffset_BlitFramebufferEXT 766
-#define _gloffset_ProgramEnvParameters4fvEXT 767
-#define _gloffset_ProgramLocalParameters4fvEXT 768
-#define _gloffset_FIRST_DYNAMIC 769
+#define _gloffset_AttachShader 408
+#define _gloffset_CreateProgram 409
+#define _gloffset_CreateShader 410
+#define _gloffset_DeleteProgram 411
+#define _gloffset_DeleteShader 412
+#define _gloffset_DetachShader 413
+#define _gloffset_GetAttachedShaders 414
+#define _gloffset_GetProgramInfoLog 415
+#define _gloffset_GetProgramiv 416
+#define _gloffset_GetShaderInfoLog 417
+#define _gloffset_GetShaderiv 418
+#define _gloffset_IsProgram 419
+#define _gloffset_IsShader 420
+#define _gloffset_StencilFuncSeparate 421
+#define _gloffset_StencilMaskSeparate 422
+#define _gloffset_StencilOpSeparate 423
+#define _gloffset_UniformMatrix2x3fv 424
+#define _gloffset_UniformMatrix2x4fv 425
+#define _gloffset_UniformMatrix3x2fv 426
+#define _gloffset_UniformMatrix3x4fv 427
+#define _gloffset_UniformMatrix4x2fv 428
+#define _gloffset_UniformMatrix4x3fv 429
+#define _gloffset_LoadTransposeMatrixdARB 430
+#define _gloffset_LoadTransposeMatrixfARB 431
+#define _gloffset_MultTransposeMatrixdARB 432
+#define _gloffset_MultTransposeMatrixfARB 433
+#define _gloffset_SampleCoverageARB 434
+#define _gloffset_CompressedTexImage1DARB 435
+#define _gloffset_CompressedTexImage2DARB 436
+#define _gloffset_CompressedTexImage3DARB 437
+#define _gloffset_CompressedTexSubImage1DARB 438
+#define _gloffset_CompressedTexSubImage2DARB 439
+#define _gloffset_CompressedTexSubImage3DARB 440
+#define _gloffset_GetCompressedTexImageARB 441
+#define _gloffset_DisableVertexAttribArrayARB 442
+#define _gloffset_EnableVertexAttribArrayARB 443
+#define _gloffset_GetProgramEnvParameterdvARB 444
+#define _gloffset_GetProgramEnvParameterfvARB 445
+#define _gloffset_GetProgramLocalParameterdvARB 446
+#define _gloffset_GetProgramLocalParameterfvARB 447
+#define _gloffset_GetProgramStringARB 448
+#define _gloffset_GetProgramivARB 449
+#define _gloffset_GetVertexAttribdvARB 450
+#define _gloffset_GetVertexAttribfvARB 451
+#define _gloffset_GetVertexAttribivARB 452
+#define _gloffset_ProgramEnvParameter4dARB 453
+#define _gloffset_ProgramEnvParameter4dvARB 454
+#define _gloffset_ProgramEnvParameter4fARB 455
+#define _gloffset_ProgramEnvParameter4fvARB 456
+#define _gloffset_ProgramLocalParameter4dARB 457
+#define _gloffset_ProgramLocalParameter4dvARB 458
+#define _gloffset_ProgramLocalParameter4fARB 459
+#define _gloffset_ProgramLocalParameter4fvARB 460
+#define _gloffset_ProgramStringARB 461
+#define _gloffset_VertexAttrib1dARB 462
+#define _gloffset_VertexAttrib1dvARB 463
+#define _gloffset_VertexAttrib1fARB 464
+#define _gloffset_VertexAttrib1fvARB 465
+#define _gloffset_VertexAttrib1sARB 466
+#define _gloffset_VertexAttrib1svARB 467
+#define _gloffset_VertexAttrib2dARB 468
+#define _gloffset_VertexAttrib2dvARB 469
+#define _gloffset_VertexAttrib2fARB 470
+#define _gloffset_VertexAttrib2fvARB 471
+#define _gloffset_VertexAttrib2sARB 472
+#define _gloffset_VertexAttrib2svARB 473
+#define _gloffset_VertexAttrib3dARB 474
+#define _gloffset_VertexAttrib3dvARB 475
+#define _gloffset_VertexAttrib3fARB 476
+#define _gloffset_VertexAttrib3fvARB 477
+#define _gloffset_VertexAttrib3sARB 478
+#define _gloffset_VertexAttrib3svARB 479
+#define _gloffset_VertexAttrib4NbvARB 480
+#define _gloffset_VertexAttrib4NivARB 481
+#define _gloffset_VertexAttrib4NsvARB 482
+#define _gloffset_VertexAttrib4NubARB 483
+#define _gloffset_VertexAttrib4NubvARB 484
+#define _gloffset_VertexAttrib4NuivARB 485
+#define _gloffset_VertexAttrib4NusvARB 486
+#define _gloffset_VertexAttrib4bvARB 487
+#define _gloffset_VertexAttrib4dARB 488
+#define _gloffset_VertexAttrib4dvARB 489
+#define _gloffset_VertexAttrib4fARB 490
+#define _gloffset_VertexAttrib4fvARB 491
+#define _gloffset_VertexAttrib4ivARB 492
+#define _gloffset_VertexAttrib4sARB 493
+#define _gloffset_VertexAttrib4svARB 494
+#define _gloffset_VertexAttrib4ubvARB 495
+#define _gloffset_VertexAttrib4uivARB 496
+#define _gloffset_VertexAttrib4usvARB 497
+#define _gloffset_VertexAttribPointerARB 498
+#define _gloffset_BindBufferARB 499
+#define _gloffset_BufferDataARB 500
+#define _gloffset_BufferSubDataARB 501
+#define _gloffset_DeleteBuffersARB 502
+#define _gloffset_GenBuffersARB 503
+#define _gloffset_GetBufferParameterivARB 504
+#define _gloffset_GetBufferPointervARB 505
+#define _gloffset_GetBufferSubDataARB 506
+#define _gloffset_IsBufferARB 507
+#define _gloffset_MapBufferARB 508
+#define _gloffset_UnmapBufferARB 509
+#define _gloffset_BeginQueryARB 510
+#define _gloffset_DeleteQueriesARB 511
+#define _gloffset_EndQueryARB 512
+#define _gloffset_GenQueriesARB 513
+#define _gloffset_GetQueryObjectivARB 514
+#define _gloffset_GetQueryObjectuivARB 515
+#define _gloffset_GetQueryivARB 516
+#define _gloffset_IsQueryARB 517
+#define _gloffset_AttachObjectARB 518
+#define _gloffset_CompileShaderARB 519
+#define _gloffset_CreateProgramObjectARB 520
+#define _gloffset_CreateShaderObjectARB 521
+#define _gloffset_DeleteObjectARB 522
+#define _gloffset_DetachObjectARB 523
+#define _gloffset_GetActiveUniformARB 524
+#define _gloffset_GetAttachedObjectsARB 525
+#define _gloffset_GetHandleARB 526
+#define _gloffset_GetInfoLogARB 527
+#define _gloffset_GetObjectParameterfvARB 528
+#define _gloffset_GetObjectParameterivARB 529
+#define _gloffset_GetShaderSourceARB 530
+#define _gloffset_GetUniformLocationARB 531
+#define _gloffset_GetUniformfvARB 532
+#define _gloffset_GetUniformivARB 533
+#define _gloffset_LinkProgramARB 534
+#define _gloffset_ShaderSourceARB 535
+#define _gloffset_Uniform1fARB 536
+#define _gloffset_Uniform1fvARB 537
+#define _gloffset_Uniform1iARB 538
+#define _gloffset_Uniform1ivARB 539
+#define _gloffset_Uniform2fARB 540
+#define _gloffset_Uniform2fvARB 541
+#define _gloffset_Uniform2iARB 542
+#define _gloffset_Uniform2ivARB 543
+#define _gloffset_Uniform3fARB 544
+#define _gloffset_Uniform3fvARB 545
+#define _gloffset_Uniform3iARB 546
+#define _gloffset_Uniform3ivARB 547
+#define _gloffset_Uniform4fARB 548
+#define _gloffset_Uniform4fvARB 549
+#define _gloffset_Uniform4iARB 550
+#define _gloffset_Uniform4ivARB 551
+#define _gloffset_UniformMatrix2fvARB 552
+#define _gloffset_UniformMatrix3fvARB 553
+#define _gloffset_UniformMatrix4fvARB 554
+#define _gloffset_UseProgramObjectARB 555
+#define _gloffset_ValidateProgramARB 556
+#define _gloffset_BindAttribLocationARB 557
+#define _gloffset_GetActiveAttribARB 558
+#define _gloffset_GetAttribLocationARB 559
+#define _gloffset_DrawBuffersARB 560
+#define _gloffset_PolygonOffsetEXT 561
+#define _gloffset_GetPixelTexGenParameterfvSGIS 562
+#define _gloffset_GetPixelTexGenParameterivSGIS 563
+#define _gloffset_PixelTexGenParameterfSGIS 564
+#define _gloffset_PixelTexGenParameterfvSGIS 565
+#define _gloffset_PixelTexGenParameteriSGIS 566
+#define _gloffset_PixelTexGenParameterivSGIS 567
+#define _gloffset_SampleMaskSGIS 568
+#define _gloffset_SamplePatternSGIS 569
+#define _gloffset_ColorPointerEXT 570
+#define _gloffset_EdgeFlagPointerEXT 571
+#define _gloffset_IndexPointerEXT 572
+#define _gloffset_NormalPointerEXT 573
+#define _gloffset_TexCoordPointerEXT 574
+#define _gloffset_VertexPointerEXT 575
+#define _gloffset_PointParameterfEXT 576
+#define _gloffset_PointParameterfvEXT 577
+#define _gloffset_LockArraysEXT 578
+#define _gloffset_UnlockArraysEXT 579
+#define _gloffset_CullParameterdvEXT 580
+#define _gloffset_CullParameterfvEXT 581
+#define _gloffset_SecondaryColor3bEXT 582
+#define _gloffset_SecondaryColor3bvEXT 583
+#define _gloffset_SecondaryColor3dEXT 584
+#define _gloffset_SecondaryColor3dvEXT 585
+#define _gloffset_SecondaryColor3fEXT 586
+#define _gloffset_SecondaryColor3fvEXT 587
+#define _gloffset_SecondaryColor3iEXT 588
+#define _gloffset_SecondaryColor3ivEXT 589
+#define _gloffset_SecondaryColor3sEXT 590
+#define _gloffset_SecondaryColor3svEXT 591
+#define _gloffset_SecondaryColor3ubEXT 592
+#define _gloffset_SecondaryColor3ubvEXT 593
+#define _gloffset_SecondaryColor3uiEXT 594
+#define _gloffset_SecondaryColor3uivEXT 595
+#define _gloffset_SecondaryColor3usEXT 596
+#define _gloffset_SecondaryColor3usvEXT 597
+#define _gloffset_SecondaryColorPointerEXT 598
+#define _gloffset_MultiDrawArraysEXT 599
+#define _gloffset_MultiDrawElementsEXT 600
+#define _gloffset_FogCoordPointerEXT 601
+#define _gloffset_FogCoorddEXT 602
+#define _gloffset_FogCoorddvEXT 603
+#define _gloffset_FogCoordfEXT 604
+#define _gloffset_FogCoordfvEXT 605
+#define _gloffset_PixelTexGenSGIX 606
+#define _gloffset_BlendFuncSeparateEXT 607
+#define _gloffset_FlushVertexArrayRangeNV 608
+#define _gloffset_VertexArrayRangeNV 609
+#define _gloffset_CombinerInputNV 610
+#define _gloffset_CombinerOutputNV 611
+#define _gloffset_CombinerParameterfNV 612
+#define _gloffset_CombinerParameterfvNV 613
+#define _gloffset_CombinerParameteriNV 614
+#define _gloffset_CombinerParameterivNV 615
+#define _gloffset_FinalCombinerInputNV 616
+#define _gloffset_GetCombinerInputParameterfvNV 617
+#define _gloffset_GetCombinerInputParameterivNV 618
+#define _gloffset_GetCombinerOutputParameterfvNV 619
+#define _gloffset_GetCombinerOutputParameterivNV 620
+#define _gloffset_GetFinalCombinerInputParameterfvNV 621
+#define _gloffset_GetFinalCombinerInputParameterivNV 622
+#define _gloffset_ResizeBuffersMESA 623
+#define _gloffset_WindowPos2dMESA 624
+#define _gloffset_WindowPos2dvMESA 625
+#define _gloffset_WindowPos2fMESA 626
+#define _gloffset_WindowPos2fvMESA 627
+#define _gloffset_WindowPos2iMESA 628
+#define _gloffset_WindowPos2ivMESA 629
+#define _gloffset_WindowPos2sMESA 630
+#define _gloffset_WindowPos2svMESA 631
+#define _gloffset_WindowPos3dMESA 632
+#define _gloffset_WindowPos3dvMESA 633
+#define _gloffset_WindowPos3fMESA 634
+#define _gloffset_WindowPos3fvMESA 635
+#define _gloffset_WindowPos3iMESA 636
+#define _gloffset_WindowPos3ivMESA 637
+#define _gloffset_WindowPos3sMESA 638
+#define _gloffset_WindowPos3svMESA 639
+#define _gloffset_WindowPos4dMESA 640
+#define _gloffset_WindowPos4dvMESA 641
+#define _gloffset_WindowPos4fMESA 642
+#define _gloffset_WindowPos4fvMESA 643
+#define _gloffset_WindowPos4iMESA 644
+#define _gloffset_WindowPos4ivMESA 645
+#define _gloffset_WindowPos4sMESA 646
+#define _gloffset_WindowPos4svMESA 647
+#define _gloffset_MultiModeDrawArraysIBM 648
+#define _gloffset_MultiModeDrawElementsIBM 649
+#define _gloffset_DeleteFencesNV 650
+#define _gloffset_FinishFenceNV 651
+#define _gloffset_GenFencesNV 652
+#define _gloffset_GetFenceivNV 653
+#define _gloffset_IsFenceNV 654
+#define _gloffset_SetFenceNV 655
+#define _gloffset_TestFenceNV 656
+#define _gloffset_AreProgramsResidentNV 657
+#define _gloffset_BindProgramNV 658
+#define _gloffset_DeleteProgramsNV 659
+#define _gloffset_ExecuteProgramNV 660
+#define _gloffset_GenProgramsNV 661
+#define _gloffset_GetProgramParameterdvNV 662
+#define _gloffset_GetProgramParameterfvNV 663
+#define _gloffset_GetProgramStringNV 664
+#define _gloffset_GetProgramivNV 665
+#define _gloffset_GetTrackMatrixivNV 666
+#define _gloffset_GetVertexAttribPointervNV 667
+#define _gloffset_GetVertexAttribdvNV 668
+#define _gloffset_GetVertexAttribfvNV 669
+#define _gloffset_GetVertexAttribivNV 670
+#define _gloffset_IsProgramNV 671
+#define _gloffset_LoadProgramNV 672
+#define _gloffset_ProgramParameter4dNV 673
+#define _gloffset_ProgramParameter4dvNV 674
+#define _gloffset_ProgramParameter4fNV 675
+#define _gloffset_ProgramParameter4fvNV 676
+#define _gloffset_ProgramParameters4dvNV 677
+#define _gloffset_ProgramParameters4fvNV 678
+#define _gloffset_RequestResidentProgramsNV 679
+#define _gloffset_TrackMatrixNV 680
+#define _gloffset_VertexAttrib1dNV 681
+#define _gloffset_VertexAttrib1dvNV 682
+#define _gloffset_VertexAttrib1fNV 683
+#define _gloffset_VertexAttrib1fvNV 684
+#define _gloffset_VertexAttrib1sNV 685
+#define _gloffset_VertexAttrib1svNV 686
+#define _gloffset_VertexAttrib2dNV 687
+#define _gloffset_VertexAttrib2dvNV 688
+#define _gloffset_VertexAttrib2fNV 689
+#define _gloffset_VertexAttrib2fvNV 690
+#define _gloffset_VertexAttrib2sNV 691
+#define _gloffset_VertexAttrib2svNV 692
+#define _gloffset_VertexAttrib3dNV 693
+#define _gloffset_VertexAttrib3dvNV 694
+#define _gloffset_VertexAttrib3fNV 695
+#define _gloffset_VertexAttrib3fvNV 696
+#define _gloffset_VertexAttrib3sNV 697
+#define _gloffset_VertexAttrib3svNV 698
+#define _gloffset_VertexAttrib4dNV 699
+#define _gloffset_VertexAttrib4dvNV 700
+#define _gloffset_VertexAttrib4fNV 701
+#define _gloffset_VertexAttrib4fvNV 702
+#define _gloffset_VertexAttrib4sNV 703
+#define _gloffset_VertexAttrib4svNV 704
+#define _gloffset_VertexAttrib4ubNV 705
+#define _gloffset_VertexAttrib4ubvNV 706
+#define _gloffset_VertexAttribPointerNV 707
+#define _gloffset_VertexAttribs1dvNV 708
+#define _gloffset_VertexAttribs1fvNV 709
+#define _gloffset_VertexAttribs1svNV 710
+#define _gloffset_VertexAttribs2dvNV 711
+#define _gloffset_VertexAttribs2fvNV 712
+#define _gloffset_VertexAttribs2svNV 713
+#define _gloffset_VertexAttribs3dvNV 714
+#define _gloffset_VertexAttribs3fvNV 715
+#define _gloffset_VertexAttribs3svNV 716
+#define _gloffset_VertexAttribs4dvNV 717
+#define _gloffset_VertexAttribs4fvNV 718
+#define _gloffset_VertexAttribs4svNV 719
+#define _gloffset_VertexAttribs4ubvNV 720
+#define _gloffset_AlphaFragmentOp1ATI 721
+#define _gloffset_AlphaFragmentOp2ATI 722
+#define _gloffset_AlphaFragmentOp3ATI 723
+#define _gloffset_BeginFragmentShaderATI 724
+#define _gloffset_BindFragmentShaderATI 725
+#define _gloffset_ColorFragmentOp1ATI 726
+#define _gloffset_ColorFragmentOp2ATI 727
+#define _gloffset_ColorFragmentOp3ATI 728
+#define _gloffset_DeleteFragmentShaderATI 729
+#define _gloffset_EndFragmentShaderATI 730
+#define _gloffset_GenFragmentShadersATI 731
+#define _gloffset_PassTexCoordATI 732
+#define _gloffset_SampleMapATI 733
+#define _gloffset_SetFragmentShaderConstantATI 734
+#define _gloffset_PointParameteriNV 735
+#define _gloffset_PointParameterivNV 736
+#define _gloffset_ActiveStencilFaceEXT 737
+#define _gloffset_BindVertexArrayAPPLE 738
+#define _gloffset_DeleteVertexArraysAPPLE 739
+#define _gloffset_GenVertexArraysAPPLE 740
+#define _gloffset_IsVertexArrayAPPLE 741
+#define _gloffset_GetProgramNamedParameterdvNV 742
+#define _gloffset_GetProgramNamedParameterfvNV 743
+#define _gloffset_ProgramNamedParameter4dNV 744
+#define _gloffset_ProgramNamedParameter4dvNV 745
+#define _gloffset_ProgramNamedParameter4fNV 746
+#define _gloffset_ProgramNamedParameter4fvNV 747
+#define _gloffset_DepthBoundsEXT 748
+#define _gloffset_BlendEquationSeparateEXT 749
+#define _gloffset_BindFramebufferEXT 750
+#define _gloffset_BindRenderbufferEXT 751
+#define _gloffset_CheckFramebufferStatusEXT 752
+#define _gloffset_DeleteFramebuffersEXT 753
+#define _gloffset_DeleteRenderbuffersEXT 754
+#define _gloffset_FramebufferRenderbufferEXT 755
+#define _gloffset_FramebufferTexture1DEXT 756
+#define _gloffset_FramebufferTexture2DEXT 757
+#define _gloffset_FramebufferTexture3DEXT 758
+#define _gloffset_GenFramebuffersEXT 759
+#define _gloffset_GenRenderbuffersEXT 760
+#define _gloffset_GenerateMipmapEXT 761
+#define _gloffset_GetFramebufferAttachmentParameterivEXT 762
+#define _gloffset_GetRenderbufferParameterivEXT 763
+#define _gloffset_IsFramebufferEXT 764
+#define _gloffset_IsRenderbufferEXT 765
+#define _gloffset_RenderbufferStorageEXT 766
+#define _gloffset_BlitFramebufferEXT 767
+#define _gloffset_ProgramEnvParameters4fvEXT 768
+#define _gloffset_ProgramLocalParameters4fvEXT 769
+#define _gloffset_GetQueryObjecti64vEXT 770
+#define _gloffset_GetQueryObjectui64vEXT 771
+#define _gloffset_FIRST_DYNAMIC 772
#else
+#define _gloffset_AttachShader driDispatchRemapTable[AttachShader_remap_index]
+#define _gloffset_CreateProgram driDispatchRemapTable[CreateProgram_remap_index]
+#define _gloffset_CreateShader driDispatchRemapTable[CreateShader_remap_index]
+#define _gloffset_DeleteProgram driDispatchRemapTable[DeleteProgram_remap_index]
+#define _gloffset_DeleteShader driDispatchRemapTable[DeleteShader_remap_index]
+#define _gloffset_DetachShader driDispatchRemapTable[DetachShader_remap_index]
+#define _gloffset_GetAttachedShaders driDispatchRemapTable[GetAttachedShaders_remap_index]
+#define _gloffset_GetProgramInfoLog driDispatchRemapTable[GetProgramInfoLog_remap_index]
+#define _gloffset_GetProgramiv driDispatchRemapTable[GetProgramiv_remap_index]
+#define _gloffset_GetShaderInfoLog driDispatchRemapTable[GetShaderInfoLog_remap_index]
+#define _gloffset_GetShaderiv driDispatchRemapTable[GetShaderiv_remap_index]
+#define _gloffset_IsProgram driDispatchRemapTable[IsProgram_remap_index]
+#define _gloffset_IsShader driDispatchRemapTable[IsShader_remap_index]
#define _gloffset_StencilFuncSeparate driDispatchRemapTable[StencilFuncSeparate_remap_index]
#define _gloffset_StencilMaskSeparate driDispatchRemapTable[StencilMaskSeparate_remap_index]
#define _gloffset_StencilOpSeparate driDispatchRemapTable[StencilOpSeparate_remap_index]
+#define _gloffset_UniformMatrix2x3fv driDispatchRemapTable[UniformMatrix2x3fv_remap_index]
+#define _gloffset_UniformMatrix2x4fv driDispatchRemapTable[UniformMatrix2x4fv_remap_index]
+#define _gloffset_UniformMatrix3x2fv driDispatchRemapTable[UniformMatrix3x2fv_remap_index]
+#define _gloffset_UniformMatrix3x4fv driDispatchRemapTable[UniformMatrix3x4fv_remap_index]
+#define _gloffset_UniformMatrix4x2fv driDispatchRemapTable[UniformMatrix4x2fv_remap_index]
+#define _gloffset_UniformMatrix4x3fv driDispatchRemapTable[UniformMatrix4x3fv_remap_index]
#define _gloffset_LoadTransposeMatrixdARB driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]
#define _gloffset_LoadTransposeMatrixfARB driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]
#define _gloffset_MultTransposeMatrixdARB driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]
@@ -940,28 +962,12 @@
#define _gloffset_GetAttribLocationARB driDispatchRemapTable[GetAttribLocationARB_remap_index]
#define _gloffset_DrawBuffersARB driDispatchRemapTable[DrawBuffersARB_remap_index]
#define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index]
-#define _gloffset_GetHistogramEXT driDispatchRemapTable[GetHistogramEXT_remap_index]
-#define _gloffset_GetHistogramParameterfvEXT driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index]
-#define _gloffset_GetHistogramParameterivEXT driDispatchRemapTable[GetHistogramParameterivEXT_remap_index]
-#define _gloffset_GetMinmaxEXT driDispatchRemapTable[GetMinmaxEXT_remap_index]
-#define _gloffset_GetMinmaxParameterfvEXT driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index]
-#define _gloffset_GetMinmaxParameterivEXT driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index]
-#define _gloffset_GetConvolutionFilterEXT driDispatchRemapTable[GetConvolutionFilterEXT_remap_index]
-#define _gloffset_GetConvolutionParameterfvEXT driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index]
-#define _gloffset_GetConvolutionParameterivEXT driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index]
-#define _gloffset_GetSeparableFilterEXT driDispatchRemapTable[GetSeparableFilterEXT_remap_index]
-#define _gloffset_GetColorTableParameterfvSGI driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index]
-#define _gloffset_GetColorTableParameterivSGI driDispatchRemapTable[GetColorTableParameterivSGI_remap_index]
-#define _gloffset_GetColorTableSGI driDispatchRemapTable[GetColorTableSGI_remap_index]
#define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]
#define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]
#define _gloffset_PixelTexGenParameterfSGIS driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index]
#define _gloffset_PixelTexGenParameterfvSGIS driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index]
#define _gloffset_PixelTexGenParameteriSGIS driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index]
#define _gloffset_PixelTexGenParameterivSGIS driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]
-#define _gloffset_AreTexturesResidentEXT driDispatchRemapTable[AreTexturesResidentEXT_remap_index]
-#define _gloffset_GenTexturesEXT driDispatchRemapTable[GenTexturesEXT_remap_index]
-#define _gloffset_IsTextureEXT driDispatchRemapTable[IsTextureEXT_remap_index]
#define _gloffset_SampleMaskSGIS driDispatchRemapTable[SampleMaskSGIS_remap_index]
#define _gloffset_SamplePatternSGIS driDispatchRemapTable[SamplePatternSGIS_remap_index]
#define _gloffset_ColorPointerEXT driDispatchRemapTable[ColorPointerEXT_remap_index]
@@ -1157,8 +1163,6 @@
#define _gloffset_GenRenderbuffersEXT driDispatchRemapTable[GenRenderbuffersEXT_remap_index]
#define _gloffset_GenerateMipmapEXT driDispatchRemapTable[GenerateMipmapEXT_remap_index]
#define _gloffset_GetFramebufferAttachmentParameterivEXT driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]
-#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]
-#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]
#define _gloffset_GetRenderbufferParameterivEXT driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]
#define _gloffset_IsFramebufferEXT driDispatchRemapTable[IsFramebufferEXT_remap_index]
#define _gloffset_IsRenderbufferEXT driDispatchRemapTable[IsRenderbufferEXT_remap_index]
@@ -1166,6 +1170,8 @@
#define _gloffset_BlitFramebufferEXT driDispatchRemapTable[BlitFramebufferEXT_remap_index]
#define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]
#define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]
+#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]
+#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]
#endif /* !defined(IN_DRI_DRIVER) */
diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h
index e4b36958896..026af32af8f 100644
--- a/src/mesa/glapi/glapitable.h
+++ b/src/mesa/glapi/glapitable.h
@@ -445,367 +445,370 @@ struct _glapi_table
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
- void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 408 */
- void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 409 */
- void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 410 */
- void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 411 */
- void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 412 */
- void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 413 */
- void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 414 */
- void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 415 */
- void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 416 */
- void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 417 */
- void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 418 */
- void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 419 */
- void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 420 */
- void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 421 */
- void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 422 */
- void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 423 */
- void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 424 */
- void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 425 */
- void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 426 */
- void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 427 */
- void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 428 */
- void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 429 */
- void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 430 */
- void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 431 */
- void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 432 */
- void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 433 */
- void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 434 */
- void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 435 */
- void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 436 */
- void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 437 */
- void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 438 */
- void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 439 */
- void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 440 */
- void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 441 */
- void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 442 */
- void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 443 */
- void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 444 */
- void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 445 */
- void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 446 */
- void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 447 */
- void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 448 */
- void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 449 */
- void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 450 */
- void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 451 */
- void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 452 */
- void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 453 */
- void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 454 */
- void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 455 */
- void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 456 */
- void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 457 */
- void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 458 */
- void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 459 */
- void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 460 */
- void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 461 */
- void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 462 */
- void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 463 */
- void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 464 */
- void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 465 */
- void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 466 */
- void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 467 */
- void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 468 */
- void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 469 */
- void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 470 */
- void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 471 */
- void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 472 */
- void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 473 */
- void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 474 */
- void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 475 */
- void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 476 */
- void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 477 */
- void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 478 */
- void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 479 */
- void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 480 */
- void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 481 */
- void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 482 */
- void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 483 */
- void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 484 */
- void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 485 */
- void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 486 */
- void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 487 */
- GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 488 */
- GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 489 */
- GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 490 */
- void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 491 */
- void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 492 */
- void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 493 */
- void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 494 */
- void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 495 */
- void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 496 */
- void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 497 */
- GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 498 */
- void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 499 */
- void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shaderObj); /* 500 */
- GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 501 */
- GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 502 */
- void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 503 */
- void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 504 */
- void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 505 */
- void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 506 */
- GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 507 */
- void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 508 */
- void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 509 */
- void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 510 */
- void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); /* 511 */
- GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 512 */
- void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat * params); /* 513 */
- void (GLAPIENTRYP GetUniformivARB)(GLhandleARB programObj, GLint location, GLint * params); /* 514 */
- void (GLAPIENTRYP LinkProgramARB)(GLhandleARB programObj); /* 515 */
- void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint * length); /* 516 */
- void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 517 */
- void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 518 */
- void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 519 */
- void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 520 */
- void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 521 */
- void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 522 */
- void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 523 */
- void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 524 */
- void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 525 */
- void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 526 */
- void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 527 */
- void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 528 */
- void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 529 */
- void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 530 */
- void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 531 */
- void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 532 */
- void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 533 */
- void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 534 */
- void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 535 */
- void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB programObj); /* 536 */
- void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB programObj); /* 537 */
- void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB * name); /* 538 */
- void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 539 */
- GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 540 */
- void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 541 */
- void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 542 */
- void (GLAPIENTRYP GetHistogramEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 543 */
- void (GLAPIENTRYP GetHistogramParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 544 */
- void (GLAPIENTRYP GetHistogramParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 545 */
- void (GLAPIENTRYP GetMinmaxEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 546 */
- void (GLAPIENTRYP GetMinmaxParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 547 */
- void (GLAPIENTRYP GetMinmaxParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 548 */
- void (GLAPIENTRYP GetConvolutionFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 549 */
- void (GLAPIENTRYP GetConvolutionParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 550 */
- void (GLAPIENTRYP GetConvolutionParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 551 */
- void (GLAPIENTRYP GetSeparableFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 552 */
- void (GLAPIENTRYP GetColorTableParameterfvSGI)(GLenum target, GLenum pname, GLfloat * params); /* 553 */
- void (GLAPIENTRYP GetColorTableParameterivSGI)(GLenum target, GLenum pname, GLint * params); /* 554 */
- void (GLAPIENTRYP GetColorTableSGI)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 555 */
- void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 556 */
- void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 557 */
- void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 558 */
- void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 559 */
- void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 560 */
- void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 561 */
- GLboolean (GLAPIENTRYP AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 562 */
- void (GLAPIENTRYP GenTexturesEXT)(GLsizei n, GLuint * textures); /* 563 */
- GLboolean (GLAPIENTRYP IsTextureEXT)(GLuint texture); /* 564 */
- void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 565 */
- void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 566 */
- void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 567 */
- void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 568 */
- void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 569 */
- void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */
- void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 571 */
- void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */
- void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 573 */
- void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 574 */
- void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 575 */
- void (GLAPIENTRYP UnlockArraysEXT)(void); /* 576 */
- void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 577 */
- void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 578 */
- void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 579 */
- void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 580 */
- void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 581 */
- void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 582 */
- void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 583 */
- void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 584 */
- void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 585 */
- void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 586 */
- void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 587 */
- void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 588 */
- void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 589 */
- void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 590 */
- void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 591 */
- void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 592 */
- void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 593 */
- void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 594 */
- void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 595 */
- void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 596 */
- void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 597 */
- void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */
- void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 599 */
- void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 600 */
- void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 601 */
- void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 602 */
- void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 603 */
- void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 604 */
- void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 605 */
- void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 606 */
- void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 607 */
- void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 608 */
- void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 609 */
- void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 610 */
- void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 611 */
- void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 612 */
- void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 613 */
- void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 614 */
- void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 615 */
- void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 616 */
- void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 617 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 618 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 619 */
- void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 620 */
- void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 621 */
- void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 622 */
- void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 623 */
- void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 624 */
- void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 625 */
- void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 626 */
- void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 627 */
- void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 628 */
- void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 629 */
- void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 630 */
- void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 631 */
- void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 632 */
- void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 633 */
- void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 634 */
- void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 635 */
- void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 636 */
- void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 637 */
- void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 638 */
- void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 639 */
- void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 640 */
- void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 641 */
- void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 642 */
- void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 643 */
- void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 644 */
- void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 645 */
- void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 646 */
- void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 647 */
- void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 648 */
- void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 649 */
- void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 650 */
- GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 651 */
- void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 652 */
- GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 653 */
- GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 654 */
- void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 655 */
- void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 656 */
- void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 657 */
- void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 658 */
- void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 659 */
- void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 660 */
- void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 661 */
- void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 662 */
- void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 663 */
- void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** params); /* 664 */
- void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 665 */
- void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 666 */
- void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 667 */
- GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 668 */
- void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 669 */
- void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 670 */
- void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 671 */
- void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 672 */
- void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 673 */
- void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 674 */
- void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 675 */
- void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 676 */
- void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 677 */
- void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 678 */
- void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 679 */
- void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 680 */
- void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 681 */
- void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 682 */
- void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 683 */
- void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 684 */
- void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 685 */
- void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 686 */
- void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 687 */
- void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 688 */
- void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 689 */
- void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 690 */
- void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 691 */
- void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 692 */
- void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 693 */
- void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 694 */
- void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 695 */
- void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 696 */
- void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 697 */
- void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 698 */
- void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 699 */
- void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 700 */
- void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 701 */
- void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 702 */
- void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 703 */
- void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 704 */
- void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 705 */
- void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 706 */
- void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 707 */
- void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */
- void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */
- void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */
- void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */
- void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */
- void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */
- void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */
- void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */
- void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */
- void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 717 */
- void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 718 */
- void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 719 */
- void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 720 */
- void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 721 */
- void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 722 */
- void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 723 */
- void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 724 */
- void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 725 */
- void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 726 */
- void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 727 */
- GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 728 */
- void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 729 */
- void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 730 */
- void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 731 */
- void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 732 */
- void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 733 */
- void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 734 */
- void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 735 */
- void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 736 */
- void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 737 */
- GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 738 */
- void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 739 */
- void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 740 */
- void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 741 */
- void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 742 */
- void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 743 */
- void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 744 */
- void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 745 */
- void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 746 */
- void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 747 */
- void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 748 */
- GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 749 */
- void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 750 */
- void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 751 */
- void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 752 */
- void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */
- void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 754 */
- void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 755 */
- void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 756 */
- void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 757 */
- void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 758 */
- void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 759 */
- void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 760 */
- void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 761 */
- void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 762 */
- GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 763 */
- GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 764 */
- void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 765 */
- void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 766 */
- void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */
- void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */
+ void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
+ GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
+ GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
+ void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
+ void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
+ void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
+ void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
+ void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
+ void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
+ void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
+ void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
+ GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
+ GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
+ void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
+ void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
+ void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 423 */
+ void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
+ void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
+ void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
+ void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
+ void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
+ void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
+ void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 430 */
+ void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 431 */
+ void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 432 */
+ void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 433 */
+ void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 434 */
+ void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 435 */
+ void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 436 */
+ void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */
+ void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 438 */
+ void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 439 */
+ void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */
+ void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 441 */
+ void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 442 */
+ void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 443 */
+ void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 444 */
+ void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 445 */
+ void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */
+ void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */
+ void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 448 */
+ void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 449 */
+ void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 450 */
+ void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 451 */
+ void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 452 */
+ void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 453 */
+ void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 454 */
+ void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 455 */
+ void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 456 */
+ void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 457 */
+ void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 458 */
+ void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 459 */
+ void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 460 */
+ void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 461 */
+ void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 462 */
+ void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 463 */
+ void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 464 */
+ void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 465 */
+ void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 466 */
+ void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 467 */
+ void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 468 */
+ void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 469 */
+ void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 470 */
+ void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 471 */
+ void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 472 */
+ void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 473 */
+ void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 474 */
+ void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 475 */
+ void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 476 */
+ void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 477 */
+ void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 478 */
+ void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 479 */
+ void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 480 */
+ void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 481 */
+ void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 482 */
+ void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 483 */
+ void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 484 */
+ void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 485 */
+ void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 486 */
+ void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 487 */
+ void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 488 */
+ void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 489 */
+ void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 490 */
+ void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 491 */
+ void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 492 */
+ void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 493 */
+ void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 494 */
+ void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 495 */
+ void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 496 */
+ void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 497 */
+ void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 498 */
+ void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 499 */
+ void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 500 */
+ void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 501 */
+ void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 502 */
+ void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 503 */
+ void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 504 */
+ void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 505 */
+ void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 506 */
+ GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 507 */
+ GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 508 */
+ GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 509 */
+ void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 510 */
+ void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 511 */
+ void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 512 */
+ void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 513 */
+ void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 514 */
+ void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 515 */
+ void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 516 */
+ GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 517 */
+ void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 518 */
+ void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 519 */
+ GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 520 */
+ GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 521 */
+ void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 522 */
+ void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 523 */
+ void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 524 */
+ void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 525 */
+ GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 526 */
+ void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 527 */
+ void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 528 */
+ void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 529 */
+ void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 530 */
+ GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 531 */
+ void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 532 */
+ void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 533 */
+ void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 534 */
+ void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 535 */
+ void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 536 */
+ void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 537 */
+ void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 538 */
+ void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 539 */
+ void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 540 */
+ void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 541 */
+ void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 542 */
+ void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 543 */
+ void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 544 */
+ void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 545 */
+ void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 546 */
+ void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 547 */
+ void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 548 */
+ void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 549 */
+ void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 550 */
+ void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 551 */
+ void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 552 */
+ void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 553 */
+ void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */
+ void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 555 */
+ void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 556 */
+ void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 557 */
+ void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */
+ GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */
+ void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */
+ void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */
+ void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */
+ void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */
+ void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */
+ void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */
+ void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */
+ void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */
+ void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */
+ void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */
+ void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */
+ void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */
+ void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */
+ void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */
+ void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */
+ void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */
+ void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */
+ void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */
+ void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */
+ void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */
+ void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */
+ void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */
+ void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */
+ void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */
+ void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */
+ void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */
+ void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */
+ void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */
+ void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */
+ void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */
+ void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */
+ void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */
+ void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */
+ void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */
+ void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */
+ void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */
+ void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */
+ void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */
+ void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */
+ void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */
+ void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */
+ void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */
+ void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */
+ void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */
+ void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */
+ void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */
+ void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */
+ void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */
+ void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */
+ void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */
+ void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */
+ void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */
+ void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */
+ void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */
+ void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */
+ void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */
+ void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */
+ void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */
+ void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */
+ void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */
+ void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */
+ void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */
+ void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */
+ void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */
+ void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */
+ void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */
+ void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */
+ void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */
+ void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */
+ void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */
+ void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */
+ void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */
+ void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */
+ void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */
+ void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */
+ void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */
+ void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */
+ void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */
+ void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */
+ void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */
+ void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */
+ void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */
+ void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */
+ void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */
+ void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */
+ void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */
+ void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */
+ void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */
+ void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */
+ void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */
+ void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */
+ void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */
+ GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */
+ void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */
+ GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */
+ GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */
+ void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */
+ void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */
+ void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */
+ void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */
+ void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */
+ void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */
+ void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */
+ void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */
+ void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */
+ void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** params); /* 667 */
+ void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */
+ void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */
+ void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */
+ GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */
+ void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */
+ void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 673 */
+ void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 674 */
+ void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 675 */
+ void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 676 */
+ void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 677 */
+ void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 678 */
+ void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 679 */
+ void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 680 */
+ void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 681 */
+ void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 682 */
+ void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 683 */
+ void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 684 */
+ void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 685 */
+ void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 686 */
+ void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 687 */
+ void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 688 */
+ void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 689 */
+ void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 690 */
+ void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 691 */
+ void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 692 */
+ void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 693 */
+ void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 694 */
+ void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 695 */
+ void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 696 */
+ void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 697 */
+ void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 698 */
+ void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 699 */
+ void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 700 */
+ void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 701 */
+ void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 702 */
+ void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 703 */
+ void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 704 */
+ void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 705 */
+ void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 706 */
+ void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 707 */
+ void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */
+ void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */
+ void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */
+ void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */
+ void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */
+ void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */
+ void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */
+ void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */
+ void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */
+ void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 717 */
+ void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 718 */
+ void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 719 */
+ void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 720 */
+ void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 721 */
+ void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 722 */
+ void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 723 */
+ void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 724 */
+ void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 725 */
+ void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 726 */
+ void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 727 */
+ void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 728 */
+ void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 729 */
+ void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 730 */
+ GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 731 */
+ void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 732 */
+ void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 733 */
+ void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 734 */
+ void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 735 */
+ void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 736 */
+ void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 737 */
+ void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 738 */
+ void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 739 */
+ void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 740 */
+ GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 741 */
+ void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 742 */
+ void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 743 */
+ void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 744 */
+ void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 745 */
+ void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 746 */
+ void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 747 */
+ void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 748 */
+ void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 749 */
+ void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 750 */
+ void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 751 */
+ GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 752 */
+ void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 753 */
+ void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 754 */
+ void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 755 */
+ void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 756 */
+ void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 757 */
+ void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 758 */
+ void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 759 */
+ void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 760 */
+ void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 761 */
+ void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 762 */
+ void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 763 */
+ GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 764 */
+ GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 765 */
+ void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 766 */
+ void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 767 */
+ void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */
+ void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 769 */
+ void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 770 */
+ void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 771 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */
diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h
index bdf66880d1b..340a4f6a040 100644
--- a/src/mesa/glapi/glapitemp.h
+++ b/src/mesa/glapi/glapitemp.h
@@ -1710,6 +1710,13 @@ KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint *
RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
{
DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
@@ -1755,16 +1762,25 @@ KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures)
DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures));
}
+#ifndef GLX_INDIRECT_RENDERING
KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures)
{
DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures));
}
+#endif /* GLX_INDIRECT_RENDERING */
KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures)
{
DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
+{
+ DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params)
{
DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params));
@@ -1780,6 +1796,13 @@ KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
{
DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
@@ -1908,16 +1931,64 @@ KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum
DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
{
DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
@@ -2043,21 +2114,57 @@ KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format,
DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image)
+{
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
{
DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
+{
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
{
DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
@@ -2075,31 +2182,85 @@ KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum
DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
{
DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
{
DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
@@ -2518,6 +2679,71 @@ KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort *
DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void)
+{
+ RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n"));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type)
+{
+ RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program)
+{
+ DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program)
+{
+ DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj)
+{
+ DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params)
+{
+ DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader)
+{
+ RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader));
+}
+
KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
{
DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask));
@@ -2533,6 +2759,36 @@ KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum fail, GLenum
DISPATCH(StencilOpSeparate, (face, fail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, fail, zfail, zpass));
}
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m)
{
DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m));
@@ -2653,11 +2909,21 @@ KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level
DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img));
}
+KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index));
+}
+
KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index)
{
DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index));
}
+KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index));
+}
+
KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index)
{
DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index));
@@ -2693,16 +2959,31 @@ KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint
DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params)
{
DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params)
{
DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params)
{
DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
@@ -2753,126 +3034,251 @@ KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsi
DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x)
{
DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x)
{
DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x)
{
DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y)
{
DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
{
DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y)
{
DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
{
DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z)
{
DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v)
{
DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v)
{
DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
{
DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v)
{
DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v)
{
DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v)
{
DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v));
@@ -2883,21 +3289,41 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v)
DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v));
@@ -2908,11 +3334,21 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v)
DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
{
DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v));
@@ -2933,6 +3369,11 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort *
DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
{
DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
@@ -3133,9 +3574,14 @@ KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleA
DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj));
}
-KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shaderObj)
+KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader)
{
- DISPATCH(CompileShaderARB, (shaderObj), (F, "glCompileShaderARB(%d);\n", shaderObj));
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader)
+{
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader));
}
KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void)
@@ -3158,9 +3604,14 @@ KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleA
DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj));
}
-KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
+{
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
{
- DISPATCH(GetActiveUniformARB, (programObj, index, maxLength, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", programObj, index, maxLength, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
}
KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog)
@@ -3188,34 +3639,69 @@ KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pna
DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source)
+KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params)
+{
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params)
{
- DISPATCH(GetShaderSourceARB, (obj, maxLength, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) source));
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params));
}
-KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB programObj, const GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params)
{
- RETURN_DISPATCH(GetUniformLocationARB, (programObj, name), (F, "glGetUniformLocationARB(%d, %p);\n", programObj, (const void *) name));
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params)
{
- DISPATCH(GetUniformfvARB, (programObj, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", programObj, location, (const void *) params));
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB programObj, GLint location, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program)
{
- DISPATCH(GetUniformivARB, (programObj, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", programObj, location, (const void *) params));
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program));
}
-KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB programObj)
+KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program)
{
- DISPATCH(LinkProgramARB, (programObj), (F, "glLinkProgramARB(%d);\n", programObj));
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program));
}
-KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint * length)
+KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length)
{
- DISPATCH(ShaderSourceARB, (shaderObj, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shaderObj, count, (const void *) string, (const void *) length));
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length)
+{
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0)
+{
+ DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0));
}
KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0)
@@ -3223,314 +3709,308 @@ KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0)
DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0)
+{
+ DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0)
{
DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value)
{
DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1)
+{
+ DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1)
{
DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1)
+{
+ DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1)
{
DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value)
{
DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
- DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2));
+ DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value)
+KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
- DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+ DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
+KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value)
{
- DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2));
+ DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value)
+KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
- DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+ DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
{
- DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
+ DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value)
+KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
{
- DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+ DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value)
{
- DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
+ DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value)
+KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value)
{
- DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+ DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
- DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+ DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
}
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
- DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+ DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
}
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value)
{
- DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+ DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB programObj)
+KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
- DISPATCH(UseProgramObjectARB, (programObj), (F, "glUseProgramObjectARB(%d);\n", programObj));
+ DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB programObj)
+KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
- DISPATCH(ValidateProgramARB, (programObj), (F, "glValidateProgramARB(%d);\n", programObj));
+ DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
}
-KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
- DISPATCH(BindAttribLocationARB, (programObj, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", programObj, index, (const void *) name));
+ DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
}
-KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value)
{
- DISPATCH(GetActiveAttribARB, (programObj, index, maxLength, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", programObj, index, maxLength, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+ DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB programObj, const GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value)
{
- RETURN_DISPATCH(GetAttribLocationARB, (programObj, name), (F, "glGetAttribLocationARB(%d, %p);\n", programObj, (const void *) name));
+ DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs)
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
- DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs));
+ DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs)
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
- DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs));
+ DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
- DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
+ DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
- DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias));
+ DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_543)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_543)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
- DISPATCH(GetHistogramEXT, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+ DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_544)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_544)(GLenum target, GLenum pname, GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
- DISPATCH(GetHistogramParameterfvEXT, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_545)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_545)(GLenum target, GLenum pname, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program)
{
- DISPATCH(GetHistogramParameterivEXT, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_546)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_546)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program)
{
- DISPATCH(GetMinmaxEXT, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_547)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_547)(GLenum target, GLenum pname, GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program)
{
- DISPATCH(GetMinmaxParameterfvEXT, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_548)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_548)(GLenum target, GLenum pname, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program)
{
- DISPATCH(GetMinmaxParameterivEXT, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_549)(GLenum target, GLenum format, GLenum type, GLvoid * image);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_549)(GLenum target, GLenum format, GLenum type, GLvoid * image)
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name)
{
- DISPATCH(GetConvolutionFilterEXT, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_550)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_550)(GLenum target, GLenum pname, GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name)
{
- DISPATCH(GetConvolutionParameterfvEXT, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_551)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_551)(GLenum target, GLenum pname, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
{
- DISPATCH(GetConvolutionParameterivEXT, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_552)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_552)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
{
- DISPATCH(GetSeparableFilterEXT, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_553)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_553)(GLenum target, GLenum pname, GLfloat * params)
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name)
{
- DISPATCH(GetColorTableParameterfvSGI, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name)
{
- DISPATCH(GetColorTableParameterfvSGI, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_554)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_554)(GLenum target, GLenum pname, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs)
{
- DISPATCH(GetColorTableParameterivSGI, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs)
{
- DISPATCH(GetColorTableParameterivSGI, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_555)(GLenum target, GLenum format, GLenum type, GLvoid * table);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_555)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
{
- DISPATCH(GetColorTableSGI, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
}
-KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
{
- DISPATCH(GetColorTableSGI, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+ DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_556)(GLenum pname, GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_556)(GLenum pname, GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params)
{
DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_557)(GLenum pname, GLint * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_557)(GLenum pname, GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params)
{
DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_558)(GLenum pname, GLfloat param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_558)(GLenum pname, GLfloat param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param)
{
DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_559)(GLenum pname, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_559)(GLenum pname, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params)
{
DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_560)(GLenum pname, GLint param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_560)(GLenum pname, GLint param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param)
{
DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_561)(GLenum pname, const GLint * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_561)(GLenum pname, const GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params)
{
DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
-{
- RETURN_DISPATCH(AreTexturesResidentEXT, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
-}
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert);
-KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
-{
- DISPATCH(GenTexturesEXT, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
-{
- RETURN_DISPATCH(IsTextureEXT, (texture), (F, "glIsTextureEXT(%d);\n", texture));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLclampf value, GLboolean invert);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLclampf value, GLboolean invert)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert)
{
DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pattern);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pattern)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern)
{
DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern));
}
@@ -3580,9 +4060,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param)
DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_573)(GLenum pname, GLfloat param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_573)(GLenum pname, GLfloat param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param)
{
DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param));
}
@@ -3602,9 +4082,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * p
DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_574)(GLenum pname, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_574)(GLenum pname, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params)
{
DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
@@ -3619,16 +4099,16 @@ KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n"));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLdouble * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLdouble * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params)
{
DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params)
{
DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
}
@@ -3873,9 +4353,9 @@ KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord)
DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_603)(GLenum mode);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_603)(GLenum mode)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode)
{
DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode));
}
@@ -3890,9 +4370,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfac
DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_604)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_604)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
@@ -4257,65 +4737,65 @@ KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v)
DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_645)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_645)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
{
DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_646)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_646)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
{
DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLsizei n, const GLuint * fences);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLsizei n, const GLuint * fences)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences)
{
DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLuint fence);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLuint fence)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence)
{
DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLsizei n, GLuint * fences);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLsizei n, GLuint * fences)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences)
{
DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLuint fence, GLenum pname, GLint * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLuint fence, GLenum pname, GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params)
{
DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence)
{
RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence, GLenum condition);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence, GLenum condition)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition)
{
DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence)
{
RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence));
}
@@ -4755,37 +5235,37 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para
DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face)
{
DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array)
{
DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays)
{
DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays)
{
DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array)
{
RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
}
@@ -4820,9 +5300,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len,
DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax)
{
DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax));
}
@@ -4832,9 +5312,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA)
{
DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA));
}
@@ -4904,20 +5384,6 @@ KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum targe
DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_760)(GLuint id, GLenum pname, GLint64EXT * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_760)(GLuint id, GLenum pname, GLint64EXT * params)
-{
- DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLuint id, GLenum pname, GLuint64EXT * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLuint id, GLenum pname, GLuint64EXT * params)
-{
- DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
@@ -4938,27 +5404,41 @@ KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum intern
DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
{
DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
{
DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
{
DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
}
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLint64EXT * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLint64EXT * params)
+{
+ DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLuint64EXT * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLuint64EXT * params)
+{
+ DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
#endif /* defined( NAME ) */
@@ -5381,9 +5861,28 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(MultiTexCoord4ivARB),
TABLE_ENTRY(MultiTexCoord4sARB),
TABLE_ENTRY(MultiTexCoord4svARB),
+ TABLE_ENTRY(AttachShader),
+ TABLE_ENTRY(CreateProgram),
+ TABLE_ENTRY(CreateShader),
+ TABLE_ENTRY(DeleteProgram),
+ TABLE_ENTRY(DeleteShader),
+ TABLE_ENTRY(DetachShader),
+ TABLE_ENTRY(GetAttachedShaders),
+ TABLE_ENTRY(GetProgramInfoLog),
+ TABLE_ENTRY(GetProgramiv),
+ TABLE_ENTRY(GetShaderInfoLog),
+ TABLE_ENTRY(GetShaderiv),
+ TABLE_ENTRY(IsProgram),
+ TABLE_ENTRY(IsShader),
TABLE_ENTRY(StencilFuncSeparate),
TABLE_ENTRY(StencilMaskSeparate),
TABLE_ENTRY(StencilOpSeparate),
+ TABLE_ENTRY(UniformMatrix2x3fv),
+ TABLE_ENTRY(UniformMatrix2x4fv),
+ TABLE_ENTRY(UniformMatrix3x2fv),
+ TABLE_ENTRY(UniformMatrix3x4fv),
+ TABLE_ENTRY(UniformMatrix4x2fv),
+ TABLE_ENTRY(UniformMatrix4x3fv),
TABLE_ENTRY(LoadTransposeMatrixdARB),
TABLE_ENTRY(LoadTransposeMatrixfARB),
TABLE_ENTRY(MultTransposeMatrixdARB),
@@ -5516,30 +6015,14 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(GetAttribLocationARB),
TABLE_ENTRY(DrawBuffersARB),
TABLE_ENTRY(PolygonOffsetEXT),
- TABLE_ENTRY(_dispatch_stub_543),
- TABLE_ENTRY(_dispatch_stub_544),
- TABLE_ENTRY(_dispatch_stub_545),
- TABLE_ENTRY(_dispatch_stub_546),
- TABLE_ENTRY(_dispatch_stub_547),
- TABLE_ENTRY(_dispatch_stub_548),
- TABLE_ENTRY(_dispatch_stub_549),
- TABLE_ENTRY(_dispatch_stub_550),
- TABLE_ENTRY(_dispatch_stub_551),
- TABLE_ENTRY(_dispatch_stub_552),
- TABLE_ENTRY(_dispatch_stub_553),
- TABLE_ENTRY(_dispatch_stub_554),
- TABLE_ENTRY(_dispatch_stub_555),
- TABLE_ENTRY(_dispatch_stub_556),
- TABLE_ENTRY(_dispatch_stub_557),
- TABLE_ENTRY(_dispatch_stub_558),
- TABLE_ENTRY(_dispatch_stub_559),
- TABLE_ENTRY(_dispatch_stub_560),
- TABLE_ENTRY(_dispatch_stub_561),
- TABLE_ENTRY(AreTexturesResidentEXT),
- TABLE_ENTRY(GenTexturesEXT),
- TABLE_ENTRY(IsTextureEXT),
+ TABLE_ENTRY(_dispatch_stub_562),
+ TABLE_ENTRY(_dispatch_stub_563),
+ TABLE_ENTRY(_dispatch_stub_564),
TABLE_ENTRY(_dispatch_stub_565),
TABLE_ENTRY(_dispatch_stub_566),
+ TABLE_ENTRY(_dispatch_stub_567),
+ TABLE_ENTRY(_dispatch_stub_568),
+ TABLE_ENTRY(_dispatch_stub_569),
TABLE_ENTRY(ColorPointerEXT),
TABLE_ENTRY(EdgeFlagPointerEXT),
TABLE_ENTRY(IndexPointerEXT),
@@ -5550,8 +6033,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(PointParameterfvEXT),
TABLE_ENTRY(LockArraysEXT),
TABLE_ENTRY(UnlockArraysEXT),
- TABLE_ENTRY(_dispatch_stub_577),
- TABLE_ENTRY(_dispatch_stub_578),
+ TABLE_ENTRY(_dispatch_stub_580),
+ TABLE_ENTRY(_dispatch_stub_581),
TABLE_ENTRY(SecondaryColor3bEXT),
TABLE_ENTRY(SecondaryColor3bvEXT),
TABLE_ENTRY(SecondaryColor3dEXT),
@@ -5576,7 +6059,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(FogCoorddvEXT),
TABLE_ENTRY(FogCoordfEXT),
TABLE_ENTRY(FogCoordfvEXT),
- TABLE_ENTRY(_dispatch_stub_603),
+ TABLE_ENTRY(_dispatch_stub_606),
TABLE_ENTRY(BlendFuncSeparateEXT),
TABLE_ENTRY(FlushVertexArrayRangeNV),
TABLE_ENTRY(VertexArrayRangeNV),
@@ -5618,15 +6101,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(WindowPos4ivMESA),
TABLE_ENTRY(WindowPos4sMESA),
TABLE_ENTRY(WindowPos4svMESA),
- TABLE_ENTRY(_dispatch_stub_645),
- TABLE_ENTRY(_dispatch_stub_646),
- TABLE_ENTRY(_dispatch_stub_647),
TABLE_ENTRY(_dispatch_stub_648),
TABLE_ENTRY(_dispatch_stub_649),
TABLE_ENTRY(_dispatch_stub_650),
TABLE_ENTRY(_dispatch_stub_651),
TABLE_ENTRY(_dispatch_stub_652),
TABLE_ENTRY(_dispatch_stub_653),
+ TABLE_ENTRY(_dispatch_stub_654),
+ TABLE_ENTRY(_dispatch_stub_655),
+ TABLE_ENTRY(_dispatch_stub_656),
TABLE_ENTRY(AreProgramsResidentNV),
TABLE_ENTRY(BindProgramNV),
TABLE_ENTRY(DeleteProgramsNV),
@@ -5707,19 +6190,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(SetFragmentShaderConstantATI),
TABLE_ENTRY(PointParameteriNV),
TABLE_ENTRY(PointParameterivNV),
- TABLE_ENTRY(_dispatch_stub_734),
- TABLE_ENTRY(_dispatch_stub_735),
- TABLE_ENTRY(_dispatch_stub_736),
TABLE_ENTRY(_dispatch_stub_737),
TABLE_ENTRY(_dispatch_stub_738),
+ TABLE_ENTRY(_dispatch_stub_739),
+ TABLE_ENTRY(_dispatch_stub_740),
+ TABLE_ENTRY(_dispatch_stub_741),
TABLE_ENTRY(GetProgramNamedParameterdvNV),
TABLE_ENTRY(GetProgramNamedParameterfvNV),
TABLE_ENTRY(ProgramNamedParameter4dNV),
TABLE_ENTRY(ProgramNamedParameter4dvNV),
TABLE_ENTRY(ProgramNamedParameter4fNV),
TABLE_ENTRY(ProgramNamedParameter4fvNV),
- TABLE_ENTRY(_dispatch_stub_745),
- TABLE_ENTRY(_dispatch_stub_746),
+ TABLE_ENTRY(_dispatch_stub_748),
+ TABLE_ENTRY(_dispatch_stub_749),
TABLE_ENTRY(BindFramebufferEXT),
TABLE_ENTRY(BindRenderbufferEXT),
TABLE_ENTRY(CheckFramebufferStatusEXT),
@@ -5733,15 +6216,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(GenRenderbuffersEXT),
TABLE_ENTRY(GenerateMipmapEXT),
TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT),
- TABLE_ENTRY(_dispatch_stub_760),
- TABLE_ENTRY(_dispatch_stub_761),
TABLE_ENTRY(GetRenderbufferParameterivEXT),
TABLE_ENTRY(IsFramebufferEXT),
TABLE_ENTRY(IsRenderbufferEXT),
TABLE_ENTRY(RenderbufferStorageEXT),
- TABLE_ENTRY(_dispatch_stub_766),
TABLE_ENTRY(_dispatch_stub_767),
TABLE_ENTRY(_dispatch_stub_768),
+ TABLE_ENTRY(_dispatch_stub_769),
+ TABLE_ENTRY(_dispatch_stub_770),
+ TABLE_ENTRY(_dispatch_stub_771),
/* A whole bunch of no-op functions. These might be called
* when someone tries to call a dynamically-registered
* extension function without a current rendering context.
@@ -5858,12 +6341,23 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(ArrayElementEXT),
TABLE_ENTRY(BindTextureEXT),
TABLE_ENTRY(DrawArraysEXT),
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(AreTexturesResidentEXT),
+#endif
TABLE_ENTRY(CopyTexImage1DEXT),
TABLE_ENTRY(CopyTexImage2DEXT),
TABLE_ENTRY(CopyTexSubImage1DEXT),
TABLE_ENTRY(CopyTexSubImage2DEXT),
+#ifndef GLX_INDIRECT_RENDERING
TABLE_ENTRY(DeleteTexturesEXT),
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GenTexturesEXT),
+#endif
TABLE_ENTRY(GetPointervEXT),
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(IsTextureEXT),
+#endif
TABLE_ENTRY(PrioritizeTexturesEXT),
TABLE_ENTRY(TexSubImage1DEXT),
TABLE_ENTRY(TexSubImage2DEXT),
@@ -5871,6 +6365,15 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(BlendEquationEXT),
TABLE_ENTRY(DrawRangeElementsEXT),
TABLE_ENTRY(ColorTableEXT),
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GetColorTableEXT),
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GetColorTableParameterfvEXT),
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GetColorTableParameterivEXT),
+#endif
TABLE_ENTRY(TexImage3DEXT),
TABLE_ENTRY(TexSubImage3DEXT),
TABLE_ENTRY(CopyTexSubImage3DEXT),
@@ -5920,6 +6423,43 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(CompressedTexSubImage2D),
TABLE_ENTRY(CompressedTexSubImage3D),
TABLE_ENTRY(GetCompressedTexImage),
+ TABLE_ENTRY(DisableVertexAttribArray),
+ TABLE_ENTRY(EnableVertexAttribArray),
+ TABLE_ENTRY(GetVertexAttribdv),
+ TABLE_ENTRY(GetVertexAttribfv),
+ TABLE_ENTRY(GetVertexAttribiv),
+ TABLE_ENTRY(VertexAttrib1d),
+ TABLE_ENTRY(VertexAttrib1dv),
+ TABLE_ENTRY(VertexAttrib1f),
+ TABLE_ENTRY(VertexAttrib1fv),
+ TABLE_ENTRY(VertexAttrib1s),
+ TABLE_ENTRY(VertexAttrib1sv),
+ TABLE_ENTRY(VertexAttrib2d),
+ TABLE_ENTRY(VertexAttrib2dv),
+ TABLE_ENTRY(VertexAttrib2f),
+ TABLE_ENTRY(VertexAttrib2fv),
+ TABLE_ENTRY(VertexAttrib2s),
+ TABLE_ENTRY(VertexAttrib2sv),
+ TABLE_ENTRY(VertexAttrib3d),
+ TABLE_ENTRY(VertexAttrib3dv),
+ TABLE_ENTRY(VertexAttrib3f),
+ TABLE_ENTRY(VertexAttrib3fv),
+ TABLE_ENTRY(VertexAttrib3s),
+ TABLE_ENTRY(VertexAttrib3sv),
+ TABLE_ENTRY(VertexAttrib4Nbv),
+ TABLE_ENTRY(VertexAttrib4Niv),
+ TABLE_ENTRY(VertexAttrib4Nsv),
+ TABLE_ENTRY(VertexAttrib4Nub),
+ TABLE_ENTRY(VertexAttrib4Nubv),
+ TABLE_ENTRY(VertexAttrib4Nuiv),
+ TABLE_ENTRY(VertexAttrib4Nusv),
+ TABLE_ENTRY(VertexAttrib4d),
+ TABLE_ENTRY(VertexAttrib4dv),
+ TABLE_ENTRY(VertexAttrib4f),
+ TABLE_ENTRY(VertexAttrib4fv),
+ TABLE_ENTRY(VertexAttrib4s),
+ TABLE_ENTRY(VertexAttrib4sv),
+ TABLE_ENTRY(VertexAttribPointer),
TABLE_ENTRY(BindBuffer),
TABLE_ENTRY(BufferData),
TABLE_ENTRY(BufferSubData),
@@ -5939,11 +6479,40 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(GetQueryObjectuiv),
TABLE_ENTRY(GetQueryiv),
TABLE_ENTRY(IsQuery),
+ TABLE_ENTRY(CompileShader),
+ TABLE_ENTRY(GetActiveUniform),
+ TABLE_ENTRY(GetShaderSource),
+ TABLE_ENTRY(GetUniformLocation),
+ TABLE_ENTRY(GetUniformfv),
+ TABLE_ENTRY(GetUniformiv),
+ TABLE_ENTRY(LinkProgram),
+ TABLE_ENTRY(ShaderSource),
+ TABLE_ENTRY(Uniform1f),
+ TABLE_ENTRY(Uniform1fv),
+ TABLE_ENTRY(Uniform1i),
+ TABLE_ENTRY(Uniform1iv),
+ TABLE_ENTRY(Uniform2f),
+ TABLE_ENTRY(Uniform2fv),
+ TABLE_ENTRY(Uniform2i),
+ TABLE_ENTRY(Uniform2iv),
+ TABLE_ENTRY(Uniform3f),
+ TABLE_ENTRY(Uniform3fv),
+ TABLE_ENTRY(Uniform3i),
+ TABLE_ENTRY(Uniform3iv),
+ TABLE_ENTRY(Uniform4f),
+ TABLE_ENTRY(Uniform4fv),
+ TABLE_ENTRY(Uniform4i),
+ TABLE_ENTRY(Uniform4iv),
+ TABLE_ENTRY(UniformMatrix2fv),
+ TABLE_ENTRY(UniformMatrix3fv),
+ TABLE_ENTRY(UniformMatrix4fv),
+ TABLE_ENTRY(UseProgram),
+ TABLE_ENTRY(ValidateProgram),
+ TABLE_ENTRY(BindAttribLocation),
+ TABLE_ENTRY(GetActiveAttrib),
+ TABLE_ENTRY(GetAttribLocation),
TABLE_ENTRY(DrawBuffers),
TABLE_ENTRY(DrawBuffersATI),
- TABLE_ENTRY(GetColorTableParameterfvEXT),
- TABLE_ENTRY(GetColorTableParameterivEXT),
- TABLE_ENTRY(GetColorTableEXT),
TABLE_ENTRY(PointParameterf),
TABLE_ENTRY(PointParameterfARB),
TABLE_ENTRY(PointParameterfv),
diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h
index 635438fc04a..905c65862d1 100644
--- a/src/mesa/glapi/glprocs.h
+++ b/src/mesa/glapi/glprocs.h
@@ -2,7 +2,7 @@
/*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004
+ * (C) Copyright IBM Corporation 2004, 2006
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,25 +26,31 @@
* SOFTWARE.
*/
+
/* This file is only included by glapi.c and is used for
* the GetProcAddress() function
*/
typedef struct {
GLint Name_offset;
-#ifdef NEED_FUNCTION_POINTER
+#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
_glapi_proc Address;
#endif
GLuint Offset;
} glprocs_table_t;
-#ifdef NEED_FUNCTION_POINTER
-# define NAME_FUNC_OFFSET(n,f,o) { n , (_glapi_proc) f , o }
-#else
-# define NAME_FUNC_OFFSET(n,f,o) { n , o }
+#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o }
+#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o }
+#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o }
+#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o }
#endif
+
static const char gl_string_table[] =
"glNewList\0"
"glEndList\0"
@@ -454,9 +460,28 @@ static const char gl_string_table[] =
"glMultiTexCoord4ivARB\0"
"glMultiTexCoord4sARB\0"
"glMultiTexCoord4svARB\0"
+ "glAttachShader\0"
+ "glCreateProgram\0"
+ "glCreateShader\0"
+ "glDeleteProgram\0"
+ "glDeleteShader\0"
+ "glDetachShader\0"
+ "glGetAttachedShaders\0"
+ "glGetProgramInfoLog\0"
+ "glGetProgramiv\0"
+ "glGetShaderInfoLog\0"
+ "glGetShaderiv\0"
+ "glIsProgram\0"
+ "glIsShader\0"
"glStencilFuncSeparate\0"
"glStencilMaskSeparate\0"
"glStencilOpSeparate\0"
+ "glUniformMatrix2x3fv\0"
+ "glUniformMatrix2x4fv\0"
+ "glUniformMatrix3x2fv\0"
+ "glUniformMatrix3x4fv\0"
+ "glUniformMatrix4x2fv\0"
+ "glUniformMatrix4x3fv\0"
"glLoadTransposeMatrixdARB\0"
"glLoadTransposeMatrixfARB\0"
"glMultTransposeMatrixdARB\0"
@@ -589,28 +614,12 @@ static const char gl_string_table[] =
"glGetAttribLocationARB\0"
"glDrawBuffersARB\0"
"glPolygonOffsetEXT\0"
- "glGetHistogramEXT\0"
- "glGetHistogramParameterfvEXT\0"
- "glGetHistogramParameterivEXT\0"
- "glGetMinmaxEXT\0"
- "glGetMinmaxParameterfvEXT\0"
- "glGetMinmaxParameterivEXT\0"
- "glGetConvolutionFilterEXT\0"
- "glGetConvolutionParameterfvEXT\0"
- "glGetConvolutionParameterivEXT\0"
- "glGetSeparableFilterEXT\0"
- "glGetColorTableParameterfvSGI\0"
- "glGetColorTableParameterivSGI\0"
- "glGetColorTableSGI\0"
"glGetPixelTexGenParameterfvSGIS\0"
"glGetPixelTexGenParameterivSGIS\0"
"glPixelTexGenParameterfSGIS\0"
"glPixelTexGenParameterfvSGIS\0"
"glPixelTexGenParameteriSGIS\0"
"glPixelTexGenParameterivSGIS\0"
- "glAreTexturesResidentEXT\0"
- "glGenTexturesEXT\0"
- "glIsTextureEXT\0"
"glSampleMaskSGIS\0"
"glSamplePatternSGIS\0"
"glColorPointerEXT\0"
@@ -806,8 +815,6 @@ static const char gl_string_table[] =
"glGenRenderbuffersEXT\0"
"glGenerateMipmapEXT\0"
"glGetFramebufferAttachmentParameterivEXT\0"
- "glGetQueryObjecti64vEXT\0"
- "glGetQueryObjectui64vEXT\0"
"glGetRenderbufferParameterivEXT\0"
"glIsFramebufferEXT\0"
"glIsRenderbufferEXT\0"
@@ -815,15 +822,20 @@ static const char gl_string_table[] =
"glBlitFramebufferEXT\0"
"glProgramEnvParameters4fvEXT\0"
"glProgramLocalParameters4fvEXT\0"
+ "glGetQueryObjecti64vEXT\0"
+ "glGetQueryObjectui64vEXT\0"
"glArrayElementEXT\0"
"glBindTextureEXT\0"
"glDrawArraysEXT\0"
+ "glAreTexturesResidentEXT\0"
"glCopyTexImage1DEXT\0"
"glCopyTexImage2DEXT\0"
"glCopyTexSubImage1DEXT\0"
"glCopyTexSubImage2DEXT\0"
"glDeleteTexturesEXT\0"
+ "glGenTexturesEXT\0"
"glGetPointervEXT\0"
+ "glIsTextureEXT\0"
"glPrioritizeTexturesEXT\0"
"glTexSubImage1DEXT\0"
"glTexSubImage2DEXT\0"
@@ -835,6 +847,12 @@ static const char gl_string_table[] =
"glColorTableParameterfvSGI\0"
"glColorTableParameterivSGI\0"
"glCopyColorTableSGI\0"
+ "glGetColorTableSGI\0"
+ "glGetColorTableEXT\0"
+ "glGetColorTableParameterfvSGI\0"
+ "glGetColorTableParameterfvEXT\0"
+ "glGetColorTableParameterivSGI\0"
+ "glGetColorTableParameterivEXT\0"
"glColorSubTableEXT\0"
"glCopyColorSubTableEXT\0"
"glConvolutionFilter1DEXT\0"
@@ -845,7 +863,17 @@ static const char gl_string_table[] =
"glConvolutionParameterivEXT\0"
"glCopyConvolutionFilter1DEXT\0"
"glCopyConvolutionFilter2DEXT\0"
+ "glGetConvolutionFilterEXT\0"
+ "glGetConvolutionParameterfvEXT\0"
+ "glGetConvolutionParameterivEXT\0"
+ "glGetSeparableFilterEXT\0"
"glSeparableFilter2DEXT\0"
+ "glGetHistogramEXT\0"
+ "glGetHistogramParameterfvEXT\0"
+ "glGetHistogramParameterivEXT\0"
+ "glGetMinmaxEXT\0"
+ "glGetMinmaxParameterfvEXT\0"
+ "glGetMinmaxParameterivEXT\0"
"glHistogramEXT\0"
"glMinmaxEXT\0"
"glResetHistogramEXT\0"
@@ -899,6 +927,43 @@ static const char gl_string_table[] =
"glCompressedTexSubImage2D\0"
"glCompressedTexSubImage3D\0"
"glGetCompressedTexImage\0"
+ "glDisableVertexAttribArray\0"
+ "glEnableVertexAttribArray\0"
+ "glGetVertexAttribdv\0"
+ "glGetVertexAttribfv\0"
+ "glGetVertexAttribiv\0"
+ "glVertexAttrib1d\0"
+ "glVertexAttrib1dv\0"
+ "glVertexAttrib1f\0"
+ "glVertexAttrib1fv\0"
+ "glVertexAttrib1s\0"
+ "glVertexAttrib1sv\0"
+ "glVertexAttrib2d\0"
+ "glVertexAttrib2dv\0"
+ "glVertexAttrib2f\0"
+ "glVertexAttrib2fv\0"
+ "glVertexAttrib2s\0"
+ "glVertexAttrib2sv\0"
+ "glVertexAttrib3d\0"
+ "glVertexAttrib3dv\0"
+ "glVertexAttrib3f\0"
+ "glVertexAttrib3fv\0"
+ "glVertexAttrib3s\0"
+ "glVertexAttrib3sv\0"
+ "glVertexAttrib4Nbv\0"
+ "glVertexAttrib4Niv\0"
+ "glVertexAttrib4Nsv\0"
+ "glVertexAttrib4Nub\0"
+ "glVertexAttrib4Nubv\0"
+ "glVertexAttrib4Nuiv\0"
+ "glVertexAttrib4Nusv\0"
+ "glVertexAttrib4d\0"
+ "glVertexAttrib4dv\0"
+ "glVertexAttrib4f\0"
+ "glVertexAttrib4fv\0"
+ "glVertexAttrib4s\0"
+ "glVertexAttrib4sv\0"
+ "glVertexAttribPointer\0"
"glBindBuffer\0"
"glBufferData\0"
"glBufferSubData\0"
@@ -918,11 +983,40 @@ static const char gl_string_table[] =
"glGetQueryObjectuiv\0"
"glGetQueryiv\0"
"glIsQuery\0"
+ "glCompileShader\0"
+ "glGetActiveUniform\0"
+ "glGetShaderSource\0"
+ "glGetUniformLocation\0"
+ "glGetUniformfv\0"
+ "glGetUniformiv\0"
+ "glLinkProgram\0"
+ "glShaderSource\0"
+ "glUniform1f\0"
+ "glUniform1fv\0"
+ "glUniform1i\0"
+ "glUniform1iv\0"
+ "glUniform2f\0"
+ "glUniform2fv\0"
+ "glUniform2i\0"
+ "glUniform2iv\0"
+ "glUniform3f\0"
+ "glUniform3fv\0"
+ "glUniform3i\0"
+ "glUniform3iv\0"
+ "glUniform4f\0"
+ "glUniform4fv\0"
+ "glUniform4i\0"
+ "glUniform4iv\0"
+ "glUniformMatrix2fv\0"
+ "glUniformMatrix3fv\0"
+ "glUniformMatrix4fv\0"
+ "glUseProgram\0"
+ "glValidateProgram\0"
+ "glBindAttribLocation\0"
+ "glGetActiveAttrib\0"
+ "glGetAttribLocation\0"
"glDrawBuffers\0"
"glDrawBuffersATI\0"
- "glGetColorTableParameterfvEXT\0"
- "glGetColorTableParameterivEXT\0"
- "glGetColorTableEXT\0"
"glSampleMaskEXT\0"
"glSamplePatternEXT\0"
"glPointParameterf\0"
@@ -1000,1009 +1094,1147 @@ static const char gl_string_table[] =
"glBlendEquationSeparateATI\0"
;
+
+#ifdef USE_MGL_NAMESPACE
+#define gl_dispatch_stub_343 mgl_dispatch_stub_343
+#define gl_dispatch_stub_344 mgl_dispatch_stub_344
+#define gl_dispatch_stub_345 mgl_dispatch_stub_345
+#define gl_dispatch_stub_356 mgl_dispatch_stub_356
+#define gl_dispatch_stub_357 mgl_dispatch_stub_357
+#define gl_dispatch_stub_358 mgl_dispatch_stub_358
+#define gl_dispatch_stub_359 mgl_dispatch_stub_359
+#define gl_dispatch_stub_361 mgl_dispatch_stub_361
+#define gl_dispatch_stub_362 mgl_dispatch_stub_362
+#define gl_dispatch_stub_363 mgl_dispatch_stub_363
+#define gl_dispatch_stub_364 mgl_dispatch_stub_364
+#define gl_dispatch_stub_365 mgl_dispatch_stub_365
+#define gl_dispatch_stub_366 mgl_dispatch_stub_366
+#define gl_dispatch_stub_562 mgl_dispatch_stub_562
+#define gl_dispatch_stub_563 mgl_dispatch_stub_563
+#define gl_dispatch_stub_564 mgl_dispatch_stub_564
+#define gl_dispatch_stub_565 mgl_dispatch_stub_565
+#define gl_dispatch_stub_566 mgl_dispatch_stub_566
+#define gl_dispatch_stub_567 mgl_dispatch_stub_567
+#define gl_dispatch_stub_568 mgl_dispatch_stub_568
+#define gl_dispatch_stub_569 mgl_dispatch_stub_569
+#define gl_dispatch_stub_580 mgl_dispatch_stub_580
+#define gl_dispatch_stub_581 mgl_dispatch_stub_581
+#define gl_dispatch_stub_606 mgl_dispatch_stub_606
+#define gl_dispatch_stub_648 mgl_dispatch_stub_648
+#define gl_dispatch_stub_649 mgl_dispatch_stub_649
+#define gl_dispatch_stub_650 mgl_dispatch_stub_650
+#define gl_dispatch_stub_651 mgl_dispatch_stub_651
+#define gl_dispatch_stub_652 mgl_dispatch_stub_652
+#define gl_dispatch_stub_653 mgl_dispatch_stub_653
+#define gl_dispatch_stub_654 mgl_dispatch_stub_654
+#define gl_dispatch_stub_655 mgl_dispatch_stub_655
+#define gl_dispatch_stub_656 mgl_dispatch_stub_656
+#define gl_dispatch_stub_737 mgl_dispatch_stub_737
+#define gl_dispatch_stub_738 mgl_dispatch_stub_738
+#define gl_dispatch_stub_739 mgl_dispatch_stub_739
+#define gl_dispatch_stub_740 mgl_dispatch_stub_740
+#define gl_dispatch_stub_741 mgl_dispatch_stub_741
+#define gl_dispatch_stub_748 mgl_dispatch_stub_748
+#define gl_dispatch_stub_749 mgl_dispatch_stub_749
+#define gl_dispatch_stub_767 mgl_dispatch_stub_767
+#define gl_dispatch_stub_768 mgl_dispatch_stub_768
+#define gl_dispatch_stub_769 mgl_dispatch_stub_769
+#define gl_dispatch_stub_770 mgl_dispatch_stub_770
+#define gl_dispatch_stub_771 mgl_dispatch_stub_771
+#endif /* USE_MGL_NAMESPACE */
+
+
/* FIXME: Having these (incorrect) prototypes here is ugly. */
-#ifdef NEED_FUNCTION_POINTER
-extern void gl_dispatch_stub_543(void);
-extern void gl_dispatch_stub_544(void);
-extern void gl_dispatch_stub_545(void);
-extern void gl_dispatch_stub_546(void);
-extern void gl_dispatch_stub_547(void);
-extern void gl_dispatch_stub_548(void);
-extern void gl_dispatch_stub_549(void);
-extern void gl_dispatch_stub_550(void);
-extern void gl_dispatch_stub_551(void);
-extern void gl_dispatch_stub_552(void);
-extern void gl_dispatch_stub_553(void);
-extern void gl_dispatch_stub_554(void);
-extern void gl_dispatch_stub_555(void);
-extern void gl_dispatch_stub_556(void);
-extern void gl_dispatch_stub_557(void);
-extern void gl_dispatch_stub_558(void);
-extern void gl_dispatch_stub_559(void);
-extern void gl_dispatch_stub_560(void);
-extern void gl_dispatch_stub_561(void);
+#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
+extern void gl_dispatch_stub_343(void);
+extern void gl_dispatch_stub_344(void);
+extern void gl_dispatch_stub_345(void);
+extern void gl_dispatch_stub_356(void);
+extern void gl_dispatch_stub_357(void);
+extern void gl_dispatch_stub_358(void);
+extern void gl_dispatch_stub_359(void);
+extern void gl_dispatch_stub_361(void);
+extern void gl_dispatch_stub_362(void);
+extern void gl_dispatch_stub_363(void);
+extern void gl_dispatch_stub_364(void);
+extern void gl_dispatch_stub_365(void);
+extern void gl_dispatch_stub_366(void);
+extern void gl_dispatch_stub_562(void);
+extern void gl_dispatch_stub_563(void);
+extern void gl_dispatch_stub_564(void);
extern void gl_dispatch_stub_565(void);
extern void gl_dispatch_stub_566(void);
-extern void gl_dispatch_stub_577(void);
-extern void gl_dispatch_stub_578(void);
-extern void gl_dispatch_stub_603(void);
-extern void gl_dispatch_stub_645(void);
-extern void gl_dispatch_stub_646(void);
-extern void gl_dispatch_stub_647(void);
+extern void gl_dispatch_stub_567(void);
+extern void gl_dispatch_stub_568(void);
+extern void gl_dispatch_stub_569(void);
+extern void gl_dispatch_stub_580(void);
+extern void gl_dispatch_stub_581(void);
+extern void gl_dispatch_stub_606(void);
extern void gl_dispatch_stub_648(void);
extern void gl_dispatch_stub_649(void);
extern void gl_dispatch_stub_650(void);
extern void gl_dispatch_stub_651(void);
extern void gl_dispatch_stub_652(void);
extern void gl_dispatch_stub_653(void);
-extern void gl_dispatch_stub_734(void);
-extern void gl_dispatch_stub_735(void);
-extern void gl_dispatch_stub_736(void);
+extern void gl_dispatch_stub_654(void);
+extern void gl_dispatch_stub_655(void);
+extern void gl_dispatch_stub_656(void);
extern void gl_dispatch_stub_737(void);
extern void gl_dispatch_stub_738(void);
-extern void gl_dispatch_stub_745(void);
-extern void gl_dispatch_stub_746(void);
-extern void gl_dispatch_stub_760(void);
-extern void gl_dispatch_stub_761(void);
-extern void gl_dispatch_stub_766(void);
+extern void gl_dispatch_stub_739(void);
+extern void gl_dispatch_stub_740(void);
+extern void gl_dispatch_stub_741(void);
+extern void gl_dispatch_stub_748(void);
+extern void gl_dispatch_stub_749(void);
extern void gl_dispatch_stub_767(void);
extern void gl_dispatch_stub_768(void);
-#endif /* NEED_FUNCTION_POINTER */
+extern void gl_dispatch_stub_769(void);
+extern void gl_dispatch_stub_770(void);
+extern void gl_dispatch_stub_771(void);
+#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */
static const glprocs_table_t static_functions[] = {
- NAME_FUNC_OFFSET( 0, glNewList, _gloffset_NewList ),
- NAME_FUNC_OFFSET( 10, glEndList, _gloffset_EndList ),
- NAME_FUNC_OFFSET( 20, glCallList, _gloffset_CallList ),
- NAME_FUNC_OFFSET( 31, glCallLists, _gloffset_CallLists ),
- NAME_FUNC_OFFSET( 43, glDeleteLists, _gloffset_DeleteLists ),
- NAME_FUNC_OFFSET( 57, glGenLists, _gloffset_GenLists ),
- NAME_FUNC_OFFSET( 68, glListBase, _gloffset_ListBase ),
- NAME_FUNC_OFFSET( 79, glBegin, _gloffset_Begin ),
- NAME_FUNC_OFFSET( 87, glBitmap, _gloffset_Bitmap ),
- NAME_FUNC_OFFSET( 96, glColor3b, _gloffset_Color3b ),
- NAME_FUNC_OFFSET( 106, glColor3bv, _gloffset_Color3bv ),
- NAME_FUNC_OFFSET( 117, glColor3d, _gloffset_Color3d ),
- NAME_FUNC_OFFSET( 127, glColor3dv, _gloffset_Color3dv ),
- NAME_FUNC_OFFSET( 138, glColor3f, _gloffset_Color3f ),
- NAME_FUNC_OFFSET( 148, glColor3fv, _gloffset_Color3fv ),
- NAME_FUNC_OFFSET( 159, glColor3i, _gloffset_Color3i ),
- NAME_FUNC_OFFSET( 169, glColor3iv, _gloffset_Color3iv ),
- NAME_FUNC_OFFSET( 180, glColor3s, _gloffset_Color3s ),
- NAME_FUNC_OFFSET( 190, glColor3sv, _gloffset_Color3sv ),
- NAME_FUNC_OFFSET( 201, glColor3ub, _gloffset_Color3ub ),
- NAME_FUNC_OFFSET( 212, glColor3ubv, _gloffset_Color3ubv ),
- NAME_FUNC_OFFSET( 224, glColor3ui, _gloffset_Color3ui ),
- NAME_FUNC_OFFSET( 235, glColor3uiv, _gloffset_Color3uiv ),
- NAME_FUNC_OFFSET( 247, glColor3us, _gloffset_Color3us ),
- NAME_FUNC_OFFSET( 258, glColor3usv, _gloffset_Color3usv ),
- NAME_FUNC_OFFSET( 270, glColor4b, _gloffset_Color4b ),
- NAME_FUNC_OFFSET( 280, glColor4bv, _gloffset_Color4bv ),
- NAME_FUNC_OFFSET( 291, glColor4d, _gloffset_Color4d ),
- NAME_FUNC_OFFSET( 301, glColor4dv, _gloffset_Color4dv ),
- NAME_FUNC_OFFSET( 312, glColor4f, _gloffset_Color4f ),
- NAME_FUNC_OFFSET( 322, glColor4fv, _gloffset_Color4fv ),
- NAME_FUNC_OFFSET( 333, glColor4i, _gloffset_Color4i ),
- NAME_FUNC_OFFSET( 343, glColor4iv, _gloffset_Color4iv ),
- NAME_FUNC_OFFSET( 354, glColor4s, _gloffset_Color4s ),
- NAME_FUNC_OFFSET( 364, glColor4sv, _gloffset_Color4sv ),
- NAME_FUNC_OFFSET( 375, glColor4ub, _gloffset_Color4ub ),
- NAME_FUNC_OFFSET( 386, glColor4ubv, _gloffset_Color4ubv ),
- NAME_FUNC_OFFSET( 398, glColor4ui, _gloffset_Color4ui ),
- NAME_FUNC_OFFSET( 409, glColor4uiv, _gloffset_Color4uiv ),
- NAME_FUNC_OFFSET( 421, glColor4us, _gloffset_Color4us ),
- NAME_FUNC_OFFSET( 432, glColor4usv, _gloffset_Color4usv ),
- NAME_FUNC_OFFSET( 444, glEdgeFlag, _gloffset_EdgeFlag ),
- NAME_FUNC_OFFSET( 455, glEdgeFlagv, _gloffset_EdgeFlagv ),
- NAME_FUNC_OFFSET( 467, glEnd, _gloffset_End ),
- NAME_FUNC_OFFSET( 473, glIndexd, _gloffset_Indexd ),
- NAME_FUNC_OFFSET( 482, glIndexdv, _gloffset_Indexdv ),
- NAME_FUNC_OFFSET( 492, glIndexf, _gloffset_Indexf ),
- NAME_FUNC_OFFSET( 501, glIndexfv, _gloffset_Indexfv ),
- NAME_FUNC_OFFSET( 511, glIndexi, _gloffset_Indexi ),
- NAME_FUNC_OFFSET( 520, glIndexiv, _gloffset_Indexiv ),
- NAME_FUNC_OFFSET( 530, glIndexs, _gloffset_Indexs ),
- NAME_FUNC_OFFSET( 539, glIndexsv, _gloffset_Indexsv ),
- NAME_FUNC_OFFSET( 549, glNormal3b, _gloffset_Normal3b ),
- NAME_FUNC_OFFSET( 560, glNormal3bv, _gloffset_Normal3bv ),
- NAME_FUNC_OFFSET( 572, glNormal3d, _gloffset_Normal3d ),
- NAME_FUNC_OFFSET( 583, glNormal3dv, _gloffset_Normal3dv ),
- NAME_FUNC_OFFSET( 595, glNormal3f, _gloffset_Normal3f ),
- NAME_FUNC_OFFSET( 606, glNormal3fv, _gloffset_Normal3fv ),
- NAME_FUNC_OFFSET( 618, glNormal3i, _gloffset_Normal3i ),
- NAME_FUNC_OFFSET( 629, glNormal3iv, _gloffset_Normal3iv ),
- NAME_FUNC_OFFSET( 641, glNormal3s, _gloffset_Normal3s ),
- NAME_FUNC_OFFSET( 652, glNormal3sv, _gloffset_Normal3sv ),
- NAME_FUNC_OFFSET( 664, glRasterPos2d, _gloffset_RasterPos2d ),
- NAME_FUNC_OFFSET( 678, glRasterPos2dv, _gloffset_RasterPos2dv ),
- NAME_FUNC_OFFSET( 693, glRasterPos2f, _gloffset_RasterPos2f ),
- NAME_FUNC_OFFSET( 707, glRasterPos2fv, _gloffset_RasterPos2fv ),
- NAME_FUNC_OFFSET( 722, glRasterPos2i, _gloffset_RasterPos2i ),
- NAME_FUNC_OFFSET( 736, glRasterPos2iv, _gloffset_RasterPos2iv ),
- NAME_FUNC_OFFSET( 751, glRasterPos2s, _gloffset_RasterPos2s ),
- NAME_FUNC_OFFSET( 765, glRasterPos2sv, _gloffset_RasterPos2sv ),
- NAME_FUNC_OFFSET( 780, glRasterPos3d, _gloffset_RasterPos3d ),
- NAME_FUNC_OFFSET( 794, glRasterPos3dv, _gloffset_RasterPos3dv ),
- NAME_FUNC_OFFSET( 809, glRasterPos3f, _gloffset_RasterPos3f ),
- NAME_FUNC_OFFSET( 823, glRasterPos3fv, _gloffset_RasterPos3fv ),
- NAME_FUNC_OFFSET( 838, glRasterPos3i, _gloffset_RasterPos3i ),
- NAME_FUNC_OFFSET( 852, glRasterPos3iv, _gloffset_RasterPos3iv ),
- NAME_FUNC_OFFSET( 867, glRasterPos3s, _gloffset_RasterPos3s ),
- NAME_FUNC_OFFSET( 881, glRasterPos3sv, _gloffset_RasterPos3sv ),
- NAME_FUNC_OFFSET( 896, glRasterPos4d, _gloffset_RasterPos4d ),
- NAME_FUNC_OFFSET( 910, glRasterPos4dv, _gloffset_RasterPos4dv ),
- NAME_FUNC_OFFSET( 925, glRasterPos4f, _gloffset_RasterPos4f ),
- NAME_FUNC_OFFSET( 939, glRasterPos4fv, _gloffset_RasterPos4fv ),
- NAME_FUNC_OFFSET( 954, glRasterPos4i, _gloffset_RasterPos4i ),
- NAME_FUNC_OFFSET( 968, glRasterPos4iv, _gloffset_RasterPos4iv ),
- NAME_FUNC_OFFSET( 983, glRasterPos4s, _gloffset_RasterPos4s ),
- NAME_FUNC_OFFSET( 997, glRasterPos4sv, _gloffset_RasterPos4sv ),
- NAME_FUNC_OFFSET( 1012, glRectd, _gloffset_Rectd ),
- NAME_FUNC_OFFSET( 1020, glRectdv, _gloffset_Rectdv ),
- NAME_FUNC_OFFSET( 1029, glRectf, _gloffset_Rectf ),
- NAME_FUNC_OFFSET( 1037, glRectfv, _gloffset_Rectfv ),
- NAME_FUNC_OFFSET( 1046, glRecti, _gloffset_Recti ),
- NAME_FUNC_OFFSET( 1054, glRectiv, _gloffset_Rectiv ),
- NAME_FUNC_OFFSET( 1063, glRects, _gloffset_Rects ),
- NAME_FUNC_OFFSET( 1071, glRectsv, _gloffset_Rectsv ),
- NAME_FUNC_OFFSET( 1080, glTexCoord1d, _gloffset_TexCoord1d ),
- NAME_FUNC_OFFSET( 1093, glTexCoord1dv, _gloffset_TexCoord1dv ),
- NAME_FUNC_OFFSET( 1107, glTexCoord1f, _gloffset_TexCoord1f ),
- NAME_FUNC_OFFSET( 1120, glTexCoord1fv, _gloffset_TexCoord1fv ),
- NAME_FUNC_OFFSET( 1134, glTexCoord1i, _gloffset_TexCoord1i ),
- NAME_FUNC_OFFSET( 1147, glTexCoord1iv, _gloffset_TexCoord1iv ),
- NAME_FUNC_OFFSET( 1161, glTexCoord1s, _gloffset_TexCoord1s ),
- NAME_FUNC_OFFSET( 1174, glTexCoord1sv, _gloffset_TexCoord1sv ),
- NAME_FUNC_OFFSET( 1188, glTexCoord2d, _gloffset_TexCoord2d ),
- NAME_FUNC_OFFSET( 1201, glTexCoord2dv, _gloffset_TexCoord2dv ),
- NAME_FUNC_OFFSET( 1215, glTexCoord2f, _gloffset_TexCoord2f ),
- NAME_FUNC_OFFSET( 1228, glTexCoord2fv, _gloffset_TexCoord2fv ),
- NAME_FUNC_OFFSET( 1242, glTexCoord2i, _gloffset_TexCoord2i ),
- NAME_FUNC_OFFSET( 1255, glTexCoord2iv, _gloffset_TexCoord2iv ),
- NAME_FUNC_OFFSET( 1269, glTexCoord2s, _gloffset_TexCoord2s ),
- NAME_FUNC_OFFSET( 1282, glTexCoord2sv, _gloffset_TexCoord2sv ),
- NAME_FUNC_OFFSET( 1296, glTexCoord3d, _gloffset_TexCoord3d ),
- NAME_FUNC_OFFSET( 1309, glTexCoord3dv, _gloffset_TexCoord3dv ),
- NAME_FUNC_OFFSET( 1323, glTexCoord3f, _gloffset_TexCoord3f ),
- NAME_FUNC_OFFSET( 1336, glTexCoord3fv, _gloffset_TexCoord3fv ),
- NAME_FUNC_OFFSET( 1350, glTexCoord3i, _gloffset_TexCoord3i ),
- NAME_FUNC_OFFSET( 1363, glTexCoord3iv, _gloffset_TexCoord3iv ),
- NAME_FUNC_OFFSET( 1377, glTexCoord3s, _gloffset_TexCoord3s ),
- NAME_FUNC_OFFSET( 1390, glTexCoord3sv, _gloffset_TexCoord3sv ),
- NAME_FUNC_OFFSET( 1404, glTexCoord4d, _gloffset_TexCoord4d ),
- NAME_FUNC_OFFSET( 1417, glTexCoord4dv, _gloffset_TexCoord4dv ),
- NAME_FUNC_OFFSET( 1431, glTexCoord4f, _gloffset_TexCoord4f ),
- NAME_FUNC_OFFSET( 1444, glTexCoord4fv, _gloffset_TexCoord4fv ),
- NAME_FUNC_OFFSET( 1458, glTexCoord4i, _gloffset_TexCoord4i ),
- NAME_FUNC_OFFSET( 1471, glTexCoord4iv, _gloffset_TexCoord4iv ),
- NAME_FUNC_OFFSET( 1485, glTexCoord4s, _gloffset_TexCoord4s ),
- NAME_FUNC_OFFSET( 1498, glTexCoord4sv, _gloffset_TexCoord4sv ),
- NAME_FUNC_OFFSET( 1512, glVertex2d, _gloffset_Vertex2d ),
- NAME_FUNC_OFFSET( 1523, glVertex2dv, _gloffset_Vertex2dv ),
- NAME_FUNC_OFFSET( 1535, glVertex2f, _gloffset_Vertex2f ),
- NAME_FUNC_OFFSET( 1546, glVertex2fv, _gloffset_Vertex2fv ),
- NAME_FUNC_OFFSET( 1558, glVertex2i, _gloffset_Vertex2i ),
- NAME_FUNC_OFFSET( 1569, glVertex2iv, _gloffset_Vertex2iv ),
- NAME_FUNC_OFFSET( 1581, glVertex2s, _gloffset_Vertex2s ),
- NAME_FUNC_OFFSET( 1592, glVertex2sv, _gloffset_Vertex2sv ),
- NAME_FUNC_OFFSET( 1604, glVertex3d, _gloffset_Vertex3d ),
- NAME_FUNC_OFFSET( 1615, glVertex3dv, _gloffset_Vertex3dv ),
- NAME_FUNC_OFFSET( 1627, glVertex3f, _gloffset_Vertex3f ),
- NAME_FUNC_OFFSET( 1638, glVertex3fv, _gloffset_Vertex3fv ),
- NAME_FUNC_OFFSET( 1650, glVertex3i, _gloffset_Vertex3i ),
- NAME_FUNC_OFFSET( 1661, glVertex3iv, _gloffset_Vertex3iv ),
- NAME_FUNC_OFFSET( 1673, glVertex3s, _gloffset_Vertex3s ),
- NAME_FUNC_OFFSET( 1684, glVertex3sv, _gloffset_Vertex3sv ),
- NAME_FUNC_OFFSET( 1696, glVertex4d, _gloffset_Vertex4d ),
- NAME_FUNC_OFFSET( 1707, glVertex4dv, _gloffset_Vertex4dv ),
- NAME_FUNC_OFFSET( 1719, glVertex4f, _gloffset_Vertex4f ),
- NAME_FUNC_OFFSET( 1730, glVertex4fv, _gloffset_Vertex4fv ),
- NAME_FUNC_OFFSET( 1742, glVertex4i, _gloffset_Vertex4i ),
- NAME_FUNC_OFFSET( 1753, glVertex4iv, _gloffset_Vertex4iv ),
- NAME_FUNC_OFFSET( 1765, glVertex4s, _gloffset_Vertex4s ),
- NAME_FUNC_OFFSET( 1776, glVertex4sv, _gloffset_Vertex4sv ),
- NAME_FUNC_OFFSET( 1788, glClipPlane, _gloffset_ClipPlane ),
- NAME_FUNC_OFFSET( 1800, glColorMaterial, _gloffset_ColorMaterial ),
- NAME_FUNC_OFFSET( 1816, glCullFace, _gloffset_CullFace ),
- NAME_FUNC_OFFSET( 1827, glFogf, _gloffset_Fogf ),
- NAME_FUNC_OFFSET( 1834, glFogfv, _gloffset_Fogfv ),
- NAME_FUNC_OFFSET( 1842, glFogi, _gloffset_Fogi ),
- NAME_FUNC_OFFSET( 1849, glFogiv, _gloffset_Fogiv ),
- NAME_FUNC_OFFSET( 1857, glFrontFace, _gloffset_FrontFace ),
- NAME_FUNC_OFFSET( 1869, glHint, _gloffset_Hint ),
- NAME_FUNC_OFFSET( 1876, glLightf, _gloffset_Lightf ),
- NAME_FUNC_OFFSET( 1885, glLightfv, _gloffset_Lightfv ),
- NAME_FUNC_OFFSET( 1895, glLighti, _gloffset_Lighti ),
- NAME_FUNC_OFFSET( 1904, glLightiv, _gloffset_Lightiv ),
- NAME_FUNC_OFFSET( 1914, glLightModelf, _gloffset_LightModelf ),
- NAME_FUNC_OFFSET( 1928, glLightModelfv, _gloffset_LightModelfv ),
- NAME_FUNC_OFFSET( 1943, glLightModeli, _gloffset_LightModeli ),
- NAME_FUNC_OFFSET( 1957, glLightModeliv, _gloffset_LightModeliv ),
- NAME_FUNC_OFFSET( 1972, glLineStipple, _gloffset_LineStipple ),
- NAME_FUNC_OFFSET( 1986, glLineWidth, _gloffset_LineWidth ),
- NAME_FUNC_OFFSET( 1998, glMaterialf, _gloffset_Materialf ),
- NAME_FUNC_OFFSET( 2010, glMaterialfv, _gloffset_Materialfv ),
- NAME_FUNC_OFFSET( 2023, glMateriali, _gloffset_Materiali ),
- NAME_FUNC_OFFSET( 2035, glMaterialiv, _gloffset_Materialiv ),
- NAME_FUNC_OFFSET( 2048, glPointSize, _gloffset_PointSize ),
- NAME_FUNC_OFFSET( 2060, glPolygonMode, _gloffset_PolygonMode ),
- NAME_FUNC_OFFSET( 2074, glPolygonStipple, _gloffset_PolygonStipple ),
- NAME_FUNC_OFFSET( 2091, glScissor, _gloffset_Scissor ),
- NAME_FUNC_OFFSET( 2101, glShadeModel, _gloffset_ShadeModel ),
- NAME_FUNC_OFFSET( 2114, glTexParameterf, _gloffset_TexParameterf ),
- NAME_FUNC_OFFSET( 2130, glTexParameterfv, _gloffset_TexParameterfv ),
- NAME_FUNC_OFFSET( 2147, glTexParameteri, _gloffset_TexParameteri ),
- NAME_FUNC_OFFSET( 2163, glTexParameteriv, _gloffset_TexParameteriv ),
- NAME_FUNC_OFFSET( 2180, glTexImage1D, _gloffset_TexImage1D ),
- NAME_FUNC_OFFSET( 2193, glTexImage2D, _gloffset_TexImage2D ),
- NAME_FUNC_OFFSET( 2206, glTexEnvf, _gloffset_TexEnvf ),
- NAME_FUNC_OFFSET( 2216, glTexEnvfv, _gloffset_TexEnvfv ),
- NAME_FUNC_OFFSET( 2227, glTexEnvi, _gloffset_TexEnvi ),
- NAME_FUNC_OFFSET( 2237, glTexEnviv, _gloffset_TexEnviv ),
- NAME_FUNC_OFFSET( 2248, glTexGend, _gloffset_TexGend ),
- NAME_FUNC_OFFSET( 2258, glTexGendv, _gloffset_TexGendv ),
- NAME_FUNC_OFFSET( 2269, glTexGenf, _gloffset_TexGenf ),
- NAME_FUNC_OFFSET( 2279, glTexGenfv, _gloffset_TexGenfv ),
- NAME_FUNC_OFFSET( 2290, glTexGeni, _gloffset_TexGeni ),
- NAME_FUNC_OFFSET( 2300, glTexGeniv, _gloffset_TexGeniv ),
- NAME_FUNC_OFFSET( 2311, glFeedbackBuffer, _gloffset_FeedbackBuffer ),
- NAME_FUNC_OFFSET( 2328, glSelectBuffer, _gloffset_SelectBuffer ),
- NAME_FUNC_OFFSET( 2343, glRenderMode, _gloffset_RenderMode ),
- NAME_FUNC_OFFSET( 2356, glInitNames, _gloffset_InitNames ),
- NAME_FUNC_OFFSET( 2368, glLoadName, _gloffset_LoadName ),
- NAME_FUNC_OFFSET( 2379, glPassThrough, _gloffset_PassThrough ),
- NAME_FUNC_OFFSET( 2393, glPopName, _gloffset_PopName ),
- NAME_FUNC_OFFSET( 2403, glPushName, _gloffset_PushName ),
- NAME_FUNC_OFFSET( 2414, glDrawBuffer, _gloffset_DrawBuffer ),
- NAME_FUNC_OFFSET( 2427, glClear, _gloffset_Clear ),
- NAME_FUNC_OFFSET( 2435, glClearAccum, _gloffset_ClearAccum ),
- NAME_FUNC_OFFSET( 2448, glClearIndex, _gloffset_ClearIndex ),
- NAME_FUNC_OFFSET( 2461, glClearColor, _gloffset_ClearColor ),
- NAME_FUNC_OFFSET( 2474, glClearStencil, _gloffset_ClearStencil ),
- NAME_FUNC_OFFSET( 2489, glClearDepth, _gloffset_ClearDepth ),
- NAME_FUNC_OFFSET( 2502, glStencilMask, _gloffset_StencilMask ),
- NAME_FUNC_OFFSET( 2516, glColorMask, _gloffset_ColorMask ),
- NAME_FUNC_OFFSET( 2528, glDepthMask, _gloffset_DepthMask ),
- NAME_FUNC_OFFSET( 2540, glIndexMask, _gloffset_IndexMask ),
- NAME_FUNC_OFFSET( 2552, glAccum, _gloffset_Accum ),
- NAME_FUNC_OFFSET( 2560, glDisable, _gloffset_Disable ),
- NAME_FUNC_OFFSET( 2570, glEnable, _gloffset_Enable ),
- NAME_FUNC_OFFSET( 2579, glFinish, _gloffset_Finish ),
- NAME_FUNC_OFFSET( 2588, glFlush, _gloffset_Flush ),
- NAME_FUNC_OFFSET( 2596, glPopAttrib, _gloffset_PopAttrib ),
- NAME_FUNC_OFFSET( 2608, glPushAttrib, _gloffset_PushAttrib ),
- NAME_FUNC_OFFSET( 2621, glMap1d, _gloffset_Map1d ),
- NAME_FUNC_OFFSET( 2629, glMap1f, _gloffset_Map1f ),
- NAME_FUNC_OFFSET( 2637, glMap2d, _gloffset_Map2d ),
- NAME_FUNC_OFFSET( 2645, glMap2f, _gloffset_Map2f ),
- NAME_FUNC_OFFSET( 2653, glMapGrid1d, _gloffset_MapGrid1d ),
- NAME_FUNC_OFFSET( 2665, glMapGrid1f, _gloffset_MapGrid1f ),
- NAME_FUNC_OFFSET( 2677, glMapGrid2d, _gloffset_MapGrid2d ),
- NAME_FUNC_OFFSET( 2689, glMapGrid2f, _gloffset_MapGrid2f ),
- NAME_FUNC_OFFSET( 2701, glEvalCoord1d, _gloffset_EvalCoord1d ),
- NAME_FUNC_OFFSET( 2715, glEvalCoord1dv, _gloffset_EvalCoord1dv ),
- NAME_FUNC_OFFSET( 2730, glEvalCoord1f, _gloffset_EvalCoord1f ),
- NAME_FUNC_OFFSET( 2744, glEvalCoord1fv, _gloffset_EvalCoord1fv ),
- NAME_FUNC_OFFSET( 2759, glEvalCoord2d, _gloffset_EvalCoord2d ),
- NAME_FUNC_OFFSET( 2773, glEvalCoord2dv, _gloffset_EvalCoord2dv ),
- NAME_FUNC_OFFSET( 2788, glEvalCoord2f, _gloffset_EvalCoord2f ),
- NAME_FUNC_OFFSET( 2802, glEvalCoord2fv, _gloffset_EvalCoord2fv ),
- NAME_FUNC_OFFSET( 2817, glEvalMesh1, _gloffset_EvalMesh1 ),
- NAME_FUNC_OFFSET( 2829, glEvalPoint1, _gloffset_EvalPoint1 ),
- NAME_FUNC_OFFSET( 2842, glEvalMesh2, _gloffset_EvalMesh2 ),
- NAME_FUNC_OFFSET( 2854, glEvalPoint2, _gloffset_EvalPoint2 ),
- NAME_FUNC_OFFSET( 2867, glAlphaFunc, _gloffset_AlphaFunc ),
- NAME_FUNC_OFFSET( 2879, glBlendFunc, _gloffset_BlendFunc ),
- NAME_FUNC_OFFSET( 2891, glLogicOp, _gloffset_LogicOp ),
- NAME_FUNC_OFFSET( 2901, glStencilFunc, _gloffset_StencilFunc ),
- NAME_FUNC_OFFSET( 2915, glStencilOp, _gloffset_StencilOp ),
- NAME_FUNC_OFFSET( 2927, glDepthFunc, _gloffset_DepthFunc ),
- NAME_FUNC_OFFSET( 2939, glPixelZoom, _gloffset_PixelZoom ),
- NAME_FUNC_OFFSET( 2951, glPixelTransferf, _gloffset_PixelTransferf ),
- NAME_FUNC_OFFSET( 2968, glPixelTransferi, _gloffset_PixelTransferi ),
- NAME_FUNC_OFFSET( 2985, glPixelStoref, _gloffset_PixelStoref ),
- NAME_FUNC_OFFSET( 2999, glPixelStorei, _gloffset_PixelStorei ),
- NAME_FUNC_OFFSET( 3013, glPixelMapfv, _gloffset_PixelMapfv ),
- NAME_FUNC_OFFSET( 3026, glPixelMapuiv, _gloffset_PixelMapuiv ),
- NAME_FUNC_OFFSET( 3040, glPixelMapusv, _gloffset_PixelMapusv ),
- NAME_FUNC_OFFSET( 3054, glReadBuffer, _gloffset_ReadBuffer ),
- NAME_FUNC_OFFSET( 3067, glCopyPixels, _gloffset_CopyPixels ),
- NAME_FUNC_OFFSET( 3080, glReadPixels, _gloffset_ReadPixels ),
- NAME_FUNC_OFFSET( 3093, glDrawPixels, _gloffset_DrawPixels ),
- NAME_FUNC_OFFSET( 3106, glGetBooleanv, _gloffset_GetBooleanv ),
- NAME_FUNC_OFFSET( 3120, glGetClipPlane, _gloffset_GetClipPlane ),
- NAME_FUNC_OFFSET( 3135, glGetDoublev, _gloffset_GetDoublev ),
- NAME_FUNC_OFFSET( 3148, glGetError, _gloffset_GetError ),
- NAME_FUNC_OFFSET( 3159, glGetFloatv, _gloffset_GetFloatv ),
- NAME_FUNC_OFFSET( 3171, glGetIntegerv, _gloffset_GetIntegerv ),
- NAME_FUNC_OFFSET( 3185, glGetLightfv, _gloffset_GetLightfv ),
- NAME_FUNC_OFFSET( 3198, glGetLightiv, _gloffset_GetLightiv ),
- NAME_FUNC_OFFSET( 3211, glGetMapdv, _gloffset_GetMapdv ),
- NAME_FUNC_OFFSET( 3222, glGetMapfv, _gloffset_GetMapfv ),
- NAME_FUNC_OFFSET( 3233, glGetMapiv, _gloffset_GetMapiv ),
- NAME_FUNC_OFFSET( 3244, glGetMaterialfv, _gloffset_GetMaterialfv ),
- NAME_FUNC_OFFSET( 3260, glGetMaterialiv, _gloffset_GetMaterialiv ),
- NAME_FUNC_OFFSET( 3276, glGetPixelMapfv, _gloffset_GetPixelMapfv ),
- NAME_FUNC_OFFSET( 3292, glGetPixelMapuiv, _gloffset_GetPixelMapuiv ),
- NAME_FUNC_OFFSET( 3309, glGetPixelMapusv, _gloffset_GetPixelMapusv ),
- NAME_FUNC_OFFSET( 3326, glGetPolygonStipple, _gloffset_GetPolygonStipple ),
- NAME_FUNC_OFFSET( 3346, glGetString, _gloffset_GetString ),
- NAME_FUNC_OFFSET( 3358, glGetTexEnvfv, _gloffset_GetTexEnvfv ),
- NAME_FUNC_OFFSET( 3372, glGetTexEnviv, _gloffset_GetTexEnviv ),
- NAME_FUNC_OFFSET( 3386, glGetTexGendv, _gloffset_GetTexGendv ),
- NAME_FUNC_OFFSET( 3400, glGetTexGenfv, _gloffset_GetTexGenfv ),
- NAME_FUNC_OFFSET( 3414, glGetTexGeniv, _gloffset_GetTexGeniv ),
- NAME_FUNC_OFFSET( 3428, glGetTexImage, _gloffset_GetTexImage ),
- NAME_FUNC_OFFSET( 3442, glGetTexParameterfv, _gloffset_GetTexParameterfv ),
- NAME_FUNC_OFFSET( 3462, glGetTexParameteriv, _gloffset_GetTexParameteriv ),
- NAME_FUNC_OFFSET( 3482, glGetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv ),
- NAME_FUNC_OFFSET( 3507, glGetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv ),
- NAME_FUNC_OFFSET( 3532, glIsEnabled, _gloffset_IsEnabled ),
- NAME_FUNC_OFFSET( 3544, glIsList, _gloffset_IsList ),
- NAME_FUNC_OFFSET( 3553, glDepthRange, _gloffset_DepthRange ),
- NAME_FUNC_OFFSET( 3566, glFrustum, _gloffset_Frustum ),
- NAME_FUNC_OFFSET( 3576, glLoadIdentity, _gloffset_LoadIdentity ),
- NAME_FUNC_OFFSET( 3591, glLoadMatrixf, _gloffset_LoadMatrixf ),
- NAME_FUNC_OFFSET( 3605, glLoadMatrixd, _gloffset_LoadMatrixd ),
- NAME_FUNC_OFFSET( 3619, glMatrixMode, _gloffset_MatrixMode ),
- NAME_FUNC_OFFSET( 3632, glMultMatrixf, _gloffset_MultMatrixf ),
- NAME_FUNC_OFFSET( 3646, glMultMatrixd, _gloffset_MultMatrixd ),
- NAME_FUNC_OFFSET( 3660, glOrtho, _gloffset_Ortho ),
- NAME_FUNC_OFFSET( 3668, glPopMatrix, _gloffset_PopMatrix ),
- NAME_FUNC_OFFSET( 3680, glPushMatrix, _gloffset_PushMatrix ),
- NAME_FUNC_OFFSET( 3693, glRotated, _gloffset_Rotated ),
- NAME_FUNC_OFFSET( 3703, glRotatef, _gloffset_Rotatef ),
- NAME_FUNC_OFFSET( 3713, glScaled, _gloffset_Scaled ),
- NAME_FUNC_OFFSET( 3722, glScalef, _gloffset_Scalef ),
- NAME_FUNC_OFFSET( 3731, glTranslated, _gloffset_Translated ),
- NAME_FUNC_OFFSET( 3744, glTranslatef, _gloffset_Translatef ),
- NAME_FUNC_OFFSET( 3757, glViewport, _gloffset_Viewport ),
- NAME_FUNC_OFFSET( 3768, glArrayElement, _gloffset_ArrayElement ),
- NAME_FUNC_OFFSET( 3783, glBindTexture, _gloffset_BindTexture ),
- NAME_FUNC_OFFSET( 3797, glColorPointer, _gloffset_ColorPointer ),
- NAME_FUNC_OFFSET( 3812, glDisableClientState, _gloffset_DisableClientState ),
- NAME_FUNC_OFFSET( 3833, glDrawArrays, _gloffset_DrawArrays ),
- NAME_FUNC_OFFSET( 3846, glDrawElements, _gloffset_DrawElements ),
- NAME_FUNC_OFFSET( 3861, glEdgeFlagPointer, _gloffset_EdgeFlagPointer ),
- NAME_FUNC_OFFSET( 3879, glEnableClientState, _gloffset_EnableClientState ),
- NAME_FUNC_OFFSET( 3899, glIndexPointer, _gloffset_IndexPointer ),
- NAME_FUNC_OFFSET( 3914, glIndexub, _gloffset_Indexub ),
- NAME_FUNC_OFFSET( 3924, glIndexubv, _gloffset_Indexubv ),
- NAME_FUNC_OFFSET( 3935, glInterleavedArrays, _gloffset_InterleavedArrays ),
- NAME_FUNC_OFFSET( 3955, glNormalPointer, _gloffset_NormalPointer ),
- NAME_FUNC_OFFSET( 3971, glPolygonOffset, _gloffset_PolygonOffset ),
- NAME_FUNC_OFFSET( 3987, glTexCoordPointer, _gloffset_TexCoordPointer ),
- NAME_FUNC_OFFSET( 4005, glVertexPointer, _gloffset_VertexPointer ),
- NAME_FUNC_OFFSET( 4021, glAreTexturesResident, _gloffset_AreTexturesResident ),
- NAME_FUNC_OFFSET( 4043, glCopyTexImage1D, _gloffset_CopyTexImage1D ),
- NAME_FUNC_OFFSET( 4060, glCopyTexImage2D, _gloffset_CopyTexImage2D ),
- NAME_FUNC_OFFSET( 4077, glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D ),
- NAME_FUNC_OFFSET( 4097, glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D ),
- NAME_FUNC_OFFSET( 4117, glDeleteTextures, _gloffset_DeleteTextures ),
- NAME_FUNC_OFFSET( 4134, glGenTextures, _gloffset_GenTextures ),
- NAME_FUNC_OFFSET( 4148, glGetPointerv, _gloffset_GetPointerv ),
- NAME_FUNC_OFFSET( 4162, glIsTexture, _gloffset_IsTexture ),
- NAME_FUNC_OFFSET( 4174, glPrioritizeTextures, _gloffset_PrioritizeTextures ),
- NAME_FUNC_OFFSET( 4195, glTexSubImage1D, _gloffset_TexSubImage1D ),
- NAME_FUNC_OFFSET( 4211, glTexSubImage2D, _gloffset_TexSubImage2D ),
- NAME_FUNC_OFFSET( 4227, glPopClientAttrib, _gloffset_PopClientAttrib ),
- NAME_FUNC_OFFSET( 4245, glPushClientAttrib, _gloffset_PushClientAttrib ),
- NAME_FUNC_OFFSET( 4264, glBlendColor, _gloffset_BlendColor ),
- NAME_FUNC_OFFSET( 4277, glBlendEquation, _gloffset_BlendEquation ),
- NAME_FUNC_OFFSET( 4293, glDrawRangeElements, _gloffset_DrawRangeElements ),
- NAME_FUNC_OFFSET( 4313, glColorTable, _gloffset_ColorTable ),
- NAME_FUNC_OFFSET( 4326, glColorTableParameterfv, _gloffset_ColorTableParameterfv ),
- NAME_FUNC_OFFSET( 4350, glColorTableParameteriv, _gloffset_ColorTableParameteriv ),
- NAME_FUNC_OFFSET( 4374, glCopyColorTable, _gloffset_CopyColorTable ),
- NAME_FUNC_OFFSET( 4391, glGetColorTable, _gloffset_GetColorTable ),
- NAME_FUNC_OFFSET( 4407, glGetColorTableParameterfv, _gloffset_GetColorTableParameterfv ),
- NAME_FUNC_OFFSET( 4434, glGetColorTableParameteriv, _gloffset_GetColorTableParameteriv ),
- NAME_FUNC_OFFSET( 4461, glColorSubTable, _gloffset_ColorSubTable ),
- NAME_FUNC_OFFSET( 4477, glCopyColorSubTable, _gloffset_CopyColorSubTable ),
- NAME_FUNC_OFFSET( 4497, glConvolutionFilter1D, _gloffset_ConvolutionFilter1D ),
- NAME_FUNC_OFFSET( 4519, glConvolutionFilter2D, _gloffset_ConvolutionFilter2D ),
- NAME_FUNC_OFFSET( 4541, glConvolutionParameterf, _gloffset_ConvolutionParameterf ),
- NAME_FUNC_OFFSET( 4565, glConvolutionParameterfv, _gloffset_ConvolutionParameterfv ),
- NAME_FUNC_OFFSET( 4590, glConvolutionParameteri, _gloffset_ConvolutionParameteri ),
- NAME_FUNC_OFFSET( 4614, glConvolutionParameteriv, _gloffset_ConvolutionParameteriv ),
- NAME_FUNC_OFFSET( 4639, glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D ),
- NAME_FUNC_OFFSET( 4665, glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D ),
- NAME_FUNC_OFFSET( 4691, glGetConvolutionFilter, _gloffset_GetConvolutionFilter ),
- NAME_FUNC_OFFSET( 4714, glGetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv ),
- NAME_FUNC_OFFSET( 4742, glGetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv ),
- NAME_FUNC_OFFSET( 4770, glGetSeparableFilter, _gloffset_GetSeparableFilter ),
- NAME_FUNC_OFFSET( 4791, glSeparableFilter2D, _gloffset_SeparableFilter2D ),
- NAME_FUNC_OFFSET( 4811, glGetHistogram, _gloffset_GetHistogram ),
- NAME_FUNC_OFFSET( 4826, glGetHistogramParameterfv, _gloffset_GetHistogramParameterfv ),
- NAME_FUNC_OFFSET( 4852, glGetHistogramParameteriv, _gloffset_GetHistogramParameteriv ),
- NAME_FUNC_OFFSET( 4878, glGetMinmax, _gloffset_GetMinmax ),
- NAME_FUNC_OFFSET( 4890, glGetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv ),
- NAME_FUNC_OFFSET( 4913, glGetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv ),
- NAME_FUNC_OFFSET( 4936, glHistogram, _gloffset_Histogram ),
- NAME_FUNC_OFFSET( 4948, glMinmax, _gloffset_Minmax ),
- NAME_FUNC_OFFSET( 4957, glResetHistogram, _gloffset_ResetHistogram ),
- NAME_FUNC_OFFSET( 4974, glResetMinmax, _gloffset_ResetMinmax ),
- NAME_FUNC_OFFSET( 4988, glTexImage3D, _gloffset_TexImage3D ),
- NAME_FUNC_OFFSET( 5001, glTexSubImage3D, _gloffset_TexSubImage3D ),
- NAME_FUNC_OFFSET( 5017, glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D ),
- NAME_FUNC_OFFSET( 5037, glActiveTextureARB, _gloffset_ActiveTextureARB ),
- NAME_FUNC_OFFSET( 5056, glClientActiveTextureARB, _gloffset_ClientActiveTextureARB ),
- NAME_FUNC_OFFSET( 5081, glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB ),
- NAME_FUNC_OFFSET( 5102, glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB ),
- NAME_FUNC_OFFSET( 5124, glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB ),
- NAME_FUNC_OFFSET( 5145, glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB ),
- NAME_FUNC_OFFSET( 5167, glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB ),
- NAME_FUNC_OFFSET( 5188, glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB ),
- NAME_FUNC_OFFSET( 5210, glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB ),
- NAME_FUNC_OFFSET( 5231, glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB ),
- NAME_FUNC_OFFSET( 5253, glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB ),
- NAME_FUNC_OFFSET( 5274, glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB ),
- NAME_FUNC_OFFSET( 5296, glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB ),
- NAME_FUNC_OFFSET( 5317, glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB ),
- NAME_FUNC_OFFSET( 5339, glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB ),
- NAME_FUNC_OFFSET( 5360, glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB ),
- NAME_FUNC_OFFSET( 5382, glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB ),
- NAME_FUNC_OFFSET( 5403, glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB ),
- NAME_FUNC_OFFSET( 5425, glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB ),
- NAME_FUNC_OFFSET( 5446, glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB ),
- NAME_FUNC_OFFSET( 5468, glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB ),
- NAME_FUNC_OFFSET( 5489, glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB ),
- NAME_FUNC_OFFSET( 5511, glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB ),
- NAME_FUNC_OFFSET( 5532, glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB ),
- NAME_FUNC_OFFSET( 5554, glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB ),
- NAME_FUNC_OFFSET( 5575, glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB ),
- NAME_FUNC_OFFSET( 5597, glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB ),
- NAME_FUNC_OFFSET( 5618, glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB ),
- NAME_FUNC_OFFSET( 5640, glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB ),
- NAME_FUNC_OFFSET( 5661, glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB ),
- NAME_FUNC_OFFSET( 5683, glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB ),
- NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB ),
- NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB ),
- NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB ),
- NAME_FUNC_OFFSET( 5769, glStencilFuncSeparate, _gloffset_StencilFuncSeparate ),
- NAME_FUNC_OFFSET( 5791, glStencilMaskSeparate, _gloffset_StencilMaskSeparate ),
- NAME_FUNC_OFFSET( 5813, glStencilOpSeparate, _gloffset_StencilOpSeparate ),
- NAME_FUNC_OFFSET( 5833, glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB ),
- NAME_FUNC_OFFSET( 5859, glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB ),
- NAME_FUNC_OFFSET( 5885, glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB ),
- NAME_FUNC_OFFSET( 5911, glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB ),
- NAME_FUNC_OFFSET( 5937, glSampleCoverageARB, _gloffset_SampleCoverageARB ),
- NAME_FUNC_OFFSET( 5957, glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB ),
- NAME_FUNC_OFFSET( 5983, glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB ),
- NAME_FUNC_OFFSET( 6009, glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB ),
- NAME_FUNC_OFFSET( 6035, glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB ),
- NAME_FUNC_OFFSET( 6064, glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB ),
- NAME_FUNC_OFFSET( 6093, glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB ),
- NAME_FUNC_OFFSET( 6122, glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB ),
- NAME_FUNC_OFFSET( 6149, glDisableVertexAttribArrayARB, _gloffset_DisableVertexAttribArrayARB ),
- NAME_FUNC_OFFSET( 6179, glEnableVertexAttribArrayARB, _gloffset_EnableVertexAttribArrayARB ),
- NAME_FUNC_OFFSET( 6208, glGetProgramEnvParameterdvARB, _gloffset_GetProgramEnvParameterdvARB ),
- NAME_FUNC_OFFSET( 6238, glGetProgramEnvParameterfvARB, _gloffset_GetProgramEnvParameterfvARB ),
- NAME_FUNC_OFFSET( 6268, glGetProgramLocalParameterdvARB, _gloffset_GetProgramLocalParameterdvARB ),
- NAME_FUNC_OFFSET( 6300, glGetProgramLocalParameterfvARB, _gloffset_GetProgramLocalParameterfvARB ),
- NAME_FUNC_OFFSET( 6332, glGetProgramStringARB, _gloffset_GetProgramStringARB ),
- NAME_FUNC_OFFSET( 6354, glGetProgramivARB, _gloffset_GetProgramivARB ),
- NAME_FUNC_OFFSET( 6372, glGetVertexAttribdvARB, _gloffset_GetVertexAttribdvARB ),
- NAME_FUNC_OFFSET( 6395, glGetVertexAttribfvARB, _gloffset_GetVertexAttribfvARB ),
- NAME_FUNC_OFFSET( 6418, glGetVertexAttribivARB, _gloffset_GetVertexAttribivARB ),
- NAME_FUNC_OFFSET( 6441, glProgramEnvParameter4dARB, _gloffset_ProgramEnvParameter4dARB ),
- NAME_FUNC_OFFSET( 6468, glProgramEnvParameter4dvARB, _gloffset_ProgramEnvParameter4dvARB ),
- NAME_FUNC_OFFSET( 6496, glProgramEnvParameter4fARB, _gloffset_ProgramEnvParameter4fARB ),
- NAME_FUNC_OFFSET( 6523, glProgramEnvParameter4fvARB, _gloffset_ProgramEnvParameter4fvARB ),
- NAME_FUNC_OFFSET( 6551, glProgramLocalParameter4dARB, _gloffset_ProgramLocalParameter4dARB ),
- NAME_FUNC_OFFSET( 6580, glProgramLocalParameter4dvARB, _gloffset_ProgramLocalParameter4dvARB ),
- NAME_FUNC_OFFSET( 6610, glProgramLocalParameter4fARB, _gloffset_ProgramLocalParameter4fARB ),
- NAME_FUNC_OFFSET( 6639, glProgramLocalParameter4fvARB, _gloffset_ProgramLocalParameter4fvARB ),
- NAME_FUNC_OFFSET( 6669, glProgramStringARB, _gloffset_ProgramStringARB ),
- NAME_FUNC_OFFSET( 6688, glVertexAttrib1dARB, _gloffset_VertexAttrib1dARB ),
- NAME_FUNC_OFFSET( 6708, glVertexAttrib1dvARB, _gloffset_VertexAttrib1dvARB ),
- NAME_FUNC_OFFSET( 6729, glVertexAttrib1fARB, _gloffset_VertexAttrib1fARB ),
- NAME_FUNC_OFFSET( 6749, glVertexAttrib1fvARB, _gloffset_VertexAttrib1fvARB ),
- NAME_FUNC_OFFSET( 6770, glVertexAttrib1sARB, _gloffset_VertexAttrib1sARB ),
- NAME_FUNC_OFFSET( 6790, glVertexAttrib1svARB, _gloffset_VertexAttrib1svARB ),
- NAME_FUNC_OFFSET( 6811, glVertexAttrib2dARB, _gloffset_VertexAttrib2dARB ),
- NAME_FUNC_OFFSET( 6831, glVertexAttrib2dvARB, _gloffset_VertexAttrib2dvARB ),
- NAME_FUNC_OFFSET( 6852, glVertexAttrib2fARB, _gloffset_VertexAttrib2fARB ),
- NAME_FUNC_OFFSET( 6872, glVertexAttrib2fvARB, _gloffset_VertexAttrib2fvARB ),
- NAME_FUNC_OFFSET( 6893, glVertexAttrib2sARB, _gloffset_VertexAttrib2sARB ),
- NAME_FUNC_OFFSET( 6913, glVertexAttrib2svARB, _gloffset_VertexAttrib2svARB ),
- NAME_FUNC_OFFSET( 6934, glVertexAttrib3dARB, _gloffset_VertexAttrib3dARB ),
- NAME_FUNC_OFFSET( 6954, glVertexAttrib3dvARB, _gloffset_VertexAttrib3dvARB ),
- NAME_FUNC_OFFSET( 6975, glVertexAttrib3fARB, _gloffset_VertexAttrib3fARB ),
- NAME_FUNC_OFFSET( 6995, glVertexAttrib3fvARB, _gloffset_VertexAttrib3fvARB ),
- NAME_FUNC_OFFSET( 7016, glVertexAttrib3sARB, _gloffset_VertexAttrib3sARB ),
- NAME_FUNC_OFFSET( 7036, glVertexAttrib3svARB, _gloffset_VertexAttrib3svARB ),
- NAME_FUNC_OFFSET( 7057, glVertexAttrib4NbvARB, _gloffset_VertexAttrib4NbvARB ),
- NAME_FUNC_OFFSET( 7079, glVertexAttrib4NivARB, _gloffset_VertexAttrib4NivARB ),
- NAME_FUNC_OFFSET( 7101, glVertexAttrib4NsvARB, _gloffset_VertexAttrib4NsvARB ),
- NAME_FUNC_OFFSET( 7123, glVertexAttrib4NubARB, _gloffset_VertexAttrib4NubARB ),
- NAME_FUNC_OFFSET( 7145, glVertexAttrib4NubvARB, _gloffset_VertexAttrib4NubvARB ),
- NAME_FUNC_OFFSET( 7168, glVertexAttrib4NuivARB, _gloffset_VertexAttrib4NuivARB ),
- NAME_FUNC_OFFSET( 7191, glVertexAttrib4NusvARB, _gloffset_VertexAttrib4NusvARB ),
- NAME_FUNC_OFFSET( 7214, glVertexAttrib4bvARB, _gloffset_VertexAttrib4bvARB ),
- NAME_FUNC_OFFSET( 7235, glVertexAttrib4dARB, _gloffset_VertexAttrib4dARB ),
- NAME_FUNC_OFFSET( 7255, glVertexAttrib4dvARB, _gloffset_VertexAttrib4dvARB ),
- NAME_FUNC_OFFSET( 7276, glVertexAttrib4fARB, _gloffset_VertexAttrib4fARB ),
- NAME_FUNC_OFFSET( 7296, glVertexAttrib4fvARB, _gloffset_VertexAttrib4fvARB ),
- NAME_FUNC_OFFSET( 7317, glVertexAttrib4ivARB, _gloffset_VertexAttrib4ivARB ),
- NAME_FUNC_OFFSET( 7338, glVertexAttrib4sARB, _gloffset_VertexAttrib4sARB ),
- NAME_FUNC_OFFSET( 7358, glVertexAttrib4svARB, _gloffset_VertexAttrib4svARB ),
- NAME_FUNC_OFFSET( 7379, glVertexAttrib4ubvARB, _gloffset_VertexAttrib4ubvARB ),
- NAME_FUNC_OFFSET( 7401, glVertexAttrib4uivARB, _gloffset_VertexAttrib4uivARB ),
- NAME_FUNC_OFFSET( 7423, glVertexAttrib4usvARB, _gloffset_VertexAttrib4usvARB ),
- NAME_FUNC_OFFSET( 7445, glVertexAttribPointerARB, _gloffset_VertexAttribPointerARB ),
- NAME_FUNC_OFFSET( 7470, glBindBufferARB, _gloffset_BindBufferARB ),
- NAME_FUNC_OFFSET( 7486, glBufferDataARB, _gloffset_BufferDataARB ),
- NAME_FUNC_OFFSET( 7502, glBufferSubDataARB, _gloffset_BufferSubDataARB ),
- NAME_FUNC_OFFSET( 7521, glDeleteBuffersARB, _gloffset_DeleteBuffersARB ),
- NAME_FUNC_OFFSET( 7540, glGenBuffersARB, _gloffset_GenBuffersARB ),
- NAME_FUNC_OFFSET( 7556, glGetBufferParameterivARB, _gloffset_GetBufferParameterivARB ),
- NAME_FUNC_OFFSET( 7582, glGetBufferPointervARB, _gloffset_GetBufferPointervARB ),
- NAME_FUNC_OFFSET( 7605, glGetBufferSubDataARB, _gloffset_GetBufferSubDataARB ),
- NAME_FUNC_OFFSET( 7627, glIsBufferARB, _gloffset_IsBufferARB ),
- NAME_FUNC_OFFSET( 7641, glMapBufferARB, _gloffset_MapBufferARB ),
- NAME_FUNC_OFFSET( 7656, glUnmapBufferARB, _gloffset_UnmapBufferARB ),
- NAME_FUNC_OFFSET( 7673, glBeginQueryARB, _gloffset_BeginQueryARB ),
- NAME_FUNC_OFFSET( 7689, glDeleteQueriesARB, _gloffset_DeleteQueriesARB ),
- NAME_FUNC_OFFSET( 7708, glEndQueryARB, _gloffset_EndQueryARB ),
- NAME_FUNC_OFFSET( 7722, glGenQueriesARB, _gloffset_GenQueriesARB ),
- NAME_FUNC_OFFSET( 7738, glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB ),
- NAME_FUNC_OFFSET( 7760, glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB ),
- NAME_FUNC_OFFSET( 7783, glGetQueryivARB, _gloffset_GetQueryivARB ),
- NAME_FUNC_OFFSET( 7799, glIsQueryARB, _gloffset_IsQueryARB ),
- NAME_FUNC_OFFSET( 7812, glAttachObjectARB, _gloffset_AttachObjectARB ),
- NAME_FUNC_OFFSET( 7830, glCompileShaderARB, _gloffset_CompileShaderARB ),
- NAME_FUNC_OFFSET( 7849, glCreateProgramObjectARB, _gloffset_CreateProgramObjectARB ),
- NAME_FUNC_OFFSET( 7874, glCreateShaderObjectARB, _gloffset_CreateShaderObjectARB ),
- NAME_FUNC_OFFSET( 7898, glDeleteObjectARB, _gloffset_DeleteObjectARB ),
- NAME_FUNC_OFFSET( 7916, glDetachObjectARB, _gloffset_DetachObjectARB ),
- NAME_FUNC_OFFSET( 7934, glGetActiveUniformARB, _gloffset_GetActiveUniformARB ),
- NAME_FUNC_OFFSET( 7956, glGetAttachedObjectsARB, _gloffset_GetAttachedObjectsARB ),
- NAME_FUNC_OFFSET( 7980, glGetHandleARB, _gloffset_GetHandleARB ),
- NAME_FUNC_OFFSET( 7995, glGetInfoLogARB, _gloffset_GetInfoLogARB ),
- NAME_FUNC_OFFSET( 8011, glGetObjectParameterfvARB, _gloffset_GetObjectParameterfvARB ),
- NAME_FUNC_OFFSET( 8037, glGetObjectParameterivARB, _gloffset_GetObjectParameterivARB ),
- NAME_FUNC_OFFSET( 8063, glGetShaderSourceARB, _gloffset_GetShaderSourceARB ),
- NAME_FUNC_OFFSET( 8084, glGetUniformLocationARB, _gloffset_GetUniformLocationARB ),
- NAME_FUNC_OFFSET( 8108, glGetUniformfvARB, _gloffset_GetUniformfvARB ),
- NAME_FUNC_OFFSET( 8126, glGetUniformivARB, _gloffset_GetUniformivARB ),
- NAME_FUNC_OFFSET( 8144, glLinkProgramARB, _gloffset_LinkProgramARB ),
- NAME_FUNC_OFFSET( 8161, glShaderSourceARB, _gloffset_ShaderSourceARB ),
- NAME_FUNC_OFFSET( 8179, glUniform1fARB, _gloffset_Uniform1fARB ),
- NAME_FUNC_OFFSET( 8194, glUniform1fvARB, _gloffset_Uniform1fvARB ),
- NAME_FUNC_OFFSET( 8210, glUniform1iARB, _gloffset_Uniform1iARB ),
- NAME_FUNC_OFFSET( 8225, glUniform1ivARB, _gloffset_Uniform1ivARB ),
- NAME_FUNC_OFFSET( 8241, glUniform2fARB, _gloffset_Uniform2fARB ),
- NAME_FUNC_OFFSET( 8256, glUniform2fvARB, _gloffset_Uniform2fvARB ),
- NAME_FUNC_OFFSET( 8272, glUniform2iARB, _gloffset_Uniform2iARB ),
- NAME_FUNC_OFFSET( 8287, glUniform2ivARB, _gloffset_Uniform2ivARB ),
- NAME_FUNC_OFFSET( 8303, glUniform3fARB, _gloffset_Uniform3fARB ),
- NAME_FUNC_OFFSET( 8318, glUniform3fvARB, _gloffset_Uniform3fvARB ),
- NAME_FUNC_OFFSET( 8334, glUniform3iARB, _gloffset_Uniform3iARB ),
- NAME_FUNC_OFFSET( 8349, glUniform3ivARB, _gloffset_Uniform3ivARB ),
- NAME_FUNC_OFFSET( 8365, glUniform4fARB, _gloffset_Uniform4fARB ),
- NAME_FUNC_OFFSET( 8380, glUniform4fvARB, _gloffset_Uniform4fvARB ),
- NAME_FUNC_OFFSET( 8396, glUniform4iARB, _gloffset_Uniform4iARB ),
- NAME_FUNC_OFFSET( 8411, glUniform4ivARB, _gloffset_Uniform4ivARB ),
- NAME_FUNC_OFFSET( 8427, glUniformMatrix2fvARB, _gloffset_UniformMatrix2fvARB ),
- NAME_FUNC_OFFSET( 8449, glUniformMatrix3fvARB, _gloffset_UniformMatrix3fvARB ),
- NAME_FUNC_OFFSET( 8471, glUniformMatrix4fvARB, _gloffset_UniformMatrix4fvARB ),
- NAME_FUNC_OFFSET( 8493, glUseProgramObjectARB, _gloffset_UseProgramObjectARB ),
- NAME_FUNC_OFFSET( 8515, glValidateProgramARB, _gloffset_ValidateProgramARB ),
- NAME_FUNC_OFFSET( 8536, glBindAttribLocationARB, _gloffset_BindAttribLocationARB ),
- NAME_FUNC_OFFSET( 8560, glGetActiveAttribARB, _gloffset_GetActiveAttribARB ),
- NAME_FUNC_OFFSET( 8581, glGetAttribLocationARB, _gloffset_GetAttribLocationARB ),
- NAME_FUNC_OFFSET( 8604, glDrawBuffersARB, _gloffset_DrawBuffersARB ),
- NAME_FUNC_OFFSET( 8621, glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT ),
- NAME_FUNC_OFFSET( 8640, gl_dispatch_stub_543, _gloffset_GetHistogramEXT ),
- NAME_FUNC_OFFSET( 8658, gl_dispatch_stub_544, _gloffset_GetHistogramParameterfvEXT ),
- NAME_FUNC_OFFSET( 8687, gl_dispatch_stub_545, _gloffset_GetHistogramParameterivEXT ),
- NAME_FUNC_OFFSET( 8716, gl_dispatch_stub_546, _gloffset_GetMinmaxEXT ),
- NAME_FUNC_OFFSET( 8731, gl_dispatch_stub_547, _gloffset_GetMinmaxParameterfvEXT ),
- NAME_FUNC_OFFSET( 8757, gl_dispatch_stub_548, _gloffset_GetMinmaxParameterivEXT ),
- NAME_FUNC_OFFSET( 8783, gl_dispatch_stub_549, _gloffset_GetConvolutionFilterEXT ),
- NAME_FUNC_OFFSET( 8809, gl_dispatch_stub_550, _gloffset_GetConvolutionParameterfvEXT ),
- NAME_FUNC_OFFSET( 8840, gl_dispatch_stub_551, _gloffset_GetConvolutionParameterivEXT ),
- NAME_FUNC_OFFSET( 8871, gl_dispatch_stub_552, _gloffset_GetSeparableFilterEXT ),
- NAME_FUNC_OFFSET( 8895, gl_dispatch_stub_553, _gloffset_GetColorTableParameterfvSGI ),
- NAME_FUNC_OFFSET( 8925, gl_dispatch_stub_554, _gloffset_GetColorTableParameterivSGI ),
- NAME_FUNC_OFFSET( 8955, gl_dispatch_stub_555, _gloffset_GetColorTableSGI ),
- NAME_FUNC_OFFSET( 8974, gl_dispatch_stub_556, _gloffset_GetPixelTexGenParameterfvSGIS ),
- NAME_FUNC_OFFSET( 9006, gl_dispatch_stub_557, _gloffset_GetPixelTexGenParameterivSGIS ),
- NAME_FUNC_OFFSET( 9038, gl_dispatch_stub_558, _gloffset_PixelTexGenParameterfSGIS ),
- NAME_FUNC_OFFSET( 9066, gl_dispatch_stub_559, _gloffset_PixelTexGenParameterfvSGIS ),
- NAME_FUNC_OFFSET( 9095, gl_dispatch_stub_560, _gloffset_PixelTexGenParameteriSGIS ),
- NAME_FUNC_OFFSET( 9123, gl_dispatch_stub_561, _gloffset_PixelTexGenParameterivSGIS ),
- NAME_FUNC_OFFSET( 9152, glAreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT ),
- NAME_FUNC_OFFSET( 9177, glGenTexturesEXT, _gloffset_GenTexturesEXT ),
- NAME_FUNC_OFFSET( 9194, glIsTextureEXT, _gloffset_IsTextureEXT ),
- NAME_FUNC_OFFSET( 9209, gl_dispatch_stub_565, _gloffset_SampleMaskSGIS ),
- NAME_FUNC_OFFSET( 9226, gl_dispatch_stub_566, _gloffset_SamplePatternSGIS ),
- NAME_FUNC_OFFSET( 9246, glColorPointerEXT, _gloffset_ColorPointerEXT ),
- NAME_FUNC_OFFSET( 9264, glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT ),
- NAME_FUNC_OFFSET( 9285, glIndexPointerEXT, _gloffset_IndexPointerEXT ),
- NAME_FUNC_OFFSET( 9303, glNormalPointerEXT, _gloffset_NormalPointerEXT ),
- NAME_FUNC_OFFSET( 9322, glTexCoordPointerEXT, _gloffset_TexCoordPointerEXT ),
- NAME_FUNC_OFFSET( 9343, glVertexPointerEXT, _gloffset_VertexPointerEXT ),
- NAME_FUNC_OFFSET( 9362, glPointParameterfEXT, _gloffset_PointParameterfEXT ),
- NAME_FUNC_OFFSET( 9383, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( 9405, glLockArraysEXT, _gloffset_LockArraysEXT ),
- NAME_FUNC_OFFSET( 9421, glUnlockArraysEXT, _gloffset_UnlockArraysEXT ),
- NAME_FUNC_OFFSET( 9439, gl_dispatch_stub_577, _gloffset_CullParameterdvEXT ),
- NAME_FUNC_OFFSET( 9460, gl_dispatch_stub_578, _gloffset_CullParameterfvEXT ),
- NAME_FUNC_OFFSET( 9481, glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT ),
- NAME_FUNC_OFFSET( 9503, glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT ),
- NAME_FUNC_OFFSET( 9526, glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT ),
- NAME_FUNC_OFFSET( 9548, glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT ),
- NAME_FUNC_OFFSET( 9571, glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT ),
- NAME_FUNC_OFFSET( 9593, glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT ),
- NAME_FUNC_OFFSET( 9616, glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT ),
- NAME_FUNC_OFFSET( 9638, glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT ),
- NAME_FUNC_OFFSET( 9661, glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT ),
- NAME_FUNC_OFFSET( 9683, glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT ),
- NAME_FUNC_OFFSET( 9706, glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT ),
- NAME_FUNC_OFFSET( 9729, glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT ),
- NAME_FUNC_OFFSET( 9753, glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT ),
- NAME_FUNC_OFFSET( 9776, glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT ),
- NAME_FUNC_OFFSET( 9800, glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT ),
- NAME_FUNC_OFFSET( 9823, glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT ),
- NAME_FUNC_OFFSET( 9847, glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT ),
- NAME_FUNC_OFFSET( 9874, glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT ),
- NAME_FUNC_OFFSET( 9895, glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT ),
- NAME_FUNC_OFFSET( 9918, glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT ),
- NAME_FUNC_OFFSET( 9939, glFogCoorddEXT, _gloffset_FogCoorddEXT ),
- NAME_FUNC_OFFSET( 9954, glFogCoorddvEXT, _gloffset_FogCoorddvEXT ),
- NAME_FUNC_OFFSET( 9970, glFogCoordfEXT, _gloffset_FogCoordfEXT ),
- NAME_FUNC_OFFSET( 9985, glFogCoordfvEXT, _gloffset_FogCoordfvEXT ),
- NAME_FUNC_OFFSET( 10001, gl_dispatch_stub_603, _gloffset_PixelTexGenSGIX ),
- NAME_FUNC_OFFSET( 10019, glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT ),
- NAME_FUNC_OFFSET( 10042, glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV ),
- NAME_FUNC_OFFSET( 10068, glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV ),
- NAME_FUNC_OFFSET( 10089, glCombinerInputNV, _gloffset_CombinerInputNV ),
- NAME_FUNC_OFFSET( 10107, glCombinerOutputNV, _gloffset_CombinerOutputNV ),
- NAME_FUNC_OFFSET( 10126, glCombinerParameterfNV, _gloffset_CombinerParameterfNV ),
- NAME_FUNC_OFFSET( 10149, glCombinerParameterfvNV, _gloffset_CombinerParameterfvNV ),
- NAME_FUNC_OFFSET( 10173, glCombinerParameteriNV, _gloffset_CombinerParameteriNV ),
- NAME_FUNC_OFFSET( 10196, glCombinerParameterivNV, _gloffset_CombinerParameterivNV ),
- NAME_FUNC_OFFSET( 10220, glFinalCombinerInputNV, _gloffset_FinalCombinerInputNV ),
- NAME_FUNC_OFFSET( 10243, glGetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV ),
- NAME_FUNC_OFFSET( 10275, glGetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV ),
- NAME_FUNC_OFFSET( 10307, glGetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV ),
- NAME_FUNC_OFFSET( 10340, glGetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV ),
- NAME_FUNC_OFFSET( 10373, glGetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV ),
- NAME_FUNC_OFFSET( 10410, glGetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV ),
- NAME_FUNC_OFFSET( 10447, glResizeBuffersMESA, _gloffset_ResizeBuffersMESA ),
- NAME_FUNC_OFFSET( 10467, glWindowPos2dMESA, _gloffset_WindowPos2dMESA ),
- NAME_FUNC_OFFSET( 10485, glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA ),
- NAME_FUNC_OFFSET( 10504, glWindowPos2fMESA, _gloffset_WindowPos2fMESA ),
- NAME_FUNC_OFFSET( 10522, glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA ),
- NAME_FUNC_OFFSET( 10541, glWindowPos2iMESA, _gloffset_WindowPos2iMESA ),
- NAME_FUNC_OFFSET( 10559, glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA ),
- NAME_FUNC_OFFSET( 10578, glWindowPos2sMESA, _gloffset_WindowPos2sMESA ),
- NAME_FUNC_OFFSET( 10596, glWindowPos2svMESA, _gloffset_WindowPos2svMESA ),
- NAME_FUNC_OFFSET( 10615, glWindowPos3dMESA, _gloffset_WindowPos3dMESA ),
- NAME_FUNC_OFFSET( 10633, glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA ),
- NAME_FUNC_OFFSET( 10652, glWindowPos3fMESA, _gloffset_WindowPos3fMESA ),
- NAME_FUNC_OFFSET( 10670, glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA ),
- NAME_FUNC_OFFSET( 10689, glWindowPos3iMESA, _gloffset_WindowPos3iMESA ),
- NAME_FUNC_OFFSET( 10707, glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA ),
- NAME_FUNC_OFFSET( 10726, glWindowPos3sMESA, _gloffset_WindowPos3sMESA ),
- NAME_FUNC_OFFSET( 10744, glWindowPos3svMESA, _gloffset_WindowPos3svMESA ),
- NAME_FUNC_OFFSET( 10763, glWindowPos4dMESA, _gloffset_WindowPos4dMESA ),
- NAME_FUNC_OFFSET( 10781, glWindowPos4dvMESA, _gloffset_WindowPos4dvMESA ),
- NAME_FUNC_OFFSET( 10800, glWindowPos4fMESA, _gloffset_WindowPos4fMESA ),
- NAME_FUNC_OFFSET( 10818, glWindowPos4fvMESA, _gloffset_WindowPos4fvMESA ),
- NAME_FUNC_OFFSET( 10837, glWindowPos4iMESA, _gloffset_WindowPos4iMESA ),
- NAME_FUNC_OFFSET( 10855, glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA ),
- NAME_FUNC_OFFSET( 10874, glWindowPos4sMESA, _gloffset_WindowPos4sMESA ),
- NAME_FUNC_OFFSET( 10892, glWindowPos4svMESA, _gloffset_WindowPos4svMESA ),
- NAME_FUNC_OFFSET( 10911, gl_dispatch_stub_645, _gloffset_MultiModeDrawArraysIBM ),
- NAME_FUNC_OFFSET( 10936, gl_dispatch_stub_646, _gloffset_MultiModeDrawElementsIBM ),
- NAME_FUNC_OFFSET( 10963, gl_dispatch_stub_647, _gloffset_DeleteFencesNV ),
- NAME_FUNC_OFFSET( 10980, gl_dispatch_stub_648, _gloffset_FinishFenceNV ),
- NAME_FUNC_OFFSET( 10996, gl_dispatch_stub_649, _gloffset_GenFencesNV ),
- NAME_FUNC_OFFSET( 11010, gl_dispatch_stub_650, _gloffset_GetFenceivNV ),
- NAME_FUNC_OFFSET( 11025, gl_dispatch_stub_651, _gloffset_IsFenceNV ),
- NAME_FUNC_OFFSET( 11037, gl_dispatch_stub_652, _gloffset_SetFenceNV ),
- NAME_FUNC_OFFSET( 11050, gl_dispatch_stub_653, _gloffset_TestFenceNV ),
- NAME_FUNC_OFFSET( 11064, glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV ),
- NAME_FUNC_OFFSET( 11088, glBindProgramNV, _gloffset_BindProgramNV ),
- NAME_FUNC_OFFSET( 11104, glDeleteProgramsNV, _gloffset_DeleteProgramsNV ),
- NAME_FUNC_OFFSET( 11123, glExecuteProgramNV, _gloffset_ExecuteProgramNV ),
- NAME_FUNC_OFFSET( 11142, glGenProgramsNV, _gloffset_GenProgramsNV ),
- NAME_FUNC_OFFSET( 11158, glGetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV ),
- NAME_FUNC_OFFSET( 11184, glGetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV ),
- NAME_FUNC_OFFSET( 11210, glGetProgramStringNV, _gloffset_GetProgramStringNV ),
- NAME_FUNC_OFFSET( 11231, glGetProgramivNV, _gloffset_GetProgramivNV ),
- NAME_FUNC_OFFSET( 11248, glGetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV ),
- NAME_FUNC_OFFSET( 11269, glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV ),
- NAME_FUNC_OFFSET( 11297, glGetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV ),
- NAME_FUNC_OFFSET( 11319, glGetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV ),
- NAME_FUNC_OFFSET( 11341, glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV ),
- NAME_FUNC_OFFSET( 11363, glIsProgramNV, _gloffset_IsProgramNV ),
- NAME_FUNC_OFFSET( 11377, glLoadProgramNV, _gloffset_LoadProgramNV ),
- NAME_FUNC_OFFSET( 11393, glProgramParameter4dNV, _gloffset_ProgramParameter4dNV ),
- NAME_FUNC_OFFSET( 11416, glProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV ),
- NAME_FUNC_OFFSET( 11440, glProgramParameter4fNV, _gloffset_ProgramParameter4fNV ),
- NAME_FUNC_OFFSET( 11463, glProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV ),
- NAME_FUNC_OFFSET( 11487, glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV ),
- NAME_FUNC_OFFSET( 11512, glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV ),
- NAME_FUNC_OFFSET( 11537, glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV ),
- NAME_FUNC_OFFSET( 11565, glTrackMatrixNV, _gloffset_TrackMatrixNV ),
- NAME_FUNC_OFFSET( 11581, glVertexAttrib1dNV, _gloffset_VertexAttrib1dNV ),
- NAME_FUNC_OFFSET( 11600, glVertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV ),
- NAME_FUNC_OFFSET( 11620, glVertexAttrib1fNV, _gloffset_VertexAttrib1fNV ),
- NAME_FUNC_OFFSET( 11639, glVertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV ),
- NAME_FUNC_OFFSET( 11659, glVertexAttrib1sNV, _gloffset_VertexAttrib1sNV ),
- NAME_FUNC_OFFSET( 11678, glVertexAttrib1svNV, _gloffset_VertexAttrib1svNV ),
- NAME_FUNC_OFFSET( 11698, glVertexAttrib2dNV, _gloffset_VertexAttrib2dNV ),
- NAME_FUNC_OFFSET( 11717, glVertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV ),
- NAME_FUNC_OFFSET( 11737, glVertexAttrib2fNV, _gloffset_VertexAttrib2fNV ),
- NAME_FUNC_OFFSET( 11756, glVertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV ),
- NAME_FUNC_OFFSET( 11776, glVertexAttrib2sNV, _gloffset_VertexAttrib2sNV ),
- NAME_FUNC_OFFSET( 11795, glVertexAttrib2svNV, _gloffset_VertexAttrib2svNV ),
- NAME_FUNC_OFFSET( 11815, glVertexAttrib3dNV, _gloffset_VertexAttrib3dNV ),
- NAME_FUNC_OFFSET( 11834, glVertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV ),
- NAME_FUNC_OFFSET( 11854, glVertexAttrib3fNV, _gloffset_VertexAttrib3fNV ),
- NAME_FUNC_OFFSET( 11873, glVertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV ),
- NAME_FUNC_OFFSET( 11893, glVertexAttrib3sNV, _gloffset_VertexAttrib3sNV ),
- NAME_FUNC_OFFSET( 11912, glVertexAttrib3svNV, _gloffset_VertexAttrib3svNV ),
- NAME_FUNC_OFFSET( 11932, glVertexAttrib4dNV, _gloffset_VertexAttrib4dNV ),
- NAME_FUNC_OFFSET( 11951, glVertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV ),
- NAME_FUNC_OFFSET( 11971, glVertexAttrib4fNV, _gloffset_VertexAttrib4fNV ),
- NAME_FUNC_OFFSET( 11990, glVertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV ),
- NAME_FUNC_OFFSET( 12010, glVertexAttrib4sNV, _gloffset_VertexAttrib4sNV ),
- NAME_FUNC_OFFSET( 12029, glVertexAttrib4svNV, _gloffset_VertexAttrib4svNV ),
- NAME_FUNC_OFFSET( 12049, glVertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV ),
- NAME_FUNC_OFFSET( 12069, glVertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV ),
- NAME_FUNC_OFFSET( 12090, glVertexAttribPointerNV, _gloffset_VertexAttribPointerNV ),
- NAME_FUNC_OFFSET( 12114, glVertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV ),
- NAME_FUNC_OFFSET( 12135, glVertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV ),
- NAME_FUNC_OFFSET( 12156, glVertexAttribs1svNV, _gloffset_VertexAttribs1svNV ),
- NAME_FUNC_OFFSET( 12177, glVertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV ),
- NAME_FUNC_OFFSET( 12198, glVertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV ),
- NAME_FUNC_OFFSET( 12219, glVertexAttribs2svNV, _gloffset_VertexAttribs2svNV ),
- NAME_FUNC_OFFSET( 12240, glVertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV ),
- NAME_FUNC_OFFSET( 12261, glVertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV ),
- NAME_FUNC_OFFSET( 12282, glVertexAttribs3svNV, _gloffset_VertexAttribs3svNV ),
- NAME_FUNC_OFFSET( 12303, glVertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV ),
- NAME_FUNC_OFFSET( 12324, glVertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV ),
- NAME_FUNC_OFFSET( 12345, glVertexAttribs4svNV, _gloffset_VertexAttribs4svNV ),
- NAME_FUNC_OFFSET( 12366, glVertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV ),
- NAME_FUNC_OFFSET( 12388, glAlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI ),
- NAME_FUNC_OFFSET( 12410, glAlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI ),
- NAME_FUNC_OFFSET( 12432, glAlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI ),
- NAME_FUNC_OFFSET( 12454, glBeginFragmentShaderATI, _gloffset_BeginFragmentShaderATI ),
- NAME_FUNC_OFFSET( 12479, glBindFragmentShaderATI, _gloffset_BindFragmentShaderATI ),
- NAME_FUNC_OFFSET( 12503, glColorFragmentOp1ATI, _gloffset_ColorFragmentOp1ATI ),
- NAME_FUNC_OFFSET( 12525, glColorFragmentOp2ATI, _gloffset_ColorFragmentOp2ATI ),
- NAME_FUNC_OFFSET( 12547, glColorFragmentOp3ATI, _gloffset_ColorFragmentOp3ATI ),
- NAME_FUNC_OFFSET( 12569, glDeleteFragmentShaderATI, _gloffset_DeleteFragmentShaderATI ),
- NAME_FUNC_OFFSET( 12595, glEndFragmentShaderATI, _gloffset_EndFragmentShaderATI ),
- NAME_FUNC_OFFSET( 12618, glGenFragmentShadersATI, _gloffset_GenFragmentShadersATI ),
- NAME_FUNC_OFFSET( 12642, glPassTexCoordATI, _gloffset_PassTexCoordATI ),
- NAME_FUNC_OFFSET( 12660, glSampleMapATI, _gloffset_SampleMapATI ),
- NAME_FUNC_OFFSET( 12675, glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI ),
- NAME_FUNC_OFFSET( 12706, glPointParameteriNV, _gloffset_PointParameteriNV ),
- NAME_FUNC_OFFSET( 12726, glPointParameterivNV, _gloffset_PointParameterivNV ),
- NAME_FUNC_OFFSET( 12747, gl_dispatch_stub_734, _gloffset_ActiveStencilFaceEXT ),
- NAME_FUNC_OFFSET( 12770, gl_dispatch_stub_735, _gloffset_BindVertexArrayAPPLE ),
- NAME_FUNC_OFFSET( 12793, gl_dispatch_stub_736, _gloffset_DeleteVertexArraysAPPLE ),
- NAME_FUNC_OFFSET( 12819, gl_dispatch_stub_737, _gloffset_GenVertexArraysAPPLE ),
- NAME_FUNC_OFFSET( 12842, gl_dispatch_stub_738, _gloffset_IsVertexArrayAPPLE ),
- NAME_FUNC_OFFSET( 12863, glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV ),
- NAME_FUNC_OFFSET( 12894, glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV ),
- NAME_FUNC_OFFSET( 12925, glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV ),
- NAME_FUNC_OFFSET( 12953, glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV ),
- NAME_FUNC_OFFSET( 12982, glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV ),
- NAME_FUNC_OFFSET( 13010, glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV ),
- NAME_FUNC_OFFSET( 13039, gl_dispatch_stub_745, _gloffset_DepthBoundsEXT ),
- NAME_FUNC_OFFSET( 13056, gl_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT ),
- NAME_FUNC_OFFSET( 13083, glBindFramebufferEXT, _gloffset_BindFramebufferEXT ),
- NAME_FUNC_OFFSET( 13104, glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT ),
- NAME_FUNC_OFFSET( 13126, glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT ),
- NAME_FUNC_OFFSET( 13154, glDeleteFramebuffersEXT, _gloffset_DeleteFramebuffersEXT ),
- NAME_FUNC_OFFSET( 13178, glDeleteRenderbuffersEXT, _gloffset_DeleteRenderbuffersEXT ),
- NAME_FUNC_OFFSET( 13203, glFramebufferRenderbufferEXT, _gloffset_FramebufferRenderbufferEXT ),
- NAME_FUNC_OFFSET( 13232, glFramebufferTexture1DEXT, _gloffset_FramebufferTexture1DEXT ),
- NAME_FUNC_OFFSET( 13258, glFramebufferTexture2DEXT, _gloffset_FramebufferTexture2DEXT ),
- NAME_FUNC_OFFSET( 13284, glFramebufferTexture3DEXT, _gloffset_FramebufferTexture3DEXT ),
- NAME_FUNC_OFFSET( 13310, glGenFramebuffersEXT, _gloffset_GenFramebuffersEXT ),
- NAME_FUNC_OFFSET( 13331, glGenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT ),
- NAME_FUNC_OFFSET( 13353, glGenerateMipmapEXT, _gloffset_GenerateMipmapEXT ),
- NAME_FUNC_OFFSET( 13373, glGetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT ),
- NAME_FUNC_OFFSET( 13414, gl_dispatch_stub_760, _gloffset_GetQueryObjecti64vEXT ),
- NAME_FUNC_OFFSET( 13438, gl_dispatch_stub_761, _gloffset_GetQueryObjectui64vEXT ),
- NAME_FUNC_OFFSET( 13463, glGetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT ),
- NAME_FUNC_OFFSET( 13495, glIsFramebufferEXT, _gloffset_IsFramebufferEXT ),
- NAME_FUNC_OFFSET( 13514, glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT ),
- NAME_FUNC_OFFSET( 13534, glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT ),
- NAME_FUNC_OFFSET( 13559, gl_dispatch_stub_766, _gloffset_BlitFramebufferEXT ),
- NAME_FUNC_OFFSET( 13580, gl_dispatch_stub_767, _gloffset_ProgramEnvParameters4fvEXT ),
- NAME_FUNC_OFFSET( 13609, gl_dispatch_stub_768, _gloffset_ProgramLocalParameters4fvEXT ),
- NAME_FUNC_OFFSET( 13640, glArrayElement, _gloffset_ArrayElement ),
- NAME_FUNC_OFFSET( 13658, glBindTexture, _gloffset_BindTexture ),
- NAME_FUNC_OFFSET( 13675, glDrawArrays, _gloffset_DrawArrays ),
- NAME_FUNC_OFFSET( 13691, glCopyTexImage1D, _gloffset_CopyTexImage1D ),
- NAME_FUNC_OFFSET( 13711, glCopyTexImage2D, _gloffset_CopyTexImage2D ),
- NAME_FUNC_OFFSET( 13731, glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D ),
- NAME_FUNC_OFFSET( 13754, glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D ),
- NAME_FUNC_OFFSET( 13777, glDeleteTextures, _gloffset_DeleteTextures ),
- NAME_FUNC_OFFSET( 13797, glGetPointerv, _gloffset_GetPointerv ),
- NAME_FUNC_OFFSET( 13814, glPrioritizeTextures, _gloffset_PrioritizeTextures ),
- NAME_FUNC_OFFSET( 13838, glTexSubImage1D, _gloffset_TexSubImage1D ),
- NAME_FUNC_OFFSET( 13857, glTexSubImage2D, _gloffset_TexSubImage2D ),
- NAME_FUNC_OFFSET( 13876, glBlendColor, _gloffset_BlendColor ),
- NAME_FUNC_OFFSET( 13892, glBlendEquation, _gloffset_BlendEquation ),
- NAME_FUNC_OFFSET( 13911, glDrawRangeElements, _gloffset_DrawRangeElements ),
- NAME_FUNC_OFFSET( 13934, glColorTable, _gloffset_ColorTable ),
- NAME_FUNC_OFFSET( 13950, glColorTable, _gloffset_ColorTable ),
- NAME_FUNC_OFFSET( 13966, glColorTableParameterfv, _gloffset_ColorTableParameterfv ),
- NAME_FUNC_OFFSET( 13993, glColorTableParameteriv, _gloffset_ColorTableParameteriv ),
- NAME_FUNC_OFFSET( 14020, glCopyColorTable, _gloffset_CopyColorTable ),
- NAME_FUNC_OFFSET( 14040, glColorSubTable, _gloffset_ColorSubTable ),
- NAME_FUNC_OFFSET( 14059, glCopyColorSubTable, _gloffset_CopyColorSubTable ),
- NAME_FUNC_OFFSET( 14082, glConvolutionFilter1D, _gloffset_ConvolutionFilter1D ),
- NAME_FUNC_OFFSET( 14107, glConvolutionFilter2D, _gloffset_ConvolutionFilter2D ),
- NAME_FUNC_OFFSET( 14132, glConvolutionParameterf, _gloffset_ConvolutionParameterf ),
- NAME_FUNC_OFFSET( 14159, glConvolutionParameterfv, _gloffset_ConvolutionParameterfv ),
- NAME_FUNC_OFFSET( 14187, glConvolutionParameteri, _gloffset_ConvolutionParameteri ),
- NAME_FUNC_OFFSET( 14214, glConvolutionParameteriv, _gloffset_ConvolutionParameteriv ),
- NAME_FUNC_OFFSET( 14242, glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D ),
- NAME_FUNC_OFFSET( 14271, glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D ),
- NAME_FUNC_OFFSET( 14300, glSeparableFilter2D, _gloffset_SeparableFilter2D ),
- NAME_FUNC_OFFSET( 14323, glHistogram, _gloffset_Histogram ),
- NAME_FUNC_OFFSET( 14338, glMinmax, _gloffset_Minmax ),
- NAME_FUNC_OFFSET( 14350, glResetHistogram, _gloffset_ResetHistogram ),
- NAME_FUNC_OFFSET( 14370, glResetMinmax, _gloffset_ResetMinmax ),
- NAME_FUNC_OFFSET( 14387, glTexImage3D, _gloffset_TexImage3D ),
- NAME_FUNC_OFFSET( 14403, glTexSubImage3D, _gloffset_TexSubImage3D ),
- NAME_FUNC_OFFSET( 14422, glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D ),
- NAME_FUNC_OFFSET( 14445, glActiveTextureARB, _gloffset_ActiveTextureARB ),
- NAME_FUNC_OFFSET( 14461, glClientActiveTextureARB, _gloffset_ClientActiveTextureARB ),
- NAME_FUNC_OFFSET( 14483, glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB ),
- NAME_FUNC_OFFSET( 14501, glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB ),
- NAME_FUNC_OFFSET( 14520, glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB ),
- NAME_FUNC_OFFSET( 14538, glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB ),
- NAME_FUNC_OFFSET( 14557, glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB ),
- NAME_FUNC_OFFSET( 14575, glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB ),
- NAME_FUNC_OFFSET( 14594, glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB ),
- NAME_FUNC_OFFSET( 14612, glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB ),
- NAME_FUNC_OFFSET( 14631, glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB ),
- NAME_FUNC_OFFSET( 14649, glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB ),
- NAME_FUNC_OFFSET( 14668, glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB ),
- NAME_FUNC_OFFSET( 14686, glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB ),
- NAME_FUNC_OFFSET( 14705, glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB ),
- NAME_FUNC_OFFSET( 14723, glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB ),
- NAME_FUNC_OFFSET( 14742, glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB ),
- NAME_FUNC_OFFSET( 14760, glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB ),
- NAME_FUNC_OFFSET( 14779, glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB ),
- NAME_FUNC_OFFSET( 14797, glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB ),
- NAME_FUNC_OFFSET( 14816, glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB ),
- NAME_FUNC_OFFSET( 14834, glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB ),
- NAME_FUNC_OFFSET( 14853, glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB ),
- NAME_FUNC_OFFSET( 14871, glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB ),
- NAME_FUNC_OFFSET( 14890, glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB ),
- NAME_FUNC_OFFSET( 14908, glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB ),
- NAME_FUNC_OFFSET( 14927, glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB ),
- NAME_FUNC_OFFSET( 14945, glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB ),
- NAME_FUNC_OFFSET( 14964, glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB ),
- NAME_FUNC_OFFSET( 14982, glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB ),
- NAME_FUNC_OFFSET( 15001, glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB ),
- NAME_FUNC_OFFSET( 15019, glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB ),
- NAME_FUNC_OFFSET( 15038, glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB ),
- NAME_FUNC_OFFSET( 15056, glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB ),
- NAME_FUNC_OFFSET( 15075, glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB ),
- NAME_FUNC_OFFSET( 15098, glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB ),
- NAME_FUNC_OFFSET( 15121, glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB ),
- NAME_FUNC_OFFSET( 15144, glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB ),
- NAME_FUNC_OFFSET( 15167, glSampleCoverageARB, _gloffset_SampleCoverageARB ),
- NAME_FUNC_OFFSET( 15184, glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB ),
- NAME_FUNC_OFFSET( 15207, glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB ),
- NAME_FUNC_OFFSET( 15230, glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB ),
- NAME_FUNC_OFFSET( 15253, glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB ),
- NAME_FUNC_OFFSET( 15279, glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB ),
- NAME_FUNC_OFFSET( 15305, glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB ),
- NAME_FUNC_OFFSET( 15331, glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB ),
- NAME_FUNC_OFFSET( 15355, glBindBufferARB, _gloffset_BindBufferARB ),
- NAME_FUNC_OFFSET( 15368, glBufferDataARB, _gloffset_BufferDataARB ),
- NAME_FUNC_OFFSET( 15381, glBufferSubDataARB, _gloffset_BufferSubDataARB ),
- NAME_FUNC_OFFSET( 15397, glDeleteBuffersARB, _gloffset_DeleteBuffersARB ),
- NAME_FUNC_OFFSET( 15413, glGenBuffersARB, _gloffset_GenBuffersARB ),
- NAME_FUNC_OFFSET( 15426, glGetBufferParameterivARB, _gloffset_GetBufferParameterivARB ),
- NAME_FUNC_OFFSET( 15449, glGetBufferPointervARB, _gloffset_GetBufferPointervARB ),
- NAME_FUNC_OFFSET( 15469, glGetBufferSubDataARB, _gloffset_GetBufferSubDataARB ),
- NAME_FUNC_OFFSET( 15488, glIsBufferARB, _gloffset_IsBufferARB ),
- NAME_FUNC_OFFSET( 15499, glMapBufferARB, _gloffset_MapBufferARB ),
- NAME_FUNC_OFFSET( 15511, glUnmapBufferARB, _gloffset_UnmapBufferARB ),
- NAME_FUNC_OFFSET( 15525, glBeginQueryARB, _gloffset_BeginQueryARB ),
- NAME_FUNC_OFFSET( 15538, glDeleteQueriesARB, _gloffset_DeleteQueriesARB ),
- NAME_FUNC_OFFSET( 15554, glEndQueryARB, _gloffset_EndQueryARB ),
- NAME_FUNC_OFFSET( 15565, glGenQueriesARB, _gloffset_GenQueriesARB ),
- NAME_FUNC_OFFSET( 15578, glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB ),
- NAME_FUNC_OFFSET( 15597, glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB ),
- NAME_FUNC_OFFSET( 15617, glGetQueryivARB, _gloffset_GetQueryivARB ),
- NAME_FUNC_OFFSET( 15630, glIsQueryARB, _gloffset_IsQueryARB ),
- NAME_FUNC_OFFSET( 15640, glDrawBuffersARB, _gloffset_DrawBuffersARB ),
- NAME_FUNC_OFFSET( 15654, glDrawBuffersARB, _gloffset_DrawBuffersARB ),
- NAME_FUNC_OFFSET( 15671, gl_dispatch_stub_553, _gloffset_GetColorTableParameterfvSGI ),
- NAME_FUNC_OFFSET( 15701, gl_dispatch_stub_554, _gloffset_GetColorTableParameterivSGI ),
- NAME_FUNC_OFFSET( 15731, gl_dispatch_stub_555, _gloffset_GetColorTableSGI ),
- NAME_FUNC_OFFSET( 15750, gl_dispatch_stub_565, _gloffset_SampleMaskSGIS ),
- NAME_FUNC_OFFSET( 15766, gl_dispatch_stub_566, _gloffset_SamplePatternSGIS ),
- NAME_FUNC_OFFSET( 15785, glPointParameterfEXT, _gloffset_PointParameterfEXT ),
- NAME_FUNC_OFFSET( 15803, glPointParameterfEXT, _gloffset_PointParameterfEXT ),
- NAME_FUNC_OFFSET( 15824, glPointParameterfEXT, _gloffset_PointParameterfEXT ),
- NAME_FUNC_OFFSET( 15846, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( 15865, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( 15887, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( 15910, glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT ),
- NAME_FUNC_OFFSET( 15929, glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT ),
- NAME_FUNC_OFFSET( 15949, glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT ),
- NAME_FUNC_OFFSET( 15968, glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT ),
- NAME_FUNC_OFFSET( 15988, glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT ),
- NAME_FUNC_OFFSET( 16007, glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT ),
- NAME_FUNC_OFFSET( 16027, glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT ),
- NAME_FUNC_OFFSET( 16046, glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT ),
- NAME_FUNC_OFFSET( 16066, glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT ),
- NAME_FUNC_OFFSET( 16085, glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT ),
- NAME_FUNC_OFFSET( 16105, glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT ),
- NAME_FUNC_OFFSET( 16125, glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT ),
- NAME_FUNC_OFFSET( 16146, glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT ),
- NAME_FUNC_OFFSET( 16166, glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT ),
- NAME_FUNC_OFFSET( 16187, glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT ),
- NAME_FUNC_OFFSET( 16207, glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT ),
- NAME_FUNC_OFFSET( 16228, glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT ),
- NAME_FUNC_OFFSET( 16252, glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT ),
- NAME_FUNC_OFFSET( 16270, glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT ),
- NAME_FUNC_OFFSET( 16290, glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT ),
- NAME_FUNC_OFFSET( 16308, glFogCoorddEXT, _gloffset_FogCoorddEXT ),
- NAME_FUNC_OFFSET( 16320, glFogCoorddvEXT, _gloffset_FogCoorddvEXT ),
- NAME_FUNC_OFFSET( 16333, glFogCoordfEXT, _gloffset_FogCoordfEXT ),
- NAME_FUNC_OFFSET( 16345, glFogCoordfvEXT, _gloffset_FogCoordfvEXT ),
- NAME_FUNC_OFFSET( 16358, glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT ),
- NAME_FUNC_OFFSET( 16378, glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT ),
- NAME_FUNC_OFFSET( 16402, glWindowPos2dMESA, _gloffset_WindowPos2dMESA ),
- NAME_FUNC_OFFSET( 16416, glWindowPos2dMESA, _gloffset_WindowPos2dMESA ),
- NAME_FUNC_OFFSET( 16433, glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA ),
- NAME_FUNC_OFFSET( 16448, glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA ),
- NAME_FUNC_OFFSET( 16466, glWindowPos2fMESA, _gloffset_WindowPos2fMESA ),
- NAME_FUNC_OFFSET( 16480, glWindowPos2fMESA, _gloffset_WindowPos2fMESA ),
- NAME_FUNC_OFFSET( 16497, glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA ),
- NAME_FUNC_OFFSET( 16512, glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA ),
- NAME_FUNC_OFFSET( 16530, glWindowPos2iMESA, _gloffset_WindowPos2iMESA ),
- NAME_FUNC_OFFSET( 16544, glWindowPos2iMESA, _gloffset_WindowPos2iMESA ),
- NAME_FUNC_OFFSET( 16561, glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA ),
- NAME_FUNC_OFFSET( 16576, glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA ),
- NAME_FUNC_OFFSET( 16594, glWindowPos2sMESA, _gloffset_WindowPos2sMESA ),
- NAME_FUNC_OFFSET( 16608, glWindowPos2sMESA, _gloffset_WindowPos2sMESA ),
- NAME_FUNC_OFFSET( 16625, glWindowPos2svMESA, _gloffset_WindowPos2svMESA ),
- NAME_FUNC_OFFSET( 16640, glWindowPos2svMESA, _gloffset_WindowPos2svMESA ),
- NAME_FUNC_OFFSET( 16658, glWindowPos3dMESA, _gloffset_WindowPos3dMESA ),
- NAME_FUNC_OFFSET( 16672, glWindowPos3dMESA, _gloffset_WindowPos3dMESA ),
- NAME_FUNC_OFFSET( 16689, glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA ),
- NAME_FUNC_OFFSET( 16704, glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA ),
- NAME_FUNC_OFFSET( 16722, glWindowPos3fMESA, _gloffset_WindowPos3fMESA ),
- NAME_FUNC_OFFSET( 16736, glWindowPos3fMESA, _gloffset_WindowPos3fMESA ),
- NAME_FUNC_OFFSET( 16753, glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA ),
- NAME_FUNC_OFFSET( 16768, glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA ),
- NAME_FUNC_OFFSET( 16786, glWindowPos3iMESA, _gloffset_WindowPos3iMESA ),
- NAME_FUNC_OFFSET( 16800, glWindowPos3iMESA, _gloffset_WindowPos3iMESA ),
- NAME_FUNC_OFFSET( 16817, glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA ),
- NAME_FUNC_OFFSET( 16832, glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA ),
- NAME_FUNC_OFFSET( 16850, glWindowPos3sMESA, _gloffset_WindowPos3sMESA ),
- NAME_FUNC_OFFSET( 16864, glWindowPos3sMESA, _gloffset_WindowPos3sMESA ),
- NAME_FUNC_OFFSET( 16881, glWindowPos3svMESA, _gloffset_WindowPos3svMESA ),
- NAME_FUNC_OFFSET( 16896, glWindowPos3svMESA, _gloffset_WindowPos3svMESA ),
- NAME_FUNC_OFFSET( 16914, glBindProgramNV, _gloffset_BindProgramNV ),
- NAME_FUNC_OFFSET( 16931, glDeleteProgramsNV, _gloffset_DeleteProgramsNV ),
- NAME_FUNC_OFFSET( 16951, glGenProgramsNV, _gloffset_GenProgramsNV ),
- NAME_FUNC_OFFSET( 16968, glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV ),
- NAME_FUNC_OFFSET( 16997, glIsProgramNV, _gloffset_IsProgramNV ),
- NAME_FUNC_OFFSET( 17012, glPointParameteriNV, _gloffset_PointParameteriNV ),
- NAME_FUNC_OFFSET( 17030, glPointParameterivNV, _gloffset_PointParameterivNV ),
- NAME_FUNC_OFFSET( 17049, gl_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT ),
- NAME_FUNC_OFFSET( 17073, gl_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT ),
- NAME_FUNC_OFFSET( -1, NULL, 0 )
+ NAME_FUNC_OFFSET( 0, glNewList, glNewList, NULL, _gloffset_NewList),
+ NAME_FUNC_OFFSET( 10, glEndList, glEndList, NULL, _gloffset_EndList),
+ NAME_FUNC_OFFSET( 20, glCallList, glCallList, NULL, _gloffset_CallList),
+ NAME_FUNC_OFFSET( 31, glCallLists, glCallLists, NULL, _gloffset_CallLists),
+ NAME_FUNC_OFFSET( 43, glDeleteLists, glDeleteLists, NULL, _gloffset_DeleteLists),
+ NAME_FUNC_OFFSET( 57, glGenLists, glGenLists, NULL, _gloffset_GenLists),
+ NAME_FUNC_OFFSET( 68, glListBase, glListBase, NULL, _gloffset_ListBase),
+ NAME_FUNC_OFFSET( 79, glBegin, glBegin, NULL, _gloffset_Begin),
+ NAME_FUNC_OFFSET( 87, glBitmap, glBitmap, NULL, _gloffset_Bitmap),
+ NAME_FUNC_OFFSET( 96, glColor3b, glColor3b, NULL, _gloffset_Color3b),
+ NAME_FUNC_OFFSET( 106, glColor3bv, glColor3bv, NULL, _gloffset_Color3bv),
+ NAME_FUNC_OFFSET( 117, glColor3d, glColor3d, NULL, _gloffset_Color3d),
+ NAME_FUNC_OFFSET( 127, glColor3dv, glColor3dv, NULL, _gloffset_Color3dv),
+ NAME_FUNC_OFFSET( 138, glColor3f, glColor3f, NULL, _gloffset_Color3f),
+ NAME_FUNC_OFFSET( 148, glColor3fv, glColor3fv, NULL, _gloffset_Color3fv),
+ NAME_FUNC_OFFSET( 159, glColor3i, glColor3i, NULL, _gloffset_Color3i),
+ NAME_FUNC_OFFSET( 169, glColor3iv, glColor3iv, NULL, _gloffset_Color3iv),
+ NAME_FUNC_OFFSET( 180, glColor3s, glColor3s, NULL, _gloffset_Color3s),
+ NAME_FUNC_OFFSET( 190, glColor3sv, glColor3sv, NULL, _gloffset_Color3sv),
+ NAME_FUNC_OFFSET( 201, glColor3ub, glColor3ub, NULL, _gloffset_Color3ub),
+ NAME_FUNC_OFFSET( 212, glColor3ubv, glColor3ubv, NULL, _gloffset_Color3ubv),
+ NAME_FUNC_OFFSET( 224, glColor3ui, glColor3ui, NULL, _gloffset_Color3ui),
+ NAME_FUNC_OFFSET( 235, glColor3uiv, glColor3uiv, NULL, _gloffset_Color3uiv),
+ NAME_FUNC_OFFSET( 247, glColor3us, glColor3us, NULL, _gloffset_Color3us),
+ NAME_FUNC_OFFSET( 258, glColor3usv, glColor3usv, NULL, _gloffset_Color3usv),
+ NAME_FUNC_OFFSET( 270, glColor4b, glColor4b, NULL, _gloffset_Color4b),
+ NAME_FUNC_OFFSET( 280, glColor4bv, glColor4bv, NULL, _gloffset_Color4bv),
+ NAME_FUNC_OFFSET( 291, glColor4d, glColor4d, NULL, _gloffset_Color4d),
+ NAME_FUNC_OFFSET( 301, glColor4dv, glColor4dv, NULL, _gloffset_Color4dv),
+ NAME_FUNC_OFFSET( 312, glColor4f, glColor4f, NULL, _gloffset_Color4f),
+ NAME_FUNC_OFFSET( 322, glColor4fv, glColor4fv, NULL, _gloffset_Color4fv),
+ NAME_FUNC_OFFSET( 333, glColor4i, glColor4i, NULL, _gloffset_Color4i),
+ NAME_FUNC_OFFSET( 343, glColor4iv, glColor4iv, NULL, _gloffset_Color4iv),
+ NAME_FUNC_OFFSET( 354, glColor4s, glColor4s, NULL, _gloffset_Color4s),
+ NAME_FUNC_OFFSET( 364, glColor4sv, glColor4sv, NULL, _gloffset_Color4sv),
+ NAME_FUNC_OFFSET( 375, glColor4ub, glColor4ub, NULL, _gloffset_Color4ub),
+ NAME_FUNC_OFFSET( 386, glColor4ubv, glColor4ubv, NULL, _gloffset_Color4ubv),
+ NAME_FUNC_OFFSET( 398, glColor4ui, glColor4ui, NULL, _gloffset_Color4ui),
+ NAME_FUNC_OFFSET( 409, glColor4uiv, glColor4uiv, NULL, _gloffset_Color4uiv),
+ NAME_FUNC_OFFSET( 421, glColor4us, glColor4us, NULL, _gloffset_Color4us),
+ NAME_FUNC_OFFSET( 432, glColor4usv, glColor4usv, NULL, _gloffset_Color4usv),
+ NAME_FUNC_OFFSET( 444, glEdgeFlag, glEdgeFlag, NULL, _gloffset_EdgeFlag),
+ NAME_FUNC_OFFSET( 455, glEdgeFlagv, glEdgeFlagv, NULL, _gloffset_EdgeFlagv),
+ NAME_FUNC_OFFSET( 467, glEnd, glEnd, NULL, _gloffset_End),
+ NAME_FUNC_OFFSET( 473, glIndexd, glIndexd, NULL, _gloffset_Indexd),
+ NAME_FUNC_OFFSET( 482, glIndexdv, glIndexdv, NULL, _gloffset_Indexdv),
+ NAME_FUNC_OFFSET( 492, glIndexf, glIndexf, NULL, _gloffset_Indexf),
+ NAME_FUNC_OFFSET( 501, glIndexfv, glIndexfv, NULL, _gloffset_Indexfv),
+ NAME_FUNC_OFFSET( 511, glIndexi, glIndexi, NULL, _gloffset_Indexi),
+ NAME_FUNC_OFFSET( 520, glIndexiv, glIndexiv, NULL, _gloffset_Indexiv),
+ NAME_FUNC_OFFSET( 530, glIndexs, glIndexs, NULL, _gloffset_Indexs),
+ NAME_FUNC_OFFSET( 539, glIndexsv, glIndexsv, NULL, _gloffset_Indexsv),
+ NAME_FUNC_OFFSET( 549, glNormal3b, glNormal3b, NULL, _gloffset_Normal3b),
+ NAME_FUNC_OFFSET( 560, glNormal3bv, glNormal3bv, NULL, _gloffset_Normal3bv),
+ NAME_FUNC_OFFSET( 572, glNormal3d, glNormal3d, NULL, _gloffset_Normal3d),
+ NAME_FUNC_OFFSET( 583, glNormal3dv, glNormal3dv, NULL, _gloffset_Normal3dv),
+ NAME_FUNC_OFFSET( 595, glNormal3f, glNormal3f, NULL, _gloffset_Normal3f),
+ NAME_FUNC_OFFSET( 606, glNormal3fv, glNormal3fv, NULL, _gloffset_Normal3fv),
+ NAME_FUNC_OFFSET( 618, glNormal3i, glNormal3i, NULL, _gloffset_Normal3i),
+ NAME_FUNC_OFFSET( 629, glNormal3iv, glNormal3iv, NULL, _gloffset_Normal3iv),
+ NAME_FUNC_OFFSET( 641, glNormal3s, glNormal3s, NULL, _gloffset_Normal3s),
+ NAME_FUNC_OFFSET( 652, glNormal3sv, glNormal3sv, NULL, _gloffset_Normal3sv),
+ NAME_FUNC_OFFSET( 664, glRasterPos2d, glRasterPos2d, NULL, _gloffset_RasterPos2d),
+ NAME_FUNC_OFFSET( 678, glRasterPos2dv, glRasterPos2dv, NULL, _gloffset_RasterPos2dv),
+ NAME_FUNC_OFFSET( 693, glRasterPos2f, glRasterPos2f, NULL, _gloffset_RasterPos2f),
+ NAME_FUNC_OFFSET( 707, glRasterPos2fv, glRasterPos2fv, NULL, _gloffset_RasterPos2fv),
+ NAME_FUNC_OFFSET( 722, glRasterPos2i, glRasterPos2i, NULL, _gloffset_RasterPos2i),
+ NAME_FUNC_OFFSET( 736, glRasterPos2iv, glRasterPos2iv, NULL, _gloffset_RasterPos2iv),
+ NAME_FUNC_OFFSET( 751, glRasterPos2s, glRasterPos2s, NULL, _gloffset_RasterPos2s),
+ NAME_FUNC_OFFSET( 765, glRasterPos2sv, glRasterPos2sv, NULL, _gloffset_RasterPos2sv),
+ NAME_FUNC_OFFSET( 780, glRasterPos3d, glRasterPos3d, NULL, _gloffset_RasterPos3d),
+ NAME_FUNC_OFFSET( 794, glRasterPos3dv, glRasterPos3dv, NULL, _gloffset_RasterPos3dv),
+ NAME_FUNC_OFFSET( 809, glRasterPos3f, glRasterPos3f, NULL, _gloffset_RasterPos3f),
+ NAME_FUNC_OFFSET( 823, glRasterPos3fv, glRasterPos3fv, NULL, _gloffset_RasterPos3fv),
+ NAME_FUNC_OFFSET( 838, glRasterPos3i, glRasterPos3i, NULL, _gloffset_RasterPos3i),
+ NAME_FUNC_OFFSET( 852, glRasterPos3iv, glRasterPos3iv, NULL, _gloffset_RasterPos3iv),
+ NAME_FUNC_OFFSET( 867, glRasterPos3s, glRasterPos3s, NULL, _gloffset_RasterPos3s),
+ NAME_FUNC_OFFSET( 881, glRasterPos3sv, glRasterPos3sv, NULL, _gloffset_RasterPos3sv),
+ NAME_FUNC_OFFSET( 896, glRasterPos4d, glRasterPos4d, NULL, _gloffset_RasterPos4d),
+ NAME_FUNC_OFFSET( 910, glRasterPos4dv, glRasterPos4dv, NULL, _gloffset_RasterPos4dv),
+ NAME_FUNC_OFFSET( 925, glRasterPos4f, glRasterPos4f, NULL, _gloffset_RasterPos4f),
+ NAME_FUNC_OFFSET( 939, glRasterPos4fv, glRasterPos4fv, NULL, _gloffset_RasterPos4fv),
+ NAME_FUNC_OFFSET( 954, glRasterPos4i, glRasterPos4i, NULL, _gloffset_RasterPos4i),
+ NAME_FUNC_OFFSET( 968, glRasterPos4iv, glRasterPos4iv, NULL, _gloffset_RasterPos4iv),
+ NAME_FUNC_OFFSET( 983, glRasterPos4s, glRasterPos4s, NULL, _gloffset_RasterPos4s),
+ NAME_FUNC_OFFSET( 997, glRasterPos4sv, glRasterPos4sv, NULL, _gloffset_RasterPos4sv),
+ NAME_FUNC_OFFSET( 1012, glRectd, glRectd, NULL, _gloffset_Rectd),
+ NAME_FUNC_OFFSET( 1020, glRectdv, glRectdv, NULL, _gloffset_Rectdv),
+ NAME_FUNC_OFFSET( 1029, glRectf, glRectf, NULL, _gloffset_Rectf),
+ NAME_FUNC_OFFSET( 1037, glRectfv, glRectfv, NULL, _gloffset_Rectfv),
+ NAME_FUNC_OFFSET( 1046, glRecti, glRecti, NULL, _gloffset_Recti),
+ NAME_FUNC_OFFSET( 1054, glRectiv, glRectiv, NULL, _gloffset_Rectiv),
+ NAME_FUNC_OFFSET( 1063, glRects, glRects, NULL, _gloffset_Rects),
+ NAME_FUNC_OFFSET( 1071, glRectsv, glRectsv, NULL, _gloffset_Rectsv),
+ NAME_FUNC_OFFSET( 1080, glTexCoord1d, glTexCoord1d, NULL, _gloffset_TexCoord1d),
+ NAME_FUNC_OFFSET( 1093, glTexCoord1dv, glTexCoord1dv, NULL, _gloffset_TexCoord1dv),
+ NAME_FUNC_OFFSET( 1107, glTexCoord1f, glTexCoord1f, NULL, _gloffset_TexCoord1f),
+ NAME_FUNC_OFFSET( 1120, glTexCoord1fv, glTexCoord1fv, NULL, _gloffset_TexCoord1fv),
+ NAME_FUNC_OFFSET( 1134, glTexCoord1i, glTexCoord1i, NULL, _gloffset_TexCoord1i),
+ NAME_FUNC_OFFSET( 1147, glTexCoord1iv, glTexCoord1iv, NULL, _gloffset_TexCoord1iv),
+ NAME_FUNC_OFFSET( 1161, glTexCoord1s, glTexCoord1s, NULL, _gloffset_TexCoord1s),
+ NAME_FUNC_OFFSET( 1174, glTexCoord1sv, glTexCoord1sv, NULL, _gloffset_TexCoord1sv),
+ NAME_FUNC_OFFSET( 1188, glTexCoord2d, glTexCoord2d, NULL, _gloffset_TexCoord2d),
+ NAME_FUNC_OFFSET( 1201, glTexCoord2dv, glTexCoord2dv, NULL, _gloffset_TexCoord2dv),
+ NAME_FUNC_OFFSET( 1215, glTexCoord2f, glTexCoord2f, NULL, _gloffset_TexCoord2f),
+ NAME_FUNC_OFFSET( 1228, glTexCoord2fv, glTexCoord2fv, NULL, _gloffset_TexCoord2fv),
+ NAME_FUNC_OFFSET( 1242, glTexCoord2i, glTexCoord2i, NULL, _gloffset_TexCoord2i),
+ NAME_FUNC_OFFSET( 1255, glTexCoord2iv, glTexCoord2iv, NULL, _gloffset_TexCoord2iv),
+ NAME_FUNC_OFFSET( 1269, glTexCoord2s, glTexCoord2s, NULL, _gloffset_TexCoord2s),
+ NAME_FUNC_OFFSET( 1282, glTexCoord2sv, glTexCoord2sv, NULL, _gloffset_TexCoord2sv),
+ NAME_FUNC_OFFSET( 1296, glTexCoord3d, glTexCoord3d, NULL, _gloffset_TexCoord3d),
+ NAME_FUNC_OFFSET( 1309, glTexCoord3dv, glTexCoord3dv, NULL, _gloffset_TexCoord3dv),
+ NAME_FUNC_OFFSET( 1323, glTexCoord3f, glTexCoord3f, NULL, _gloffset_TexCoord3f),
+ NAME_FUNC_OFFSET( 1336, glTexCoord3fv, glTexCoord3fv, NULL, _gloffset_TexCoord3fv),
+ NAME_FUNC_OFFSET( 1350, glTexCoord3i, glTexCoord3i, NULL, _gloffset_TexCoord3i),
+ NAME_FUNC_OFFSET( 1363, glTexCoord3iv, glTexCoord3iv, NULL, _gloffset_TexCoord3iv),
+ NAME_FUNC_OFFSET( 1377, glTexCoord3s, glTexCoord3s, NULL, _gloffset_TexCoord3s),
+ NAME_FUNC_OFFSET( 1390, glTexCoord3sv, glTexCoord3sv, NULL, _gloffset_TexCoord3sv),
+ NAME_FUNC_OFFSET( 1404, glTexCoord4d, glTexCoord4d, NULL, _gloffset_TexCoord4d),
+ NAME_FUNC_OFFSET( 1417, glTexCoord4dv, glTexCoord4dv, NULL, _gloffset_TexCoord4dv),
+ NAME_FUNC_OFFSET( 1431, glTexCoord4f, glTexCoord4f, NULL, _gloffset_TexCoord4f),
+ NAME_FUNC_OFFSET( 1444, glTexCoord4fv, glTexCoord4fv, NULL, _gloffset_TexCoord4fv),
+ NAME_FUNC_OFFSET( 1458, glTexCoord4i, glTexCoord4i, NULL, _gloffset_TexCoord4i),
+ NAME_FUNC_OFFSET( 1471, glTexCoord4iv, glTexCoord4iv, NULL, _gloffset_TexCoord4iv),
+ NAME_FUNC_OFFSET( 1485, glTexCoord4s, glTexCoord4s, NULL, _gloffset_TexCoord4s),
+ NAME_FUNC_OFFSET( 1498, glTexCoord4sv, glTexCoord4sv, NULL, _gloffset_TexCoord4sv),
+ NAME_FUNC_OFFSET( 1512, glVertex2d, glVertex2d, NULL, _gloffset_Vertex2d),
+ NAME_FUNC_OFFSET( 1523, glVertex2dv, glVertex2dv, NULL, _gloffset_Vertex2dv),
+ NAME_FUNC_OFFSET( 1535, glVertex2f, glVertex2f, NULL, _gloffset_Vertex2f),
+ NAME_FUNC_OFFSET( 1546, glVertex2fv, glVertex2fv, NULL, _gloffset_Vertex2fv),
+ NAME_FUNC_OFFSET( 1558, glVertex2i, glVertex2i, NULL, _gloffset_Vertex2i),
+ NAME_FUNC_OFFSET( 1569, glVertex2iv, glVertex2iv, NULL, _gloffset_Vertex2iv),
+ NAME_FUNC_OFFSET( 1581, glVertex2s, glVertex2s, NULL, _gloffset_Vertex2s),
+ NAME_FUNC_OFFSET( 1592, glVertex2sv, glVertex2sv, NULL, _gloffset_Vertex2sv),
+ NAME_FUNC_OFFSET( 1604, glVertex3d, glVertex3d, NULL, _gloffset_Vertex3d),
+ NAME_FUNC_OFFSET( 1615, glVertex3dv, glVertex3dv, NULL, _gloffset_Vertex3dv),
+ NAME_FUNC_OFFSET( 1627, glVertex3f, glVertex3f, NULL, _gloffset_Vertex3f),
+ NAME_FUNC_OFFSET( 1638, glVertex3fv, glVertex3fv, NULL, _gloffset_Vertex3fv),
+ NAME_FUNC_OFFSET( 1650, glVertex3i, glVertex3i, NULL, _gloffset_Vertex3i),
+ NAME_FUNC_OFFSET( 1661, glVertex3iv, glVertex3iv, NULL, _gloffset_Vertex3iv),
+ NAME_FUNC_OFFSET( 1673, glVertex3s, glVertex3s, NULL, _gloffset_Vertex3s),
+ NAME_FUNC_OFFSET( 1684, glVertex3sv, glVertex3sv, NULL, _gloffset_Vertex3sv),
+ NAME_FUNC_OFFSET( 1696, glVertex4d, glVertex4d, NULL, _gloffset_Vertex4d),
+ NAME_FUNC_OFFSET( 1707, glVertex4dv, glVertex4dv, NULL, _gloffset_Vertex4dv),
+ NAME_FUNC_OFFSET( 1719, glVertex4f, glVertex4f, NULL, _gloffset_Vertex4f),
+ NAME_FUNC_OFFSET( 1730, glVertex4fv, glVertex4fv, NULL, _gloffset_Vertex4fv),
+ NAME_FUNC_OFFSET( 1742, glVertex4i, glVertex4i, NULL, _gloffset_Vertex4i),
+ NAME_FUNC_OFFSET( 1753, glVertex4iv, glVertex4iv, NULL, _gloffset_Vertex4iv),
+ NAME_FUNC_OFFSET( 1765, glVertex4s, glVertex4s, NULL, _gloffset_Vertex4s),
+ NAME_FUNC_OFFSET( 1776, glVertex4sv, glVertex4sv, NULL, _gloffset_Vertex4sv),
+ NAME_FUNC_OFFSET( 1788, glClipPlane, glClipPlane, NULL, _gloffset_ClipPlane),
+ NAME_FUNC_OFFSET( 1800, glColorMaterial, glColorMaterial, NULL, _gloffset_ColorMaterial),
+ NAME_FUNC_OFFSET( 1816, glCullFace, glCullFace, NULL, _gloffset_CullFace),
+ NAME_FUNC_OFFSET( 1827, glFogf, glFogf, NULL, _gloffset_Fogf),
+ NAME_FUNC_OFFSET( 1834, glFogfv, glFogfv, NULL, _gloffset_Fogfv),
+ NAME_FUNC_OFFSET( 1842, glFogi, glFogi, NULL, _gloffset_Fogi),
+ NAME_FUNC_OFFSET( 1849, glFogiv, glFogiv, NULL, _gloffset_Fogiv),
+ NAME_FUNC_OFFSET( 1857, glFrontFace, glFrontFace, NULL, _gloffset_FrontFace),
+ NAME_FUNC_OFFSET( 1869, glHint, glHint, NULL, _gloffset_Hint),
+ NAME_FUNC_OFFSET( 1876, glLightf, glLightf, NULL, _gloffset_Lightf),
+ NAME_FUNC_OFFSET( 1885, glLightfv, glLightfv, NULL, _gloffset_Lightfv),
+ NAME_FUNC_OFFSET( 1895, glLighti, glLighti, NULL, _gloffset_Lighti),
+ NAME_FUNC_OFFSET( 1904, glLightiv, glLightiv, NULL, _gloffset_Lightiv),
+ NAME_FUNC_OFFSET( 1914, glLightModelf, glLightModelf, NULL, _gloffset_LightModelf),
+ NAME_FUNC_OFFSET( 1928, glLightModelfv, glLightModelfv, NULL, _gloffset_LightModelfv),
+ NAME_FUNC_OFFSET( 1943, glLightModeli, glLightModeli, NULL, _gloffset_LightModeli),
+ NAME_FUNC_OFFSET( 1957, glLightModeliv, glLightModeliv, NULL, _gloffset_LightModeliv),
+ NAME_FUNC_OFFSET( 1972, glLineStipple, glLineStipple, NULL, _gloffset_LineStipple),
+ NAME_FUNC_OFFSET( 1986, glLineWidth, glLineWidth, NULL, _gloffset_LineWidth),
+ NAME_FUNC_OFFSET( 1998, glMaterialf, glMaterialf, NULL, _gloffset_Materialf),
+ NAME_FUNC_OFFSET( 2010, glMaterialfv, glMaterialfv, NULL, _gloffset_Materialfv),
+ NAME_FUNC_OFFSET( 2023, glMateriali, glMateriali, NULL, _gloffset_Materiali),
+ NAME_FUNC_OFFSET( 2035, glMaterialiv, glMaterialiv, NULL, _gloffset_Materialiv),
+ NAME_FUNC_OFFSET( 2048, glPointSize, glPointSize, NULL, _gloffset_PointSize),
+ NAME_FUNC_OFFSET( 2060, glPolygonMode, glPolygonMode, NULL, _gloffset_PolygonMode),
+ NAME_FUNC_OFFSET( 2074, glPolygonStipple, glPolygonStipple, NULL, _gloffset_PolygonStipple),
+ NAME_FUNC_OFFSET( 2091, glScissor, glScissor, NULL, _gloffset_Scissor),
+ NAME_FUNC_OFFSET( 2101, glShadeModel, glShadeModel, NULL, _gloffset_ShadeModel),
+ NAME_FUNC_OFFSET( 2114, glTexParameterf, glTexParameterf, NULL, _gloffset_TexParameterf),
+ NAME_FUNC_OFFSET( 2130, glTexParameterfv, glTexParameterfv, NULL, _gloffset_TexParameterfv),
+ NAME_FUNC_OFFSET( 2147, glTexParameteri, glTexParameteri, NULL, _gloffset_TexParameteri),
+ NAME_FUNC_OFFSET( 2163, glTexParameteriv, glTexParameteriv, NULL, _gloffset_TexParameteriv),
+ NAME_FUNC_OFFSET( 2180, glTexImage1D, glTexImage1D, NULL, _gloffset_TexImage1D),
+ NAME_FUNC_OFFSET( 2193, glTexImage2D, glTexImage2D, NULL, _gloffset_TexImage2D),
+ NAME_FUNC_OFFSET( 2206, glTexEnvf, glTexEnvf, NULL, _gloffset_TexEnvf),
+ NAME_FUNC_OFFSET( 2216, glTexEnvfv, glTexEnvfv, NULL, _gloffset_TexEnvfv),
+ NAME_FUNC_OFFSET( 2227, glTexEnvi, glTexEnvi, NULL, _gloffset_TexEnvi),
+ NAME_FUNC_OFFSET( 2237, glTexEnviv, glTexEnviv, NULL, _gloffset_TexEnviv),
+ NAME_FUNC_OFFSET( 2248, glTexGend, glTexGend, NULL, _gloffset_TexGend),
+ NAME_FUNC_OFFSET( 2258, glTexGendv, glTexGendv, NULL, _gloffset_TexGendv),
+ NAME_FUNC_OFFSET( 2269, glTexGenf, glTexGenf, NULL, _gloffset_TexGenf),
+ NAME_FUNC_OFFSET( 2279, glTexGenfv, glTexGenfv, NULL, _gloffset_TexGenfv),
+ NAME_FUNC_OFFSET( 2290, glTexGeni, glTexGeni, NULL, _gloffset_TexGeni),
+ NAME_FUNC_OFFSET( 2300, glTexGeniv, glTexGeniv, NULL, _gloffset_TexGeniv),
+ NAME_FUNC_OFFSET( 2311, glFeedbackBuffer, glFeedbackBuffer, NULL, _gloffset_FeedbackBuffer),
+ NAME_FUNC_OFFSET( 2328, glSelectBuffer, glSelectBuffer, NULL, _gloffset_SelectBuffer),
+ NAME_FUNC_OFFSET( 2343, glRenderMode, glRenderMode, NULL, _gloffset_RenderMode),
+ NAME_FUNC_OFFSET( 2356, glInitNames, glInitNames, NULL, _gloffset_InitNames),
+ NAME_FUNC_OFFSET( 2368, glLoadName, glLoadName, NULL, _gloffset_LoadName),
+ NAME_FUNC_OFFSET( 2379, glPassThrough, glPassThrough, NULL, _gloffset_PassThrough),
+ NAME_FUNC_OFFSET( 2393, glPopName, glPopName, NULL, _gloffset_PopName),
+ NAME_FUNC_OFFSET( 2403, glPushName, glPushName, NULL, _gloffset_PushName),
+ NAME_FUNC_OFFSET( 2414, glDrawBuffer, glDrawBuffer, NULL, _gloffset_DrawBuffer),
+ NAME_FUNC_OFFSET( 2427, glClear, glClear, NULL, _gloffset_Clear),
+ NAME_FUNC_OFFSET( 2435, glClearAccum, glClearAccum, NULL, _gloffset_ClearAccum),
+ NAME_FUNC_OFFSET( 2448, glClearIndex, glClearIndex, NULL, _gloffset_ClearIndex),
+ NAME_FUNC_OFFSET( 2461, glClearColor, glClearColor, NULL, _gloffset_ClearColor),
+ NAME_FUNC_OFFSET( 2474, glClearStencil, glClearStencil, NULL, _gloffset_ClearStencil),
+ NAME_FUNC_OFFSET( 2489, glClearDepth, glClearDepth, NULL, _gloffset_ClearDepth),
+ NAME_FUNC_OFFSET( 2502, glStencilMask, glStencilMask, NULL, _gloffset_StencilMask),
+ NAME_FUNC_OFFSET( 2516, glColorMask, glColorMask, NULL, _gloffset_ColorMask),
+ NAME_FUNC_OFFSET( 2528, glDepthMask, glDepthMask, NULL, _gloffset_DepthMask),
+ NAME_FUNC_OFFSET( 2540, glIndexMask, glIndexMask, NULL, _gloffset_IndexMask),
+ NAME_FUNC_OFFSET( 2552, glAccum, glAccum, NULL, _gloffset_Accum),
+ NAME_FUNC_OFFSET( 2560, glDisable, glDisable, NULL, _gloffset_Disable),
+ NAME_FUNC_OFFSET( 2570, glEnable, glEnable, NULL, _gloffset_Enable),
+ NAME_FUNC_OFFSET( 2579, glFinish, glFinish, NULL, _gloffset_Finish),
+ NAME_FUNC_OFFSET( 2588, glFlush, glFlush, NULL, _gloffset_Flush),
+ NAME_FUNC_OFFSET( 2596, glPopAttrib, glPopAttrib, NULL, _gloffset_PopAttrib),
+ NAME_FUNC_OFFSET( 2608, glPushAttrib, glPushAttrib, NULL, _gloffset_PushAttrib),
+ NAME_FUNC_OFFSET( 2621, glMap1d, glMap1d, NULL, _gloffset_Map1d),
+ NAME_FUNC_OFFSET( 2629, glMap1f, glMap1f, NULL, _gloffset_Map1f),
+ NAME_FUNC_OFFSET( 2637, glMap2d, glMap2d, NULL, _gloffset_Map2d),
+ NAME_FUNC_OFFSET( 2645, glMap2f, glMap2f, NULL, _gloffset_Map2f),
+ NAME_FUNC_OFFSET( 2653, glMapGrid1d, glMapGrid1d, NULL, _gloffset_MapGrid1d),
+ NAME_FUNC_OFFSET( 2665, glMapGrid1f, glMapGrid1f, NULL, _gloffset_MapGrid1f),
+ NAME_FUNC_OFFSET( 2677, glMapGrid2d, glMapGrid2d, NULL, _gloffset_MapGrid2d),
+ NAME_FUNC_OFFSET( 2689, glMapGrid2f, glMapGrid2f, NULL, _gloffset_MapGrid2f),
+ NAME_FUNC_OFFSET( 2701, glEvalCoord1d, glEvalCoord1d, NULL, _gloffset_EvalCoord1d),
+ NAME_FUNC_OFFSET( 2715, glEvalCoord1dv, glEvalCoord1dv, NULL, _gloffset_EvalCoord1dv),
+ NAME_FUNC_OFFSET( 2730, glEvalCoord1f, glEvalCoord1f, NULL, _gloffset_EvalCoord1f),
+ NAME_FUNC_OFFSET( 2744, glEvalCoord1fv, glEvalCoord1fv, NULL, _gloffset_EvalCoord1fv),
+ NAME_FUNC_OFFSET( 2759, glEvalCoord2d, glEvalCoord2d, NULL, _gloffset_EvalCoord2d),
+ NAME_FUNC_OFFSET( 2773, glEvalCoord2dv, glEvalCoord2dv, NULL, _gloffset_EvalCoord2dv),
+ NAME_FUNC_OFFSET( 2788, glEvalCoord2f, glEvalCoord2f, NULL, _gloffset_EvalCoord2f),
+ NAME_FUNC_OFFSET( 2802, glEvalCoord2fv, glEvalCoord2fv, NULL, _gloffset_EvalCoord2fv),
+ NAME_FUNC_OFFSET( 2817, glEvalMesh1, glEvalMesh1, NULL, _gloffset_EvalMesh1),
+ NAME_FUNC_OFFSET( 2829, glEvalPoint1, glEvalPoint1, NULL, _gloffset_EvalPoint1),
+ NAME_FUNC_OFFSET( 2842, glEvalMesh2, glEvalMesh2, NULL, _gloffset_EvalMesh2),
+ NAME_FUNC_OFFSET( 2854, glEvalPoint2, glEvalPoint2, NULL, _gloffset_EvalPoint2),
+ NAME_FUNC_OFFSET( 2867, glAlphaFunc, glAlphaFunc, NULL, _gloffset_AlphaFunc),
+ NAME_FUNC_OFFSET( 2879, glBlendFunc, glBlendFunc, NULL, _gloffset_BlendFunc),
+ NAME_FUNC_OFFSET( 2891, glLogicOp, glLogicOp, NULL, _gloffset_LogicOp),
+ NAME_FUNC_OFFSET( 2901, glStencilFunc, glStencilFunc, NULL, _gloffset_StencilFunc),
+ NAME_FUNC_OFFSET( 2915, glStencilOp, glStencilOp, NULL, _gloffset_StencilOp),
+ NAME_FUNC_OFFSET( 2927, glDepthFunc, glDepthFunc, NULL, _gloffset_DepthFunc),
+ NAME_FUNC_OFFSET( 2939, glPixelZoom, glPixelZoom, NULL, _gloffset_PixelZoom),
+ NAME_FUNC_OFFSET( 2951, glPixelTransferf, glPixelTransferf, NULL, _gloffset_PixelTransferf),
+ NAME_FUNC_OFFSET( 2968, glPixelTransferi, glPixelTransferi, NULL, _gloffset_PixelTransferi),
+ NAME_FUNC_OFFSET( 2985, glPixelStoref, glPixelStoref, NULL, _gloffset_PixelStoref),
+ NAME_FUNC_OFFSET( 2999, glPixelStorei, glPixelStorei, NULL, _gloffset_PixelStorei),
+ NAME_FUNC_OFFSET( 3013, glPixelMapfv, glPixelMapfv, NULL, _gloffset_PixelMapfv),
+ NAME_FUNC_OFFSET( 3026, glPixelMapuiv, glPixelMapuiv, NULL, _gloffset_PixelMapuiv),
+ NAME_FUNC_OFFSET( 3040, glPixelMapusv, glPixelMapusv, NULL, _gloffset_PixelMapusv),
+ NAME_FUNC_OFFSET( 3054, glReadBuffer, glReadBuffer, NULL, _gloffset_ReadBuffer),
+ NAME_FUNC_OFFSET( 3067, glCopyPixels, glCopyPixels, NULL, _gloffset_CopyPixels),
+ NAME_FUNC_OFFSET( 3080, glReadPixels, glReadPixels, NULL, _gloffset_ReadPixels),
+ NAME_FUNC_OFFSET( 3093, glDrawPixels, glDrawPixels, NULL, _gloffset_DrawPixels),
+ NAME_FUNC_OFFSET( 3106, glGetBooleanv, glGetBooleanv, NULL, _gloffset_GetBooleanv),
+ NAME_FUNC_OFFSET( 3120, glGetClipPlane, glGetClipPlane, NULL, _gloffset_GetClipPlane),
+ NAME_FUNC_OFFSET( 3135, glGetDoublev, glGetDoublev, NULL, _gloffset_GetDoublev),
+ NAME_FUNC_OFFSET( 3148, glGetError, glGetError, NULL, _gloffset_GetError),
+ NAME_FUNC_OFFSET( 3159, glGetFloatv, glGetFloatv, NULL, _gloffset_GetFloatv),
+ NAME_FUNC_OFFSET( 3171, glGetIntegerv, glGetIntegerv, NULL, _gloffset_GetIntegerv),
+ NAME_FUNC_OFFSET( 3185, glGetLightfv, glGetLightfv, NULL, _gloffset_GetLightfv),
+ NAME_FUNC_OFFSET( 3198, glGetLightiv, glGetLightiv, NULL, _gloffset_GetLightiv),
+ NAME_FUNC_OFFSET( 3211, glGetMapdv, glGetMapdv, NULL, _gloffset_GetMapdv),
+ NAME_FUNC_OFFSET( 3222, glGetMapfv, glGetMapfv, NULL, _gloffset_GetMapfv),
+ NAME_FUNC_OFFSET( 3233, glGetMapiv, glGetMapiv, NULL, _gloffset_GetMapiv),
+ NAME_FUNC_OFFSET( 3244, glGetMaterialfv, glGetMaterialfv, NULL, _gloffset_GetMaterialfv),
+ NAME_FUNC_OFFSET( 3260, glGetMaterialiv, glGetMaterialiv, NULL, _gloffset_GetMaterialiv),
+ NAME_FUNC_OFFSET( 3276, glGetPixelMapfv, glGetPixelMapfv, NULL, _gloffset_GetPixelMapfv),
+ NAME_FUNC_OFFSET( 3292, glGetPixelMapuiv, glGetPixelMapuiv, NULL, _gloffset_GetPixelMapuiv),
+ NAME_FUNC_OFFSET( 3309, glGetPixelMapusv, glGetPixelMapusv, NULL, _gloffset_GetPixelMapusv),
+ NAME_FUNC_OFFSET( 3326, glGetPolygonStipple, glGetPolygonStipple, NULL, _gloffset_GetPolygonStipple),
+ NAME_FUNC_OFFSET( 3346, glGetString, glGetString, NULL, _gloffset_GetString),
+ NAME_FUNC_OFFSET( 3358, glGetTexEnvfv, glGetTexEnvfv, NULL, _gloffset_GetTexEnvfv),
+ NAME_FUNC_OFFSET( 3372, glGetTexEnviv, glGetTexEnviv, NULL, _gloffset_GetTexEnviv),
+ NAME_FUNC_OFFSET( 3386, glGetTexGendv, glGetTexGendv, NULL, _gloffset_GetTexGendv),
+ NAME_FUNC_OFFSET( 3400, glGetTexGenfv, glGetTexGenfv, NULL, _gloffset_GetTexGenfv),
+ NAME_FUNC_OFFSET( 3414, glGetTexGeniv, glGetTexGeniv, NULL, _gloffset_GetTexGeniv),
+ NAME_FUNC_OFFSET( 3428, glGetTexImage, glGetTexImage, NULL, _gloffset_GetTexImage),
+ NAME_FUNC_OFFSET( 3442, glGetTexParameterfv, glGetTexParameterfv, NULL, _gloffset_GetTexParameterfv),
+ NAME_FUNC_OFFSET( 3462, glGetTexParameteriv, glGetTexParameteriv, NULL, _gloffset_GetTexParameteriv),
+ NAME_FUNC_OFFSET( 3482, glGetTexLevelParameterfv, glGetTexLevelParameterfv, NULL, _gloffset_GetTexLevelParameterfv),
+ NAME_FUNC_OFFSET( 3507, glGetTexLevelParameteriv, glGetTexLevelParameteriv, NULL, _gloffset_GetTexLevelParameteriv),
+ NAME_FUNC_OFFSET( 3532, glIsEnabled, glIsEnabled, NULL, _gloffset_IsEnabled),
+ NAME_FUNC_OFFSET( 3544, glIsList, glIsList, NULL, _gloffset_IsList),
+ NAME_FUNC_OFFSET( 3553, glDepthRange, glDepthRange, NULL, _gloffset_DepthRange),
+ NAME_FUNC_OFFSET( 3566, glFrustum, glFrustum, NULL, _gloffset_Frustum),
+ NAME_FUNC_OFFSET( 3576, glLoadIdentity, glLoadIdentity, NULL, _gloffset_LoadIdentity),
+ NAME_FUNC_OFFSET( 3591, glLoadMatrixf, glLoadMatrixf, NULL, _gloffset_LoadMatrixf),
+ NAME_FUNC_OFFSET( 3605, glLoadMatrixd, glLoadMatrixd, NULL, _gloffset_LoadMatrixd),
+ NAME_FUNC_OFFSET( 3619, glMatrixMode, glMatrixMode, NULL, _gloffset_MatrixMode),
+ NAME_FUNC_OFFSET( 3632, glMultMatrixf, glMultMatrixf, NULL, _gloffset_MultMatrixf),
+ NAME_FUNC_OFFSET( 3646, glMultMatrixd, glMultMatrixd, NULL, _gloffset_MultMatrixd),
+ NAME_FUNC_OFFSET( 3660, glOrtho, glOrtho, NULL, _gloffset_Ortho),
+ NAME_FUNC_OFFSET( 3668, glPopMatrix, glPopMatrix, NULL, _gloffset_PopMatrix),
+ NAME_FUNC_OFFSET( 3680, glPushMatrix, glPushMatrix, NULL, _gloffset_PushMatrix),
+ NAME_FUNC_OFFSET( 3693, glRotated, glRotated, NULL, _gloffset_Rotated),
+ NAME_FUNC_OFFSET( 3703, glRotatef, glRotatef, NULL, _gloffset_Rotatef),
+ NAME_FUNC_OFFSET( 3713, glScaled, glScaled, NULL, _gloffset_Scaled),
+ NAME_FUNC_OFFSET( 3722, glScalef, glScalef, NULL, _gloffset_Scalef),
+ NAME_FUNC_OFFSET( 3731, glTranslated, glTranslated, NULL, _gloffset_Translated),
+ NAME_FUNC_OFFSET( 3744, glTranslatef, glTranslatef, NULL, _gloffset_Translatef),
+ NAME_FUNC_OFFSET( 3757, glViewport, glViewport, NULL, _gloffset_Viewport),
+ NAME_FUNC_OFFSET( 3768, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
+ NAME_FUNC_OFFSET( 3783, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
+ NAME_FUNC_OFFSET( 3797, glColorPointer, glColorPointer, NULL, _gloffset_ColorPointer),
+ NAME_FUNC_OFFSET( 3812, glDisableClientState, glDisableClientState, NULL, _gloffset_DisableClientState),
+ NAME_FUNC_OFFSET( 3833, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
+ NAME_FUNC_OFFSET( 3846, glDrawElements, glDrawElements, NULL, _gloffset_DrawElements),
+ NAME_FUNC_OFFSET( 3861, glEdgeFlagPointer, glEdgeFlagPointer, NULL, _gloffset_EdgeFlagPointer),
+ NAME_FUNC_OFFSET( 3879, glEnableClientState, glEnableClientState, NULL, _gloffset_EnableClientState),
+ NAME_FUNC_OFFSET( 3899, glIndexPointer, glIndexPointer, NULL, _gloffset_IndexPointer),
+ NAME_FUNC_OFFSET( 3914, glIndexub, glIndexub, NULL, _gloffset_Indexub),
+ NAME_FUNC_OFFSET( 3924, glIndexubv, glIndexubv, NULL, _gloffset_Indexubv),
+ NAME_FUNC_OFFSET( 3935, glInterleavedArrays, glInterleavedArrays, NULL, _gloffset_InterleavedArrays),
+ NAME_FUNC_OFFSET( 3955, glNormalPointer, glNormalPointer, NULL, _gloffset_NormalPointer),
+ NAME_FUNC_OFFSET( 3971, glPolygonOffset, glPolygonOffset, NULL, _gloffset_PolygonOffset),
+ NAME_FUNC_OFFSET( 3987, glTexCoordPointer, glTexCoordPointer, NULL, _gloffset_TexCoordPointer),
+ NAME_FUNC_OFFSET( 4005, glVertexPointer, glVertexPointer, NULL, _gloffset_VertexPointer),
+ NAME_FUNC_OFFSET( 4021, glAreTexturesResident, glAreTexturesResident, NULL, _gloffset_AreTexturesResident),
+ NAME_FUNC_OFFSET( 4043, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
+ NAME_FUNC_OFFSET( 4060, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
+ NAME_FUNC_OFFSET( 4077, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
+ NAME_FUNC_OFFSET( 4097, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
+ NAME_FUNC_OFFSET( 4117, glDeleteTextures, glDeleteTextures, NULL, _gloffset_DeleteTextures),
+ NAME_FUNC_OFFSET( 4134, glGenTextures, glGenTextures, NULL, _gloffset_GenTextures),
+ NAME_FUNC_OFFSET( 4148, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
+ NAME_FUNC_OFFSET( 4162, glIsTexture, glIsTexture, NULL, _gloffset_IsTexture),
+ NAME_FUNC_OFFSET( 4174, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
+ NAME_FUNC_OFFSET( 4195, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
+ NAME_FUNC_OFFSET( 4211, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
+ NAME_FUNC_OFFSET( 4227, glPopClientAttrib, glPopClientAttrib, NULL, _gloffset_PopClientAttrib),
+ NAME_FUNC_OFFSET( 4245, glPushClientAttrib, glPushClientAttrib, NULL, _gloffset_PushClientAttrib),
+ NAME_FUNC_OFFSET( 4264, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
+ NAME_FUNC_OFFSET( 4277, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
+ NAME_FUNC_OFFSET( 4293, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
+ NAME_FUNC_OFFSET( 4313, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+ NAME_FUNC_OFFSET( 4326, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
+ NAME_FUNC_OFFSET( 4350, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
+ NAME_FUNC_OFFSET( 4374, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
+ NAME_FUNC_OFFSET( 4391, glGetColorTable, glGetColorTable, NULL, _gloffset_GetColorTable),
+ NAME_FUNC_OFFSET( 4407, glGetColorTableParameterfv, glGetColorTableParameterfv, NULL, _gloffset_GetColorTableParameterfv),
+ NAME_FUNC_OFFSET( 4434, glGetColorTableParameteriv, glGetColorTableParameteriv, NULL, _gloffset_GetColorTableParameteriv),
+ NAME_FUNC_OFFSET( 4461, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
+ NAME_FUNC_OFFSET( 4477, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
+ NAME_FUNC_OFFSET( 4497, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
+ NAME_FUNC_OFFSET( 4519, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
+ NAME_FUNC_OFFSET( 4541, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
+ NAME_FUNC_OFFSET( 4565, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
+ NAME_FUNC_OFFSET( 4590, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
+ NAME_FUNC_OFFSET( 4614, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
+ NAME_FUNC_OFFSET( 4639, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
+ NAME_FUNC_OFFSET( 4665, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
+ NAME_FUNC_OFFSET( 4691, glGetConvolutionFilter, glGetConvolutionFilter, NULL, _gloffset_GetConvolutionFilter),
+ NAME_FUNC_OFFSET( 4714, glGetConvolutionParameterfv, glGetConvolutionParameterfv, NULL, _gloffset_GetConvolutionParameterfv),
+ NAME_FUNC_OFFSET( 4742, glGetConvolutionParameteriv, glGetConvolutionParameteriv, NULL, _gloffset_GetConvolutionParameteriv),
+ NAME_FUNC_OFFSET( 4770, glGetSeparableFilter, glGetSeparableFilter, NULL, _gloffset_GetSeparableFilter),
+ NAME_FUNC_OFFSET( 4791, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
+ NAME_FUNC_OFFSET( 4811, glGetHistogram, glGetHistogram, NULL, _gloffset_GetHistogram),
+ NAME_FUNC_OFFSET( 4826, glGetHistogramParameterfv, glGetHistogramParameterfv, NULL, _gloffset_GetHistogramParameterfv),
+ NAME_FUNC_OFFSET( 4852, glGetHistogramParameteriv, glGetHistogramParameteriv, NULL, _gloffset_GetHistogramParameteriv),
+ NAME_FUNC_OFFSET( 4878, glGetMinmax, glGetMinmax, NULL, _gloffset_GetMinmax),
+ NAME_FUNC_OFFSET( 4890, glGetMinmaxParameterfv, glGetMinmaxParameterfv, NULL, _gloffset_GetMinmaxParameterfv),
+ NAME_FUNC_OFFSET( 4913, glGetMinmaxParameteriv, glGetMinmaxParameteriv, NULL, _gloffset_GetMinmaxParameteriv),
+ NAME_FUNC_OFFSET( 4936, glHistogram, glHistogram, NULL, _gloffset_Histogram),
+ NAME_FUNC_OFFSET( 4948, glMinmax, glMinmax, NULL, _gloffset_Minmax),
+ NAME_FUNC_OFFSET( 4957, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
+ NAME_FUNC_OFFSET( 4974, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
+ NAME_FUNC_OFFSET( 4988, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
+ NAME_FUNC_OFFSET( 5001, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
+ NAME_FUNC_OFFSET( 5017, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
+ NAME_FUNC_OFFSET( 5037, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
+ NAME_FUNC_OFFSET( 5056, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
+ NAME_FUNC_OFFSET( 5081, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
+ NAME_FUNC_OFFSET( 5102, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
+ NAME_FUNC_OFFSET( 5124, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
+ NAME_FUNC_OFFSET( 5145, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
+ NAME_FUNC_OFFSET( 5167, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
+ NAME_FUNC_OFFSET( 5188, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
+ NAME_FUNC_OFFSET( 5210, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
+ NAME_FUNC_OFFSET( 5231, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
+ NAME_FUNC_OFFSET( 5253, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
+ NAME_FUNC_OFFSET( 5274, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
+ NAME_FUNC_OFFSET( 5296, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
+ NAME_FUNC_OFFSET( 5317, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
+ NAME_FUNC_OFFSET( 5339, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
+ NAME_FUNC_OFFSET( 5360, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
+ NAME_FUNC_OFFSET( 5382, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
+ NAME_FUNC_OFFSET( 5403, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
+ NAME_FUNC_OFFSET( 5425, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
+ NAME_FUNC_OFFSET( 5446, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
+ NAME_FUNC_OFFSET( 5468, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
+ NAME_FUNC_OFFSET( 5489, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
+ NAME_FUNC_OFFSET( 5511, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
+ NAME_FUNC_OFFSET( 5532, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
+ NAME_FUNC_OFFSET( 5554, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
+ NAME_FUNC_OFFSET( 5575, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
+ NAME_FUNC_OFFSET( 5597, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
+ NAME_FUNC_OFFSET( 5618, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
+ NAME_FUNC_OFFSET( 5640, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
+ NAME_FUNC_OFFSET( 5661, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
+ NAME_FUNC_OFFSET( 5683, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
+ NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
+ NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
+ NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
+ NAME_FUNC_OFFSET( 5769, glAttachShader, glAttachShader, NULL, _gloffset_AttachShader),
+ NAME_FUNC_OFFSET( 5784, glCreateProgram, glCreateProgram, NULL, _gloffset_CreateProgram),
+ NAME_FUNC_OFFSET( 5800, glCreateShader, glCreateShader, NULL, _gloffset_CreateShader),
+ NAME_FUNC_OFFSET( 5815, glDeleteProgram, glDeleteProgram, NULL, _gloffset_DeleteProgram),
+ NAME_FUNC_OFFSET( 5831, glDeleteShader, glDeleteShader, NULL, _gloffset_DeleteShader),
+ NAME_FUNC_OFFSET( 5846, glDetachShader, glDetachShader, NULL, _gloffset_DetachShader),
+ NAME_FUNC_OFFSET( 5861, glGetAttachedShaders, glGetAttachedShaders, NULL, _gloffset_GetAttachedShaders),
+ NAME_FUNC_OFFSET( 5882, glGetProgramInfoLog, glGetProgramInfoLog, NULL, _gloffset_GetProgramInfoLog),
+ NAME_FUNC_OFFSET( 5902, glGetProgramiv, glGetProgramiv, NULL, _gloffset_GetProgramiv),
+ NAME_FUNC_OFFSET( 5917, glGetShaderInfoLog, glGetShaderInfoLog, NULL, _gloffset_GetShaderInfoLog),
+ NAME_FUNC_OFFSET( 5936, glGetShaderiv, glGetShaderiv, NULL, _gloffset_GetShaderiv),
+ NAME_FUNC_OFFSET( 5950, glIsProgram, glIsProgram, NULL, _gloffset_IsProgram),
+ NAME_FUNC_OFFSET( 5962, glIsShader, glIsShader, NULL, _gloffset_IsShader),
+ NAME_FUNC_OFFSET( 5973, glStencilFuncSeparate, glStencilFuncSeparate, NULL, _gloffset_StencilFuncSeparate),
+ NAME_FUNC_OFFSET( 5995, glStencilMaskSeparate, glStencilMaskSeparate, NULL, _gloffset_StencilMaskSeparate),
+ NAME_FUNC_OFFSET( 6017, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate),
+ NAME_FUNC_OFFSET( 6037, glUniformMatrix2x3fv, glUniformMatrix2x3fv, NULL, _gloffset_UniformMatrix2x3fv),
+ NAME_FUNC_OFFSET( 6058, glUniformMatrix2x4fv, glUniformMatrix2x4fv, NULL, _gloffset_UniformMatrix2x4fv),
+ NAME_FUNC_OFFSET( 6079, glUniformMatrix3x2fv, glUniformMatrix3x2fv, NULL, _gloffset_UniformMatrix3x2fv),
+ NAME_FUNC_OFFSET( 6100, glUniformMatrix3x4fv, glUniformMatrix3x4fv, NULL, _gloffset_UniformMatrix3x4fv),
+ NAME_FUNC_OFFSET( 6121, glUniformMatrix4x2fv, glUniformMatrix4x2fv, NULL, _gloffset_UniformMatrix4x2fv),
+ NAME_FUNC_OFFSET( 6142, glUniformMatrix4x3fv, glUniformMatrix4x3fv, NULL, _gloffset_UniformMatrix4x3fv),
+ NAME_FUNC_OFFSET( 6163, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
+ NAME_FUNC_OFFSET( 6189, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
+ NAME_FUNC_OFFSET( 6215, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
+ NAME_FUNC_OFFSET( 6241, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
+ NAME_FUNC_OFFSET( 6267, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
+ NAME_FUNC_OFFSET( 6287, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
+ NAME_FUNC_OFFSET( 6313, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
+ NAME_FUNC_OFFSET( 6339, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
+ NAME_FUNC_OFFSET( 6365, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
+ NAME_FUNC_OFFSET( 6394, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
+ NAME_FUNC_OFFSET( 6423, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
+ NAME_FUNC_OFFSET( 6452, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
+ NAME_FUNC_OFFSET( 6479, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET( 6509, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET( 6538, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterdvARB, NULL, _gloffset_GetProgramEnvParameterdvARB),
+ NAME_FUNC_OFFSET( 6568, glGetProgramEnvParameterfvARB, glGetProgramEnvParameterfvARB, NULL, _gloffset_GetProgramEnvParameterfvARB),
+ NAME_FUNC_OFFSET( 6598, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterdvARB, NULL, _gloffset_GetProgramLocalParameterdvARB),
+ NAME_FUNC_OFFSET( 6630, glGetProgramLocalParameterfvARB, glGetProgramLocalParameterfvARB, NULL, _gloffset_GetProgramLocalParameterfvARB),
+ NAME_FUNC_OFFSET( 6662, glGetProgramStringARB, glGetProgramStringARB, NULL, _gloffset_GetProgramStringARB),
+ NAME_FUNC_OFFSET( 6684, glGetProgramivARB, glGetProgramivARB, NULL, _gloffset_GetProgramivARB),
+ NAME_FUNC_OFFSET( 6702, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
+ NAME_FUNC_OFFSET( 6725, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
+ NAME_FUNC_OFFSET( 6748, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
+ NAME_FUNC_OFFSET( 6771, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB),
+ NAME_FUNC_OFFSET( 6798, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB),
+ NAME_FUNC_OFFSET( 6826, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB),
+ NAME_FUNC_OFFSET( 6853, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB),
+ NAME_FUNC_OFFSET( 6881, glProgramLocalParameter4dARB, glProgramLocalParameter4dARB, NULL, _gloffset_ProgramLocalParameter4dARB),
+ NAME_FUNC_OFFSET( 6910, glProgramLocalParameter4dvARB, glProgramLocalParameter4dvARB, NULL, _gloffset_ProgramLocalParameter4dvARB),
+ NAME_FUNC_OFFSET( 6940, glProgramLocalParameter4fARB, glProgramLocalParameter4fARB, NULL, _gloffset_ProgramLocalParameter4fARB),
+ NAME_FUNC_OFFSET( 6969, glProgramLocalParameter4fvARB, glProgramLocalParameter4fvARB, NULL, _gloffset_ProgramLocalParameter4fvARB),
+ NAME_FUNC_OFFSET( 6999, glProgramStringARB, glProgramStringARB, NULL, _gloffset_ProgramStringARB),
+ NAME_FUNC_OFFSET( 7018, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
+ NAME_FUNC_OFFSET( 7038, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
+ NAME_FUNC_OFFSET( 7059, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
+ NAME_FUNC_OFFSET( 7079, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB),
+ NAME_FUNC_OFFSET( 7100, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB),
+ NAME_FUNC_OFFSET( 7120, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB),
+ NAME_FUNC_OFFSET( 7141, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB),
+ NAME_FUNC_OFFSET( 7161, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB),
+ NAME_FUNC_OFFSET( 7182, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB),
+ NAME_FUNC_OFFSET( 7202, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB),
+ NAME_FUNC_OFFSET( 7223, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB),
+ NAME_FUNC_OFFSET( 7243, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB),
+ NAME_FUNC_OFFSET( 7264, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB),
+ NAME_FUNC_OFFSET( 7284, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB),
+ NAME_FUNC_OFFSET( 7305, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB),
+ NAME_FUNC_OFFSET( 7325, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB),
+ NAME_FUNC_OFFSET( 7346, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB),
+ NAME_FUNC_OFFSET( 7366, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB),
+ NAME_FUNC_OFFSET( 7387, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB),
+ NAME_FUNC_OFFSET( 7409, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB),
+ NAME_FUNC_OFFSET( 7431, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB),
+ NAME_FUNC_OFFSET( 7453, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB),
+ NAME_FUNC_OFFSET( 7475, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
+ NAME_FUNC_OFFSET( 7498, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
+ NAME_FUNC_OFFSET( 7521, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
+ NAME_FUNC_OFFSET( 7544, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB),
+ NAME_FUNC_OFFSET( 7565, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
+ NAME_FUNC_OFFSET( 7585, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
+ NAME_FUNC_OFFSET( 7606, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
+ NAME_FUNC_OFFSET( 7626, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
+ NAME_FUNC_OFFSET( 7647, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB),
+ NAME_FUNC_OFFSET( 7668, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
+ NAME_FUNC_OFFSET( 7688, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
+ NAME_FUNC_OFFSET( 7709, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB),
+ NAME_FUNC_OFFSET( 7731, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB),
+ NAME_FUNC_OFFSET( 7753, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB),
+ NAME_FUNC_OFFSET( 7775, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
+ NAME_FUNC_OFFSET( 7800, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
+ NAME_FUNC_OFFSET( 7816, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
+ NAME_FUNC_OFFSET( 7832, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
+ NAME_FUNC_OFFSET( 7851, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
+ NAME_FUNC_OFFSET( 7870, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
+ NAME_FUNC_OFFSET( 7886, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
+ NAME_FUNC_OFFSET( 7912, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
+ NAME_FUNC_OFFSET( 7935, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
+ NAME_FUNC_OFFSET( 7957, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
+ NAME_FUNC_OFFSET( 7971, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
+ NAME_FUNC_OFFSET( 7986, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
+ NAME_FUNC_OFFSET( 8003, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
+ NAME_FUNC_OFFSET( 8019, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
+ NAME_FUNC_OFFSET( 8038, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
+ NAME_FUNC_OFFSET( 8052, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
+ NAME_FUNC_OFFSET( 8068, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
+ NAME_FUNC_OFFSET( 8090, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
+ NAME_FUNC_OFFSET( 8113, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
+ NAME_FUNC_OFFSET( 8129, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
+ NAME_FUNC_OFFSET( 8142, glAttachObjectARB, glAttachObjectARB, NULL, _gloffset_AttachObjectARB),
+ NAME_FUNC_OFFSET( 8160, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
+ NAME_FUNC_OFFSET( 8179, glCreateProgramObjectARB, glCreateProgramObjectARB, NULL, _gloffset_CreateProgramObjectARB),
+ NAME_FUNC_OFFSET( 8204, glCreateShaderObjectARB, glCreateShaderObjectARB, NULL, _gloffset_CreateShaderObjectARB),
+ NAME_FUNC_OFFSET( 8228, glDeleteObjectARB, glDeleteObjectARB, NULL, _gloffset_DeleteObjectARB),
+ NAME_FUNC_OFFSET( 8246, glDetachObjectARB, glDetachObjectARB, NULL, _gloffset_DetachObjectARB),
+ NAME_FUNC_OFFSET( 8264, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
+ NAME_FUNC_OFFSET( 8286, glGetAttachedObjectsARB, glGetAttachedObjectsARB, NULL, _gloffset_GetAttachedObjectsARB),
+ NAME_FUNC_OFFSET( 8310, glGetHandleARB, glGetHandleARB, NULL, _gloffset_GetHandleARB),
+ NAME_FUNC_OFFSET( 8325, glGetInfoLogARB, glGetInfoLogARB, NULL, _gloffset_GetInfoLogARB),
+ NAME_FUNC_OFFSET( 8341, glGetObjectParameterfvARB, glGetObjectParameterfvARB, NULL, _gloffset_GetObjectParameterfvARB),
+ NAME_FUNC_OFFSET( 8367, glGetObjectParameterivARB, glGetObjectParameterivARB, NULL, _gloffset_GetObjectParameterivARB),
+ NAME_FUNC_OFFSET( 8393, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
+ NAME_FUNC_OFFSET( 8414, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
+ NAME_FUNC_OFFSET( 8438, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
+ NAME_FUNC_OFFSET( 8456, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
+ NAME_FUNC_OFFSET( 8474, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
+ NAME_FUNC_OFFSET( 8491, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
+ NAME_FUNC_OFFSET( 8509, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
+ NAME_FUNC_OFFSET( 8524, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
+ NAME_FUNC_OFFSET( 8540, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
+ NAME_FUNC_OFFSET( 8555, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
+ NAME_FUNC_OFFSET( 8571, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
+ NAME_FUNC_OFFSET( 8586, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
+ NAME_FUNC_OFFSET( 8602, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
+ NAME_FUNC_OFFSET( 8617, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
+ NAME_FUNC_OFFSET( 8633, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
+ NAME_FUNC_OFFSET( 8648, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
+ NAME_FUNC_OFFSET( 8664, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
+ NAME_FUNC_OFFSET( 8679, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
+ NAME_FUNC_OFFSET( 8695, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
+ NAME_FUNC_OFFSET( 8710, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
+ NAME_FUNC_OFFSET( 8726, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
+ NAME_FUNC_OFFSET( 8741, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
+ NAME_FUNC_OFFSET( 8757, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
+ NAME_FUNC_OFFSET( 8779, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
+ NAME_FUNC_OFFSET( 8801, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
+ NAME_FUNC_OFFSET( 8823, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
+ NAME_FUNC_OFFSET( 8845, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
+ NAME_FUNC_OFFSET( 8866, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
+ NAME_FUNC_OFFSET( 8890, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
+ NAME_FUNC_OFFSET( 8911, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
+ NAME_FUNC_OFFSET( 8934, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET( 8951, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT),
+ NAME_FUNC_OFFSET( 8970, gl_dispatch_stub_562, gl_dispatch_stub_562, NULL, _gloffset_GetPixelTexGenParameterfvSGIS),
+ NAME_FUNC_OFFSET( 9002, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterivSGIS),
+ NAME_FUNC_OFFSET( 9034, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_PixelTexGenParameterfSGIS),
+ NAME_FUNC_OFFSET( 9062, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfvSGIS),
+ NAME_FUNC_OFFSET( 9091, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameteriSGIS),
+ NAME_FUNC_OFFSET( 9119, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameterivSGIS),
+ NAME_FUNC_OFFSET( 9148, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
+ NAME_FUNC_OFFSET( 9165, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
+ NAME_FUNC_OFFSET( 9185, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT),
+ NAME_FUNC_OFFSET( 9203, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT),
+ NAME_FUNC_OFFSET( 9224, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT),
+ NAME_FUNC_OFFSET( 9242, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT),
+ NAME_FUNC_OFFSET( 9261, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT),
+ NAME_FUNC_OFFSET( 9282, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT),
+ NAME_FUNC_OFFSET( 9301, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET( 9322, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET( 9344, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT),
+ NAME_FUNC_OFFSET( 9360, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT),
+ NAME_FUNC_OFFSET( 9378, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_CullParameterdvEXT),
+ NAME_FUNC_OFFSET( 9399, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterfvEXT),
+ NAME_FUNC_OFFSET( 9420, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
+ NAME_FUNC_OFFSET( 9442, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
+ NAME_FUNC_OFFSET( 9465, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
+ NAME_FUNC_OFFSET( 9487, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
+ NAME_FUNC_OFFSET( 9510, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
+ NAME_FUNC_OFFSET( 9532, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
+ NAME_FUNC_OFFSET( 9555, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
+ NAME_FUNC_OFFSET( 9577, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
+ NAME_FUNC_OFFSET( 9600, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
+ NAME_FUNC_OFFSET( 9622, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
+ NAME_FUNC_OFFSET( 9645, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
+ NAME_FUNC_OFFSET( 9668, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
+ NAME_FUNC_OFFSET( 9692, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
+ NAME_FUNC_OFFSET( 9715, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
+ NAME_FUNC_OFFSET( 9739, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
+ NAME_FUNC_OFFSET( 9762, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
+ NAME_FUNC_OFFSET( 9786, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
+ NAME_FUNC_OFFSET( 9813, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
+ NAME_FUNC_OFFSET( 9834, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
+ NAME_FUNC_OFFSET( 9857, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
+ NAME_FUNC_OFFSET( 9878, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
+ NAME_FUNC_OFFSET( 9893, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
+ NAME_FUNC_OFFSET( 9909, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
+ NAME_FUNC_OFFSET( 9924, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
+ NAME_FUNC_OFFSET( 9940, gl_dispatch_stub_606, gl_dispatch_stub_606, NULL, _gloffset_PixelTexGenSGIX),
+ NAME_FUNC_OFFSET( 9958, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET( 9981, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV),
+ NAME_FUNC_OFFSET(10007, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV),
+ NAME_FUNC_OFFSET(10028, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV),
+ NAME_FUNC_OFFSET(10046, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV),
+ NAME_FUNC_OFFSET(10065, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV),
+ NAME_FUNC_OFFSET(10088, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV),
+ NAME_FUNC_OFFSET(10112, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV),
+ NAME_FUNC_OFFSET(10135, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV),
+ NAME_FUNC_OFFSET(10159, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV),
+ NAME_FUNC_OFFSET(10182, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV),
+ NAME_FUNC_OFFSET(10214, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV),
+ NAME_FUNC_OFFSET(10246, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV),
+ NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV),
+ NAME_FUNC_OFFSET(10312, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV),
+ NAME_FUNC_OFFSET(10349, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV),
+ NAME_FUNC_OFFSET(10386, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA),
+ NAME_FUNC_OFFSET(10406, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(10424, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(10443, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(10461, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(10480, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(10498, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(10517, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(10535, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(10554, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(10572, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(10591, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(10609, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(10628, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(10646, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(10665, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(10683, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(10702, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA),
+ NAME_FUNC_OFFSET(10720, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA),
+ NAME_FUNC_OFFSET(10739, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA),
+ NAME_FUNC_OFFSET(10757, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA),
+ NAME_FUNC_OFFSET(10776, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA),
+ NAME_FUNC_OFFSET(10794, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA),
+ NAME_FUNC_OFFSET(10813, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA),
+ NAME_FUNC_OFFSET(10831, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA),
+ NAME_FUNC_OFFSET(10850, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, _gloffset_MultiModeDrawArraysIBM),
+ NAME_FUNC_OFFSET(10875, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawElementsIBM),
+ NAME_FUNC_OFFSET(10902, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_DeleteFencesNV),
+ NAME_FUNC_OFFSET(10919, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_FinishFenceNV),
+ NAME_FUNC_OFFSET(10935, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_GenFencesNV),
+ NAME_FUNC_OFFSET(10949, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GetFenceivNV),
+ NAME_FUNC_OFFSET(10964, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_IsFenceNV),
+ NAME_FUNC_OFFSET(10976, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_SetFenceNV),
+ NAME_FUNC_OFFSET(10989, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_TestFenceNV),
+ NAME_FUNC_OFFSET(11003, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV),
+ NAME_FUNC_OFFSET(11027, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
+ NAME_FUNC_OFFSET(11043, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
+ NAME_FUNC_OFFSET(11062, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV),
+ NAME_FUNC_OFFSET(11081, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
+ NAME_FUNC_OFFSET(11097, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV),
+ NAME_FUNC_OFFSET(11123, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV),
+ NAME_FUNC_OFFSET(11149, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV),
+ NAME_FUNC_OFFSET(11170, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV),
+ NAME_FUNC_OFFSET(11187, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV),
+ NAME_FUNC_OFFSET(11208, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(11236, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV),
+ NAME_FUNC_OFFSET(11258, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV),
+ NAME_FUNC_OFFSET(11280, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV),
+ NAME_FUNC_OFFSET(11302, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
+ NAME_FUNC_OFFSET(11316, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV),
+ NAME_FUNC_OFFSET(11332, glProgramParameter4dNV, glProgramParameter4dNV, NULL, _gloffset_ProgramParameter4dNV),
+ NAME_FUNC_OFFSET(11355, glProgramParameter4dvNV, glProgramParameter4dvNV, NULL, _gloffset_ProgramParameter4dvNV),
+ NAME_FUNC_OFFSET(11379, glProgramParameter4fNV, glProgramParameter4fNV, NULL, _gloffset_ProgramParameter4fNV),
+ NAME_FUNC_OFFSET(11402, glProgramParameter4fvNV, glProgramParameter4fvNV, NULL, _gloffset_ProgramParameter4fvNV),
+ NAME_FUNC_OFFSET(11426, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV),
+ NAME_FUNC_OFFSET(11451, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV),
+ NAME_FUNC_OFFSET(11476, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV),
+ NAME_FUNC_OFFSET(11504, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV),
+ NAME_FUNC_OFFSET(11520, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV),
+ NAME_FUNC_OFFSET(11539, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV),
+ NAME_FUNC_OFFSET(11559, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV),
+ NAME_FUNC_OFFSET(11578, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV),
+ NAME_FUNC_OFFSET(11598, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV),
+ NAME_FUNC_OFFSET(11617, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV),
+ NAME_FUNC_OFFSET(11637, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV),
+ NAME_FUNC_OFFSET(11656, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV),
+ NAME_FUNC_OFFSET(11676, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV),
+ NAME_FUNC_OFFSET(11695, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV),
+ NAME_FUNC_OFFSET(11715, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV),
+ NAME_FUNC_OFFSET(11734, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV),
+ NAME_FUNC_OFFSET(11754, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV),
+ NAME_FUNC_OFFSET(11773, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV),
+ NAME_FUNC_OFFSET(11793, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV),
+ NAME_FUNC_OFFSET(11812, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV),
+ NAME_FUNC_OFFSET(11832, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV),
+ NAME_FUNC_OFFSET(11851, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV),
+ NAME_FUNC_OFFSET(11871, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV),
+ NAME_FUNC_OFFSET(11890, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV),
+ NAME_FUNC_OFFSET(11910, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV),
+ NAME_FUNC_OFFSET(11929, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV),
+ NAME_FUNC_OFFSET(11949, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV),
+ NAME_FUNC_OFFSET(11968, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV),
+ NAME_FUNC_OFFSET(11988, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV),
+ NAME_FUNC_OFFSET(12008, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV),
+ NAME_FUNC_OFFSET(12029, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV),
+ NAME_FUNC_OFFSET(12053, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV),
+ NAME_FUNC_OFFSET(12074, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV),
+ NAME_FUNC_OFFSET(12095, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV),
+ NAME_FUNC_OFFSET(12116, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV),
+ NAME_FUNC_OFFSET(12137, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV),
+ NAME_FUNC_OFFSET(12158, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV),
+ NAME_FUNC_OFFSET(12179, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV),
+ NAME_FUNC_OFFSET(12200, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV),
+ NAME_FUNC_OFFSET(12221, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV),
+ NAME_FUNC_OFFSET(12242, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV),
+ NAME_FUNC_OFFSET(12263, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV),
+ NAME_FUNC_OFFSET(12284, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV),
+ NAME_FUNC_OFFSET(12305, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV),
+ NAME_FUNC_OFFSET(12327, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI),
+ NAME_FUNC_OFFSET(12349, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI),
+ NAME_FUNC_OFFSET(12371, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI),
+ NAME_FUNC_OFFSET(12393, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI),
+ NAME_FUNC_OFFSET(12418, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI),
+ NAME_FUNC_OFFSET(12442, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI),
+ NAME_FUNC_OFFSET(12464, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI),
+ NAME_FUNC_OFFSET(12486, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI),
+ NAME_FUNC_OFFSET(12508, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI),
+ NAME_FUNC_OFFSET(12534, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI),
+ NAME_FUNC_OFFSET(12557, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI),
+ NAME_FUNC_OFFSET(12581, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI),
+ NAME_FUNC_OFFSET(12599, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI),
+ NAME_FUNC_OFFSET(12614, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI),
+ NAME_FUNC_OFFSET(12645, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+ NAME_FUNC_OFFSET(12665, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+ NAME_FUNC_OFFSET(12686, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_ActiveStencilFaceEXT),
+ NAME_FUNC_OFFSET(12709, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, _gloffset_BindVertexArrayAPPLE),
+ NAME_FUNC_OFFSET(12732, gl_dispatch_stub_739, gl_dispatch_stub_739, NULL, _gloffset_DeleteVertexArraysAPPLE),
+ NAME_FUNC_OFFSET(12758, gl_dispatch_stub_740, gl_dispatch_stub_740, NULL, _gloffset_GenVertexArraysAPPLE),
+ NAME_FUNC_OFFSET(12781, gl_dispatch_stub_741, gl_dispatch_stub_741, NULL, _gloffset_IsVertexArrayAPPLE),
+ NAME_FUNC_OFFSET(12802, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV),
+ NAME_FUNC_OFFSET(12833, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV),
+ NAME_FUNC_OFFSET(12864, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV),
+ NAME_FUNC_OFFSET(12892, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV),
+ NAME_FUNC_OFFSET(12921, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV),
+ NAME_FUNC_OFFSET(12949, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV),
+ NAME_FUNC_OFFSET(12978, gl_dispatch_stub_748, gl_dispatch_stub_748, NULL, _gloffset_DepthBoundsEXT),
+ NAME_FUNC_OFFSET(12995, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(13022, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
+ NAME_FUNC_OFFSET(13043, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
+ NAME_FUNC_OFFSET(13065, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
+ NAME_FUNC_OFFSET(13093, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
+ NAME_FUNC_OFFSET(13117, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
+ NAME_FUNC_OFFSET(13142, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
+ NAME_FUNC_OFFSET(13171, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
+ NAME_FUNC_OFFSET(13197, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
+ NAME_FUNC_OFFSET(13223, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
+ NAME_FUNC_OFFSET(13249, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
+ NAME_FUNC_OFFSET(13270, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
+ NAME_FUNC_OFFSET(13292, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
+ NAME_FUNC_OFFSET(13312, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
+ NAME_FUNC_OFFSET(13353, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
+ NAME_FUNC_OFFSET(13385, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
+ NAME_FUNC_OFFSET(13404, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
+ NAME_FUNC_OFFSET(13424, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
+ NAME_FUNC_OFFSET(13449, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_BlitFramebufferEXT),
+ NAME_FUNC_OFFSET(13470, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_ProgramEnvParameters4fvEXT),
+ NAME_FUNC_OFFSET(13499, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_ProgramLocalParameters4fvEXT),
+ NAME_FUNC_OFFSET(13530, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_GetQueryObjecti64vEXT),
+ NAME_FUNC_OFFSET(13554, gl_dispatch_stub_771, gl_dispatch_stub_771, NULL, _gloffset_GetQueryObjectui64vEXT),
+ NAME_FUNC_OFFSET(13579, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
+ NAME_FUNC_OFFSET(13597, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
+ NAME_FUNC_OFFSET(13614, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
+ NAME_FUNC_OFFSET(13630, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident),
+ NAME_FUNC_OFFSET(13655, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
+ NAME_FUNC_OFFSET(13675, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
+ NAME_FUNC_OFFSET(13695, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
+ NAME_FUNC_OFFSET(13718, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
+ NAME_FUNC_OFFSET(13741, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures),
+ NAME_FUNC_OFFSET(13761, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures),
+ NAME_FUNC_OFFSET(13778, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
+ NAME_FUNC_OFFSET(13795, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture),
+ NAME_FUNC_OFFSET(13810, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
+ NAME_FUNC_OFFSET(13834, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
+ NAME_FUNC_OFFSET(13853, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
+ NAME_FUNC_OFFSET(13872, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
+ NAME_FUNC_OFFSET(13888, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
+ NAME_FUNC_OFFSET(13907, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
+ NAME_FUNC_OFFSET(13930, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+ NAME_FUNC_OFFSET(13946, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+ NAME_FUNC_OFFSET(13962, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
+ NAME_FUNC_OFFSET(13989, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
+ NAME_FUNC_OFFSET(14016, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
+ NAME_FUNC_OFFSET(14036, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+ NAME_FUNC_OFFSET(14055, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+ NAME_FUNC_OFFSET(14074, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+ NAME_FUNC_OFFSET(14104, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+ NAME_FUNC_OFFSET(14134, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+ NAME_FUNC_OFFSET(14164, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+ NAME_FUNC_OFFSET(14194, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
+ NAME_FUNC_OFFSET(14213, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
+ NAME_FUNC_OFFSET(14236, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
+ NAME_FUNC_OFFSET(14261, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
+ NAME_FUNC_OFFSET(14286, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
+ NAME_FUNC_OFFSET(14313, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
+ NAME_FUNC_OFFSET(14341, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
+ NAME_FUNC_OFFSET(14368, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
+ NAME_FUNC_OFFSET(14396, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
+ NAME_FUNC_OFFSET(14425, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
+ NAME_FUNC_OFFSET(14454, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter),
+ NAME_FUNC_OFFSET(14480, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv),
+ NAME_FUNC_OFFSET(14511, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv),
+ NAME_FUNC_OFFSET(14542, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter),
+ NAME_FUNC_OFFSET(14566, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
+ NAME_FUNC_OFFSET(14589, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram),
+ NAME_FUNC_OFFSET(14607, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv),
+ NAME_FUNC_OFFSET(14636, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv),
+ NAME_FUNC_OFFSET(14665, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax),
+ NAME_FUNC_OFFSET(14680, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv),
+ NAME_FUNC_OFFSET(14706, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv),
+ NAME_FUNC_OFFSET(14732, glHistogram, glHistogram, NULL, _gloffset_Histogram),
+ NAME_FUNC_OFFSET(14747, glMinmax, glMinmax, NULL, _gloffset_Minmax),
+ NAME_FUNC_OFFSET(14759, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
+ NAME_FUNC_OFFSET(14779, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
+ NAME_FUNC_OFFSET(14796, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
+ NAME_FUNC_OFFSET(14812, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
+ NAME_FUNC_OFFSET(14831, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
+ NAME_FUNC_OFFSET(14854, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
+ NAME_FUNC_OFFSET(14870, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
+ NAME_FUNC_OFFSET(14892, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
+ NAME_FUNC_OFFSET(14910, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
+ NAME_FUNC_OFFSET(14929, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
+ NAME_FUNC_OFFSET(14947, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
+ NAME_FUNC_OFFSET(14966, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
+ NAME_FUNC_OFFSET(14984, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
+ NAME_FUNC_OFFSET(15003, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
+ NAME_FUNC_OFFSET(15021, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
+ NAME_FUNC_OFFSET(15040, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
+ NAME_FUNC_OFFSET(15058, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
+ NAME_FUNC_OFFSET(15077, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
+ NAME_FUNC_OFFSET(15095, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
+ NAME_FUNC_OFFSET(15114, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
+ NAME_FUNC_OFFSET(15132, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
+ NAME_FUNC_OFFSET(15151, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
+ NAME_FUNC_OFFSET(15169, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
+ NAME_FUNC_OFFSET(15188, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
+ NAME_FUNC_OFFSET(15206, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
+ NAME_FUNC_OFFSET(15225, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
+ NAME_FUNC_OFFSET(15243, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
+ NAME_FUNC_OFFSET(15262, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
+ NAME_FUNC_OFFSET(15280, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
+ NAME_FUNC_OFFSET(15299, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
+ NAME_FUNC_OFFSET(15317, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
+ NAME_FUNC_OFFSET(15336, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
+ NAME_FUNC_OFFSET(15354, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
+ NAME_FUNC_OFFSET(15373, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
+ NAME_FUNC_OFFSET(15391, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
+ NAME_FUNC_OFFSET(15410, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
+ NAME_FUNC_OFFSET(15428, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
+ NAME_FUNC_OFFSET(15447, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
+ NAME_FUNC_OFFSET(15465, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
+ NAME_FUNC_OFFSET(15484, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
+ NAME_FUNC_OFFSET(15507, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
+ NAME_FUNC_OFFSET(15530, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
+ NAME_FUNC_OFFSET(15553, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
+ NAME_FUNC_OFFSET(15576, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
+ NAME_FUNC_OFFSET(15593, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
+ NAME_FUNC_OFFSET(15616, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
+ NAME_FUNC_OFFSET(15639, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
+ NAME_FUNC_OFFSET(15662, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
+ NAME_FUNC_OFFSET(15688, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
+ NAME_FUNC_OFFSET(15714, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
+ NAME_FUNC_OFFSET(15740, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
+ NAME_FUNC_OFFSET(15764, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET(15791, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET(15817, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
+ NAME_FUNC_OFFSET(15837, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
+ NAME_FUNC_OFFSET(15857, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
+ NAME_FUNC_OFFSET(15877, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
+ NAME_FUNC_OFFSET(15894, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
+ NAME_FUNC_OFFSET(15912, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
+ NAME_FUNC_OFFSET(15929, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB),
+ NAME_FUNC_OFFSET(15947, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB),
+ NAME_FUNC_OFFSET(15964, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB),
+ NAME_FUNC_OFFSET(15982, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB),
+ NAME_FUNC_OFFSET(15999, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB),
+ NAME_FUNC_OFFSET(16017, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB),
+ NAME_FUNC_OFFSET(16034, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB),
+ NAME_FUNC_OFFSET(16052, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB),
+ NAME_FUNC_OFFSET(16069, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB),
+ NAME_FUNC_OFFSET(16087, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB),
+ NAME_FUNC_OFFSET(16104, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB),
+ NAME_FUNC_OFFSET(16122, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB),
+ NAME_FUNC_OFFSET(16139, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB),
+ NAME_FUNC_OFFSET(16157, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB),
+ NAME_FUNC_OFFSET(16174, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB),
+ NAME_FUNC_OFFSET(16192, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB),
+ NAME_FUNC_OFFSET(16211, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB),
+ NAME_FUNC_OFFSET(16230, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB),
+ NAME_FUNC_OFFSET(16249, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB),
+ NAME_FUNC_OFFSET(16268, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
+ NAME_FUNC_OFFSET(16288, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
+ NAME_FUNC_OFFSET(16308, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
+ NAME_FUNC_OFFSET(16328, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
+ NAME_FUNC_OFFSET(16345, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
+ NAME_FUNC_OFFSET(16363, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
+ NAME_FUNC_OFFSET(16380, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
+ NAME_FUNC_OFFSET(16398, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
+ NAME_FUNC_OFFSET(16415, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
+ NAME_FUNC_OFFSET(16433, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
+ NAME_FUNC_OFFSET(16455, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
+ NAME_FUNC_OFFSET(16468, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
+ NAME_FUNC_OFFSET(16481, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
+ NAME_FUNC_OFFSET(16497, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
+ NAME_FUNC_OFFSET(16513, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
+ NAME_FUNC_OFFSET(16526, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
+ NAME_FUNC_OFFSET(16549, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
+ NAME_FUNC_OFFSET(16569, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
+ NAME_FUNC_OFFSET(16588, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
+ NAME_FUNC_OFFSET(16599, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
+ NAME_FUNC_OFFSET(16611, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
+ NAME_FUNC_OFFSET(16625, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
+ NAME_FUNC_OFFSET(16638, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
+ NAME_FUNC_OFFSET(16654, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
+ NAME_FUNC_OFFSET(16665, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
+ NAME_FUNC_OFFSET(16678, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
+ NAME_FUNC_OFFSET(16697, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
+ NAME_FUNC_OFFSET(16717, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
+ NAME_FUNC_OFFSET(16730, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
+ NAME_FUNC_OFFSET(16740, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
+ NAME_FUNC_OFFSET(16756, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
+ NAME_FUNC_OFFSET(16775, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
+ NAME_FUNC_OFFSET(16793, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
+ NAME_FUNC_OFFSET(16814, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
+ NAME_FUNC_OFFSET(16829, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
+ NAME_FUNC_OFFSET(16844, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
+ NAME_FUNC_OFFSET(16858, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
+ NAME_FUNC_OFFSET(16873, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
+ NAME_FUNC_OFFSET(16885, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
+ NAME_FUNC_OFFSET(16898, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
+ NAME_FUNC_OFFSET(16910, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
+ NAME_FUNC_OFFSET(16923, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
+ NAME_FUNC_OFFSET(16935, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
+ NAME_FUNC_OFFSET(16948, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
+ NAME_FUNC_OFFSET(16960, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
+ NAME_FUNC_OFFSET(16973, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
+ NAME_FUNC_OFFSET(16985, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
+ NAME_FUNC_OFFSET(16998, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
+ NAME_FUNC_OFFSET(17010, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
+ NAME_FUNC_OFFSET(17023, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
+ NAME_FUNC_OFFSET(17035, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
+ NAME_FUNC_OFFSET(17048, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
+ NAME_FUNC_OFFSET(17060, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
+ NAME_FUNC_OFFSET(17073, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
+ NAME_FUNC_OFFSET(17092, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
+ NAME_FUNC_OFFSET(17111, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
+ NAME_FUNC_OFFSET(17130, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
+ NAME_FUNC_OFFSET(17143, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
+ NAME_FUNC_OFFSET(17161, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
+ NAME_FUNC_OFFSET(17182, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
+ NAME_FUNC_OFFSET(17200, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
+ NAME_FUNC_OFFSET(17220, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17234, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17251, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
+ NAME_FUNC_OFFSET(17267, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
+ NAME_FUNC_OFFSET(17286, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17304, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17325, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17347, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17366, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17388, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17411, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
+ NAME_FUNC_OFFSET(17430, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
+ NAME_FUNC_OFFSET(17450, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
+ NAME_FUNC_OFFSET(17469, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
+ NAME_FUNC_OFFSET(17489, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
+ NAME_FUNC_OFFSET(17508, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
+ NAME_FUNC_OFFSET(17528, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
+ NAME_FUNC_OFFSET(17547, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
+ NAME_FUNC_OFFSET(17567, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
+ NAME_FUNC_OFFSET(17586, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
+ NAME_FUNC_OFFSET(17606, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
+ NAME_FUNC_OFFSET(17626, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
+ NAME_FUNC_OFFSET(17647, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
+ NAME_FUNC_OFFSET(17667, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
+ NAME_FUNC_OFFSET(17688, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
+ NAME_FUNC_OFFSET(17708, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
+ NAME_FUNC_OFFSET(17729, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
+ NAME_FUNC_OFFSET(17753, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
+ NAME_FUNC_OFFSET(17771, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
+ NAME_FUNC_OFFSET(17791, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
+ NAME_FUNC_OFFSET(17809, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
+ NAME_FUNC_OFFSET(17821, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
+ NAME_FUNC_OFFSET(17834, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
+ NAME_FUNC_OFFSET(17846, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
+ NAME_FUNC_OFFSET(17859, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(17879, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(17903, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(17917, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(17934, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(17949, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(17967, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(17981, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(17998, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18013, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18031, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18045, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18062, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18077, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18095, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18109, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18126, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18141, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18159, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18173, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18190, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18205, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18223, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18237, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18254, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18269, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18287, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18301, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18318, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18333, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18351, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18365, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18382, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18397, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18415, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
+ NAME_FUNC_OFFSET(18432, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
+ NAME_FUNC_OFFSET(18452, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
+ NAME_FUNC_OFFSET(18469, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(18498, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
+ NAME_FUNC_OFFSET(18513, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+ NAME_FUNC_OFFSET(18531, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+ NAME_FUNC_OFFSET(18550, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(18574, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
};
#undef NAME_FUNC_OFFSET
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h
index 0958cd1b32c..a61086d0dc6 100644
--- a/src/mesa/glapi/glthread.h
+++ b/src/mesa/glapi/glthread.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -64,6 +64,12 @@
#define GLTHREAD_H
+#if defined(USE_MGL_NAMESPACE)
+#define _glapi_Dispatch _mglapi_Dispatch
+#endif
+
+
+
#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
&& !defined(THREADS)
diff --git a/src/mesa/glapi/sources b/src/mesa/glapi/sources
new file mode 100644
index 00000000000..1d5c2528211
--- /dev/null
+++ b/src/mesa/glapi/sources
@@ -0,0 +1,12 @@
+MESA_GLAPI_SOURCES = \
+glapi.c \
+glthread.c
+
+MESA_GLAPI_HEADERS = \
+dispatch.h \
+glapi.h \
+glapioffsets.h \
+glapitable.h \
+glapitemp.h \
+glprocs.h \
+glthread.h
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index a6e422640cf..2345695f3c6 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -94,11 +94,7 @@ _mesa_Accum( GLenum op, GLfloat value )
}
if (ctx->RenderMode == GL_RENDER) {
- GLint x = ctx->DrawBuffer->_Xmin;
- GLint y = ctx->DrawBuffer->_Ymin;
- GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- ctx->Driver.Accum(ctx, op, value, x, y, width, height);
+ ctx->Driver.Accum(ctx, op, value);
}
}
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index dda659bbc3f..1899975213f 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -53,6 +53,11 @@ typedef struct {
AEarray arrays[32];
AEattrib attribs[VERT_ATTRIB_MAX + 1];
GLuint NewState;
+
+ struct gl_buffer_object *vbo[VERT_ATTRIB_MAX];
+ GLuint nr_vbos;
+ GLboolean mapped_vbos;
+
} AEcontext;
#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context)
@@ -1046,7 +1051,7 @@ GLboolean _ae_create_context( GLcontext *ctx )
FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
- ctx->aelt_context = MALLOC( sizeof(AEcontext) );
+ ctx->aelt_context = CALLOC( sizeof(AEcontext) );
if (!ctx->aelt_context)
return GL_FALSE;
@@ -1063,6 +1068,19 @@ void _ae_destroy_context( GLcontext *ctx )
}
}
+static void check_vbo( AEcontext *actx,
+ struct gl_buffer_object *vbo )
+{
+ if (vbo->Name && !vbo->Pointer) {
+ GLuint i;
+ for (i = 0; i < actx->nr_vbos; i++)
+ if (actx->vbo[i] == vbo)
+ return;
+ assert(actx->nr_vbos < VERT_ATTRIB_MAX);
+ actx->vbo[actx->nr_vbos++] = vbo;
+ }
+}
+
/**
* Make a list of per-vertex functions to call for each glArrayElement call.
@@ -1077,35 +1095,43 @@ static void _ae_update_state( GLcontext *ctx )
AEattrib *at = actx->attribs;
GLuint i;
+ actx->nr_vbos = 0;
+
/* conventional vertex arrays */
if (ctx->Array.ArrayObj->Index.Enabled) {
aa->array = &ctx->Array.ArrayObj->Index;
aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->EdgeFlag.Enabled) {
aa->array = &ctx->Array.ArrayObj->EdgeFlag;
aa->offset = _gloffset_EdgeFlagv;
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->Normal.Enabled) {
aa->array = &ctx->Array.ArrayObj->Normal;
aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->Color.Enabled) {
aa->array = &ctx->Array.ArrayObj->Color;
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->SecondaryColor.Enabled) {
aa->array = &ctx->Array.ArrayObj->SecondaryColor;
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->FogCoord.Enabled) {
aa->array = &ctx->Array.ArrayObj->FogCoord;
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
@@ -1120,11 +1146,12 @@ static void _ae_update_state( GLcontext *ctx )
[at->array->Size-1]
[TYPE_IDX(at->array->Type)];
at->index = VERT_ATTRIB_TEX0 + i;
+ check_vbo(actx, at->array->BufferObj);
at++;
}
}
- /* generic vertex attribute arrays */
+ /* generic vertex attribute arrays */
for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */
struct gl_client_array *attribArray = &ctx->Array.ArrayObj->VertexAttrib[i];
if (attribArray->Enabled) {
@@ -1146,6 +1173,7 @@ static void _ae_update_state( GLcontext *ctx )
[TYPE_IDX(at->array->Type)];
}
at->index = i;
+ check_vbo(actx, at->array->BufferObj);
at++;
}
}
@@ -1158,14 +1186,18 @@ static void _ae_update_state( GLcontext *ctx )
aa->array = &ctx->Array.ArrayObj->VertexAttrib[0];
assert(aa->array->Size >= 2); /* XXX fix someday? */
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
else if (ctx->Array.ArrayObj->Vertex.Enabled) {
aa->array = &ctx->Array.ArrayObj->Vertex;
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
+ check_vbo(actx, ctx->Array.ElementArrayBufferObj);
+
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
ASSERT(aa - actx->arrays < 32);
at->func = NULL; /* terminate the list */
@@ -1174,6 +1206,45 @@ static void _ae_update_state( GLcontext *ctx )
actx->NewState = 0;
}
+void _ae_map_vbos( GLcontext *ctx )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+ GLuint i;
+
+ if (actx->mapped_vbos)
+ return;
+
+ if (actx->NewState)
+ _ae_update_state(ctx);
+
+ for (i = 0; i < actx->nr_vbos; i++)
+ ctx->Driver.MapBuffer(ctx,
+ GL_ARRAY_BUFFER_ARB,
+ GL_DYNAMIC_DRAW_ARB,
+ actx->vbo[i]);
+
+ if (actx->nr_vbos)
+ actx->mapped_vbos = GL_TRUE;
+}
+
+void _ae_unmap_vbos( GLcontext *ctx )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+ GLuint i;
+
+ if (!actx->mapped_vbos)
+ return;
+
+ assert (!actx->NewState);
+
+ for (i = 0; i < actx->nr_vbos; i++)
+ ctx->Driver.UnmapBuffer(ctx,
+ GL_ARRAY_BUFFER_ARB,
+ actx->vbo[i]);
+
+ actx->mapped_vbos = GL_FALSE;
+}
+
/**
* Called via glArrayElement() and glDrawArrays().
@@ -1188,15 +1259,24 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt )
const AEarray *aa;
const AEattrib *at;
const struct _glapi_table * const disp = GET_DISPATCH();
+ GLboolean do_map;
-
- if (actx->NewState)
+ if (actx->NewState) {
+ assert(!actx->mapped_vbos);
_ae_update_state( ctx );
+ }
+
+ do_map = actx->nr_vbos && !actx->mapped_vbos;
+ /*
+ */
+ if (do_map)
+ _ae_map_vbos(ctx);
+
/* generic attributes */
for (at = actx->attribs; at->func; at++) {
const GLubyte *src
- = ADD_POINTERS(at->array->BufferObj->Data, at->array->Ptr)
+ = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr)
+ elt * at->array->StrideB;
at->func( at->index, src );
}
@@ -1204,15 +1284,34 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt )
/* conventional arrays */
for (aa = actx->arrays; aa->offset != -1 ; aa++) {
const GLubyte *src
- = ADD_POINTERS(aa->array->BufferObj->Data, aa->array->Ptr)
+ = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr)
+ elt * aa->array->StrideB;
CALL_by_offset( disp, (array_func), aa->offset,
((const void *) src) );
}
+
+ if (do_map)
+ _ae_unmap_vbos(ctx);
}
void _ae_invalidate_state( GLcontext *ctx, GLuint new_state )
{
- AE_CONTEXT(ctx)->NewState |= new_state;
+ AEcontext *actx = AE_CONTEXT(ctx);
+
+
+ /* Only interested in this subset of mesa state. Need to prune
+ * this down as both tnl/ and the drivers can raise statechanges
+ * for arcane reasons in the middle of seemingly atomic operations
+ * like DrawElements, over which we'd like to keep a known set of
+ * arrays and vbo's mapped.
+ *
+ * Luckily, neither the drivers nor tnl muck with the state that
+ * concerns us here:
+ */
+ new_state &= _NEW_ARRAY | _NEW_PROGRAM;
+ if (new_state) {
+ assert(!actx->mapped_vbos);
+ actx->NewState |= new_state;
+ }
}
diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h
index 1c0af9f3ea8..e621724fb29 100644
--- a/src/mesa/main/api_arrayelt.h
+++ b/src/mesa/main/api_arrayelt.h
@@ -34,4 +34,9 @@ extern void _ae_destroy_context( GLcontext *ctx );
extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state );
extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt );
+/* May optionally be called before a batch of element calls:
+ */
+extern void _ae_map_vbos( GLcontext *ctx );
+extern void _ae_unmap_vbos( GLcontext *ctx );
+
#endif
diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c
index 51d5af6f5f0..717ef1fc8f0 100644
--- a/src/mesa/main/api_loopback.c
+++ b/src/mesa/main/api_loopback.c
@@ -510,7 +510,7 @@ loopback_TexCoord2sv( const GLshort *v )
static void GLAPIENTRY
loopback_TexCoord3dv( const GLdouble *v )
{
- TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]);
+ TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
}
static void GLAPIENTRY
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index ef970ad9eb6..9993a0021bc 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -337,6 +337,8 @@ _mesa_PushAttrib(GLbitfield mask)
if (mask & GL_TEXTURE_BIT) {
struct gl_texture_attrib *attr;
GLuint u;
+
+ _mesa_lock_context_textures(ctx);
/* Bump the texture object reference counts so that they don't
* inadvertantly get deleted.
*/
@@ -362,6 +364,9 @@ _mesa_PushAttrib(GLbitfield mask)
_mesa_copy_texture_object(&attr->Unit[u].SavedRect,
attr->Unit[u].CurrentRect);
}
+
+ _mesa_unlock_context_textures(ctx);
+
newnode = new_attrib_node( GL_TEXTURE_BIT );
newnode->data = attr;
newnode->next = head;
@@ -1004,9 +1009,6 @@ _mesa_PopAttrib(void)
(GLfloat) light->Model.TwoSide);
_mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL,
(GLfloat) light->Model.ColorControl);
- /* materials */
- MEMCPY(&ctx->Light.Material, &light->Material,
- sizeof(struct gl_material));
/* shade model */
_mesa_ShadeModel(light->ShadeModel);
/* color material */
@@ -1014,6 +1016,9 @@ _mesa_PopAttrib(void)
light->ColorMaterialMode);
_mesa_set_enable(ctx, GL_COLOR_MATERIAL,
light->ColorMaterialEnabled);
+ /* materials */
+ MEMCPY(&ctx->Light.Material, &light->Material,
+ sizeof(struct gl_material));
}
break;
case GL_LINE_BIT:
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index bf886af9e81..81bd4c2f320 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -516,6 +516,37 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
}
+extern void GLAPIENTRY
+_mesa_ClampColorARB(GLenum target, GLenum clamp)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (clamp != GL_TRUE && clamp != GL_FALSE && clamp != GL_FIXED_ONLY_ARB) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(clamp)");
+ return;
+ }
+
+ switch (target) {
+ case GL_CLAMP_VERTEX_COLOR_ARB:
+ ctx->Light.ClampVertexColor = clamp;
+ break;
+ case GL_CLAMP_FRAGMENT_COLOR_ARB:
+ ctx->Color.ClampFragmentColor = clamp;
+ break;
+ case GL_CLAMP_READ_COLOR_ARB:
+ ctx->Color.ClampReadColor = clamp;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(target)");
+ return;
+ }
+}
+
+
+
+
/**********************************************************************/
/** \name Initialization */
/*@{*/
diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
index d6c03d903f4..5c0f2783a73 100644
--- a/src/mesa/main/blend.h
+++ b/src/mesa/main/blend.h
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -72,6 +72,11 @@ extern void GLAPIENTRY
_mesa_ColorMask( GLboolean red, GLboolean green,
GLboolean blue, GLboolean alpha );
+
+extern void GLAPIENTRY
+_mesa_ClampColorARB(GLenum target, GLenum clamp);
+
+
extern void
_mesa_init_color( GLcontext * ctx );
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index adaf3ade078..3f9f7985465 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -296,7 +296,10 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
{
(void) ctx; (void) target;
- if (bufObj->Data && ((GLuint) (size + offset) <= bufObj->Size)) {
+ /* this should have been caught in _mesa_BufferSubData() */
+ ASSERT((GLuint) (size + offset) <= bufObj->Size);
+
+ if (bufObj->Data) {
_mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size );
}
}
@@ -336,9 +339,9 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
/**
* Fallback function called via ctx->Driver.MapBuffer().
* Hardware drivers that really implement buffer objects should never use
- * function.
+ * this function.
*
- * The input parameters will have been already tested for errors.
+ * The function parameters will have been already tested for errors.
*
* \param ctx GL context.
* \param target Buffer object target on which to operate.
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 6f4a51e1072..0e3ed155841 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,11 +1,6 @@
-/**
- * \file buffers.c
- * Frame buffer management.
- */
-
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -28,6 +23,13 @@
*/
+/**
+ * \file buffers.c
+ * General framebuffer-related functions, like glClear, glScissor, etc.
+ */
+
+
+
#include "glheader.h"
#include "buffers.h"
#include "colormac.h"
@@ -139,10 +141,6 @@ _mesa_Clear( GLbitfield mask )
}
if (ctx->RenderMode == GL_RENDER) {
- const GLint x = ctx->DrawBuffer->_Xmin;
- const GLint y = ctx->DrawBuffer->_Ymin;
- const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
GLbitfield bufferMask;
/* don't clear depth buffer if depth writing disabled */
@@ -175,8 +173,7 @@ _mesa_Clear( GLbitfield mask )
}
ASSERT(ctx->Driver.Clear);
- ctx->Driver.Clear( ctx, bufferMask, (GLboolean) !ctx->Scissor.Enabled,
- x, y, width, height );
+ ctx->Driver.Clear(ctx, bufferMask);
}
}
@@ -581,6 +578,9 @@ _mesa_ReadBuffer(GLenum buffer)
#if _HAVE_FULL_GL
/**
+ * XXX THIS IS OBSOLETE - drivers should take care of detecting window
+ * size changes and act accordingly, likely calling _mesa_resize_framebuffer().
+ *
* GL_MESA_resize_buffers extension.
*
* When this function is called, we'll ask the window system how large
@@ -591,16 +591,18 @@ _mesa_ReadBuffer(GLenum buffer)
* \note This function should only be called through the GL API, not
* from device drivers (as was done in the past).
*/
-void GLAPIENTRY
-_mesa_ResizeBuffersMESA( void )
-{
- GET_CURRENT_CONTEXT(ctx);
+void _mesa_resizebuffers( GLcontext *ctx )
+{
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glResizeBuffersMESA\n");
+ if (!ctx->Driver.GetBufferSize) {
+ return;
+ }
+
if (ctx->WinSysDrawBuffer) {
GLuint newWidth, newHeight;
GLframebuffer *buffer = ctx->WinSysDrawBuffer;
@@ -639,6 +641,19 @@ _mesa_ResizeBuffersMESA( void )
/*
+ * XXX THIS IS OBSOLETE
+ */
+void GLAPIENTRY
+_mesa_ResizeBuffersMESA( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (ctx->Extensions.MESA_resize_buffers)
+ _mesa_resizebuffers( ctx );
+}
+
+
+/*
* XXX move somewhere else someday?
*/
void GLAPIENTRY
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index b61bdad4330..fcc21523421 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -78,4 +78,6 @@ extern void
_mesa_set_scissor(GLcontext *ctx,
GLint x, GLint y, GLsizei width, GLsizei height);
+extern void _mesa_resizebuffers( GLcontext *ctx );
+
#endif
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index 8b6fc127fe9..e9349516eb8 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -32,7 +32,7 @@
#include "state.h"
-/*
+/**
* Given an internalFormat token passed to glColorTable,
* return the corresponding base format.
* Return -1 if invalid token.
@@ -92,32 +92,14 @@ base_colortab_format( GLenum format )
-/*
+/**
* Examine table's format and set the component sizes accordingly.
*/
static void
set_component_sizes( struct gl_color_table *table )
{
- GLubyte sz;
-
- switch (table->Type) {
- case GL_UNSIGNED_BYTE:
- sz = 8 * sizeof(GLubyte);
- break;
- case GL_UNSIGNED_SHORT:
- sz = 8 * sizeof(GLushort);
- break;
- case GL_FLOAT:
- /* Don't actually return 32 here since that causes the conformance
- * tests to blow up. Conform thinks the component is an integer,
- * not a float.
- */
- sz = 8; /** 8 * sizeof(GLfloat); **/
- break;
- default:
- _mesa_problem(NULL, "bad color table type in set_component_sizes 0x%x", table->Type);
- return;
- }
+ /* assuming the ubyte table */
+ const GLubyte sz = 8;
switch (table->_BaseFormat) {
case GL_ALPHA:
@@ -217,7 +199,7 @@ store_colortable_entries(GLcontext *ctx, struct gl_color_table *table,
}
- if (table->Type == GL_FLOAT) {
+ {
/* convert user-provided data to GLfloat values */
GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
GLfloat *tableF;
@@ -233,7 +215,7 @@ store_colortable_entries(GLcontext *ctx, struct gl_color_table *table,
IMAGE_CLAMP_BIT); /* transfer ops */
/* the destination */
- tableF = (GLfloat *) table->Table;
+ tableF = table->TableF;
/* Apply scale & bias & clamp now */
switch (table->_BaseFormat) {
@@ -284,16 +266,16 @@ store_colortable_entries(GLcontext *ctx, struct gl_color_table *table,
return;
}
}
- else {
- /* non-float (GLchan) */
+
+ /* update the ubyte table */
+ {
const GLint comps = _mesa_components_in_format(table->_BaseFormat);
- GLchan *dest = (GLchan *) table->Table + start * comps;
- _mesa_unpack_color_span_chan(ctx, count, /* number of entries */
- table->_BaseFormat, /* dest format */
- dest, /* dest address */
- format, type, data, /* src data */
- &ctx->Unpack,
- 0); /* transfer ops */
+ const GLfloat *tableF = table->TableF + start * comps;
+ GLubyte *tableUB = table->TableUB + start * comps;
+ GLint i;
+ for (i = 0; i < count * comps; i++) {
+ CLAMPED_FLOAT_TO_UBYTE(tableUB[i], tableF[i]);
+ }
}
if (ctx->Unpack.BufferObj->Name) {
@@ -317,7 +299,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
GLint baseFormat;
GLfloat rScale = 1.0, gScale = 1.0, bScale = 1.0, aScale = 1.0;
GLfloat rBias = 0.0, gBias = 0.0, bBias = 0.0, aBias = 0.0;
- GLenum tableType = CHAN_TYPE;
GLint comps;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */
@@ -367,11 +348,9 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
break;
case GL_SHARED_TEXTURE_PALETTE_EXT:
table = &ctx->Texture.Palette;
- tableType = GL_FLOAT;
break;
case GL_COLOR_TABLE:
table = &ctx->ColorTable;
- tableType = GL_FLOAT;
rScale = ctx->Pixel.ColorTableScale[0];
gScale = ctx->Pixel.ColorTableScale[1];
bScale = ctx->Pixel.ColorTableScale[2];
@@ -391,7 +370,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
return;
}
table = &(texUnit->ColorTable);
- tableType = GL_FLOAT;
rScale = ctx->Pixel.TextureColorTableScale[0];
gScale = ctx->Pixel.TextureColorTableScale[1];
bScale = ctx->Pixel.TextureColorTableScale[2];
@@ -407,12 +385,10 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
return;
}
table = &(texUnit->ProxyColorTable);
- tableType = GL_FLOAT;
proxy = GL_TRUE;
break;
case GL_POST_CONVOLUTION_COLOR_TABLE:
table = &ctx->PostConvolutionColorTable;
- tableType = GL_FLOAT;
rScale = ctx->Pixel.PCCTscale[0];
gScale = ctx->Pixel.PCCTscale[1];
bScale = ctx->Pixel.PCCTscale[2];
@@ -424,12 +400,10 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
break;
case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE:
table = &ctx->ProxyPostConvolutionColorTable;
- tableType = GL_FLOAT;
proxy = GL_TRUE;
break;
case GL_POST_COLOR_MATRIX_COLOR_TABLE:
table = &ctx->PostColorMatrixColorTable;
- tableType = GL_FLOAT;
rScale = ctx->Pixel.PCMCTscale[0];
gScale = ctx->Pixel.PCMCTscale[1];
bScale = ctx->Pixel.PCMCTscale[2];
@@ -441,7 +415,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
break;
case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE:
table = &ctx->ProxyPostColorMatrixColorTable;
- tableType = GL_FLOAT;
proxy = GL_TRUE;
break;
default:
@@ -491,27 +464,18 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
table->Size = width;
table->InternalFormat = internalFormat;
table->_BaseFormat = (GLenum) baseFormat;
- table->Type = (tableType == GL_FLOAT) ? GL_FLOAT : CHAN_TYPE;
comps = _mesa_components_in_format(table->_BaseFormat);
assert(comps > 0); /* error should have been caught sooner */
if (!proxy) {
- /* free old table, if any */
- if (table->Table) {
- FREE(table->Table);
- table->Table = NULL;
- }
+ _mesa_free_colortable_data(table);
if (width > 0) {
- if (table->Type == GL_FLOAT) {
- table->Table = MALLOC(comps * width * sizeof(GLfloat));
- }
- else {
- table->Table = MALLOC(comps * width * sizeof(GLchan));
- }
+ table->TableF = _mesa_malloc(comps * width * sizeof(GLfloat));
+ table->TableUB = _mesa_malloc(comps * width * sizeof(GLubyte));
- if (!table->Table) {
+ if (!table->TableF || !table->TableUB) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable");
return;
}
@@ -652,8 +616,8 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
return;
}
- if (!table->Table) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorSubTable");
+ if (!table->TableF || !table->TableUB) {
+ /* a GL_OUT_OF_MEMORY error would have been recorded previously */
return;
}
@@ -708,7 +672,7 @@ _mesa_GetColorTable( GLenum target, GLenum format,
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_color_table *table = NULL;
- GLchan rgba[MAX_COLOR_TABLE_SIZE][4];
+ GLfloat rgba[MAX_COLOR_TABLE_SIZE][4];
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->NewState) {
@@ -759,177 +723,67 @@ _mesa_GetColorTable( GLenum target, GLenum format,
ASSERT(table);
switch (table->_BaseFormat) {
- case GL_ALPHA:
- if (table->Type == GL_FLOAT) {
- const GLfloat *tableF = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] = 0;
- rgba[i][GCOMP] = 0;
- rgba[i][BCOMP] = 0;
-#if CHAN_BITS==32
- rgba[i][ACOMP] = tableF[i];
-#else
- rgba[i][ACOMP] = IROUND_POS(tableF[i] * CHAN_MAXF);
-#endif
- }
- }
- else {
- const GLchan *tableUB = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] = 0;
- rgba[i][GCOMP] = 0;
- rgba[i][BCOMP] = 0;
- rgba[i][ACOMP] = tableUB[i];
- }
- }
- break;
- case GL_LUMINANCE:
- if (table->Type == GL_FLOAT) {
- const GLfloat *tableF = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
-#if CHAN_BITS==32
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = tableF[i];
- rgba[i][ACOMP] = CHAN_MAX;
-#else
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = IROUND_POS(tableF[i] * CHAN_MAXF);
- rgba[i][ACOMP] = CHAN_MAX;
-#endif
- }
- }
- else {
- const GLchan *tableUB = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = tableUB[i];
- rgba[i][ACOMP] = CHAN_MAX;
- }
- }
- break;
- case GL_LUMINANCE_ALPHA:
- if (table->Type == GL_FLOAT) {
- const GLfloat *tableF = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
-#if CHAN_BITS==32
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = tableF[i*2+0];
- rgba[i][ACOMP] = tableF[i*2+1];
-#else
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = IROUND_POS(tableF[i*2+0] * CHAN_MAXF);
- rgba[i][ACOMP] = IROUND_POS(tableF[i*2+1] * CHAN_MAXF);
-#endif
- }
- }
- else {
- const GLchan *tableUB = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = tableUB[i*2+0];
- rgba[i][ACOMP] = tableUB[i*2+1];
- }
+ case GL_ALPHA:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] = 0;
+ rgba[i][GCOMP] = 0;
+ rgba[i][BCOMP] = 0;
+ rgba[i][ACOMP] = table->TableF[i];
}
- break;
- case GL_INTENSITY:
- if (table->Type == GL_FLOAT) {
- const GLfloat *tableF = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
-#if CHAN_BITS==32
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] =
- rgba[i][ACOMP] = tableF[i];
-#else
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] =
- rgba[i][ACOMP] = IROUND_POS(tableF[i] * CHAN_MAXF);
-#endif
- }
- }
- else {
- const GLchan *tableUB = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] =
- rgba[i][ACOMP] = tableUB[i];
- }
- }
- break;
- case GL_RGB:
- if (table->Type == GL_FLOAT) {
- const GLfloat *tableF = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
-#if CHAN_BITS==32
- rgba[i][RCOMP] = tableF[i*3+0];
- rgba[i][GCOMP] = tableF[i*3+1];
- rgba[i][BCOMP] = tableF[i*3+2];
- rgba[i][ACOMP] = CHAN_MAX;
-#else
- rgba[i][RCOMP] = IROUND_POS(tableF[i*3+0] * CHAN_MAXF);
- rgba[i][GCOMP] = IROUND_POS(tableF[i*3+1] * CHAN_MAXF);
- rgba[i][BCOMP] = IROUND_POS(tableF[i*3+2] * CHAN_MAXF);
- rgba[i][ACOMP] = CHAN_MAX;
-#endif
- }
+ }
+ break;
+ case GL_LUMINANCE:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = table->TableF[i];
+ rgba[i][ACOMP] = 1.0F;
}
- else {
- const GLchan *tableUB = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] = tableUB[i*3+0];
- rgba[i][GCOMP] = tableUB[i*3+1];
- rgba[i][BCOMP] = tableUB[i*3+2];
- rgba[i][ACOMP] = CHAN_MAX;
- }
+ }
+ break;
+ case GL_LUMINANCE_ALPHA:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = table->TableF[i*2+0];
+ rgba[i][ACOMP] = table->TableF[i*2+1];
}
- break;
- case GL_RGBA:
- if (table->Type == GL_FLOAT) {
- const GLfloat *tableF = (const GLfloat *) table->Table;
-#if CHAN_BITS==32
- _mesa_memcpy(rgba, tableF, 4 * table->Size * sizeof(GLfloat));
-#else
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] = IROUND_POS(tableF[i*4+0] * CHAN_MAXF);
- rgba[i][GCOMP] = IROUND_POS(tableF[i*4+1] * CHAN_MAXF);
- rgba[i][BCOMP] = IROUND_POS(tableF[i*4+2] * CHAN_MAXF);
- rgba[i][ACOMP] = IROUND_POS(tableF[i*4+3] * CHAN_MAXF);
- }
-#endif
+ }
+ break;
+ case GL_INTENSITY:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] =
+ rgba[i][ACOMP] = table->TableF[i];
}
- else {
- const GLchan *tableUB = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] = tableUB[i*4+0];
- rgba[i][GCOMP] = tableUB[i*4+1];
- rgba[i][BCOMP] = tableUB[i*4+2];
- rgba[i][ACOMP] = tableUB[i*4+3];
- }
+ }
+ break;
+ case GL_RGB:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] = table->TableF[i*3+0];
+ rgba[i][GCOMP] = table->TableF[i*3+1];
+ rgba[i][BCOMP] = table->TableF[i*3+2];
+ rgba[i][ACOMP] = 1.0F;
}
- break;
- default:
- _mesa_problem(ctx, "bad table format in glGetColorTable");
- return;
+ }
+ break;
+ case GL_RGBA:
+ _mesa_memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat));
+ break;
+ default:
+ _mesa_problem(ctx, "bad table format in glGetColorTable");
+ return;
}
if (ctx->Pack.BufferObj->Name) {
@@ -953,8 +807,8 @@ _mesa_GetColorTable( GLenum target, GLenum format,
data = ADD_POINTERS(buf, data);
}
- _mesa_pack_rgba_span_chan(ctx, table->Size, (const GLchan (*)[4]) rgba,
- format, type, data, &ctx->Pack, GL_FALSE);
+ _mesa_pack_rgba_span_float(ctx, table->Size, rgba,
+ format, type, data, &ctx->Pack, 0x0);
if (ctx->Pack.BufferObj->Name) {
ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
@@ -1434,8 +1288,8 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
void
_mesa_init_colortable( struct gl_color_table *p )
{
- p->Type = CHAN_TYPE;
- p->Table = NULL;
+ p->TableF = NULL;
+ p->TableUB = NULL;
p->Size = 0;
p->InternalFormat = GL_RGBA;
}
@@ -1445,9 +1299,13 @@ _mesa_init_colortable( struct gl_color_table *p )
void
_mesa_free_colortable_data( struct gl_color_table *p )
{
- if (p->Table) {
- FREE(p->Table);
- p->Table = NULL;
+ if (p->TableF) {
+ _mesa_free(p->TableF);
+ p->TableF = NULL;
+ }
+ if (p->TableUB) {
+ _mesa_free(p->TableUB);
+ p->TableUB = NULL;
}
}
@@ -1455,7 +1313,8 @@ _mesa_free_colortable_data( struct gl_color_table *p )
/*
* Initialize all colortables for a context.
*/
-void _mesa_init_colortables( GLcontext * ctx )
+void
+_mesa_init_colortables( GLcontext * ctx )
{
/* Color tables */
_mesa_init_colortable(&ctx->ColorTable);
@@ -1470,7 +1329,8 @@ void _mesa_init_colortables( GLcontext * ctx )
/*
* Free all colortable data for a context
*/
-void _mesa_free_colortables_data( GLcontext *ctx )
+void
+_mesa_free_colortables_data( GLcontext *ctx )
{
_mesa_free_colortable_data(&ctx->ColorTable);
_mesa_free_colortable_data(&ctx->ProxyColorTable);
diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h
index 4bd16210a0b..b6ff737a65f 100644
--- a/src/mesa/main/colortab.h
+++ b/src/mesa/main/colortab.h
@@ -1,18 +1,8 @@
-/**
- * \file colortab.h
- * Color tables.
- *
- * \if subset
- * (No-op)
- *
- * \endif
- */
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index e2ba65ac63b..13c6281f077 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -5,7 +5,7 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -28,8 +28,8 @@
*/
-#ifndef CONFIG_H
-#define CONFIG_H
+#ifndef MESA_CONFIG_H_INCLUDED
+#define MESA_CONFIG_H_INCLUDED
/**
* \name OpenGL implementation limits
@@ -198,6 +198,7 @@
#define MAX_PROGRAM_LOCAL_PARAMS 128 /* KW: power of two */
#define MAX_PROGRAM_MATRICES 8
#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
+#define MAX_PROGRAM_CALL_DEPTH 8
/*@}*/
/** For GL_ARB_fragment_shader */
@@ -323,4 +324,4 @@
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
-#endif /* CONFIG_H */
+#endif /* MESA_CONFIG_H_INCLUDED */
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index afe6048c802..7ff45cffe8b 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -735,6 +735,10 @@ alloc_shared_state( GLcontext *ctx )
ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS;
ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS;
+ _glthread_INIT_MUTEX(ss->TexMutex);
+ ss->TextureStateStamp = 0;
+
+
#if FEATURE_EXT_framebuffer_object
ss->FrameBuffers = _mesa_NewHashTable();
if (!ss->FrameBuffers)
@@ -872,6 +876,16 @@ delete_arrayobj_cb(GLuint id, void *data, void *userData)
_mesa_delete_array_object(ctx, arrayObj);
}
+/**
+ * Callback for deleting an shader object. Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_shaderobj_cb(GLuint id, void *data, void *userData)
+{
+ /* XXX probably need to fix this */
+ _mesa_free(data);
+}
+
/**
* Deallocate a shared state object and all children structures.
@@ -934,6 +948,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
_mesa_DeleteHashTable(ss->ArrayObjects);
#if FEATURE_ARB_shader_objects
+ _mesa_HashDeleteAll(ss->GL2Objects, delete_shaderobj_cb, ctx);
_mesa_DeleteHashTable(ss->GL2Objects);
#endif
@@ -1048,6 +1063,7 @@ _mesa_init_constants( GLcontext *ctx )
ctx->Const.VertexProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS;
ctx->Const.VertexProgram.MaxEnvParams = MAX_NV_VERTEX_PROGRAM_PARAMS;
ctx->Const.VertexProgram.MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
+ ctx->Const.VertexProgram.MaxUniformComponents = MAX_VERTEX_UNIFORM_COMPONENTS;
init_natives(&ctx->Const.VertexProgram);
#endif
#if FEATURE_ARB_fragment_program
@@ -1061,6 +1077,7 @@ _mesa_init_constants( GLcontext *ctx )
ctx->Const.FragmentProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS;
ctx->Const.FragmentProgram.MaxEnvParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
ctx->Const.FragmentProgram.MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS;
+ ctx->Const.FragmentProgram.MaxUniformComponents = MAX_FRAGMENT_UNIFORM_COMPONENTS;
init_natives(&ctx->Const.FragmentProgram);
#endif
ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
@@ -1069,7 +1086,7 @@ _mesa_init_constants( GLcontext *ctx )
/* If we're running in the X server, do bounds checking to prevent
* segfaults and server crashes!
*/
-#if defined(XFree86LOADER) && defined(IN_MODULE)
+#if defined(XFree86Server)
ctx->Const.CheckArrayBounds = GL_TRUE;
#else
ctx->Const.CheckArrayBounds = GL_FALSE;
@@ -1087,6 +1104,11 @@ _mesa_init_constants( GLcontext *ctx )
ctx->Const.MaxRenderbufferSize = MAX_WIDTH;
#endif
+#if FEATURE_ARB_vertex_shader
+ ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+ ctx->Const.MaxVaryingFloats = MAX_VARYING_FLOATS;
+#endif
+
/* sanity checks */
ASSERT(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
ctx->Const.MaxTextureCoordUnits));
@@ -1629,11 +1651,12 @@ static void
initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb)
{
GLuint width, height;
- ASSERT(ctx->Driver.GetBufferSize);
- ctx->Driver.GetBufferSize(fb, &width, &height);
- if (ctx->Driver.ResizeBuffers)
- ctx->Driver.ResizeBuffers(ctx, fb, width, height);
- fb->Initialized = GL_TRUE;
+ if (ctx->Driver.GetBufferSize) {
+ ctx->Driver.GetBufferSize(fb, &width, &height);
+ if (ctx->Driver.ResizeBuffers)
+ ctx->Driver.ResizeBuffers(ctx, fb, width, height);
+ fb->Initialized = GL_TRUE;
+ }
}
@@ -1706,6 +1729,9 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
newCtx->NewState |= _NEW_BUFFERS;
+#if 1
+ /* We want to get rid of these lines: */
+
#if _HAVE_FULL_GL
if (!drawBuffer->Initialized) {
initialize_framebuffer_size(newCtx, drawBuffer);
@@ -1713,7 +1739,26 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
if (readBuffer != drawBuffer && !readBuffer->Initialized) {
initialize_framebuffer_size(newCtx, readBuffer);
}
+
+ _mesa_resizebuffers(newCtx);
#endif
+
+#else
+ /* We want the drawBuffer and readBuffer to be initialized by
+ * the driver.
+ * This generally means the Width and Height match the actual
+ * window size and the renderbuffers (both hardware and software
+ * based) are allocated to match. The later can generally be
+ * done with a call to _mesa_resize_framebuffer().
+ *
+ * It's theoretically possible for a buffer to have zero width
+ * or height, but for now, assert check that the driver did what's
+ * expected of it.
+ */
+ ASSERT(drawBuffer->Width > 0);
+ ASSERT(drawBuffer->Height > 0);
+#endif
+
if (newCtx->FirstTimeCurrent) {
/* set initial viewport and scissor size now */
_mesa_set_viewport(newCtx, 0, 0,
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index c72fe8a56ac..e7e0fda72ea 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -317,4 +317,12 @@ do { \
)
+/**
+ * Is RGBA LogicOp enabled?
+ */
+#define RGBA_LOGICOP_ENABLED(CTX) \
+ ((CTX)->Color.ColorLogicOpEnabled || \
+ ((CTX)->Color.BlendEnabled && (CTX)->Color.BlendEquationRGB == GL_LOGIC_OP))
+
+
#endif /* CONTEXT_H */
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c
index 6b97c7f56cd..814c6a0a5a6 100644
--- a/src/mesa/main/convolve.c
+++ b/src/mesa/main/convolve.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -560,9 +560,10 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi
void GLAPIENTRY
-_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
+_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *image)
{
- const struct gl_convolution_attrib *filter;
+ struct gl_convolution_attrib *filter;
GLuint row;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -623,10 +624,9 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *im
GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width,
filter->Height, format, type,
row, 0);
- const GLfloat *src = filter->Filter + row * filter->Width * 4;
- _mesa_pack_rgba_span_float(ctx, filter->Width,
- (const GLfloat (*)[4]) src,
- format, type, dst, &ctx->Pack, 0);
+ GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4);
+ _mesa_pack_rgba_span_float(ctx, filter->Width, src,
+ format, type, dst, &ctx->Pack, 0x0);
}
if (ctx->Pack.BufferObj->Name) {
@@ -768,10 +768,11 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
void GLAPIENTRY
-_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *row, GLvoid *column, GLvoid *span)
{
const GLint colStart = MAX_CONVOLUTION_WIDTH * 4;
- const struct gl_convolution_attrib *filter;
+ struct gl_convolution_attrib *filter;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -785,7 +786,8 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row,
}
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetConvolutionFilter(format or type)");
return;
}
@@ -833,18 +835,17 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row,
GLvoid *dst = _mesa_image_address1d(&ctx->Pack, row, filter->Width,
format, type, 0);
_mesa_pack_rgba_span_float(ctx, filter->Width,
- (const GLfloat (*)[4]) filter->Filter,
- format, type, dst, &ctx->Pack, 0);
+ (GLfloat (*)[4]) filter->Filter,
+ format, type, dst, &ctx->Pack, 0x0);
}
/* Column filter */
if (column) {
GLvoid *dst = _mesa_image_address1d(&ctx->Pack, column, filter->Height,
format, type, 0);
- const GLfloat *src = filter->Filter + colStart;
- _mesa_pack_rgba_span_float(ctx, filter->Height,
- (const GLfloat (*)[4]) src,
- format, type, dst, &ctx->Pack, 0);
+ GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart);
+ _mesa_pack_rgba_span_float(ctx, filter->Height, src,
+ format, type, dst, &ctx->Pack, 0x0);
}
(void) span; /* unused at this time */
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 1b8cf6304e5..1de2542bee2 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -52,8 +52,7 @@ struct mesa_display_list;
struct dd_function_table {
/**
* Return a string as needed by glGetString().
- *
- * Only the GL_RENDERER token must be implemented. Otherwise, NULL can be
+ * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be
* returned.
*/
const GLubyte * (*GetString)( GLcontext *ctx, GLenum name );
@@ -70,19 +69,20 @@ struct dd_function_table {
* Get the width and height of the named buffer/window.
*
* Mesa uses this to determine when the driver's window size has changed.
+ * XXX OBSOLETE: this function will be removed in the future.
*/
void (*GetBufferSize)( GLframebuffer *buffer,
GLuint *width, GLuint *height );
/**
* Resize the given framebuffer to the given size.
+ * XXX OBSOLETE: this function will be removed in the future.
*/
void (*ResizeBuffers)( GLcontext *ctx, GLframebuffer *fb,
GLuint width, GLuint height);
/**
* Called whenever an error is generated.
- *
* __GLcontextRec::ErrorValue contains the error value.
*/
void (*Error)( GLcontext *ctx );
@@ -99,40 +99,24 @@ struct dd_function_table {
/**
* Clear the color/depth/stencil/accum buffer(s).
- *
- * \param mask a bitmask of the DD_*_BIT values defined above that indicates
- * which buffers need to be cleared.
- * \param all if true then clear the whole buffer, else clear only the
- * region defined by <tt>(x, y, width, height)</tt>.
- *
- * This function must obey the glColorMask(), glIndexMask() and
- * glStencilMask() settings!
- * Software Mesa can do masked clears if the device driver can't.
+ * \param buffers a bitmask of BUFFER_BIT_* flags indicating which
+ * renderbuffers need to be cleared.
*/
- void (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
+ void (*Clear)( GLcontext *ctx, GLbitfield buffers );
-
- /**
- * \name For hardware accumulation buffer
- */
- /*@{*/
/**
- * Execute glAccum command within the given scissor region.
+ * Execute glAccum command.
*/
- void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height );
- /*@}*/
+ void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value );
/**
- * \name glDraw(), glRead(), glCopyPixels() and glBitmap() functions
+ * \name Image-related functions
*/
/*@{*/
/**
- * This is called by glDrawPixels().
- *
+ * Called by glDrawPixels().
* \p unpack describes how to unpack the source image data.
*/
void (*DrawPixels)( GLcontext *ctx,
@@ -151,19 +135,14 @@ struct dd_function_table {
GLvoid *dest );
/**
- * Do a glCopyPixels().
- *
- * This function must respect all rasterization state, glPixelTransfer(),
- * glPixelZoom(), etc.
+ * Called by glCopyPixels().
*/
void (*CopyPixels)( GLcontext *ctx, GLint srcx, GLint srcy,
GLsizei width, GLsizei height,
GLint dstx, GLint dsty, GLenum type );
/**
- * This is called by glBitmap().
- *
- * Works the same as dd_function_table::DrawPixels, above.
+ * Called by glBitmap().
*/
void (*Bitmap)( GLcontext *ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
@@ -591,8 +570,9 @@ struct dd_function_table {
/** Notify driver that a program string has been specified. */
void (*ProgramStringNotify)(GLcontext *ctx, GLenum target,
struct gl_program *prog);
-
-
+ /** Get value of a fragment program register during program execution. */
+ void (*GetFragmentProgramRegister)(GLcontext *ctx, enum register_file file,
+ GLuint index, GLfloat val[4]);
/** Query if program can be loaded onto hardware */
GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target,
diff --git a/src/mesa/main/descrip.mms b/src/mesa/main/descrip.mms
index 5790e6b796c..d09c57b3212 100644
--- a/src/mesa/main/descrip.mms
+++ b/src/mesa/main/descrip.mms
@@ -56,6 +56,7 @@ SOURCES =accum.c \
light.c \
lines.c \
matrix.c \
+ mipmap.c \
mm.c \
occlude.c \
pixel.c \
@@ -118,6 +119,7 @@ imports.obj,\
light.obj,\
lines.obj,\
matrix.obj,\
+mipmap.obj,\
mm.obj,\
occlude.obj,\
pixel.obj,\
@@ -193,6 +195,7 @@ imports.obj : imports.c vsnprintf.c
light.obj : light.c
lines.obj : lines.c
matrix.obj : matrix.c
+mipmap.obj : mipmap.c
mm.obj : mm.c
occlude.obj : occlude.c
pixel.obj : pixel.c
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 8be01cfb7dc..dca6ede6cb3 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -7869,7 +7869,6 @@ _mesa_init_dlist_table(struct _glapi_table *table)
/* GL 1.1 */
SET_AreTexturesResident(table, exec_AreTexturesResident);
- SET_AreTexturesResidentEXT(table, exec_AreTexturesResident);
SET_BindTexture(table, save_BindTexture);
SET_ColorPointer(table, exec_ColorPointer);
SET_CopyTexImage1D(table, save_CopyTexImage1D);
@@ -7881,12 +7880,10 @@ _mesa_init_dlist_table(struct _glapi_table *table)
SET_EdgeFlagPointer(table, exec_EdgeFlagPointer);
SET_EnableClientState(table, exec_EnableClientState);
SET_GenTextures(table, exec_GenTextures);
- SET_GenTexturesEXT(table, exec_GenTextures);
SET_GetPointerv(table, exec_GetPointerv);
SET_IndexPointer(table, exec_IndexPointer);
SET_InterleavedArrays(table, exec_InterleavedArrays);
SET_IsTexture(table, exec_IsTexture);
- SET_IsTextureEXT(table, exec_IsTexture);
SET_NormalPointer(table, exec_NormalPointer);
SET_PopClientAttrib(table, exec_PopClientAttrib);
SET_PrioritizeTextures(table, save_PrioritizeTextures);
@@ -7925,31 +7922,18 @@ _mesa_init_dlist_table(struct _glapi_table *table)
SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D);
SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D);
SET_GetColorTable(table, exec_GetColorTable);
- SET_GetColorTableSGI(table, exec_GetColorTable);
SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv);
- SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv);
SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv);
- SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv);
SET_GetConvolutionFilter(table, exec_GetConvolutionFilter);
- SET_GetConvolutionFilterEXT(table, exec_GetConvolutionFilter);
SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv);
- SET_GetConvolutionParameterfvEXT(table, exec_GetConvolutionParameterfv);
SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv);
- SET_GetConvolutionParameterivEXT(table, exec_GetConvolutionParameteriv);
SET_GetHistogram(table, exec_GetHistogram);
- SET_GetHistogramEXT(table, exec_GetHistogram);
SET_GetHistogramParameterfv(table, exec_GetHistogramParameterfv);
- SET_GetHistogramParameterfvEXT(table, exec_GetHistogramParameterfv);
SET_GetHistogramParameteriv(table, exec_GetHistogramParameteriv);
- SET_GetHistogramParameterivEXT(table, exec_GetHistogramParameteriv);
SET_GetMinmax(table, exec_GetMinmax);
- SET_GetMinmaxEXT(table, exec_GetMinmax);
SET_GetMinmaxParameterfv(table, exec_GetMinmaxParameterfv);
- SET_GetMinmaxParameterfvEXT(table, exec_GetMinmaxParameterfv);
SET_GetMinmaxParameteriv(table, exec_GetMinmaxParameteriv);
- SET_GetMinmaxParameterivEXT(table, exec_GetMinmaxParameteriv);
SET_GetSeparableFilter(table, exec_GetSeparableFilter);
- SET_GetSeparableFilterEXT(table, exec_GetSeparableFilter);
SET_Histogram(table, save_Histogram);
SET_Minmax(table, save_Minmax);
SET_ResetHistogram(table, save_ResetHistogram);
@@ -7975,10 +7959,10 @@ _mesa_init_dlist_table(struct _glapi_table *table)
#if 0
SET_ColorTableSGI(table, save_ColorTable);
SET_ColorSubTableSGI(table, save_ColorSubTable);
-#endif
SET_GetColorTableSGI(table, exec_GetColorTable);
SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv);
SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv);
+#endif
/* 30. GL_EXT_vertex_array */
SET_ColorPointerEXT(table, exec_ColorPointerEXT);
@@ -8068,7 +8052,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
- SET_IsProgramNV(table, _mesa_IsProgram);
+ SET_IsProgramNV(table, _mesa_IsProgramARB);
SET_LoadProgramNV(table, save_LoadProgramNV);
SET_ProgramParameter4dNV(table, save_ProgramParameter4dNV);
SET_ProgramParameter4dvNV(table, save_ProgramParameter4dvNV);
@@ -8161,7 +8145,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
SET_BindProgramNV(table, save_BindProgramNV);
SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
SET_GenProgramsNV(table, _mesa_GenPrograms);
- SET_IsProgramNV(table, _mesa_IsProgram);
+ SET_IsProgramNV(table, _mesa_IsProgramARB);
SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV);
SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index b569d6ad6f6..fc56809e978 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -34,7 +34,7 @@ typedef struct {
int n;
} enum_elt;
-static const char enum_string_table[] =
+LONGSTRING static const char enum_string_table[] =
"GL_2D\0"
"GL_2_BYTES\0"
"GL_3D\0"
@@ -50,9 +50,13 @@ static const char enum_string_table[] =
"GL_ACCUM_CLEAR_VALUE\0"
"GL_ACCUM_GREEN_BITS\0"
"GL_ACCUM_RED_BITS\0"
+ "GL_ACTIVE_ATTRIBUTES\0"
+ "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH\0"
"GL_ACTIVE_STENCIL_FACE_EXT\0"
"GL_ACTIVE_TEXTURE\0"
"GL_ACTIVE_TEXTURE_ARB\0"
+ "GL_ACTIVE_UNIFORMS\0"
+ "GL_ACTIVE_UNIFORM_MAX_LENGTH\0"
"GL_ACTIVE_VERTEX_UNITS_ARB\0"
"GL_ADD\0"
"GL_ADD_SIGNED\0"
@@ -87,6 +91,7 @@ static const char enum_string_table[] =
"GL_ARRAY_BUFFER_ARB\0"
"GL_ARRAY_BUFFER_BINDING\0"
"GL_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_ATTACHED_SHADERS\0"
"GL_ATTRIB_ARRAY_POINTER_NV\0"
"GL_ATTRIB_ARRAY_SIZE_NV\0"
"GL_ATTRIB_ARRAY_STRIDE_NV\0"
@@ -112,6 +117,7 @@ static const char enum_string_table[] =
"GL_BLEND_DST_ALPHA\0"
"GL_BLEND_DST_RGB\0"
"GL_BLEND_EQUATION\0"
+ "GL_BLEND_EQUATION_ALPHA\0"
"GL_BLEND_EQUATION_ALPHA_EXT\0"
"GL_BLEND_EQUATION_EXT\0"
"GL_BLEND_EQUATION_RGB_EXT\0"
@@ -122,9 +128,13 @@ static const char enum_string_table[] =
"GL_BLUE_BIAS\0"
"GL_BLUE_BITS\0"
"GL_BLUE_SCALE\0"
+ "GL_BOOL\0"
"GL_BOOL_ARB\0"
+ "GL_BOOL_VEC2\0"
"GL_BOOL_VEC2_ARB\0"
+ "GL_BOOL_VEC3\0"
"GL_BOOL_VEC3_ARB\0"
+ "GL_BOOL_VEC4\0"
"GL_BOOL_VEC4_ARB\0"
"GL_BUFFER_ACCESS\0"
"GL_BUFFER_ACCESS_ARB\0"
@@ -245,6 +255,7 @@ static const char enum_string_table[] =
"GL_COMPARE_R_TO_TEXTURE_ARB\0"
"GL_COMPILE\0"
"GL_COMPILE_AND_EXECUTE\0"
+ "GL_COMPILE_STATUS\0"
"GL_COMPRESSED_ALPHA\0"
"GL_COMPRESSED_ALPHA_ARB\0"
"GL_COMPRESSED_INTENSITY\0"
@@ -289,6 +300,7 @@ static const char enum_string_table[] =
"GL_CONVOLUTION_HEIGHT_EXT\0"
"GL_CONVOLUTION_WIDTH\0"
"GL_CONVOLUTION_WIDTH_EXT\0"
+ "GL_COORD_REPLACE\0"
"GL_COORD_REPLACE_ARB\0"
"GL_COORD_REPLACE_NV\0"
"GL_COPY\0"
@@ -312,6 +324,7 @@ static const char enum_string_table[] =
"GL_CURRENT_MATRIX_STACK_DEPTH_NV\0"
"GL_CURRENT_NORMAL\0"
"GL_CURRENT_PALETTE_MATRIX_ARB\0"
+ "GL_CURRENT_PROGRAM\0"
"GL_CURRENT_QUERY\0"
"GL_CURRENT_QUERY_ARB\0"
"GL_CURRENT_RASTER_COLOR\0"
@@ -322,6 +335,7 @@ static const char enum_string_table[] =
"GL_CURRENT_RASTER_TEXTURE_COORDS\0"
"GL_CURRENT_SECONDARY_COLOR\0"
"GL_CURRENT_TEXTURE_COORDS\0"
+ "GL_CURRENT_VERTEX_ATTRIB\0"
"GL_CURRENT_VERTEX_ATTRIB_ARB\0"
"GL_CURRENT_WEIGHT_ARB\0"
"GL_CW\0"
@@ -332,6 +346,7 @@ static const char enum_string_table[] =
"GL_DECR\0"
"GL_DECR_WRAP\0"
"GL_DECR_WRAP_EXT\0"
+ "GL_DELETE_STATUS\0"
"GL_DEPTH\0"
"GL_DEPTH_ATTACHMENT_EXT\0"
"GL_DEPTH_BIAS\0"
@@ -374,36 +389,52 @@ static const char enum_string_table[] =
"GL_DOUBLE\0"
"GL_DOUBLEBUFFER\0"
"GL_DRAW_BUFFER\0"
+ "GL_DRAW_BUFFER0\0"
"GL_DRAW_BUFFER0_ARB\0"
"GL_DRAW_BUFFER0_ATI\0"
+ "GL_DRAW_BUFFER1\0"
+ "GL_DRAW_BUFFER10\0"
"GL_DRAW_BUFFER10_ARB\0"
"GL_DRAW_BUFFER10_ATI\0"
+ "GL_DRAW_BUFFER11\0"
"GL_DRAW_BUFFER11_ARB\0"
"GL_DRAW_BUFFER11_ATI\0"
+ "GL_DRAW_BUFFER12\0"
"GL_DRAW_BUFFER12_ARB\0"
"GL_DRAW_BUFFER12_ATI\0"
+ "GL_DRAW_BUFFER13\0"
"GL_DRAW_BUFFER13_ARB\0"
"GL_DRAW_BUFFER13_ATI\0"
+ "GL_DRAW_BUFFER14\0"
"GL_DRAW_BUFFER14_ARB\0"
"GL_DRAW_BUFFER14_ATI\0"
+ "GL_DRAW_BUFFER15\0"
"GL_DRAW_BUFFER15_ARB\0"
"GL_DRAW_BUFFER15_ATI\0"
"GL_DRAW_BUFFER1_ARB\0"
"GL_DRAW_BUFFER1_ATI\0"
+ "GL_DRAW_BUFFER2\0"
"GL_DRAW_BUFFER2_ARB\0"
"GL_DRAW_BUFFER2_ATI\0"
+ "GL_DRAW_BUFFER3\0"
"GL_DRAW_BUFFER3_ARB\0"
"GL_DRAW_BUFFER3_ATI\0"
+ "GL_DRAW_BUFFER4\0"
"GL_DRAW_BUFFER4_ARB\0"
"GL_DRAW_BUFFER4_ATI\0"
+ "GL_DRAW_BUFFER5\0"
"GL_DRAW_BUFFER5_ARB\0"
"GL_DRAW_BUFFER5_ATI\0"
+ "GL_DRAW_BUFFER6\0"
"GL_DRAW_BUFFER6_ARB\0"
"GL_DRAW_BUFFER6_ATI\0"
+ "GL_DRAW_BUFFER7\0"
"GL_DRAW_BUFFER7_ARB\0"
"GL_DRAW_BUFFER7_ATI\0"
+ "GL_DRAW_BUFFER8\0"
"GL_DRAW_BUFFER8_ARB\0"
"GL_DRAW_BUFFER8_ATI\0"
+ "GL_DRAW_BUFFER9\0"
"GL_DRAW_BUFFER9_ARB\0"
"GL_DRAW_BUFFER9_ATI\0"
"GL_DRAW_FRAMEBUFFER_BINDING_EXT\0"
@@ -448,11 +479,17 @@ static const char enum_string_table[] =
"GL_FILL\0"
"GL_FLAT\0"
"GL_FLOAT\0"
+ "GL_FLOAT_MAT2\0"
"GL_FLOAT_MAT2_ARB\0"
+ "GL_FLOAT_MAT3\0"
"GL_FLOAT_MAT3_ARB\0"
+ "GL_FLOAT_MAT4\0"
"GL_FLOAT_MAT4_ARB\0"
+ "GL_FLOAT_VEC2\0"
"GL_FLOAT_VEC2_ARB\0"
+ "GL_FLOAT_VEC3\0"
"GL_FLOAT_VEC3_ARB\0"
+ "GL_FLOAT_VEC4\0"
"GL_FLOAT_VEC4_ARB\0"
"GL_FOG\0"
"GL_FOG_BIT\0"
@@ -483,7 +520,9 @@ static const char enum_string_table[] =
"GL_FOG_START\0"
"GL_FRAGMENT_DEPTH\0"
"GL_FRAGMENT_PROGRAM_ARB\0"
+ "GL_FRAGMENT_SHADER\0"
"GL_FRAGMENT_SHADER_ARB\0"
+ "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0"
"GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0"
"GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0"
"GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0"
@@ -517,6 +556,30 @@ static const char enum_string_table[] =
"GL_GENERATE_MIPMAP_HINT_SGIS\0"
"GL_GENERATE_MIPMAP_SGIS\0"
"GL_GEQUAL\0"
+ "GL_GL_BLEND_EQUATION_RGB\0"
+ "GL_GL_COMPRESSED_SLUMINANCE\0"
+ "GL_GL_COMPRESSED_SLUMINANCE_ALPHA\0"
+ "GL_GL_COMPRESSED_SRGB\0"
+ "GL_GL_COMPRESSED_SRGB_ALPHA\0"
+ "GL_GL_CURRENT_RASTER_SECONDARY_COLOR\0"
+ "GL_GL_FLOAT_MAT2x3\0"
+ "GL_GL_FLOAT_MAT2x4\0"
+ "GL_GL_FLOAT_MAT3x2\0"
+ "GL_GL_FLOAT_MAT3x4\0"
+ "GL_GL_FLOAT_MAT4x2\0"
+ "GL_GL_FLOAT_MAT4x3\0"
+ "GL_GL_PIXEL_PACK_BUFFER\0"
+ "GL_GL_PIXEL_PACK_BUFFER_BINDING\0"
+ "GL_GL_PIXEL_UNPACK_BUFFER\0"
+ "GL_GL_PIXEL_UNPACK_BUFFER_BINDING\0"
+ "GL_GL_SLUMINANCE\0"
+ "GL_GL_SLUMINANCE8\0"
+ "GL_GL_SLUMINANCE8_ALPHA8\0"
+ "GL_GL_SLUMINANCE_ALPHA\0"
+ "GL_GL_SRGB\0"
+ "GL_GL_SRGB8\0"
+ "GL_GL_SRGB8_ALPHA8\0"
+ "GL_GL_SRGB_ALPHA\0"
"GL_GREATER\0"
"GL_GREEN\0"
"GL_GREEN_BIAS\0"
@@ -561,6 +624,7 @@ static const char enum_string_table[] =
"GL_INDEX_OFFSET\0"
"GL_INDEX_SHIFT\0"
"GL_INDEX_WRITEMASK\0"
+ "GL_INFO_LOG_LENGTH\0"
"GL_INT\0"
"GL_INTENSITY\0"
"GL_INTENSITY12\0"
@@ -575,8 +639,11 @@ static const char enum_string_table[] =
"GL_INTERPOLATE\0"
"GL_INTERPOLATE_ARB\0"
"GL_INTERPOLATE_EXT\0"
+ "GL_INT_VEC2\0"
"GL_INT_VEC2_ARB\0"
+ "GL_INT_VEC3\0"
"GL_INT_VEC3_ARB\0"
+ "GL_INT_VEC4\0"
"GL_INT_VEC4_ARB\0"
"GL_INVALID_ENUM\0"
"GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0"
@@ -625,6 +692,7 @@ static const char enum_string_table[] =
"GL_LINE_WIDTH\0"
"GL_LINE_WIDTH_GRANULARITY\0"
"GL_LINE_WIDTH_RANGE\0"
+ "GL_LINK_STATUS\0"
"GL_LIST_BASE\0"
"GL_LIST_BIT\0"
"GL_LIST_INDEX\0"
@@ -632,6 +700,7 @@ static const char enum_string_table[] =
"GL_LOAD\0"
"GL_LOGIC_OP\0"
"GL_LOGIC_OP_MODE\0"
+ "GL_LOWER_LEFT\0"
"GL_LUMINANCE\0"
"GL_LUMINANCE12\0"
"GL_LUMINANCE12_ALPHA12\0"
@@ -767,6 +836,7 @@ static const char enum_string_table[] =
"GL_MAX_COLOR_ATTACHMENTS_EXT\0"
"GL_MAX_COLOR_MATRIX_STACK_DEPTH\0"
"GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI\0"
+ "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS\0"
"GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB\0"
"GL_MAX_CONVOLUTION_HEIGHT\0"
"GL_MAX_CONVOLUTION_HEIGHT_EXT\0"
@@ -774,12 +844,14 @@ static const char enum_string_table[] =
"GL_MAX_CONVOLUTION_WIDTH_EXT\0"
"GL_MAX_CUBE_MAP_TEXTURE_SIZE\0"
"GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\0"
+ "GL_MAX_DRAW_BUFFERS\0"
"GL_MAX_DRAW_BUFFERS_ARB\0"
"GL_MAX_DRAW_BUFFERS_ATI\0"
"GL_MAX_ELEMENTS_INDICES\0"
"GL_MAX_ELEMENTS_VERTICES\0"
"GL_MAX_EVAL_ORDER\0"
"GL_MAX_EXT\0"
+ "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS\0"
"GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB\0"
"GL_MAX_LIGHTS\0"
"GL_MAX_LIST_NESTING\0"
@@ -819,7 +891,9 @@ static const char enum_string_table[] =
"GL_MAX_RENDERBUFFER_SIZE_EXT\0"
"GL_MAX_SHININESS_NV\0"
"GL_MAX_SPOT_EXPONENT_NV\0"
+ "GL_MAX_TEXTURE_COORDS\0"
"GL_MAX_TEXTURE_COORDS_ARB\0"
+ "GL_MAX_TEXTURE_IMAGE_UNITS\0"
"GL_MAX_TEXTURE_IMAGE_UNITS_ARB\0"
"GL_MAX_TEXTURE_LOD_BIAS\0"
"GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\0"
@@ -829,9 +903,13 @@ static const char enum_string_table[] =
"GL_MAX_TEXTURE_UNITS_ARB\0"
"GL_MAX_TRACK_MATRICES_NV\0"
"GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0"
+ "GL_MAX_VARYING_FLOATS\0"
"GL_MAX_VARYING_FLOATS_ARB\0"
+ "GL_MAX_VERTEX_ATTRIBS\0"
"GL_MAX_VERTEX_ATTRIBS_ARB\0"
+ "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0"
"GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0"
+ "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0"
"GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB\0"
"GL_MAX_VERTEX_UNITS_ARB\0"
"GL_MAX_VIEWPORT_DIMS\0"
@@ -1047,6 +1125,7 @@ static const char enum_string_table[] =
"GL_POINT_SIZE_RANGE\0"
"GL_POINT_SMOOTH\0"
"GL_POINT_SMOOTH_HINT\0"
+ "GL_POINT_SPRITE\0"
"GL_POINT_SPRITE_ARB\0"
"GL_POINT_SPRITE_COORD_ORIGIN\0"
"GL_POINT_SPRITE_NV\0"
@@ -1246,6 +1325,12 @@ static const char enum_string_table[] =
"GL_RGB_SCALE_EXT\0"
"GL_RIGHT\0"
"GL_S\0"
+ "GL_SAMPLER_1D\0"
+ "GL_SAMPLER_1D_SHADOW\0"
+ "GL_SAMPLER_2D\0"
+ "GL_SAMPLER_2D_SHADOW\0"
+ "GL_SAMPLER_3D\0"
+ "GL_SAMPLER_CUBE\0"
"GL_SAMPLES\0"
"GL_SAMPLES_3DFX\0"
"GL_SAMPLES_ARB\0"
@@ -1282,7 +1367,10 @@ static const char enum_string_table[] =
"GL_SEPARATE_SPECULAR_COLOR_EXT\0"
"GL_SET\0"
"GL_SHADER_OBJECT_ARB\0"
+ "GL_SHADER_SOURCE_LENGTH\0"
+ "GL_SHADER_TYPE\0"
"GL_SHADE_MODEL\0"
+ "GL_SHADING_LANGUAGE_VERSION\0"
"GL_SHADOW_AMBIENT_SGIX\0"
"GL_SHARED_TEXTURE_PALETTE_EXT\0"
"GL_SHININESS\0"
@@ -1339,6 +1427,13 @@ static const char enum_string_table[] =
"GL_STATIC_READ_ARB\0"
"GL_STENCIL\0"
"GL_STENCIL_ATTACHMENT_EXT\0"
+ "GL_STENCIL_BACK_FAIL\0"
+ "GL_STENCIL_BACK_FUNC\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_FAIL\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_PASS\0"
+ "GL_STENCIL_BACK_REF\0"
+ "GL_STENCIL_BACK_VALUE_MASK\0"
+ "GL_STENCIL_BACK_WRITEMASK\0"
"GL_STENCIL_BITS\0"
"GL_STENCIL_BUFFER_BIT\0"
"GL_STENCIL_CLEAR_VALUE\0"
@@ -1601,8 +1696,10 @@ static const char enum_string_table[] =
"GL_UNSIGNED_SHORT_8_8_MESA\0"
"GL_UNSIGNED_SHORT_8_8_REV_APPLE\0"
"GL_UNSIGNED_SHORT_8_8_REV_MESA\0"
+ "GL_UPPER_LEFT\0"
"GL_V2F\0"
"GL_V3F\0"
+ "GL_VALIDATE_STATUS\0"
"GL_VENDOR\0"
"GL_VERSION\0"
"GL_VERTEX_ARRAY\0"
@@ -1631,20 +1728,29 @@ static const char enum_string_table[] =
"GL_VERTEX_ATTRIB_ARRAY9_NV\0"
"GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\0"
"GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_ENABLED\0"
"GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED\0"
"GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_POINTER\0"
"GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_SIZE\0"
"GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_STRIDE\0"
"GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_TYPE\0"
"GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB\0"
"GL_VERTEX_BLEND_ARB\0"
"GL_VERTEX_PROGRAM_ARB\0"
"GL_VERTEX_PROGRAM_BINDING_NV\0"
"GL_VERTEX_PROGRAM_NV\0"
+ "GL_VERTEX_PROGRAM_POINT_SIZE\0"
"GL_VERTEX_PROGRAM_POINT_SIZE_ARB\0"
"GL_VERTEX_PROGRAM_POINT_SIZE_NV\0"
+ "GL_VERTEX_PROGRAM_TWO_SIDE\0"
"GL_VERTEX_PROGRAM_TWO_SIDE_ARB\0"
"GL_VERTEX_PROGRAM_TWO_SIDE_NV\0"
+ "GL_VERTEX_SHADER\0"
"GL_VERTEX_SHADER_ARB\0"
"GL_VERTEX_STATE_PROGRAM_NV\0"
"GL_VIEWPORT\0"
@@ -1668,7 +1774,7 @@ static const char enum_string_table[] =
"GL_ZOOM_Y\0"
;
-static const enum_elt all_enums[1631] =
+static const enum_elt all_enums[1737] =
{
{ 0, 0x00000600 }, /* GL_2D */
{ 6, 0x00001407 }, /* GL_2_BYTES */
@@ -1685,2866 +1791,3009 @@ static const enum_elt all_enums[1631] =
{ 165, 0x00000B80 }, /* GL_ACCUM_CLEAR_VALUE */
{ 186, 0x00000D59 }, /* GL_ACCUM_GREEN_BITS */
{ 206, 0x00000D58 }, /* GL_ACCUM_RED_BITS */
- { 224, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */
- { 251, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */
- { 269, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */
- { 291, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- { 318, 0x00000104 }, /* GL_ADD */
- { 325, 0x00008574 }, /* GL_ADD_SIGNED */
- { 339, 0x00008574 }, /* GL_ADD_SIGNED_ARB */
- { 357, 0x00008574 }, /* GL_ADD_SIGNED_EXT */
- { 375, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */
- { 403, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */
- { 431, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */
- { 450, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */
- { 476, 0x00001906 }, /* GL_ALPHA */
- { 485, 0x0000803D }, /* GL_ALPHA12 */
- { 496, 0x0000803D }, /* GL_ALPHA12_EXT */
- { 511, 0x0000803E }, /* GL_ALPHA16 */
- { 522, 0x0000803E }, /* GL_ALPHA16_EXT */
- { 537, 0x0000803B }, /* GL_ALPHA4 */
- { 547, 0x0000803B }, /* GL_ALPHA4_EXT */
- { 561, 0x0000803C }, /* GL_ALPHA8 */
- { 571, 0x0000803C }, /* GL_ALPHA8_EXT */
- { 585, 0x00000D1D }, /* GL_ALPHA_BIAS */
- { 599, 0x00000D55 }, /* GL_ALPHA_BITS */
- { 613, 0x00000D1C }, /* GL_ALPHA_SCALE */
- { 628, 0x00000BC0 }, /* GL_ALPHA_TEST */
- { 642, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */
- { 661, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */
- { 679, 0x00000207 }, /* GL_ALWAYS */
- { 689, 0x00001200 }, /* GL_AMBIENT */
- { 700, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */
- { 723, 0x00001501 }, /* GL_AND */
- { 730, 0x00001504 }, /* GL_AND_INVERTED */
- { 746, 0x00001502 }, /* GL_AND_REVERSE */
- { 761, 0x00008892 }, /* GL_ARRAY_BUFFER */
- { 777, 0x00008892 }, /* GL_ARRAY_BUFFER_ARB */
- { 797, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */
- { 821, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */
- { 849, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */
- { 876, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */
- { 900, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */
- { 926, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */
- { 950, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */
- { 972, 0x00000D80 }, /* GL_AUTO_NORMAL */
- { 987, 0x00000409 }, /* GL_AUX0 */
- { 995, 0x0000040A }, /* GL_AUX1 */
- { 1003, 0x0000040B }, /* GL_AUX2 */
- { 1011, 0x0000040C }, /* GL_AUX3 */
- { 1019, 0x00000C00 }, /* GL_AUX_BUFFERS */
- { 1034, 0x00000405 }, /* GL_BACK */
- { 1042, 0x00000402 }, /* GL_BACK_LEFT */
- { 1055, 0x00000403 }, /* GL_BACK_RIGHT */
- { 1069, 0x000080E0 }, /* GL_BGR */
- { 1076, 0x000080E1 }, /* GL_BGRA */
- { 1084, 0x00001A00 }, /* GL_BITMAP */
- { 1094, 0x00000704 }, /* GL_BITMAP_TOKEN */
- { 1110, 0x00000BE2 }, /* GL_BLEND */
- { 1119, 0x00008005 }, /* GL_BLEND_COLOR */
- { 1134, 0x00008005 }, /* GL_BLEND_COLOR_EXT */
- { 1153, 0x00000BE0 }, /* GL_BLEND_DST */
- { 1166, 0x000080CA }, /* GL_BLEND_DST_ALPHA */
- { 1185, 0x000080C8 }, /* GL_BLEND_DST_RGB */
- { 1202, 0x00008009 }, /* GL_BLEND_EQUATION */
- { 1220, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */
- { 1248, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */
- { 1270, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */
- { 1296, 0x00000BE1 }, /* GL_BLEND_SRC */
- { 1309, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */
- { 1328, 0x000080C9 }, /* GL_BLEND_SRC_RGB */
- { 1345, 0x00001905 }, /* GL_BLUE */
- { 1353, 0x00000D1B }, /* GL_BLUE_BIAS */
- { 1366, 0x00000D54 }, /* GL_BLUE_BITS */
- { 1379, 0x00000D1A }, /* GL_BLUE_SCALE */
- { 1393, 0x00008B56 }, /* GL_BOOL_ARB */
- { 1405, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */
- { 1422, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */
- { 1439, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */
- { 1456, 0x000088BB }, /* GL_BUFFER_ACCESS */
- { 1473, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */
- { 1494, 0x000088BC }, /* GL_BUFFER_MAPPED */
- { 1511, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */
- { 1532, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */
- { 1554, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */
- { 1580, 0x00008764 }, /* GL_BUFFER_SIZE */
- { 1595, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */
- { 1614, 0x00008765 }, /* GL_BUFFER_USAGE */
- { 1630, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */
- { 1650, 0x00001400 }, /* GL_BYTE */
- { 1658, 0x00002A24 }, /* GL_C3F_V3F */
- { 1669, 0x00002A26 }, /* GL_C4F_N3F_V3F */
- { 1684, 0x00002A22 }, /* GL_C4UB_V2F */
- { 1696, 0x00002A23 }, /* GL_C4UB_V3F */
- { 1708, 0x00000901 }, /* GL_CCW */
- { 1715, 0x00002900 }, /* GL_CLAMP */
- { 1724, 0x0000812D }, /* GL_CLAMP_TO_BORDER */
- { 1743, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */
- { 1766, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */
- { 1790, 0x0000812F }, /* GL_CLAMP_TO_EDGE */
- { 1807, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */
- { 1829, 0x00001500 }, /* GL_CLEAR */
- { 1838, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */
- { 1863, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */
- { 1892, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */
- { 1918, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
- { 1947, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */
- { 1973, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */
- { 2000, 0x00003000 }, /* GL_CLIP_PLANE0 */
- { 2015, 0x00003001 }, /* GL_CLIP_PLANE1 */
- { 2030, 0x00003002 }, /* GL_CLIP_PLANE2 */
- { 2045, 0x00003003 }, /* GL_CLIP_PLANE3 */
- { 2060, 0x00003004 }, /* GL_CLIP_PLANE4 */
- { 2075, 0x00003005 }, /* GL_CLIP_PLANE5 */
- { 2090, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- { 2123, 0x00000A00 }, /* GL_COEFF */
- { 2132, 0x00001800 }, /* GL_COLOR */
- { 2141, 0x00008076 }, /* GL_COLOR_ARRAY */
- { 2156, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- { 2186, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 2220, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */
- { 2243, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */
- { 2263, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */
- { 2285, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */
- { 2305, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
- { 2330, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
- { 2356, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
- { 2382, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
- { 2408, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
- { 2434, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
- { 2460, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
- { 2486, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
- { 2511, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
- { 2536, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
- { 2561, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
- { 2586, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
- { 2611, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
- { 2636, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
- { 2661, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
- { 2686, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
- { 2711, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
- { 2731, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
- { 2752, 0x00001900 }, /* GL_COLOR_INDEX */
- { 2767, 0x00001603 }, /* GL_COLOR_INDEXES */
- { 2784, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
- { 2802, 0x00000B57 }, /* GL_COLOR_MATERIAL */
- { 2820, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
- { 2843, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
- { 2871, 0x000080B1 }, /* GL_COLOR_MATRIX */
- { 2887, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
- { 2907, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
- { 2935, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 2967, 0x00008458 }, /* GL_COLOR_SUM */
- { 2980, 0x00008458 }, /* GL_COLOR_SUM_ARB */
- { 2997, 0x000080D0 }, /* GL_COLOR_TABLE */
- { 3012, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
- { 3038, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
- { 3068, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
- { 3098, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
- { 3118, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
- { 3142, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
- { 3167, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
- { 3196, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
- { 3225, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
- { 3247, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
- { 3273, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
- { 3299, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
- { 3325, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
- { 3355, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
- { 3385, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
- { 3415, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
- { 3449, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
- { 3483, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- { 3513, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
- { 3547, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
- { 3581, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
- { 3605, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
- { 3633, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
- { 3661, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
- { 3682, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
- { 3707, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
- { 3728, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
- { 3753, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
- { 3778, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
- { 3797, 0x00008570 }, /* GL_COMBINE */
- { 3808, 0x00008503 }, /* GL_COMBINE4 */
- { 3820, 0x00008572 }, /* GL_COMBINE_ALPHA */
- { 3837, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
- { 3858, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
- { 3879, 0x00008570 }, /* GL_COMBINE_ARB */
- { 3894, 0x00008570 }, /* GL_COMBINE_EXT */
- { 3909, 0x00008571 }, /* GL_COMBINE_RGB */
- { 3924, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
- { 3943, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
- { 3962, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
- { 3986, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
- { 4014, 0x00001300 }, /* GL_COMPILE */
- { 4025, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
- { 4048, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
- { 4068, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
- { 4092, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
- { 4116, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
- { 4144, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
- { 4168, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- { 4198, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
- { 4232, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
- { 4260, 0x000084ED }, /* GL_COMPRESSED_RGB */
- { 4278, 0x000084EE }, /* GL_COMPRESSED_RGBA */
- { 4297, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
- { 4320, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- { 4349, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- { 4382, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- { 4415, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- { 4448, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
- { 4470, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- { 4498, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- { 4530, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
- { 4560, 0x00008576 }, /* GL_CONSTANT */
- { 4572, 0x00008003 }, /* GL_CONSTANT_ALPHA */
- { 4590, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
- { 4612, 0x00008576 }, /* GL_CONSTANT_ARB */
- { 4628, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
- { 4652, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
- { 4674, 0x00008001 }, /* GL_CONSTANT_COLOR */
- { 4692, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
- { 4714, 0x00008576 }, /* GL_CONSTANT_EXT */
- { 4730, 0x00008010 }, /* GL_CONVOLUTION_1D */
- { 4748, 0x00008011 }, /* GL_CONVOLUTION_2D */
- { 4766, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
- { 4794, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
- { 4825, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
- { 4852, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
- { 4883, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
- { 4910, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
- { 4941, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
- { 4969, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
- { 5001, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
- { 5023, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
- { 5049, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
- { 5071, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
- { 5097, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
- { 5118, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
- { 5143, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
- { 5164, 0x00008862 }, /* GL_COORD_REPLACE_NV */
- { 5184, 0x00001503 }, /* GL_COPY */
- { 5192, 0x0000150C }, /* GL_COPY_INVERTED */
- { 5209, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
- { 5229, 0x00000B44 }, /* GL_CULL_FACE */
- { 5242, 0x00000B45 }, /* GL_CULL_FACE_MODE */
- { 5260, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
- { 5279, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- { 5311, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- { 5346, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
- { 5367, 0x00000001 }, /* GL_CURRENT_BIT */
- { 5382, 0x00000B00 }, /* GL_CURRENT_COLOR */
- { 5399, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
- { 5420, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
- { 5446, 0x00000B01 }, /* GL_CURRENT_INDEX */
- { 5463, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
- { 5485, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
- { 5513, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
- { 5534, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- { 5568, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
- { 5601, 0x00000B02 }, /* GL_CURRENT_NORMAL */
- { 5619, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- { 5649, 0x00008865 }, /* GL_CURRENT_QUERY */
- { 5666, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
- { 5687, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
- { 5711, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
- { 5738, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
- { 5762, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
- { 5789, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
- { 5822, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- { 5855, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
- { 5882, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
- { 5908, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
- { 5937, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
- { 5959, 0x00000900 }, /* GL_CW */
- { 5965, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
- { 5986, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
- { 6007, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
- { 6027, 0x00002101 }, /* GL_DECAL */
- { 6036, 0x00001E03 }, /* GL_DECR */
- { 6044, 0x00008508 }, /* GL_DECR_WRAP */
- { 6057, 0x00008508 }, /* GL_DECR_WRAP_EXT */
- { 6074, 0x00001801 }, /* GL_DEPTH */
- { 6083, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
- { 6107, 0x00000D1F }, /* GL_DEPTH_BIAS */
- { 6121, 0x00000D56 }, /* GL_DEPTH_BITS */
- { 6135, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
- { 6155, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
- { 6180, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
- { 6200, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
- { 6218, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
- { 6239, 0x00001902 }, /* GL_DEPTH_COMPONENT */
- { 6258, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
- { 6279, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
- { 6304, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
- { 6330, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
- { 6351, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
- { 6376, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
- { 6402, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
- { 6423, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
- { 6448, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
- { 6474, 0x00000B74 }, /* GL_DEPTH_FUNC */
- { 6488, 0x00000B70 }, /* GL_DEPTH_RANGE */
- { 6503, 0x00000D1E }, /* GL_DEPTH_SCALE */
- { 6518, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
- { 6538, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- { 6566, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- { 6594, 0x00000B71 }, /* GL_DEPTH_TEST */
- { 6608, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
- { 6630, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
- { 6656, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
- { 6675, 0x00001201 }, /* GL_DIFFUSE */
- { 6686, 0x00000BD0 }, /* GL_DITHER */
- { 6696, 0x00000A02 }, /* GL_DOMAIN */
- { 6706, 0x00001100 }, /* GL_DONT_CARE */
- { 6719, 0x000086AE }, /* GL_DOT3_RGB */
- { 6731, 0x000086AF }, /* GL_DOT3_RGBA */
- { 6744, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
- { 6761, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
- { 6778, 0x000086AE }, /* GL_DOT3_RGB_ARB */
- { 6794, 0x00008740 }, /* GL_DOT3_RGB_EXT */
- { 6810, 0x0000140A }, /* GL_DOUBLE */
- { 6820, 0x00000C32 }, /* GL_DOUBLEBUFFER */
- { 6836, 0x00000C01 }, /* GL_DRAW_BUFFER */
- { 6851, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
- { 6871, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
- { 6891, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
- { 6912, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
- { 6933, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
- { 6954, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
- { 6975, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
- { 6996, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
- { 7017, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
- { 7038, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
- { 7059, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
- { 7080, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
- { 7101, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
- { 7122, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
- { 7143, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
- { 7163, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
- { 7183, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
- { 7203, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
- { 7223, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
- { 7243, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
- { 7263, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
- { 7283, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
- { 7303, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
- { 7323, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
- { 7343, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
- { 7363, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
- { 7383, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
- { 7403, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
- { 7423, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
- { 7443, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
- { 7463, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
- { 7483, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
- { 7503, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- { 7535, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
- { 7559, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
- { 7579, 0x00000304 }, /* GL_DST_ALPHA */
- { 7592, 0x00000306 }, /* GL_DST_COLOR */
- { 7605, 0x000088EA }, /* GL_DYNAMIC_COPY */
- { 7621, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
- { 7641, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
- { 7657, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
- { 7677, 0x000088E9 }, /* GL_DYNAMIC_READ */
- { 7693, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
- { 7713, 0x00000B43 }, /* GL_EDGE_FLAG */
- { 7726, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
- { 7745, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- { 7779, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
- { 7817, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
- { 7844, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- { 7870, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
- { 7894, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */
- { 7922, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- { 7954, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
- { 7990, 0x00001600 }, /* GL_EMISSION */
- { 8002, 0x00002000 }, /* GL_ENABLE_BIT */
- { 8016, 0x00000202 }, /* GL_EQUAL */
- { 8025, 0x00001509 }, /* GL_EQUIV */
- { 8034, 0x00010000 }, /* GL_EVAL_BIT */
- { 8046, 0x00000800 }, /* GL_EXP */
- { 8053, 0x00000801 }, /* GL_EXP2 */
- { 8061, 0x00001F03 }, /* GL_EXTENSIONS */
- { 8075, 0x00002400 }, /* GL_EYE_LINEAR */
- { 8089, 0x00002502 }, /* GL_EYE_PLANE */
- { 8102, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
- { 8127, 0x0000855B }, /* GL_EYE_RADIAL_NV */
- { 8144, 0x00000000 }, /* GL_FALSE */
- { 8153, 0x00001101 }, /* GL_FASTEST */
- { 8164, 0x00001C01 }, /* GL_FEEDBACK */
- { 8176, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
- { 8203, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
- { 8227, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
- { 8251, 0x00001B02 }, /* GL_FILL */
- { 8259, 0x00001D00 }, /* GL_FLAT */
- { 8267, 0x00001406 }, /* GL_FLOAT */
- { 8276, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
- { 8294, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
- { 8312, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
- { 8330, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
- { 8348, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
- { 8366, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
- { 8384, 0x00000B60 }, /* GL_FOG */
- { 8391, 0x00000080 }, /* GL_FOG_BIT */
- { 8402, 0x00000B66 }, /* GL_FOG_COLOR */
- { 8415, 0x00008451 }, /* GL_FOG_COORD */
- { 8428, 0x00008451 }, /* GL_FOG_COORDINATE */
- { 8446, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
- { 8470, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- { 8509, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
- { 8552, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- { 8584, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- { 8615, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- { 8644, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
- { 8669, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
- { 8688, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
- { 8722, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
- { 8749, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
- { 8775, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
- { 8799, 0x00008450 }, /* GL_FOG_COORD_SRC */
- { 8816, 0x00000B62 }, /* GL_FOG_DENSITY */
- { 8831, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
- { 8855, 0x00000B64 }, /* GL_FOG_END */
- { 8866, 0x00000C54 }, /* GL_FOG_HINT */
- { 8878, 0x00000B61 }, /* GL_FOG_INDEX */
- { 8891, 0x00000B65 }, /* GL_FOG_MODE */
- { 8903, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
- { 8922, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
- { 8947, 0x00000B63 }, /* GL_FOG_START */
- { 8960, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
- { 8978, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
- { 9002, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
- { 9025, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- { 9067, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- { 9109, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- { 9158, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- { 9210, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- { 9254, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
- { 9281, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- { 9309, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
- { 9328, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- { 9369, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- { 9410, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- { 9452, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- { 9503, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- { 9541, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- { 9590, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- { 9632, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- { 9664, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- { 9695, 0x00000404 }, /* GL_FRONT */
- { 9704, 0x00000408 }, /* GL_FRONT_AND_BACK */
- { 9722, 0x00000B46 }, /* GL_FRONT_FACE */
- { 9736, 0x00000400 }, /* GL_FRONT_LEFT */
- { 9750, 0x00000401 }, /* GL_FRONT_RIGHT */
- { 9765, 0x00008006 }, /* GL_FUNC_ADD */
- { 9777, 0x00008006 }, /* GL_FUNC_ADD_EXT */
- { 9793, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
- { 9818, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
- { 9847, 0x0000800A }, /* GL_FUNC_SUBTRACT */
- { 9864, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
- { 9885, 0x00008191 }, /* GL_GENERATE_MIPMAP */
- { 9904, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
- { 9928, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
- { 9957, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
- { 9981, 0x00000206 }, /* GL_GEQUAL */
- { 9991, 0x00000204 }, /* GL_GREATER */
- { 10002, 0x00001904 }, /* GL_GREEN */
- { 10011, 0x00000D19 }, /* GL_GREEN_BIAS */
- { 10025, 0x00000D53 }, /* GL_GREEN_BITS */
- { 10039, 0x00000D18 }, /* GL_GREEN_SCALE */
- { 10054, 0x00008000 }, /* GL_HINT_BIT */
- { 10066, 0x00008024 }, /* GL_HISTOGRAM */
- { 10079, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
- { 10103, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
- { 10131, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
- { 10154, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
- { 10181, 0x00008024 }, /* GL_HISTOGRAM_EXT */
- { 10198, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
- { 10218, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
- { 10242, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
- { 10266, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
- { 10294, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- { 10322, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
- { 10354, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
- { 10376, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
- { 10402, 0x0000802D }, /* GL_HISTOGRAM_SINK */
- { 10420, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
- { 10442, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
- { 10461, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
- { 10484, 0x0000862A }, /* GL_IDENTITY_NV */
- { 10499, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
- { 10519, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- { 10559, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- { 10597, 0x00001E02 }, /* GL_INCR */
- { 10605, 0x00008507 }, /* GL_INCR_WRAP */
- { 10618, 0x00008507 }, /* GL_INCR_WRAP_EXT */
- { 10635, 0x00008077 }, /* GL_INDEX_ARRAY */
- { 10650, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- { 10680, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
- { 10714, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
- { 10737, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
- { 10759, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
- { 10779, 0x00000D51 }, /* GL_INDEX_BITS */
- { 10793, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
- { 10814, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
- { 10832, 0x00000C30 }, /* GL_INDEX_MODE */
- { 10846, 0x00000D13 }, /* GL_INDEX_OFFSET */
- { 10862, 0x00000D12 }, /* GL_INDEX_SHIFT */
- { 10877, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
- { 10896, 0x00001404 }, /* GL_INT */
- { 10903, 0x00008049 }, /* GL_INTENSITY */
- { 10916, 0x0000804C }, /* GL_INTENSITY12 */
- { 10931, 0x0000804C }, /* GL_INTENSITY12_EXT */
- { 10950, 0x0000804D }, /* GL_INTENSITY16 */
- { 10965, 0x0000804D }, /* GL_INTENSITY16_EXT */
- { 10984, 0x0000804A }, /* GL_INTENSITY4 */
- { 10998, 0x0000804A }, /* GL_INTENSITY4_EXT */
- { 11016, 0x0000804B }, /* GL_INTENSITY8 */
- { 11030, 0x0000804B }, /* GL_INTENSITY8_EXT */
- { 11048, 0x00008049 }, /* GL_INTENSITY_EXT */
- { 11065, 0x00008575 }, /* GL_INTERPOLATE */
- { 11080, 0x00008575 }, /* GL_INTERPOLATE_ARB */
- { 11099, 0x00008575 }, /* GL_INTERPOLATE_EXT */
- { 11118, 0x00008B53 }, /* GL_INT_VEC2_ARB */
- { 11134, 0x00008B54 }, /* GL_INT_VEC3_ARB */
- { 11150, 0x00008B55 }, /* GL_INT_VEC4_ARB */
- { 11166, 0x00000500 }, /* GL_INVALID_ENUM */
- { 11182, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
- { 11219, 0x00000502 }, /* GL_INVALID_OPERATION */
- { 11240, 0x00000501 }, /* GL_INVALID_VALUE */
- { 11257, 0x0000862B }, /* GL_INVERSE_NV */
- { 11271, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
- { 11295, 0x0000150A }, /* GL_INVERT */
- { 11305, 0x00001E00 }, /* GL_KEEP */
- { 11313, 0x00000406 }, /* GL_LEFT */
- { 11321, 0x00000203 }, /* GL_LEQUAL */
- { 11331, 0x00000201 }, /* GL_LESS */
- { 11339, 0x00004000 }, /* GL_LIGHT0 */
- { 11349, 0x00004001 }, /* GL_LIGHT1 */
- { 11359, 0x00004002 }, /* GL_LIGHT2 */
- { 11369, 0x00004003 }, /* GL_LIGHT3 */
- { 11379, 0x00004004 }, /* GL_LIGHT4 */
- { 11389, 0x00004005 }, /* GL_LIGHT5 */
- { 11399, 0x00004006 }, /* GL_LIGHT6 */
- { 11409, 0x00004007 }, /* GL_LIGHT7 */
- { 11419, 0x00000B50 }, /* GL_LIGHTING */
- { 11431, 0x00000040 }, /* GL_LIGHTING_BIT */
- { 11447, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
- { 11470, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- { 11499, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
- { 11532, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- { 11560, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
- { 11584, 0x00001B01 }, /* GL_LINE */
- { 11592, 0x00002601 }, /* GL_LINEAR */
- { 11602, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
- { 11624, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- { 11654, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- { 11685, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
- { 11709, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
- { 11734, 0x00000001 }, /* GL_LINES */
- { 11743, 0x00000004 }, /* GL_LINE_BIT */
- { 11755, 0x00000002 }, /* GL_LINE_LOOP */
- { 11768, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
- { 11788, 0x00000B20 }, /* GL_LINE_SMOOTH */
- { 11803, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
- { 11823, 0x00000B24 }, /* GL_LINE_STIPPLE */
- { 11839, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
- { 11863, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
- { 11886, 0x00000003 }, /* GL_LINE_STRIP */
- { 11900, 0x00000702 }, /* GL_LINE_TOKEN */
- { 11914, 0x00000B21 }, /* GL_LINE_WIDTH */
- { 11928, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
- { 11954, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
- { 11974, 0x00000B32 }, /* GL_LIST_BASE */
- { 11987, 0x00020000 }, /* GL_LIST_BIT */
- { 11999, 0x00000B33 }, /* GL_LIST_INDEX */
- { 12013, 0x00000B30 }, /* GL_LIST_MODE */
- { 12026, 0x00000101 }, /* GL_LOAD */
- { 12034, 0x00000BF1 }, /* GL_LOGIC_OP */
- { 12046, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
- { 12063, 0x00001909 }, /* GL_LUMINANCE */
- { 12076, 0x00008041 }, /* GL_LUMINANCE12 */
- { 12091, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
- { 12114, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
- { 12141, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
- { 12163, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
- { 12189, 0x00008041 }, /* GL_LUMINANCE12_EXT */
- { 12208, 0x00008042 }, /* GL_LUMINANCE16 */
- { 12223, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
- { 12246, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
- { 12273, 0x00008042 }, /* GL_LUMINANCE16_EXT */
- { 12292, 0x0000803F }, /* GL_LUMINANCE4 */
- { 12306, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
- { 12327, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
- { 12352, 0x0000803F }, /* GL_LUMINANCE4_EXT */
- { 12370, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
- { 12391, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
- { 12416, 0x00008040 }, /* GL_LUMINANCE8 */
- { 12430, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
- { 12451, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
- { 12476, 0x00008040 }, /* GL_LUMINANCE8_EXT */
- { 12494, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
- { 12513, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
- { 12529, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
- { 12549, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
- { 12571, 0x00000D91 }, /* GL_MAP1_INDEX */
- { 12585, 0x00000D92 }, /* GL_MAP1_NORMAL */
- { 12600, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
- { 12624, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
- { 12648, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
- { 12672, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
- { 12696, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
- { 12713, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
- { 12730, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- { 12758, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- { 12787, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- { 12816, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- { 12845, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- { 12874, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- { 12903, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- { 12932, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- { 12960, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- { 12988, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- { 13016, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- { 13044, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- { 13072, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- { 13100, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- { 13128, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- { 13156, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- { 13184, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
- { 13200, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
- { 13220, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
- { 13242, 0x00000DB1 }, /* GL_MAP2_INDEX */
- { 13256, 0x00000DB2 }, /* GL_MAP2_NORMAL */
- { 13271, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
- { 13295, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
- { 13319, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
- { 13343, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
- { 13367, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
- { 13384, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
- { 13401, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- { 13429, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- { 13458, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- { 13487, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- { 13516, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- { 13545, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- { 13574, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- { 13603, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- { 13631, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- { 13659, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- { 13687, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- { 13715, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- { 13743, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- { 13771, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
- { 13799, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- { 13827, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- { 13855, 0x00000D10 }, /* GL_MAP_COLOR */
- { 13868, 0x00000D11 }, /* GL_MAP_STENCIL */
- { 13883, 0x000088C0 }, /* GL_MATRIX0_ARB */
- { 13898, 0x00008630 }, /* GL_MATRIX0_NV */
- { 13912, 0x000088CA }, /* GL_MATRIX10_ARB */
- { 13928, 0x000088CB }, /* GL_MATRIX11_ARB */
- { 13944, 0x000088CC }, /* GL_MATRIX12_ARB */
- { 13960, 0x000088CD }, /* GL_MATRIX13_ARB */
- { 13976, 0x000088CE }, /* GL_MATRIX14_ARB */
- { 13992, 0x000088CF }, /* GL_MATRIX15_ARB */
- { 14008, 0x000088D0 }, /* GL_MATRIX16_ARB */
- { 14024, 0x000088D1 }, /* GL_MATRIX17_ARB */
- { 14040, 0x000088D2 }, /* GL_MATRIX18_ARB */
- { 14056, 0x000088D3 }, /* GL_MATRIX19_ARB */
- { 14072, 0x000088C1 }, /* GL_MATRIX1_ARB */
- { 14087, 0x00008631 }, /* GL_MATRIX1_NV */
- { 14101, 0x000088D4 }, /* GL_MATRIX20_ARB */
- { 14117, 0x000088D5 }, /* GL_MATRIX21_ARB */
- { 14133, 0x000088D6 }, /* GL_MATRIX22_ARB */
- { 14149, 0x000088D7 }, /* GL_MATRIX23_ARB */
- { 14165, 0x000088D8 }, /* GL_MATRIX24_ARB */
- { 14181, 0x000088D9 }, /* GL_MATRIX25_ARB */
- { 14197, 0x000088DA }, /* GL_MATRIX26_ARB */
- { 14213, 0x000088DB }, /* GL_MATRIX27_ARB */
- { 14229, 0x000088DC }, /* GL_MATRIX28_ARB */
- { 14245, 0x000088DD }, /* GL_MATRIX29_ARB */
- { 14261, 0x000088C2 }, /* GL_MATRIX2_ARB */
- { 14276, 0x00008632 }, /* GL_MATRIX2_NV */
- { 14290, 0x000088DE }, /* GL_MATRIX30_ARB */
- { 14306, 0x000088DF }, /* GL_MATRIX31_ARB */
- { 14322, 0x000088C3 }, /* GL_MATRIX3_ARB */
- { 14337, 0x00008633 }, /* GL_MATRIX3_NV */
- { 14351, 0x000088C4 }, /* GL_MATRIX4_ARB */
- { 14366, 0x00008634 }, /* GL_MATRIX4_NV */
- { 14380, 0x000088C5 }, /* GL_MATRIX5_ARB */
- { 14395, 0x00008635 }, /* GL_MATRIX5_NV */
- { 14409, 0x000088C6 }, /* GL_MATRIX6_ARB */
- { 14424, 0x00008636 }, /* GL_MATRIX6_NV */
- { 14438, 0x000088C7 }, /* GL_MATRIX7_ARB */
- { 14453, 0x00008637 }, /* GL_MATRIX7_NV */
- { 14467, 0x000088C8 }, /* GL_MATRIX8_ARB */
- { 14482, 0x000088C9 }, /* GL_MATRIX9_ARB */
- { 14497, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
- { 14523, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- { 14557, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- { 14588, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- { 14621, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- { 14652, 0x00000BA0 }, /* GL_MATRIX_MODE */
- { 14667, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
- { 14689, 0x00008008 }, /* GL_MAX */
- { 14696, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
- { 14719, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
- { 14745, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- { 14778, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- { 14804, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 14838, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
- { 14857, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- { 14886, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- { 14918, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 14954, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- { 14994, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
- { 15020, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
- { 15050, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
- { 15075, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
- { 15104, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- { 15133, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
- { 15166, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
- { 15190, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
- { 15214, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
- { 15238, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
- { 15263, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
- { 15281, 0x00008008 }, /* GL_MAX_EXT */
- { 15292, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- { 15331, 0x00000D31 }, /* GL_MAX_LIGHTS */
- { 15345, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
- { 15365, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- { 15403, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- { 15432, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
- { 15456, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
- { 15484, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
- { 15507, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 15544, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 15580, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- { 15607, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- { 15636, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- { 15670, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- { 15706, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- { 15733, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- { 15765, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- { 15801, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- { 15830, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- { 15859, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
- { 15887, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- { 15925, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 15969, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 16012, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 16046, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 16085, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 16122, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 16160, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 16203, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 16246, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- { 16276, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- { 16307, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 16343, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 16379, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
- { 16409, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- { 16443, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
- { 16476, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- { 16505, 0x00008504 }, /* GL_MAX_SHININESS_NV */
- { 16525, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
- { 16549, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
- { 16575, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- { 16606, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
- { 16630, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- { 16664, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
- { 16684, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
- { 16711, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
- { 16732, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
- { 16757, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
- { 16782, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
- { 16817, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
- { 16843, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- { 16869, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- { 16907, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- { 16944, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
- { 16968, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
- { 16989, 0x00008007 }, /* GL_MIN */
- { 16996, 0x0000802E }, /* GL_MINMAX */
- { 17006, 0x0000802E }, /* GL_MINMAX_EXT */
- { 17020, 0x0000802F }, /* GL_MINMAX_FORMAT */
- { 17037, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
- { 17058, 0x00008030 }, /* GL_MINMAX_SINK */
- { 17073, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
- { 17092, 0x00008007 }, /* GL_MIN_EXT */
- { 17103, 0x00008370 }, /* GL_MIRRORED_REPEAT */
- { 17122, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
- { 17145, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
- { 17168, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
- { 17188, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
- { 17208, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- { 17238, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
- { 17266, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- { 17294, 0x00001700 }, /* GL_MODELVIEW */
- { 17307, 0x00001700 }, /* GL_MODELVIEW0_ARB */
- { 17325, 0x0000872A }, /* GL_MODELVIEW10_ARB */
- { 17344, 0x0000872B }, /* GL_MODELVIEW11_ARB */
- { 17363, 0x0000872C }, /* GL_MODELVIEW12_ARB */
- { 17382, 0x0000872D }, /* GL_MODELVIEW13_ARB */
- { 17401, 0x0000872E }, /* GL_MODELVIEW14_ARB */
- { 17420, 0x0000872F }, /* GL_MODELVIEW15_ARB */
- { 17439, 0x00008730 }, /* GL_MODELVIEW16_ARB */
- { 17458, 0x00008731 }, /* GL_MODELVIEW17_ARB */
- { 17477, 0x00008732 }, /* GL_MODELVIEW18_ARB */
- { 17496, 0x00008733 }, /* GL_MODELVIEW19_ARB */
- { 17515, 0x0000850A }, /* GL_MODELVIEW1_ARB */
- { 17533, 0x00008734 }, /* GL_MODELVIEW20_ARB */
- { 17552, 0x00008735 }, /* GL_MODELVIEW21_ARB */
- { 17571, 0x00008736 }, /* GL_MODELVIEW22_ARB */
- { 17590, 0x00008737 }, /* GL_MODELVIEW23_ARB */
- { 17609, 0x00008738 }, /* GL_MODELVIEW24_ARB */
- { 17628, 0x00008739 }, /* GL_MODELVIEW25_ARB */
- { 17647, 0x0000873A }, /* GL_MODELVIEW26_ARB */
- { 17666, 0x0000873B }, /* GL_MODELVIEW27_ARB */
- { 17685, 0x0000873C }, /* GL_MODELVIEW28_ARB */
- { 17704, 0x0000873D }, /* GL_MODELVIEW29_ARB */
- { 17723, 0x00008722 }, /* GL_MODELVIEW2_ARB */
- { 17741, 0x0000873E }, /* GL_MODELVIEW30_ARB */
- { 17760, 0x0000873F }, /* GL_MODELVIEW31_ARB */
- { 17779, 0x00008723 }, /* GL_MODELVIEW3_ARB */
- { 17797, 0x00008724 }, /* GL_MODELVIEW4_ARB */
- { 17815, 0x00008725 }, /* GL_MODELVIEW5_ARB */
- { 17833, 0x00008726 }, /* GL_MODELVIEW6_ARB */
- { 17851, 0x00008727 }, /* GL_MODELVIEW7_ARB */
- { 17869, 0x00008728 }, /* GL_MODELVIEW8_ARB */
- { 17887, 0x00008729 }, /* GL_MODELVIEW9_ARB */
- { 17905, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
- { 17925, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
- { 17952, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
- { 17977, 0x00002100 }, /* GL_MODULATE */
- { 17989, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
- { 18009, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
- { 18036, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
- { 18061, 0x00000103 }, /* GL_MULT */
- { 18069, 0x0000809D }, /* GL_MULTISAMPLE */
- { 18084, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
- { 18104, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
- { 18123, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
- { 18142, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
- { 18166, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
- { 18189, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- { 18219, 0x00002A25 }, /* GL_N3F_V3F */
- { 18230, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
- { 18250, 0x0000150E }, /* GL_NAND */
- { 18258, 0x00002600 }, /* GL_NEAREST */
- { 18269, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- { 18300, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- { 18332, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
- { 18357, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
- { 18383, 0x00000200 }, /* GL_NEVER */
- { 18392, 0x00001102 }, /* GL_NICEST */
- { 18402, 0x00000000 }, /* GL_NONE */
- { 18410, 0x00001505 }, /* GL_NOOP */
- { 18418, 0x00001508 }, /* GL_NOR */
- { 18425, 0x00000BA1 }, /* GL_NORMALIZE */
- { 18438, 0x00008075 }, /* GL_NORMAL_ARRAY */
- { 18454, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- { 18485, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
- { 18520, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
- { 18544, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
- { 18567, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
- { 18588, 0x00008511 }, /* GL_NORMAL_MAP */
- { 18602, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
- { 18620, 0x00008511 }, /* GL_NORMAL_MAP_NV */
- { 18637, 0x00000205 }, /* GL_NOTEQUAL */
- { 18649, 0x00000000 }, /* GL_NO_ERROR */
- { 18661, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- { 18695, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 18733, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- { 18765, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- { 18807, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- { 18837, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- { 18877, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- { 18908, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
- { 18937, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
- { 18965, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- { 18995, 0x00002401 }, /* GL_OBJECT_LINEAR */
- { 19012, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
- { 19038, 0x00002501 }, /* GL_OBJECT_PLANE */
- { 19054, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- { 19089, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
- { 19111, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
- { 19130, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- { 19160, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
- { 19181, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
- { 19209, 0x00000001 }, /* GL_ONE */
- { 19216, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- { 19244, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
- { 19276, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
- { 19304, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
- { 19336, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
- { 19359, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
- { 19382, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
- { 19405, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
- { 19428, 0x00008598 }, /* GL_OPERAND0_ALPHA */
- { 19446, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
- { 19468, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
- { 19490, 0x00008590 }, /* GL_OPERAND0_RGB */
- { 19506, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
- { 19526, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
- { 19546, 0x00008599 }, /* GL_OPERAND1_ALPHA */
- { 19564, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
- { 19586, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
- { 19608, 0x00008591 }, /* GL_OPERAND1_RGB */
- { 19624, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
- { 19644, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
- { 19664, 0x0000859A }, /* GL_OPERAND2_ALPHA */
- { 19682, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
- { 19704, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
- { 19726, 0x00008592 }, /* GL_OPERAND2_RGB */
- { 19742, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
- { 19762, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
- { 19782, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
- { 19803, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
- { 19822, 0x00001507 }, /* GL_OR */
- { 19828, 0x00000A01 }, /* GL_ORDER */
- { 19837, 0x0000150D }, /* GL_OR_INVERTED */
- { 19852, 0x0000150B }, /* GL_OR_REVERSE */
- { 19866, 0x00000505 }, /* GL_OUT_OF_MEMORY */
- { 19883, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
- { 19901, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
- { 19922, 0x00008758 }, /* GL_PACK_INVERT_MESA */
- { 19942, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
- { 19960, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
- { 19979, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
- { 19999, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
- { 20019, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
- { 20037, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
- { 20056, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
- { 20081, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
- { 20105, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
- { 20126, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
- { 20148, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
- { 20170, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
- { 20195, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
- { 20219, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
- { 20240, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
- { 20262, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
- { 20284, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
- { 20306, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
- { 20337, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
- { 20357, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- { 20382, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
- { 20402, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- { 20427, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
- { 20447, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- { 20472, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
- { 20492, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- { 20517, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
- { 20537, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- { 20562, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
- { 20582, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- { 20607, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
- { 20627, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- { 20652, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
- { 20672, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- { 20697, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
- { 20717, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- { 20742, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
- { 20762, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- { 20787, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
- { 20805, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- { 20838, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
- { 20863, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- { 20898, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- { 20925, 0x00001B00 }, /* GL_POINT */
- { 20934, 0x00000000 }, /* GL_POINTS */
- { 20944, 0x00000002 }, /* GL_POINT_BIT */
- { 20957, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
- { 20987, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
- { 21021, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
- { 21055, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
- { 21090, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
- { 21119, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
- { 21152, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
- { 21185, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
- { 21219, 0x00000B11 }, /* GL_POINT_SIZE */
- { 21233, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
- { 21259, 0x00008127 }, /* GL_POINT_SIZE_MAX */
- { 21277, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
- { 21299, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
- { 21321, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
- { 21344, 0x00008126 }, /* GL_POINT_SIZE_MIN */
- { 21362, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
- { 21384, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
- { 21406, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
- { 21429, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
- { 21449, 0x00000B10 }, /* GL_POINT_SMOOTH */
- { 21465, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
- { 21486, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
- { 21506, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
- { 21535, 0x00008861 }, /* GL_POINT_SPRITE_NV */
- { 21554, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
- { 21580, 0x00000701 }, /* GL_POINT_TOKEN */
- { 21595, 0x00000009 }, /* GL_POLYGON */
- { 21606, 0x00000008 }, /* GL_POLYGON_BIT */
- { 21621, 0x00000B40 }, /* GL_POLYGON_MODE */
- { 21637, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
- { 21660, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
- { 21685, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
- { 21708, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
- { 21731, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
- { 21755, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
- { 21779, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
- { 21797, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
- { 21820, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
- { 21839, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
- { 21862, 0x00000703 }, /* GL_POLYGON_TOKEN */
- { 21879, 0x00001203 }, /* GL_POSITION */
- { 21891, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- { 21923, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
- { 21959, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- { 21992, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
- { 22029, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- { 22060, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
- { 22095, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- { 22127, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
- { 22163, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- { 22196, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- { 22228, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
- { 22264, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- { 22297, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
- { 22334, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- { 22364, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
- { 22398, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- { 22429, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
- { 22464, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- { 22495, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
- { 22530, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- { 22562, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
- { 22598, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- { 22628, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
- { 22662, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- { 22693, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
- { 22728, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- { 22760, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- { 22791, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
- { 22826, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- { 22858, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
- { 22894, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
- { 22923, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
- { 22956, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
- { 22986, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
- { 23020, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- { 23059, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- { 23092, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- { 23132, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- { 23166, 0x00008578 }, /* GL_PREVIOUS */
- { 23178, 0x00008578 }, /* GL_PREVIOUS_ARB */
- { 23194, 0x00008578 }, /* GL_PREVIOUS_EXT */
- { 23210, 0x00008577 }, /* GL_PRIMARY_COLOR */
- { 23227, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
- { 23248, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
- { 23269, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 23302, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 23334, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
- { 23357, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
- { 23380, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
- { 23410, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
- { 23439, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
- { 23467, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
- { 23489, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- { 23517, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- { 23545, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
- { 23567, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
- { 23588, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 23628, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 23667, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 23697, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 23732, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 23765, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 23799, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 23838, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 23877, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
- { 23899, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
- { 23925, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
- { 23949, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
- { 23972, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
- { 23994, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
- { 24015, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
- { 24036, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
- { 24063, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 24095, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 24127, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- { 24162, 0x00001701 }, /* GL_PROJECTION */
- { 24176, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
- { 24197, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
- { 24223, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
- { 24244, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
- { 24263, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
- { 24286, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- { 24325, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- { 24363, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
- { 24383, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
- { 24407, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
- { 24427, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
- { 24451, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
- { 24471, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- { 24504, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
- { 24530, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
- { 24560, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- { 24591, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
- { 24621, 0x00002003 }, /* GL_Q */
- { 24626, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
- { 24651, 0x00000007 }, /* GL_QUADS */
- { 24660, 0x00008614 }, /* GL_QUAD_MESH_SUN */
- { 24677, 0x00000008 }, /* GL_QUAD_STRIP */
- { 24691, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
- { 24713, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
- { 24739, 0x00008866 }, /* GL_QUERY_RESULT */
- { 24755, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
- { 24775, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
- { 24801, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
- { 24831, 0x00002002 }, /* GL_R */
- { 24836, 0x00002A10 }, /* GL_R3_G3_B2 */
- { 24848, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- { 24881, 0x00000C02 }, /* GL_READ_BUFFER */
- { 24896, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- { 24928, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
- { 24952, 0x000088B8 }, /* GL_READ_ONLY */
- { 24965, 0x000088B8 }, /* GL_READ_ONLY_ARB */
- { 24982, 0x000088BA }, /* GL_READ_WRITE */
- { 24996, 0x000088BA }, /* GL_READ_WRITE_ARB */
- { 25014, 0x00001903 }, /* GL_RED */
- { 25021, 0x00008016 }, /* GL_REDUCE */
- { 25031, 0x00008016 }, /* GL_REDUCE_EXT */
- { 25045, 0x00000D15 }, /* GL_RED_BIAS */
- { 25057, 0x00000D52 }, /* GL_RED_BITS */
- { 25069, 0x00000D14 }, /* GL_RED_SCALE */
- { 25082, 0x00008512 }, /* GL_REFLECTION_MAP */
- { 25100, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
- { 25122, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
- { 25143, 0x00001C00 }, /* GL_RENDER */
- { 25153, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
- { 25181, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
- { 25201, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
- { 25228, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- { 25264, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
- { 25290, 0x00001F01 }, /* GL_RENDERER */
- { 25302, 0x00000C40 }, /* GL_RENDER_MODE */
- { 25317, 0x00002901 }, /* GL_REPEAT */
- { 25327, 0x00001E01 }, /* GL_REPLACE */
- { 25338, 0x00008062 }, /* GL_REPLACE_EXT */
- { 25353, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
- { 25376, 0x0000803A }, /* GL_RESCALE_NORMAL */
- { 25394, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
- { 25416, 0x00000102 }, /* GL_RETURN */
- { 25426, 0x00001907 }, /* GL_RGB */
- { 25433, 0x00008052 }, /* GL_RGB10 */
- { 25442, 0x00008059 }, /* GL_RGB10_A2 */
- { 25454, 0x00008059 }, /* GL_RGB10_A2_EXT */
- { 25470, 0x00008052 }, /* GL_RGB10_EXT */
- { 25483, 0x00008053 }, /* GL_RGB12 */
- { 25492, 0x00008053 }, /* GL_RGB12_EXT */
- { 25505, 0x00008054 }, /* GL_RGB16 */
- { 25514, 0x00008054 }, /* GL_RGB16_EXT */
- { 25527, 0x0000804E }, /* GL_RGB2_EXT */
- { 25539, 0x0000804F }, /* GL_RGB4 */
- { 25547, 0x0000804F }, /* GL_RGB4_EXT */
- { 25559, 0x000083A1 }, /* GL_RGB4_S3TC */
- { 25572, 0x00008050 }, /* GL_RGB5 */
- { 25580, 0x00008057 }, /* GL_RGB5_A1 */
- { 25591, 0x00008057 }, /* GL_RGB5_A1_EXT */
- { 25606, 0x00008050 }, /* GL_RGB5_EXT */
- { 25618, 0x00008051 }, /* GL_RGB8 */
- { 25626, 0x00008051 }, /* GL_RGB8_EXT */
- { 25638, 0x00001908 }, /* GL_RGBA */
- { 25646, 0x0000805A }, /* GL_RGBA12 */
- { 25656, 0x0000805A }, /* GL_RGBA12_EXT */
- { 25670, 0x0000805B }, /* GL_RGBA16 */
- { 25680, 0x0000805B }, /* GL_RGBA16_EXT */
- { 25694, 0x00008055 }, /* GL_RGBA2 */
- { 25703, 0x00008055 }, /* GL_RGBA2_EXT */
- { 25716, 0x00008056 }, /* GL_RGBA4 */
- { 25725, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
- { 25744, 0x00008056 }, /* GL_RGBA4_EXT */
- { 25757, 0x000083A3 }, /* GL_RGBA4_S3TC */
- { 25771, 0x00008058 }, /* GL_RGBA8 */
- { 25780, 0x00008058 }, /* GL_RGBA8_EXT */
- { 25793, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
- { 25811, 0x00000C31 }, /* GL_RGBA_MODE */
- { 25824, 0x000083A2 }, /* GL_RGBA_S3TC */
- { 25837, 0x000083A0 }, /* GL_RGB_S3TC */
- { 25849, 0x00008573 }, /* GL_RGB_SCALE */
- { 25862, 0x00008573 }, /* GL_RGB_SCALE_ARB */
- { 25879, 0x00008573 }, /* GL_RGB_SCALE_EXT */
- { 25896, 0x00000407 }, /* GL_RIGHT */
- { 25905, 0x00002000 }, /* GL_S */
- { 25910, 0x000080A9 }, /* GL_SAMPLES */
- { 25921, 0x000086B4 }, /* GL_SAMPLES_3DFX */
- { 25937, 0x000080A9 }, /* GL_SAMPLES_ARB */
- { 25952, 0x00008914 }, /* GL_SAMPLES_PASSED */
- { 25970, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
- { 25992, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- { 26020, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
- { 26052, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
- { 26075, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
- { 26102, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
- { 26120, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
- { 26143, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
- { 26165, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
- { 26184, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
- { 26207, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
- { 26233, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
- { 26263, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
- { 26288, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
- { 26317, 0x00080000 }, /* GL_SCISSOR_BIT */
- { 26332, 0x00000C10 }, /* GL_SCISSOR_BOX */
- { 26347, 0x00000C11 }, /* GL_SCISSOR_TEST */
- { 26363, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
- { 26388, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- { 26428, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 26472, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- { 26505, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- { 26535, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- { 26567, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- { 26597, 0x00001C02 }, /* GL_SELECT */
- { 26607, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
- { 26635, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
- { 26660, 0x00008012 }, /* GL_SEPARABLE_2D */
- { 26676, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
- { 26703, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
- { 26734, 0x0000150F }, /* GL_SET */
- { 26741, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
- { 26762, 0x00000B54 }, /* GL_SHADE_MODEL */
- { 26777, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
- { 26800, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- { 26830, 0x00001601 }, /* GL_SHININESS */
- { 26843, 0x00001402 }, /* GL_SHORT */
- { 26852, 0x000081F9 }, /* GL_SINGLE_COLOR */
- { 26868, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
- { 26888, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
- { 26907, 0x00001D01 }, /* GL_SMOOTH */
- { 26917, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
- { 26950, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
- { 26977, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
- { 27010, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
- { 27037, 0x00008588 }, /* GL_SOURCE0_ALPHA */
- { 27054, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
- { 27075, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
- { 27096, 0x00008580 }, /* GL_SOURCE0_RGB */
- { 27111, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
- { 27130, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
- { 27149, 0x00008589 }, /* GL_SOURCE1_ALPHA */
- { 27166, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
- { 27187, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
- { 27208, 0x00008581 }, /* GL_SOURCE1_RGB */
- { 27223, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
- { 27242, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
- { 27261, 0x0000858A }, /* GL_SOURCE2_ALPHA */
- { 27278, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
- { 27299, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
- { 27320, 0x00008582 }, /* GL_SOURCE2_RGB */
- { 27335, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
- { 27354, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
- { 27373, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
- { 27393, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
- { 27411, 0x00001202 }, /* GL_SPECULAR */
- { 27423, 0x00002402 }, /* GL_SPHERE_MAP */
- { 27437, 0x00001206 }, /* GL_SPOT_CUTOFF */
- { 27452, 0x00001204 }, /* GL_SPOT_DIRECTION */
- { 27470, 0x00001205 }, /* GL_SPOT_EXPONENT */
- { 27487, 0x00008588 }, /* GL_SRC0_ALPHA */
- { 27501, 0x00008580 }, /* GL_SRC0_RGB */
- { 27513, 0x00008589 }, /* GL_SRC1_ALPHA */
- { 27527, 0x00008581 }, /* GL_SRC1_RGB */
- { 27539, 0x0000858A }, /* GL_SRC2_ALPHA */
- { 27553, 0x00008582 }, /* GL_SRC2_RGB */
- { 27565, 0x00000302 }, /* GL_SRC_ALPHA */
- { 27578, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
- { 27600, 0x00000300 }, /* GL_SRC_COLOR */
- { 27613, 0x00000503 }, /* GL_STACK_OVERFLOW */
- { 27631, 0x00000504 }, /* GL_STACK_UNDERFLOW */
- { 27650, 0x000088E6 }, /* GL_STATIC_COPY */
- { 27665, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
- { 27684, 0x000088E4 }, /* GL_STATIC_DRAW */
- { 27699, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
- { 27718, 0x000088E5 }, /* GL_STATIC_READ */
- { 27733, 0x000088E5 }, /* GL_STATIC_READ_ARB */
- { 27752, 0x00001802 }, /* GL_STENCIL */
- { 27763, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
- { 27789, 0x00000D57 }, /* GL_STENCIL_BITS */
- { 27805, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
- { 27827, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
- { 27850, 0x00000B94 }, /* GL_STENCIL_FAIL */
- { 27866, 0x00000B92 }, /* GL_STENCIL_FUNC */
- { 27882, 0x00001901 }, /* GL_STENCIL_INDEX */
- { 27899, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
- { 27922, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
- { 27944, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
- { 27966, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
- { 27988, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
- { 28009, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
- { 28036, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
- { 28063, 0x00000B97 }, /* GL_STENCIL_REF */
- { 28078, 0x00000B90 }, /* GL_STENCIL_TEST */
- { 28094, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- { 28123, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
- { 28145, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
- { 28166, 0x00000C33 }, /* GL_STEREO */
- { 28176, 0x000088E2 }, /* GL_STREAM_COPY */
- { 28191, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
- { 28210, 0x000088E0 }, /* GL_STREAM_DRAW */
- { 28225, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
- { 28244, 0x000088E1 }, /* GL_STREAM_READ */
- { 28259, 0x000088E1 }, /* GL_STREAM_READ_ARB */
- { 28278, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
- { 28295, 0x000084E7 }, /* GL_SUBTRACT */
- { 28307, 0x000084E7 }, /* GL_SUBTRACT_ARB */
- { 28323, 0x00002001 }, /* GL_T */
- { 28328, 0x00002A2A }, /* GL_T2F_C3F_V3F */
- { 28343, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
- { 28362, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
- { 28378, 0x00002A2B }, /* GL_T2F_N3F_V3F */
- { 28393, 0x00002A27 }, /* GL_T2F_V3F */
- { 28404, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
- { 28423, 0x00002A28 }, /* GL_T4F_V4F */
- { 28434, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
- { 28457, 0x00001702 }, /* GL_TEXTURE */
- { 28468, 0x000084C0 }, /* GL_TEXTURE0 */
- { 28480, 0x000084C0 }, /* GL_TEXTURE0_ARB */
- { 28496, 0x000084C1 }, /* GL_TEXTURE1 */
- { 28508, 0x000084CA }, /* GL_TEXTURE10 */
- { 28521, 0x000084CA }, /* GL_TEXTURE10_ARB */
- { 28538, 0x000084CB }, /* GL_TEXTURE11 */
- { 28551, 0x000084CB }, /* GL_TEXTURE11_ARB */
- { 28568, 0x000084CC }, /* GL_TEXTURE12 */
- { 28581, 0x000084CC }, /* GL_TEXTURE12_ARB */
- { 28598, 0x000084CD }, /* GL_TEXTURE13 */
- { 28611, 0x000084CD }, /* GL_TEXTURE13_ARB */
- { 28628, 0x000084CE }, /* GL_TEXTURE14 */
- { 28641, 0x000084CE }, /* GL_TEXTURE14_ARB */
- { 28658, 0x000084CF }, /* GL_TEXTURE15 */
- { 28671, 0x000084CF }, /* GL_TEXTURE15_ARB */
- { 28688, 0x000084D0 }, /* GL_TEXTURE16 */
- { 28701, 0x000084D0 }, /* GL_TEXTURE16_ARB */
- { 28718, 0x000084D1 }, /* GL_TEXTURE17 */
- { 28731, 0x000084D1 }, /* GL_TEXTURE17_ARB */
- { 28748, 0x000084D2 }, /* GL_TEXTURE18 */
- { 28761, 0x000084D2 }, /* GL_TEXTURE18_ARB */
- { 28778, 0x000084D3 }, /* GL_TEXTURE19 */
- { 28791, 0x000084D3 }, /* GL_TEXTURE19_ARB */
- { 28808, 0x000084C1 }, /* GL_TEXTURE1_ARB */
- { 28824, 0x000084C2 }, /* GL_TEXTURE2 */
- { 28836, 0x000084D4 }, /* GL_TEXTURE20 */
- { 28849, 0x000084D4 }, /* GL_TEXTURE20_ARB */
- { 28866, 0x000084D5 }, /* GL_TEXTURE21 */
- { 28879, 0x000084D5 }, /* GL_TEXTURE21_ARB */
- { 28896, 0x000084D6 }, /* GL_TEXTURE22 */
- { 28909, 0x000084D6 }, /* GL_TEXTURE22_ARB */
- { 28926, 0x000084D7 }, /* GL_TEXTURE23 */
- { 28939, 0x000084D7 }, /* GL_TEXTURE23_ARB */
- { 28956, 0x000084D8 }, /* GL_TEXTURE24 */
- { 28969, 0x000084D8 }, /* GL_TEXTURE24_ARB */
- { 28986, 0x000084D9 }, /* GL_TEXTURE25 */
- { 28999, 0x000084D9 }, /* GL_TEXTURE25_ARB */
- { 29016, 0x000084DA }, /* GL_TEXTURE26 */
- { 29029, 0x000084DA }, /* GL_TEXTURE26_ARB */
- { 29046, 0x000084DB }, /* GL_TEXTURE27 */
- { 29059, 0x000084DB }, /* GL_TEXTURE27_ARB */
- { 29076, 0x000084DC }, /* GL_TEXTURE28 */
- { 29089, 0x000084DC }, /* GL_TEXTURE28_ARB */
- { 29106, 0x000084DD }, /* GL_TEXTURE29 */
- { 29119, 0x000084DD }, /* GL_TEXTURE29_ARB */
- { 29136, 0x000084C2 }, /* GL_TEXTURE2_ARB */
- { 29152, 0x000084C3 }, /* GL_TEXTURE3 */
- { 29164, 0x000084DE }, /* GL_TEXTURE30 */
- { 29177, 0x000084DE }, /* GL_TEXTURE30_ARB */
- { 29194, 0x000084DF }, /* GL_TEXTURE31 */
- { 29207, 0x000084DF }, /* GL_TEXTURE31_ARB */
- { 29224, 0x000084C3 }, /* GL_TEXTURE3_ARB */
- { 29240, 0x000084C4 }, /* GL_TEXTURE4 */
- { 29252, 0x000084C4 }, /* GL_TEXTURE4_ARB */
- { 29268, 0x000084C5 }, /* GL_TEXTURE5 */
- { 29280, 0x000084C5 }, /* GL_TEXTURE5_ARB */
- { 29296, 0x000084C6 }, /* GL_TEXTURE6 */
- { 29308, 0x000084C6 }, /* GL_TEXTURE6_ARB */
- { 29324, 0x000084C7 }, /* GL_TEXTURE7 */
- { 29336, 0x000084C7 }, /* GL_TEXTURE7_ARB */
- { 29352, 0x000084C8 }, /* GL_TEXTURE8 */
- { 29364, 0x000084C8 }, /* GL_TEXTURE8_ARB */
- { 29380, 0x000084C9 }, /* GL_TEXTURE9 */
- { 29392, 0x000084C9 }, /* GL_TEXTURE9_ARB */
- { 29408, 0x00000DE0 }, /* GL_TEXTURE_1D */
- { 29422, 0x00000DE1 }, /* GL_TEXTURE_2D */
- { 29436, 0x0000806F }, /* GL_TEXTURE_3D */
- { 29450, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
- { 29472, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
- { 29498, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
- { 29520, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
- { 29542, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
- { 29564, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
- { 29586, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
- { 29614, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
- { 29646, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- { 29679, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
- { 29711, 0x00040000 }, /* GL_TEXTURE_BIT */
- { 29726, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
- { 29747, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
- { 29772, 0x00001005 }, /* GL_TEXTURE_BORDER */
- { 29790, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
- { 29814, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- { 29845, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- { 29875, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- { 29905, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- { 29940, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- { 29971, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 30009, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
- { 30036, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- { 30068, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- { 30102, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
- { 30126, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
- { 30154, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
- { 30178, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
- { 30206, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- { 30239, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
- { 30263, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
- { 30285, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
- { 30307, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
- { 30333, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 30367, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- { 30400, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
- { 30437, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
- { 30465, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
- { 30497, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
- { 30520, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- { 30558, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
- { 30600, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- { 30631, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- { 30659, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- { 30689, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- { 30717, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
- { 30737, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
- { 30761, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- { 30792, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
- { 30827, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- { 30858, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
- { 30893, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- { 30924, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
- { 30959, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- { 30990, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
- { 31025, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- { 31056, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
- { 31091, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- { 31122, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
- { 31157, 0x00008071 }, /* GL_TEXTURE_DEPTH */
- { 31174, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
- { 31196, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
- { 31222, 0x00002300 }, /* GL_TEXTURE_ENV */
- { 31237, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
- { 31258, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
- { 31278, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
- { 31304, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
- { 31324, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
- { 31341, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
- { 31358, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
- { 31375, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
- { 31392, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
- { 31417, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
- { 31439, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
- { 31465, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
- { 31483, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
- { 31509, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
- { 31535, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
- { 31565, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
- { 31592, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
- { 31617, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
- { 31637, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
- { 31661, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- { 31688, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- { 31715, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- { 31742, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
- { 31768, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
- { 31798, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
- { 31820, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
- { 31838, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- { 31868, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- { 31896, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- { 31924, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- { 31952, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
- { 31973, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
- { 31992, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
- { 32014, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
- { 32033, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
- { 32053, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
- { 32078, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
- { 32102, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
- { 32122, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
- { 32146, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
- { 32166, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
- { 32189, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
- { 32214, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- { 32248, 0x00001000 }, /* GL_TEXTURE_WIDTH */
- { 32265, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
- { 32283, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
- { 32301, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
- { 32319, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
- { 32339, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 32358, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 32387, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 32404, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 32430, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 32460, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 32492, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 32522, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 32556, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 32572, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 32603, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 32638, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 32666, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 32698, 0x00000004 }, /* GL_TRIANGLES */
- { 32711, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 32727, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 32748, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 32766, 0x00000001 }, /* GL_TRUE */
- { 32774, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 32794, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 32817, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 32837, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 32858, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 32880, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 32902, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 32922, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 32943, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 32960, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 32987, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 33010, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 33026, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 33053, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 33077, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 33108, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 33132, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 33160, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 33178, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 33208, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 33234, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 33264, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 33290, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 33314, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 33342, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 33370, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 33397, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 33429, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 33460, 0x00002A20 }, /* GL_V2F */
- { 33467, 0x00002A21 }, /* GL_V3F */
- { 33474, 0x00001F00 }, /* GL_VENDOR */
- { 33484, 0x00001F02 }, /* GL_VERSION */
- { 33495, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 33511, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- { 33541, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 33572, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 33607, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 33631, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 33652, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 33675, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 33696, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 33723, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 33751, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 33779, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 33807, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 33835, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 33863, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 33891, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 33918, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 33945, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 33972, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 33999, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 34026, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 34053, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 34080, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 34107, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 34134, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 34172, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 34214, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 34249, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 34287, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 34322, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 34354, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 34388, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 34420, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 34440, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 34462, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 34491, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 34512, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 34545, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 34577, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 34608, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 34638, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 34659, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 34686, 0x00000BA2 }, /* GL_VIEWPORT */
- { 34698, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 34714, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 34734, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 34765, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 34800, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 34828, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 34853, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 34880, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 34905, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 34929, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 34948, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 34962, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 34980, 0x00001506 }, /* GL_XOR */
- { 34987, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 35006, 0x00008757 }, /* GL_YCBCR_MESA */
- { 35020, 0x00000000 }, /* GL_ZERO */
- { 35028, 0x00000D16 }, /* GL_ZOOM_X */
- { 35038, 0x00000D17 }, /* GL_ZOOM_Y */
+ { 224, 0x00008B89 }, /* GL_ACTIVE_ATTRIBUTES */
+ { 245, 0x00008B8A }, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
+ { 276, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */
+ { 303, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */
+ { 321, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */
+ { 343, 0x00008B86 }, /* GL_ACTIVE_UNIFORMS */
+ { 362, 0x00008B87 }, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
+ { 391, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */
+ { 418, 0x00000104 }, /* GL_ADD */
+ { 425, 0x00008574 }, /* GL_ADD_SIGNED */
+ { 439, 0x00008574 }, /* GL_ADD_SIGNED_ARB */
+ { 457, 0x00008574 }, /* GL_ADD_SIGNED_EXT */
+ { 475, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */
+ { 503, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */
+ { 531, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */
+ { 550, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */
+ { 576, 0x00001906 }, /* GL_ALPHA */
+ { 585, 0x0000803D }, /* GL_ALPHA12 */
+ { 596, 0x0000803D }, /* GL_ALPHA12_EXT */
+ { 611, 0x0000803E }, /* GL_ALPHA16 */
+ { 622, 0x0000803E }, /* GL_ALPHA16_EXT */
+ { 637, 0x0000803B }, /* GL_ALPHA4 */
+ { 647, 0x0000803B }, /* GL_ALPHA4_EXT */
+ { 661, 0x0000803C }, /* GL_ALPHA8 */
+ { 671, 0x0000803C }, /* GL_ALPHA8_EXT */
+ { 685, 0x00000D1D }, /* GL_ALPHA_BIAS */
+ { 699, 0x00000D55 }, /* GL_ALPHA_BITS */
+ { 713, 0x00000D1C }, /* GL_ALPHA_SCALE */
+ { 728, 0x00000BC0 }, /* GL_ALPHA_TEST */
+ { 742, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */
+ { 761, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */
+ { 779, 0x00000207 }, /* GL_ALWAYS */
+ { 789, 0x00001200 }, /* GL_AMBIENT */
+ { 800, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */
+ { 823, 0x00001501 }, /* GL_AND */
+ { 830, 0x00001504 }, /* GL_AND_INVERTED */
+ { 846, 0x00001502 }, /* GL_AND_REVERSE */
+ { 861, 0x00008892 }, /* GL_ARRAY_BUFFER */
+ { 877, 0x00008892 }, /* GL_ARRAY_BUFFER_ARB */
+ { 897, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */
+ { 921, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */
+ { 949, 0x00008B85 }, /* GL_ATTACHED_SHADERS */
+ { 969, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */
+ { 996, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */
+ { 1020, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */
+ { 1046, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */
+ { 1070, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */
+ { 1092, 0x00000D80 }, /* GL_AUTO_NORMAL */
+ { 1107, 0x00000409 }, /* GL_AUX0 */
+ { 1115, 0x0000040A }, /* GL_AUX1 */
+ { 1123, 0x0000040B }, /* GL_AUX2 */
+ { 1131, 0x0000040C }, /* GL_AUX3 */
+ { 1139, 0x00000C00 }, /* GL_AUX_BUFFERS */
+ { 1154, 0x00000405 }, /* GL_BACK */
+ { 1162, 0x00000402 }, /* GL_BACK_LEFT */
+ { 1175, 0x00000403 }, /* GL_BACK_RIGHT */
+ { 1189, 0x000080E0 }, /* GL_BGR */
+ { 1196, 0x000080E1 }, /* GL_BGRA */
+ { 1204, 0x00001A00 }, /* GL_BITMAP */
+ { 1214, 0x00000704 }, /* GL_BITMAP_TOKEN */
+ { 1230, 0x00000BE2 }, /* GL_BLEND */
+ { 1239, 0x00008005 }, /* GL_BLEND_COLOR */
+ { 1254, 0x00008005 }, /* GL_BLEND_COLOR_EXT */
+ { 1273, 0x00000BE0 }, /* GL_BLEND_DST */
+ { 1286, 0x000080CA }, /* GL_BLEND_DST_ALPHA */
+ { 1305, 0x000080C8 }, /* GL_BLEND_DST_RGB */
+ { 1322, 0x00008009 }, /* GL_BLEND_EQUATION */
+ { 1340, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */
+ { 1364, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */
+ { 1392, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */
+ { 1414, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */
+ { 1440, 0x00000BE1 }, /* GL_BLEND_SRC */
+ { 1453, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */
+ { 1472, 0x000080C9 }, /* GL_BLEND_SRC_RGB */
+ { 1489, 0x00001905 }, /* GL_BLUE */
+ { 1497, 0x00000D1B }, /* GL_BLUE_BIAS */
+ { 1510, 0x00000D54 }, /* GL_BLUE_BITS */
+ { 1523, 0x00000D1A }, /* GL_BLUE_SCALE */
+ { 1537, 0x00008B56 }, /* GL_BOOL */
+ { 1545, 0x00008B56 }, /* GL_BOOL_ARB */
+ { 1557, 0x00008B57 }, /* GL_BOOL_VEC2 */
+ { 1570, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */
+ { 1587, 0x00008B58 }, /* GL_BOOL_VEC3 */
+ { 1600, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */
+ { 1617, 0x00008B59 }, /* GL_BOOL_VEC4 */
+ { 1630, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */
+ { 1647, 0x000088BB }, /* GL_BUFFER_ACCESS */
+ { 1664, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */
+ { 1685, 0x000088BC }, /* GL_BUFFER_MAPPED */
+ { 1702, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */
+ { 1723, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */
+ { 1745, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */
+ { 1771, 0x00008764 }, /* GL_BUFFER_SIZE */
+ { 1786, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */
+ { 1805, 0x00008765 }, /* GL_BUFFER_USAGE */
+ { 1821, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */
+ { 1841, 0x00001400 }, /* GL_BYTE */
+ { 1849, 0x00002A24 }, /* GL_C3F_V3F */
+ { 1860, 0x00002A26 }, /* GL_C4F_N3F_V3F */
+ { 1875, 0x00002A22 }, /* GL_C4UB_V2F */
+ { 1887, 0x00002A23 }, /* GL_C4UB_V3F */
+ { 1899, 0x00000901 }, /* GL_CCW */
+ { 1906, 0x00002900 }, /* GL_CLAMP */
+ { 1915, 0x0000812D }, /* GL_CLAMP_TO_BORDER */
+ { 1934, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */
+ { 1957, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */
+ { 1981, 0x0000812F }, /* GL_CLAMP_TO_EDGE */
+ { 1998, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */
+ { 2020, 0x00001500 }, /* GL_CLEAR */
+ { 2029, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */
+ { 2054, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */
+ { 2083, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */
+ { 2109, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
+ { 2138, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */
+ { 2164, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */
+ { 2191, 0x00003000 }, /* GL_CLIP_PLANE0 */
+ { 2206, 0x00003001 }, /* GL_CLIP_PLANE1 */
+ { 2221, 0x00003002 }, /* GL_CLIP_PLANE2 */
+ { 2236, 0x00003003 }, /* GL_CLIP_PLANE3 */
+ { 2251, 0x00003004 }, /* GL_CLIP_PLANE4 */
+ { 2266, 0x00003005 }, /* GL_CLIP_PLANE5 */
+ { 2281, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
+ { 2314, 0x00000A00 }, /* GL_COEFF */
+ { 2323, 0x00001800 }, /* GL_COLOR */
+ { 2332, 0x00008076 }, /* GL_COLOR_ARRAY */
+ { 2347, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */
+ { 2377, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 2411, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */
+ { 2434, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */
+ { 2454, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */
+ { 2476, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */
+ { 2496, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
+ { 2521, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
+ { 2547, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
+ { 2573, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
+ { 2599, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
+ { 2625, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
+ { 2651, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
+ { 2677, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
+ { 2702, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
+ { 2727, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
+ { 2752, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
+ { 2777, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
+ { 2802, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
+ { 2827, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
+ { 2852, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
+ { 2877, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
+ { 2902, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
+ { 2922, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
+ { 2943, 0x00001900 }, /* GL_COLOR_INDEX */
+ { 2958, 0x00001603 }, /* GL_COLOR_INDEXES */
+ { 2975, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
+ { 2993, 0x00000B57 }, /* GL_COLOR_MATERIAL */
+ { 3011, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
+ { 3034, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
+ { 3062, 0x000080B1 }, /* GL_COLOR_MATRIX */
+ { 3078, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
+ { 3098, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ { 3126, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 3158, 0x00008458 }, /* GL_COLOR_SUM */
+ { 3171, 0x00008458 }, /* GL_COLOR_SUM_ARB */
+ { 3188, 0x000080D0 }, /* GL_COLOR_TABLE */
+ { 3203, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ { 3229, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
+ { 3259, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
+ { 3289, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
+ { 3309, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
+ { 3333, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
+ { 3358, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
+ { 3387, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
+ { 3416, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
+ { 3438, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
+ { 3464, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
+ { 3490, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
+ { 3516, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
+ { 3546, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
+ { 3576, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ { 3606, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
+ { 3640, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
+ { 3674, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ { 3704, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
+ { 3738, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
+ { 3772, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
+ { 3796, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
+ { 3824, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
+ { 3852, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
+ { 3873, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
+ { 3898, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
+ { 3919, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
+ { 3944, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
+ { 3969, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
+ { 3988, 0x00008570 }, /* GL_COMBINE */
+ { 3999, 0x00008503 }, /* GL_COMBINE4 */
+ { 4011, 0x00008572 }, /* GL_COMBINE_ALPHA */
+ { 4028, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
+ { 4049, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
+ { 4070, 0x00008570 }, /* GL_COMBINE_ARB */
+ { 4085, 0x00008570 }, /* GL_COMBINE_EXT */
+ { 4100, 0x00008571 }, /* GL_COMBINE_RGB */
+ { 4115, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
+ { 4134, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
+ { 4153, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
+ { 4177, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
+ { 4205, 0x00001300 }, /* GL_COMPILE */
+ { 4216, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
+ { 4239, 0x00008B81 }, /* GL_COMPILE_STATUS */
+ { 4257, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
+ { 4277, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
+ { 4301, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
+ { 4325, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
+ { 4353, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
+ { 4377, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ { 4407, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
+ { 4441, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
+ { 4469, 0x000084ED }, /* GL_COMPRESSED_RGB */
+ { 4487, 0x000084EE }, /* GL_COMPRESSED_RGBA */
+ { 4506, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
+ { 4529, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ { 4558, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ { 4591, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ { 4624, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ { 4657, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
+ { 4679, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ { 4707, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ { 4739, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ { 4769, 0x00008576 }, /* GL_CONSTANT */
+ { 4781, 0x00008003 }, /* GL_CONSTANT_ALPHA */
+ { 4799, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
+ { 4821, 0x00008576 }, /* GL_CONSTANT_ARB */
+ { 4837, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
+ { 4861, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
+ { 4883, 0x00008001 }, /* GL_CONSTANT_COLOR */
+ { 4901, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
+ { 4923, 0x00008576 }, /* GL_CONSTANT_EXT */
+ { 4939, 0x00008010 }, /* GL_CONVOLUTION_1D */
+ { 4957, 0x00008011 }, /* GL_CONVOLUTION_2D */
+ { 4975, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
+ { 5003, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
+ { 5034, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
+ { 5061, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
+ { 5092, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
+ { 5119, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
+ { 5150, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
+ { 5178, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
+ { 5210, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
+ { 5232, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
+ { 5258, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
+ { 5280, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
+ { 5306, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
+ { 5327, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
+ { 5352, 0x00008862 }, /* GL_COORD_REPLACE */
+ { 5369, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
+ { 5390, 0x00008862 }, /* GL_COORD_REPLACE_NV */
+ { 5410, 0x00001503 }, /* GL_COPY */
+ { 5418, 0x0000150C }, /* GL_COPY_INVERTED */
+ { 5435, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
+ { 5455, 0x00000B44 }, /* GL_CULL_FACE */
+ { 5468, 0x00000B45 }, /* GL_CULL_FACE_MODE */
+ { 5486, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
+ { 5505, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ { 5537, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ { 5572, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
+ { 5593, 0x00000001 }, /* GL_CURRENT_BIT */
+ { 5608, 0x00000B00 }, /* GL_CURRENT_COLOR */
+ { 5625, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
+ { 5646, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
+ { 5672, 0x00000B01 }, /* GL_CURRENT_INDEX */
+ { 5689, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
+ { 5711, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ { 5739, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
+ { 5760, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ { 5794, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
+ { 5827, 0x00000B02 }, /* GL_CURRENT_NORMAL */
+ { 5845, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ { 5875, 0x00008B8D }, /* GL_CURRENT_PROGRAM */
+ { 5894, 0x00008865 }, /* GL_CURRENT_QUERY */
+ { 5911, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
+ { 5932, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
+ { 5956, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
+ { 5983, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
+ { 6007, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
+ { 6034, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
+ { 6067, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ { 6100, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
+ { 6127, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
+ { 6153, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */
+ { 6178, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
+ { 6207, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
+ { 6229, 0x00000900 }, /* GL_CW */
+ { 6235, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
+ { 6256, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
+ { 6277, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
+ { 6297, 0x00002101 }, /* GL_DECAL */
+ { 6306, 0x00001E03 }, /* GL_DECR */
+ { 6314, 0x00008508 }, /* GL_DECR_WRAP */
+ { 6327, 0x00008508 }, /* GL_DECR_WRAP_EXT */
+ { 6344, 0x00008B80 }, /* GL_DELETE_STATUS */
+ { 6361, 0x00001801 }, /* GL_DEPTH */
+ { 6370, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
+ { 6394, 0x00000D1F }, /* GL_DEPTH_BIAS */
+ { 6408, 0x00000D56 }, /* GL_DEPTH_BITS */
+ { 6422, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
+ { 6442, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ { 6467, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
+ { 6487, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
+ { 6505, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
+ { 6526, 0x00001902 }, /* GL_DEPTH_COMPONENT */
+ { 6545, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
+ { 6566, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
+ { 6591, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
+ { 6617, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
+ { 6638, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
+ { 6663, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
+ { 6689, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
+ { 6710, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
+ { 6735, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
+ { 6761, 0x00000B74 }, /* GL_DEPTH_FUNC */
+ { 6775, 0x00000B70 }, /* GL_DEPTH_RANGE */
+ { 6790, 0x00000D1E }, /* GL_DEPTH_SCALE */
+ { 6805, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
+ { 6825, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ { 6853, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ { 6881, 0x00000B71 }, /* GL_DEPTH_TEST */
+ { 6895, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
+ { 6917, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
+ { 6943, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
+ { 6962, 0x00001201 }, /* GL_DIFFUSE */
+ { 6973, 0x00000BD0 }, /* GL_DITHER */
+ { 6983, 0x00000A02 }, /* GL_DOMAIN */
+ { 6993, 0x00001100 }, /* GL_DONT_CARE */
+ { 7006, 0x000086AE }, /* GL_DOT3_RGB */
+ { 7018, 0x000086AF }, /* GL_DOT3_RGBA */
+ { 7031, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
+ { 7048, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
+ { 7065, 0x000086AE }, /* GL_DOT3_RGB_ARB */
+ { 7081, 0x00008740 }, /* GL_DOT3_RGB_EXT */
+ { 7097, 0x0000140A }, /* GL_DOUBLE */
+ { 7107, 0x00000C32 }, /* GL_DOUBLEBUFFER */
+ { 7123, 0x00000C01 }, /* GL_DRAW_BUFFER */
+ { 7138, 0x00008825 }, /* GL_DRAW_BUFFER0 */
+ { 7154, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
+ { 7174, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
+ { 7194, 0x00008826 }, /* GL_DRAW_BUFFER1 */
+ { 7210, 0x0000882F }, /* GL_DRAW_BUFFER10 */
+ { 7227, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
+ { 7248, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
+ { 7269, 0x00008830 }, /* GL_DRAW_BUFFER11 */
+ { 7286, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
+ { 7307, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
+ { 7328, 0x00008831 }, /* GL_DRAW_BUFFER12 */
+ { 7345, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
+ { 7366, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
+ { 7387, 0x00008832 }, /* GL_DRAW_BUFFER13 */
+ { 7404, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
+ { 7425, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
+ { 7446, 0x00008833 }, /* GL_DRAW_BUFFER14 */
+ { 7463, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
+ { 7484, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
+ { 7505, 0x00008834 }, /* GL_DRAW_BUFFER15 */
+ { 7522, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
+ { 7543, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
+ { 7564, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
+ { 7584, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
+ { 7604, 0x00008827 }, /* GL_DRAW_BUFFER2 */
+ { 7620, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
+ { 7640, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
+ { 7660, 0x00008828 }, /* GL_DRAW_BUFFER3 */
+ { 7676, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
+ { 7696, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
+ { 7716, 0x00008829 }, /* GL_DRAW_BUFFER4 */
+ { 7732, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
+ { 7752, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
+ { 7772, 0x0000882A }, /* GL_DRAW_BUFFER5 */
+ { 7788, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
+ { 7808, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
+ { 7828, 0x0000882B }, /* GL_DRAW_BUFFER6 */
+ { 7844, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
+ { 7864, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
+ { 7884, 0x0000882C }, /* GL_DRAW_BUFFER7 */
+ { 7900, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
+ { 7920, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
+ { 7940, 0x0000882D }, /* GL_DRAW_BUFFER8 */
+ { 7956, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
+ { 7976, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
+ { 7996, 0x0000882E }, /* GL_DRAW_BUFFER9 */
+ { 8012, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
+ { 8032, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
+ { 8052, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ { 8084, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
+ { 8108, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
+ { 8128, 0x00000304 }, /* GL_DST_ALPHA */
+ { 8141, 0x00000306 }, /* GL_DST_COLOR */
+ { 8154, 0x000088EA }, /* GL_DYNAMIC_COPY */
+ { 8170, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
+ { 8190, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
+ { 8206, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
+ { 8226, 0x000088E9 }, /* GL_DYNAMIC_READ */
+ { 8242, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
+ { 8262, 0x00000B43 }, /* GL_EDGE_FLAG */
+ { 8275, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
+ { 8294, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ { 8328, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
+ { 8366, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ { 8393, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ { 8419, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
+ { 8443, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */
+ { 8471, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ { 8503, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
+ { 8539, 0x00001600 }, /* GL_EMISSION */
+ { 8551, 0x00002000 }, /* GL_ENABLE_BIT */
+ { 8565, 0x00000202 }, /* GL_EQUAL */
+ { 8574, 0x00001509 }, /* GL_EQUIV */
+ { 8583, 0x00010000 }, /* GL_EVAL_BIT */
+ { 8595, 0x00000800 }, /* GL_EXP */
+ { 8602, 0x00000801 }, /* GL_EXP2 */
+ { 8610, 0x00001F03 }, /* GL_EXTENSIONS */
+ { 8624, 0x00002400 }, /* GL_EYE_LINEAR */
+ { 8638, 0x00002502 }, /* GL_EYE_PLANE */
+ { 8651, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ { 8676, 0x0000855B }, /* GL_EYE_RADIAL_NV */
+ { 8693, 0x00000000 }, /* GL_FALSE */
+ { 8702, 0x00001101 }, /* GL_FASTEST */
+ { 8713, 0x00001C01 }, /* GL_FEEDBACK */
+ { 8725, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
+ { 8752, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
+ { 8776, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
+ { 8800, 0x00001B02 }, /* GL_FILL */
+ { 8808, 0x00001D00 }, /* GL_FLAT */
+ { 8816, 0x00001406 }, /* GL_FLOAT */
+ { 8825, 0x00008B5A }, /* GL_FLOAT_MAT2 */
+ { 8839, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
+ { 8857, 0x00008B5B }, /* GL_FLOAT_MAT3 */
+ { 8871, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
+ { 8889, 0x00008B5C }, /* GL_FLOAT_MAT4 */
+ { 8903, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
+ { 8921, 0x00008B50 }, /* GL_FLOAT_VEC2 */
+ { 8935, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
+ { 8953, 0x00008B51 }, /* GL_FLOAT_VEC3 */
+ { 8967, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
+ { 8985, 0x00008B52 }, /* GL_FLOAT_VEC4 */
+ { 8999, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
+ { 9017, 0x00000B60 }, /* GL_FOG */
+ { 9024, 0x00000080 }, /* GL_FOG_BIT */
+ { 9035, 0x00000B66 }, /* GL_FOG_COLOR */
+ { 9048, 0x00008451 }, /* GL_FOG_COORD */
+ { 9061, 0x00008451 }, /* GL_FOG_COORDINATE */
+ { 9079, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
+ { 9103, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ { 9142, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
+ { 9185, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ { 9217, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ { 9248, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ { 9277, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
+ { 9302, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
+ { 9321, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
+ { 9355, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
+ { 9382, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
+ { 9408, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
+ { 9432, 0x00008450 }, /* GL_FOG_COORD_SRC */
+ { 9449, 0x00000B62 }, /* GL_FOG_DENSITY */
+ { 9464, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
+ { 9488, 0x00000B64 }, /* GL_FOG_END */
+ { 9499, 0x00000C54 }, /* GL_FOG_HINT */
+ { 9511, 0x00000B61 }, /* GL_FOG_INDEX */
+ { 9524, 0x00000B65 }, /* GL_FOG_MODE */
+ { 9536, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
+ { 9555, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
+ { 9580, 0x00000B63 }, /* GL_FOG_START */
+ { 9593, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
+ { 9611, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
+ { 9635, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
+ { 9654, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
+ { 9677, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ { 9712, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
+ { 9754, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
+ { 9796, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
+ { 9845, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
+ { 9897, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
+ { 9941, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
+ { 9968, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
+ { 9996, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
+ { 10015, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
+ { 10056, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ { 10097, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ { 10139, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ { 10190, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ { 10228, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
+ { 10277, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ { 10319, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ { 10351, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
+ { 10382, 0x00000404 }, /* GL_FRONT */
+ { 10391, 0x00000408 }, /* GL_FRONT_AND_BACK */
+ { 10409, 0x00000B46 }, /* GL_FRONT_FACE */
+ { 10423, 0x00000400 }, /* GL_FRONT_LEFT */
+ { 10437, 0x00000401 }, /* GL_FRONT_RIGHT */
+ { 10452, 0x00008006 }, /* GL_FUNC_ADD */
+ { 10464, 0x00008006 }, /* GL_FUNC_ADD_EXT */
+ { 10480, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
+ { 10505, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
+ { 10534, 0x0000800A }, /* GL_FUNC_SUBTRACT */
+ { 10551, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
+ { 10572, 0x00008191 }, /* GL_GENERATE_MIPMAP */
+ { 10591, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
+ { 10615, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
+ { 10644, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
+ { 10668, 0x00000206 }, /* GL_GEQUAL */
+ { 10678, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */
+ { 10703, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */
+ { 10731, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
+ { 10765, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */
+ { 10787, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */
+ { 10815, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
+ { 10852, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */
+ { 10871, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */
+ { 10890, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */
+ { 10909, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */
+ { 10928, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */
+ { 10947, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */
+ { 10966, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */
+ { 10990, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
+ { 11022, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */
+ { 11048, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
+ { 11082, 0x00008C46 }, /* GL_GL_SLUMINANCE */
+ { 11099, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */
+ { 11117, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */
+ { 11142, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */
+ { 11165, 0x00008C40 }, /* GL_GL_SRGB */
+ { 11176, 0x00008C41 }, /* GL_GL_SRGB8 */
+ { 11188, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */
+ { 11207, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */
+ { 11224, 0x00000204 }, /* GL_GREATER */
+ { 11235, 0x00001904 }, /* GL_GREEN */
+ { 11244, 0x00000D19 }, /* GL_GREEN_BIAS */
+ { 11258, 0x00000D53 }, /* GL_GREEN_BITS */
+ { 11272, 0x00000D18 }, /* GL_GREEN_SCALE */
+ { 11287, 0x00008000 }, /* GL_HINT_BIT */
+ { 11299, 0x00008024 }, /* GL_HISTOGRAM */
+ { 11312, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
+ { 11336, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
+ { 11364, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
+ { 11387, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
+ { 11414, 0x00008024 }, /* GL_HISTOGRAM_EXT */
+ { 11431, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
+ { 11451, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
+ { 11475, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
+ { 11499, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
+ { 11527, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ { 11555, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
+ { 11587, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
+ { 11609, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
+ { 11635, 0x0000802D }, /* GL_HISTOGRAM_SINK */
+ { 11653, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
+ { 11675, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
+ { 11694, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
+ { 11717, 0x0000862A }, /* GL_IDENTITY_NV */
+ { 11732, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
+ { 11752, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ { 11792, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ { 11830, 0x00001E02 }, /* GL_INCR */
+ { 11838, 0x00008507 }, /* GL_INCR_WRAP */
+ { 11851, 0x00008507 }, /* GL_INCR_WRAP_EXT */
+ { 11868, 0x00008077 }, /* GL_INDEX_ARRAY */
+ { 11883, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ { 11913, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
+ { 11947, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
+ { 11970, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
+ { 11992, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
+ { 12012, 0x00000D51 }, /* GL_INDEX_BITS */
+ { 12026, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
+ { 12047, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
+ { 12065, 0x00000C30 }, /* GL_INDEX_MODE */
+ { 12079, 0x00000D13 }, /* GL_INDEX_OFFSET */
+ { 12095, 0x00000D12 }, /* GL_INDEX_SHIFT */
+ { 12110, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
+ { 12129, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
+ { 12148, 0x00001404 }, /* GL_INT */
+ { 12155, 0x00008049 }, /* GL_INTENSITY */
+ { 12168, 0x0000804C }, /* GL_INTENSITY12 */
+ { 12183, 0x0000804C }, /* GL_INTENSITY12_EXT */
+ { 12202, 0x0000804D }, /* GL_INTENSITY16 */
+ { 12217, 0x0000804D }, /* GL_INTENSITY16_EXT */
+ { 12236, 0x0000804A }, /* GL_INTENSITY4 */
+ { 12250, 0x0000804A }, /* GL_INTENSITY4_EXT */
+ { 12268, 0x0000804B }, /* GL_INTENSITY8 */
+ { 12282, 0x0000804B }, /* GL_INTENSITY8_EXT */
+ { 12300, 0x00008049 }, /* GL_INTENSITY_EXT */
+ { 12317, 0x00008575 }, /* GL_INTERPOLATE */
+ { 12332, 0x00008575 }, /* GL_INTERPOLATE_ARB */
+ { 12351, 0x00008575 }, /* GL_INTERPOLATE_EXT */
+ { 12370, 0x00008B53 }, /* GL_INT_VEC2 */
+ { 12382, 0x00008B53 }, /* GL_INT_VEC2_ARB */
+ { 12398, 0x00008B54 }, /* GL_INT_VEC3 */
+ { 12410, 0x00008B54 }, /* GL_INT_VEC3_ARB */
+ { 12426, 0x00008B55 }, /* GL_INT_VEC4 */
+ { 12438, 0x00008B55 }, /* GL_INT_VEC4_ARB */
+ { 12454, 0x00000500 }, /* GL_INVALID_ENUM */
+ { 12470, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ { 12507, 0x00000502 }, /* GL_INVALID_OPERATION */
+ { 12528, 0x00000501 }, /* GL_INVALID_VALUE */
+ { 12545, 0x0000862B }, /* GL_INVERSE_NV */
+ { 12559, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
+ { 12583, 0x0000150A }, /* GL_INVERT */
+ { 12593, 0x00001E00 }, /* GL_KEEP */
+ { 12601, 0x00000406 }, /* GL_LEFT */
+ { 12609, 0x00000203 }, /* GL_LEQUAL */
+ { 12619, 0x00000201 }, /* GL_LESS */
+ { 12627, 0x00004000 }, /* GL_LIGHT0 */
+ { 12637, 0x00004001 }, /* GL_LIGHT1 */
+ { 12647, 0x00004002 }, /* GL_LIGHT2 */
+ { 12657, 0x00004003 }, /* GL_LIGHT3 */
+ { 12667, 0x00004004 }, /* GL_LIGHT4 */
+ { 12677, 0x00004005 }, /* GL_LIGHT5 */
+ { 12687, 0x00004006 }, /* GL_LIGHT6 */
+ { 12697, 0x00004007 }, /* GL_LIGHT7 */
+ { 12707, 0x00000B50 }, /* GL_LIGHTING */
+ { 12719, 0x00000040 }, /* GL_LIGHTING_BIT */
+ { 12735, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
+ { 12758, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ { 12787, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
+ { 12820, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ { 12848, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
+ { 12872, 0x00001B01 }, /* GL_LINE */
+ { 12880, 0x00002601 }, /* GL_LINEAR */
+ { 12890, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
+ { 12912, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ { 12942, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ { 12973, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
+ { 12997, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
+ { 13022, 0x00000001 }, /* GL_LINES */
+ { 13031, 0x00000004 }, /* GL_LINE_BIT */
+ { 13043, 0x00000002 }, /* GL_LINE_LOOP */
+ { 13056, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
+ { 13076, 0x00000B20 }, /* GL_LINE_SMOOTH */
+ { 13091, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
+ { 13111, 0x00000B24 }, /* GL_LINE_STIPPLE */
+ { 13127, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
+ { 13151, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
+ { 13174, 0x00000003 }, /* GL_LINE_STRIP */
+ { 13188, 0x00000702 }, /* GL_LINE_TOKEN */
+ { 13202, 0x00000B21 }, /* GL_LINE_WIDTH */
+ { 13216, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
+ { 13242, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
+ { 13262, 0x00008B82 }, /* GL_LINK_STATUS */
+ { 13277, 0x00000B32 }, /* GL_LIST_BASE */
+ { 13290, 0x00020000 }, /* GL_LIST_BIT */
+ { 13302, 0x00000B33 }, /* GL_LIST_INDEX */
+ { 13316, 0x00000B30 }, /* GL_LIST_MODE */
+ { 13329, 0x00000101 }, /* GL_LOAD */
+ { 13337, 0x00000BF1 }, /* GL_LOGIC_OP */
+ { 13349, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
+ { 13366, 0x00008CA1 }, /* GL_LOWER_LEFT */
+ { 13380, 0x00001909 }, /* GL_LUMINANCE */
+ { 13393, 0x00008041 }, /* GL_LUMINANCE12 */
+ { 13408, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
+ { 13431, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
+ { 13458, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
+ { 13480, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
+ { 13506, 0x00008041 }, /* GL_LUMINANCE12_EXT */
+ { 13525, 0x00008042 }, /* GL_LUMINANCE16 */
+ { 13540, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
+ { 13563, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
+ { 13590, 0x00008042 }, /* GL_LUMINANCE16_EXT */
+ { 13609, 0x0000803F }, /* GL_LUMINANCE4 */
+ { 13623, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
+ { 13644, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
+ { 13669, 0x0000803F }, /* GL_LUMINANCE4_EXT */
+ { 13687, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
+ { 13708, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
+ { 13733, 0x00008040 }, /* GL_LUMINANCE8 */
+ { 13747, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
+ { 13768, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
+ { 13793, 0x00008040 }, /* GL_LUMINANCE8_EXT */
+ { 13811, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
+ { 13830, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
+ { 13846, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
+ { 13866, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
+ { 13888, 0x00000D91 }, /* GL_MAP1_INDEX */
+ { 13902, 0x00000D92 }, /* GL_MAP1_NORMAL */
+ { 13917, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
+ { 13941, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
+ { 13965, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
+ { 13989, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
+ { 14013, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
+ { 14030, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
+ { 14047, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ { 14075, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ { 14104, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ { 14133, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ { 14162, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ { 14191, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ { 14220, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ { 14249, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ { 14277, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ { 14305, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ { 14333, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ { 14361, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ { 14389, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ { 14417, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ { 14445, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ { 14473, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ { 14501, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
+ { 14517, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
+ { 14537, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
+ { 14559, 0x00000DB1 }, /* GL_MAP2_INDEX */
+ { 14573, 0x00000DB2 }, /* GL_MAP2_NORMAL */
+ { 14588, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
+ { 14612, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
+ { 14636, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
+ { 14660, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
+ { 14684, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
+ { 14701, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
+ { 14718, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ { 14746, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ { 14775, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ { 14804, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ { 14833, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ { 14862, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ { 14891, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ { 14920, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ { 14948, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ { 14976, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ { 15004, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ { 15032, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ { 15060, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ { 15088, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
+ { 15116, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ { 15144, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ { 15172, 0x00000D10 }, /* GL_MAP_COLOR */
+ { 15185, 0x00000D11 }, /* GL_MAP_STENCIL */
+ { 15200, 0x000088C0 }, /* GL_MATRIX0_ARB */
+ { 15215, 0x00008630 }, /* GL_MATRIX0_NV */
+ { 15229, 0x000088CA }, /* GL_MATRIX10_ARB */
+ { 15245, 0x000088CB }, /* GL_MATRIX11_ARB */
+ { 15261, 0x000088CC }, /* GL_MATRIX12_ARB */
+ { 15277, 0x000088CD }, /* GL_MATRIX13_ARB */
+ { 15293, 0x000088CE }, /* GL_MATRIX14_ARB */
+ { 15309, 0x000088CF }, /* GL_MATRIX15_ARB */
+ { 15325, 0x000088D0 }, /* GL_MATRIX16_ARB */
+ { 15341, 0x000088D1 }, /* GL_MATRIX17_ARB */
+ { 15357, 0x000088D2 }, /* GL_MATRIX18_ARB */
+ { 15373, 0x000088D3 }, /* GL_MATRIX19_ARB */
+ { 15389, 0x000088C1 }, /* GL_MATRIX1_ARB */
+ { 15404, 0x00008631 }, /* GL_MATRIX1_NV */
+ { 15418, 0x000088D4 }, /* GL_MATRIX20_ARB */
+ { 15434, 0x000088D5 }, /* GL_MATRIX21_ARB */
+ { 15450, 0x000088D6 }, /* GL_MATRIX22_ARB */
+ { 15466, 0x000088D7 }, /* GL_MATRIX23_ARB */
+ { 15482, 0x000088D8 }, /* GL_MATRIX24_ARB */
+ { 15498, 0x000088D9 }, /* GL_MATRIX25_ARB */
+ { 15514, 0x000088DA }, /* GL_MATRIX26_ARB */
+ { 15530, 0x000088DB }, /* GL_MATRIX27_ARB */
+ { 15546, 0x000088DC }, /* GL_MATRIX28_ARB */
+ { 15562, 0x000088DD }, /* GL_MATRIX29_ARB */
+ { 15578, 0x000088C2 }, /* GL_MATRIX2_ARB */
+ { 15593, 0x00008632 }, /* GL_MATRIX2_NV */
+ { 15607, 0x000088DE }, /* GL_MATRIX30_ARB */
+ { 15623, 0x000088DF }, /* GL_MATRIX31_ARB */
+ { 15639, 0x000088C3 }, /* GL_MATRIX3_ARB */
+ { 15654, 0x00008633 }, /* GL_MATRIX3_NV */
+ { 15668, 0x000088C4 }, /* GL_MATRIX4_ARB */
+ { 15683, 0x00008634 }, /* GL_MATRIX4_NV */
+ { 15697, 0x000088C5 }, /* GL_MATRIX5_ARB */
+ { 15712, 0x00008635 }, /* GL_MATRIX5_NV */
+ { 15726, 0x000088C6 }, /* GL_MATRIX6_ARB */
+ { 15741, 0x00008636 }, /* GL_MATRIX6_NV */
+ { 15755, 0x000088C7 }, /* GL_MATRIX7_ARB */
+ { 15770, 0x00008637 }, /* GL_MATRIX7_NV */
+ { 15784, 0x000088C8 }, /* GL_MATRIX8_ARB */
+ { 15799, 0x000088C9 }, /* GL_MATRIX9_ARB */
+ { 15814, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ { 15840, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ { 15874, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ { 15905, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ { 15938, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ { 15969, 0x00000BA0 }, /* GL_MATRIX_MODE */
+ { 15984, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
+ { 16006, 0x00008008 }, /* GL_MAX */
+ { 16013, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
+ { 16036, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ { 16062, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ { 16095, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ { 16121, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 16155, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
+ { 16174, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ { 16203, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ { 16235, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 16271, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ { 16307, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
+ { 16347, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
+ { 16373, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
+ { 16403, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
+ { 16428, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
+ { 16457, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ { 16486, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
+ { 16519, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
+ { 16539, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
+ { 16563, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
+ { 16587, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
+ { 16611, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
+ { 16636, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
+ { 16654, 0x00008008 }, /* GL_MAX_EXT */
+ { 16665, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ { 16700, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
+ { 16739, 0x00000D31 }, /* GL_MAX_LIGHTS */
+ { 16753, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
+ { 16773, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ { 16811, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ { 16840, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
+ { 16864, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
+ { 16892, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
+ { 16915, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 16952, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 16988, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ { 17015, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ { 17044, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ { 17078, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ { 17114, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ { 17141, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ { 17173, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ { 17209, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ { 17238, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ { 17267, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ { 17295, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ { 17333, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 17377, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 17420, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 17454, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 17493, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 17530, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 17568, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 17611, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 17654, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ { 17684, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ { 17715, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 17751, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 17787, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ { 17817, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ { 17851, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
+ { 17884, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ { 17913, 0x00008504 }, /* GL_MAX_SHININESS_NV */
+ { 17933, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
+ { 17957, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
+ { 17979, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
+ { 18005, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ { 18032, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
+ { 18063, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
+ { 18087, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 18121, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
+ { 18141, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ { 18168, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
+ { 18189, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
+ { 18214, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
+ { 18239, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
+ { 18274, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
+ { 18296, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
+ { 18322, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
+ { 18344, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+ { 18370, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ { 18404, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+ { 18442, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ { 18475, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
+ { 18512, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
+ { 18536, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
+ { 18557, 0x00008007 }, /* GL_MIN */
+ { 18564, 0x0000802E }, /* GL_MINMAX */
+ { 18574, 0x0000802E }, /* GL_MINMAX_EXT */
+ { 18588, 0x0000802F }, /* GL_MINMAX_FORMAT */
+ { 18605, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
+ { 18626, 0x00008030 }, /* GL_MINMAX_SINK */
+ { 18641, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
+ { 18660, 0x00008007 }, /* GL_MIN_EXT */
+ { 18671, 0x00008370 }, /* GL_MIRRORED_REPEAT */
+ { 18690, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
+ { 18713, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
+ { 18736, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
+ { 18756, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
+ { 18776, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ { 18806, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
+ { 18834, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ { 18862, 0x00001700 }, /* GL_MODELVIEW */
+ { 18875, 0x00001700 }, /* GL_MODELVIEW0_ARB */
+ { 18893, 0x0000872A }, /* GL_MODELVIEW10_ARB */
+ { 18912, 0x0000872B }, /* GL_MODELVIEW11_ARB */
+ { 18931, 0x0000872C }, /* GL_MODELVIEW12_ARB */
+ { 18950, 0x0000872D }, /* GL_MODELVIEW13_ARB */
+ { 18969, 0x0000872E }, /* GL_MODELVIEW14_ARB */
+ { 18988, 0x0000872F }, /* GL_MODELVIEW15_ARB */
+ { 19007, 0x00008730 }, /* GL_MODELVIEW16_ARB */
+ { 19026, 0x00008731 }, /* GL_MODELVIEW17_ARB */
+ { 19045, 0x00008732 }, /* GL_MODELVIEW18_ARB */
+ { 19064, 0x00008733 }, /* GL_MODELVIEW19_ARB */
+ { 19083, 0x0000850A }, /* GL_MODELVIEW1_ARB */
+ { 19101, 0x00008734 }, /* GL_MODELVIEW20_ARB */
+ { 19120, 0x00008735 }, /* GL_MODELVIEW21_ARB */
+ { 19139, 0x00008736 }, /* GL_MODELVIEW22_ARB */
+ { 19158, 0x00008737 }, /* GL_MODELVIEW23_ARB */
+ { 19177, 0x00008738 }, /* GL_MODELVIEW24_ARB */
+ { 19196, 0x00008739 }, /* GL_MODELVIEW25_ARB */
+ { 19215, 0x0000873A }, /* GL_MODELVIEW26_ARB */
+ { 19234, 0x0000873B }, /* GL_MODELVIEW27_ARB */
+ { 19253, 0x0000873C }, /* GL_MODELVIEW28_ARB */
+ { 19272, 0x0000873D }, /* GL_MODELVIEW29_ARB */
+ { 19291, 0x00008722 }, /* GL_MODELVIEW2_ARB */
+ { 19309, 0x0000873E }, /* GL_MODELVIEW30_ARB */
+ { 19328, 0x0000873F }, /* GL_MODELVIEW31_ARB */
+ { 19347, 0x00008723 }, /* GL_MODELVIEW3_ARB */
+ { 19365, 0x00008724 }, /* GL_MODELVIEW4_ARB */
+ { 19383, 0x00008725 }, /* GL_MODELVIEW5_ARB */
+ { 19401, 0x00008726 }, /* GL_MODELVIEW6_ARB */
+ { 19419, 0x00008727 }, /* GL_MODELVIEW7_ARB */
+ { 19437, 0x00008728 }, /* GL_MODELVIEW8_ARB */
+ { 19455, 0x00008729 }, /* GL_MODELVIEW9_ARB */
+ { 19473, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
+ { 19493, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
+ { 19520, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
+ { 19545, 0x00002100 }, /* GL_MODULATE */
+ { 19557, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
+ { 19577, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
+ { 19604, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
+ { 19629, 0x00000103 }, /* GL_MULT */
+ { 19637, 0x0000809D }, /* GL_MULTISAMPLE */
+ { 19652, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
+ { 19672, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
+ { 19691, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
+ { 19710, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
+ { 19734, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
+ { 19757, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ { 19787, 0x00002A25 }, /* GL_N3F_V3F */
+ { 19798, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
+ { 19818, 0x0000150E }, /* GL_NAND */
+ { 19826, 0x00002600 }, /* GL_NEAREST */
+ { 19837, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ { 19868, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ { 19900, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
+ { 19925, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
+ { 19951, 0x00000200 }, /* GL_NEVER */
+ { 19960, 0x00001102 }, /* GL_NICEST */
+ { 19970, 0x00000000 }, /* GL_NONE */
+ { 19978, 0x00001505 }, /* GL_NOOP */
+ { 19986, 0x00001508 }, /* GL_NOR */
+ { 19993, 0x00000BA1 }, /* GL_NORMALIZE */
+ { 20006, 0x00008075 }, /* GL_NORMAL_ARRAY */
+ { 20022, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ { 20053, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
+ { 20088, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
+ { 20112, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
+ { 20135, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
+ { 20156, 0x00008511 }, /* GL_NORMAL_MAP */
+ { 20170, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
+ { 20188, 0x00008511 }, /* GL_NORMAL_MAP_NV */
+ { 20205, 0x00000205 }, /* GL_NOTEQUAL */
+ { 20217, 0x00000000 }, /* GL_NO_ERROR */
+ { 20229, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ { 20263, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 20301, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ { 20333, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ { 20375, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ { 20405, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ { 20445, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ { 20476, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ { 20505, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
+ { 20533, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ { 20563, 0x00002401 }, /* GL_OBJECT_LINEAR */
+ { 20580, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
+ { 20606, 0x00002501 }, /* GL_OBJECT_PLANE */
+ { 20622, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ { 20657, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
+ { 20679, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
+ { 20698, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ { 20728, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
+ { 20749, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
+ { 20777, 0x00000001 }, /* GL_ONE */
+ { 20784, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ { 20812, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
+ { 20844, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ { 20872, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
+ { 20904, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
+ { 20927, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
+ { 20950, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
+ { 20973, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
+ { 20996, 0x00008598 }, /* GL_OPERAND0_ALPHA */
+ { 21014, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
+ { 21036, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
+ { 21058, 0x00008590 }, /* GL_OPERAND0_RGB */
+ { 21074, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
+ { 21094, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
+ { 21114, 0x00008599 }, /* GL_OPERAND1_ALPHA */
+ { 21132, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
+ { 21154, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
+ { 21176, 0x00008591 }, /* GL_OPERAND1_RGB */
+ { 21192, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
+ { 21212, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
+ { 21232, 0x0000859A }, /* GL_OPERAND2_ALPHA */
+ { 21250, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
+ { 21272, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
+ { 21294, 0x00008592 }, /* GL_OPERAND2_RGB */
+ { 21310, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
+ { 21330, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
+ { 21350, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
+ { 21371, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
+ { 21390, 0x00001507 }, /* GL_OR */
+ { 21396, 0x00000A01 }, /* GL_ORDER */
+ { 21405, 0x0000150D }, /* GL_OR_INVERTED */
+ { 21420, 0x0000150B }, /* GL_OR_REVERSE */
+ { 21434, 0x00000505 }, /* GL_OUT_OF_MEMORY */
+ { 21451, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
+ { 21469, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
+ { 21490, 0x00008758 }, /* GL_PACK_INVERT_MESA */
+ { 21510, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
+ { 21528, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
+ { 21547, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
+ { 21567, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
+ { 21587, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
+ { 21605, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
+ { 21624, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
+ { 21649, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
+ { 21673, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
+ { 21694, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
+ { 21716, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
+ { 21738, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
+ { 21763, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
+ { 21787, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
+ { 21808, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
+ { 21830, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
+ { 21852, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
+ { 21874, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ { 21905, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
+ { 21925, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ { 21950, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
+ { 21970, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ { 21995, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
+ { 22015, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ { 22040, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
+ { 22060, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ { 22085, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
+ { 22105, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ { 22130, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
+ { 22150, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ { 22175, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
+ { 22195, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ { 22220, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
+ { 22240, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ { 22265, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
+ { 22285, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ { 22310, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
+ { 22330, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ { 22355, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
+ { 22373, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ { 22406, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
+ { 22431, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ { 22466, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ { 22493, 0x00001B00 }, /* GL_POINT */
+ { 22502, 0x00000000 }, /* GL_POINTS */
+ { 22512, 0x00000002 }, /* GL_POINT_BIT */
+ { 22525, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
+ { 22555, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
+ { 22589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
+ { 22623, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
+ { 22658, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ { 22687, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
+ { 22720, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
+ { 22753, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
+ { 22787, 0x00000B11 }, /* GL_POINT_SIZE */
+ { 22801, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
+ { 22827, 0x00008127 }, /* GL_POINT_SIZE_MAX */
+ { 22845, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
+ { 22867, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
+ { 22889, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
+ { 22912, 0x00008126 }, /* GL_POINT_SIZE_MIN */
+ { 22930, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
+ { 22952, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
+ { 22974, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
+ { 22997, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
+ { 23017, 0x00000B10 }, /* GL_POINT_SMOOTH */
+ { 23033, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
+ { 23054, 0x00008861 }, /* GL_POINT_SPRITE */
+ { 23070, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
+ { 23090, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ { 23119, 0x00008861 }, /* GL_POINT_SPRITE_NV */
+ { 23138, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
+ { 23164, 0x00000701 }, /* GL_POINT_TOKEN */
+ { 23179, 0x00000009 }, /* GL_POLYGON */
+ { 23190, 0x00000008 }, /* GL_POLYGON_BIT */
+ { 23205, 0x00000B40 }, /* GL_POLYGON_MODE */
+ { 23221, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
+ { 23244, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
+ { 23269, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
+ { 23292, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
+ { 23315, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
+ { 23339, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
+ { 23363, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
+ { 23381, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
+ { 23404, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
+ { 23423, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
+ { 23446, 0x00000703 }, /* GL_POLYGON_TOKEN */
+ { 23463, 0x00001203 }, /* GL_POSITION */
+ { 23475, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ { 23507, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
+ { 23543, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ { 23576, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
+ { 23613, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ { 23644, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
+ { 23679, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ { 23711, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
+ { 23747, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 23780, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ { 23812, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
+ { 23848, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ { 23881, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
+ { 23918, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ { 23948, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
+ { 23982, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ { 24013, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
+ { 24048, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ { 24079, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
+ { 24114, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ { 24146, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
+ { 24182, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ { 24212, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
+ { 24246, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ { 24277, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
+ { 24312, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ { 24344, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ { 24375, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
+ { 24410, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ { 24442, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
+ { 24478, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
+ { 24507, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
+ { 24540, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
+ { 24570, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
+ { 24604, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ { 24643, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ { 24676, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ { 24716, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ { 24750, 0x00008578 }, /* GL_PREVIOUS */
+ { 24762, 0x00008578 }, /* GL_PREVIOUS_ARB */
+ { 24778, 0x00008578 }, /* GL_PREVIOUS_EXT */
+ { 24794, 0x00008577 }, /* GL_PRIMARY_COLOR */
+ { 24811, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
+ { 24832, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
+ { 24853, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 24886, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 24918, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
+ { 24941, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
+ { 24964, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ { 24994, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
+ { 25023, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
+ { 25051, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
+ { 25073, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ { 25101, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ { 25129, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
+ { 25151, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
+ { 25172, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 25212, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 25251, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 25281, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 25316, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 25349, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 25383, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 25422, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 25461, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
+ { 25483, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
+ { 25509, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
+ { 25533, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
+ { 25556, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
+ { 25578, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
+ { 25599, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
+ { 25620, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
+ { 25647, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 25679, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 25711, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ { 25746, 0x00001701 }, /* GL_PROJECTION */
+ { 25760, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
+ { 25781, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
+ { 25807, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
+ { 25828, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
+ { 25847, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
+ { 25870, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 25909, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ { 25947, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
+ { 25967, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
+ { 25991, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
+ { 26011, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
+ { 26035, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
+ { 26055, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ { 26088, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ { 26114, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
+ { 26144, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ { 26175, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
+ { 26205, 0x00002003 }, /* GL_Q */
+ { 26210, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
+ { 26235, 0x00000007 }, /* GL_QUADS */
+ { 26244, 0x00008614 }, /* GL_QUAD_MESH_SUN */
+ { 26261, 0x00000008 }, /* GL_QUAD_STRIP */
+ { 26275, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
+ { 26297, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
+ { 26323, 0x00008866 }, /* GL_QUERY_RESULT */
+ { 26339, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
+ { 26359, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
+ { 26385, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
+ { 26415, 0x00002002 }, /* GL_R */
+ { 26420, 0x00002A10 }, /* GL_R3_G3_B2 */
+ { 26432, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ { 26465, 0x00000C02 }, /* GL_READ_BUFFER */
+ { 26480, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ { 26512, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
+ { 26536, 0x000088B8 }, /* GL_READ_ONLY */
+ { 26549, 0x000088B8 }, /* GL_READ_ONLY_ARB */
+ { 26566, 0x000088BA }, /* GL_READ_WRITE */
+ { 26580, 0x000088BA }, /* GL_READ_WRITE_ARB */
+ { 26598, 0x00001903 }, /* GL_RED */
+ { 26605, 0x00008016 }, /* GL_REDUCE */
+ { 26615, 0x00008016 }, /* GL_REDUCE_EXT */
+ { 26629, 0x00000D15 }, /* GL_RED_BIAS */
+ { 26641, 0x00000D52 }, /* GL_RED_BITS */
+ { 26653, 0x00000D14 }, /* GL_RED_SCALE */
+ { 26666, 0x00008512 }, /* GL_REFLECTION_MAP */
+ { 26684, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
+ { 26706, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
+ { 26727, 0x00001C00 }, /* GL_RENDER */
+ { 26737, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
+ { 26765, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
+ { 26785, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ { 26812, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ { 26848, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
+ { 26874, 0x00001F01 }, /* GL_RENDERER */
+ { 26886, 0x00000C40 }, /* GL_RENDER_MODE */
+ { 26901, 0x00002901 }, /* GL_REPEAT */
+ { 26911, 0x00001E01 }, /* GL_REPLACE */
+ { 26922, 0x00008062 }, /* GL_REPLACE_EXT */
+ { 26937, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
+ { 26960, 0x0000803A }, /* GL_RESCALE_NORMAL */
+ { 26978, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
+ { 27000, 0x00000102 }, /* GL_RETURN */
+ { 27010, 0x00001907 }, /* GL_RGB */
+ { 27017, 0x00008052 }, /* GL_RGB10 */
+ { 27026, 0x00008059 }, /* GL_RGB10_A2 */
+ { 27038, 0x00008059 }, /* GL_RGB10_A2_EXT */
+ { 27054, 0x00008052 }, /* GL_RGB10_EXT */
+ { 27067, 0x00008053 }, /* GL_RGB12 */
+ { 27076, 0x00008053 }, /* GL_RGB12_EXT */
+ { 27089, 0x00008054 }, /* GL_RGB16 */
+ { 27098, 0x00008054 }, /* GL_RGB16_EXT */
+ { 27111, 0x0000804E }, /* GL_RGB2_EXT */
+ { 27123, 0x0000804F }, /* GL_RGB4 */
+ { 27131, 0x0000804F }, /* GL_RGB4_EXT */
+ { 27143, 0x000083A1 }, /* GL_RGB4_S3TC */
+ { 27156, 0x00008050 }, /* GL_RGB5 */
+ { 27164, 0x00008057 }, /* GL_RGB5_A1 */
+ { 27175, 0x00008057 }, /* GL_RGB5_A1_EXT */
+ { 27190, 0x00008050 }, /* GL_RGB5_EXT */
+ { 27202, 0x00008051 }, /* GL_RGB8 */
+ { 27210, 0x00008051 }, /* GL_RGB8_EXT */
+ { 27222, 0x00001908 }, /* GL_RGBA */
+ { 27230, 0x0000805A }, /* GL_RGBA12 */
+ { 27240, 0x0000805A }, /* GL_RGBA12_EXT */
+ { 27254, 0x0000805B }, /* GL_RGBA16 */
+ { 27264, 0x0000805B }, /* GL_RGBA16_EXT */
+ { 27278, 0x00008055 }, /* GL_RGBA2 */
+ { 27287, 0x00008055 }, /* GL_RGBA2_EXT */
+ { 27300, 0x00008056 }, /* GL_RGBA4 */
+ { 27309, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
+ { 27328, 0x00008056 }, /* GL_RGBA4_EXT */
+ { 27341, 0x000083A3 }, /* GL_RGBA4_S3TC */
+ { 27355, 0x00008058 }, /* GL_RGBA8 */
+ { 27364, 0x00008058 }, /* GL_RGBA8_EXT */
+ { 27377, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
+ { 27395, 0x00000C31 }, /* GL_RGBA_MODE */
+ { 27408, 0x000083A2 }, /* GL_RGBA_S3TC */
+ { 27421, 0x000083A0 }, /* GL_RGB_S3TC */
+ { 27433, 0x00008573 }, /* GL_RGB_SCALE */
+ { 27446, 0x00008573 }, /* GL_RGB_SCALE_ARB */
+ { 27463, 0x00008573 }, /* GL_RGB_SCALE_EXT */
+ { 27480, 0x00000407 }, /* GL_RIGHT */
+ { 27489, 0x00002000 }, /* GL_S */
+ { 27494, 0x00008B5D }, /* GL_SAMPLER_1D */
+ { 27508, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
+ { 27529, 0x00008B5E }, /* GL_SAMPLER_2D */
+ { 27543, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
+ { 27564, 0x00008B5F }, /* GL_SAMPLER_3D */
+ { 27578, 0x00008B60 }, /* GL_SAMPLER_CUBE */
+ { 27594, 0x000080A9 }, /* GL_SAMPLES */
+ { 27605, 0x000086B4 }, /* GL_SAMPLES_3DFX */
+ { 27621, 0x000080A9 }, /* GL_SAMPLES_ARB */
+ { 27636, 0x00008914 }, /* GL_SAMPLES_PASSED */
+ { 27654, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
+ { 27676, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ { 27704, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
+ { 27736, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
+ { 27759, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
+ { 27786, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
+ { 27804, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
+ { 27827, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
+ { 27849, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
+ { 27868, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
+ { 27891, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
+ { 27917, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
+ { 27947, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
+ { 27972, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
+ { 28001, 0x00080000 }, /* GL_SCISSOR_BIT */
+ { 28016, 0x00000C10 }, /* GL_SCISSOR_BOX */
+ { 28031, 0x00000C11 }, /* GL_SCISSOR_TEST */
+ { 28047, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
+ { 28072, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ { 28112, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 28156, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ { 28189, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ { 28219, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ { 28251, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ { 28281, 0x00001C02 }, /* GL_SELECT */
+ { 28291, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
+ { 28319, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
+ { 28344, 0x00008012 }, /* GL_SEPARABLE_2D */
+ { 28360, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
+ { 28387, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
+ { 28418, 0x0000150F }, /* GL_SET */
+ { 28425, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
+ { 28446, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
+ { 28470, 0x00008B4F }, /* GL_SHADER_TYPE */
+ { 28485, 0x00000B54 }, /* GL_SHADE_MODEL */
+ { 28500, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
+ { 28528, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
+ { 28551, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ { 28581, 0x00001601 }, /* GL_SHININESS */
+ { 28594, 0x00001402 }, /* GL_SHORT */
+ { 28603, 0x000081F9 }, /* GL_SINGLE_COLOR */
+ { 28619, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
+ { 28639, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
+ { 28658, 0x00001D01 }, /* GL_SMOOTH */
+ { 28668, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+ { 28701, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
+ { 28728, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
+ { 28761, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
+ { 28788, 0x00008588 }, /* GL_SOURCE0_ALPHA */
+ { 28805, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
+ { 28826, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
+ { 28847, 0x00008580 }, /* GL_SOURCE0_RGB */
+ { 28862, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
+ { 28881, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
+ { 28900, 0x00008589 }, /* GL_SOURCE1_ALPHA */
+ { 28917, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
+ { 28938, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
+ { 28959, 0x00008581 }, /* GL_SOURCE1_RGB */
+ { 28974, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
+ { 28993, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
+ { 29012, 0x0000858A }, /* GL_SOURCE2_ALPHA */
+ { 29029, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
+ { 29050, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
+ { 29071, 0x00008582 }, /* GL_SOURCE2_RGB */
+ { 29086, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
+ { 29105, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
+ { 29124, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
+ { 29144, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
+ { 29162, 0x00001202 }, /* GL_SPECULAR */
+ { 29174, 0x00002402 }, /* GL_SPHERE_MAP */
+ { 29188, 0x00001206 }, /* GL_SPOT_CUTOFF */
+ { 29203, 0x00001204 }, /* GL_SPOT_DIRECTION */
+ { 29221, 0x00001205 }, /* GL_SPOT_EXPONENT */
+ { 29238, 0x00008588 }, /* GL_SRC0_ALPHA */
+ { 29252, 0x00008580 }, /* GL_SRC0_RGB */
+ { 29264, 0x00008589 }, /* GL_SRC1_ALPHA */
+ { 29278, 0x00008581 }, /* GL_SRC1_RGB */
+ { 29290, 0x0000858A }, /* GL_SRC2_ALPHA */
+ { 29304, 0x00008582 }, /* GL_SRC2_RGB */
+ { 29316, 0x00000302 }, /* GL_SRC_ALPHA */
+ { 29329, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
+ { 29351, 0x00000300 }, /* GL_SRC_COLOR */
+ { 29364, 0x00000503 }, /* GL_STACK_OVERFLOW */
+ { 29382, 0x00000504 }, /* GL_STACK_UNDERFLOW */
+ { 29401, 0x000088E6 }, /* GL_STATIC_COPY */
+ { 29416, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
+ { 29435, 0x000088E4 }, /* GL_STATIC_DRAW */
+ { 29450, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
+ { 29469, 0x000088E5 }, /* GL_STATIC_READ */
+ { 29484, 0x000088E5 }, /* GL_STATIC_READ_ARB */
+ { 29503, 0x00001802 }, /* GL_STENCIL */
+ { 29514, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
+ { 29540, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
+ { 29561, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
+ { 29582, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ { 29614, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ { 29646, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
+ { 29666, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
+ { 29693, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
+ { 29719, 0x00000D57 }, /* GL_STENCIL_BITS */
+ { 29735, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
+ { 29757, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
+ { 29780, 0x00000B94 }, /* GL_STENCIL_FAIL */
+ { 29796, 0x00000B92 }, /* GL_STENCIL_FUNC */
+ { 29812, 0x00001901 }, /* GL_STENCIL_INDEX */
+ { 29829, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
+ { 29852, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
+ { 29874, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
+ { 29896, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
+ { 29918, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
+ { 29939, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ { 29966, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
+ { 29993, 0x00000B97 }, /* GL_STENCIL_REF */
+ { 30008, 0x00000B90 }, /* GL_STENCIL_TEST */
+ { 30024, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ { 30053, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
+ { 30075, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
+ { 30096, 0x00000C33 }, /* GL_STEREO */
+ { 30106, 0x000088E2 }, /* GL_STREAM_COPY */
+ { 30121, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
+ { 30140, 0x000088E0 }, /* GL_STREAM_DRAW */
+ { 30155, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
+ { 30174, 0x000088E1 }, /* GL_STREAM_READ */
+ { 30189, 0x000088E1 }, /* GL_STREAM_READ_ARB */
+ { 30208, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
+ { 30225, 0x000084E7 }, /* GL_SUBTRACT */
+ { 30237, 0x000084E7 }, /* GL_SUBTRACT_ARB */
+ { 30253, 0x00002001 }, /* GL_T */
+ { 30258, 0x00002A2A }, /* GL_T2F_C3F_V3F */
+ { 30273, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
+ { 30292, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
+ { 30308, 0x00002A2B }, /* GL_T2F_N3F_V3F */
+ { 30323, 0x00002A27 }, /* GL_T2F_V3F */
+ { 30334, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
+ { 30353, 0x00002A28 }, /* GL_T4F_V4F */
+ { 30364, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
+ { 30387, 0x00001702 }, /* GL_TEXTURE */
+ { 30398, 0x000084C0 }, /* GL_TEXTURE0 */
+ { 30410, 0x000084C0 }, /* GL_TEXTURE0_ARB */
+ { 30426, 0x000084C1 }, /* GL_TEXTURE1 */
+ { 30438, 0x000084CA }, /* GL_TEXTURE10 */
+ { 30451, 0x000084CA }, /* GL_TEXTURE10_ARB */
+ { 30468, 0x000084CB }, /* GL_TEXTURE11 */
+ { 30481, 0x000084CB }, /* GL_TEXTURE11_ARB */
+ { 30498, 0x000084CC }, /* GL_TEXTURE12 */
+ { 30511, 0x000084CC }, /* GL_TEXTURE12_ARB */
+ { 30528, 0x000084CD }, /* GL_TEXTURE13 */
+ { 30541, 0x000084CD }, /* GL_TEXTURE13_ARB */
+ { 30558, 0x000084CE }, /* GL_TEXTURE14 */
+ { 30571, 0x000084CE }, /* GL_TEXTURE14_ARB */
+ { 30588, 0x000084CF }, /* GL_TEXTURE15 */
+ { 30601, 0x000084CF }, /* GL_TEXTURE15_ARB */
+ { 30618, 0x000084D0 }, /* GL_TEXTURE16 */
+ { 30631, 0x000084D0 }, /* GL_TEXTURE16_ARB */
+ { 30648, 0x000084D1 }, /* GL_TEXTURE17 */
+ { 30661, 0x000084D1 }, /* GL_TEXTURE17_ARB */
+ { 30678, 0x000084D2 }, /* GL_TEXTURE18 */
+ { 30691, 0x000084D2 }, /* GL_TEXTURE18_ARB */
+ { 30708, 0x000084D3 }, /* GL_TEXTURE19 */
+ { 30721, 0x000084D3 }, /* GL_TEXTURE19_ARB */
+ { 30738, 0x000084C1 }, /* GL_TEXTURE1_ARB */
+ { 30754, 0x000084C2 }, /* GL_TEXTURE2 */
+ { 30766, 0x000084D4 }, /* GL_TEXTURE20 */
+ { 30779, 0x000084D4 }, /* GL_TEXTURE20_ARB */
+ { 30796, 0x000084D5 }, /* GL_TEXTURE21 */
+ { 30809, 0x000084D5 }, /* GL_TEXTURE21_ARB */
+ { 30826, 0x000084D6 }, /* GL_TEXTURE22 */
+ { 30839, 0x000084D6 }, /* GL_TEXTURE22_ARB */
+ { 30856, 0x000084D7 }, /* GL_TEXTURE23 */
+ { 30869, 0x000084D7 }, /* GL_TEXTURE23_ARB */
+ { 30886, 0x000084D8 }, /* GL_TEXTURE24 */
+ { 30899, 0x000084D8 }, /* GL_TEXTURE24_ARB */
+ { 30916, 0x000084D9 }, /* GL_TEXTURE25 */
+ { 30929, 0x000084D9 }, /* GL_TEXTURE25_ARB */
+ { 30946, 0x000084DA }, /* GL_TEXTURE26 */
+ { 30959, 0x000084DA }, /* GL_TEXTURE26_ARB */
+ { 30976, 0x000084DB }, /* GL_TEXTURE27 */
+ { 30989, 0x000084DB }, /* GL_TEXTURE27_ARB */
+ { 31006, 0x000084DC }, /* GL_TEXTURE28 */
+ { 31019, 0x000084DC }, /* GL_TEXTURE28_ARB */
+ { 31036, 0x000084DD }, /* GL_TEXTURE29 */
+ { 31049, 0x000084DD }, /* GL_TEXTURE29_ARB */
+ { 31066, 0x000084C2 }, /* GL_TEXTURE2_ARB */
+ { 31082, 0x000084C3 }, /* GL_TEXTURE3 */
+ { 31094, 0x000084DE }, /* GL_TEXTURE30 */
+ { 31107, 0x000084DE }, /* GL_TEXTURE30_ARB */
+ { 31124, 0x000084DF }, /* GL_TEXTURE31 */
+ { 31137, 0x000084DF }, /* GL_TEXTURE31_ARB */
+ { 31154, 0x000084C3 }, /* GL_TEXTURE3_ARB */
+ { 31170, 0x000084C4 }, /* GL_TEXTURE4 */
+ { 31182, 0x000084C4 }, /* GL_TEXTURE4_ARB */
+ { 31198, 0x000084C5 }, /* GL_TEXTURE5 */
+ { 31210, 0x000084C5 }, /* GL_TEXTURE5_ARB */
+ { 31226, 0x000084C6 }, /* GL_TEXTURE6 */
+ { 31238, 0x000084C6 }, /* GL_TEXTURE6_ARB */
+ { 31254, 0x000084C7 }, /* GL_TEXTURE7 */
+ { 31266, 0x000084C7 }, /* GL_TEXTURE7_ARB */
+ { 31282, 0x000084C8 }, /* GL_TEXTURE8 */
+ { 31294, 0x000084C8 }, /* GL_TEXTURE8_ARB */
+ { 31310, 0x000084C9 }, /* GL_TEXTURE9 */
+ { 31322, 0x000084C9 }, /* GL_TEXTURE9_ARB */
+ { 31338, 0x00000DE0 }, /* GL_TEXTURE_1D */
+ { 31352, 0x00000DE1 }, /* GL_TEXTURE_2D */
+ { 31366, 0x0000806F }, /* GL_TEXTURE_3D */
+ { 31380, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
+ { 31402, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
+ { 31428, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
+ { 31450, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
+ { 31472, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
+ { 31494, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
+ { 31516, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ { 31544, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
+ { 31576, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ { 31609, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
+ { 31641, 0x00040000 }, /* GL_TEXTURE_BIT */
+ { 31656, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
+ { 31677, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
+ { 31702, 0x00001005 }, /* GL_TEXTURE_BORDER */
+ { 31720, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
+ { 31744, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ { 31775, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ { 31805, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ { 31835, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ { 31870, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ { 31901, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 31939, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ { 31966, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ { 31998, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ { 32032, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
+ { 32056, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
+ { 32084, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
+ { 32108, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
+ { 32136, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ { 32169, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
+ { 32193, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
+ { 32215, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
+ { 32237, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
+ { 32263, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 32297, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ { 32330, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
+ { 32367, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
+ { 32395, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
+ { 32427, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
+ { 32450, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ { 32488, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
+ { 32530, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ { 32561, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ { 32589, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ { 32619, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ { 32647, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
+ { 32667, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
+ { 32691, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ { 32722, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
+ { 32757, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ { 32788, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
+ { 32823, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ { 32854, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
+ { 32889, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ { 32920, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
+ { 32955, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ { 32986, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
+ { 33021, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ { 33052, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
+ { 33087, 0x00008071 }, /* GL_TEXTURE_DEPTH */
+ { 33104, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
+ { 33126, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
+ { 33152, 0x00002300 }, /* GL_TEXTURE_ENV */
+ { 33167, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
+ { 33188, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
+ { 33208, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
+ { 33234, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
+ { 33254, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
+ { 33271, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
+ { 33288, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
+ { 33305, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
+ { 33322, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ { 33347, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
+ { 33369, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
+ { 33395, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
+ { 33413, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ { 33439, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
+ { 33465, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
+ { 33495, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
+ { 33522, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ { 33547, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
+ { 33567, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
+ { 33591, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ { 33618, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ { 33645, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ { 33672, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
+ { 33698, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
+ { 33728, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
+ { 33750, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
+ { 33768, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 33798, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ { 33826, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ { 33854, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ { 33882, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
+ { 33903, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
+ { 33922, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
+ { 33944, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
+ { 33963, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
+ { 33983, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
+ { 34008, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
+ { 34032, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
+ { 34052, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
+ { 34076, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
+ { 34096, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
+ { 34119, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
+ { 34144, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ { 34178, 0x00001000 }, /* GL_TEXTURE_WIDTH */
+ { 34195, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
+ { 34213, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
+ { 34231, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
+ { 34249, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
+ { 34269, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 34288, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 34317, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 34334, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 34360, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 34390, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 34422, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 34452, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 34486, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 34502, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 34533, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 34568, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 34596, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 34628, 0x00000004 }, /* GL_TRIANGLES */
+ { 34641, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 34657, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 34678, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 34696, 0x00000001 }, /* GL_TRUE */
+ { 34704, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 34724, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 34747, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 34767, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 34788, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 34810, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 34832, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 34852, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 34873, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 34890, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 34917, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 34940, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 34956, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 34983, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 35007, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 35038, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 35062, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 35090, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 35108, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 35138, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 35164, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 35194, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 35220, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 35244, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 35272, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 35300, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 35327, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 35359, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 35390, 0x00008CA2 }, /* GL_UPPER_LEFT */
+ { 35404, 0x00002A20 }, /* GL_V2F */
+ { 35411, 0x00002A21 }, /* GL_V3F */
+ { 35418, 0x00008B83 }, /* GL_VALIDATE_STATUS */
+ { 35437, 0x00001F00 }, /* GL_VENDOR */
+ { 35447, 0x00001F02 }, /* GL_VERSION */
+ { 35458, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 35474, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ { 35504, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 35535, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 35570, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 35594, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 35615, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 35638, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 35659, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 35686, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 35714, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 35742, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 35770, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 35798, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 35826, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 35854, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 35881, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 35908, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 35935, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 35962, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 35989, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 36016, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 36043, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 36070, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 36097, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 36135, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 36177, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ { 36208, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 36243, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ { 36277, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 36315, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ { 36346, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 36381, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ { 36409, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 36441, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ { 36471, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 36505, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ { 36533, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 36565, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 36585, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 36607, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 36636, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 36657, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ { 36686, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 36719, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 36751, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ { 36778, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 36809, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 36839, 0x00008B31 }, /* GL_VERTEX_SHADER */
+ { 36856, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 36877, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 36904, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 36916, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 36932, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 36952, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 36983, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 37018, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 37046, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 37071, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 37098, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 37123, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 37147, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 37166, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 37180, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 37198, 0x00001506 }, /* GL_XOR */
+ { 37205, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 37224, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 37238, 0x00000000 }, /* GL_ZERO */
+ { 37246, 0x00000D16 }, /* GL_ZOOM_X */
+ { 37256, 0x00000D17 }, /* GL_ZOOM_Y */
};
-static const unsigned reduced_enums[1240] =
+static const unsigned reduced_enums[1277] =
{
- 404, /* GL_FALSE */
- 576, /* GL_LINES */
- 578, /* GL_LINE_LOOP */
- 585, /* GL_LINE_STRIP */
- 1533, /* GL_TRIANGLES */
- 1536, /* GL_TRIANGLE_STRIP */
- 1534, /* GL_TRIANGLE_FAN */
- 1127, /* GL_QUADS */
- 1129, /* GL_QUAD_STRIP */
- 1017, /* GL_POLYGON */
- 1029, /* GL_POLYGON_STIPPLE_BIT */
- 983, /* GL_PIXEL_MODE_BIT */
- 563, /* GL_LIGHTING_BIT */
- 420, /* GL_FOG_BIT */
+ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */
+ 435, /* GL_FALSE */
+ 643, /* GL_LINES */
+ 645, /* GL_LINE_LOOP */
+ 652, /* GL_LINE_STRIP */
+ 1628, /* GL_TRIANGLES */
+ 1631, /* GL_TRIANGLE_STRIP */
+ 1629, /* GL_TRIANGLE_FAN */
+ 1206, /* GL_QUADS */
+ 1208, /* GL_QUAD_STRIP */
+ 1096, /* GL_POLYGON */
+ 1108, /* GL_POLYGON_STIPPLE_BIT */
+ 1061, /* GL_PIXEL_MODE_BIT */
+ 630, /* GL_LIGHTING_BIT */
+ 457, /* GL_FOG_BIT */
8, /* GL_ACCUM */
- 594, /* GL_LOAD */
- 1169, /* GL_RETURN */
- 856, /* GL_MULT */
- 19, /* GL_ADD */
- 872, /* GL_NEVER */
- 553, /* GL_LESS */
- 394, /* GL_EQUAL */
- 552, /* GL_LEQUAL */
- 482, /* GL_GREATER */
- 887, /* GL_NOTEQUAL */
- 481, /* GL_GEQUAL */
- 42, /* GL_ALWAYS */
- 1293, /* GL_SRC_COLOR */
- 916, /* GL_ONE_MINUS_SRC_COLOR */
- 1291, /* GL_SRC_ALPHA */
- 915, /* GL_ONE_MINUS_SRC_ALPHA */
- 374, /* GL_DST_ALPHA */
- 913, /* GL_ONE_MINUS_DST_ALPHA */
- 375, /* GL_DST_COLOR */
- 914, /* GL_ONE_MINUS_DST_COLOR */
- 1292, /* GL_SRC_ALPHA_SATURATE */
- 469, /* GL_FRONT_LEFT */
- 470, /* GL_FRONT_RIGHT */
- 64, /* GL_BACK_LEFT */
- 65, /* GL_BACK_RIGHT */
- 466, /* GL_FRONT */
- 63, /* GL_BACK */
- 551, /* GL_LEFT */
- 1209, /* GL_RIGHT */
- 467, /* GL_FRONT_AND_BACK */
- 58, /* GL_AUX0 */
- 59, /* GL_AUX1 */
- 60, /* GL_AUX2 */
- 61, /* GL_AUX3 */
- 543, /* GL_INVALID_ENUM */
- 546, /* GL_INVALID_VALUE */
- 545, /* GL_INVALID_OPERATION */
- 1294, /* GL_STACK_OVERFLOW */
- 1295, /* GL_STACK_UNDERFLOW */
- 941, /* GL_OUT_OF_MEMORY */
- 544, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ 662, /* GL_LOAD */
+ 1248, /* GL_RETURN */
+ 934, /* GL_MULT */
+ 23, /* GL_ADD */
+ 950, /* GL_NEVER */
+ 620, /* GL_LESS */
+ 425, /* GL_EQUAL */
+ 619, /* GL_LEQUAL */
+ 545, /* GL_GREATER */
+ 965, /* GL_NOTEQUAL */
+ 520, /* GL_GEQUAL */
+ 46, /* GL_ALWAYS */
+ 1381, /* GL_SRC_COLOR */
+ 994, /* GL_ONE_MINUS_SRC_COLOR */
+ 1379, /* GL_SRC_ALPHA */
+ 993, /* GL_ONE_MINUS_SRC_ALPHA */
+ 405, /* GL_DST_ALPHA */
+ 991, /* GL_ONE_MINUS_DST_ALPHA */
+ 406, /* GL_DST_COLOR */
+ 992, /* GL_ONE_MINUS_DST_COLOR */
+ 1380, /* GL_SRC_ALPHA_SATURATE */
+ 508, /* GL_FRONT_LEFT */
+ 509, /* GL_FRONT_RIGHT */
+ 69, /* GL_BACK_LEFT */
+ 70, /* GL_BACK_RIGHT */
+ 505, /* GL_FRONT */
+ 68, /* GL_BACK */
+ 618, /* GL_LEFT */
+ 1288, /* GL_RIGHT */
+ 506, /* GL_FRONT_AND_BACK */
+ 63, /* GL_AUX0 */
+ 64, /* GL_AUX1 */
+ 65, /* GL_AUX2 */
+ 66, /* GL_AUX3 */
+ 610, /* GL_INVALID_ENUM */
+ 613, /* GL_INVALID_VALUE */
+ 612, /* GL_INVALID_OPERATION */
+ 1382, /* GL_STACK_OVERFLOW */
+ 1383, /* GL_STACK_UNDERFLOW */
+ 1019, /* GL_OUT_OF_MEMORY */
+ 611, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
0, /* GL_2D */
2, /* GL_3D */
3, /* GL_3D_COLOR */
4, /* GL_3D_COLOR_TEXTURE */
6, /* GL_4D_COLOR_TEXTURE */
- 961, /* GL_PASS_THROUGH_TOKEN */
- 1016, /* GL_POINT_TOKEN */
- 586, /* GL_LINE_TOKEN */
- 1030, /* GL_POLYGON_TOKEN */
- 69, /* GL_BITMAP_TOKEN */
- 373, /* GL_DRAW_PIXEL_TOKEN */
- 258, /* GL_COPY_PIXEL_TOKEN */
- 579, /* GL_LINE_RESET_TOKEN */
- 397, /* GL_EXP */
- 398, /* GL_EXP2 */
- 289, /* GL_CW */
- 106, /* GL_CCW */
- 127, /* GL_COEFF */
- 938, /* GL_ORDER */
- 328, /* GL_DOMAIN */
- 266, /* GL_CURRENT_COLOR */
- 269, /* GL_CURRENT_INDEX */
- 275, /* GL_CURRENT_NORMAL */
- 286, /* GL_CURRENT_TEXTURE_COORDS */
- 279, /* GL_CURRENT_RASTER_COLOR */
- 281, /* GL_CURRENT_RASTER_INDEX */
- 284, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- 282, /* GL_CURRENT_RASTER_POSITION */
- 283, /* GL_CURRENT_RASTER_POSITION_VALID */
- 280, /* GL_CURRENT_RASTER_DISTANCE */
- 1010, /* GL_POINT_SMOOTH */
- 999, /* GL_POINT_SIZE */
- 1009, /* GL_POINT_SIZE_RANGE */
- 1000, /* GL_POINT_SIZE_GRANULARITY */
- 580, /* GL_LINE_SMOOTH */
- 587, /* GL_LINE_WIDTH */
- 589, /* GL_LINE_WIDTH_RANGE */
- 588, /* GL_LINE_WIDTH_GRANULARITY */
- 582, /* GL_LINE_STIPPLE */
- 583, /* GL_LINE_STIPPLE_PATTERN */
- 584, /* GL_LINE_STIPPLE_REPEAT */
- 593, /* GL_LIST_MODE */
- 747, /* GL_MAX_LIST_NESTING */
- 590, /* GL_LIST_BASE */
- 592, /* GL_LIST_INDEX */
- 1019, /* GL_POLYGON_MODE */
- 1026, /* GL_POLYGON_SMOOTH */
- 1028, /* GL_POLYGON_STIPPLE */
- 382, /* GL_EDGE_FLAG */
- 259, /* GL_CULL_FACE */
- 260, /* GL_CULL_FACE_MODE */
- 468, /* GL_FRONT_FACE */
- 562, /* GL_LIGHTING */
- 567, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- 568, /* GL_LIGHT_MODEL_TWO_SIDE */
- 564, /* GL_LIGHT_MODEL_AMBIENT */
- 1247, /* GL_SHADE_MODEL */
- 158, /* GL_COLOR_MATERIAL_FACE */
- 159, /* GL_COLOR_MATERIAL_PARAMETER */
- 157, /* GL_COLOR_MATERIAL */
- 419, /* GL_FOG */
- 441, /* GL_FOG_INDEX */
- 437, /* GL_FOG_DENSITY */
- 445, /* GL_FOG_START */
- 439, /* GL_FOG_END */
- 442, /* GL_FOG_MODE */
- 421, /* GL_FOG_COLOR */
- 317, /* GL_DEPTH_RANGE */
- 322, /* GL_DEPTH_TEST */
- 325, /* GL_DEPTH_WRITEMASK */
- 305, /* GL_DEPTH_CLEAR_VALUE */
- 316, /* GL_DEPTH_FUNC */
+ 1039, /* GL_PASS_THROUGH_TOKEN */
+ 1095, /* GL_POINT_TOKEN */
+ 653, /* GL_LINE_TOKEN */
+ 1109, /* GL_POLYGON_TOKEN */
+ 74, /* GL_BITMAP_TOKEN */
+ 404, /* GL_DRAW_PIXEL_TOKEN */
+ 270, /* GL_COPY_PIXEL_TOKEN */
+ 646, /* GL_LINE_RESET_TOKEN */
+ 428, /* GL_EXP */
+ 429, /* GL_EXP2 */
+ 303, /* GL_CW */
+ 116, /* GL_CCW */
+ 137, /* GL_COEFF */
+ 1016, /* GL_ORDER */
+ 343, /* GL_DOMAIN */
+ 278, /* GL_CURRENT_COLOR */
+ 281, /* GL_CURRENT_INDEX */
+ 287, /* GL_CURRENT_NORMAL */
+ 299, /* GL_CURRENT_TEXTURE_COORDS */
+ 292, /* GL_CURRENT_RASTER_COLOR */
+ 294, /* GL_CURRENT_RASTER_INDEX */
+ 297, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ 295, /* GL_CURRENT_RASTER_POSITION */
+ 296, /* GL_CURRENT_RASTER_POSITION_VALID */
+ 293, /* GL_CURRENT_RASTER_DISTANCE */
+ 1088, /* GL_POINT_SMOOTH */
+ 1077, /* GL_POINT_SIZE */
+ 1087, /* GL_POINT_SIZE_RANGE */
+ 1078, /* GL_POINT_SIZE_GRANULARITY */
+ 647, /* GL_LINE_SMOOTH */
+ 654, /* GL_LINE_WIDTH */
+ 656, /* GL_LINE_WIDTH_RANGE */
+ 655, /* GL_LINE_WIDTH_GRANULARITY */
+ 649, /* GL_LINE_STIPPLE */
+ 650, /* GL_LINE_STIPPLE_PATTERN */
+ 651, /* GL_LINE_STIPPLE_REPEAT */
+ 661, /* GL_LIST_MODE */
+ 819, /* GL_MAX_LIST_NESTING */
+ 658, /* GL_LIST_BASE */
+ 660, /* GL_LIST_INDEX */
+ 1098, /* GL_POLYGON_MODE */
+ 1105, /* GL_POLYGON_SMOOTH */
+ 1107, /* GL_POLYGON_STIPPLE */
+ 413, /* GL_EDGE_FLAG */
+ 271, /* GL_CULL_FACE */
+ 272, /* GL_CULL_FACE_MODE */
+ 507, /* GL_FRONT_FACE */
+ 629, /* GL_LIGHTING */
+ 634, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ 635, /* GL_LIGHT_MODEL_TWO_SIDE */
+ 631, /* GL_LIGHT_MODEL_AMBIENT */
+ 1334, /* GL_SHADE_MODEL */
+ 168, /* GL_COLOR_MATERIAL_FACE */
+ 169, /* GL_COLOR_MATERIAL_PARAMETER */
+ 167, /* GL_COLOR_MATERIAL */
+ 456, /* GL_FOG */
+ 478, /* GL_FOG_INDEX */
+ 474, /* GL_FOG_DENSITY */
+ 482, /* GL_FOG_START */
+ 476, /* GL_FOG_END */
+ 479, /* GL_FOG_MODE */
+ 458, /* GL_FOG_COLOR */
+ 332, /* GL_DEPTH_RANGE */
+ 337, /* GL_DEPTH_TEST */
+ 340, /* GL_DEPTH_WRITEMASK */
+ 320, /* GL_DEPTH_CLEAR_VALUE */
+ 331, /* GL_DEPTH_FUNC */
12, /* GL_ACCUM_CLEAR_VALUE */
- 1318, /* GL_STENCIL_TEST */
- 1306, /* GL_STENCIL_CLEAR_VALUE */
- 1308, /* GL_STENCIL_FUNC */
- 1320, /* GL_STENCIL_VALUE_MASK */
- 1307, /* GL_STENCIL_FAIL */
- 1315, /* GL_STENCIL_PASS_DEPTH_FAIL */
- 1316, /* GL_STENCIL_PASS_DEPTH_PASS */
- 1317, /* GL_STENCIL_REF */
- 1321, /* GL_STENCIL_WRITEMASK */
- 720, /* GL_MATRIX_MODE */
- 877, /* GL_NORMALIZE */
- 1612, /* GL_VIEWPORT */
- 851, /* GL_MODELVIEW_STACK_DEPTH */
- 1109, /* GL_PROJECTION_STACK_DEPTH */
- 1512, /* GL_TEXTURE_STACK_DEPTH */
- 849, /* GL_MODELVIEW_MATRIX */
- 1108, /* GL_PROJECTION_MATRIX */
- 1497, /* GL_TEXTURE_MATRIX */
- 56, /* GL_ATTRIB_STACK_DEPTH */
- 117, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
- 39, /* GL_ALPHA_TEST */
- 40, /* GL_ALPHA_TEST_FUNC */
- 41, /* GL_ALPHA_TEST_REF */
- 327, /* GL_DITHER */
- 73, /* GL_BLEND_DST */
- 80, /* GL_BLEND_SRC */
- 70, /* GL_BLEND */
- 596, /* GL_LOGIC_OP_MODE */
- 521, /* GL_INDEX_LOGIC_OP */
- 156, /* GL_COLOR_LOGIC_OP */
- 62, /* GL_AUX_BUFFERS */
- 338, /* GL_DRAW_BUFFER */
- 1139, /* GL_READ_BUFFER */
- 1230, /* GL_SCISSOR_BOX */
- 1231, /* GL_SCISSOR_TEST */
- 520, /* GL_INDEX_CLEAR_VALUE */
- 525, /* GL_INDEX_WRITEMASK */
- 153, /* GL_COLOR_CLEAR_VALUE */
- 195, /* GL_COLOR_WRITEMASK */
- 522, /* GL_INDEX_MODE */
- 1203, /* GL_RGBA_MODE */
- 337, /* GL_DOUBLEBUFFER */
- 1322, /* GL_STEREO */
- 1162, /* GL_RENDER_MODE */
- 962, /* GL_PERSPECTIVE_CORRECTION_HINT */
- 1011, /* GL_POINT_SMOOTH_HINT */
- 581, /* GL_LINE_SMOOTH_HINT */
- 1027, /* GL_POLYGON_SMOOTH_HINT */
- 440, /* GL_FOG_HINT */
- 1478, /* GL_TEXTURE_GEN_S */
- 1479, /* GL_TEXTURE_GEN_T */
- 1477, /* GL_TEXTURE_GEN_R */
- 1476, /* GL_TEXTURE_GEN_Q */
- 975, /* GL_PIXEL_MAP_I_TO_I */
- 981, /* GL_PIXEL_MAP_S_TO_S */
- 977, /* GL_PIXEL_MAP_I_TO_R */
- 973, /* GL_PIXEL_MAP_I_TO_G */
- 971, /* GL_PIXEL_MAP_I_TO_B */
- 969, /* GL_PIXEL_MAP_I_TO_A */
- 979, /* GL_PIXEL_MAP_R_TO_R */
- 967, /* GL_PIXEL_MAP_G_TO_G */
- 965, /* GL_PIXEL_MAP_B_TO_B */
- 963, /* GL_PIXEL_MAP_A_TO_A */
- 976, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- 982, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- 978, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- 974, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- 972, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- 970, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- 980, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- 968, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- 966, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- 964, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 1545, /* GL_UNPACK_SWAP_BYTES */
- 1540, /* GL_UNPACK_LSB_FIRST */
- 1541, /* GL_UNPACK_ROW_LENGTH */
- 1544, /* GL_UNPACK_SKIP_ROWS */
- 1543, /* GL_UNPACK_SKIP_PIXELS */
- 1538, /* GL_UNPACK_ALIGNMENT */
- 950, /* GL_PACK_SWAP_BYTES */
- 945, /* GL_PACK_LSB_FIRST */
- 946, /* GL_PACK_ROW_LENGTH */
- 949, /* GL_PACK_SKIP_ROWS */
- 948, /* GL_PACK_SKIP_PIXELS */
- 942, /* GL_PACK_ALIGNMENT */
- 673, /* GL_MAP_COLOR */
- 674, /* GL_MAP_STENCIL */
- 524, /* GL_INDEX_SHIFT */
- 523, /* GL_INDEX_OFFSET */
- 1151, /* GL_RED_SCALE */
- 1149, /* GL_RED_BIAS */
- 1629, /* GL_ZOOM_X */
- 1630, /* GL_ZOOM_Y */
- 486, /* GL_GREEN_SCALE */
- 484, /* GL_GREEN_BIAS */
- 86, /* GL_BLUE_SCALE */
- 84, /* GL_BLUE_BIAS */
- 38, /* GL_ALPHA_SCALE */
- 36, /* GL_ALPHA_BIAS */
- 318, /* GL_DEPTH_SCALE */
- 299, /* GL_DEPTH_BIAS */
- 743, /* GL_MAX_EVAL_ORDER */
- 746, /* GL_MAX_LIGHTS */
- 728, /* GL_MAX_CLIP_PLANES */
- 788, /* GL_MAX_TEXTURE_SIZE */
- 752, /* GL_MAX_PIXEL_MAP_TABLE */
- 724, /* GL_MAX_ATTRIB_STACK_DEPTH */
- 749, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- 750, /* GL_MAX_NAME_STACK_DEPTH */
- 778, /* GL_MAX_PROJECTION_STACK_DEPTH */
- 789, /* GL_MAX_TEXTURE_STACK_DEPTH */
- 799, /* GL_MAX_VIEWPORT_DIMS */
- 725, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- 1329, /* GL_SUBPIXEL_BITS */
- 519, /* GL_INDEX_BITS */
- 1150, /* GL_RED_BITS */
- 485, /* GL_GREEN_BITS */
- 85, /* GL_BLUE_BITS */
- 37, /* GL_ALPHA_BITS */
- 300, /* GL_DEPTH_BITS */
- 1304, /* GL_STENCIL_BITS */
+ 1413, /* GL_STENCIL_TEST */
+ 1401, /* GL_STENCIL_CLEAR_VALUE */
+ 1403, /* GL_STENCIL_FUNC */
+ 1415, /* GL_STENCIL_VALUE_MASK */
+ 1402, /* GL_STENCIL_FAIL */
+ 1410, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ 1411, /* GL_STENCIL_PASS_DEPTH_PASS */
+ 1412, /* GL_STENCIL_REF */
+ 1416, /* GL_STENCIL_WRITEMASK */
+ 789, /* GL_MATRIX_MODE */
+ 955, /* GL_NORMALIZE */
+ 1718, /* GL_VIEWPORT */
+ 929, /* GL_MODELVIEW_STACK_DEPTH */
+ 1188, /* GL_PROJECTION_STACK_DEPTH */
+ 1607, /* GL_TEXTURE_STACK_DEPTH */
+ 927, /* GL_MODELVIEW_MATRIX */
+ 1187, /* GL_PROJECTION_MATRIX */
+ 1592, /* GL_TEXTURE_MATRIX */
+ 61, /* GL_ATTRIB_STACK_DEPTH */
+ 127, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
+ 43, /* GL_ALPHA_TEST */
+ 44, /* GL_ALPHA_TEST_FUNC */
+ 45, /* GL_ALPHA_TEST_REF */
+ 342, /* GL_DITHER */
+ 78, /* GL_BLEND_DST */
+ 86, /* GL_BLEND_SRC */
+ 75, /* GL_BLEND */
+ 664, /* GL_LOGIC_OP_MODE */
+ 584, /* GL_INDEX_LOGIC_OP */
+ 166, /* GL_COLOR_LOGIC_OP */
+ 67, /* GL_AUX_BUFFERS */
+ 353, /* GL_DRAW_BUFFER */
+ 1218, /* GL_READ_BUFFER */
+ 1315, /* GL_SCISSOR_BOX */
+ 1316, /* GL_SCISSOR_TEST */
+ 583, /* GL_INDEX_CLEAR_VALUE */
+ 588, /* GL_INDEX_WRITEMASK */
+ 163, /* GL_COLOR_CLEAR_VALUE */
+ 205, /* GL_COLOR_WRITEMASK */
+ 585, /* GL_INDEX_MODE */
+ 1282, /* GL_RGBA_MODE */
+ 352, /* GL_DOUBLEBUFFER */
+ 1417, /* GL_STEREO */
+ 1241, /* GL_RENDER_MODE */
+ 1040, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ 1089, /* GL_POINT_SMOOTH_HINT */
+ 648, /* GL_LINE_SMOOTH_HINT */
+ 1106, /* GL_POLYGON_SMOOTH_HINT */
+ 477, /* GL_FOG_HINT */
+ 1573, /* GL_TEXTURE_GEN_S */
+ 1574, /* GL_TEXTURE_GEN_T */
+ 1572, /* GL_TEXTURE_GEN_R */
+ 1571, /* GL_TEXTURE_GEN_Q */
+ 1053, /* GL_PIXEL_MAP_I_TO_I */
+ 1059, /* GL_PIXEL_MAP_S_TO_S */
+ 1055, /* GL_PIXEL_MAP_I_TO_R */
+ 1051, /* GL_PIXEL_MAP_I_TO_G */
+ 1049, /* GL_PIXEL_MAP_I_TO_B */
+ 1047, /* GL_PIXEL_MAP_I_TO_A */
+ 1057, /* GL_PIXEL_MAP_R_TO_R */
+ 1045, /* GL_PIXEL_MAP_G_TO_G */
+ 1043, /* GL_PIXEL_MAP_B_TO_B */
+ 1041, /* GL_PIXEL_MAP_A_TO_A */
+ 1054, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ 1060, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ 1056, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ 1052, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ 1050, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ 1048, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ 1058, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ 1046, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ 1044, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ 1042, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ 1640, /* GL_UNPACK_SWAP_BYTES */
+ 1635, /* GL_UNPACK_LSB_FIRST */
+ 1636, /* GL_UNPACK_ROW_LENGTH */
+ 1639, /* GL_UNPACK_SKIP_ROWS */
+ 1638, /* GL_UNPACK_SKIP_PIXELS */
+ 1633, /* GL_UNPACK_ALIGNMENT */
+ 1028, /* GL_PACK_SWAP_BYTES */
+ 1023, /* GL_PACK_LSB_FIRST */
+ 1024, /* GL_PACK_ROW_LENGTH */
+ 1027, /* GL_PACK_SKIP_ROWS */
+ 1026, /* GL_PACK_SKIP_PIXELS */
+ 1020, /* GL_PACK_ALIGNMENT */
+ 742, /* GL_MAP_COLOR */
+ 743, /* GL_MAP_STENCIL */
+ 587, /* GL_INDEX_SHIFT */
+ 586, /* GL_INDEX_OFFSET */
+ 1230, /* GL_RED_SCALE */
+ 1228, /* GL_RED_BIAS */
+ 1735, /* GL_ZOOM_X */
+ 1736, /* GL_ZOOM_Y */
+ 549, /* GL_GREEN_SCALE */
+ 547, /* GL_GREEN_BIAS */
+ 92, /* GL_BLUE_SCALE */
+ 90, /* GL_BLUE_BIAS */
+ 42, /* GL_ALPHA_SCALE */
+ 40, /* GL_ALPHA_BIAS */
+ 333, /* GL_DEPTH_SCALE */
+ 314, /* GL_DEPTH_BIAS */
+ 814, /* GL_MAX_EVAL_ORDER */
+ 818, /* GL_MAX_LIGHTS */
+ 797, /* GL_MAX_CLIP_PLANES */
+ 862, /* GL_MAX_TEXTURE_SIZE */
+ 824, /* GL_MAX_PIXEL_MAP_TABLE */
+ 793, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ 821, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ 822, /* GL_MAX_NAME_STACK_DEPTH */
+ 850, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ 863, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ 877, /* GL_MAX_VIEWPORT_DIMS */
+ 794, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ 1424, /* GL_SUBPIXEL_BITS */
+ 582, /* GL_INDEX_BITS */
+ 1229, /* GL_RED_BITS */
+ 548, /* GL_GREEN_BITS */
+ 91, /* GL_BLUE_BITS */
+ 41, /* GL_ALPHA_BITS */
+ 315, /* GL_DEPTH_BITS */
+ 1399, /* GL_STENCIL_BITS */
14, /* GL_ACCUM_RED_BITS */
13, /* GL_ACCUM_GREEN_BITS */
10, /* GL_ACCUM_BLUE_BITS */
9, /* GL_ACCUM_ALPHA_BITS */
- 865, /* GL_NAME_STACK_DEPTH */
- 57, /* GL_AUTO_NORMAL */
- 619, /* GL_MAP1_COLOR_4 */
- 622, /* GL_MAP1_INDEX */
- 623, /* GL_MAP1_NORMAL */
- 624, /* GL_MAP1_TEXTURE_COORD_1 */
- 625, /* GL_MAP1_TEXTURE_COORD_2 */
- 626, /* GL_MAP1_TEXTURE_COORD_3 */
- 627, /* GL_MAP1_TEXTURE_COORD_4 */
- 628, /* GL_MAP1_VERTEX_3 */
- 629, /* GL_MAP1_VERTEX_4 */
- 646, /* GL_MAP2_COLOR_4 */
- 649, /* GL_MAP2_INDEX */
- 650, /* GL_MAP2_NORMAL */
- 651, /* GL_MAP2_TEXTURE_COORD_1 */
- 652, /* GL_MAP2_TEXTURE_COORD_2 */
- 653, /* GL_MAP2_TEXTURE_COORD_3 */
- 654, /* GL_MAP2_TEXTURE_COORD_4 */
- 655, /* GL_MAP2_VERTEX_3 */
- 656, /* GL_MAP2_VERTEX_4 */
- 620, /* GL_MAP1_GRID_DOMAIN */
- 621, /* GL_MAP1_GRID_SEGMENTS */
- 647, /* GL_MAP2_GRID_DOMAIN */
- 648, /* GL_MAP2_GRID_SEGMENTS */
- 1406, /* GL_TEXTURE_1D */
- 1407, /* GL_TEXTURE_2D */
- 407, /* GL_FEEDBACK_BUFFER_POINTER */
- 408, /* GL_FEEDBACK_BUFFER_SIZE */
- 409, /* GL_FEEDBACK_BUFFER_TYPE */
- 1240, /* GL_SELECTION_BUFFER_POINTER */
- 1241, /* GL_SELECTION_BUFFER_SIZE */
- 1515, /* GL_TEXTURE_WIDTH */
- 1483, /* GL_TEXTURE_HEIGHT */
- 1439, /* GL_TEXTURE_COMPONENTS */
- 1423, /* GL_TEXTURE_BORDER_COLOR */
- 1422, /* GL_TEXTURE_BORDER */
- 329, /* GL_DONT_CARE */
- 405, /* GL_FASTEST */
- 873, /* GL_NICEST */
- 43, /* GL_AMBIENT */
- 326, /* GL_DIFFUSE */
- 1280, /* GL_SPECULAR */
- 1031, /* GL_POSITION */
- 1283, /* GL_SPOT_DIRECTION */
- 1284, /* GL_SPOT_EXPONENT */
- 1282, /* GL_SPOT_CUTOFF */
- 233, /* GL_CONSTANT_ATTENUATION */
- 571, /* GL_LINEAR_ATTENUATION */
- 1126, /* GL_QUADRATIC_ATTENUATION */
- 208, /* GL_COMPILE */
- 209, /* GL_COMPILE_AND_EXECUTE */
- 101, /* GL_BYTE */
- 1546, /* GL_UNSIGNED_BYTE */
- 1251, /* GL_SHORT */
- 1555, /* GL_UNSIGNED_SHORT */
- 526, /* GL_INT */
- 1549, /* GL_UNSIGNED_INT */
- 412, /* GL_FLOAT */
+ 943, /* GL_NAME_STACK_DEPTH */
+ 62, /* GL_AUTO_NORMAL */
+ 688, /* GL_MAP1_COLOR_4 */
+ 691, /* GL_MAP1_INDEX */
+ 692, /* GL_MAP1_NORMAL */
+ 693, /* GL_MAP1_TEXTURE_COORD_1 */
+ 694, /* GL_MAP1_TEXTURE_COORD_2 */
+ 695, /* GL_MAP1_TEXTURE_COORD_3 */
+ 696, /* GL_MAP1_TEXTURE_COORD_4 */
+ 697, /* GL_MAP1_VERTEX_3 */
+ 698, /* GL_MAP1_VERTEX_4 */
+ 715, /* GL_MAP2_COLOR_4 */
+ 718, /* GL_MAP2_INDEX */
+ 719, /* GL_MAP2_NORMAL */
+ 720, /* GL_MAP2_TEXTURE_COORD_1 */
+ 721, /* GL_MAP2_TEXTURE_COORD_2 */
+ 722, /* GL_MAP2_TEXTURE_COORD_3 */
+ 723, /* GL_MAP2_TEXTURE_COORD_4 */
+ 724, /* GL_MAP2_VERTEX_3 */
+ 725, /* GL_MAP2_VERTEX_4 */
+ 689, /* GL_MAP1_GRID_DOMAIN */
+ 690, /* GL_MAP1_GRID_SEGMENTS */
+ 716, /* GL_MAP2_GRID_DOMAIN */
+ 717, /* GL_MAP2_GRID_SEGMENTS */
+ 1501, /* GL_TEXTURE_1D */
+ 1502, /* GL_TEXTURE_2D */
+ 438, /* GL_FEEDBACK_BUFFER_POINTER */
+ 439, /* GL_FEEDBACK_BUFFER_SIZE */
+ 440, /* GL_FEEDBACK_BUFFER_TYPE */
+ 1325, /* GL_SELECTION_BUFFER_POINTER */
+ 1326, /* GL_SELECTION_BUFFER_SIZE */
+ 1610, /* GL_TEXTURE_WIDTH */
+ 1578, /* GL_TEXTURE_HEIGHT */
+ 1534, /* GL_TEXTURE_COMPONENTS */
+ 1518, /* GL_TEXTURE_BORDER_COLOR */
+ 1517, /* GL_TEXTURE_BORDER */
+ 344, /* GL_DONT_CARE */
+ 436, /* GL_FASTEST */
+ 951, /* GL_NICEST */
+ 47, /* GL_AMBIENT */
+ 341, /* GL_DIFFUSE */
+ 1368, /* GL_SPECULAR */
+ 1110, /* GL_POSITION */
+ 1371, /* GL_SPOT_DIRECTION */
+ 1372, /* GL_SPOT_EXPONENT */
+ 1370, /* GL_SPOT_CUTOFF */
+ 244, /* GL_CONSTANT_ATTENUATION */
+ 638, /* GL_LINEAR_ATTENUATION */
+ 1205, /* GL_QUADRATIC_ATTENUATION */
+ 218, /* GL_COMPILE */
+ 219, /* GL_COMPILE_AND_EXECUTE */
+ 111, /* GL_BYTE */
+ 1641, /* GL_UNSIGNED_BYTE */
+ 1339, /* GL_SHORT */
+ 1650, /* GL_UNSIGNED_SHORT */
+ 590, /* GL_INT */
+ 1644, /* GL_UNSIGNED_INT */
+ 443, /* GL_FLOAT */
1, /* GL_2_BYTES */
5, /* GL_3_BYTES */
7, /* GL_4_BYTES */
- 336, /* GL_DOUBLE */
- 113, /* GL_CLEAR */
- 45, /* GL_AND */
- 47, /* GL_AND_REVERSE */
- 256, /* GL_COPY */
- 46, /* GL_AND_INVERTED */
- 875, /* GL_NOOP */
- 1625, /* GL_XOR */
- 937, /* GL_OR */
- 876, /* GL_NOR */
- 395, /* GL_EQUIV */
- 549, /* GL_INVERT */
- 940, /* GL_OR_REVERSE */
- 257, /* GL_COPY_INVERTED */
- 939, /* GL_OR_INVERTED */
- 866, /* GL_NAND */
- 1245, /* GL_SET */
- 392, /* GL_EMISSION */
- 1250, /* GL_SHININESS */
- 44, /* GL_AMBIENT_AND_DIFFUSE */
- 155, /* GL_COLOR_INDEXES */
- 816, /* GL_MODELVIEW */
- 1107, /* GL_PROJECTION */
- 1341, /* GL_TEXTURE */
- 128, /* GL_COLOR */
- 297, /* GL_DEPTH */
- 1302, /* GL_STENCIL */
- 154, /* GL_COLOR_INDEX */
- 1309, /* GL_STENCIL_INDEX */
- 306, /* GL_DEPTH_COMPONENT */
- 1146, /* GL_RED */
- 483, /* GL_GREEN */
- 83, /* GL_BLUE */
- 27, /* GL_ALPHA */
- 1170, /* GL_RGB */
- 1189, /* GL_RGBA */
- 597, /* GL_LUMINANCE */
- 618, /* GL_LUMINANCE_ALPHA */
- 68, /* GL_BITMAP */
- 988, /* GL_POINT */
- 569, /* GL_LINE */
- 410, /* GL_FILL */
- 1155, /* GL_RENDER */
- 406, /* GL_FEEDBACK */
- 1239, /* GL_SELECT */
- 411, /* GL_FLAT */
- 1255, /* GL_SMOOTH */
- 550, /* GL_KEEP */
- 1164, /* GL_REPLACE */
- 510, /* GL_INCR */
- 294, /* GL_DECR */
- 1568, /* GL_VENDOR */
- 1161, /* GL_RENDERER */
- 1569, /* GL_VERSION */
- 399, /* GL_EXTENSIONS */
- 1210, /* GL_S */
- 1332, /* GL_T */
- 1136, /* GL_R */
- 1125, /* GL_Q */
- 852, /* GL_MODULATE */
- 293, /* GL_DECAL */
- 1473, /* GL_TEXTURE_ENV_MODE */
- 1472, /* GL_TEXTURE_ENV_COLOR */
- 1471, /* GL_TEXTURE_ENV */
- 400, /* GL_EYE_LINEAR */
- 899, /* GL_OBJECT_LINEAR */
- 1281, /* GL_SPHERE_MAP */
- 1475, /* GL_TEXTURE_GEN_MODE */
- 901, /* GL_OBJECT_PLANE */
- 401, /* GL_EYE_PLANE */
- 867, /* GL_NEAREST */
- 570, /* GL_LINEAR */
- 871, /* GL_NEAREST_MIPMAP_NEAREST */
- 575, /* GL_LINEAR_MIPMAP_NEAREST */
- 870, /* GL_NEAREST_MIPMAP_LINEAR */
- 574, /* GL_LINEAR_MIPMAP_LINEAR */
- 1496, /* GL_TEXTURE_MAG_FILTER */
- 1504, /* GL_TEXTURE_MIN_FILTER */
- 1517, /* GL_TEXTURE_WRAP_S */
- 1518, /* GL_TEXTURE_WRAP_T */
- 107, /* GL_CLAMP */
- 1163, /* GL_REPEAT */
- 1025, /* GL_POLYGON_OFFSET_UNITS */
- 1024, /* GL_POLYGON_OFFSET_POINT */
- 1023, /* GL_POLYGON_OFFSET_LINE */
- 1137, /* GL_R3_G3_B2 */
- 1566, /* GL_V2F */
- 1567, /* GL_V3F */
- 104, /* GL_C4UB_V2F */
- 105, /* GL_C4UB_V3F */
- 102, /* GL_C3F_V3F */
- 864, /* GL_N3F_V3F */
- 103, /* GL_C4F_N3F_V3F */
- 1337, /* GL_T2F_V3F */
- 1339, /* GL_T4F_V4F */
- 1335, /* GL_T2F_C4UB_V3F */
- 1333, /* GL_T2F_C3F_V3F */
- 1336, /* GL_T2F_N3F_V3F */
- 1334, /* GL_T2F_C4F_N3F_V3F */
- 1338, /* GL_T4F_C4F_N3F_V4F */
- 120, /* GL_CLIP_PLANE0 */
- 121, /* GL_CLIP_PLANE1 */
- 122, /* GL_CLIP_PLANE2 */
- 123, /* GL_CLIP_PLANE3 */
- 124, /* GL_CLIP_PLANE4 */
- 125, /* GL_CLIP_PLANE5 */
- 554, /* GL_LIGHT0 */
- 555, /* GL_LIGHT1 */
- 556, /* GL_LIGHT2 */
- 557, /* GL_LIGHT3 */
- 558, /* GL_LIGHT4 */
- 559, /* GL_LIGHT5 */
- 560, /* GL_LIGHT6 */
- 561, /* GL_LIGHT7 */
- 487, /* GL_HINT_BIT */
- 235, /* GL_CONSTANT_COLOR */
- 911, /* GL_ONE_MINUS_CONSTANT_COLOR */
- 230, /* GL_CONSTANT_ALPHA */
- 909, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- 71, /* GL_BLEND_COLOR */
- 471, /* GL_FUNC_ADD */
- 800, /* GL_MIN */
- 722, /* GL_MAX */
- 76, /* GL_BLEND_EQUATION */
- 475, /* GL_FUNC_SUBTRACT */
- 473, /* GL_FUNC_REVERSE_SUBTRACT */
- 238, /* GL_CONVOLUTION_1D */
- 239, /* GL_CONVOLUTION_2D */
- 1242, /* GL_SEPARABLE_2D */
- 242, /* GL_CONVOLUTION_BORDER_MODE */
- 246, /* GL_CONVOLUTION_FILTER_SCALE */
- 244, /* GL_CONVOLUTION_FILTER_BIAS */
- 1147, /* GL_REDUCE */
- 248, /* GL_CONVOLUTION_FORMAT */
- 252, /* GL_CONVOLUTION_WIDTH */
- 250, /* GL_CONVOLUTION_HEIGHT */
- 735, /* GL_MAX_CONVOLUTION_WIDTH */
- 733, /* GL_MAX_CONVOLUTION_HEIGHT */
- 1064, /* GL_POST_CONVOLUTION_RED_SCALE */
- 1060, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- 1055, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- 1051, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- 1062, /* GL_POST_CONVOLUTION_RED_BIAS */
- 1058, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- 1053, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- 1049, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- 488, /* GL_HISTOGRAM */
- 1111, /* GL_PROXY_HISTOGRAM */
- 504, /* GL_HISTOGRAM_WIDTH */
- 494, /* GL_HISTOGRAM_FORMAT */
- 500, /* GL_HISTOGRAM_RED_SIZE */
- 496, /* GL_HISTOGRAM_GREEN_SIZE */
- 491, /* GL_HISTOGRAM_BLUE_SIZE */
- 489, /* GL_HISTOGRAM_ALPHA_SIZE */
- 498, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- 502, /* GL_HISTOGRAM_SINK */
- 801, /* GL_MINMAX */
- 803, /* GL_MINMAX_FORMAT */
- 805, /* GL_MINMAX_SINK */
- 1340, /* GL_TABLE_TOO_LARGE_EXT */
- 1548, /* GL_UNSIGNED_BYTE_3_3_2 */
- 1557, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 1559, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 1553, /* GL_UNSIGNED_INT_8_8_8_8 */
- 1550, /* GL_UNSIGNED_INT_10_10_10_2 */
- 1022, /* GL_POLYGON_OFFSET_FILL */
- 1021, /* GL_POLYGON_OFFSET_FACTOR */
- 1020, /* GL_POLYGON_OFFSET_BIAS */
- 1167, /* GL_RESCALE_NORMAL */
- 32, /* GL_ALPHA4 */
- 34, /* GL_ALPHA8 */
- 28, /* GL_ALPHA12 */
- 30, /* GL_ALPHA16 */
- 608, /* GL_LUMINANCE4 */
- 614, /* GL_LUMINANCE8 */
- 598, /* GL_LUMINANCE12 */
- 604, /* GL_LUMINANCE16 */
- 609, /* GL_LUMINANCE4_ALPHA4 */
- 612, /* GL_LUMINANCE6_ALPHA2 */
- 615, /* GL_LUMINANCE8_ALPHA8 */
- 601, /* GL_LUMINANCE12_ALPHA4 */
- 599, /* GL_LUMINANCE12_ALPHA12 */
- 605, /* GL_LUMINANCE16_ALPHA16 */
- 527, /* GL_INTENSITY */
- 532, /* GL_INTENSITY4 */
- 534, /* GL_INTENSITY8 */
- 528, /* GL_INTENSITY12 */
- 530, /* GL_INTENSITY16 */
- 1179, /* GL_RGB2_EXT */
- 1180, /* GL_RGB4 */
- 1183, /* GL_RGB5 */
- 1187, /* GL_RGB8 */
- 1171, /* GL_RGB10 */
- 1175, /* GL_RGB12 */
- 1177, /* GL_RGB16 */
- 1194, /* GL_RGBA2 */
- 1196, /* GL_RGBA4 */
- 1184, /* GL_RGB5_A1 */
- 1200, /* GL_RGBA8 */
- 1172, /* GL_RGB10_A2 */
- 1190, /* GL_RGBA12 */
- 1192, /* GL_RGBA16 */
- 1509, /* GL_TEXTURE_RED_SIZE */
- 1481, /* GL_TEXTURE_GREEN_SIZE */
- 1420, /* GL_TEXTURE_BLUE_SIZE */
- 1409, /* GL_TEXTURE_ALPHA_SIZE */
- 1494, /* GL_TEXTURE_LUMINANCE_SIZE */
- 1485, /* GL_TEXTURE_INTENSITY_SIZE */
- 1165, /* GL_REPLACE_EXT */
- 1115, /* GL_PROXY_TEXTURE_1D */
- 1117, /* GL_PROXY_TEXTURE_2D */
- 1513, /* GL_TEXTURE_TOO_LARGE_EXT */
- 1506, /* GL_TEXTURE_PRIORITY */
- 1511, /* GL_TEXTURE_RESIDENT */
- 1412, /* GL_TEXTURE_BINDING_1D */
- 1413, /* GL_TEXTURE_BINDING_2D */
- 1414, /* GL_TEXTURE_BINDING_3D */
- 947, /* GL_PACK_SKIP_IMAGES */
- 943, /* GL_PACK_IMAGE_HEIGHT */
- 1542, /* GL_UNPACK_SKIP_IMAGES */
- 1539, /* GL_UNPACK_IMAGE_HEIGHT */
- 1408, /* GL_TEXTURE_3D */
- 1119, /* GL_PROXY_TEXTURE_3D */
- 1468, /* GL_TEXTURE_DEPTH */
- 1516, /* GL_TEXTURE_WRAP_R */
- 723, /* GL_MAX_3D_TEXTURE_SIZE */
- 1570, /* GL_VERTEX_ARRAY */
- 878, /* GL_NORMAL_ARRAY */
- 129, /* GL_COLOR_ARRAY */
- 513, /* GL_INDEX_ARRAY */
- 1447, /* GL_TEXTURE_COORD_ARRAY */
- 383, /* GL_EDGE_FLAG_ARRAY */
- 1575, /* GL_VERTEX_ARRAY_SIZE */
- 1577, /* GL_VERTEX_ARRAY_TYPE */
- 1576, /* GL_VERTEX_ARRAY_STRIDE */
- 883, /* GL_NORMAL_ARRAY_TYPE */
- 882, /* GL_NORMAL_ARRAY_STRIDE */
- 133, /* GL_COLOR_ARRAY_SIZE */
- 135, /* GL_COLOR_ARRAY_TYPE */
- 134, /* GL_COLOR_ARRAY_STRIDE */
- 518, /* GL_INDEX_ARRAY_TYPE */
- 517, /* GL_INDEX_ARRAY_STRIDE */
- 1451, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- 1453, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- 1452, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- 387, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 1574, /* GL_VERTEX_ARRAY_POINTER */
- 881, /* GL_NORMAL_ARRAY_POINTER */
- 132, /* GL_COLOR_ARRAY_POINTER */
- 516, /* GL_INDEX_ARRAY_POINTER */
- 1450, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- 386, /* GL_EDGE_FLAG_ARRAY_POINTER */
- 857, /* GL_MULTISAMPLE */
- 1216, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- 1218, /* GL_SAMPLE_ALPHA_TO_ONE */
- 1223, /* GL_SAMPLE_COVERAGE */
- 1220, /* GL_SAMPLE_BUFFERS */
- 1211, /* GL_SAMPLES */
- 1227, /* GL_SAMPLE_COVERAGE_VALUE */
- 1225, /* GL_SAMPLE_COVERAGE_INVERT */
- 160, /* GL_COLOR_MATRIX */
- 162, /* GL_COLOR_MATRIX_STACK_DEPTH */
- 730, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- 1047, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- 1043, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- 1038, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- 1034, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- 1045, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- 1041, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- 1036, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- 1032, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- 1430, /* GL_TEXTURE_COLOR_TABLE_SGI */
- 1120, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- 1432, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- 75, /* GL_BLEND_DST_RGB */
- 82, /* GL_BLEND_SRC_RGB */
- 74, /* GL_BLEND_DST_ALPHA */
- 81, /* GL_BLEND_SRC_ALPHA */
- 166, /* GL_COLOR_TABLE */
- 1057, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- 1040, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- 1110, /* GL_PROXY_COLOR_TABLE */
- 1114, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- 1113, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- 190, /* GL_COLOR_TABLE_SCALE */
- 170, /* GL_COLOR_TABLE_BIAS */
- 175, /* GL_COLOR_TABLE_FORMAT */
- 192, /* GL_COLOR_TABLE_WIDTH */
- 187, /* GL_COLOR_TABLE_RED_SIZE */
- 178, /* GL_COLOR_TABLE_GREEN_SIZE */
- 172, /* GL_COLOR_TABLE_BLUE_SIZE */
- 167, /* GL_COLOR_TABLE_ALPHA_SIZE */
- 184, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- 181, /* GL_COLOR_TABLE_INTENSITY_SIZE */
- 66, /* GL_BGR */
- 67, /* GL_BGRA */
- 742, /* GL_MAX_ELEMENTS_VERTICES */
- 741, /* GL_MAX_ELEMENTS_INDICES */
- 1484, /* GL_TEXTURE_INDEX_SIZE_EXT */
- 126, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- 1005, /* GL_POINT_SIZE_MIN */
- 1001, /* GL_POINT_SIZE_MAX */
- 995, /* GL_POINT_FADE_THRESHOLD_SIZE */
- 991, /* GL_POINT_DISTANCE_ATTENUATION */
- 108, /* GL_CLAMP_TO_BORDER */
- 111, /* GL_CLAMP_TO_EDGE */
- 1505, /* GL_TEXTURE_MIN_LOD */
- 1503, /* GL_TEXTURE_MAX_LOD */
- 1411, /* GL_TEXTURE_BASE_LEVEL */
- 1502, /* GL_TEXTURE_MAX_LEVEL */
- 507, /* GL_IGNORE_BORDER_HP */
- 234, /* GL_CONSTANT_BORDER_HP */
- 1166, /* GL_REPLICATE_BORDER_HP */
- 240, /* GL_CONVOLUTION_BORDER_COLOR */
- 906, /* GL_OCCLUSION_TEST_HP */
- 907, /* GL_OCCLUSION_TEST_RESULT_HP */
- 572, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- 1424, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- 1426, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- 1428, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- 1429, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1427, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- 1425, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- 726, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- 727, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1067, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- 1069, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- 1066, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- 1068, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- 1492, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- 1493, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- 1491, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- 477, /* GL_GENERATE_MIPMAP */
- 478, /* GL_GENERATE_MIPMAP_HINT */
- 443, /* GL_FOG_OFFSET_SGIX */
- 444, /* GL_FOG_OFFSET_VALUE_SGIX */
- 1438, /* GL_TEXTURE_COMPARE_SGIX */
- 1437, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- 1488, /* GL_TEXTURE_LEQUAL_R_SGIX */
- 1480, /* GL_TEXTURE_GEQUAL_R_SGIX */
- 307, /* GL_DEPTH_COMPONENT16 */
- 310, /* GL_DEPTH_COMPONENT24 */
- 313, /* GL_DEPTH_COMPONENT32 */
- 261, /* GL_CULL_VERTEX_EXT */
- 263, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- 262, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 1622, /* GL_WRAP_BORDER_SUN */
- 1431, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- 565, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- 1252, /* GL_SINGLE_COLOR */
- 1243, /* GL_SEPARATE_SPECULAR_COLOR */
- 1249, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- 1547, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 1560, /* GL_UNSIGNED_SHORT_5_6_5 */
- 1561, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 1558, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 1556, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 1554, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 1552, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- 1500, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- 1501, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- 1499, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- 808, /* GL_MIRRORED_REPEAT */
- 1205, /* GL_RGB_S3TC */
- 1182, /* GL_RGB4_S3TC */
- 1204, /* GL_RGBA_S3TC */
- 1199, /* GL_RGBA4_S3TC */
- 1202, /* GL_RGBA_DXT5_S3TC */
- 1197, /* GL_RGBA4_DXT5_S3TC */
- 227, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- 222, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- 223, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- 224, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- 869, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- 868, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- 573, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- 430, /* GL_FOG_COORDINATE_SOURCE */
- 422, /* GL_FOG_COORD */
- 446, /* GL_FRAGMENT_DEPTH */
- 267, /* GL_CURRENT_FOG_COORD */
- 429, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- 428, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- 427, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- 424, /* GL_FOG_COORDINATE_ARRAY */
- 164, /* GL_COLOR_SUM */
- 285, /* GL_CURRENT_SECONDARY_COLOR */
- 1236, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- 1238, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- 1237, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- 1235, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- 1232, /* GL_SECONDARY_COLOR_ARRAY */
- 24, /* GL_ALIASED_POINT_SIZE_RANGE */
- 23, /* GL_ALIASED_LINE_WIDTH_RANGE */
- 1342, /* GL_TEXTURE0 */
- 1344, /* GL_TEXTURE1 */
- 1366, /* GL_TEXTURE2 */
- 1388, /* GL_TEXTURE3 */
- 1394, /* GL_TEXTURE4 */
- 1396, /* GL_TEXTURE5 */
- 1398, /* GL_TEXTURE6 */
- 1400, /* GL_TEXTURE7 */
- 1402, /* GL_TEXTURE8 */
- 1404, /* GL_TEXTURE9 */
- 1345, /* GL_TEXTURE10 */
- 1347, /* GL_TEXTURE11 */
- 1349, /* GL_TEXTURE12 */
- 1351, /* GL_TEXTURE13 */
- 1353, /* GL_TEXTURE14 */
- 1355, /* GL_TEXTURE15 */
- 1357, /* GL_TEXTURE16 */
- 1359, /* GL_TEXTURE17 */
- 1361, /* GL_TEXTURE18 */
- 1363, /* GL_TEXTURE19 */
- 1367, /* GL_TEXTURE20 */
- 1369, /* GL_TEXTURE21 */
- 1371, /* GL_TEXTURE22 */
- 1373, /* GL_TEXTURE23 */
- 1375, /* GL_TEXTURE24 */
- 1377, /* GL_TEXTURE25 */
- 1379, /* GL_TEXTURE26 */
- 1381, /* GL_TEXTURE27 */
- 1383, /* GL_TEXTURE28 */
- 1385, /* GL_TEXTURE29 */
- 1389, /* GL_TEXTURE30 */
- 1391, /* GL_TEXTURE31 */
- 16, /* GL_ACTIVE_TEXTURE */
- 114, /* GL_CLIENT_ACTIVE_TEXTURE */
- 790, /* GL_MAX_TEXTURE_UNITS */
- 1526, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 1529, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 1531, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 1523, /* GL_TRANSPOSE_COLOR_MATRIX */
- 1330, /* GL_SUBTRACT */
- 781, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- 210, /* GL_COMPRESSED_ALPHA */
- 214, /* GL_COMPRESSED_LUMINANCE */
- 215, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- 212, /* GL_COMPRESSED_INTENSITY */
- 218, /* GL_COMPRESSED_RGB */
- 219, /* GL_COMPRESSED_RGBA */
- 1445, /* GL_TEXTURE_COMPRESSION_HINT */
- 1507, /* GL_TEXTURE_RECTANGLE_ARB */
- 1417, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- 1123, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- 779, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- 319, /* GL_DEPTH_STENCIL_NV */
- 1551, /* GL_UNSIGNED_INT_24_8_NV */
- 786, /* GL_MAX_TEXTURE_LOD_BIAS */
- 1498, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- 787, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- 1474, /* GL_TEXTURE_FILTER_CONTROL */
- 1489, /* GL_TEXTURE_LOD_BIAS */
- 197, /* GL_COMBINE4 */
- 782, /* GL_MAX_SHININESS_NV */
- 783, /* GL_MAX_SPOT_EXPONENT_NV */
- 511, /* GL_INCR_WRAP */
- 295, /* GL_DECR_WRAP */
- 828, /* GL_MODELVIEW1_ARB */
- 884, /* GL_NORMAL_MAP */
- 1152, /* GL_REFLECTION_MAP */
- 1454, /* GL_TEXTURE_CUBE_MAP */
- 1415, /* GL_TEXTURE_BINDING_CUBE_MAP */
- 1462, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- 1456, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- 1464, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- 1458, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- 1466, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- 1460, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- 1121, /* GL_PROXY_TEXTURE_CUBE_MAP */
- 737, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- 863, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- 438, /* GL_FOG_DISTANCE_MODE_NV */
- 403, /* GL_EYE_RADIAL_NV */
- 402, /* GL_EYE_PLANE_ABSOLUTE_NV */
- 196, /* GL_COMBINE */
- 203, /* GL_COMBINE_RGB */
- 198, /* GL_COMBINE_ALPHA */
- 1206, /* GL_RGB_SCALE */
- 20, /* GL_ADD_SIGNED */
- 537, /* GL_INTERPOLATE */
- 229, /* GL_CONSTANT */
- 1073, /* GL_PRIMARY_COLOR */
- 1070, /* GL_PREVIOUS */
- 1263, /* GL_SOURCE0_RGB */
- 1269, /* GL_SOURCE1_RGB */
- 1275, /* GL_SOURCE2_RGB */
- 1279, /* GL_SOURCE3_RGB_NV */
- 1260, /* GL_SOURCE0_ALPHA */
- 1266, /* GL_SOURCE1_ALPHA */
- 1272, /* GL_SOURCE2_ALPHA */
- 1278, /* GL_SOURCE3_ALPHA_NV */
- 920, /* GL_OPERAND0_RGB */
- 926, /* GL_OPERAND1_RGB */
- 932, /* GL_OPERAND2_RGB */
- 936, /* GL_OPERAND3_RGB_NV */
- 917, /* GL_OPERAND0_ALPHA */
- 923, /* GL_OPERAND1_ALPHA */
- 929, /* GL_OPERAND2_ALPHA */
- 935, /* GL_OPERAND3_ALPHA_NV */
- 1571, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- 1626, /* GL_YCBCR_422_APPLE */
- 1562, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 1564, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- 1254, /* GL_SLICE_ACCUM_SUN */
- 1128, /* GL_QUAD_MESH_SUN */
- 1535, /* GL_TRIANGLE_MESH_SUN */
- 1603, /* GL_VERTEX_PROGRAM_ARB */
- 1611, /* GL_VERTEX_STATE_PROGRAM_NV */
- 1596, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- 1599, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- 1600, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- 1601, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- 287, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
- 1086, /* GL_PROGRAM_LENGTH_ARB */
- 1100, /* GL_PROGRAM_STRING_ARB */
- 850, /* GL_MODELVIEW_PROJECTION_NV */
- 506, /* GL_IDENTITY_NV */
- 547, /* GL_INVERSE_NV */
- 1528, /* GL_TRANSPOSE_NV */
- 548, /* GL_INVERSE_TRANSPOSE_NV */
- 765, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- 764, /* GL_MAX_PROGRAM_MATRICES_ARB */
- 676, /* GL_MATRIX0_NV */
- 688, /* GL_MATRIX1_NV */
- 700, /* GL_MATRIX2_NV */
- 704, /* GL_MATRIX3_NV */
- 706, /* GL_MATRIX4_NV */
- 708, /* GL_MATRIX5_NV */
- 710, /* GL_MATRIX6_NV */
- 712, /* GL_MATRIX7_NV */
- 273, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- 270, /* GL_CURRENT_MATRIX_ARB */
- 1606, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- 1608, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- 1098, /* GL_PROGRAM_PARAMETER_NV */
- 1598, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- 1102, /* GL_PROGRAM_TARGET_NV */
- 1099, /* GL_PROGRAM_RESIDENT_NV */
- 1520, /* GL_TRACK_MATRIX_NV */
- 1521, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 1604, /* GL_VERTEX_PROGRAM_BINDING_NV */
- 1080, /* GL_PROGRAM_ERROR_POSITION_ARB */
- 304, /* GL_DEPTH_CLAMP_NV */
- 1578, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 1585, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 1586, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 1587, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 1588, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 1589, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 1590, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 1591, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 1592, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 1593, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 1579, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 1580, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 1581, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 1582, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 1583, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 1584, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- 630, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- 637, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- 638, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- 639, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- 640, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- 641, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- 642, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- 643, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- 644, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- 645, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- 631, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- 632, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- 633, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- 634, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- 635, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- 636, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- 657, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- 664, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- 665, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- 666, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- 667, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- 668, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- 669, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- 1079, /* GL_PROGRAM_BINDING_ARB */
- 671, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- 672, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- 658, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- 659, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- 660, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- 661, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- 662, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- 663, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- 1443, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- 1440, /* GL_TEXTURE_COMPRESSED */
- 889, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- 228, /* GL_COMPRESSED_TEXTURE_FORMATS */
- 798, /* GL_MAX_VERTEX_UNITS_ARB */
- 18, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 1621, /* GL_WEIGHT_SUM_UNITY_ARB */
- 1602, /* GL_VERTEX_BLEND_ARB */
- 288, /* GL_CURRENT_WEIGHT_ARB */
- 1620, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 1619, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 1618, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 1617, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 1614, /* GL_WEIGHT_ARRAY_ARB */
- 330, /* GL_DOT3_RGB */
- 331, /* GL_DOT3_RGBA */
- 226, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- 221, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- 858, /* GL_MULTISAMPLE_3DFX */
- 1221, /* GL_SAMPLE_BUFFERS_3DFX */
- 1212, /* GL_SAMPLES_3DFX */
- 839, /* GL_MODELVIEW2_ARB */
- 842, /* GL_MODELVIEW3_ARB */
- 843, /* GL_MODELVIEW4_ARB */
- 844, /* GL_MODELVIEW5_ARB */
- 845, /* GL_MODELVIEW6_ARB */
- 846, /* GL_MODELVIEW7_ARB */
- 847, /* GL_MODELVIEW8_ARB */
- 848, /* GL_MODELVIEW9_ARB */
- 818, /* GL_MODELVIEW10_ARB */
- 819, /* GL_MODELVIEW11_ARB */
- 820, /* GL_MODELVIEW12_ARB */
- 821, /* GL_MODELVIEW13_ARB */
- 822, /* GL_MODELVIEW14_ARB */
- 823, /* GL_MODELVIEW15_ARB */
- 824, /* GL_MODELVIEW16_ARB */
- 825, /* GL_MODELVIEW17_ARB */
- 826, /* GL_MODELVIEW18_ARB */
- 827, /* GL_MODELVIEW19_ARB */
- 829, /* GL_MODELVIEW20_ARB */
- 830, /* GL_MODELVIEW21_ARB */
- 831, /* GL_MODELVIEW22_ARB */
- 832, /* GL_MODELVIEW23_ARB */
- 833, /* GL_MODELVIEW24_ARB */
- 834, /* GL_MODELVIEW25_ARB */
- 835, /* GL_MODELVIEW26_ARB */
- 836, /* GL_MODELVIEW27_ARB */
- 837, /* GL_MODELVIEW28_ARB */
- 838, /* GL_MODELVIEW29_ARB */
- 840, /* GL_MODELVIEW30_ARB */
- 841, /* GL_MODELVIEW31_ARB */
- 335, /* GL_DOT3_RGB_EXT */
- 333, /* GL_DOT3_RGBA_EXT */
- 812, /* GL_MIRROR_CLAMP_EXT */
- 815, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- 853, /* GL_MODULATE_ADD_ATI */
- 854, /* GL_MODULATE_SIGNED_ADD_ATI */
- 855, /* GL_MODULATE_SUBTRACT_ATI */
- 1627, /* GL_YCBCR_MESA */
- 944, /* GL_PACK_INVERT_MESA */
- 291, /* GL_DEBUG_OBJECT_MESA */
- 292, /* GL_DEBUG_PRINT_MESA */
- 290, /* GL_DEBUG_ASSERT_MESA */
- 97, /* GL_BUFFER_SIZE */
- 99, /* GL_BUFFER_USAGE */
- 447, /* GL_FRAGMENT_PROGRAM_ARB */
- 1077, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1105, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1104, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1089, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1095, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1094, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 754, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 777, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 776, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- 767, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 773, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 772, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 739, /* GL_MAX_DRAW_BUFFERS_ARB */
- 339, /* GL_DRAW_BUFFER0_ARB */
- 353, /* GL_DRAW_BUFFER1_ARB */
- 355, /* GL_DRAW_BUFFER2_ARB */
- 357, /* GL_DRAW_BUFFER3_ARB */
- 359, /* GL_DRAW_BUFFER4_ARB */
- 361, /* GL_DRAW_BUFFER5_ARB */
- 363, /* GL_DRAW_BUFFER6_ARB */
- 365, /* GL_DRAW_BUFFER7_ARB */
- 367, /* GL_DRAW_BUFFER8_ARB */
- 369, /* GL_DRAW_BUFFER9_ARB */
- 341, /* GL_DRAW_BUFFER10_ARB */
- 343, /* GL_DRAW_BUFFER11_ARB */
- 345, /* GL_DRAW_BUFFER12_ARB */
- 347, /* GL_DRAW_BUFFER13_ARB */
- 349, /* GL_DRAW_BUFFER14_ARB */
- 351, /* GL_DRAW_BUFFER15_ARB */
- 77, /* GL_BLEND_EQUATION_ALPHA_EXT */
- 721, /* GL_MATRIX_PALETTE_ARB */
- 748, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- 751, /* GL_MAX_PALETTE_MATRICES_ARB */
- 276, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- 715, /* GL_MATRIX_INDEX_ARRAY_ARB */
- 271, /* GL_CURRENT_MATRIX_INDEX_ARB */
- 717, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- 719, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- 718, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- 716, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- 1469, /* GL_TEXTURE_DEPTH_SIZE */
- 323, /* GL_DEPTH_TEXTURE_MODE */
- 1435, /* GL_TEXTURE_COMPARE_MODE */
- 1433, /* GL_TEXTURE_COMPARE_FUNC */
- 206, /* GL_COMPARE_R_TO_TEXTURE */
- 1012, /* GL_POINT_SPRITE_ARB */
- 254, /* GL_COORD_REPLACE_ARB */
- 1015, /* GL_POINT_SPRITE_R_MODE_NV */
- 1130, /* GL_QUERY_COUNTER_BITS */
- 277, /* GL_CURRENT_QUERY */
- 1132, /* GL_QUERY_RESULT */
- 1134, /* GL_QUERY_RESULT_AVAILABLE */
- 795, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- 1597, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- 321, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- 320, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- 784, /* GL_MAX_TEXTURE_COORDS_ARB */
- 785, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- 1082, /* GL_PROGRAM_ERROR_STRING_ARB */
- 1084, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- 1083, /* GL_PROGRAM_FORMAT_ARB */
- 1514, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- 302, /* GL_DEPTH_BOUNDS_TEST_EXT */
- 301, /* GL_DEPTH_BOUNDS_EXT */
- 48, /* GL_ARRAY_BUFFER */
- 388, /* GL_ELEMENT_ARRAY_BUFFER */
- 50, /* GL_ARRAY_BUFFER_BINDING */
- 390, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 1572, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- 879, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- 130, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- 514, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- 1448, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- 384, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- 1233, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- 425, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 1615, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 1594, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- 1085, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- 760, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- 1091, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 769, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1103, /* GL_PROGRAM_TEMPORARIES_ARB */
- 775, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- 1093, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 771, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1097, /* GL_PROGRAM_PARAMETERS_ARB */
- 774, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- 1092, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- 770, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1078, /* GL_PROGRAM_ATTRIBS_ARB */
- 755, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- 1090, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- 768, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1076, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- 753, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1088, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 766, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 761, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- 757, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- 1106, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 1525, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- 1142, /* GL_READ_ONLY */
- 1623, /* GL_WRITE_ONLY */
- 1144, /* GL_READ_WRITE */
- 91, /* GL_BUFFER_ACCESS */
- 93, /* GL_BUFFER_MAPPED */
- 95, /* GL_BUFFER_MAP_POINTER */
- 1519, /* GL_TIME_ELAPSED_EXT */
- 675, /* GL_MATRIX0_ARB */
- 687, /* GL_MATRIX1_ARB */
- 699, /* GL_MATRIX2_ARB */
- 703, /* GL_MATRIX3_ARB */
- 705, /* GL_MATRIX4_ARB */
- 707, /* GL_MATRIX5_ARB */
- 709, /* GL_MATRIX6_ARB */
- 711, /* GL_MATRIX7_ARB */
- 713, /* GL_MATRIX8_ARB */
- 714, /* GL_MATRIX9_ARB */
- 677, /* GL_MATRIX10_ARB */
- 678, /* GL_MATRIX11_ARB */
- 679, /* GL_MATRIX12_ARB */
- 680, /* GL_MATRIX13_ARB */
- 681, /* GL_MATRIX14_ARB */
- 682, /* GL_MATRIX15_ARB */
- 683, /* GL_MATRIX16_ARB */
- 684, /* GL_MATRIX17_ARB */
- 685, /* GL_MATRIX18_ARB */
- 686, /* GL_MATRIX19_ARB */
- 689, /* GL_MATRIX20_ARB */
- 690, /* GL_MATRIX21_ARB */
- 691, /* GL_MATRIX22_ARB */
- 692, /* GL_MATRIX23_ARB */
- 693, /* GL_MATRIX24_ARB */
- 694, /* GL_MATRIX25_ARB */
- 695, /* GL_MATRIX26_ARB */
- 696, /* GL_MATRIX27_ARB */
- 697, /* GL_MATRIX28_ARB */
- 698, /* GL_MATRIX29_ARB */
- 701, /* GL_MATRIX30_ARB */
- 702, /* GL_MATRIX31_ARB */
- 1325, /* GL_STREAM_DRAW */
- 1327, /* GL_STREAM_READ */
- 1323, /* GL_STREAM_COPY */
- 1298, /* GL_STATIC_DRAW */
- 1300, /* GL_STATIC_READ */
- 1296, /* GL_STATIC_COPY */
- 378, /* GL_DYNAMIC_DRAW */
- 380, /* GL_DYNAMIC_READ */
- 376, /* GL_DYNAMIC_COPY */
- 985, /* GL_PIXEL_PACK_BUFFER_EXT */
- 987, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- 984, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- 986, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- 758, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- 756, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- 759, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- 763, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- 762, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- 1319, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- 15, /* GL_ACTIVE_STENCIL_FACE_EXT */
- 813, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- 1214, /* GL_SAMPLES_PASSED */
- 448, /* GL_FRAGMENT_SHADER_ARB */
- 1610, /* GL_VERTEX_SHADER_ARB */
- 1096, /* GL_PROGRAM_OBJECT_ARB */
- 1246, /* GL_SHADER_OBJECT_ARB */
- 745, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- 797, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- 794, /* GL_MAX_VARYING_FLOATS_ARB */
- 796, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- 732, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- 904, /* GL_OBJECT_TYPE_ARB */
- 903, /* GL_OBJECT_SUBTYPE_ARB */
- 416, /* GL_FLOAT_VEC2_ARB */
- 417, /* GL_FLOAT_VEC3_ARB */
- 418, /* GL_FLOAT_VEC4_ARB */
- 540, /* GL_INT_VEC2_ARB */
- 541, /* GL_INT_VEC3_ARB */
- 542, /* GL_INT_VEC4_ARB */
- 87, /* GL_BOOL_ARB */
- 88, /* GL_BOOL_VEC2_ARB */
- 89, /* GL_BOOL_VEC3_ARB */
- 90, /* GL_BOOL_VEC4_ARB */
- 413, /* GL_FLOAT_MAT2_ARB */
- 414, /* GL_FLOAT_MAT3_ARB */
- 415, /* GL_FLOAT_MAT4_ARB */
- 897, /* GL_OBJECT_DELETE_STATUS_ARB */
- 896, /* GL_OBJECT_COMPILE_STATUS_ARB */
- 900, /* GL_OBJECT_LINK_STATUS_ARB */
- 905, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- 898, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- 895, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- 893, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- 894, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- 902, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- 891, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- 892, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- 953, /* GL_PALETTE4_RGB8_OES */
- 955, /* GL_PALETTE4_RGBA8_OES */
- 951, /* GL_PALETTE4_R5_G6_B5_OES */
- 954, /* GL_PALETTE4_RGBA4_OES */
- 952, /* GL_PALETTE4_RGB5_A1_OES */
- 958, /* GL_PALETTE8_RGB8_OES */
- 960, /* GL_PALETTE8_RGBA8_OES */
- 956, /* GL_PALETTE8_R5_G6_B5_OES */
- 959, /* GL_PALETTE8_RGBA4_OES */
- 957, /* GL_PALETTE8_RGB5_A1_OES */
- 509, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- 508, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- 1013, /* GL_POINT_SPRITE_COORD_ORIGIN */
- 371, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- 1156, /* GL_RENDERBUFFER_BINDING_EXT */
- 1141, /* GL_READ_FRAMEBUFFER_EXT */
- 372, /* GL_DRAW_FRAMEBUFFER_EXT */
- 1140, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- 450, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- 449, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- 453, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- 452, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- 451, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- 455, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- 457, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- 462, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- 460, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- 458, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- 461, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- 459, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- 463, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- 465, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- 464, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- 729, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- 136, /* GL_COLOR_ATTACHMENT0_EXT */
- 143, /* GL_COLOR_ATTACHMENT1_EXT */
- 144, /* GL_COLOR_ATTACHMENT2_EXT */
- 145, /* GL_COLOR_ATTACHMENT3_EXT */
- 146, /* GL_COLOR_ATTACHMENT4_EXT */
- 147, /* GL_COLOR_ATTACHMENT5_EXT */
- 148, /* GL_COLOR_ATTACHMENT6_EXT */
- 149, /* GL_COLOR_ATTACHMENT7_EXT */
- 150, /* GL_COLOR_ATTACHMENT8_EXT */
- 151, /* GL_COLOR_ATTACHMENT9_EXT */
- 137, /* GL_COLOR_ATTACHMENT10_EXT */
- 138, /* GL_COLOR_ATTACHMENT11_EXT */
- 139, /* GL_COLOR_ATTACHMENT12_EXT */
- 140, /* GL_COLOR_ATTACHMENT13_EXT */
- 141, /* GL_COLOR_ATTACHMENT14_EXT */
- 142, /* GL_COLOR_ATTACHMENT15_EXT */
- 298, /* GL_DEPTH_ATTACHMENT_EXT */
- 1303, /* GL_STENCIL_ATTACHMENT_EXT */
- 456, /* GL_FRAMEBUFFER_EXT */
- 1157, /* GL_RENDERBUFFER_EXT */
- 1160, /* GL_RENDERBUFFER_WIDTH_EXT */
- 1158, /* GL_RENDERBUFFER_HEIGHT_EXT */
- 1159, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- 1314, /* GL_STENCIL_INDEX_EXT */
- 1311, /* GL_STENCIL_INDEX1_EXT */
- 1312, /* GL_STENCIL_INDEX4_EXT */
- 1313, /* GL_STENCIL_INDEX8_EXT */
- 1310, /* GL_STENCIL_INDEX16_EXT */
- 396, /* GL_EVAL_BIT */
- 1138, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- 591, /* GL_LIST_BIT */
- 1419, /* GL_TEXTURE_BIT */
- 1229, /* GL_SCISSOR_BIT */
- 25, /* GL_ALL_ATTRIB_BITS */
- 860, /* GL_MULTISAMPLE_BIT */
- 26, /* GL_ALL_CLIENT_ATTRIB_BITS */
+ 351, /* GL_DOUBLE */
+ 123, /* GL_CLEAR */
+ 49, /* GL_AND */
+ 51, /* GL_AND_REVERSE */
+ 268, /* GL_COPY */
+ 50, /* GL_AND_INVERTED */
+ 953, /* GL_NOOP */
+ 1731, /* GL_XOR */
+ 1015, /* GL_OR */
+ 954, /* GL_NOR */
+ 426, /* GL_EQUIV */
+ 616, /* GL_INVERT */
+ 1018, /* GL_OR_REVERSE */
+ 269, /* GL_COPY_INVERTED */
+ 1017, /* GL_OR_INVERTED */
+ 944, /* GL_NAND */
+ 1330, /* GL_SET */
+ 423, /* GL_EMISSION */
+ 1338, /* GL_SHININESS */
+ 48, /* GL_AMBIENT_AND_DIFFUSE */
+ 165, /* GL_COLOR_INDEXES */
+ 894, /* GL_MODELVIEW */
+ 1186, /* GL_PROJECTION */
+ 1436, /* GL_TEXTURE */
+ 138, /* GL_COLOR */
+ 312, /* GL_DEPTH */
+ 1390, /* GL_STENCIL */
+ 164, /* GL_COLOR_INDEX */
+ 1404, /* GL_STENCIL_INDEX */
+ 321, /* GL_DEPTH_COMPONENT */
+ 1225, /* GL_RED */
+ 546, /* GL_GREEN */
+ 89, /* GL_BLUE */
+ 31, /* GL_ALPHA */
+ 1249, /* GL_RGB */
+ 1268, /* GL_RGBA */
+ 666, /* GL_LUMINANCE */
+ 687, /* GL_LUMINANCE_ALPHA */
+ 73, /* GL_BITMAP */
+ 1066, /* GL_POINT */
+ 636, /* GL_LINE */
+ 441, /* GL_FILL */
+ 1234, /* GL_RENDER */
+ 437, /* GL_FEEDBACK */
+ 1324, /* GL_SELECT */
+ 442, /* GL_FLAT */
+ 1343, /* GL_SMOOTH */
+ 617, /* GL_KEEP */
+ 1243, /* GL_REPLACE */
+ 573, /* GL_INCR */
+ 308, /* GL_DECR */
+ 1665, /* GL_VENDOR */
+ 1240, /* GL_RENDERER */
+ 1666, /* GL_VERSION */
+ 430, /* GL_EXTENSIONS */
+ 1289, /* GL_S */
+ 1427, /* GL_T */
+ 1215, /* GL_R */
+ 1204, /* GL_Q */
+ 930, /* GL_MODULATE */
+ 307, /* GL_DECAL */
+ 1568, /* GL_TEXTURE_ENV_MODE */
+ 1567, /* GL_TEXTURE_ENV_COLOR */
+ 1566, /* GL_TEXTURE_ENV */
+ 431, /* GL_EYE_LINEAR */
+ 977, /* GL_OBJECT_LINEAR */
+ 1369, /* GL_SPHERE_MAP */
+ 1570, /* GL_TEXTURE_GEN_MODE */
+ 979, /* GL_OBJECT_PLANE */
+ 432, /* GL_EYE_PLANE */
+ 945, /* GL_NEAREST */
+ 637, /* GL_LINEAR */
+ 949, /* GL_NEAREST_MIPMAP_NEAREST */
+ 642, /* GL_LINEAR_MIPMAP_NEAREST */
+ 948, /* GL_NEAREST_MIPMAP_LINEAR */
+ 641, /* GL_LINEAR_MIPMAP_LINEAR */
+ 1591, /* GL_TEXTURE_MAG_FILTER */
+ 1599, /* GL_TEXTURE_MIN_FILTER */
+ 1612, /* GL_TEXTURE_WRAP_S */
+ 1613, /* GL_TEXTURE_WRAP_T */
+ 117, /* GL_CLAMP */
+ 1242, /* GL_REPEAT */
+ 1104, /* GL_POLYGON_OFFSET_UNITS */
+ 1103, /* GL_POLYGON_OFFSET_POINT */
+ 1102, /* GL_POLYGON_OFFSET_LINE */
+ 1216, /* GL_R3_G3_B2 */
+ 1662, /* GL_V2F */
+ 1663, /* GL_V3F */
+ 114, /* GL_C4UB_V2F */
+ 115, /* GL_C4UB_V3F */
+ 112, /* GL_C3F_V3F */
+ 942, /* GL_N3F_V3F */
+ 113, /* GL_C4F_N3F_V3F */
+ 1432, /* GL_T2F_V3F */
+ 1434, /* GL_T4F_V4F */
+ 1430, /* GL_T2F_C4UB_V3F */
+ 1428, /* GL_T2F_C3F_V3F */
+ 1431, /* GL_T2F_N3F_V3F */
+ 1429, /* GL_T2F_C4F_N3F_V3F */
+ 1433, /* GL_T4F_C4F_N3F_V4F */
+ 130, /* GL_CLIP_PLANE0 */
+ 131, /* GL_CLIP_PLANE1 */
+ 132, /* GL_CLIP_PLANE2 */
+ 133, /* GL_CLIP_PLANE3 */
+ 134, /* GL_CLIP_PLANE4 */
+ 135, /* GL_CLIP_PLANE5 */
+ 621, /* GL_LIGHT0 */
+ 622, /* GL_LIGHT1 */
+ 623, /* GL_LIGHT2 */
+ 624, /* GL_LIGHT3 */
+ 625, /* GL_LIGHT4 */
+ 626, /* GL_LIGHT5 */
+ 627, /* GL_LIGHT6 */
+ 628, /* GL_LIGHT7 */
+ 550, /* GL_HINT_BIT */
+ 246, /* GL_CONSTANT_COLOR */
+ 989, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ 241, /* GL_CONSTANT_ALPHA */
+ 987, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ 76, /* GL_BLEND_COLOR */
+ 510, /* GL_FUNC_ADD */
+ 878, /* GL_MIN */
+ 791, /* GL_MAX */
+ 81, /* GL_BLEND_EQUATION */
+ 514, /* GL_FUNC_SUBTRACT */
+ 512, /* GL_FUNC_REVERSE_SUBTRACT */
+ 249, /* GL_CONVOLUTION_1D */
+ 250, /* GL_CONVOLUTION_2D */
+ 1327, /* GL_SEPARABLE_2D */
+ 253, /* GL_CONVOLUTION_BORDER_MODE */
+ 257, /* GL_CONVOLUTION_FILTER_SCALE */
+ 255, /* GL_CONVOLUTION_FILTER_BIAS */
+ 1226, /* GL_REDUCE */
+ 259, /* GL_CONVOLUTION_FORMAT */
+ 263, /* GL_CONVOLUTION_WIDTH */
+ 261, /* GL_CONVOLUTION_HEIGHT */
+ 805, /* GL_MAX_CONVOLUTION_WIDTH */
+ 803, /* GL_MAX_CONVOLUTION_HEIGHT */
+ 1143, /* GL_POST_CONVOLUTION_RED_SCALE */
+ 1139, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ 1134, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ 1130, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ 1141, /* GL_POST_CONVOLUTION_RED_BIAS */
+ 1137, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ 1132, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ 1128, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ 551, /* GL_HISTOGRAM */
+ 1190, /* GL_PROXY_HISTOGRAM */
+ 567, /* GL_HISTOGRAM_WIDTH */
+ 557, /* GL_HISTOGRAM_FORMAT */
+ 563, /* GL_HISTOGRAM_RED_SIZE */
+ 559, /* GL_HISTOGRAM_GREEN_SIZE */
+ 554, /* GL_HISTOGRAM_BLUE_SIZE */
+ 552, /* GL_HISTOGRAM_ALPHA_SIZE */
+ 561, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ 565, /* GL_HISTOGRAM_SINK */
+ 879, /* GL_MINMAX */
+ 881, /* GL_MINMAX_FORMAT */
+ 883, /* GL_MINMAX_SINK */
+ 1435, /* GL_TABLE_TOO_LARGE_EXT */
+ 1643, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 1652, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 1654, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 1648, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 1645, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1101, /* GL_POLYGON_OFFSET_FILL */
+ 1100, /* GL_POLYGON_OFFSET_FACTOR */
+ 1099, /* GL_POLYGON_OFFSET_BIAS */
+ 1246, /* GL_RESCALE_NORMAL */
+ 36, /* GL_ALPHA4 */
+ 38, /* GL_ALPHA8 */
+ 32, /* GL_ALPHA12 */
+ 34, /* GL_ALPHA16 */
+ 677, /* GL_LUMINANCE4 */
+ 683, /* GL_LUMINANCE8 */
+ 667, /* GL_LUMINANCE12 */
+ 673, /* GL_LUMINANCE16 */
+ 678, /* GL_LUMINANCE4_ALPHA4 */
+ 681, /* GL_LUMINANCE6_ALPHA2 */
+ 684, /* GL_LUMINANCE8_ALPHA8 */
+ 670, /* GL_LUMINANCE12_ALPHA4 */
+ 668, /* GL_LUMINANCE12_ALPHA12 */
+ 674, /* GL_LUMINANCE16_ALPHA16 */
+ 591, /* GL_INTENSITY */
+ 596, /* GL_INTENSITY4 */
+ 598, /* GL_INTENSITY8 */
+ 592, /* GL_INTENSITY12 */
+ 594, /* GL_INTENSITY16 */
+ 1258, /* GL_RGB2_EXT */
+ 1259, /* GL_RGB4 */
+ 1262, /* GL_RGB5 */
+ 1266, /* GL_RGB8 */
+ 1250, /* GL_RGB10 */
+ 1254, /* GL_RGB12 */
+ 1256, /* GL_RGB16 */
+ 1273, /* GL_RGBA2 */
+ 1275, /* GL_RGBA4 */
+ 1263, /* GL_RGB5_A1 */
+ 1279, /* GL_RGBA8 */
+ 1251, /* GL_RGB10_A2 */
+ 1269, /* GL_RGBA12 */
+ 1271, /* GL_RGBA16 */
+ 1604, /* GL_TEXTURE_RED_SIZE */
+ 1576, /* GL_TEXTURE_GREEN_SIZE */
+ 1515, /* GL_TEXTURE_BLUE_SIZE */
+ 1504, /* GL_TEXTURE_ALPHA_SIZE */
+ 1589, /* GL_TEXTURE_LUMINANCE_SIZE */
+ 1580, /* GL_TEXTURE_INTENSITY_SIZE */
+ 1244, /* GL_REPLACE_EXT */
+ 1194, /* GL_PROXY_TEXTURE_1D */
+ 1196, /* GL_PROXY_TEXTURE_2D */
+ 1608, /* GL_TEXTURE_TOO_LARGE_EXT */
+ 1601, /* GL_TEXTURE_PRIORITY */
+ 1606, /* GL_TEXTURE_RESIDENT */
+ 1507, /* GL_TEXTURE_BINDING_1D */
+ 1508, /* GL_TEXTURE_BINDING_2D */
+ 1509, /* GL_TEXTURE_BINDING_3D */
+ 1025, /* GL_PACK_SKIP_IMAGES */
+ 1021, /* GL_PACK_IMAGE_HEIGHT */
+ 1637, /* GL_UNPACK_SKIP_IMAGES */
+ 1634, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1503, /* GL_TEXTURE_3D */
+ 1198, /* GL_PROXY_TEXTURE_3D */
+ 1563, /* GL_TEXTURE_DEPTH */
+ 1611, /* GL_TEXTURE_WRAP_R */
+ 792, /* GL_MAX_3D_TEXTURE_SIZE */
+ 1667, /* GL_VERTEX_ARRAY */
+ 956, /* GL_NORMAL_ARRAY */
+ 139, /* GL_COLOR_ARRAY */
+ 576, /* GL_INDEX_ARRAY */
+ 1542, /* GL_TEXTURE_COORD_ARRAY */
+ 414, /* GL_EDGE_FLAG_ARRAY */
+ 1672, /* GL_VERTEX_ARRAY_SIZE */
+ 1674, /* GL_VERTEX_ARRAY_TYPE */
+ 1673, /* GL_VERTEX_ARRAY_STRIDE */
+ 961, /* GL_NORMAL_ARRAY_TYPE */
+ 960, /* GL_NORMAL_ARRAY_STRIDE */
+ 143, /* GL_COLOR_ARRAY_SIZE */
+ 145, /* GL_COLOR_ARRAY_TYPE */
+ 144, /* GL_COLOR_ARRAY_STRIDE */
+ 581, /* GL_INDEX_ARRAY_TYPE */
+ 580, /* GL_INDEX_ARRAY_STRIDE */
+ 1546, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ 1548, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ 1547, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ 418, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ 1671, /* GL_VERTEX_ARRAY_POINTER */
+ 959, /* GL_NORMAL_ARRAY_POINTER */
+ 142, /* GL_COLOR_ARRAY_POINTER */
+ 579, /* GL_INDEX_ARRAY_POINTER */
+ 1545, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ 417, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ 935, /* GL_MULTISAMPLE */
+ 1301, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ 1303, /* GL_SAMPLE_ALPHA_TO_ONE */
+ 1308, /* GL_SAMPLE_COVERAGE */
+ 1305, /* GL_SAMPLE_BUFFERS */
+ 1296, /* GL_SAMPLES */
+ 1312, /* GL_SAMPLE_COVERAGE_VALUE */
+ 1310, /* GL_SAMPLE_COVERAGE_INVERT */
+ 170, /* GL_COLOR_MATRIX */
+ 172, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ 799, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ 1126, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ 1122, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ 1117, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ 1113, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ 1124, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ 1120, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ 1115, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ 1111, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ 1525, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ 1199, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ 1527, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ 80, /* GL_BLEND_DST_RGB */
+ 88, /* GL_BLEND_SRC_RGB */
+ 79, /* GL_BLEND_DST_ALPHA */
+ 87, /* GL_BLEND_SRC_ALPHA */
+ 176, /* GL_COLOR_TABLE */
+ 1136, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ 1119, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1189, /* GL_PROXY_COLOR_TABLE */
+ 1193, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ 1192, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ 200, /* GL_COLOR_TABLE_SCALE */
+ 180, /* GL_COLOR_TABLE_BIAS */
+ 185, /* GL_COLOR_TABLE_FORMAT */
+ 202, /* GL_COLOR_TABLE_WIDTH */
+ 197, /* GL_COLOR_TABLE_RED_SIZE */
+ 188, /* GL_COLOR_TABLE_GREEN_SIZE */
+ 182, /* GL_COLOR_TABLE_BLUE_SIZE */
+ 177, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ 194, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ 191, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ 71, /* GL_BGR */
+ 72, /* GL_BGRA */
+ 813, /* GL_MAX_ELEMENTS_VERTICES */
+ 812, /* GL_MAX_ELEMENTS_INDICES */
+ 1579, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ 136, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
+ 1083, /* GL_POINT_SIZE_MIN */
+ 1079, /* GL_POINT_SIZE_MAX */
+ 1073, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ 1069, /* GL_POINT_DISTANCE_ATTENUATION */
+ 118, /* GL_CLAMP_TO_BORDER */
+ 121, /* GL_CLAMP_TO_EDGE */
+ 1600, /* GL_TEXTURE_MIN_LOD */
+ 1598, /* GL_TEXTURE_MAX_LOD */
+ 1506, /* GL_TEXTURE_BASE_LEVEL */
+ 1597, /* GL_TEXTURE_MAX_LEVEL */
+ 570, /* GL_IGNORE_BORDER_HP */
+ 245, /* GL_CONSTANT_BORDER_HP */
+ 1245, /* GL_REPLICATE_BORDER_HP */
+ 251, /* GL_CONVOLUTION_BORDER_COLOR */
+ 984, /* GL_OCCLUSION_TEST_HP */
+ 985, /* GL_OCCLUSION_TEST_RESULT_HP */
+ 639, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ 1519, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ 1521, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ 1523, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ 1524, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1522, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ 1520, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ 795, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ 796, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1146, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ 1148, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ 1145, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ 1147, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ 1587, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ 1588, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ 1586, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ 516, /* GL_GENERATE_MIPMAP */
+ 517, /* GL_GENERATE_MIPMAP_HINT */
+ 480, /* GL_FOG_OFFSET_SGIX */
+ 481, /* GL_FOG_OFFSET_VALUE_SGIX */
+ 1533, /* GL_TEXTURE_COMPARE_SGIX */
+ 1532, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ 1583, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ 1575, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ 322, /* GL_DEPTH_COMPONENT16 */
+ 325, /* GL_DEPTH_COMPONENT24 */
+ 328, /* GL_DEPTH_COMPONENT32 */
+ 273, /* GL_CULL_VERTEX_EXT */
+ 275, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ 274, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ 1728, /* GL_WRAP_BORDER_SUN */
+ 1526, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ 632, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ 1340, /* GL_SINGLE_COLOR */
+ 1328, /* GL_SEPARATE_SPECULAR_COLOR */
+ 1337, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ 1642, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 1655, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 1656, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 1653, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 1651, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 1649, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 1647, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 1595, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ 1596, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ 1594, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ 886, /* GL_MIRRORED_REPEAT */
+ 1284, /* GL_RGB_S3TC */
+ 1261, /* GL_RGB4_S3TC */
+ 1283, /* GL_RGBA_S3TC */
+ 1278, /* GL_RGBA4_S3TC */
+ 1281, /* GL_RGBA_DXT5_S3TC */
+ 1276, /* GL_RGBA4_DXT5_S3TC */
+ 238, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ 233, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ 234, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ 235, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ 947, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ 946, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ 640, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ 467, /* GL_FOG_COORDINATE_SOURCE */
+ 459, /* GL_FOG_COORD */
+ 483, /* GL_FRAGMENT_DEPTH */
+ 279, /* GL_CURRENT_FOG_COORD */
+ 466, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ 465, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ 464, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ 461, /* GL_FOG_COORDINATE_ARRAY */
+ 174, /* GL_COLOR_SUM */
+ 298, /* GL_CURRENT_SECONDARY_COLOR */
+ 1321, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ 1323, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ 1322, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ 1320, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ 1317, /* GL_SECONDARY_COLOR_ARRAY */
+ 526, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
+ 28, /* GL_ALIASED_POINT_SIZE_RANGE */
+ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */
+ 1437, /* GL_TEXTURE0 */
+ 1439, /* GL_TEXTURE1 */
+ 1461, /* GL_TEXTURE2 */
+ 1483, /* GL_TEXTURE3 */
+ 1489, /* GL_TEXTURE4 */
+ 1491, /* GL_TEXTURE5 */
+ 1493, /* GL_TEXTURE6 */
+ 1495, /* GL_TEXTURE7 */
+ 1497, /* GL_TEXTURE8 */
+ 1499, /* GL_TEXTURE9 */
+ 1440, /* GL_TEXTURE10 */
+ 1442, /* GL_TEXTURE11 */
+ 1444, /* GL_TEXTURE12 */
+ 1446, /* GL_TEXTURE13 */
+ 1448, /* GL_TEXTURE14 */
+ 1450, /* GL_TEXTURE15 */
+ 1452, /* GL_TEXTURE16 */
+ 1454, /* GL_TEXTURE17 */
+ 1456, /* GL_TEXTURE18 */
+ 1458, /* GL_TEXTURE19 */
+ 1462, /* GL_TEXTURE20 */
+ 1464, /* GL_TEXTURE21 */
+ 1466, /* GL_TEXTURE22 */
+ 1468, /* GL_TEXTURE23 */
+ 1470, /* GL_TEXTURE24 */
+ 1472, /* GL_TEXTURE25 */
+ 1474, /* GL_TEXTURE26 */
+ 1476, /* GL_TEXTURE27 */
+ 1478, /* GL_TEXTURE28 */
+ 1480, /* GL_TEXTURE29 */
+ 1484, /* GL_TEXTURE30 */
+ 1486, /* GL_TEXTURE31 */
+ 18, /* GL_ACTIVE_TEXTURE */
+ 124, /* GL_CLIENT_ACTIVE_TEXTURE */
+ 864, /* GL_MAX_TEXTURE_UNITS */
+ 1621, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 1624, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 1626, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 1618, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1425, /* GL_SUBTRACT */
+ 853, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ 221, /* GL_COMPRESSED_ALPHA */
+ 225, /* GL_COMPRESSED_LUMINANCE */
+ 226, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ 223, /* GL_COMPRESSED_INTENSITY */
+ 229, /* GL_COMPRESSED_RGB */
+ 230, /* GL_COMPRESSED_RGBA */
+ 1540, /* GL_TEXTURE_COMPRESSION_HINT */
+ 1602, /* GL_TEXTURE_RECTANGLE_ARB */
+ 1512, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ 1202, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ 851, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ 334, /* GL_DEPTH_STENCIL_NV */
+ 1646, /* GL_UNSIGNED_INT_24_8_NV */
+ 860, /* GL_MAX_TEXTURE_LOD_BIAS */
+ 1593, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ 861, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ 1569, /* GL_TEXTURE_FILTER_CONTROL */
+ 1584, /* GL_TEXTURE_LOD_BIAS */
+ 207, /* GL_COMBINE4 */
+ 854, /* GL_MAX_SHININESS_NV */
+ 855, /* GL_MAX_SPOT_EXPONENT_NV */
+ 574, /* GL_INCR_WRAP */
+ 309, /* GL_DECR_WRAP */
+ 906, /* GL_MODELVIEW1_ARB */
+ 962, /* GL_NORMAL_MAP */
+ 1231, /* GL_REFLECTION_MAP */
+ 1549, /* GL_TEXTURE_CUBE_MAP */
+ 1510, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ 1557, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ 1551, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ 1559, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ 1553, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ 1561, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ 1555, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ 1200, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ 807, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ 941, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ 475, /* GL_FOG_DISTANCE_MODE_NV */
+ 434, /* GL_EYE_RADIAL_NV */
+ 433, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ 206, /* GL_COMBINE */
+ 213, /* GL_COMBINE_RGB */
+ 208, /* GL_COMBINE_ALPHA */
+ 1285, /* GL_RGB_SCALE */
+ 24, /* GL_ADD_SIGNED */
+ 601, /* GL_INTERPOLATE */
+ 240, /* GL_CONSTANT */
+ 1152, /* GL_PRIMARY_COLOR */
+ 1149, /* GL_PREVIOUS */
+ 1351, /* GL_SOURCE0_RGB */
+ 1357, /* GL_SOURCE1_RGB */
+ 1363, /* GL_SOURCE2_RGB */
+ 1367, /* GL_SOURCE3_RGB_NV */
+ 1348, /* GL_SOURCE0_ALPHA */
+ 1354, /* GL_SOURCE1_ALPHA */
+ 1360, /* GL_SOURCE2_ALPHA */
+ 1366, /* GL_SOURCE3_ALPHA_NV */
+ 998, /* GL_OPERAND0_RGB */
+ 1004, /* GL_OPERAND1_RGB */
+ 1010, /* GL_OPERAND2_RGB */
+ 1014, /* GL_OPERAND3_RGB_NV */
+ 995, /* GL_OPERAND0_ALPHA */
+ 1001, /* GL_OPERAND1_ALPHA */
+ 1007, /* GL_OPERAND2_ALPHA */
+ 1013, /* GL_OPERAND3_ALPHA_NV */
+ 1668, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ 1732, /* GL_YCBCR_422_APPLE */
+ 1657, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 1659, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 1342, /* GL_SLICE_ACCUM_SUN */
+ 1207, /* GL_QUAD_MESH_SUN */
+ 1630, /* GL_TRIANGLE_MESH_SUN */
+ 1706, /* GL_VERTEX_PROGRAM_ARB */
+ 1717, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 1693, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ 1699, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ 1701, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ 1703, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ 300, /* GL_CURRENT_VERTEX_ATTRIB */
+ 1165, /* GL_PROGRAM_LENGTH_ARB */
+ 1179, /* GL_PROGRAM_STRING_ARB */
+ 928, /* GL_MODELVIEW_PROJECTION_NV */
+ 569, /* GL_IDENTITY_NV */
+ 614, /* GL_INVERSE_NV */
+ 1623, /* GL_TRANSPOSE_NV */
+ 615, /* GL_INVERSE_TRANSPOSE_NV */
+ 837, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ 836, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ 745, /* GL_MATRIX0_NV */
+ 757, /* GL_MATRIX1_NV */
+ 769, /* GL_MATRIX2_NV */
+ 773, /* GL_MATRIX3_NV */
+ 775, /* GL_MATRIX4_NV */
+ 777, /* GL_MATRIX5_NV */
+ 779, /* GL_MATRIX6_NV */
+ 781, /* GL_MATRIX7_NV */
+ 285, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ 282, /* GL_CURRENT_MATRIX_ARB */
+ 1709, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ 1712, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ 1177, /* GL_PROGRAM_PARAMETER_NV */
+ 1697, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ 1181, /* GL_PROGRAM_TARGET_NV */
+ 1178, /* GL_PROGRAM_RESIDENT_NV */
+ 1615, /* GL_TRACK_MATRIX_NV */
+ 1616, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 1707, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1159, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ 319, /* GL_DEPTH_CLAMP_NV */
+ 1675, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 1682, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 1683, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 1684, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 1685, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 1686, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 1687, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 1688, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 1689, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 1690, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 1676, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 1677, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 1678, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 1679, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 1680, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 1681, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 699, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ 706, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ 707, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ 708, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ 709, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ 710, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ 711, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ 712, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ 713, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ 714, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ 700, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ 701, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ 702, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ 703, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ 704, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ 705, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ 726, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ 733, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ 734, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ 735, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ 736, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ 737, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ 738, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ 1158, /* GL_PROGRAM_BINDING_ARB */
+ 740, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ 741, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ 727, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ 728, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ 729, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ 730, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ 731, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ 732, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ 1538, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ 1535, /* GL_TEXTURE_COMPRESSED */
+ 967, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ 239, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ 876, /* GL_MAX_VERTEX_UNITS_ARB */
+ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */
+ 1727, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 1705, /* GL_VERTEX_BLEND_ARB */
+ 302, /* GL_CURRENT_WEIGHT_ARB */
+ 1726, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 1725, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 1724, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 1723, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 1720, /* GL_WEIGHT_ARRAY_ARB */
+ 345, /* GL_DOT3_RGB */
+ 346, /* GL_DOT3_RGBA */
+ 237, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ 232, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ 936, /* GL_MULTISAMPLE_3DFX */
+ 1306, /* GL_SAMPLE_BUFFERS_3DFX */
+ 1297, /* GL_SAMPLES_3DFX */
+ 917, /* GL_MODELVIEW2_ARB */
+ 920, /* GL_MODELVIEW3_ARB */
+ 921, /* GL_MODELVIEW4_ARB */
+ 922, /* GL_MODELVIEW5_ARB */
+ 923, /* GL_MODELVIEW6_ARB */
+ 924, /* GL_MODELVIEW7_ARB */
+ 925, /* GL_MODELVIEW8_ARB */
+ 926, /* GL_MODELVIEW9_ARB */
+ 896, /* GL_MODELVIEW10_ARB */
+ 897, /* GL_MODELVIEW11_ARB */
+ 898, /* GL_MODELVIEW12_ARB */
+ 899, /* GL_MODELVIEW13_ARB */
+ 900, /* GL_MODELVIEW14_ARB */
+ 901, /* GL_MODELVIEW15_ARB */
+ 902, /* GL_MODELVIEW16_ARB */
+ 903, /* GL_MODELVIEW17_ARB */
+ 904, /* GL_MODELVIEW18_ARB */
+ 905, /* GL_MODELVIEW19_ARB */
+ 907, /* GL_MODELVIEW20_ARB */
+ 908, /* GL_MODELVIEW21_ARB */
+ 909, /* GL_MODELVIEW22_ARB */
+ 910, /* GL_MODELVIEW23_ARB */
+ 911, /* GL_MODELVIEW24_ARB */
+ 912, /* GL_MODELVIEW25_ARB */
+ 913, /* GL_MODELVIEW26_ARB */
+ 914, /* GL_MODELVIEW27_ARB */
+ 915, /* GL_MODELVIEW28_ARB */
+ 916, /* GL_MODELVIEW29_ARB */
+ 918, /* GL_MODELVIEW30_ARB */
+ 919, /* GL_MODELVIEW31_ARB */
+ 350, /* GL_DOT3_RGB_EXT */
+ 348, /* GL_DOT3_RGBA_EXT */
+ 890, /* GL_MIRROR_CLAMP_EXT */
+ 893, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ 931, /* GL_MODULATE_ADD_ATI */
+ 932, /* GL_MODULATE_SIGNED_ADD_ATI */
+ 933, /* GL_MODULATE_SUBTRACT_ATI */
+ 1733, /* GL_YCBCR_MESA */
+ 1022, /* GL_PACK_INVERT_MESA */
+ 305, /* GL_DEBUG_OBJECT_MESA */
+ 306, /* GL_DEBUG_PRINT_MESA */
+ 304, /* GL_DEBUG_ASSERT_MESA */
+ 107, /* GL_BUFFER_SIZE */
+ 109, /* GL_BUFFER_USAGE */
+ 1393, /* GL_STENCIL_BACK_FUNC */
+ 1392, /* GL_STENCIL_BACK_FAIL */
+ 1394, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ 1395, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ 484, /* GL_FRAGMENT_PROGRAM_ARB */
+ 1156, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1184, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1183, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1168, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1174, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1173, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 826, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 849, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 848, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 839, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 845, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 844, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 809, /* GL_MAX_DRAW_BUFFERS */
+ 354, /* GL_DRAW_BUFFER0 */
+ 357, /* GL_DRAW_BUFFER1 */
+ 378, /* GL_DRAW_BUFFER2 */
+ 381, /* GL_DRAW_BUFFER3 */
+ 384, /* GL_DRAW_BUFFER4 */
+ 387, /* GL_DRAW_BUFFER5 */
+ 390, /* GL_DRAW_BUFFER6 */
+ 393, /* GL_DRAW_BUFFER7 */
+ 396, /* GL_DRAW_BUFFER8 */
+ 399, /* GL_DRAW_BUFFER9 */
+ 358, /* GL_DRAW_BUFFER10 */
+ 361, /* GL_DRAW_BUFFER11 */
+ 364, /* GL_DRAW_BUFFER12 */
+ 367, /* GL_DRAW_BUFFER13 */
+ 370, /* GL_DRAW_BUFFER14 */
+ 373, /* GL_DRAW_BUFFER15 */
+ 82, /* GL_BLEND_EQUATION_ALPHA */
+ 790, /* GL_MATRIX_PALETTE_ARB */
+ 820, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ 823, /* GL_MAX_PALETTE_MATRICES_ARB */
+ 288, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ 784, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ 283, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ 786, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ 788, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ 787, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ 785, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ 1564, /* GL_TEXTURE_DEPTH_SIZE */
+ 338, /* GL_DEPTH_TEXTURE_MODE */
+ 1530, /* GL_TEXTURE_COMPARE_MODE */
+ 1528, /* GL_TEXTURE_COMPARE_FUNC */
+ 216, /* GL_COMPARE_R_TO_TEXTURE */
+ 1090, /* GL_POINT_SPRITE */
+ 265, /* GL_COORD_REPLACE */
+ 1094, /* GL_POINT_SPRITE_R_MODE_NV */
+ 1209, /* GL_QUERY_COUNTER_BITS */
+ 290, /* GL_CURRENT_QUERY */
+ 1211, /* GL_QUERY_RESULT */
+ 1213, /* GL_QUERY_RESULT_AVAILABLE */
+ 870, /* GL_MAX_VERTEX_ATTRIBS */
+ 1695, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ 336, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ 335, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ 856, /* GL_MAX_TEXTURE_COORDS */
+ 858, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ 1161, /* GL_PROGRAM_ERROR_STRING_ARB */
+ 1163, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ 1162, /* GL_PROGRAM_FORMAT_ARB */
+ 1609, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ 317, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ 316, /* GL_DEPTH_BOUNDS_EXT */
+ 52, /* GL_ARRAY_BUFFER */
+ 419, /* GL_ELEMENT_ARRAY_BUFFER */
+ 54, /* GL_ARRAY_BUFFER_BINDING */
+ 421, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ 1669, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 957, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ 140, /* GL_COLOR_ARRAY_BUFFER_BINDING */
+ 577, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ 1543, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ 415, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ 1318, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ 462, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ 1721, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 1691, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1164, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ 832, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ 1170, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 841, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1182, /* GL_PROGRAM_TEMPORARIES_ARB */
+ 847, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ 1172, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 843, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1176, /* GL_PROGRAM_PARAMETERS_ARB */
+ 846, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ 1171, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 842, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1157, /* GL_PROGRAM_ATTRIBS_ARB */
+ 827, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ 1169, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 840, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1155, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 825, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1167, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 838, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 833, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ 829, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ 1185, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ 1620, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1221, /* GL_READ_ONLY */
+ 1729, /* GL_WRITE_ONLY */
+ 1223, /* GL_READ_WRITE */
+ 101, /* GL_BUFFER_ACCESS */
+ 103, /* GL_BUFFER_MAPPED */
+ 105, /* GL_BUFFER_MAP_POINTER */
+ 1614, /* GL_TIME_ELAPSED_EXT */
+ 744, /* GL_MATRIX0_ARB */
+ 756, /* GL_MATRIX1_ARB */
+ 768, /* GL_MATRIX2_ARB */
+ 772, /* GL_MATRIX3_ARB */
+ 774, /* GL_MATRIX4_ARB */
+ 776, /* GL_MATRIX5_ARB */
+ 778, /* GL_MATRIX6_ARB */
+ 780, /* GL_MATRIX7_ARB */
+ 782, /* GL_MATRIX8_ARB */
+ 783, /* GL_MATRIX9_ARB */
+ 746, /* GL_MATRIX10_ARB */
+ 747, /* GL_MATRIX11_ARB */
+ 748, /* GL_MATRIX12_ARB */
+ 749, /* GL_MATRIX13_ARB */
+ 750, /* GL_MATRIX14_ARB */
+ 751, /* GL_MATRIX15_ARB */
+ 752, /* GL_MATRIX16_ARB */
+ 753, /* GL_MATRIX17_ARB */
+ 754, /* GL_MATRIX18_ARB */
+ 755, /* GL_MATRIX19_ARB */
+ 758, /* GL_MATRIX20_ARB */
+ 759, /* GL_MATRIX21_ARB */
+ 760, /* GL_MATRIX22_ARB */
+ 761, /* GL_MATRIX23_ARB */
+ 762, /* GL_MATRIX24_ARB */
+ 763, /* GL_MATRIX25_ARB */
+ 764, /* GL_MATRIX26_ARB */
+ 765, /* GL_MATRIX27_ARB */
+ 766, /* GL_MATRIX28_ARB */
+ 767, /* GL_MATRIX29_ARB */
+ 770, /* GL_MATRIX30_ARB */
+ 771, /* GL_MATRIX31_ARB */
+ 1420, /* GL_STREAM_DRAW */
+ 1422, /* GL_STREAM_READ */
+ 1418, /* GL_STREAM_COPY */
+ 1386, /* GL_STATIC_DRAW */
+ 1388, /* GL_STATIC_READ */
+ 1384, /* GL_STATIC_COPY */
+ 409, /* GL_DYNAMIC_DRAW */
+ 411, /* GL_DYNAMIC_READ */
+ 407, /* GL_DYNAMIC_COPY */
+ 533, /* GL_GL_PIXEL_PACK_BUFFER */
+ 535, /* GL_GL_PIXEL_UNPACK_BUFFER */
+ 534, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
+ 536, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
+ 830, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ 828, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ 831, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ 835, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ 834, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ 1414, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */
+ 891, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ 1299, /* GL_SAMPLES_PASSED */
+ 485, /* GL_FRAGMENT_SHADER */
+ 1715, /* GL_VERTEX_SHADER */
+ 1175, /* GL_PROGRAM_OBJECT_ARB */
+ 1331, /* GL_SHADER_OBJECT_ARB */
+ 816, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ 874, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ 868, /* GL_MAX_VARYING_FLOATS */
+ 872, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ 801, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ 982, /* GL_OBJECT_TYPE_ARB */
+ 1333, /* GL_SHADER_TYPE */
+ 450, /* GL_FLOAT_VEC2 */
+ 452, /* GL_FLOAT_VEC3 */
+ 454, /* GL_FLOAT_VEC4 */
+ 604, /* GL_INT_VEC2 */
+ 606, /* GL_INT_VEC3 */
+ 608, /* GL_INT_VEC4 */
+ 93, /* GL_BOOL */
+ 95, /* GL_BOOL_VEC2 */
+ 97, /* GL_BOOL_VEC3 */
+ 99, /* GL_BOOL_VEC4 */
+ 444, /* GL_FLOAT_MAT2 */
+ 446, /* GL_FLOAT_MAT3 */
+ 448, /* GL_FLOAT_MAT4 */
+ 1290, /* GL_SAMPLER_1D */
+ 1292, /* GL_SAMPLER_2D */
+ 1294, /* GL_SAMPLER_3D */
+ 1295, /* GL_SAMPLER_CUBE */
+ 1291, /* GL_SAMPLER_1D_SHADOW */
+ 1293, /* GL_SAMPLER_2D_SHADOW */
+ 527, /* GL_GL_FLOAT_MAT2x3 */
+ 528, /* GL_GL_FLOAT_MAT2x4 */
+ 529, /* GL_GL_FLOAT_MAT3x2 */
+ 530, /* GL_GL_FLOAT_MAT3x4 */
+ 531, /* GL_GL_FLOAT_MAT4x2 */
+ 532, /* GL_GL_FLOAT_MAT4x3 */
+ 311, /* GL_DELETE_STATUS */
+ 220, /* GL_COMPILE_STATUS */
+ 657, /* GL_LINK_STATUS */
+ 1664, /* GL_VALIDATE_STATUS */
+ 589, /* GL_INFO_LOG_LENGTH */
+ 56, /* GL_ATTACHED_SHADERS */
+ 20, /* GL_ACTIVE_UNIFORMS */
+ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
+ 1332, /* GL_SHADER_SOURCE_LENGTH */
+ 15, /* GL_ACTIVE_ATTRIBUTES */
+ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
+ 487, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ 1335, /* GL_SHADING_LANGUAGE_VERSION */
+ 289, /* GL_CURRENT_PROGRAM */
+ 1031, /* GL_PALETTE4_RGB8_OES */
+ 1033, /* GL_PALETTE4_RGBA8_OES */
+ 1029, /* GL_PALETTE4_R5_G6_B5_OES */
+ 1032, /* GL_PALETTE4_RGBA4_OES */
+ 1030, /* GL_PALETTE4_RGB5_A1_OES */
+ 1036, /* GL_PALETTE8_RGB8_OES */
+ 1038, /* GL_PALETTE8_RGBA8_OES */
+ 1034, /* GL_PALETTE8_R5_G6_B5_OES */
+ 1037, /* GL_PALETTE8_RGBA4_OES */
+ 1035, /* GL_PALETTE8_RGB5_A1_OES */
+ 572, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ 571, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ 541, /* GL_GL_SRGB */
+ 542, /* GL_GL_SRGB8 */
+ 544, /* GL_GL_SRGB_ALPHA */
+ 543, /* GL_GL_SRGB8_ALPHA8 */
+ 540, /* GL_GL_SLUMINANCE_ALPHA */
+ 539, /* GL_GL_SLUMINANCE8_ALPHA8 */
+ 537, /* GL_GL_SLUMINANCE */
+ 538, /* GL_GL_SLUMINANCE8 */
+ 524, /* GL_GL_COMPRESSED_SRGB */
+ 525, /* GL_GL_COMPRESSED_SRGB_ALPHA */
+ 522, /* GL_GL_COMPRESSED_SLUMINANCE */
+ 523, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
+ 1092, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ 665, /* GL_LOWER_LEFT */
+ 1661, /* GL_UPPER_LEFT */
+ 1396, /* GL_STENCIL_BACK_REF */
+ 1397, /* GL_STENCIL_BACK_VALUE_MASK */
+ 1398, /* GL_STENCIL_BACK_WRITEMASK */
+ 402, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ 1235, /* GL_RENDERBUFFER_BINDING_EXT */
+ 1220, /* GL_READ_FRAMEBUFFER_EXT */
+ 403, /* GL_DRAW_FRAMEBUFFER_EXT */
+ 1219, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ 489, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
+ 488, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
+ 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
+ 491, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
+ 490, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
+ 494, /* GL_FRAMEBUFFER_COMPLETE_EXT */
+ 496, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
+ 501, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
+ 499, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ 497, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ 500, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ 498, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ 502, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ 504, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
+ 503, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ 798, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ 146, /* GL_COLOR_ATTACHMENT0_EXT */
+ 153, /* GL_COLOR_ATTACHMENT1_EXT */
+ 154, /* GL_COLOR_ATTACHMENT2_EXT */
+ 155, /* GL_COLOR_ATTACHMENT3_EXT */
+ 156, /* GL_COLOR_ATTACHMENT4_EXT */
+ 157, /* GL_COLOR_ATTACHMENT5_EXT */
+ 158, /* GL_COLOR_ATTACHMENT6_EXT */
+ 159, /* GL_COLOR_ATTACHMENT7_EXT */
+ 160, /* GL_COLOR_ATTACHMENT8_EXT */
+ 161, /* GL_COLOR_ATTACHMENT9_EXT */
+ 147, /* GL_COLOR_ATTACHMENT10_EXT */
+ 148, /* GL_COLOR_ATTACHMENT11_EXT */
+ 149, /* GL_COLOR_ATTACHMENT12_EXT */
+ 150, /* GL_COLOR_ATTACHMENT13_EXT */
+ 151, /* GL_COLOR_ATTACHMENT14_EXT */
+ 152, /* GL_COLOR_ATTACHMENT15_EXT */
+ 313, /* GL_DEPTH_ATTACHMENT_EXT */
+ 1391, /* GL_STENCIL_ATTACHMENT_EXT */
+ 495, /* GL_FRAMEBUFFER_EXT */
+ 1236, /* GL_RENDERBUFFER_EXT */
+ 1239, /* GL_RENDERBUFFER_WIDTH_EXT */
+ 1237, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ 1238, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ 1409, /* GL_STENCIL_INDEX_EXT */
+ 1406, /* GL_STENCIL_INDEX1_EXT */
+ 1407, /* GL_STENCIL_INDEX4_EXT */
+ 1408, /* GL_STENCIL_INDEX8_EXT */
+ 1405, /* GL_STENCIL_INDEX16_EXT */
+ 427, /* GL_EVAL_BIT */
+ 1217, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ 659, /* GL_LIST_BIT */
+ 1514, /* GL_TEXTURE_BIT */
+ 1314, /* GL_SCISSOR_BIT */
+ 29, /* GL_ALL_ATTRIB_BITS */
+ 938, /* GL_MULTISAMPLE_BIT */
};
#define Elements(x) sizeof(x)/sizeof(*x)
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 5edf9a7dd65..135323f9c15 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -58,6 +58,7 @@ static const struct {
{ OFF, "GL_ARB_point_sprite", F(ARB_point_sprite) },
{ OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) },
{ OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) },
+ { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) },
{ OFF, "GL_ARB_shadow", F(ARB_shadow) },
{ OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) },
{ OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) },
@@ -249,7 +250,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.EXT_secondary_color = GL_TRUE;
ctx->Extensions.EXT_shared_texture_palette = GL_TRUE;
ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
- ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
+ ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */
ctx->Extensions.EXT_texture_env_add = GL_TRUE;
ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
@@ -388,7 +389,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx)
#if FEATURE_ARB_shading_language_100
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
#endif
- ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* yes, turn it off */
+ ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */
#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
#endif
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index b6a59336cb8..cf8de1e0cbe 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -33,6 +33,7 @@
#include "fbobject.h"
#include "framebuffer.h"
#include "hash.h"
+#include "mipmap.h"
#include "renderbuffer.h"
#include "state.h"
#include "teximage.h"
@@ -570,6 +571,12 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+ /* The above doesn't fully flush the drivers in the way that a
+ * glFlush does, but that is required here:
+ */
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx);
+
if (renderbuffer) {
newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
@@ -972,7 +979,9 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
+ if (ctx->Driver.Flush) {
+ ctx->Driver.Flush(ctx);
+ }
if (framebuffer) {
/* Binding a user-created framebuffer object */
newFb = _mesa_lookup_framebuffer(ctx, framebuffer);
@@ -1047,6 +1056,11 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+ /* The above doesn't fully flush the drivers in the way that a
+ * glFlush does, but that is required here:
+ */
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx);
for (i = 0; i < n; i++) {
if (framebuffers[i] > 0) {
@@ -1262,6 +1276,11 @@ framebuffer_texture(GLuint dims, GLenum target, GLenum attachment,
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+ /* The above doesn't fully flush the drivers in the way that a
+ * glFlush does, but that is required here:
+ */
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx);
_glthread_LOCK_MUTEX(fb->Mutex);
if (texObj) {
@@ -1380,6 +1399,11 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+ /* The above doesn't fully flush the drivers in the way that a
+ * glFlush does, but that is required here:
+ */
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx);
assert(ctx->Driver.FramebufferRenderbuffer);
ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb);
@@ -1443,6 +1467,11 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+ /* The above doesn't fully flush the drivers in the way that a
+ * glFlush does, but that is required here:
+ */
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx);
switch (pname) {
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
@@ -1521,7 +1550,9 @@ _mesa_GenerateMipmapEXT(GLenum target)
texObj = _mesa_select_tex_object(ctx, texUnit, target);
/* XXX this might not handle cube maps correctly */
+ _mesa_lock_texture(ctx, texObj);
_mesa_generate_mipmap(ctx, target, texUnit, texObj);
+ _mesa_unlock_texture(ctx, texObj);
}
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index d0dbbbad02b..465197401b7 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -327,9 +327,14 @@ _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb,
fb->Width = width;
fb->Height = height;
- /* to update scissor / window bounds */
- if (ctx)
+ if (ctx) {
+ /* update scissor / window bounds */
_mesa_update_draw_buffer_bounds(ctx);
+ /* Signal new buffer state so that swrast will update its clipping
+ * info (the CLIP_BIT flag).
+ */
+ ctx->NewState |= _NEW_BUFFERS;
+ }
}
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 086785911ee..858c8226592 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -793,7 +793,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedBias);
break;
case GL_RED_BITS:
- params[0] = INT_TO_BOOLEAN( ctx->DrawBuffer->Visual.redBits );
+ params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.redBits);
break;
case GL_RED_SCALE:
params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedScale);
@@ -1833,6 +1833,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
case GL_STENCIL_BACK_VALUE_MASK:
params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[1]);
break;
+ case GL_STENCIL_BACK_WRITEMASK:
+ params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[1]);
+ break;
case GL_STENCIL_BACK_REF:
params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[1]);
break;
@@ -1863,7 +1866,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetBooleanv");
- params[0] = INT_TO_BOOLEAN(MAX_FRAGMENT_UNIFORM_COMPONENTS);
+ params[0] = INT_TO_BOOLEAN(ctx->Const.FragmentProgram.MaxUniformComponents);
break;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetBooleanv");
@@ -1871,15 +1874,15 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
- params[0] = INT_TO_BOOLEAN(MAX_VERTEX_UNIFORM_COMPONENTS);
+ params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxUniformComponents);
break;
case GL_MAX_VARYING_FLOATS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
- params[0] = INT_TO_BOOLEAN(MAX_VARYING_FLOATS);
+ params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVaryingFloats);
break;
case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
- params[0] = INT_TO_BOOLEAN(MAX_VERTEX_TEXTURE_IMAGE_UNITS);
+ params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVertexTextureImageUnits);
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
@@ -2617,7 +2620,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- params[0] = (GLfloat)( ctx->DrawBuffer->Visual.redBits );
+ params[0] = (GLfloat)(ctx->DrawBuffer->Visual.redBits);
break;
case GL_RED_SCALE:
params[0] = ctx->Pixel.RedScale;
@@ -3657,6 +3660,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
case GL_STENCIL_BACK_VALUE_MASK:
params[0] = (GLfloat)(ctx->Stencil.ValueMask[1]);
break;
+ case GL_STENCIL_BACK_WRITEMASK:
+ params[0] = (GLfloat)(ctx->Stencil.WriteMask[1]);
+ break;
case GL_STENCIL_BACK_REF:
params[0] = (GLfloat)(ctx->Stencil.Ref[1]);
break;
@@ -3687,7 +3693,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetFloatv");
- params[0] = (GLfloat)(MAX_FRAGMENT_UNIFORM_COMPONENTS);
+ params[0] = (GLfloat)(ctx->Const.FragmentProgram.MaxUniformComponents);
break;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetFloatv");
@@ -3695,15 +3701,15 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
- params[0] = (GLfloat)(MAX_VERTEX_UNIFORM_COMPONENTS);
+ params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxUniformComponents);
break;
case GL_MAX_VARYING_FLOATS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
- params[0] = (GLfloat)(MAX_VARYING_FLOATS);
+ params[0] = (GLfloat)(ctx->Const.MaxVaryingFloats);
break;
case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
- params[0] = (GLfloat)(MAX_VERTEX_TEXTURE_IMAGE_UNITS);
+ params[0] = (GLfloat)(ctx->Const.MaxVertexTextureImageUnits);
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
@@ -4441,7 +4447,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = IROUND(ctx->Pixel.RedBias);
break;
case GL_RED_BITS:
- params[0] = ctx->DrawBuffer->Visual.redBits ;
+ params[0] = ctx->DrawBuffer->Visual.redBits;
break;
case GL_RED_SCALE:
params[0] = IROUND(ctx->Pixel.RedScale);
@@ -5481,6 +5487,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
case GL_STENCIL_BACK_VALUE_MASK:
params[0] = ctx->Stencil.ValueMask[1];
break;
+ case GL_STENCIL_BACK_WRITEMASK:
+ params[0] = ctx->Stencil.WriteMask[1];
+ break;
case GL_STENCIL_BACK_REF:
params[0] = ctx->Stencil.Ref[1];
break;
@@ -5511,7 +5520,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetIntegerv");
- params[0] = MAX_FRAGMENT_UNIFORM_COMPONENTS;
+ params[0] = ctx->Const.FragmentProgram.MaxUniformComponents;
break;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
CHECK_EXT1(ARB_fragment_shader, "GetIntegerv");
@@ -5519,15 +5528,15 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
- params[0] = MAX_VERTEX_UNIFORM_COMPONENTS;
+ params[0] = ctx->Const.VertexProgram.MaxUniformComponents;
break;
case GL_MAX_VARYING_FLOATS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
- params[0] = MAX_VARYING_FLOATS;
+ params[0] = ctx->Const.MaxVaryingFloats;
break;
case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
- params[0] = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+ params[0] = ctx->Const.MaxVertexTextureImageUnits;
break;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index 4680fea2771..0f2ca00b831 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -385,7 +385,7 @@ StateVars = [
["ctx->ProjectionMatrixStack.Depth + 1"], "", None ),
( "GL_READ_BUFFER", GLenum, ["ctx->ReadBuffer->ColorReadBuffer"], "", None ),
( "GL_RED_BIAS", GLfloat, ["ctx->Pixel.RedBias"], "", None ),
- ( "GL_RED_BITS", GLint, [" ctx->DrawBuffer->Visual.redBits "], "", None ),
+ ( "GL_RED_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,
@@ -958,6 +958,7 @@ StateVars = [
# OpenGL 2.0
( "GL_STENCIL_BACK_FUNC", GLenum, ["ctx->Stencil.Function[1]"], "", None ),
( "GL_STENCIL_BACK_VALUE_MASK", GLint, ["ctx->Stencil.ValueMask[1]"], "", None ),
+ ( "GL_STENCIL_BACK_WRITEMASK", GLint, ["ctx->Stencil.WriteMask[1]"], "", None ),
( "GL_STENCIL_BACK_REF", GLint, ["ctx->Stencil.Ref[1]"], "", None ),
( "GL_STENCIL_BACK_FAIL", GLenum, ["ctx->Stencil.FailFunc[1]"], "", None ),
( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum, ["ctx->Stencil.ZFailFunc[1]"], "", None ),
@@ -978,17 +979,19 @@ StateVars = [
# GL_ARB_fragment_shader
( "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", GLint,
- ["MAX_FRAGMENT_UNIFORM_COMPONENTS"], "", ["ARB_fragment_shader"] ),
+ ["ctx->Const.FragmentProgram.MaxUniformComponents"], "",
+ ["ARB_fragment_shader"] ),
( "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB", GLenum,
["ctx->Hint.FragmentShaderDerivative"], "", ["ARB_fragment_shader"] ),
# GL_ARB_vertex_shader
( "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB", GLint,
- ["MAX_VERTEX_UNIFORM_COMPONENTS"], "", ["ARB_vertex_shader"] ),
+ ["ctx->Const.VertexProgram.MaxUniformComponents"], "",
+ ["ARB_vertex_shader"] ),
( "GL_MAX_VARYING_FLOATS_ARB", GLint,
- ["MAX_VARYING_FLOATS"], "", ["ARB_vertex_shader"] ),
+ ["ctx->Const.MaxVaryingFloats"], "", ["ARB_vertex_shader"] ),
( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint,
- ["MAX_VERTEX_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ),
+ ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ),
( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint,
["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] )
]
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index fba8e1634f4..f033ddc8954 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -54,12 +54,16 @@ _mesa_GetString( GLenum name )
static const char *version_1_3 = "1.3 Mesa " MESA_VERSION_STRING;
static const char *version_1_4 = "1.4 Mesa " MESA_VERSION_STRING;
static const char *version_1_5 = "1.5 Mesa " MESA_VERSION_STRING;
- static const char *version_2_0 = "1.5 Mesa " MESA_VERSION_STRING;/*XXX FIX*/
+ static const char *version_2_0 = "1.5 Mesa " MESA_VERSION_STRING;
+ static const char *version_2_1 = "1.5 Mesa " MESA_VERSION_STRING;
#if FEATURE_ARB_shading_language_100
static const char *sl_version_110 = "1.10 Mesa " MESA_VERSION_STRING;
#endif
+ if (!ctx)
+ return NULL;
+
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);
/* this is a required driver function */
@@ -107,9 +111,18 @@ _mesa_GetString( GLenum name )
ctx->Extensions.EXT_shadow_funcs) {
if (ctx->Extensions.ARB_draw_buffers &&
ctx->Extensions.ARB_point_sprite &&
- ctx->Extensions.ARB_texture_non_power_of_two &&
- ctx->Extensions.EXT_stencil_two_side) {
- return (const GLubyte *) version_2_0;
+ ctx->Extensions.ARB_shader_objects &&
+ ctx->Extensions.ARB_vertex_shader &&
+ ctx->Extensions.ARB_fragment_shader &&
+ ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (ctx->Extensions.ARB_shading_language_120 &&
+ ctx->Extensions.EXT_pixel_buffer_object &&
+ ctx->Extensions.EXT_texture_sRGB) {
+ return (const GLubyte *) version_2_1;
+ }
+ else {
+ return (const GLubyte *) version_2_0;
+ }
}
else {
return (const GLubyte *) version_1_5;
diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c
index 29aced0c7a7..6a7f09489c5 100644
--- a/src/mesa/main/histogram.c
+++ b/src/mesa/main/histogram.c
@@ -748,8 +748,8 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo
minmax[1][GCOMP] = CLAMP(ctx->MinMax.Max[GCOMP], 0.0F, 1.0F);
minmax[1][BCOMP] = CLAMP(ctx->MinMax.Max[BCOMP], 0.0F, 1.0F);
minmax[1][ACOMP] = CLAMP(ctx->MinMax.Max[ACOMP], 0.0F, 1.0F);
- _mesa_pack_rgba_span_float(ctx, 2, (CONST GLfloat (*)[4]) minmax,
- format, type, values, &ctx->Pack, 0);
+ _mesa_pack_rgba_span_float(ctx, 2, minmax,
+ format, type, values, &ctx->Pack, 0x0);
}
if (ctx->Pack.BufferObj->Name) {
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index d86c2203a81..6ff4089f0ea 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -990,7 +990,7 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
* as indicated by the transferOps bitmask
*/
void
-_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLuint transferOps,
+_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps,
GLuint n, GLfloat rgba[][4])
{
/* scale & bias */
@@ -1059,45 +1059,130 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLuint transferOps,
}
+/*
+ * Apply color index shift and offset to an array of pixels.
+ */
+static void
+shift_and_offset_ci( const GLcontext *ctx, GLuint n, GLuint indexes[] )
+{
+ GLint shift = ctx->Pixel.IndexShift;
+ GLint offset = ctx->Pixel.IndexOffset;
+ GLuint i;
+ if (shift > 0) {
+ for (i=0;i<n;i++) {
+ indexes[i] = (indexes[i] << shift) + offset;
+ }
+ }
+ else if (shift < 0) {
+ shift = -shift;
+ for (i=0;i<n;i++) {
+ indexes[i] = (indexes[i] >> shift) + offset;
+ }
+ }
+ else {
+ for (i=0;i<n;i++) {
+ indexes[i] = indexes[i] + offset;
+ }
+ }
+}
+
+
+
+/**
+ * Apply color index shift, offset and table lookup to an array
+ * of color indexes;
+ */
+void
+_mesa_apply_ci_transfer_ops(const GLcontext *ctx, GLbitfield transferOps,
+ GLuint n, GLuint indexes[])
+{
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ shift_and_offset_ci(ctx, n, indexes);
+ }
+ if (transferOps & IMAGE_MAP_COLOR_BIT) {
+ const GLuint mask = ctx->Pixel.MapItoIsize - 1;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ const GLuint j = indexes[i] & mask;
+ indexes[i] = IROUND(ctx->Pixel.MapItoI[j]);
+ }
+ }
+}
+
+
+/**
+ * Apply stencil index shift, offset and table lookup to an array
+ * of stencil values.
+ */
+void
+_mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n,
+ GLstencil stencil[])
+{
+ if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) {
+ const GLint offset = ctx->Pixel.IndexOffset;
+ GLint shift = ctx->Pixel.IndexShift;
+ GLuint i;
+ if (shift > 0) {
+ for (i = 0; i < n; i++) {
+ stencil[i] = (stencil[i] << shift) + offset;
+ }
+ }
+ else if (shift < 0) {
+ shift = -shift;
+ for (i = 0; i < n; i++) {
+ stencil[i] = (stencil[i] >> shift) + offset;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ stencil[i] = stencil[i] + offset;
+ }
+ }
+ }
+ if (ctx->Pixel.MapStencilFlag) {
+ GLuint mask = ctx->Pixel.MapStoSsize - 1;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ stencil[i] = ctx->Pixel.MapStoS[ stencil[i] & mask ];
+ }
+ }
+}
+
/**
* Used to pack an array [][4] of RGBA float colors as specified
* by the dstFormat, dstType and dstPacking. Used by glReadPixels,
* glGetConvolutionFilter(), etc.
- * NOTE: it's assumed the incoming float colors are all in [0,1].
+ * Incoming colors will be clamped to [0,1] if needed.
+ * Note: the rgba values will be modified by this function when any pixel
+ * transfer ops are enabled.
*/
void
-_mesa_pack_rgba_span_float( GLcontext *ctx,
- GLuint n, CONST GLfloat rgbaIn[][4],
- GLenum dstFormat, GLenum dstType,
- GLvoid *dstAddr,
- const struct gl_pixelstore_attrib *dstPacking,
- GLuint transferOps )
+_mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
+ GLenum dstFormat, GLenum dstType,
+ GLvoid *dstAddr,
+ const struct gl_pixelstore_attrib *dstPacking,
+ GLbitfield transferOps)
{
- const GLint comps = _mesa_components_in_format(dstFormat);
GLfloat luminance[MAX_WIDTH];
- const GLfloat (*rgba)[4];
+ const GLint comps = _mesa_components_in_format(dstFormat);
GLuint i;
- if (transferOps) {
- /* make copy of incoming data */
- GLfloat rgbaCopy[MAX_WIDTH][4];
- _mesa_memcpy(rgbaCopy, rgbaIn, n * 4 * sizeof(GLfloat));
- _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgbaCopy);
- rgba = (const GLfloat (*)[4]) rgbaCopy;
+ if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
+ /* need to clamp to [0, 1] */
+ transferOps |= IMAGE_CLAMP_BIT;
+ }
+ if (transferOps) {
+ _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) {
return;
}
}
- else {
- /* use incoming data, not a copy */
- rgba = (const GLfloat (*)[4]) rgbaIn;
- }
if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
/* compute luminance values */
- if (ctx->Color.ClampReadColor == GL_TRUE) {
+ if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
for (i = 0; i < n; i++) {
GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
luminance[i] = CLAMP(sum, 0.0F, 1.0F);
@@ -1992,78 +2077,6 @@ _mesa_pack_rgba_span_float( GLcontext *ctx,
}
-/*
- * Pack the given RGBA span into client memory at 'dest' address
- * in the given pixel format and type.
- * Optionally apply the enabled pixel transfer ops.
- * Pack into memory using the given packing params struct.
- * This is used by glReadPixels and glGetTexImage?D()
- * \param ctx - the context
- * n - number of pixels in the span
- * rgba - the pixels
- * format - dest packing format
- * type - dest packing data type
- * destination - destination packing address
- * packing - pixel packing parameters
- * transferOps - bitmask of IMAGE_*_BIT operations to apply
- */
-void
-_mesa_pack_rgba_span_chan( GLcontext *ctx,
- GLuint n, CONST GLchan srcRgba[][4],
- GLenum dstFormat, GLenum dstType,
- GLvoid *dstAddr,
- const struct gl_pixelstore_attrib *dstPacking,
- GLuint transferOps)
-{
- ASSERT((ctx->NewState & _NEW_PIXEL) == 0 || transferOps == 0);
-
- /* Test for optimized case first */
- if (transferOps == 0 && dstFormat == GL_RGBA && dstType == CHAN_TYPE) {
- /* common simple case */
- _mesa_memcpy(dstAddr, srcRgba, n * 4 * sizeof(GLchan));
- }
- else if (transferOps == 0 && dstFormat == GL_RGB && dstType == CHAN_TYPE) {
- /* common simple case */
- GLuint i;
- GLchan *dest = (GLchan *) dstAddr;
- for (i = 0; i < n; i++) {
- dest[0] = srcRgba[i][RCOMP];
- dest[1] = srcRgba[i][GCOMP];
- dest[2] = srcRgba[i][BCOMP];
- dest += 3;
- }
- }
- else if (transferOps == 0 && dstFormat == GL_RGBA && dstType == GL_UNSIGNED_BYTE) {
- /* common simple case */
- GLuint i;
- GLubyte *dest = (GLubyte *) dstAddr;
- for (i = 0; i < n; i++) {
- dest[0] = CHAN_TO_UBYTE(srcRgba[i][RCOMP]);
- dest[1] = CHAN_TO_UBYTE(srcRgba[i][GCOMP]);
- dest[2] = CHAN_TO_UBYTE(srcRgba[i][BCOMP]);
- dest[3] = CHAN_TO_UBYTE(srcRgba[i][ACOMP]);
- dest += 4;
- }
- }
- else {
- /* general solution */
- GLuint i;
- GLfloat rgba[MAX_WIDTH][4];
- assert(n <= MAX_WIDTH);
- /* convert color components to floating point */
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = CHAN_TO_FLOAT(srcRgba[i][RCOMP]);
- rgba[i][GCOMP] = CHAN_TO_FLOAT(srcRgba[i][GCOMP]);
- rgba[i][BCOMP] = CHAN_TO_FLOAT(srcRgba[i][BCOMP]);
- rgba[i][ACOMP] = CHAN_TO_FLOAT(srcRgba[i][ACOMP]);
- }
- _mesa_pack_rgba_span_float(ctx, n, (const GLfloat (*)[4]) rgba,
- dstFormat, dstType, dstAddr,
- dstPacking, transferOps);
- }
-}
-
-
#define SWAP2BYTE(VALUE) \
{ \
GLubyte *bytes = (GLubyte *) &(VALUE); \
@@ -2089,7 +2102,7 @@ extract_uint_indexes(GLuint n, GLuint indexes[],
GLenum srcFormat, GLenum srcType, const GLvoid *src,
const struct gl_pixelstore_attrib *unpack )
{
- assert(srcFormat == GL_COLOR_INDEX);
+ ASSERT(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX);
ASSERT(srcType == GL_BITMAP ||
srcType == GL_UNSIGNED_BYTE ||
@@ -2820,7 +2833,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx,
GLenum srcFormat, GLenum srcType,
const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps )
+ GLbitfield transferOps )
{
ASSERT(dstFormat == GL_ALPHA ||
dstFormat == GL_LUMINANCE ||
@@ -3002,17 +3015,10 @@ _mesa_unpack_color_span_chan( GLcontext *ctx,
extract_uint_indexes(n, indexes, srcFormat, srcType, source,
srcPacking);
- if (dstFormat == GL_COLOR_INDEX
- && (transferOps & IMAGE_MAP_COLOR_BIT)) {
- _mesa_map_ci(ctx, n, indexes);
- }
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- _mesa_shift_and_offset_ci(ctx, n, indexes);
- }
-
if (dstFormat == GL_COLOR_INDEX) {
- /* convert to GLchan and return */
GLuint i;
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
+ /* convert to GLchan and return */
for (i = 0; i < n; i++) {
dest[i] = (GLchan) (indexes[i] & 0xff);
}
@@ -3020,6 +3026,9 @@ _mesa_unpack_color_span_chan( GLcontext *ctx,
}
else {
/* Convert indexes to RGBA */
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ shift_and_offset_ci(ctx, n, indexes);
+ }
_mesa_map_ci_to_rgba(ctx, n, indexes, rgba);
}
@@ -3160,7 +3169,7 @@ _mesa_unpack_color_span_float( GLcontext *ctx,
GLenum srcFormat, GLenum srcType,
const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps )
+ GLbitfield transferOps )
{
ASSERT(dstFormat == GL_ALPHA ||
dstFormat == GL_LUMINANCE ||
@@ -3226,17 +3235,10 @@ _mesa_unpack_color_span_float( GLcontext *ctx,
extract_uint_indexes(n, indexes, srcFormat, srcType, source,
srcPacking);
- if (dstFormat == GL_COLOR_INDEX
- && (transferOps & IMAGE_MAP_COLOR_BIT)) {
- _mesa_map_ci(ctx, n, indexes);
- }
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- _mesa_shift_and_offset_ci(ctx, n, indexes);
- }
-
if (dstFormat == GL_COLOR_INDEX) {
- /* convert to GLchan and return */
GLuint i;
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
+ /* convert to GLchan and return */
for (i = 0; i < n; i++) {
dest[i] = (GLchan) (indexes[i] & 0xff);
}
@@ -3244,6 +3246,9 @@ _mesa_unpack_color_span_float( GLcontext *ctx,
}
else {
/* Convert indexes to RGBA */
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ shift_and_offset_ci(ctx, n, indexes);
+ }
_mesa_map_ci_to_rgba(ctx, n, indexes, rgba);
}
@@ -3386,7 +3391,7 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n,
GLenum dstType, GLvoid *dest,
GLenum srcType, const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps )
+ GLbitfield transferOps )
{
ASSERT(srcType == GL_BITMAP ||
srcType == GL_UNSIGNED_BYTE ||
@@ -3426,14 +3431,8 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n,
extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source,
srcPacking);
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- /* shift and offset indexes */
- _mesa_shift_and_offset_ci(ctx, n, indexes);
- }
- if (transferOps & IMAGE_MAP_COLOR_BIT) {
- /* Apply lookup table */
- _mesa_map_ci(ctx, n, indexes);
- }
+ if (transferOps)
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
/* convert to dest type */
switch (dstType) {
@@ -3469,7 +3468,7 @@ void
_mesa_pack_index_span( const GLcontext *ctx, GLuint n,
GLenum dstType, GLvoid *dest, const GLuint *source,
const struct gl_pixelstore_attrib *dstPacking,
- GLuint transferOps )
+ GLbitfield transferOps )
{
GLuint indexes[MAX_WIDTH];
@@ -3480,12 +3479,7 @@ _mesa_pack_index_span( const GLcontext *ctx, GLuint n,
if (transferOps & (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT)) {
/* make a copy of input */
_mesa_memcpy(indexes, source, n * sizeof(GLuint));
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- _mesa_shift_and_offset_ci( ctx, n, indexes);
- }
- if (transferOps & IMAGE_MAP_COLOR_BIT) {
- _mesa_map_ci(ctx, n, indexes);
- }
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
source = indexes;
}
@@ -3605,7 +3599,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
GLenum dstType, GLvoid *dest,
GLenum srcType, const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps )
+ GLbitfield transferOps )
{
ASSERT(srcType == GL_BITMAP ||
srcType == GL_UNSIGNED_BYTE ||
@@ -3646,13 +3640,13 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
GLuint indexes[MAX_WIDTH];
assert(n <= MAX_WIDTH);
- extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source,
+ extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source,
srcPacking);
if (transferOps) {
if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
/* shift and offset indexes */
- _mesa_shift_and_offset_ci(ctx, n, indexes);
+ shift_and_offset_ci(ctx, n, indexes);
}
if (ctx->Pixel.MapStencilFlag) {
@@ -3708,12 +3702,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
ctx->Pixel.MapStencilFlag) {
/* make a copy of input */
_mesa_memcpy(stencil, source, n * sizeof(GLstencil));
- if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) {
- _mesa_shift_and_offset_stencil( ctx, n, stencil );
- }
- if (ctx->Pixel.MapStencilFlag) {
- _mesa_map_stencil( ctx, n, stencil );
- }
+ _mesa_apply_stencil_transfer_ops(ctx, n, stencil);
source = stencil;
}
@@ -4142,15 +4131,11 @@ _mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest,
depthVals = depthCopy;
}
- if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) {
+ if (ctx->Pixel.IndexShift ||
+ ctx->Pixel.IndexOffset ||
+ ctx->Pixel.MapStencilFlag) {
_mesa_memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil));
- _mesa_shift_and_offset_stencil(ctx, n, stencilCopy);
- stencilVals = stencilCopy;
- }
- if (ctx->Pixel.MapStencilFlag) {
- if (stencilVals != stencilCopy)
- _mesa_memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil));
- _mesa_map_stencil(ctx, n, stencilCopy);
+ _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy);
stencilVals = stencilCopy;
}
@@ -4188,7 +4173,7 @@ _mesa_unpack_image( GLuint dimensions,
if (width <= 0 || height <= 0 || depth <= 0)
return NULL; /* generate error later */
- if (format == GL_BITMAP) {
+ if (type == GL_BITMAP) {
bytesPerRow = (width + 7) >> 3;
flipBytes = !unpack->LsbFirst;
swap2 = swap4 = GL_FALSE;
@@ -4243,11 +4228,136 @@ _mesa_unpack_image( GLuint dimensions,
#endif /* _HAVE_FULL_GL */
+
/**
- * Perform clipping for glDrawPixels. The image's window position
- * and size, and the unpack SkipPixels and SkipRows are adjusted so
- * that the image region is entirely within the window and scissor bounds.
- * NOTE: this will only work when glPixelZoom is (1, 1).
+ * Convert an array of RGBA colors from one datatype to another.
+ * NOTE: src may equal dst. In that case, we use a temporary buffer.
+ */
+void
+_mesa_convert_colors(GLenum srcType, const GLvoid *src,
+ GLenum dstType, GLvoid *dst,
+ GLuint count, const GLubyte mask[])
+{
+ GLuint tempBuffer[MAX_WIDTH][4];
+ const GLboolean useTemp = (src == dst);
+
+ ASSERT(srcType != dstType);
+
+ switch (srcType) {
+ case GL_UNSIGNED_BYTE:
+ if (dstType == GL_UNSIGNED_SHORT) {
+ const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src;
+ GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst);
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst2[i][RCOMP] = UBYTE_TO_USHORT(src1[i][RCOMP]);
+ dst2[i][GCOMP] = UBYTE_TO_USHORT(src1[i][GCOMP]);
+ dst2[i][BCOMP] = UBYTE_TO_USHORT(src1[i][BCOMP]);
+ dst2[i][ACOMP] = UBYTE_TO_USHORT(src1[i][ACOMP]);
+ }
+ }
+ if (useTemp)
+ _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort));
+ }
+ else {
+ const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src;
+ GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst);
+ GLuint i;
+ ASSERT(dstType == GL_FLOAT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst4[i][RCOMP] = UBYTE_TO_FLOAT(src1[i][RCOMP]);
+ dst4[i][GCOMP] = UBYTE_TO_FLOAT(src1[i][GCOMP]);
+ dst4[i][BCOMP] = UBYTE_TO_FLOAT(src1[i][BCOMP]);
+ dst4[i][ACOMP] = UBYTE_TO_FLOAT(src1[i][ACOMP]);
+ }
+ }
+ if (useTemp)
+ _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat));
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ if (dstType == GL_UNSIGNED_BYTE) {
+ const GLushort (*src2)[4] = (const GLushort (*)[4]) src;
+ GLubyte (*dst1)[4] = (GLubyte (*)[4]) (useTemp ? tempBuffer : dst);
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst1[i][RCOMP] = USHORT_TO_UBYTE(src2[i][RCOMP]);
+ dst1[i][GCOMP] = USHORT_TO_UBYTE(src2[i][GCOMP]);
+ dst1[i][BCOMP] = USHORT_TO_UBYTE(src2[i][BCOMP]);
+ dst1[i][ACOMP] = USHORT_TO_UBYTE(src2[i][ACOMP]);
+ }
+ }
+ if (useTemp)
+ _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte));
+ }
+ else {
+ const GLushort (*src2)[4] = (const GLushort (*)[4]) src;
+ GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst);
+ GLuint i;
+ ASSERT(dstType == GL_FLOAT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst4[i][RCOMP] = USHORT_TO_FLOAT(src2[i][RCOMP]);
+ dst4[i][GCOMP] = USHORT_TO_FLOAT(src2[i][GCOMP]);
+ dst4[i][BCOMP] = USHORT_TO_FLOAT(src2[i][BCOMP]);
+ dst4[i][ACOMP] = USHORT_TO_FLOAT(src2[i][ACOMP]);
+ }
+ }
+ if (useTemp)
+ _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat));
+ }
+ break;
+ case GL_FLOAT:
+ if (dstType == GL_UNSIGNED_BYTE) {
+ const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src;
+ GLubyte (*dst1)[4] = (GLubyte (*)[4]) (useTemp ? tempBuffer : dst);
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][RCOMP], src4[i][RCOMP]);
+ UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][GCOMP], src4[i][GCOMP]);
+ UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][BCOMP], src4[i][BCOMP]);
+ UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][ACOMP], src4[i][ACOMP]);
+ }
+ }
+ if (useTemp)
+ _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte));
+ }
+ else {
+ const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src;
+ GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst);
+ GLuint i;
+ ASSERT(dstType == GL_UNSIGNED_SHORT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ UNCLAMPED_FLOAT_TO_USHORT(dst2[i][RCOMP], src4[i][RCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(dst2[i][GCOMP], src4[i][GCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(dst2[i][BCOMP], src4[i][BCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(dst2[i][ACOMP], src4[i][ACOMP]);
+ }
+ }
+ if (useTemp)
+ _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort));
+ }
+ break;
+ default:
+ _mesa_problem(NULL, "Invalid datatype in _mesa_convert_colors");
+ }
+}
+
+
+
+
+/**
+ * Perform basic clipping for glDrawPixels. The image's position and size
+ * and the unpack SkipPixels and SkipRows are adjusted so that the image
+ * region is entirely within the window and scissor bounds.
+ * NOTE: this will only work when glPixelZoom is (1, 1) or (1, -1).
+ * If Pixel.ZoomY is -1, *destY will be changed to be the first row which
+ * we'll actually write. Beforehand, *destY-1 is the first drawing row.
*
* \return GL_TRUE if image is ready for drawing or
* GL_FALSE if image was completely clipped away (draw nothing)
@@ -4264,7 +4374,8 @@ _mesa_clip_drawpixels(const GLcontext *ctx,
unpack->RowLength = *width;
}
- ASSERT(ctx->Pixel.ZoomX == 1.0F && ctx->Pixel.ZoomY == 1.0F);
+ ASSERT(ctx->Pixel.ZoomX == 1.0F);
+ ASSERT(ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F);
/* left clipping */
if (*destX < buffer->_Xmin) {
@@ -4279,15 +4390,30 @@ _mesa_clip_drawpixels(const GLcontext *ctx,
if (*width <= 0)
return GL_FALSE;
- /* bottom clipping */
- if (*destY < buffer->_Ymin) {
- unpack->SkipRows += (buffer->_Ymin - *destY);
- *height -= (buffer->_Ymin - *destY);
- *destY = buffer->_Ymin;
+ if (ctx->Pixel.ZoomY == 1.0F) {
+ /* bottom clipping */
+ if (*destY < buffer->_Ymin) {
+ unpack->SkipRows += (buffer->_Ymin - *destY);
+ *height -= (buffer->_Ymin - *destY);
+ *destY = buffer->_Ymin;
+ }
+ /* top clipping */
+ if (*destY + *height > buffer->_Ymax)
+ *height -= (*destY + *height - buffer->_Ymax);
+ }
+ else { /* upside down */
+ /* top clipping */
+ if (*destY > buffer->_Ymax) {
+ unpack->SkipRows += (*destY - buffer->_Ymax);
+ *height -= (*destY - buffer->_Ymax);
+ *destY = buffer->_Ymax;
+ }
+ /* bottom clipping */
+ if (*destY - *height < buffer->_Ymin)
+ *height -= (buffer->_Ymin - (*destY - *height));
+ /* adjust destY so it's the first row to write to */
+ (*destY)--;
}
- /* top clipping */
- if (*destY + *height > buffer->_Ymax)
- *height -= (*destY + *height - buffer->_Ymax);
if (*height <= 0)
return GL_TRUE;
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 84faa03255e..990398a7c45 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -112,23 +112,25 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
extern void
-_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLuint transferOps,
+_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps,
GLuint n, GLfloat rgba[][4]);
+
extern void
-_mesa_pack_rgba_span_float( GLcontext *ctx,
- GLuint n, CONST GLfloat rgba[][4],
- GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
- const struct gl_pixelstore_attrib *dstPacking,
- GLuint transferOps );
+_mesa_apply_ci_transfer_ops(const GLcontext *ctx, GLbitfield transferOps,
+ GLuint n, GLuint indexes[]);
extern void
-_mesa_pack_rgba_span_chan( GLcontext *ctx,
- GLuint n, CONST GLchan rgba[][4],
- GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
- const struct gl_pixelstore_attrib *dstPacking,
- GLuint transferOps );
+_mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n,
+ GLstencil stencil[]);
+
+
+extern void
+_mesa_pack_rgba_span_float( GLcontext *ctx, GLuint n, GLfloat rgba[][4],
+ GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
+ const struct gl_pixelstore_attrib *dstPacking,
+ GLbitfield transferOps );
extern void
@@ -137,7 +139,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx,
GLenum srcFormat, GLenum srcType,
const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps );
+ GLbitfield transferOps );
extern void
@@ -146,7 +148,7 @@ _mesa_unpack_color_span_float( GLcontext *ctx,
GLenum srcFormat, GLenum srcType,
const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps );
+ GLbitfield transferOps );
extern void
@@ -154,14 +156,14 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n,
GLenum dstType, GLvoid *dest,
GLenum srcType, const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps );
+ GLbitfield transferOps );
extern void
_mesa_pack_index_span( const GLcontext *ctx, GLuint n,
GLenum dstType, GLvoid *dest, const GLuint *source,
const struct gl_pixelstore_attrib *dstPacking,
- GLuint transferOps );
+ GLbitfield transferOps );
extern void
@@ -169,7 +171,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
GLenum dstType, GLvoid *dest,
GLenum srcType, const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
- GLuint transferOps );
+ GLbitfield transferOps );
extern void
_mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
@@ -203,6 +205,12 @@ _mesa_unpack_image( GLuint dimensions,
const struct gl_pixelstore_attrib *unpack );
+extern void
+_mesa_convert_colors(GLenum srcType, const GLvoid *src,
+ GLenum dstType, GLvoid *dst,
+ GLuint count, const GLubyte mask[]);
+
+
extern GLboolean
_mesa_clip_drawpixels(const GLcontext *ctx,
GLint *destX, GLint *destY,
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index a17a0fd18ca..dad2767e72d 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -55,6 +55,15 @@ extern "C" {
#define NULL 0
#endif
+
+/** gcc -pedantic warns about long string literals, LONGSTRING silences that */
+#if !defined(__GNUC__) || (__GNUC__ < 2) || \
+ ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7))
+# define LONGSTRING
+#else
+# define LONGSTRING __extension__
+#endif
+
/*@}*/
@@ -604,6 +613,17 @@ do { \
#endif
+/**
+ * Return 1 if this is a little endian machine, 0 if big endian.
+ */
+static INLINE GLboolean
+_mesa_little_endian(void)
+{
+ const GLuint ui = 1; /* intentionally not static */
+ return *((const GLubyte *) &ui);
+}
+
+
/**********************************************************************
* Functions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 63f88b7229f..984f7b2abc4 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1340,6 +1340,7 @@ _mesa_init_lighting( GLcontext *ctx )
NULL );
ctx->Light.ColorMaterialEnabled = GL_FALSE;
+ ctx->Light.ClampVertexColor = GL_TRUE;
/* Lighting miscellaneous */
ctx->_ShineTabList = MALLOC_STRUCT( gl_shine_tab );
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 672a2f8bd2f..fbbcd4e269e 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -511,7 +511,18 @@ do { \
(DST)[1] += S; \
} while (0)
+/** Assign scalers to short vectors */
+#define ASSIGN_2V( V, V0, V1 ) \
+do { \
+ V[0] = V0; \
+ V[1] = V1; \
+} while(0)
+
+/*@}*/
+
+/** \name Linear interpolation macros */
+/*@{*/
/**
* Linear interpolation
@@ -585,15 +596,6 @@ do { \
} \
} while(0)
-
-
-/** Assign scalers to short vectors */
-#define ASSIGN_2V( V, V0, V1 ) \
-do { \
- V[0] = V0; \
- V[1] = V1; \
-} while(0)
-
/*@}*/
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
new file mode 100644
index 00000000000..f154bd46513
--- /dev/null
+++ b/src/mesa/main/mipmap.c
@@ -0,0 +1,1147 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file mipmap.c mipmap generation and teximage resizing functions.
+ */
+
+#include "imports.h"
+#include "mipmap.h"
+#include "texcompress.h"
+#include "texformat.h"
+#include "teximage.h"
+#include "image.h"
+
+
+
+/**
+ * Average together two rows of a source image to produce a single new
+ * row in the dest image. It's legal for the two source rows to point
+ * to the same data. The source width must be equal to either the
+ * dest width or two times the dest width.
+ */
+static void
+do_row(const struct gl_texture_format *format, GLint srcWidth,
+ const GLvoid *srcRowA, const GLvoid *srcRowB,
+ GLint dstWidth, GLvoid *dstRow)
+{
+ const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1;
+ const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2;
+
+ /* This assertion is no longer valid with non-power-of-2 textures
+ assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth);
+ */
+
+ switch (format->MesaFormat) {
+ case MESA_FORMAT_RGBA:
+ {
+ GLuint i, j, k;
+ const GLchan (*rowA)[4] = (const GLchan (*)[4]) srcRowA;
+ const GLchan (*rowB)[4] = (const GLchan (*)[4]) srcRowB;
+ GLchan (*dst)[4] = (GLchan (*)[4]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) / 4;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) / 4;
+ dst[i][2] = (rowA[j][2] + rowA[k][2] +
+ rowB[j][2] + rowB[k][2]) / 4;
+ dst[i][3] = (rowA[j][3] + rowA[k][3] +
+ rowB[j][3] + rowB[k][3]) / 4;
+ }
+ }
+ return;
+ case MESA_FORMAT_RGB:
+ {
+ GLuint i, j, k;
+ const GLchan (*rowA)[3] = (const GLchan (*)[3]) srcRowA;
+ const GLchan (*rowB)[3] = (const GLchan (*)[3]) srcRowB;
+ GLchan (*dst)[3] = (GLchan (*)[3]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) / 4;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) / 4;
+ dst[i][2] = (rowA[j][2] + rowA[k][2] +
+ rowB[j][2] + rowB[k][2]) / 4;
+ }
+ }
+ return;
+ case MESA_FORMAT_ALPHA:
+ case MESA_FORMAT_LUMINANCE:
+ case MESA_FORMAT_INTENSITY:
+ {
+ GLuint i, j, k;
+ const GLchan *rowA = (const GLchan *) srcRowA;
+ const GLchan *rowB = (const GLchan *) srcRowB;
+ GLchan *dst = (GLchan *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
+ }
+ }
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA:
+ {
+ GLuint i, j, k;
+ const GLchan (*rowA)[2] = (const GLchan (*)[2]) srcRowA;
+ const GLchan (*rowB)[2] = (const GLchan (*)[2]) srcRowB;
+ GLchan (*dst)[2] = (GLchan (*)[2]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) / 4;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) / 4;
+ }
+ }
+ return;
+ case MESA_FORMAT_Z32:
+ {
+ GLuint i, j, k;
+ const GLuint *rowA = (const GLuint *) srcRowA;
+ const GLuint *rowB = (const GLuint *) srcRowB;
+ GLfloat *dst = (GLfloat *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i] = rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4;
+ }
+ }
+ return;
+ case MESA_FORMAT_Z16:
+ {
+ GLuint i, j, k;
+ const GLushort *rowA = (const GLushort *) srcRowA;
+ const GLushort *rowB = (const GLushort *) srcRowB;
+ GLushort *dst = (GLushort *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
+ }
+ }
+ return;
+ /* Begin hardware formats */
+ case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_ARGB8888_REV:
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SRGBA8:
+#endif
+ {
+ GLuint i, j, k;
+ const GLubyte (*rowA)[4] = (const GLubyte (*)[4]) srcRowA;
+ const GLubyte (*rowB)[4] = (const GLubyte (*)[4]) srcRowB;
+ GLubyte (*dst)[4] = (GLubyte (*)[4]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) / 4;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) / 4;
+ dst[i][2] = (rowA[j][2] + rowA[k][2] +
+ rowB[j][2] + rowB[k][2]) / 4;
+ dst[i][3] = (rowA[j][3] + rowA[k][3] +
+ rowB[j][3] + rowB[k][3]) / 4;
+ }
+ }
+ return;
+ case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR888:
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SRGB8:
+#endif
+ {
+ GLuint i, j, k;
+ const GLubyte (*rowA)[3] = (const GLubyte (*)[3]) srcRowA;
+ const GLubyte (*rowB)[3] = (const GLubyte (*)[3]) srcRowB;
+ GLubyte (*dst)[3] = (GLubyte (*)[3]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) / 4;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) / 4;
+ dst[i][2] = (rowA[j][2] + rowA[k][2] +
+ rowB[j][2] + rowB[k][2]) / 4;
+ }
+ }
+ return;
+ case MESA_FORMAT_RGB565:
+ case MESA_FORMAT_RGB565_REV:
+ {
+ GLuint i, j, k;
+ const GLushort *rowA = (const GLushort *) srcRowA;
+ const GLushort *rowB = (const GLushort *) srcRowB;
+ GLushort *dst = (GLushort *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ const GLint rowAr0 = rowA[j] & 0x1f;
+ const GLint rowAr1 = rowA[k] & 0x1f;
+ const GLint rowBr0 = rowB[j] & 0x1f;
+ const GLint rowBr1 = rowB[k] & 0x1f;
+ const GLint rowAg0 = (rowA[j] >> 5) & 0x3f;
+ const GLint rowAg1 = (rowA[k] >> 5) & 0x3f;
+ const GLint rowBg0 = (rowB[j] >> 5) & 0x3f;
+ const GLint rowBg1 = (rowB[k] >> 5) & 0x3f;
+ const GLint rowAb0 = (rowA[j] >> 11) & 0x1f;
+ const GLint rowAb1 = (rowA[k] >> 11) & 0x1f;
+ const GLint rowBb0 = (rowB[j] >> 11) & 0x1f;
+ const GLint rowBb1 = (rowB[k] >> 11) & 0x1f;
+ const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
+ const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
+ const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
+ dst[i] = (blue << 11) | (green << 5) | red;
+ }
+ }
+ return;
+ case MESA_FORMAT_ARGB4444:
+ case MESA_FORMAT_ARGB4444_REV:
+ {
+ GLuint i, j, k;
+ const GLushort *rowA = (const GLushort *) srcRowA;
+ const GLushort *rowB = (const GLushort *) srcRowB;
+ GLushort *dst = (GLushort *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ const GLint rowAr0 = rowA[j] & 0xf;
+ const GLint rowAr1 = rowA[k] & 0xf;
+ const GLint rowBr0 = rowB[j] & 0xf;
+ const GLint rowBr1 = rowB[k] & 0xf;
+ const GLint rowAg0 = (rowA[j] >> 4) & 0xf;
+ const GLint rowAg1 = (rowA[k] >> 4) & 0xf;
+ const GLint rowBg0 = (rowB[j] >> 4) & 0xf;
+ const GLint rowBg1 = (rowB[k] >> 4) & 0xf;
+ const GLint rowAb0 = (rowA[j] >> 8) & 0xf;
+ const GLint rowAb1 = (rowA[k] >> 8) & 0xf;
+ const GLint rowBb0 = (rowB[j] >> 8) & 0xf;
+ const GLint rowBb1 = (rowB[k] >> 8) & 0xf;
+ const GLint rowAa0 = (rowA[j] >> 12) & 0xf;
+ const GLint rowAa1 = (rowA[k] >> 12) & 0xf;
+ const GLint rowBa0 = (rowB[j] >> 12) & 0xf;
+ const GLint rowBa1 = (rowB[k] >> 12) & 0xf;
+ const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
+ const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
+ const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
+ const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2;
+ dst[i] = (alpha << 12) | (blue << 8) | (green << 4) | red;
+ }
+ }
+ return;
+ case MESA_FORMAT_ARGB1555:
+ case MESA_FORMAT_ARGB1555_REV: /* XXX broken? */
+ {
+ GLuint i, j, k;
+ const GLushort *rowA = (const GLushort *) srcRowA;
+ const GLushort *rowB = (const GLushort *) srcRowB;
+ GLushort *dst = (GLushort *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ const GLint rowAr0 = rowA[j] & 0x1f;
+ const GLint rowAr1 = rowA[k] & 0x1f;
+ const GLint rowBr0 = rowB[j] & 0x1f;
+ const GLint rowBr1 = rowB[k] & 0xf;
+ const GLint rowAg0 = (rowA[j] >> 5) & 0x1f;
+ const GLint rowAg1 = (rowA[k] >> 5) & 0x1f;
+ const GLint rowBg0 = (rowB[j] >> 5) & 0x1f;
+ const GLint rowBg1 = (rowB[k] >> 5) & 0x1f;
+ const GLint rowAb0 = (rowA[j] >> 10) & 0x1f;
+ const GLint rowAb1 = (rowA[k] >> 10) & 0x1f;
+ const GLint rowBb0 = (rowB[j] >> 10) & 0x1f;
+ const GLint rowBb1 = (rowB[k] >> 10) & 0x1f;
+ const GLint rowAa0 = (rowA[j] >> 15) & 0x1;
+ const GLint rowAa1 = (rowA[k] >> 15) & 0x1;
+ const GLint rowBa0 = (rowB[j] >> 15) & 0x1;
+ const GLint rowBa1 = (rowB[k] >> 15) & 0x1;
+ const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
+ const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
+ const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
+ const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2;
+ dst[i] = (alpha << 15) | (blue << 10) | (green << 5) | red;
+ }
+ }
+ return;
+ case MESA_FORMAT_AL88:
+ case MESA_FORMAT_AL88_REV:
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SLA8:
+#endif
+ {
+ GLuint i, j, k;
+ const GLubyte (*rowA)[2] = (const GLubyte (*)[2]) srcRowA;
+ const GLubyte (*rowB)[2] = (const GLubyte (*)[2]) srcRowB;
+ GLubyte (*dst)[2] = (GLubyte (*)[2]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) >> 2;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) >> 2;
+ }
+ }
+ return;
+ case MESA_FORMAT_RGB332:
+ {
+ GLuint i, j, k;
+ const GLubyte *rowA = (const GLubyte *) srcRowA;
+ const GLubyte *rowB = (const GLubyte *) srcRowB;
+ GLubyte *dst = (GLubyte *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ const GLint rowAr0 = rowA[j] & 0x3;
+ const GLint rowAr1 = rowA[k] & 0x3;
+ const GLint rowBr0 = rowB[j] & 0x3;
+ const GLint rowBr1 = rowB[k] & 0x3;
+ const GLint rowAg0 = (rowA[j] >> 2) & 0x7;
+ const GLint rowAg1 = (rowA[k] >> 2) & 0x7;
+ const GLint rowBg0 = (rowB[j] >> 2) & 0x7;
+ const GLint rowBg1 = (rowB[k] >> 2) & 0x7;
+ const GLint rowAb0 = (rowA[j] >> 5) & 0x7;
+ const GLint rowAb1 = (rowA[k] >> 5) & 0x7;
+ const GLint rowBb0 = (rowB[j] >> 5) & 0x7;
+ const GLint rowBb1 = (rowB[k] >> 5) & 0x7;
+ const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
+ const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
+ const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
+ dst[i] = (blue << 5) | (green << 2) | red;
+ }
+ }
+ return;
+ case MESA_FORMAT_A8:
+ case MESA_FORMAT_L8:
+ case MESA_FORMAT_I8:
+ case MESA_FORMAT_CI8:
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SL8:
+#endif
+ {
+ GLuint i, j, k;
+ const GLubyte *rowA = (const GLubyte *) srcRowA;
+ const GLubyte *rowB = (const GLubyte *) srcRowB;
+ GLubyte *dst = (GLubyte *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) >> 2;
+ }
+ }
+ return;
+ case MESA_FORMAT_RGBA_FLOAT32:
+ {
+ GLuint i, j, k;
+ const GLfloat (*rowA)[4] = (const GLfloat (*)[4]) srcRowA;
+ const GLfloat (*rowB)[4] = (const GLfloat (*)[4]) srcRowB;
+ GLfloat (*dst)[4] = (GLfloat (*)[4]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) * 0.25F;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) * 0.25F;
+ dst[i][2] = (rowA[j][2] + rowA[k][2] +
+ rowB[j][2] + rowB[k][2]) * 0.25F;
+ dst[i][3] = (rowA[j][3] + rowA[k][3] +
+ rowB[j][3] + rowB[k][3]) * 0.25F;
+ }
+ }
+ return;
+ case MESA_FORMAT_RGBA_FLOAT16:
+ {
+ GLuint i, j, k, comp;
+ const GLhalfARB (*rowA)[4] = (const GLhalfARB (*)[4]) srcRowA;
+ const GLhalfARB (*rowB)[4] = (const GLhalfARB (*)[4]) srcRowB;
+ GLhalfARB (*dst)[4] = (GLhalfARB (*)[4]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ for (comp = 0; comp < 4; comp++) {
+ GLfloat aj, ak, bj, bk;
+ aj = _mesa_half_to_float(rowA[j][comp]);
+ ak = _mesa_half_to_float(rowA[k][comp]);
+ bj = _mesa_half_to_float(rowB[j][comp]);
+ bk = _mesa_half_to_float(rowB[k][comp]);
+ dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
+ }
+ }
+ }
+ return;
+ case MESA_FORMAT_RGB_FLOAT32:
+ {
+ GLuint i, j, k;
+ const GLfloat (*rowA)[3] = (const GLfloat (*)[3]) srcRowA;
+ const GLfloat (*rowB)[3] = (const GLfloat (*)[3]) srcRowB;
+ GLfloat (*dst)[3] = (GLfloat (*)[3]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) * 0.25F;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) * 0.25F;
+ dst[i][2] = (rowA[j][2] + rowA[k][2] +
+ rowB[j][2] + rowB[k][2]) * 0.25F;
+ }
+ }
+ return;
+ case MESA_FORMAT_RGB_FLOAT16:
+ {
+ GLuint i, j, k, comp;
+ const GLhalfARB (*rowA)[3] = (const GLhalfARB (*)[3]) srcRowA;
+ const GLhalfARB (*rowB)[3] = (const GLhalfARB (*)[3]) srcRowB;
+ GLhalfARB (*dst)[3] = (GLhalfARB (*)[3]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ for (comp = 0; comp < 3; comp++) {
+ GLfloat aj, ak, bj, bk;
+ aj = _mesa_half_to_float(rowA[j][comp]);
+ ak = _mesa_half_to_float(rowA[k][comp]);
+ bj = _mesa_half_to_float(rowB[j][comp]);
+ bk = _mesa_half_to_float(rowB[k][comp]);
+ dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
+ }
+ }
+ }
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32:
+ {
+ GLuint i, j, k;
+ const GLfloat (*rowA)[2] = (const GLfloat (*)[2]) srcRowA;
+ const GLfloat (*rowB)[2] = (const GLfloat (*)[2]) srcRowB;
+ GLfloat (*dst)[2] = (GLfloat (*)[2]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i][0] = (rowA[j][0] + rowA[k][0] +
+ rowB[j][0] + rowB[k][0]) * 0.25F;
+ dst[i][1] = (rowA[j][1] + rowA[k][1] +
+ rowB[j][1] + rowB[k][1]) * 0.25F;
+ }
+ }
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16:
+ {
+ GLuint i, j, k, comp;
+ const GLhalfARB (*rowA)[2] = (const GLhalfARB (*)[2]) srcRowA;
+ const GLhalfARB (*rowB)[2] = (const GLhalfARB (*)[2]) srcRowB;
+ GLhalfARB (*dst)[2] = (GLhalfARB (*)[2]) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ for (comp = 0; comp < 2; comp++) {
+ GLfloat aj, ak, bj, bk;
+ aj = _mesa_half_to_float(rowA[j][comp]);
+ ak = _mesa_half_to_float(rowA[k][comp]);
+ bj = _mesa_half_to_float(rowB[j][comp]);
+ bk = _mesa_half_to_float(rowB[k][comp]);
+ dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
+ }
+ }
+ }
+ return;
+ case MESA_FORMAT_ALPHA_FLOAT32:
+ case MESA_FORMAT_LUMINANCE_FLOAT32:
+ case MESA_FORMAT_INTENSITY_FLOAT32:
+ {
+ GLuint i, j, k;
+ const GLfloat *rowA = (const GLfloat *) srcRowA;
+ const GLfloat *rowB = (const GLfloat *) srcRowB;
+ GLfloat *dst = (GLfloat *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) * 0.25F;
+ }
+ }
+ return;
+ case MESA_FORMAT_ALPHA_FLOAT16:
+ case MESA_FORMAT_LUMINANCE_FLOAT16:
+ case MESA_FORMAT_INTENSITY_FLOAT16:
+ {
+ GLuint i, j, k;
+ const GLhalfARB *rowA = (const GLhalfARB *) srcRowA;
+ const GLhalfARB *rowB = (const GLhalfARB *) srcRowB;
+ GLhalfARB *dst = (GLhalfARB *) dstRow;
+ for (i = j = 0, k = k0; i < (GLuint) dstWidth;
+ i++, j += colStride, k += colStride) {
+ GLfloat aj, ak, bj, bk;
+ aj = _mesa_half_to_float(rowA[j]);
+ ak = _mesa_half_to_float(rowA[k]);
+ bj = _mesa_half_to_float(rowB[j]);
+ bk = _mesa_half_to_float(rowB[k]);
+ dst[i] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
+ }
+ }
+ return;
+
+ default:
+ _mesa_problem(NULL, "bad format in do_row()");
+ }
+}
+
+
+/*
+ * These functions generate a 1/2-size mipmap image from a source image.
+ * Texture borders are handled by copying or averaging the source image's
+ * border texels, depending on the scale-down factor.
+ */
+
+static void
+make_1d_mipmap(const struct gl_texture_format *format, GLint border,
+ GLint srcWidth, const GLubyte *srcPtr,
+ GLint dstWidth, GLubyte *dstPtr)
+{
+ const GLint bpt = format->TexelBytes;
+ const GLubyte *src;
+ GLubyte *dst;
+
+ /* skip the border pixel, if any */
+ src = srcPtr + border * bpt;
+ dst = dstPtr + border * bpt;
+
+ /* we just duplicate the input row, kind of hack, saves code */
+ do_row(format, srcWidth - 2 * border, src, src,
+ dstWidth - 2 * border, dst);
+
+ if (border) {
+ /* copy left-most pixel from source */
+ MEMCPY(dstPtr, srcPtr, bpt);
+ /* copy right-most pixel from source */
+ MEMCPY(dstPtr + (dstWidth - 1) * bpt,
+ srcPtr + (srcWidth - 1) * bpt,
+ bpt);
+ }
+}
+
+
+/**
+ * XXX need to use the tex image's row stride!
+ */
+static void
+make_2d_mipmap(const struct gl_texture_format *format, GLint border,
+ GLint srcWidth, GLint srcHeight, const GLubyte *srcPtr,
+ GLint dstWidth, GLint dstHeight, GLubyte *dstPtr)
+{
+ const GLint bpt = format->TexelBytes;
+ const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
+ const GLint dstWidthNB = dstWidth - 2 * border;
+ const GLint dstHeightNB = dstHeight - 2 * border;
+ const GLint srcRowStride = bpt * srcWidth;
+ const GLint dstRowStride = bpt * dstWidth;
+ const GLubyte *srcA, *srcB;
+ GLubyte *dst;
+ GLint row;
+
+ /* Compute src and dst pointers, skipping any border */
+ srcA = srcPtr + border * ((srcWidth + 1) * bpt);
+ if (srcHeight > 1)
+ srcB = srcA + srcRowStride;
+ else
+ srcB = srcA;
+ dst = dstPtr + border * ((dstWidth + 1) * bpt);
+
+ for (row = 0; row < dstHeightNB; row++) {
+ do_row(format, srcWidthNB, srcA, srcB,
+ dstWidthNB, dst);
+ srcA += 2 * srcRowStride;
+ srcB += 2 * srcRowStride;
+ dst += dstRowStride;
+ }
+
+ /* This is ugly but probably won't be used much */
+ if (border > 0) {
+ /* fill in dest border */
+ /* lower-left border pixel */
+ MEMCPY(dstPtr, srcPtr, bpt);
+ /* lower-right border pixel */
+ MEMCPY(dstPtr + (dstWidth - 1) * bpt,
+ srcPtr + (srcWidth - 1) * bpt, bpt);
+ /* upper-left border pixel */
+ MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt,
+ srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt);
+ /* upper-right border pixel */
+ MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt,
+ srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt);
+ /* lower border */
+ do_row(format, srcWidthNB,
+ srcPtr + bpt,
+ srcPtr + bpt,
+ dstWidthNB, dstPtr + bpt);
+ /* upper border */
+ do_row(format, srcWidthNB,
+ srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt,
+ srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt,
+ dstWidthNB,
+ dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt);
+ /* left and right borders */
+ if (srcHeight == dstHeight) {
+ /* copy border pixel from src to dst */
+ for (row = 1; row < srcHeight; row++) {
+ MEMCPY(dstPtr + dstWidth * row * bpt,
+ srcPtr + srcWidth * row * bpt, bpt);
+ MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt,
+ srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt);
+ }
+ }
+ else {
+ /* average two src pixels each dest pixel */
+ for (row = 0; row < dstHeightNB; row += 2) {
+ do_row(format, 1,
+ srcPtr + (srcWidth * (row * 2 + 1)) * bpt,
+ srcPtr + (srcWidth * (row * 2 + 2)) * bpt,
+ 1, dstPtr + (dstWidth * row + 1) * bpt);
+ do_row(format, 1,
+ srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt,
+ srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt,
+ 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt);
+ }
+ }
+ }
+}
+
+
+static void
+make_3d_mipmap(const struct gl_texture_format *format, GLint border,
+ GLint srcWidth, GLint srcHeight, GLint srcDepth,
+ const GLubyte *srcPtr,
+ GLint dstWidth, GLint dstHeight, GLint dstDepth,
+ GLubyte *dstPtr)
+{
+ const GLint bpt = format->TexelBytes;
+ const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
+ const GLint srcDepthNB = srcDepth - 2 * border;
+ const GLint dstWidthNB = dstWidth - 2 * border;
+ const GLint dstHeightNB = dstHeight - 2 * border;
+ const GLint dstDepthNB = dstDepth - 2 * border;
+ GLvoid *tmpRowA, *tmpRowB;
+ GLint img, row;
+ GLint bytesPerSrcImage, bytesPerDstImage;
+ GLint bytesPerSrcRow, bytesPerDstRow;
+ GLint srcImageOffset, srcRowOffset;
+
+ (void) srcDepthNB; /* silence warnings */
+
+ /* Need two temporary row buffers */
+ tmpRowA = _mesa_malloc(srcWidth * bpt);
+ if (!tmpRowA)
+ return;
+ tmpRowB = _mesa_malloc(srcWidth * bpt);
+ if (!tmpRowB) {
+ _mesa_free(tmpRowA);
+ return;
+ }
+
+ bytesPerSrcImage = srcWidth * srcHeight * bpt;
+ bytesPerDstImage = dstWidth * dstHeight * bpt;
+
+ bytesPerSrcRow = srcWidth * bpt;
+ bytesPerDstRow = dstWidth * bpt;
+
+ /* Offset between adjacent src images to be averaged together */
+ srcImageOffset = (srcDepth == dstDepth) ? 0 : bytesPerSrcImage;
+
+ /* Offset between adjacent src rows to be averaged together */
+ srcRowOffset = (srcHeight == dstHeight) ? 0 : srcWidth * bpt;
+
+ /*
+ * Need to average together up to 8 src pixels for each dest pixel.
+ * Break that down into 3 operations:
+ * 1. take two rows from source image and average them together.
+ * 2. take two rows from next source image and average them together.
+ * 3. take the two averaged rows and average them for the final dst row.
+ */
+
+ /*
+ _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n",
+ srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth);
+ */
+
+ for (img = 0; img < dstDepthNB; img++) {
+ /* first source image pointer, skipping border */
+ const GLubyte *imgSrcA = srcPtr
+ + (bytesPerSrcImage + bytesPerSrcRow + border) * bpt * border
+ + img * (bytesPerSrcImage + srcImageOffset);
+ /* second source image pointer, skipping border */
+ const GLubyte *imgSrcB = imgSrcA + srcImageOffset;
+ /* address of the dest image, skipping border */
+ GLubyte *imgDst = dstPtr
+ + (bytesPerDstImage + bytesPerDstRow + border) * bpt * border
+ + img * bytesPerDstImage;
+
+ /* setup the four source row pointers and the dest row pointer */
+ const GLubyte *srcImgARowA = imgSrcA;
+ const GLubyte *srcImgARowB = imgSrcA + srcRowOffset;
+ const GLubyte *srcImgBRowA = imgSrcB;
+ const GLubyte *srcImgBRowB = imgSrcB + srcRowOffset;
+ GLubyte *dstImgRow = imgDst;
+
+ for (row = 0; row < dstHeightNB; row++) {
+ /* Average together two rows from first src image */
+ do_row(format, srcWidthNB, srcImgARowA, srcImgARowB,
+ srcWidthNB, tmpRowA);
+ /* Average together two rows from second src image */
+ do_row(format, srcWidthNB, srcImgBRowA, srcImgBRowB,
+ srcWidthNB, tmpRowB);
+ /* Average together the temp rows to make the final row */
+ do_row(format, srcWidthNB, tmpRowA, tmpRowB,
+ dstWidthNB, dstImgRow);
+ /* advance to next rows */
+ srcImgARowA += bytesPerSrcRow + srcRowOffset;
+ srcImgARowB += bytesPerSrcRow + srcRowOffset;
+ srcImgBRowA += bytesPerSrcRow + srcRowOffset;
+ srcImgBRowB += bytesPerSrcRow + srcRowOffset;
+ dstImgRow += bytesPerDstRow;
+ }
+ }
+
+ _mesa_free(tmpRowA);
+ _mesa_free(tmpRowB);
+
+ /* Luckily we can leverage the make_2d_mipmap() function here! */
+ if (border > 0) {
+ /* do front border image */
+ make_2d_mipmap(format, 1, srcWidth, srcHeight, srcPtr,
+ dstWidth, dstHeight, dstPtr);
+ /* do back border image */
+ make_2d_mipmap(format, 1, srcWidth, srcHeight,
+ srcPtr + bytesPerSrcImage * (srcDepth - 1),
+ dstWidth, dstHeight,
+ dstPtr + bytesPerDstImage * (dstDepth - 1));
+ /* do four remaining border edges that span the image slices */
+ if (srcDepth == dstDepth) {
+ /* just copy border pixels from src to dst */
+ for (img = 0; img < dstDepthNB; img++) {
+ const GLubyte *src;
+ GLubyte *dst;
+
+ /* do border along [img][row=0][col=0] */
+ src = srcPtr + (img + 1) * bytesPerSrcImage;
+ dst = dstPtr + (img + 1) * bytesPerDstImage;
+ MEMCPY(dst, src, bpt);
+
+ /* do border along [img][row=dstHeight-1][col=0] */
+ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
+ + (srcHeight - 1) * bytesPerSrcRow;
+ dst = dstPtr + (img + 1) * bytesPerDstImage
+ + (dstHeight - 1) * bytesPerDstRow;
+ MEMCPY(dst, src, bpt);
+
+ /* do border along [img][row=0][col=dstWidth-1] */
+ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
+ + (srcWidth - 1) * bpt;
+ dst = dstPtr + (img + 1) * bytesPerDstImage
+ + (dstWidth - 1) * bpt;
+ MEMCPY(dst, src, bpt);
+
+ /* do border along [img][row=dstHeight-1][col=dstWidth-1] */
+ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
+ + (bytesPerSrcImage - bpt);
+ dst = dstPtr + (img + 1) * bytesPerDstImage
+ + (bytesPerDstImage - bpt);
+ MEMCPY(dst, src, bpt);
+ }
+ }
+ else {
+ /* average border pixels from adjacent src image pairs */
+ ASSERT(srcDepthNB == 2 * dstDepthNB);
+ for (img = 0; img < dstDepthNB; img++) {
+ const GLubyte *src;
+ GLubyte *dst;
+
+ /* do border along [img][row=0][col=0] */
+ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage;
+ dst = dstPtr + (img + 1) * bytesPerDstImage;
+ do_row(format, 1, src, src + srcImageOffset, 1, dst);
+
+ /* do border along [img][row=dstHeight-1][col=0] */
+ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
+ + (srcHeight - 1) * bytesPerSrcRow;
+ dst = dstPtr + (img + 1) * bytesPerDstImage
+ + (dstHeight - 1) * bytesPerDstRow;
+ do_row(format, 1, src, src + srcImageOffset, 1, dst);
+
+ /* do border along [img][row=0][col=dstWidth-1] */
+ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
+ + (srcWidth - 1) * bpt;
+ dst = dstPtr + (img + 1) * bytesPerDstImage
+ + (dstWidth - 1) * bpt;
+ do_row(format, 1, src, src + srcImageOffset, 1, dst);
+
+ /* do border along [img][row=dstHeight-1][col=dstWidth-1] */
+ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
+ + (bytesPerSrcImage - bpt);
+ dst = dstPtr + (img + 1) * bytesPerDstImage
+ + (bytesPerDstImage - bpt);
+ do_row(format, 1, src, src + srcImageOffset, 1, dst);
+ }
+ }
+ }
+}
+
+
+/**
+ * For GL_SGIX_generate_mipmap:
+ * Generate a complete set of mipmaps from texObj's base-level image.
+ * Stop at texObj's MaxLevel or when we get to the 1x1 texture.
+ */
+void
+_mesa_generate_mipmap(GLcontext *ctx, GLenum target,
+ const struct gl_texture_unit *texUnit,
+ struct gl_texture_object *texObj)
+{
+ const struct gl_texture_image *srcImage;
+ const struct gl_texture_format *convertFormat;
+ const GLubyte *srcData = NULL;
+ GLubyte *dstData = NULL;
+ GLint level, maxLevels;
+
+ ASSERT(texObj);
+ /* XXX choose cube map face here??? */
+ srcImage = texObj->Image[0][texObj->BaseLevel];
+ ASSERT(srcImage);
+
+ maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
+ ASSERT(maxLevels > 0); /* bad target */
+
+ /* Find convertFormat - the format that do_row() will process */
+ if (srcImage->IsCompressed) {
+ /* setup for compressed textures */
+ GLuint row;
+ GLint components, size;
+ GLchan *dst;
+
+ assert(texObj->Target == GL_TEXTURE_2D);
+
+ if (srcImage->_BaseFormat == GL_RGB) {
+ convertFormat = &_mesa_texformat_rgb;
+ components = 3;
+ }
+ else if (srcImage->_BaseFormat == GL_RGBA) {
+ convertFormat = &_mesa_texformat_rgba;
+ components = 4;
+ }
+ else {
+ _mesa_problem(ctx, "bad srcImage->_BaseFormat in _mesa_generate_mipmaps");
+ return;
+ }
+
+ /* allocate storage for uncompressed GL_RGB or GL_RGBA images */
+ size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE)
+ * srcImage->Width * srcImage->Height * srcImage->Depth + 20;
+ /* 20 extra bytes, just be safe when calling last FetchTexel */
+ srcData = (GLubyte *) _mesa_malloc(size);
+ if (!srcData) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
+ return;
+ }
+ dstData = (GLubyte *) _mesa_malloc(size / 2); /* 1/4 would probably be OK */
+ if (!dstData) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
+ _mesa_free((void *) srcData);
+ return;
+ }
+
+ /* decompress base image here */
+ dst = (GLchan *) srcData;
+ for (row = 0; row < srcImage->Height; row++) {
+ GLuint col;
+ for (col = 0; col < srcImage->Width; col++) {
+ srcImage->FetchTexelc(srcImage, col, row, 0, dst);
+ dst += components;
+ }
+ }
+ }
+ else {
+ /* uncompressed */
+ convertFormat = srcImage->TexFormat;
+ }
+
+ for (level = texObj->BaseLevel; level < texObj->MaxLevel
+ && level < maxLevels - 1; level++) {
+ /* generate image[level+1] from image[level] */
+ const struct gl_texture_image *srcImage;
+ struct gl_texture_image *dstImage;
+ GLint srcWidth, srcHeight, srcDepth;
+ GLint dstWidth, dstHeight, dstDepth;
+ GLint border, bytesPerTexel;
+
+ /* get src image parameters */
+ srcImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ ASSERT(srcImage);
+ srcWidth = srcImage->Width;
+ srcHeight = srcImage->Height;
+ srcDepth = srcImage->Depth;
+ border = srcImage->Border;
+
+ /* compute next (level+1) image size */
+ if (srcWidth - 2 * border > 1) {
+ dstWidth = (srcWidth - 2 * border) / 2 + 2 * border;
+ }
+ else {
+ dstWidth = srcWidth; /* can't go smaller */
+ }
+ if (srcHeight - 2 * border > 1) {
+ dstHeight = (srcHeight - 2 * border) / 2 + 2 * border;
+ }
+ else {
+ dstHeight = srcHeight; /* can't go smaller */
+ }
+ if (srcDepth - 2 * border > 1) {
+ dstDepth = (srcDepth - 2 * border) / 2 + 2 * border;
+ }
+ else {
+ dstDepth = srcDepth; /* can't go smaller */
+ }
+
+ if (dstWidth == srcWidth &&
+ dstHeight == srcHeight &&
+ dstDepth == srcDepth) {
+ /* all done */
+ if (srcImage->IsCompressed) {
+ _mesa_free((void *) srcData);
+ _mesa_free(dstData);
+ }
+ return;
+ }
+
+ /* get dest gl_texture_image */
+ dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
+ if (!dstImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
+ return;
+ }
+
+ /* Free old image data */
+ if (dstImage->Data)
+ ctx->Driver.FreeTexImageData(ctx, dstImage);
+
+ /* initialize new image */
+ _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
+ dstDepth, border, srcImage->InternalFormat);
+ dstImage->DriverData = NULL;
+ dstImage->TexFormat = srcImage->TexFormat;
+ dstImage->FetchTexelc = srcImage->FetchTexelc;
+ dstImage->FetchTexelf = srcImage->FetchTexelf;
+ dstImage->IsCompressed = srcImage->IsCompressed;
+ if (dstImage->IsCompressed) {
+ dstImage->CompressedSize
+ = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width,
+ dstImage->Height,
+ dstImage->Depth,
+ dstImage->TexFormat->MesaFormat);
+ ASSERT(dstImage->CompressedSize > 0);
+ }
+
+ ASSERT(dstImage->TexFormat);
+ ASSERT(dstImage->FetchTexelc);
+ ASSERT(dstImage->FetchTexelf);
+
+ /* Alloc new teximage data buffer.
+ * Setup src and dest data pointers.
+ */
+ if (dstImage->IsCompressed) {
+ dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize);
+ if (!dstImage->Data) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
+ return;
+ }
+ /* srcData and dstData are already set */
+ ASSERT(srcData);
+ ASSERT(dstData);
+ }
+ else {
+ bytesPerTexel = dstImage->TexFormat->TexelBytes;
+ ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0);
+ dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight
+ * dstDepth * bytesPerTexel);
+ if (!dstImage->Data) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
+ return;
+ }
+ srcData = (const GLubyte *) srcImage->Data;
+ dstData = (GLubyte *) dstImage->Data;
+ }
+
+ /*
+ * We use simple 2x2 averaging to compute the next mipmap level.
+ */
+ switch (target) {
+ case GL_TEXTURE_1D:
+ make_1d_mipmap(convertFormat, border,
+ srcWidth, srcData,
+ dstWidth, dstData);
+ break;
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ make_2d_mipmap(convertFormat, border,
+ srcWidth, srcHeight, srcData,
+ dstWidth, dstHeight, dstData);
+ break;
+ case GL_TEXTURE_3D:
+ make_3d_mipmap(convertFormat, border,
+ srcWidth, srcHeight, srcDepth, srcData,
+ dstWidth, dstHeight, dstDepth, dstData);
+ break;
+ case GL_TEXTURE_RECTANGLE_NV:
+ /* no mipmaps, do nothing */
+ break;
+ default:
+ _mesa_problem(ctx, "bad dimensions in _mesa_generate_mipmaps");
+ return;
+ }
+
+ if (dstImage->IsCompressed) {
+ GLubyte *temp;
+ /* compress image from dstData into dstImage->Data */
+ const GLenum srcFormat = convertFormat->BaseFormat;
+ GLint dstRowStride
+ = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth);
+ ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA);
+ dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat,
+ dstImage->TexFormat,
+ dstImage->Data,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride, 0, /* strides */
+ dstWidth, dstHeight, 1, /* size */
+ srcFormat, CHAN_TYPE,
+ dstData, /* src data, actually */
+ &ctx->DefaultPacking);
+ /* swap src and dest pointers */
+ temp = (GLubyte *) srcData;
+ srcData = dstData;
+ dstData = temp;
+ }
+
+ } /* loop over mipmap levels */
+}
+
+
+/**
+ * Helper function for drivers which need to rescale texture images to
+ * certain aspect ratios.
+ * Nearest filtering only (for broken hardware that can't support
+ * all aspect ratios). This can be made a lot faster, but I don't
+ * really care enough...
+ */
+void
+_mesa_rescale_teximage2d(GLuint bytesPerPixel,
+ GLuint srcStrideInPixels,
+ GLuint dstRowStride,
+ GLint srcWidth, GLint srcHeight,
+ GLint dstWidth, GLint dstHeight,
+ const GLvoid *srcImage, GLvoid *dstImage)
+{
+ GLint row, col;
+
+#define INNER_LOOP( TYPE, HOP, WOP ) \
+ for ( row = 0 ; row < dstHeight ; row++ ) { \
+ GLint srcRow = row HOP hScale; \
+ for ( col = 0 ; col < dstWidth ; col++ ) { \
+ GLint srcCol = col WOP wScale; \
+ dst[col] = src[srcRow * srcStrideInPixels + srcCol]; \
+ } \
+ dst = (TYPE *) ((GLubyte *) dst + dstRowStride); \
+ } \
+
+#define RESCALE_IMAGE( TYPE ) \
+do { \
+ const TYPE *src = (const TYPE *)srcImage; \
+ TYPE *dst = (TYPE *)dstImage; \
+ \
+ if ( srcHeight < dstHeight ) { \
+ const GLint hScale = dstHeight / srcHeight; \
+ if ( srcWidth < dstWidth ) { \
+ const GLint wScale = dstWidth / srcWidth; \
+ INNER_LOOP( TYPE, /, / ); \
+ } \
+ else { \
+ const GLint wScale = srcWidth / dstWidth; \
+ INNER_LOOP( TYPE, /, * ); \
+ } \
+ } \
+ else { \
+ const GLint hScale = srcHeight / dstHeight; \
+ if ( srcWidth < dstWidth ) { \
+ const GLint wScale = dstWidth / srcWidth; \
+ INNER_LOOP( TYPE, *, / ); \
+ } \
+ else { \
+ const GLint wScale = srcWidth / dstWidth; \
+ INNER_LOOP( TYPE, *, * ); \
+ } \
+ } \
+} while (0)
+
+ switch ( bytesPerPixel ) {
+ case 4:
+ RESCALE_IMAGE( GLuint );
+ break;
+
+ case 2:
+ RESCALE_IMAGE( GLushort );
+ break;
+
+ case 1:
+ RESCALE_IMAGE( GLubyte );
+ break;
+ default:
+ _mesa_problem(NULL,"unexpected bytes/pixel in _mesa_rescale_teximage2d");
+ }
+}
+
+
+/**
+ * Upscale an image by replication, not (typical) stretching.
+ * We use this when the image width or height is less than a
+ * certain size (4, 8) and we need to upscale an image.
+ */
+void
+_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight,
+ GLsizei outWidth, GLsizei outHeight,
+ GLint comps, const GLchan *src, GLint srcRowStride,
+ GLchan *dest )
+{
+ GLint i, j, k;
+
+ ASSERT(outWidth >= inWidth);
+ ASSERT(outHeight >= inHeight);
+#if 0
+ ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2);
+ ASSERT((outWidth & 3) == 0);
+ ASSERT((outHeight & 3) == 0);
+#endif
+
+ for (i = 0; i < outHeight; i++) {
+ const GLint ii = i % inHeight;
+ for (j = 0; j < outWidth; j++) {
+ const GLint jj = j % inWidth;
+ for (k = 0; k < comps; k++) {
+ dest[(i * outWidth + j) * comps + k]
+ = src[ii * srcRowStride + jj * comps + k];
+ }
+ }
+ }
+}
+
diff --git a/progs/tools/trace/gltrace_support.h b/src/mesa/main/mipmap.h
index de28669a989..df786032838 100644
--- a/progs/tools/trace/gltrace_support.h
+++ b/src/mesa/main/mipmap.h
@@ -1,6 +1,8 @@
-// -*- c++ -*- (emacs c++ mode)
/*
- * Copyright (C) 2006 Thomas Sondergaard All Rights Reserved.
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -19,47 +21,32 @@
* AN ACTION 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 GLTRACE_SUPPORT_H
-#define GLTRACE_SUPPORT_H
-
-#include <string>
-#include <iostream>
-#include <memory>
-
-namespace gltrace {
-
- const int MAX_STACKFRAMES = 100;
- /// Returns the stack trace of the current thread
- std::string getStackTrace(int count = MAX_STACKFRAMES, int first = 0);
-
- std::ostream &timeNow(std::ostream &os);
- struct logstream : public std::ostream {
-
- /// Opens a logstream - if filename is null, stderr will be used
- logstream(const char *filename = 0);
-
- private:
- std::auto_ptr<std::ofstream> file_os;
- };
+#ifndef MIPMAP_H
+#define MIPMAP_H
- struct Config {
- bool logCalls;
- bool checkErrors;
- bool logTime;
- logstream log;
-
- Config();
- };
+#include "mtypes.h"
- extern Config config;
+extern void
+_mesa_generate_mipmap(GLcontext *ctx, GLenum target,
+ const struct gl_texture_unit *texUnit,
+ struct gl_texture_object *texObj);
-} // namespace gltrace
-#define GLTRACE_LOG(x) \
- { if (config.logTime) config.log << timeNow << ": "; config.log << x << "\n"; }
+extern void
+_mesa_rescale_teximage2d(GLuint bytesPerPixel,
+ GLuint srcStrideInPixels,
+ GLuint dstRowStride,
+ GLint srcWidth, GLint srcHeight,
+ GLint dstWidth, GLint dstHeight,
+ const GLvoid *srcImage, GLvoid *dstImage);
-#endif // GLTRACE_SUPPORT_H
+extern void
+_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight,
+ GLsizei outWidth, GLsizei outHeight,
+ GLint comps, const GLchan *src, GLint srcRowStride,
+ GLchan *dest);
+#endif /* MIPMAP_H */
diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c
index 7a657dc3cad..846c329c70d 100644
--- a/src/mesa/main/mm.c
+++ b/src/mesa/main/mm.c
@@ -234,8 +234,6 @@ Join2Blocks(struct mem_block *p)
int
mmFreeMem(struct mem_block *b)
{
- struct mem_block *heap = b->heap;
-
if (!b)
return 0;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2bb6d93c390..0ed73beb3c5 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -392,9 +392,9 @@ struct gl_color_table
{
GLenum InternalFormat; /**< The user-specified format */
GLenum _BaseFormat; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */
- GLuint Size; /**< number of entries (rows) in table */
- GLvoid *Table; /**< points to data of <Type> */
- GLenum Type; /**< GL_UNSIGNED_BYTE or GL_FLOAT */
+ GLuint Size; /**< number of entries in table */
+ GLfloat *TableF; /**< Color table, floating point values */
+ GLubyte *TableUB; /**< Color table, ubyte values */
GLubyte RedSize;
GLubyte GreenSize;
GLubyte BlueSize;
@@ -888,6 +888,7 @@ struct gl_light_attrib
GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */
GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
GLboolean ColorMaterialEnabled;
+ GLenum ClampVertexColor;
struct gl_light EnabledList; /**< List sentinel */
@@ -1809,18 +1810,6 @@ struct gl_evaluators
/**
- * State used during execution of fragment programs.
- */
-struct fp_machine
-{
- GLfloat Temporaries[MAX_NV_FRAGMENT_PROGRAM_TEMPS][4];
- GLfloat Inputs[MAX_NV_FRAGMENT_PROGRAM_INPUTS][4];
- GLfloat Outputs[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS][4];
- GLuint CondCodes[4];
-};
-
-
-/**
* Names of the various vertex/fragment program register files, etc.
* NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
* All values should fit in a 4-bit field.
@@ -1925,30 +1914,25 @@ struct gl_program_state
/**
- * State vars for GL_ARB/GL_NV_vertex_program
+ * Context state for vertex programs.
*/
struct gl_vertex_program_state
{
- GLboolean Enabled; /**< GL_VERTEX_PROGRAM_ARB/NV */
- GLboolean _Enabled; /**< Enabled and valid program? */
- GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
- GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
+ GLboolean Enabled; /**< GL_VERTEX_PROGRAM_ARB/NV */
+ GLboolean _Enabled; /**< Enabled and valid program? */
+ GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
+ GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
struct gl_vertex_program *Current; /**< ptr to currently bound program */
const struct gl_vertex_program *_Current; /**< ptr to currently bound
program, including internal
(t_vp_build.c) programs */
+ GLfloat Parameters[MAX_NV_VERTEX_PROGRAM_PARAMS][4]; /**< Env params */
+
+ /* For GL_NV_vertex_program only: */
GLenum TrackMatrix[MAX_NV_VERTEX_PROGRAM_PARAMS / 4];
GLenum TrackMatrixTransform[MAX_NV_VERTEX_PROGRAM_PARAMS / 4];
- GLfloat Parameters[MAX_NV_VERTEX_PROGRAM_PARAMS][4]; /* Env params */
- /* Only used during program execution (may be moved someday): */
- GLfloat Temporaries[MAX_NV_VERTEX_PROGRAM_TEMPS][4];
- GLfloat Inputs[MAX_NV_VERTEX_PROGRAM_INPUTS][4];
- GLuint InputsSize[MAX_NV_VERTEX_PROGRAM_INPUTS];
- GLfloat Outputs[MAX_NV_VERTEX_PROGRAM_OUTPUTS][4];
- GLint AddressReg[4];
-
#if FEATURE_MESA_program_debug
GLprogramcallbackMESA Callback;
GLvoid *CallbackData;
@@ -1959,18 +1943,17 @@ struct gl_vertex_program_state
/**
- * Context state for GL_ARB/NV_fragment_program
+ * Context state for fragment programs.
*/
struct gl_fragment_program_state
{
- GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */
- GLboolean _Enabled; /* Enabled and valid program? */
- GLboolean _Active;
- struct gl_fragment_program *Current; /* ptr to currently bound program */
- const struct gl_fragment_program *_Current; /* ptr to currently active program
+ GLboolean Enabled; /**< User-set fragment program enable flag */
+ GLboolean _Enabled; /**< Fragment program enabled and valid? */
+ GLboolean _Active; /**< Is a user program or internal program active? */
+ struct gl_fragment_program *Current; /**< User-bound program */
+ const struct gl_fragment_program *_Current; /**< currently active program
(including internal programs) */
- struct fp_machine Machine; /* machine state */
- GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /* Env params */
+ GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /**< Env params */
#if FEATURE_MESA_program_debug
GLprogramcallbackMESA Callback;
@@ -1991,17 +1974,6 @@ struct atifs_instruction;
struct atifs_setupinst;
/**
- * State for executing ATI fragment shader.
- */
-struct atifs_machine
-{
- GLfloat Registers[6][4]; /** six temporary registers */
- GLfloat PrevPassRegisters[6][4];
- GLfloat Inputs[2][4]; /** Primary, secondary input colors */
-};
-
-
-/**
* ATI fragment shader
*/
struct ati_fragment_shader
@@ -2031,7 +2003,6 @@ struct gl_ati_fragment_shader_state
GLboolean _Enabled; /** enabled and valid shader? */
GLboolean Compiling;
GLfloat GlobalConstants[8][4];
- struct atifs_machine Machine; /* machine state */
struct ati_fragment_shader *Current;
};
@@ -2092,6 +2063,19 @@ struct gl_shared_state
/*@}*/
/**
+ * \name Thread safety and statechange notification for texture
+ * objects.
+ *
+ * \todo Improve the granularity of locking.
+ */
+ /*@{*/
+ _glthread_Mutex TexMutex; /**< texobj thread safety */
+ GLuint TextureStateStamp; /**< state notification for shared tex */
+ /*@}*/
+
+
+
+ /**
* \name Vertex/fragment programs
*/
/*@{*/
@@ -2340,6 +2324,8 @@ struct gl_program_constants
GLuint MaxNativeTemps;
GLuint MaxNativeAddressRegs; /* vertex program only, for now */
GLuint MaxNativeParameters;
+ /* For shaders */
+ GLuint MaxUniformComponents;
};
@@ -2389,6 +2375,9 @@ struct gl_constants
/* GL_EXT_framebuffer_object */
GLuint MaxColorAttachments;
GLuint MaxRenderbufferSize;
+ /* GL_ARB_vertex_shader */
+ GLuint MaxVertexTextureImageUnits;
+ GLuint MaxVaryingFloats;
};
@@ -2417,6 +2406,7 @@ struct gl_extensions
GLboolean ARB_point_sprite;
GLboolean ARB_shader_objects;
GLboolean ARB_shading_language_100;
+ GLboolean ARB_shading_language_120;
GLboolean ARB_shadow;
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_compression;
@@ -2955,6 +2945,8 @@ struct __GLcontextRec
GLboolean _ForceEyeCoords;
GLenum _CurrentProgram; /* currently executing program */
+ GLuint TextureStateTimestamp; /* detect changes to shared state */
+
struct gl_shine_tab *_ShineTable[2]; /**< Active shine tables */
struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */
/**@}*/
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 3b1f848e8c3..4e47cdba890 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1171,200 +1171,88 @@ void
_mesa_lookup_rgba_float(const struct gl_color_table *table,
GLuint n, GLfloat rgba[][4])
{
- if (!table->Table || table->Size == 0)
+ const GLint max = table->Size - 1;
+ const GLfloat scale = (GLfloat) max;
+ const GLfloat *lut = table->TableF;
+ GLuint i;
+
+ if (!table->TableF || table->Size == 0)
return;
switch (table->_BaseFormat) {
case GL_INTENSITY:
/* replace RGBA with I */
- if (table->Type == GL_FLOAT) {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND(rgba[i][RCOMP] * scale);
- GLfloat c = lut[CLAMP(j, 0, max)];
- rgba[i][RCOMP] = rgba[i][GCOMP] =
- rgba[i][BCOMP] = rgba[i][ACOMP] = c;
- }
- }
- else {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND(rgba[i][RCOMP] * scale);
- GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]);
- rgba[i][RCOMP] = rgba[i][GCOMP] =
- rgba[i][BCOMP] = rgba[i][ACOMP] = c;
- }
+ for (i = 0; i < n; i++) {
+ GLint j = IROUND(rgba[i][RCOMP] * scale);
+ GLfloat c = lut[CLAMP(j, 0, max)];
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] =
+ rgba[i][ACOMP] = c;
}
break;
case GL_LUMINANCE:
/* replace RGB with L */
- if (table->Type == GL_FLOAT) {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND(rgba[i][RCOMP] * scale);
- GLfloat c = lut[CLAMP(j, 0, max)];
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c;
- }
- }
- else {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND(rgba[i][RCOMP] * scale);
- GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]);
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c;
- }
+ for (i = 0; i < n; i++) {
+ GLint j = IROUND(rgba[i][RCOMP] * scale);
+ GLfloat c = lut[CLAMP(j, 0, max)];
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = c;
}
break;
case GL_ALPHA:
/* replace A with A */
- if (table->Type == GL_FLOAT) {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND(rgba[i][ACOMP] * scale);
- rgba[i][ACOMP] = lut[CLAMP(j, 0, max)];
- }
- }
- else {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND(rgba[i][ACOMP] * scale);
- rgba[i][ACOMP] = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]);
- }
+ for (i = 0; i < n; i++) {
+ GLint j = IROUND(rgba[i][ACOMP] * scale);
+ rgba[i][ACOMP] = lut[CLAMP(j, 0, max)];
}
break;
case GL_LUMINANCE_ALPHA:
/* replace RGBA with LLLA */
- if (table->Type == GL_FLOAT) {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jL = IROUND(rgba[i][RCOMP] * scale);
- GLint jA = IROUND(rgba[i][ACOMP] * scale);
- GLfloat luminance, alpha;
- jL = CLAMP(jL, 0, max);
- jA = CLAMP(jA, 0, max);
- luminance = lut[jL * 2 + 0];
- alpha = lut[jA * 2 + 1];
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance;
- rgba[i][ACOMP] = alpha;;
- }
- }
- else {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jL = IROUND(rgba[i][RCOMP] * scale);
- GLint jA = IROUND(rgba[i][ACOMP] * scale);
- GLfloat luminance, alpha;
- jL = CLAMP(jL, 0, max);
- jA = CLAMP(jA, 0, max);
- luminance = CHAN_TO_FLOAT(lut[jL * 2 + 0]);
- alpha = CHAN_TO_FLOAT(lut[jA * 2 + 1]);
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance;
- rgba[i][ACOMP] = alpha;;
- }
+ for (i = 0; i < n; i++) {
+ GLint jL = IROUND(rgba[i][RCOMP] * scale);
+ GLint jA = IROUND(rgba[i][ACOMP] * scale);
+ GLfloat luminance, alpha;
+ jL = CLAMP(jL, 0, max);
+ jA = CLAMP(jA, 0, max);
+ luminance = lut[jL * 2 + 0];
+ alpha = lut[jA * 2 + 1];
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = luminance;
+ rgba[i][ACOMP] = alpha;;
}
break;
case GL_RGB:
/* replace RGB with RGB */
- if (table->Type == GL_FLOAT) {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND(rgba[i][RCOMP] * scale);
- GLint jG = IROUND(rgba[i][GCOMP] * scale);
- GLint jB = IROUND(rgba[i][BCOMP] * scale);
- jR = CLAMP(jR, 0, max);
- jG = CLAMP(jG, 0, max);
- jB = CLAMP(jB, 0, max);
- rgba[i][RCOMP] = lut[jR * 3 + 0];
- rgba[i][GCOMP] = lut[jG * 3 + 1];
- rgba[i][BCOMP] = lut[jB * 3 + 2];
- }
- }
- else {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND(rgba[i][RCOMP] * scale);
- GLint jG = IROUND(rgba[i][GCOMP] * scale);
- GLint jB = IROUND(rgba[i][BCOMP] * scale);
- jR = CLAMP(jR, 0, max);
- jG = CLAMP(jG, 0, max);
- jB = CLAMP(jB, 0, max);
- rgba[i][RCOMP] = CHAN_TO_FLOAT(lut[jR * 3 + 0]);
- rgba[i][GCOMP] = CHAN_TO_FLOAT(lut[jG * 3 + 1]);
- rgba[i][BCOMP] = CHAN_TO_FLOAT(lut[jB * 3 + 2]);
- }
+ for (i = 0; i < n; i++) {
+ GLint jR = IROUND(rgba[i][RCOMP] * scale);
+ GLint jG = IROUND(rgba[i][GCOMP] * scale);
+ GLint jB = IROUND(rgba[i][BCOMP] * scale);
+ jR = CLAMP(jR, 0, max);
+ jG = CLAMP(jG, 0, max);
+ jB = CLAMP(jB, 0, max);
+ rgba[i][RCOMP] = lut[jR * 3 + 0];
+ rgba[i][GCOMP] = lut[jG * 3 + 1];
+ rgba[i][BCOMP] = lut[jB * 3 + 2];
}
break;
case GL_RGBA:
/* replace RGBA with RGBA */
- if (table->Type == GL_FLOAT) {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND(rgba[i][RCOMP] * scale);
- GLint jG = IROUND(rgba[i][GCOMP] * scale);
- GLint jB = IROUND(rgba[i][BCOMP] * scale);
- GLint jA = IROUND(rgba[i][ACOMP] * scale);
- jR = CLAMP(jR, 0, max);
- jG = CLAMP(jG, 0, max);
- jB = CLAMP(jB, 0, max);
- jA = CLAMP(jA, 0, max);
- rgba[i][RCOMP] = lut[jR * 4 + 0];
- rgba[i][GCOMP] = lut[jG * 4 + 1];
- rgba[i][BCOMP] = lut[jB * 4 + 2];
- rgba[i][ACOMP] = lut[jA * 4 + 3];
- }
- }
- else {
- const GLint max = table->Size - 1;
- const GLfloat scale = (GLfloat) max;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND(rgba[i][RCOMP] * scale);
- GLint jG = IROUND(rgba[i][GCOMP] * scale);
- GLint jB = IROUND(rgba[i][BCOMP] * scale);
- GLint jA = IROUND(rgba[i][ACOMP] * scale);
- jR = CLAMP(jR, 0, max);
- jG = CLAMP(jG, 0, max);
- jB = CLAMP(jB, 0, max);
- jA = CLAMP(jA, 0, max);
- rgba[i][RCOMP] = CHAN_TO_FLOAT(lut[jR * 4 + 0]);
- rgba[i][GCOMP] = CHAN_TO_FLOAT(lut[jG * 4 + 1]);
- rgba[i][BCOMP] = CHAN_TO_FLOAT(lut[jB * 4 + 2]);
- rgba[i][ACOMP] = CHAN_TO_FLOAT(lut[jA * 4 + 3]);
- }
+ for (i = 0; i < n; i++) {
+ GLint jR = IROUND(rgba[i][RCOMP] * scale);
+ GLint jG = IROUND(rgba[i][GCOMP] * scale);
+ GLint jB = IROUND(rgba[i][BCOMP] * scale);
+ GLint jA = IROUND(rgba[i][ACOMP] * scale);
+ jR = CLAMP(jR, 0, max);
+ jG = CLAMP(jG, 0, max);
+ jB = CLAMP(jB, 0, max);
+ jA = CLAMP(jA, 0, max);
+ rgba[i][RCOMP] = lut[jR * 4 + 0];
+ rgba[i][GCOMP] = lut[jG * 4 + 1];
+ rgba[i][BCOMP] = lut[jB * 4 + 2];
+ rgba[i][ACOMP] = lut[jA * 4 + 3];
}
break;
default:
@@ -1376,361 +1264,147 @@ _mesa_lookup_rgba_float(const struct gl_color_table *table,
/**
- * Apply a color table lookup to an array of GLchan RGBA colors.
+ * Apply a color table lookup to an array of ubyte/RGBA colors.
*/
void
-_mesa_lookup_rgba_chan(const struct gl_color_table *table,
- GLuint n, GLchan rgba[][4])
+_mesa_lookup_rgba_ubyte(const struct gl_color_table *table,
+ GLuint n, GLubyte rgba[][4])
{
- if (!table->Table || table->Size == 0)
+ const GLubyte *lut = table->TableUB;
+ const GLfloat scale = (GLfloat) (table->Size - 1) / 255.0;
+ GLuint i;
+
+ if (!table->TableUB || table->Size == 0)
return;
switch (table->_BaseFormat) {
- case GL_INTENSITY:
- /* replace RGBA with I */
- if (table->Type == GL_FLOAT) {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLchan c;
- CLAMPED_FLOAT_TO_CHAN(c, lut[j]);
- rgba[i][RCOMP] = rgba[i][GCOMP] =
- rgba[i][BCOMP] = rgba[i][ACOMP] = c;
- }
- }
- else {
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- if (table->Size == 256) {
- /* common case */
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- const GLchan c = lut[rgba[i][RCOMP]];
- rgba[i][RCOMP] = rgba[i][GCOMP] =
- rgba[i][BCOMP] = rgba[i][ACOMP] = c;
- }
- }
- else
-#endif
- {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- rgba[i][RCOMP] = rgba[i][GCOMP] =
- rgba[i][BCOMP] = rgba[i][ACOMP] = lut[j];
- }
- }
- }
- break;
- case GL_LUMINANCE:
- /* replace RGB with L */
- if (table->Type == GL_FLOAT) {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLchan c;
- CLAMPED_FLOAT_TO_CHAN(c, lut[j]);
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c;
- }
+ case GL_INTENSITY:
+ /* replace RGBA with I */
+ if (table->Size == 256) {
+ for (i = 0; i < n; i++) {
+ const GLubyte c = lut[rgba[i][RCOMP]];
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] =
+ rgba[i][ACOMP] = c;
}
- else {
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- if (table->Size == 256) {
- /* common case */
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- const GLchan c = lut[rgba[i][RCOMP]];
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c;
- }
- }
- else
-#endif
- {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = lut[j];
- }
- }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale);
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] =
+ rgba[i][ACOMP] = lut[j];
}
- break;
- case GL_ALPHA:
- /* replace A with A */
- if (table->Type == GL_FLOAT) {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale);
- GLchan c;
- CLAMPED_FLOAT_TO_CHAN(c, lut[j]);
- rgba[i][ACOMP] = c;
- }
+ }
+ break;
+ case GL_LUMINANCE:
+ /* replace RGB with L */
+ if (table->Size == 256) {
+ for (i = 0; i < n; i++) {
+ const GLubyte c = lut[rgba[i][RCOMP]];
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = c;
}
- else {
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- if (table->Size == 256) {
- /* common case */
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- rgba[i][ACOMP] = lut[rgba[i][ACOMP]];
- }
- }
- else
-#endif
- {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale);
- rgba[i][ACOMP] = lut[j];
- }
- }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale);
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = lut[j];
}
- break;
- case GL_LUMINANCE_ALPHA:
- /* replace RGBA with LLLA */
- if (table->Type == GL_FLOAT) {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jL = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale);
- GLchan luminance, alpha;
- CLAMPED_FLOAT_TO_CHAN(luminance, lut[jL * 2 + 0]);
- CLAMPED_FLOAT_TO_CHAN(alpha, lut[jA * 2 + 1]);
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance;
- rgba[i][ACOMP] = alpha;;
- }
+ }
+ break;
+ case GL_ALPHA:
+ /* replace A with A */
+ if (table->Size == 256) {
+ for (i = 0; i < n; i++) {
+ rgba[i][ACOMP] = lut[rgba[i][ACOMP]];
}
- else {
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- if (table->Size == 256) {
- /* common case */
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLchan l = lut[rgba[i][RCOMP] * 2 + 0];
- GLchan a = lut[rgba[i][ACOMP] * 2 + 1];;
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = l;
- rgba[i][ACOMP] = a;
- }
- }
- else
-#endif
- {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jL = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale);
- GLchan luminance = lut[jL * 2 + 0];
- GLchan alpha = lut[jA * 2 + 1];
- rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance;
- rgba[i][ACOMP] = alpha;
- }
- }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale);
+ rgba[i][ACOMP] = lut[j];
}
- break;
- case GL_RGB:
- /* replace RGB with RGB */
- if (table->Type == GL_FLOAT) {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale);
- GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 3 + 0]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 3 + 1]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 3 + 2]);
- }
+ }
+ break;
+ case GL_LUMINANCE_ALPHA:
+ /* replace RGBA with LLLA */
+ if (table->Size == 256) {
+ for (i = 0; i < n; i++) {
+ GLubyte l = lut[rgba[i][RCOMP] * 2 + 0];
+ GLubyte a = lut[rgba[i][ACOMP] * 2 + 1];;
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = l;
+ rgba[i][ACOMP] = a;
}
- else {
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- if (table->Size == 256) {
- /* common case */
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 3 + 0];
- rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 3 + 1];
- rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 3 + 2];
- }
- }
- else
-#endif
- {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale);
- GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale);
- rgba[i][RCOMP] = lut[jR * 3 + 0];
- rgba[i][GCOMP] = lut[jG * 3 + 1];
- rgba[i][BCOMP] = lut[jB * 3 + 2];
- }
- }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ GLint jL = IROUND((GLfloat) rgba[i][RCOMP] * scale);
+ GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale);
+ GLubyte luminance = lut[jL * 2 + 0];
+ GLubyte alpha = lut[jA * 2 + 1];
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = luminance;
+ rgba[i][ACOMP] = alpha;
}
- break;
- case GL_RGBA:
- /* replace RGBA with RGBA */
- if (table->Type == GL_FLOAT) {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale);
- GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale);
- GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 4 + 0]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 4 + 1]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 4 + 2]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], lut[jA * 4 + 3]);
- }
+ }
+ break;
+ case GL_RGB:
+ if (table->Size == 256) {
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 3 + 0];
+ rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 3 + 1];
+ rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 3 + 2];
}
- else {
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- if (table->Size == 256) {
- /* common case */
- const GLchan *lut = (const GLchan *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 4 + 0];
- rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 4 + 1];
- rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 4 + 2];
- rgba[i][ACOMP] = lut[rgba[i][ACOMP] * 4 + 3];
- }
- }
- else
-#endif
- {
- const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
- const GLfloat *lut = (const GLfloat *) table->Table;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale);
- GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale);
- GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale);
- GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 4 + 0]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 4 + 1]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 4 + 2]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], lut[jA * 4 + 3]);
- }
- }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale);
+ GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale);
+ GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale);
+ rgba[i][RCOMP] = lut[jR * 3 + 0];
+ rgba[i][GCOMP] = lut[jG * 3 + 1];
+ rgba[i][BCOMP] = lut[jB * 3 + 2];
}
- break;
- default:
- _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_chan");
- return;
- }
-}
-
-
-
-/*
- * Apply color index shift and offset to an array of pixels.
- */
-void
-_mesa_shift_and_offset_ci( const GLcontext *ctx, GLuint n, GLuint indexes[] )
-{
- GLint shift = ctx->Pixel.IndexShift;
- GLint offset = ctx->Pixel.IndexOffset;
- GLuint i;
- if (shift > 0) {
- for (i=0;i<n;i++) {
- indexes[i] = (indexes[i] << shift) + offset;
}
- }
- else if (shift < 0) {
- shift = -shift;
- for (i=0;i<n;i++) {
- indexes[i] = (indexes[i] >> shift) + offset;
+ break;
+ case GL_RGBA:
+ if (table->Size == 256) {
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 4 + 0];
+ rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 4 + 1];
+ rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 4 + 2];
+ rgba[i][ACOMP] = lut[rgba[i][ACOMP] * 4 + 3];
+ }
}
- }
- else {
- for (i=0;i<n;i++) {
- indexes[i] = indexes[i] + offset;
+ else {
+ for (i = 0; i < n; i++) {
+ GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale);
+ GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale);
+ GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale);
+ GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale);
+ CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 4 + 0]);
+ CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 4 + 1]);
+ CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 4 + 2]);
+ CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], lut[jA * 4 + 3]);
+ }
}
+ break;
+ default:
+ _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_chan");
+ return;
}
}
-/*
- * Apply color index mapping to color indexes.
- */
-void
-_mesa_map_ci( const GLcontext *ctx, GLuint n, GLuint index[] )
-{
- const GLuint mask = ctx->Pixel.MapItoIsize - 1;
- GLuint i;
- for (i = 0; i < n; i++) {
- const GLuint j = index[i] & mask;
- index[i] = IROUND(ctx->Pixel.MapItoI[j]);
- }
-}
-
-
-/*
- * Map color indexes to rgba values.
- */
-void
-_mesa_map_ci_to_rgba_chan( const GLcontext *ctx, GLuint n,
- const GLuint index[], GLchan rgba[][4] )
-{
-#if CHAN_BITS == 8
- GLuint rmask = ctx->Pixel.MapItoRsize - 1;
- GLuint gmask = ctx->Pixel.MapItoGsize - 1;
- GLuint bmask = ctx->Pixel.MapItoBsize - 1;
- GLuint amask = ctx->Pixel.MapItoAsize - 1;
- const GLubyte *rMap = ctx->Pixel.MapItoR8;
- const GLubyte *gMap = ctx->Pixel.MapItoG8;
- const GLubyte *bMap = ctx->Pixel.MapItoB8;
- const GLubyte *aMap = ctx->Pixel.MapItoA8;
- GLuint i;
- for (i=0;i<n;i++) {
- rgba[i][RCOMP] = rMap[index[i] & rmask];
- rgba[i][GCOMP] = gMap[index[i] & gmask];
- rgba[i][BCOMP] = bMap[index[i] & bmask];
- rgba[i][ACOMP] = aMap[index[i] & amask];
- }
-#else
- GLuint rmask = ctx->Pixel.MapItoRsize - 1;
- GLuint gmask = ctx->Pixel.MapItoGsize - 1;
- GLuint bmask = ctx->Pixel.MapItoBsize - 1;
- GLuint amask = ctx->Pixel.MapItoAsize - 1;
- const GLfloat *rMap = ctx->Pixel.MapItoR;
- const GLfloat *gMap = ctx->Pixel.MapItoG;
- const GLfloat *bMap = ctx->Pixel.MapItoB;
- const GLfloat *aMap = ctx->Pixel.MapItoA;
- GLuint i;
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], rMap[index[i] & rmask]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], gMap[index[i] & gmask]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], bMap[index[i] & bmask]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], aMap[index[i] & amask]);
- }
-#endif
-}
-
/*
* Map color indexes to float rgba values.
@@ -1757,14 +1431,13 @@ _mesa_map_ci_to_rgba( const GLcontext *ctx, GLuint n,
}
-/*
- * Map 8-bit color indexes to rgb values.
+/**
+ * Map ubyte color indexes to ubyte/RGBA values.
*/
void
-_mesa_map_ci8_to_rgba( const GLcontext *ctx, GLuint n, const GLubyte index[],
- GLchan rgba[][4] )
+_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[],
+ GLubyte rgba[][4])
{
-#if CHAN_BITS == 8
GLuint rmask = ctx->Pixel.MapItoRsize - 1;
GLuint gmask = ctx->Pixel.MapItoGsize - 1;
GLuint bmask = ctx->Pixel.MapItoBsize - 1;
@@ -1780,61 +1453,6 @@ _mesa_map_ci8_to_rgba( const GLcontext *ctx, GLuint n, const GLubyte index[],
rgba[i][BCOMP] = bMap[index[i] & bmask];
rgba[i][ACOMP] = aMap[index[i] & amask];
}
-#else
- GLuint rmask = ctx->Pixel.MapItoRsize - 1;
- GLuint gmask = ctx->Pixel.MapItoGsize - 1;
- GLuint bmask = ctx->Pixel.MapItoBsize - 1;
- GLuint amask = ctx->Pixel.MapItoAsize - 1;
- const GLfloat *rMap = ctx->Pixel.MapItoR;
- const GLfloat *gMap = ctx->Pixel.MapItoG;
- const GLfloat *bMap = ctx->Pixel.MapItoB;
- const GLfloat *aMap = ctx->Pixel.MapItoA;
- GLuint i;
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], rMap[index[i] & rmask]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], gMap[index[i] & gmask]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], bMap[index[i] & bmask]);
- CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], aMap[index[i] & amask]);
- }
-#endif
-}
-
-
-void
-_mesa_shift_and_offset_stencil( const GLcontext *ctx, GLuint n,
- GLstencil stencil[] )
-{
- GLuint i;
- GLint shift = ctx->Pixel.IndexShift;
- GLint offset = ctx->Pixel.IndexOffset;
- if (shift > 0) {
- for (i=0;i<n;i++) {
- stencil[i] = (stencil[i] << shift) + offset;
- }
- }
- else if (shift < 0) {
- shift = -shift;
- for (i=0;i<n;i++) {
- stencil[i] = (stencil[i] >> shift) + offset;
- }
- }
- else {
- for (i=0;i<n;i++) {
- stencil[i] = stencil[i] + offset;
- }
- }
-
-}
-
-
-void
-_mesa_map_stencil( const GLcontext *ctx, GLuint n, GLstencil stencil[] )
-{
- GLuint mask = ctx->Pixel.MapStoSsize - 1;
- GLuint i;
- for (i=0;i<n;i++) {
- stencil[i] = ctx->Pixel.MapStoS[ stencil[i] & mask ];
- }
}
@@ -1852,52 +1470,6 @@ _mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n,
}
-/*
- * This function converts an array of GLchan colors to GLfloat colors.
- * Most importantly, it undoes the non-uniform quantization of pixel
- * values introduced when we convert shallow (< 8 bit) pixel values
- * to GLubytes in the ctx->Driver.ReadRGBASpan() functions.
- * This fixes a number of OpenGL conformance failures when running on
- * 16bpp displays, for example.
- */
-void
-_mesa_chan_to_float_span(const GLcontext *ctx, GLuint n,
- CONST GLchan rgba[][4], GLfloat rgbaf[][4])
-{
-#if CHAN_TYPE == GL_FLOAT
- MEMCPY(rgbaf, rgba, n * 4 * sizeof(GLfloat));
-#else
- const GLuint rShift = CHAN_BITS - ctx->Visual.redBits;
- const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits;
- const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits;
- GLuint aShift;
- const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1);
- const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1);
- const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1);
- GLfloat aScale;
- GLuint i;
-
- if (ctx->Visual.alphaBits > 0) {
- aShift = CHAN_BITS - ctx->Visual.alphaBits;
- aScale = 1.0F / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1);
- }
- else {
- aShift = 0;
- aScale = 1.0F / CHAN_MAXF;
- }
-
- for (i = 0; i < n; i++) {
- const GLint r = rgba[i][RCOMP] >> rShift;
- const GLint g = rgba[i][GCOMP] >> gShift;
- const GLint b = rgba[i][BCOMP] >> bShift;
- const GLint a = rgba[i][ACOMP] >> aShift;
- rgbaf[i][RCOMP] = (GLfloat) r * rScale;
- rgbaf[i][GCOMP] = (GLfloat) g * gScale;
- rgbaf[i][BCOMP] = (GLfloat) b * bScale;
- rgbaf[i][ACOMP] = (GLfloat) a * aScale;
- }
-#endif
-}
/**********************************************************************/
/***** State Management *****/
diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h
index 161990024b9..09155cfd70d 100644
--- a/src/mesa/main/pixel.h
+++ b/src/mesa/main/pixel.h
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -98,23 +98,8 @@ _mesa_lookup_rgba_float(const struct gl_color_table *table,
GLuint n, GLfloat rgba[][4]);
extern void
-_mesa_lookup_rgba_chan(const struct gl_color_table *table,
- GLuint n, GLchan rgba[][4]);
-
-
-extern void
-_mesa_shift_and_offset_ci(const GLcontext *ctx, GLuint n,
- GLuint indexes[]);
-
-
-extern void
-_mesa_map_ci(const GLcontext *ctx, GLuint n, GLuint index[]);
-
-
-extern void
-_mesa_map_ci_to_rgba_chan(const GLcontext *ctx,
- GLuint n, const GLuint index[],
- GLchan rgba[][4]);
+_mesa_lookup_rgba_ubyte(const struct gl_color_table *table,
+ GLuint n, GLubyte rgba[][4]);
extern void
@@ -123,18 +108,8 @@ _mesa_map_ci_to_rgba(const GLcontext *ctx,
extern void
-_mesa_map_ci8_to_rgba(const GLcontext *ctx,
- GLuint n, const GLubyte index[],
- GLchan rgba[][4]);
-
-
-extern void
-_mesa_shift_and_offset_stencil(const GLcontext *ctx, GLuint n,
- GLstencil indexes[]);
-
-
-extern void
-_mesa_map_stencil(const GLcontext *ctx, GLuint n, GLstencil index[]);
+_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[],
+ GLubyte rgba[][4]);
extern void
@@ -142,11 +117,6 @@ _mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n,
GLfloat depthValues[]);
-extern void
-_mesa_chan_to_float_span(const GLcontext *ctx, GLuint n,
- CONST GLchan rgba[][4], GLfloat rgbaf[][4]);
-
-
extern void
_mesa_update_pixel( GLcontext *ctx, GLuint newstate );
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index 4f490db724f..ddf2ac51d3b 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -994,6 +994,7 @@ void _mesa_init_rastpos( GLcontext * ctx )
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
+ ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterIndex = 1.0;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
diff --git a/src/mesa/main/sources b/src/mesa/main/sources
new file mode 100644
index 00000000000..dfcff89e4b6
--- /dev/null
+++ b/src/mesa/main/sources
@@ -0,0 +1,138 @@
+# List of source files in this directory used for X.org xserver build
+MESA_MAIN_SOURCES = \
+accum.c \
+api_arrayelt.c \
+api_loopback.c \
+api_noop.c \
+api_validate.c \
+arrayobj.c \
+attrib.c \
+blend.c \
+bufferobj.c \
+buffers.c \
+clip.c \
+colortab.c \
+context.c \
+convolve.c \
+debug.c \
+depth.c \
+depthstencil.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 \
+mipmap.c \
+mm.c \
+occlude.c \
+pixel.c \
+points.c \
+polygon.c \
+rastpos.c \
+rbadaptors.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 \
+$(VSNPRINTF_SOURCES) \
+vtxfmt.c
+
+MESA_VSNPRINTF_SOURCES = \
+vsnprintf.c
+
+MESA_MAIN_HEADERS = \
+accum.h \
+api_arrayelt.h \
+api_eval.h \
+api_loopback.h \
+api_noop.h \
+api_validate.h \
+arrayobj.h \
+attrib.h \
+bitset.h \
+blend.h \
+bufferobj.h \
+buffers.h \
+clip.h \
+colormac.h \
+colortab.h \
+config.h \
+context.h \
+convolve.h \
+dd.h \
+debug.h \
+depth.h \
+depthstencil.h \
+dlist.h \
+drawpix.h \
+enable.h \
+enums.h \
+eval.h \
+extensions.h \
+fbobject.h \
+feedback.h \
+fog.h \
+framebuffer.h \
+get.h \
+glheader.h \
+hash.h \
+hint.h \
+histogram.h \
+image.h \
+imports.h \
+light.h \
+lines.h \
+macros.h \
+matrix.h \
+mipmap.h \
+mm.h \
+mtypes.h \
+occlude.h \
+pixel.h \
+points.h \
+polygon.h \
+rastpos.h \
+rbadaptors.h \
+renderbuffer.h \
+simple_list.h \
+state.h \
+stencil.h \
+texcompress.h \
+texenvprogram.h \
+texformat.h \
+texformat_tmp.h \
+teximage.h \
+texobj.h \
+texrender.h \
+texstate.h \
+texstore.h \
+varray.h \
+version.h \
+vtxfmt.h \
+vtxfmt_tmp.h
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index b40a5dc5517..e62fbe47d15 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -304,7 +304,6 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_GenTextures(exec, _mesa_GenTextures);
#if _HAVE_FULL_GL
SET_AreTexturesResident(exec, _mesa_AreTexturesResident);
- SET_AreTexturesResidentEXT(exec, _mesa_AreTexturesResident);
SET_ColorPointer(exec, _mesa_ColorPointer);
SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D);
SET_CopyTexImage2D(exec, _mesa_CopyTexImage2D);
@@ -313,12 +312,10 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_DisableClientState(exec, _mesa_DisableClientState);
SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer);
SET_EnableClientState(exec, _mesa_EnableClientState);
- SET_GenTexturesEXT(exec, _mesa_GenTextures);
SET_GetPointerv(exec, _mesa_GetPointerv);
SET_IndexPointer(exec, _mesa_IndexPointer);
SET_InterleavedArrays(exec, _mesa_InterleavedArrays);
SET_IsTexture(exec, _mesa_IsTexture);
- SET_IsTextureEXT(exec, _mesa_IsTexture);
SET_NormalPointer(exec, _mesa_NormalPointer);
SET_PopClientAttrib(exec, _mesa_PopClientAttrib);
SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures);
@@ -356,31 +353,18 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D);
SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D);
SET_GetColorTable(exec, _mesa_GetColorTable);
- SET_GetColorTableSGI(exec, _mesa_GetColorTable);
SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv);
- SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv);
SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv);
- SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv);
SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter);
- SET_GetConvolutionFilterEXT(exec, _mesa_GetConvolutionFilter);
SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv);
- SET_GetConvolutionParameterfvEXT(exec, _mesa_GetConvolutionParameterfv);
SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv);
- SET_GetConvolutionParameterivEXT(exec, _mesa_GetConvolutionParameteriv);
SET_GetHistogram(exec, _mesa_GetHistogram);
- SET_GetHistogramEXT(exec, _mesa_GetHistogram);
SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv);
- SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv);
SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv);
- SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv);
SET_GetMinmax(exec, _mesa_GetMinmax);
- SET_GetMinmaxEXT(exec, _mesa_GetMinmax);
SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv);
- SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv);
SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv);
- SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv);
SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter);
- SET_GetSeparableFilterEXT(exec, _mesa_GetSeparableFilter);
SET_Histogram(exec, _mesa_Histogram);
SET_Minmax(exec, _mesa_Minmax);
SET_ResetHistogram(exec, _mesa_ResetHistogram);
@@ -392,6 +376,32 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate);
SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate);
SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate);
+#if FEATURE_ARB_shader_objects
+ SET_AttachShader(exec, _mesa_AttachShader);
+ SET_CreateProgram(exec, _mesa_CreateProgram);
+ SET_CreateShader(exec, _mesa_CreateShader);
+ SET_DeleteProgram(exec, _mesa_DeleteProgram);
+ SET_DeleteShader(exec, _mesa_DeleteShader);
+ SET_DetachShader(exec, _mesa_DetachShader);
+ SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
+ SET_GetProgramiv(exec, _mesa_GetProgramiv);
+ SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
+ SET_GetShaderiv(exec, _mesa_GetShaderiv);
+ SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
+ SET_IsProgram(exec, _mesa_IsProgram);
+ SET_IsShader(exec, _mesa_IsShader);
+#endif
+
+ /* OpenGL 2.1 */
+#if FEATURE_ARB_shader_objects
+ SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv);
+ SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv);
+ SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv);
+ SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv);
+ SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv);
+ SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv);
+#endif
+
/* 2. GL_EXT_blend_color */
#if 0
@@ -411,7 +421,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)
#endif
/* 11. GL_EXT_histogram */
-#if _HAVE_FULL_GL
+#if 0
SET_GetHistogramEXT(exec, _mesa_GetHistogram);
SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv);
SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv);
@@ -424,8 +434,6 @@ _mesa_init_exec_table(struct _glapi_table *exec)
#if 0
SET_ColorTableSGI(exec, _mesa_ColorTable);
SET_ColorSubTableSGI(exec, _mesa_ColorSubTable);
-#endif
-#if _HAVE_FULL_GL
SET_GetColorTableSGI(exec, _mesa_GetColorTable);
SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv);
SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv);
@@ -525,7 +533,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV);
SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV);
SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV);
- SET_IsProgramNV(exec, _mesa_IsProgram);
+ SET_IsProgramNV(exec, _mesa_IsProgramARB);
SET_LoadProgramNV(exec, _mesa_LoadProgramNV);
SET_ProgramParameter4dNV(exec, _mesa_ProgramParameter4dNV);
SET_ProgramParameter4dvNV(exec, _mesa_ProgramParameter4dvNV);
@@ -1001,9 +1009,7 @@ update_color(GLcontext *ctx)
/* This is needed to support 1.1's RGB logic ops AND
* 1.0's blending logicops.
*/
- ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled ||
- (ctx->Color.BlendEnabled &&
- ctx->Color.BlendEquationRGB == GL_LOGIC_OP));
+ ctx->Color._LogicOpEnabled = RGBA_LOGICOP_ENABLED(ctx);
}
@@ -1021,7 +1027,7 @@ update_color(GLcontext *ctx)
* _mesa_update_lighting() and _mesa_update_tnl_spaces().
*/
void
-_mesa_update_state( GLcontext *ctx )
+_mesa_update_state_locked( GLcontext *ctx )
{
GLbitfield new_state = ctx->NewState;
@@ -1102,4 +1108,17 @@ _mesa_update_state( GLcontext *ctx )
ctx->Array.NewState = 0;
}
+
+/* This is the usual entrypoint for state updates:
+ */
+void
+_mesa_update_state( GLcontext *ctx )
+{
+ _mesa_lock_context_textures(ctx);
+ _mesa_update_state_locked(ctx);
+ _mesa_unlock_context_textures(ctx);
+}
+
+
+
/*@}*/
diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h
index 58cfcc41462..5240d4bf935 100644
--- a/src/mesa/main/state.h
+++ b/src/mesa/main/state.h
@@ -39,5 +39,11 @@ _mesa_init_exec_table(struct _glapi_table *exec);
extern void
_mesa_update_state( GLcontext *ctx );
+/* As above but can only be called between _mesa_lock_context_textures() and
+ * _mesa_unlock_context_textures().
+ */
+extern void
+_mesa_update_state_locked( GLcontext *ctx );
+
#endif
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index 9992ec9b6eb..ad71a81f6e0 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -38,6 +38,10 @@
*
* So either we advertise the GL_EXT_stencil_two_side extension, or OpenGL
* 2.0, but not both.
+ *
+ * Also, note that GL_ATI_separate_stencil is different as well:
+ * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs.
+ * glStencilFuncSeparate(GLenum face, GLenum func, ...).
*/
@@ -406,17 +410,16 @@ _mesa_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
FLUSH_VERTICES(ctx, _NEW_STENCIL);
- if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ if (face != GL_BACK) {
ctx->Stencil.FailFunc[0] = fail;
ctx->Stencil.ZFailFunc[0] = zfail;
ctx->Stencil.ZPassFunc[0] = zpass;
}
- if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ if (face != GL_FRONT) {
ctx->Stencil.FailFunc[1] = fail;
ctx->Stencil.ZFailFunc[1] = zfail;
ctx->Stencil.ZPassFunc[1] = zpass;
}
-
if (ctx->Driver.StencilOpSeparate) {
ctx->Driver.StencilOpSeparate(ctx, face, fail, zfail, zpass);
}
@@ -465,7 +468,6 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
ctx->Stencil.Ref[1] = ref;
ctx->Stencil.ValueMask[1] = mask;
}
-
if (ctx->Driver.StencilFuncSeparate) {
ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask);
}
@@ -486,13 +488,12 @@ _mesa_StencilMaskSeparate(GLenum face, GLuint mask)
FLUSH_VERTICES(ctx, _NEW_STENCIL);
- if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ if (face != GL_BACK) {
ctx->Stencil.WriteMask[0] = mask;
}
- if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ if (face != GL_FRONT) {
ctx->Stencil.WriteMask[1] = mask;
}
-
if (ctx->Driver.StencilMaskSeparate) {
ctx->Driver.StencilMaskSeparate(ctx, face, mask);
}
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index d5943080245..c44d594d683 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -34,6 +34,7 @@
#include "colormac.h"
#include "context.h"
#include "image.h"
+#include "mipmap.h"
#include "texcompress.h"
#include "texformat.h"
#include "texstore.h"
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 18180e12eaf..d3011cedce4 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -35,6 +35,7 @@
#include "context.h"
#include "convolve.h"
#include "image.h"
+#include "mipmap.h"
#include "texcompress.h"
#include "texformat.h"
#include "texstore.h"
@@ -104,7 +105,7 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS)
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- GL_COMPRESSED_RGB_FXT1_3DFX,
+ dstFormat->MesaFormat,
texWidth, (GLubyte *) dstAddr);
fxt1_encode(srcWidth, srcHeight, 3, pixels, srcRowStride,
@@ -161,7 +162,7 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS)
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- GL_COMPRESSED_RGBA_FXT1_3DFX,
+ dstFormat->MesaFormat,
texWidth, (GLubyte *) dstAddr);
fxt1_encode(srcWidth, srcHeight, 4, pixels, srcRowStride,
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index 3ccc8a8df75..99b703de4a5 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -48,6 +48,8 @@
#ifdef __MINGW32__
#define DXTN_LIBNAME "dxtn.dll"
+#define RTLD_LAZY 0
+#define RTLD_GLOBAL 0
#elif defined(__DJGPP__)
#define DXTN_LIBNAME "dxtn.dxe"
#else
@@ -104,7 +106,7 @@ _mesa_dlsym(void *handle, const char *fname)
{
#if USE_EXTERNAL_DXTN_LIB
#ifdef __MINGW32__
- return (GenericFunc) GetProcAddress(handle, fname)
+ return (GenericFunc) GetProcAddress(handle, fname);
#elif defined(__DJGPP__)
/* need '_' prefix on symbol names */
char fname2[1000];
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 5f798cc7df4..5329719cbbb 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -33,7 +33,11 @@
#include "shader/program.h"
#include "shader/program_instruction.h"
-#define MAX_INSTRUCTIONS 100
+/**
+ * According to Glean's texCombine test, no more than 21 instructions
+ * are needed. Allow a few extra just in case.
+ */
+#define MAX_INSTRUCTIONS 24
#define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
@@ -474,7 +478,7 @@ emit_op(struct texenv_fragment_program *p,
GLuint nr = p->program->Base.NumInstructions++;
struct prog_instruction *inst = &p->program->Base.Instructions[nr];
- _mesa_init_instruction(inst);
+ _mesa_init_instructions(inst, 1);
inst->Opcode = op;
emit_arg( &inst->SrcReg[0], src0 );
@@ -571,7 +575,7 @@ static struct ureg register_const4f( struct texenv_fragment_program *p,
values[1] = s1;
values[2] = s2;
values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values );
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
return make_ureg(PROGRAM_STATE_VAR, idx);
}
@@ -988,9 +992,10 @@ load_texunit_sources( struct texenv_fragment_program *p, int unit )
* current texture env/combine mode.
*/
static void
-create_new_program(struct state_key *key, GLcontext *ctx,
+create_new_program(GLcontext *ctx, struct state_key *key,
struct gl_fragment_program *program)
{
+ struct prog_instruction instBuffer[MAX_INSTRUCTIONS];
struct texenv_fragment_program p;
GLuint unit;
struct ureg cf, out;
@@ -1000,18 +1005,19 @@ create_new_program(struct state_key *key, GLcontext *ctx,
p.state = key;
p.program = program;
- p.program->Base.Instructions =
- (struct prog_instruction*) _mesa_malloc(sizeof(struct prog_instruction) * MAX_INSTRUCTIONS);
- p.program->Base.NumInstructions = 0;
+ /* During code generation, use locally-allocated instruction buffer,
+ * then alloc dynamic storage below.
+ */
+ p.program->Base.Instructions = instBuffer;
p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB;
p.program->NumTexIndirections = 1; /* correct? */
p.program->NumTexInstructions = 0;
p.program->NumAluInstructions = 0;
p.program->Base.String = 0;
p.program->Base.NumInstructions =
- p.program->Base.NumTemporaries =
- p.program->Base.NumParameters =
- p.program->Base.NumAttributes = p.program->Base.NumAddressRegs = 0;
+ p.program->Base.NumTemporaries =
+ p.program->Base.NumParameters =
+ p.program->Base.NumAttributes = p.program->Base.NumAddressRegs = 0;
p.program->Base.Parameters = _mesa_new_parameter_list();
p.program->Base.InputsRead = 0;
@@ -1088,17 +1094,28 @@ create_new_program(struct state_key *key, GLcontext *ctx,
ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS);
+ /* Allocate final instruction array */
+ program->Base.Instructions
+ = _mesa_alloc_instructions(program->Base.NumInstructions);
+ if (!program->Base.Instructions) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "generating tex env program");
+ return;
+ }
+ _mesa_memcpy(program->Base.Instructions, instBuffer,
+ sizeof(struct prog_instruction)
+ * program->Base.NumInstructions);
+
/* Notify driver the fragment program has (actually) changed.
*/
- if (ctx->Driver.ProgramStringNotify || DISASSEM) {
- if (ctx->Driver.ProgramStringNotify)
- ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB,
- &p.program->Base );
-
- if (DISASSEM) {
- _mesa_print_program(&p.program->Base);
- _mesa_printf("\n");
- }
+ if (ctx->Driver.ProgramStringNotify) {
+ ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB,
+ &p.program->Base );
+ }
+
+ if (DISASSEM) {
+ _mesa_print_program(&p.program->Base);
+ _mesa_printf("\n");
}
}
@@ -1225,7 +1242,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
(struct gl_fragment_program *)
ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
- create_new_program(&key, ctx, ctx->_TexEnvProgram);
+ create_new_program(ctx, &key, ctx->_TexEnvProgram);
cache_item(&ctx->Texture.env_fp_cache, hash, &key, ctx->_TexEnvProgram);
} else {
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h
index 0d3519188e2..99785da1a0a 100644
--- a/src/mesa/main/texformat_tmp.h
+++ b/src/mesa/main/texformat_tmp.h
@@ -1060,6 +1060,7 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage,
{
const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
const struct gl_color_table *palette;
+ GLubyte texelUB[4];
GLuint index;
GET_CURRENT_CONTEXT(ctx);
@@ -1075,91 +1076,61 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage,
/* Mask the index against size of palette to avoid going out of bounds */
index = (*src) & (palette->Size - 1);
- if (palette->Type == GL_FLOAT) {
- const GLfloat *ftable = (const GLfloat *) palette->Table;
+ {
+ const GLubyte *table = palette->TableUB;
switch (palette->_BaseFormat) {
case GL_ALPHA:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] = 0;
- texel[ACOMP] = (GLchan) (ftable[index] * CHAN_MAX);
- return;
+ texelUB[RCOMP] =
+ texelUB[GCOMP] =
+ texelUB[BCOMP] = 0;
+ texelUB[ACOMP] = table[index];
+ break;;
case GL_LUMINANCE:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] = (GLchan) (ftable[index] * CHAN_MAX);
- texel[ACOMP] = CHAN_MAX;
+ texelUB[RCOMP] =
+ texelUB[GCOMP] =
+ texelUB[BCOMP] = table[index];
+ texelUB[ACOMP] = 255;
break;
case GL_INTENSITY:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] =
- texel[ACOMP] = ftable[index] * CHAN_MAX;
- return;
+ texelUB[RCOMP] =
+ texelUB[GCOMP] =
+ texelUB[BCOMP] =
+ texelUB[ACOMP] = table[index];
+ break;;
case GL_LUMINANCE_ALPHA:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] = (GLchan) (ftable[index * 2 + 0] * CHAN_MAX);
- texel[ACOMP] = (GLchan) (ftable[index * 2 + 1] * CHAN_MAX);
- return;
+ texelUB[RCOMP] =
+ texelUB[GCOMP] =
+ texelUB[BCOMP] = table[index * 2 + 0];
+ texelUB[ACOMP] = table[index * 2 + 1];
+ break;;
case GL_RGB:
- texel[RCOMP] = (GLchan) (ftable[index * 3 + 0] * CHAN_MAX);
- texel[GCOMP] = (GLchan) (ftable[index * 3 + 1] * CHAN_MAX);
- texel[BCOMP] = (GLchan) (ftable[index * 3 + 2] * CHAN_MAX);
- texel[ACOMP] = CHAN_MAX;
- return;
+ texelUB[RCOMP] = table[index * 3 + 0];
+ texelUB[GCOMP] = table[index * 3 + 1];
+ texelUB[BCOMP] = table[index * 3 + 2];
+ texelUB[ACOMP] = 255;
+ break;;
case GL_RGBA:
- texel[RCOMP] = (GLchan) (ftable[index * 4 + 0] * CHAN_MAX);
- texel[GCOMP] = (GLchan) (ftable[index * 4 + 1] * CHAN_MAX);
- texel[BCOMP] = (GLchan) (ftable[index * 4 + 2] * CHAN_MAX);
- texel[ACOMP] = (GLchan) (ftable[index * 4 + 3] * CHAN_MAX);
- return;
- default:
- _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8");
- }
- }
- else {
- const GLchan *table = (const GLchan *) palette->Table;
- switch (palette->_BaseFormat) {
- case GL_ALPHA:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] = 0;
- texel[ACOMP] = table[index];
- return;
- case GL_LUMINANCE:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] = table[index];
- texel[ACOMP] = CHAN_MAX;
- break;
- case GL_INTENSITY:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] =
- texel[ACOMP] = table[index];
- return;
- case GL_LUMINANCE_ALPHA:
- texel[RCOMP] =
- texel[GCOMP] =
- texel[BCOMP] = table[index * 2 + 0];
- texel[ACOMP] = table[index * 2 + 1];
- return;
- case GL_RGB:
- texel[RCOMP] = table[index * 3 + 0];
- texel[GCOMP] = table[index * 3 + 1];
- texel[BCOMP] = table[index * 3 + 2];
- texel[ACOMP] = CHAN_MAX;
- return;
- case GL_RGBA:
- texel[RCOMP] = table[index * 4 + 0];
- texel[GCOMP] = table[index * 4 + 1];
- texel[BCOMP] = table[index * 4 + 2];
- texel[ACOMP] = table[index * 4 + 3];
- return;
+ texelUB[RCOMP] = table[index * 4 + 0];
+ texelUB[GCOMP] = table[index * 4 + 1];
+ texelUB[BCOMP] = table[index * 4 + 2];
+ texelUB[ACOMP] = table[index * 4 + 3];
+ break;;
default:
_mesa_problem(ctx, "Bad palette format in fetch_texel_ci8");
}
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ COPY_4UBV(texel, texelUB);
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ texel[0] = UBYTE_TO_USHORT(texelUB[0]);
+ texel[1] = UBYTE_TO_USHORT(texelUB[1]);
+ texel[2] = UBYTE_TO_USHORT(texelUB[2]);
+ texel[3] = UBYTE_TO_USHORT(texelUB[3]);
+#else
+ texel[0] = UBYTE_TO_FLOAT(texelUB[0]);
+ texel[1] = UBYTE_TO_FLOAT(texelUB[1]);
+ texel[2] = UBYTE_TO_FLOAT(texelUB[2]);
+ texel[3] = UBYTE_TO_FLOAT(texelUB[3]);
+#endif
}
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 14024fec047..543d6efc984 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -73,11 +73,11 @@ _mesa_free_texmemory(void *m)
#if 0
static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img)
{
-#if CHAN_TYPE == GL_FLOAT
- _mesa_problem(NULL, "PrintTexture doesn't support float channels");
+#if CHAN_TYPE != GL_UNSIGNED_BYTE
+ _mesa_problem(NULL, "PrintTexture not supported");
#else
GLuint i, j, c;
- const GLchan *data = (const GLchan *) img->Data;
+ const GLubyte *data = (const GLubyte *) img->Data;
if (!data) {
_mesa_printf("No texture data\n");
@@ -706,9 +706,12 @@ _mesa_free_texture_image_data(GLcontext *ctx,
void
_mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *texImage )
{
- if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
+ /* Free texImage->Data and/or any other driver-specific texture
+ * image storage.
+ */
+ ASSERT(ctx->Driver.FreeTexImageData);
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+
ASSERT(texImage->Data == NULL);
if (texImage->ImageOffsets)
_mesa_free(texImage->ImageOffsets);
@@ -801,24 +804,23 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit,
* \sa gl_texture_unit.
*/
struct gl_texture_image *
-_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
- GLenum target, GLint level)
+_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj,
+ GLenum target, GLint level)
{
- ASSERT(texUnit);
- ASSERT(level < MAX_TEXTURE_LEVELS);
+ ASSERT(texObj);
+
+ if (level < 0 || level >= MAX_TEXTURE_LEVELS)
+ return NULL;
+
switch (target) {
case GL_TEXTURE_1D:
- return texUnit->Current1D->Image[0][level];
case GL_PROXY_TEXTURE_1D:
- return ctx->Texture.Proxy1D->Image[0][level];
case GL_TEXTURE_2D:
- return texUnit->Current2D->Image[0][level];
case GL_PROXY_TEXTURE_2D:
- return ctx->Texture.Proxy2D->Image[0][level];
case GL_TEXTURE_3D:
- return texUnit->Current3D->Image[0][level];
case GL_PROXY_TEXTURE_3D:
- return ctx->Texture.Proxy3D->Image[0][level];
+ return texObj->Image[0][level];
+
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
@@ -828,33 +830,25 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
if (ctx->Extensions.ARB_texture_cube_map) {
GLuint face = ((GLuint) target -
(GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X);
- return texUnit->CurrentCubeMap->Image[face][level];
+ return texObj->Image[face][level];
}
else
return NULL;
+
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
if (ctx->Extensions.ARB_texture_cube_map)
- return ctx->Texture.ProxyCubeMap->Image[0][level];
+ return texObj->Image[0][level];
else
return NULL;
+
case GL_TEXTURE_RECTANGLE_NV:
- if (ctx->Extensions.NV_texture_rectangle) {
- ASSERT(level == 0);
- return texUnit->CurrentRect->Image[0][level];
- }
- else {
- return NULL;
- }
case GL_PROXY_TEXTURE_RECTANGLE_NV:
- if (ctx->Extensions.NV_texture_rectangle) {
- ASSERT(level == 0);
- return ctx->Texture.ProxyRect->Image[0][level];
- }
- else {
+ if (ctx->Extensions.NV_texture_rectangle && level == 0)
+ return texObj->Image[0][level];
+ else
return NULL;
- }
+
default:
- _mesa_problem(ctx, "bad target in _mesa_select_tex_image()");
return NULL;
}
}
@@ -866,22 +860,25 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
* out of memory.
*/
struct gl_texture_image *
-_mesa_get_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
+_mesa_get_tex_image(GLcontext *ctx, struct gl_texture_object *texObj,
GLenum target, GLint level)
{
struct gl_texture_image *texImage;
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+
+ if (!texObj)
+ return NULL;
+
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
if (!texImage) {
- struct gl_texture_object *texObj;
texImage = ctx->Driver.NewTextureImage(ctx);
if (!texImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "texture image allocation");
return NULL;
}
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- ASSERT(texObj);
+
_mesa_set_tex_image(texObj, target, level, texImage);
}
+
return texImage;
}
@@ -1584,9 +1581,6 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
GLint width, GLint height, GLint depth,
GLenum format, GLenum type )
{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_texture_image *destTex;
-
/* Check target */
if (dimensions == 1) {
if (target != GL_TEXTURE_1D) {
@@ -1596,14 +1590,13 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
}
else if (dimensions == 2) {
if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
- target <=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
if (!ctx->Extensions.ARB_texture_cube_map) {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" );
return GL_TRUE;
}
}
- else if (ctx->Extensions.NV_texture_rectangle &&
- target == GL_TEXTURE_RECTANGLE_NV) {
+ else if (target == GL_TEXTURE_RECTANGLE_NV) {
if (!ctx->Extensions.NV_texture_rectangle) {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" );
return GL_TRUE;
@@ -1647,8 +1640,23 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
return GL_TRUE;
}
- destTex = _mesa_select_tex_image(ctx, texUnit, target, level);
+ if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexSubImage%dD(format or type)", dimensions);
+ return GL_TRUE;
+ }
+
+ return GL_FALSE;
+}
+static GLboolean
+subtexture_error_check2( GLcontext *ctx, GLuint dimensions,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type,
+ const struct gl_texture_image *destTex )
+{
if (!destTex) {
/* undefined image level */
_mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD", dimensions);
@@ -1688,12 +1696,6 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
}
}
- if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexSubImage%dD(format or type)", dimensions);
- return GL_TRUE;
- }
-
#if FEATURE_EXT_texture_sRGB
if (destTex->InternalFormat == GL_COMPRESSED_SRGB_S3TC_DXT1_EXT ||
destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT ||
@@ -1709,11 +1711,6 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
#endif
if (destTex->IsCompressed) {
- const struct gl_texture_unit *texUnit;
- const struct gl_texture_image *texImage;
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
-
if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) {
/* OK */
}
@@ -1735,12 +1732,12 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
return GL_TRUE;
}
/* size must be multiple of 4 or equal to whole texture size */
- if ((width & 3) && (GLuint) width != texImage->Width) {
+ if ((width & 3) && (GLuint) width != destTex->Width) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexSubImage%D(width)", dimensions);
return GL_TRUE;
}
- if ((height & 3) && (GLuint) height != texImage->Height) {
+ if ((height & 3) && (GLuint) height != destTex->Height) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexSubImage%D(width)", dimensions);
return GL_TRUE;
@@ -1781,6 +1778,11 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions,
/* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */
if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(level=%d)", dimensions, level);
+ return GL_TRUE;
+ }
+
/* Check that the source buffer is complete */
if (ctx->ReadBuffer->Name) {
_mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
@@ -1791,11 +1793,6 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions,
}
}
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexImage%dD(level=%d)", dimensions, level);
- return GL_TRUE;
- }
-
/* Check border */
if (border < 0 || border > 1 ||
((target == GL_TEXTURE_RECTANGLE_NV ||
@@ -1945,11 +1942,8 @@ static GLboolean
copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions,
GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height )
+ GLsizei width, GLsizei height)
{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_texture_image *teximage;
-
/* Check target */
/* Check that the source buffer is complete */
if (ctx->ReadBuffer->Name) {
@@ -2012,7 +2006,16 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions,
return GL_TRUE;
}
- teximage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ return GL_FALSE;
+}
+
+static GLboolean
+copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height,
+ const struct gl_texture_image *teximage )
+{
if (!teximage) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexSubImage%dD(undefined texture level: %d)",
@@ -2186,59 +2189,66 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
if (!pixels)
return;
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- /* invalid mipmap level, not an error */
- return;
- }
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ /* invalid mipmap level, not an error */
+ goto out;
+ }
- /* Make sure the requested image format is compatible with the
- * texture's format. Note that a color index texture can be converted
- * to RGBA so that combo is allowed.
- */
- if (is_color_format(format)
- && !is_color_format(texImage->TexFormat->BaseFormat)
- && !is_index_format(texImage->TexFormat->BaseFormat)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
- return;
- }
- else if (is_index_format(format)
- && !is_index_format(texImage->TexFormat->BaseFormat)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
- return;
- }
- else if (is_depth_format(format)
- && !is_depth_format(texImage->TexFormat->BaseFormat)
- && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
- return;
- }
- else if (is_ycbcr_format(format)
- && !is_ycbcr_format(texImage->TexFormat->BaseFormat)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
- return;
- }
- else if (is_depthstencil_format(format)
- && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
- return;
- }
- if (ctx->Pack.BufferObj->Name) {
- /* packing texture image into a PBO */
- const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2;
- if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width,
- texImage->Height, texImage->Depth,
- format, type, pixels)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetTexImage(invalid PBO access)");
- return;
+ /* Make sure the requested image format is compatible with the
+ * texture's format. Note that a color index texture can be converted
+ * to RGBA so that combo is allowed.
+ */
+ if (is_color_format(format)
+ && !is_color_format(texImage->TexFormat->BaseFormat)
+ && !is_index_format(texImage->TexFormat->BaseFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
+ goto out;
+ }
+ else if (is_index_format(format)
+ && !is_index_format(texImage->TexFormat->BaseFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
+ goto out;
+ }
+ else if (is_depth_format(format)
+ && !is_depth_format(texImage->TexFormat->BaseFormat)
+ && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
+ goto out;
+ }
+ else if (is_ycbcr_format(format)
+ && !is_ycbcr_format(texImage->TexFormat->BaseFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
+ goto out;
+ }
+ else if (is_depthstencil_format(format)
+ && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
+ goto out;
+ }
+
+ if (ctx->Pack.BufferObj->Name) {
+ /* packing texture image into a PBO */
+ const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2;
+ if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width,
+ texImage->Height, texImage->Depth,
+ format, type, pixels)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetTexImage(invalid PBO access)");
+ goto out;
+ }
}
- }
- /* typically, this will call _mesa_get_teximage() */
- ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels,
- texObj, texImage);
+ /* typically, this will call _mesa_get_teximage() */
+ ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels,
+ texObj, texImage);
+
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -2301,40 +2311,47 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
return; /* error was recorded */
}
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
-
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
- clear_teximage_fields(texImage); /* not really needed, but helpful */
- _mesa_init_teximage_fields(ctx, target, texImage,
- postConvWidth, 1, 1,
- border, internalFormat);
-
if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
- _mesa_update_state(ctx);
+ _mesa_update_state(ctx);
- ASSERT(ctx->Driver.TexImage1D);
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
- /* Give the texture to the driver! <pixels> may be null! */
- (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat,
- width, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
+ ASSERT(texImage->Data == NULL);
- ASSERT(texImage->TexFormat);
+ clear_teximage_fields(texImage); /* not really needed, but helpful */
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ postConvWidth, 1, 1,
+ border, internalFormat);
+
+ ASSERT(ctx->Driver.TexImage1D);
- update_fbo_texture(ctx, texObj, face, level);
+ /* Give the texture to the driver! <pixels> may be null! */
+ (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat,
+ width, border, format, type, pixels,
+ &ctx->Unpack, texObj, texImage);
+
+ ASSERT(texImage->TexFormat);
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ update_fbo_texture(ctx, texObj, face, level);
+
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
@@ -2396,39 +2413,46 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
return; /* error was recorded */
}
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
- clear_teximage_fields(texImage); /* not really needed, but helpful */
- _mesa_init_teximage_fields(ctx, target, texImage,
- postConvWidth, postConvHeight, 1,
- border, internalFormat);
-
if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
- _mesa_update_state(ctx);
-
- ASSERT(ctx->Driver.TexImage2D);
-
- /* Give the texture to the driver! <pixels> may be null! */
- (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat,
- width, height, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- ASSERT(texImage->TexFormat);
+ _mesa_update_state(ctx);
- update_fbo_texture(ctx, texObj, face, level);
-
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+
+ ASSERT(texImage->Data == NULL);
+ clear_teximage_fields(texImage); /* not really needed, but helpful */
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ postConvWidth, postConvHeight, 1,
+ border, internalFormat);
+
+ ASSERT(ctx->Driver.TexImage2D);
+
+ /* Give the texture to the driver! <pixels> may be null! */
+ (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat,
+ width, height, border, format, type, pixels,
+ &ctx->Unpack, texObj, texImage);
+
+ ASSERT(texImage->TexFormat);
+
+ update_fbo_texture(ctx, texObj, face, level);
+
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
else if (target == GL_PROXY_TEXTURE_2D ||
(target == GL_PROXY_TEXTURE_CUBE_MAP_ARB &&
@@ -2486,39 +2510,46 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
return; /* error was recorded */
}
+ if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ _mesa_update_state(ctx);
+
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
- clear_teximage_fields(texImage); /* not really needed, but helpful */
- _mesa_init_teximage_fields(ctx, target, texImage,
- width, height, depth,
- border, internalFormat);
-
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
- _mesa_update_state(ctx);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+
+ ASSERT(texImage->Data == NULL);
+ clear_teximage_fields(texImage); /* not really needed, but helpful */
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ width, height, depth,
+ border, internalFormat);
- ASSERT(ctx->Driver.TexImage3D);
+ ASSERT(ctx->Driver.TexImage3D);
- /* Give the texture to the driver! <pixels> may be null! */
- (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat,
- width, height, depth, border, format, type,
- pixels, &ctx->Unpack, texObj, texImage);
+ /* Give the texture to the driver! <pixels> may be null! */
+ (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat,
+ width, height, depth, border, format, type,
+ pixels, &ctx->Unpack, texObj, texImage);
- ASSERT(texImage->TexFormat);
+ ASSERT(texImage->TexFormat);
- update_fbo_texture(ctx, texObj, face, level);
+ update_fbo_texture(ctx, texObj, face, level);
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
@@ -2566,7 +2597,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
GLsizei postConvWidth = width;
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
+ struct gl_texture_image *texImage = NULL;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -2579,26 +2610,38 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
}
if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0,
- postConvWidth, 1, 1, format, type)) {
+ postConvWidth, 1, 1, format, type)) {
return; /* error was detected */
}
+
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- assert(texImage);
+ assert(texObj);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- if (width == 0)
- return; /* no-op, not an error */
+ if (subtexture_error_check2(ctx, 1, target, level, xoffset, 0, 0,
+ postConvWidth, 1, 1, format, type, texImage)) {
+ goto out; /* error was detected */
+ }
- /* If we have a border, xoffset=-1 is legal. Bias by border width */
- xoffset += texImage->Border;
+ if (width == 0)
+ goto out; /* no-op, not an error */
- ASSERT(ctx->Driver.TexSubImage1D);
- (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
- format, type, pixels, &ctx->Unpack,
- texObj, texImage);
- ctx->NewState |= _NEW_TEXTURE;
+ /* If we have a border, xoffset=-1 is legal. Bias by border width */
+ xoffset += texImage->Border;
+
+ ASSERT(ctx->Driver.TexSubImage1D);
+ (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
+ format, type, pixels, &ctx->Unpack,
+ texObj, texImage);
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -2626,27 +2669,37 @@ _mesa_TexSubImage2D( GLenum target, GLint level,
}
if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0,
- postConvWidth, postConvHeight, 1, format, type)) {
+ postConvWidth, postConvHeight, 1, format, type)) {
return; /* error was detected */
}
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- assert(texImage);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- if (width == 0 || height == 0)
- return; /* no-op, not an error */
+ if (subtexture_error_check2(ctx, 2, target, level, xoffset, yoffset, 0,
+ postConvWidth, postConvHeight, 1, format, type,
+ texImage)) {
+ goto out; /* error was detected */
+ }
- /* If we have a border, xoffset=-1 is legal. Bias by border width */
- xoffset += texImage->Border;
- yoffset += texImage->Border;
+ if (width == 0 || height == 0)
+ goto out; /* no-op, not an error */
- ASSERT(ctx->Driver.TexSubImage2D);
- (*ctx->Driver.TexSubImage2D)(ctx, target, level, xoffset, yoffset,
- width, height, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
- ctx->NewState |= _NEW_TEXTURE;
+ /* If we have a border, xoffset=-1 is legal. Bias by border width */
+ xoffset += texImage->Border;
+ yoffset += texImage->Border;
+
+ ASSERT(ctx->Driver.TexSubImage2D);
+ (*ctx->Driver.TexSubImage2D)(ctx, target, level, xoffset, yoffset,
+ width, height, format, type, pixels,
+ &ctx->Unpack, texObj, texImage);
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -2674,24 +2727,34 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- assert(texImage);
-
- if (width == 0 || height == 0 || height == 0)
- return; /* no-op, not an error */
-
- /* If we have a border, xoffset=-1 is legal. Bias by border width */
- xoffset += texImage->Border;
- yoffset += texImage->Border;
- zoffset += texImage->Border;
-
- ASSERT(ctx->Driver.TexSubImage3D);
- (*ctx->Driver.TexSubImage3D)(ctx, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage );
- ctx->NewState |= _NEW_TEXTURE;
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+
+ if (subtexture_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, type, texImage)) {
+ goto out; /* error was detected */
+ }
+
+ if (width == 0 || height == 0 || height == 0)
+ goto out; /* no-op, not an error */
+
+ /* If we have a border, xoffset=-1 is legal. Bias by border width */
+ xoffset += texImage->Border;
+ yoffset += texImage->Border;
+ zoffset += texImage->Border;
+
+ ASSERT(ctx->Driver.TexSubImage3D);
+ (*ctx->Driver.TexSubImage3D)(ctx, target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, pixels,
+ &ctx->Unpack, texObj, texImage );
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -2723,32 +2786,39 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+
+ ASSERT(texImage->Data == NULL);
- clear_teximage_fields(texImage); /* not really needed, but helpful */
- _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1,
- border, internalFormat);
+ clear_teximage_fields(texImage); /* not really needed, but helpful */
+ _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1,
+ border, internalFormat);
- ASSERT(ctx->Driver.CopyTexImage1D);
- (*ctx->Driver.CopyTexImage1D)(ctx, target, level, internalFormat,
- x, y, width, border);
+ ASSERT(ctx->Driver.CopyTexImage1D);
+ (*ctx->Driver.CopyTexImage1D)(ctx, target, level, internalFormat,
+ x, y, width, border);
- ASSERT(texImage->TexFormat);
+ ASSERT(texImage->TexFormat);
- update_fbo_texture(ctx, texObj, face, level);
+ update_fbo_texture(ctx, texObj, face, level);
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -2780,41 +2850,50 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
- clear_teximage_fields(texImage); /* not really needed, but helpful */
- _mesa_init_teximage_fields(ctx, target, texImage,
- postConvWidth, postConvHeight, 1,
- border, internalFormat);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
- ASSERT(ctx->Driver.CopyTexImage2D);
- (*ctx->Driver.CopyTexImage2D)(ctx, target, level, internalFormat,
- x, y, width, height, border);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+
+ ASSERT(texImage->Data == NULL);
- ASSERT(texImage->TexFormat);
+ clear_teximage_fields(texImage); /* not really needed, but helpful */
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ postConvWidth, postConvHeight, 1,
+ border, internalFormat);
+
+ ASSERT(ctx->Driver.CopyTexImage2D);
+ (*ctx->Driver.CopyTexImage2D)(ctx, target, level, internalFormat,
+ x, y, width, height, border);
+
+ ASSERT(texImage->TexFormat);
- update_fbo_texture(ctx, texObj, face, level);
+ update_fbo_texture(ctx, texObj, face, level);
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
-
void GLAPIENTRY
_mesa_CopyTexSubImage1D( GLenum target, GLint level,
GLint xoffset, GLint x, GLint y, GLsizei width )
{
struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLsizei postConvWidth = width;
GET_CURRENT_CONTEXT(ctx);
@@ -2831,15 +2910,27 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
return;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- /* If we have a border, xoffset=-1 is legal. Bias by border width */
- xoffset += texImage->Border;
+ if (copytexsubimage_error_check2(ctx, 1, target, level,
+ xoffset, 0, 0, postConvWidth, 1,
+ texImage))
+ goto out;
+
+
+ /* If we have a border, xoffset=-1 is legal. Bias by border width */
+ xoffset += texImage->Border;
- ASSERT(ctx->Driver.CopyTexSubImage1D);
- (*ctx->Driver.CopyTexSubImage1D)(ctx, target, level, xoffset, x, y, width);
- ctx->NewState |= _NEW_TEXTURE;
+ ASSERT(ctx->Driver.CopyTexSubImage1D);
+ (*ctx->Driver.CopyTexSubImage1D)(ctx, target, level, xoffset, x, y, width);
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -2850,6 +2941,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
@@ -2866,17 +2958,27 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
return;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- /* If we have a border, xoffset=-1 is legal. Bias by border width */
- xoffset += texImage->Border;
- yoffset += texImage->Border;
+ if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0,
+ postConvWidth, postConvHeight, texImage))
+ goto out;
- ASSERT(ctx->Driver.CopyTexSubImage2D);
- (*ctx->Driver.CopyTexSubImage2D)(ctx, target, level,
- xoffset, yoffset, x, y, width, height);
- ctx->NewState |= _NEW_TEXTURE;
+ /* If we have a border, xoffset=-1 is legal. Bias by border width */
+ xoffset += texImage->Border;
+ yoffset += texImage->Border;
+
+ ASSERT(ctx->Driver.CopyTexSubImage2D);
+ (*ctx->Driver.CopyTexSubImage2D)(ctx, target, level,
+ xoffset, yoffset, x, y, width, height);
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -2887,6 +2989,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLsizei postConvWidth = width, postConvHeight = height;
GET_CURRENT_CONTEXT(ctx);
@@ -2903,19 +3006,30 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
return;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- /* If we have a border, xoffset=-1 is legal. Bias by border width */
- xoffset += texImage->Border;
- yoffset += texImage->Border;
- zoffset += texImage->Border;
+ if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset,
+ zoffset, postConvWidth, postConvHeight,
+ texImage))
+ goto out;
- ASSERT(ctx->Driver.CopyTexSubImage3D);
- (*ctx->Driver.CopyTexSubImage3D)(ctx, target, level,
- xoffset, yoffset, zoffset,
- x, y, width, height);
- ctx->NewState |= _NEW_TEXTURE;
+ /* If we have a border, xoffset=-1 is legal. Bias by border width */
+ xoffset += texImage->Border;
+ yoffset += texImage->Border;
+ zoffset += texImage->Border;
+
+ ASSERT(ctx->Driver.CopyTexSubImage3D);
+ (*ctx->Driver.CopyTexSubImage3D)(ctx, target, level,
+ xoffset, yoffset, zoffset,
+ x, y, width, height);
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -3136,28 +3250,35 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
- _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1,
- border, internalFormat);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+ ASSERT(texImage->Data == NULL);
- ASSERT(ctx->Driver.CompressedTexImage1D);
- (*ctx->Driver.CompressedTexImage1D)(ctx, target, level,
- internalFormat, width, border,
- imageSize, data,
- texObj, texImage);
+ _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1,
+ border, internalFormat);
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ ASSERT(ctx->Driver.CompressedTexImage1D);
+ (*ctx->Driver.CompressedTexImage1D)(ctx, target, level,
+ internalFormat, width, border,
+ imageSize, data,
+ texObj, texImage);
+
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
@@ -3179,11 +3300,18 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
else {
/* store the teximage parameters */
struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1,
- border, internalFormat);
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1,
+ border, internalFormat);
+ }
+ _mesa_unlock_texture(ctx, texObj);
}
}
else {
@@ -3219,28 +3347,35 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
- _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
- border, internalFormat);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+ ASSERT(texImage->Data == NULL);
- ASSERT(ctx->Driver.CompressedTexImage2D);
- (*ctx->Driver.CompressedTexImage2D)(ctx, target, level,
- internalFormat, width, height,
- border, imageSize, data,
- texObj, texImage);
+ _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
+ border, internalFormat);
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ ASSERT(ctx->Driver.CompressedTexImage2D);
+ (*ctx->Driver.CompressedTexImage2D)(ctx, target, level,
+ internalFormat, width, height,
+ border, imageSize, data,
+ texObj, texImage);
+
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
else if (target == GL_PROXY_TEXTURE_2D ||
(target == GL_PROXY_TEXTURE_CUBE_MAP_ARB &&
@@ -3264,11 +3399,18 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
else {
/* store the teximage parameters */
struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
- border, internalFormat);
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
+ border, internalFormat);
+ }
+ _mesa_unlock_texture(ctx, texObj);
}
}
else {
@@ -3301,29 +3443,35 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_get_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D");
- return;
- }
- else if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
-
- _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth,
- border, internalFormat);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D");
+ goto out;
+ }
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+ ASSERT(texImage->Data == NULL);
- ASSERT(ctx->Driver.CompressedTexImage3D);
- (*ctx->Driver.CompressedTexImage3D)(ctx, target, level,
- internalFormat,
- width, height, depth,
- border, imageSize, data,
- texObj, texImage);
+ _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth,
+ border, internalFormat);
- /* state update */
- texObj->Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ ASSERT(ctx->Driver.CompressedTexImage3D);
+ (*ctx->Driver.CompressedTexImage3D)(ctx, target, level,
+ internalFormat,
+ width, height, depth,
+ border, imageSize, data,
+ texObj, texImage);
+
+ /* state update */
+ texObj->Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
@@ -3345,11 +3493,17 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
else {
/* store the teximage parameters */
struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- _mesa_init_teximage_fields(ctx, target, texImage, width, height,
- depth, border, internalFormat);
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ _mesa_init_teximage_fields(ctx, target, texImage, width, height,
+ depth, border, internalFormat);
+ }
+ _mesa_unlock_texture(ctx, texObj);
}
}
else {
@@ -3382,30 +3536,35 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- assert(texImage);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ assert(texImage);
- if ((GLint) format != texImage->InternalFormat) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCompressedTexSubImage1D(format)");
- return;
- }
+ if ((GLint) format != texImage->InternalFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage1D(format)");
+ goto out;
+ }
- if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)");
- return;
- }
+ if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)");
+ goto out;
+ }
- if (width == 0)
- return; /* no-op, not an error */
+ if (width == 0)
+ goto out; /* no-op, not an error */
- if (ctx->Driver.CompressedTexSubImage1D) {
- (*ctx->Driver.CompressedTexSubImage1D)(ctx, target, level,
- xoffset, width,
- format, imageSize, data,
- texObj, texImage);
+ if (ctx->Driver.CompressedTexSubImage1D) {
+ (*ctx->Driver.CompressedTexSubImage1D)(ctx, target, level,
+ xoffset, width,
+ format, imageSize, data,
+ texObj, texImage);
+ }
+ ctx->NewState |= _NEW_TEXTURE;
}
- ctx->NewState |= _NEW_TEXTURE;
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -3434,31 +3593,36 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- assert(texImage);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ assert(texImage);
- if ((GLint) format != texImage->InternalFormat) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCompressedTexSubImage2D(format)");
- return;
- }
+ if ((GLint) format != texImage->InternalFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage2D(format)");
+ goto out;
+ }
- if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) ||
- ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)");
- return;
- }
+ if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) ||
+ ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)");
+ goto out;
+ }
- if (width == 0 || height == 0)
- return; /* no-op, not an error */
+ if (width == 0 || height == 0)
+ goto out; /* no-op, not an error */
- if (ctx->Driver.CompressedTexSubImage2D) {
- (*ctx->Driver.CompressedTexSubImage2D)(ctx, target, level,
- xoffset, yoffset, width, height,
- format, imageSize, data,
- texObj, texImage);
+ if (ctx->Driver.CompressedTexSubImage2D) {
+ (*ctx->Driver.CompressedTexSubImage2D)(ctx, target, level,
+ xoffset, yoffset, width, height,
+ format, imageSize, data,
+ texObj, texImage);
+ }
+ ctx->NewState |= _NEW_TEXTURE;
}
- ctx->NewState |= _NEW_TEXTURE;
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -3486,33 +3650,38 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- assert(texImage);
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ assert(texImage);
- if ((GLint) format != texImage->InternalFormat) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCompressedTexSubImage3D(format)");
- return;
- }
+ if ((GLint) format != texImage->InternalFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage3D(format)");
+ goto out;
+ }
- if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) ||
- ((height == 1 || height == 2) && (GLuint) height != texImage->Height) ||
- ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)");
- return;
- }
+ if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) ||
+ ((height == 1 || height == 2) && (GLuint) height != texImage->Height) ||
+ ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)");
+ goto out;
+ }
- if (width == 0 || height == 0 || depth == 0)
- return; /* no-op, not an error */
+ if (width == 0 || height == 0 || depth == 0)
+ goto out; /* no-op, not an error */
- if (ctx->Driver.CompressedTexSubImage3D) {
- (*ctx->Driver.CompressedTexSubImage3D)(ctx, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, imageSize, data,
- texObj, texImage);
+ if (ctx->Driver.CompressedTexSubImage3D) {
+ (*ctx->Driver.CompressedTexSubImage3D)(ctx, target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, imageSize, data,
+ texObj, texImage);
+ }
+ ctx->NewState |= _NEW_TEXTURE;
}
- ctx->NewState |= _NEW_TEXTURE;
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -3520,12 +3689,13 @@ void GLAPIENTRY
_mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
{
const struct gl_texture_unit *texUnit;
- const struct gl_texture_object *texObj;
+ struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLint maxLevels;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
if (!texObj) {
@@ -3546,18 +3716,24 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
return;
}
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- if (!texImage) {
- /* probably invalid mipmap level */
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)");
- return;
- }
- if (!texImage->IsCompressed) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImageARB");
- return;
- }
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ /* probably invalid mipmap level */
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)");
+ goto out;
+ }
+
+ if (!texImage->IsCompressed) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImageARB");
+ goto out;
+ }
- /* this typically calls _mesa_get_compressed_teximage() */
- ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj,texImage);
+ /* this typically calls _mesa_get_compressed_teximage() */
+ ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj,texImage);
+ }
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 410789fe046..68457f4728c 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -84,12 +84,12 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit,
extern struct gl_texture_image *
-_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
+_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj,
GLenum target, GLint level);
extern struct gl_texture_image *
-_mesa_get_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
+_mesa_get_tex_image(GLcontext *ctx, struct gl_texture_object *texObj,
GLenum target, GLint level);
@@ -106,6 +106,23 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
GLint internalFormat, GLenum format, GLenum type,
GLint width, GLint height, GLint depth, GLint border);
+
+/* Lock a texture for updating. See also _mesa_lock_context_textures().
+ */
+static INLINE void _mesa_lock_texture(GLcontext *ctx,
+ struct gl_texture_object *texObj)
+{
+ _glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
+ ctx->Shared->TextureStateStamp++;
+ (void) texObj;
+}
+
+static INLINE void _mesa_unlock_texture(GLcontext *ctx,
+ struct gl_texture_object *texObj)
+{
+ _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
+}
+
/*@}*/
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 8b42c2a712c..1d27cd3f7c6 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -697,7 +697,11 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
if (textures[i] > 0) {
struct gl_texture_object *delObj
= _mesa_lookup_texture(ctx, textures[i]);
+
if (delObj) {
+ GLboolean delete;
+
+ _mesa_lock_texture(ctx, delObj);
/* Check if texture is bound to any framebuffer objects.
* If so, unbind.
@@ -724,7 +728,14 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
* XXX all RefCount accesses should be protected by a mutex.
*/
delObj->RefCount--;
- if (delObj->RefCount == 0) {
+ delete = (delObj->RefCount == 0);
+ _mesa_unlock_texture(ctx, delObj);
+
+ /* We know that refcount went to zero above, so this is
+ * the only pointer left to delObj, so we don't have to
+ * worry about locking any more:
+ */
+ if (delete) {
ASSERT(delObj->Name != 0); /* Never delete default tex objs */
ASSERT(ctx->Driver.DeleteTexture);
(*ctx->Driver.DeleteTexture)(ctx, delObj);
@@ -1052,4 +1063,30 @@ _mesa_IsTexture( GLuint texture )
return t && t->Target;
}
+/* Simplest implementation of texture locking: Grab the a new mutex in
+ * the shared context. Examine the shared context state timestamp and
+ * if there has been a change, set the appropriate bits in
+ * ctx->NewState.
+ *
+ * See also _mesa_lock/unlock_texture in texobj.h
+ */
+void _mesa_lock_context_textures( GLcontext *ctx )
+{
+ _glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
+
+ if (ctx->Shared->TextureStateStamp != ctx->TextureStateTimestamp) {
+ ctx->NewState |= _NEW_TEXTURE;
+ ctx->TextureStateTimestamp = ctx->Shared->TextureStateStamp;
+ }
+}
+
+
+void _mesa_unlock_context_textures( GLcontext *ctx )
+{
+ assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
+}
+
/*@}*/
+
+
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index ac66ac69d3c..ec7cf8cd86e 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -61,6 +61,9 @@ extern void
_mesa_test_texobj_completeness( const GLcontext *ctx,
struct gl_texture_object *obj );
+extern void _mesa_unlock_context_textures( GLcontext *ctx );
+extern void _mesa_lock_context_textures( GLcontext *ctx );
+
/*@}*/
@@ -95,4 +98,5 @@ _mesa_IsTexture( GLuint texture );
/*@}*/
+
#endif
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 0687e5760c9..bcedcafe19e 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -144,6 +144,8 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst )
dst->Texture.Unit[i].Combine.ScaleShiftA = src->Texture.Unit[i].Combine.ScaleShiftA;
/* copy texture object bindings, not contents of texture objects */
+ _mesa_lock_context_textures(dst);
+
copy_texture_binding(src, &dst->Texture.Unit[i].Current1D,
src->Texture.Unit[i].Current1D);
copy_texture_binding(src, &dst->Texture.Unit[i].Current2D,
@@ -154,6 +156,8 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst )
src->Texture.Unit[i].CurrentCubeMap);
copy_texture_binding(src, &dst->Texture.Unit[i].CurrentRect,
src->Texture.Unit[i].CurrentRect);
+
+ _mesa_unlock_context_textures(dst);
}
}
@@ -1700,6 +1704,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
GLenum pname, GLint *params )
{
const struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
const struct gl_texture_image *img = NULL;
GLuint dimensions;
GLboolean isProxy;
@@ -1734,14 +1739,17 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
return;
}
- img = _mesa_select_tex_image(ctx, texUnit, target, level);
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ _mesa_lock_texture(ctx, texObj);
+
+ img = _mesa_select_tex_image(ctx, texObj, target, level);
if (!img || !img->TexFormat) {
/* undefined texture image */
if (pname == GL_TEXTURE_COMPONENTS)
*params = 1;
else
*params = 0;
- return;
+ goto out;
}
isProxy = _mesa_is_proxy_texture(target);
@@ -1749,37 +1757,37 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
switch (pname) {
case GL_TEXTURE_WIDTH:
*params = img->Width;
- return;
+ break;
case GL_TEXTURE_HEIGHT:
*params = img->Height;
- return;
+ break;
case GL_TEXTURE_DEPTH:
*params = img->Depth;
- return;
+ break;
case GL_TEXTURE_INTERNAL_FORMAT:
*params = img->InternalFormat;
- return;
+ break;
case GL_TEXTURE_BORDER:
*params = img->Border;
- return;
+ break;
case GL_TEXTURE_RED_SIZE:
if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->RedBits;
else
*params = 0;
- return;
+ break;
case GL_TEXTURE_GREEN_SIZE:
if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->GreenBits;
else
*params = 0;
- return;
+ break;
case GL_TEXTURE_BLUE_SIZE:
if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->BlueBits;
else
*params = 0;
- return;
+ break;
case GL_TEXTURE_ALPHA_SIZE:
if (img->_BaseFormat == GL_ALPHA ||
img->_BaseFormat == GL_LUMINANCE_ALPHA ||
@@ -1787,7 +1795,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = img->TexFormat->AlphaBits;
else
*params = 0;
- return;
+ break;
case GL_TEXTURE_INTENSITY_SIZE:
if (img->_BaseFormat != GL_INTENSITY)
*params = 0;
@@ -1795,7 +1803,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = img->TexFormat->IntensityBits;
else /* intensity probably stored as rgb texture */
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
- return;
+ break;
case GL_TEXTURE_LUMINANCE_SIZE:
if (img->_BaseFormat != GL_LUMINANCE &&
img->_BaseFormat != GL_LUMINANCE_ALPHA)
@@ -1804,13 +1812,13 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = img->TexFormat->LuminanceBits;
else /* luminance probably stored as rgb texture */
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
- return;
+ break;
case GL_TEXTURE_INDEX_SIZE_EXT:
if (img->_BaseFormat == GL_COLOR_INDEX)
*params = img->TexFormat->IndexBits;
else
*params = 0;
- return;
+ break;
case GL_TEXTURE_DEPTH_SIZE_ARB:
if (ctx->Extensions.SGIX_depth_texture ||
ctx->Extensions.ARB_depth_texture)
@@ -1818,7 +1826,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
else
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
- return;
+ break;
case GL_TEXTURE_STENCIL_SIZE_EXT:
if (ctx->Extensions.EXT_packed_depth_stencil) {
*params = img->TexFormat->StencilBits;
@@ -1827,7 +1835,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
@@ -1849,7 +1857,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
case GL_TEXTURE_COMPRESSED:
if (ctx->Extensions.ARB_texture_compression) {
*params = (GLint) img->IsCompressed;
@@ -1858,7 +1866,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
/* GL_ARB_texture_float */
case GL_TEXTURE_RED_TYPE_ARB:
@@ -1869,7 +1877,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
case GL_TEXTURE_GREEN_TYPE_ARB:
if (ctx->Extensions.ARB_texture_float) {
*params = img->TexFormat->GreenBits ? img->TexFormat->DataType : GL_NONE;
@@ -1878,7 +1886,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
case GL_TEXTURE_BLUE_TYPE_ARB:
if (ctx->Extensions.ARB_texture_float) {
*params = img->TexFormat->BlueBits ? img->TexFormat->DataType : GL_NONE;
@@ -1887,7 +1895,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
case GL_TEXTURE_ALPHA_TYPE_ARB:
if (ctx->Extensions.ARB_texture_float) {
*params = img->TexFormat->AlphaBits ? img->TexFormat->DataType : GL_NONE;
@@ -1896,7 +1904,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
case GL_TEXTURE_LUMINANCE_TYPE_ARB:
if (ctx->Extensions.ARB_texture_float) {
*params = img->TexFormat->LuminanceBits ? img->TexFormat->DataType : GL_NONE;
@@ -1905,7 +1913,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
case GL_TEXTURE_INTENSITY_TYPE_ARB:
if (ctx->Extensions.ARB_texture_float) {
*params = img->TexFormat->IntensityBits ? img->TexFormat->DataType : GL_NONE;
@@ -1914,7 +1922,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
case GL_TEXTURE_DEPTH_TYPE_ARB:
if (ctx->Extensions.ARB_texture_float) {
*params = img->TexFormat->DepthBits ? img->TexFormat->DataType : GL_NONE;
@@ -1923,12 +1931,15 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
- return;
+ break;
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
}
+
+ out:
+ _mesa_unlock_texture(ctx, texObj);
}
@@ -1938,6 +1949,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
{
struct gl_texture_unit *texUnit;
struct gl_texture_object *obj;
+ GLboolean error = GL_FALSE;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -1955,28 +1967,29 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
return;
}
+ _mesa_lock_texture(ctx, obj);
switch (pname) {
case GL_TEXTURE_MAG_FILTER:
*params = ENUM_TO_FLOAT(obj->MagFilter);
- return;
+ break;
case GL_TEXTURE_MIN_FILTER:
*params = ENUM_TO_FLOAT(obj->MinFilter);
- return;
+ break;
case GL_TEXTURE_WRAP_S:
*params = ENUM_TO_FLOAT(obj->WrapS);
- return;
+ break;
case GL_TEXTURE_WRAP_T:
*params = ENUM_TO_FLOAT(obj->WrapT);
- return;
+ break;
case GL_TEXTURE_WRAP_R:
*params = ENUM_TO_FLOAT(obj->WrapR);
- return;
+ break;
case GL_TEXTURE_BORDER_COLOR:
params[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F);
params[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F);
params[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F);
params[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F);
- return;
+ break;
case GL_TEXTURE_RESIDENT:
{
GLboolean resident;
@@ -1986,82 +1999,94 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
resident = GL_TRUE;
*params = ENUM_TO_FLOAT(resident);
}
- return;
+ break;
case GL_TEXTURE_PRIORITY:
*params = obj->Priority;
- return;
+ break;
case GL_TEXTURE_MIN_LOD:
*params = obj->MinLod;
- return;
+ break;
case GL_TEXTURE_MAX_LOD:
*params = obj->MaxLod;
- return;
+ break;
case GL_TEXTURE_BASE_LEVEL:
*params = (GLfloat) obj->BaseLevel;
- return;
+ break;
case GL_TEXTURE_MAX_LEVEL:
*params = (GLfloat) obj->MaxLevel;
- return;
+ break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
*params = obj->MaxAnisotropy;
- return;
}
+ else
+ error = 1;
break;
case GL_TEXTURE_COMPARE_SGIX:
if (ctx->Extensions.SGIX_shadow) {
*params = (GLfloat) obj->CompareFlag;
- return;
}
+ else
+ error = 1;
break;
case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
if (ctx->Extensions.SGIX_shadow) {
*params = (GLfloat) obj->CompareOperator;
- return;
}
+ else
+ error = 1;
break;
case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
*params = obj->ShadowAmbient;
- return;
}
+ else
+ error = 1;
break;
case GL_GENERATE_MIPMAP_SGIS:
if (ctx->Extensions.SGIS_generate_mipmap) {
*params = (GLfloat) obj->GenerateMipmap;
- return;
}
+ else
+ error = 1;
break;
case GL_TEXTURE_COMPARE_MODE_ARB:
if (ctx->Extensions.ARB_shadow) {
*params = (GLfloat) obj->CompareMode;
- return;
}
+ else
+ error = 1;
break;
case GL_TEXTURE_COMPARE_FUNC_ARB:
if (ctx->Extensions.ARB_shadow) {
*params = (GLfloat) obj->CompareFunc;
- return;
}
+ else
+ error = 1;
break;
case GL_DEPTH_TEXTURE_MODE_ARB:
if (ctx->Extensions.ARB_depth_texture) {
*params = (GLfloat) obj->DepthMode;
- return;
}
+ else
+ error = 1;
break;
case GL_TEXTURE_LOD_BIAS:
if (ctx->Extensions.EXT_texture_lod_bias) {
*params = obj->LodBias;
- return;
}
+ else
+ error = 1;
break;
default:
- ; /* silence warnings */
+ error = 1;
+ break;
}
- /* If we get here, pname was an unrecognized enum */
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)",
- pname);
+ if (error)
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)",
+ pname);
+
+ _mesa_unlock_texture(ctx, obj);
}
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 7471934b49d..89563842c25 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -27,7 +27,7 @@
* Brian Paul
*/
-/*
+/**
* The GL texture image functions in teximage.c basically just do
* error checking and data structure allocation. They in turn call
* device driver functions which actually copy/convert/store the user's
@@ -58,16 +58,27 @@
#include "convolve.h"
#include "image.h"
#include "macros.h"
+#include "mipmap.h"
#include "imports.h"
#include "texcompress.h"
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
+#include "enums.h"
-static const GLint ZERO = 4, ONE = 5;
+enum {
+ ZERO = 4,
+ ONE = 5
+};
-static GLboolean can_swizzle(GLenum logicalBaseFormat)
+
+/**
+ * Return GL_TRUE if the given image format is one that be converted
+ * to another format by swizzling.
+ */
+static GLboolean
+can_swizzle(GLenum logicalBaseFormat)
{
switch (logicalBaseFormat) {
case GL_RGBA:
@@ -76,6 +87,12 @@ static GLboolean can_swizzle(GLenum logicalBaseFormat)
case GL_INTENSITY:
case GL_ALPHA:
case GL_LUMINANCE:
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_BGR:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
return GL_TRUE;
default:
return GL_FALSE;
@@ -83,89 +100,172 @@ static GLboolean can_swizzle(GLenum logicalBaseFormat)
}
+
+enum {
+ IDX_LUMINANCE = 0,
+ IDX_ALPHA,
+ IDX_INTENSITY,
+ IDX_LUMINANCE_ALPHA,
+ IDX_RGB,
+ IDX_RGBA,
+ IDX_RED,
+ IDX_GREEN,
+ IDX_BLUE,
+ IDX_BGR,
+ IDX_BGRA,
+ IDX_ABGR,
+ MAX_IDX
+};
+
+#define MAP1(x) MAP4(x, ZERO, ZERO, ZERO)
+#define MAP2(x,y) MAP4(x, y, ZERO, ZERO)
+#define MAP3(x,y,z) MAP4(x, y, z, ZERO)
+#define MAP4(x,y,z,w) { x, y, z, w, ZERO, ONE }
+
+
+static const struct {
+ GLubyte format_idx;
+ GLubyte to_rgba[6];
+ GLubyte from_rgba[6];
+} mappings[MAX_IDX] =
+{
+ {
+ IDX_LUMINANCE,
+ MAP4(0,0,0,ONE),
+ MAP1(0)
+ },
+
+ {
+ IDX_ALPHA,
+ MAP4(ZERO, ZERO, ZERO, 0),
+ MAP1(3)
+ },
+
+ {
+ IDX_INTENSITY,
+ MAP4(0, 0, 0, 0),
+ MAP1(0),
+ },
+
+ {
+ IDX_LUMINANCE_ALPHA,
+ MAP4(0,0,0,1),
+ MAP2(0,3)
+ },
+
+ {
+ IDX_RGB,
+ MAP4(0,1,2,ONE),
+ MAP3(0,1,2)
+ },
+
+ {
+ IDX_RGBA,
+ MAP4(0,1,2,3),
+ MAP4(0,1,2,3),
+ },
+
+
+ {
+ IDX_RED,
+ MAP4(0, ZERO, ZERO, ONE),
+ MAP1(0),
+ },
+
+ {
+ IDX_GREEN,
+ MAP4(ZERO, 0, ZERO, ONE),
+ MAP1(1),
+ },
+
+ {
+ IDX_BLUE,
+ MAP4(ZERO, ZERO, 0, ONE),
+ MAP1(2),
+ },
+
+ {
+ IDX_BGR,
+ MAP4(2,1,0,ONE),
+ MAP3(2,1,0)
+ },
+
+ {
+ IDX_BGRA,
+ MAP4(2,1,0,3),
+ MAP4(2,1,0,3)
+ },
+
+ {
+ IDX_ABGR,
+ MAP4(3,2,1,0),
+ MAP4(3,2,1,0)
+ },
+};
+
+
+
+/**
+ * Convert a GL image format enum to an IDX_* value (see above).
+ */
+static int
+get_map_idx(GLenum value)
+{
+ switch (value) {
+ case GL_LUMINANCE: return IDX_LUMINANCE;
+ case GL_ALPHA: return IDX_ALPHA;
+ case GL_INTENSITY: return IDX_INTENSITY;
+ case GL_LUMINANCE_ALPHA: return IDX_LUMINANCE_ALPHA;
+ case GL_RGB: return IDX_RGB;
+ case GL_RGBA: return IDX_RGBA;
+ case GL_RED: return IDX_RED;
+ case GL_GREEN: return IDX_GREEN;
+ case GL_BLUE: return IDX_BLUE;
+ case GL_BGR: return IDX_BGR;
+ case GL_BGRA: return IDX_BGRA;
+ case GL_ABGR_EXT: return IDX_ABGR;
+ default:
+ _mesa_problem(NULL, "Unexpected inFormat");
+ return 0;
+ }
+}
+
+
/**
* When promoting texture formats (see below) we need to compute the
* mapping of dest components back to source components.
* This function does that.
- * \param logicalBaseFormat the logical format of the texture
- * \param textureBaseFormat the final texture format
- * \return map[4] the four mapping values
+ * \param inFormat the incoming format of the texture
+ * \param outFormat the final texture format
+ * \return map[6] a full 6-component map
*/
static void
-compute_component_mapping(GLenum logicalBaseFormat, GLenum textureBaseFormat,
- GLubyte map[6])
+compute_component_mapping(GLenum inFormat, GLenum outFormat,
+ GLubyte *map)
{
+ const int inFmt = get_map_idx(inFormat);
+ const int outFmt = get_map_idx(outFormat);
+ const GLubyte *in2rgba = mappings[inFmt].to_rgba;
+ const GLubyte *rgba2out = mappings[outFmt].from_rgba;
+ int i;
+
+ for (i = 0; i < 4; i++)
+ map[i] = in2rgba[rgba2out[i]];
+
map[ZERO] = ZERO;
- map[ONE] = ONE;
+ map[ONE] = ONE;
- /* compute mapping from dest components back to src components */
- switch (textureBaseFormat) {
- case GL_RGB:
- case GL_RGBA:
- switch (logicalBaseFormat) {
- case GL_LUMINANCE:
- map[0] = map[1] = map[2] = 0;
- if (textureBaseFormat == GL_RGBA)
- map[3] = ONE;
- break;
- case GL_ALPHA:
- ASSERT(textureBaseFormat == GL_RGBA);
- map[0] = map[1] = map[2] = ZERO;
- map[3] = 0;
- break;
- case GL_INTENSITY:
- map[0] = map[1] = map[2] = 0;
- if (textureBaseFormat == GL_RGBA)
- map[3] = 0;
- break;
- case GL_LUMINANCE_ALPHA:
- ASSERT(textureBaseFormat == GL_RGBA);
- map[0] = map[1] = map[2] = 0;
- map[3] = 1;
- break;
- case GL_RGB:
- ASSERT(textureBaseFormat == GL_RGBA);
- map[0] = 0;
- map[1] = 1;
- map[2] = 2;
- map[3] = ONE;
- break;
- case GL_RGBA:
- ASSERT(textureBaseFormat == GL_RGBA);
- map[0] = 0;
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
- break;
- default:
- _mesa_problem(NULL, "Unexpected logicalBaseFormat");
- map[0] = map[1] = map[2] = map[3] = 0;
- }
- break;
- case GL_LUMINANCE_ALPHA:
- switch (logicalBaseFormat) {
- case GL_LUMINANCE:
- map[0] = 0;
- map[1] = ONE;
- break;
- case GL_ALPHA:
- map[0] = ZERO;
- map[1] = 0;
- break;
- case GL_INTENSITY:
- map[0] = 0;
- map[1] = 0;
- break;
- default:
- _mesa_problem(NULL, "Unexpected logicalBaseFormat");
- map[0] = map[1] = 0;
- }
- break;
- default:
- _mesa_problem(NULL, "Unexpected textureBaseFormat");
- map[0] = map[1] = 0;
- break;
- }
+/*
+ _mesa_printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n",
+ inFormat, _mesa_lookup_enum_by_nr(inFormat),
+ outFormat, _mesa_lookup_enum_by_nr(outFormat),
+ map[0],
+ map[1],
+ map[2],
+ map[3],
+ map[4],
+ map[5]);
+*/
}
@@ -298,7 +398,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims,
GLfloat *dst = tempImage + img * (convWidth * convHeight * 4);
for (row = 0; row < convHeight; row++) {
_mesa_pack_rgba_span_float(ctx, convWidth,
- (const GLfloat (*)[4]) src,
+ (GLfloat (*)[4]) src,
logicalBaseFormat, GL_FLOAT,
dst, &ctx->DefaultPacking,
postConvTransferOps);
@@ -552,14 +652,16 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
* \param dstComponents number of color components in destination pixels
* \param src source pixels
* \param srcComponents number of color components in source pixels
- * \param map the swizzle mapping
+ * \param map the swizzle mapping. map[X] says where to find the X component
+ * in the source image's pixels. For example, if the source image
+ * is GL_BGRA and X = red, map[0] yields 2.
* \param count number of pixels to copy/swizzle.
*/
static void
swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src,
GLuint srcComponents, const GLubyte *map, GLuint count)
{
- GLubyte tmp[8];
+ GLubyte tmp[6];
GLuint i;
tmp[ZERO] = 0x0;
@@ -596,10 +698,61 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src,
dst += 2;
}
break;
+ case 1:
+ /* XXX investigate valgrind invalid read when running demos/texenv.c */
+ for (i = 0; i < count; i++) {
+ COPY_4UBV(tmp, src);
+ src += srcComponents;
+ dst[0] = tmp[map[0]];
+ dst += 1;
+ }
+ break;
+ }
+}
+
+
+static const GLubyte map_identity[6] = { 0, 1, 2, 3, ZERO, ONE };
+static const GLubyte map_3210[6] = { 3, 2, 1, 0, ZERO, ONE };
+
+/* Deal with the _REV input types:
+ */
+static const GLubyte *
+type_mapping( GLenum srcType )
+{
+ switch (srcType) {
+ case GL_UNSIGNED_BYTE:
+ return map_identity;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ return _mesa_little_endian() ? map_3210 : map_identity;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ return _mesa_little_endian() ? map_identity : map_3210;
+ default:
+ return NULL;
+ }
+}
+
+/* Mapping required if input type is
+ */
+static const GLubyte *
+byteswap_mapping( GLboolean swapBytes,
+ GLenum srcType )
+{
+ if (!swapBytes)
+ return map_identity;
+
+ switch (srcType) {
+ case GL_UNSIGNED_BYTE:
+ return map_identity;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ return map_3210;
+ default:
+ return NULL;
}
}
+
/**
* Transfer a GLubyte texture image with component swizzling.
*/
@@ -607,7 +760,12 @@ static void
_mesa_swizzle_ubyte_image(GLcontext *ctx,
GLuint dimensions,
GLenum srcFormat,
- const GLubyte *dstmap, GLint dstComponents,
+ GLenum srcType,
+
+ GLenum baseInternalFormat,
+
+ const GLubyte *rgba2dst,
+ GLuint dstComponents,
GLvoid *dstAddr,
GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
@@ -619,9 +777,9 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx,
const struct gl_pixelstore_attrib *srcPacking )
{
GLint srcComponents = _mesa_components_in_format(srcFormat);
- GLubyte srcmap[6], map[4];
+ const GLubyte *srctype2ubyte, *swap;
+ GLubyte map[4], src2base[6], base2rgba[6];
GLint i;
-
const GLint srcRowStride =
_mesa_image_row_stride(srcPacking, srcWidth,
srcFormat, GL_UNSIGNED_BYTE);
@@ -635,10 +793,20 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx,
(void) ctx;
- compute_component_mapping(srcFormat, GL_RGBA, srcmap);
+ /* Translate from src->baseInternal->GL_RGBA->dst. This will
+ * correctly deal with RGBA->RGB->RGBA conversions where the final
+ * A value must be 0xff regardless of the incoming alpha values.
+ */
+ compute_component_mapping(srcFormat, baseInternalFormat, src2base);
+ compute_component_mapping(baseInternalFormat, GL_RGBA, base2rgba);
+ swap = byteswap_mapping(srcPacking->SwapBytes, srcType);
+ srctype2ubyte = type_mapping(srcType);
+
for (i = 0; i < 4; i++)
- map[i] = srcmap[dstmap[i]];
+ map[i] = srctype2ubyte[swap[src2base[base2rgba[rgba2dst[i]]]]];
+
+/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */
if (srcRowStride == srcWidth * srcComponents &&
dimensions < 3) {
@@ -817,6 +985,58 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS)
}
}
}
+ else if (!ctx->_ImageTransferState &&
+ CHAN_TYPE == GL_UNSIGNED_BYTE &&
+ (srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV) &&
+ can_swizzle(baseInternalFormat) &&
+ can_swizzle(srcFormat)) {
+
+ const GLubyte *dstmap;
+ GLuint components;
+
+ /* dstmap - how to swizzle from RGBA to dst format:
+ */
+ if (dstFormat == &_mesa_texformat_rgba) {
+ dstmap = mappings[IDX_RGBA].from_rgba;
+ components = 4;
+ }
+ else if (dstFormat == &_mesa_texformat_rgb) {
+ dstmap = mappings[IDX_RGB].from_rgba;
+ components = 3;
+ }
+ else if (dstFormat == &_mesa_texformat_alpha) {
+ dstmap = mappings[IDX_ALPHA].from_rgba;
+ components = 1;
+ }
+ else if (dstFormat == &_mesa_texformat_luminance) {
+ dstmap = mappings[IDX_LUMINANCE].from_rgba;
+ components = 1;
+ }
+ else if (dstFormat == &_mesa_texformat_luminance_alpha) {
+ dstmap = mappings[IDX_LUMINANCE_ALPHA].from_rgba;
+ components = 2;
+ }
+ else if (dstFormat == &_mesa_texformat_intensity) {
+ dstmap = mappings[IDX_INTENSITY].from_rgba;
+ components = 1;
+ }
+ else {
+ _mesa_problem(ctx, "Unexpected dstFormat in _mesa_texstore_rgba");
+ return GL_FALSE;
+ }
+
+ _mesa_swizzle_ubyte_image(ctx, dims,
+ srcFormat,
+ srcType,
+ baseInternalFormat,
+ dstmap, components,
+ dstAddr, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstImageOffsets,
+ srcWidth, srcHeight, srcDepth, srcAddr,
+ srcPacking);
+ }
else {
/* general path */
const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
@@ -1050,13 +1270,14 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
}
+/**
+ * Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV.
+ */
GLboolean
_mesa_texstore_rgba8888(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
- (void)littleEndian;
ASSERT(dstFormat == &_mesa_texformat_rgba8888 ||
dstFormat == &_mesa_texformat_rgba8888_rev);
ASSERT(dstFormat->TexelBytes == 4);
@@ -1093,40 +1314,41 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
-#if 0
- /* broken? */
else if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- srcType == GL_UNSIGNED_BYTE &&
- dstFormat == &_mesa_texformat_rgba8888 &&
- littleEndian &&
- /* Three texture formats involved: srcFormat,
- * baseInternalFormat and destFormat (GL_RGBA). Only two
- * may differ. _mesa_swizzle_ubyte_image can't handle two
- * propagations at once correctly. */
- (srcFormat == baseInternalFormat ||
- baseInternalFormat == GL_RGBA) &&
+ (srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV) &&
+ can_swizzle(baseInternalFormat) &&
can_swizzle(srcFormat)) {
+
GLubyte dstmap[4];
- /* dstmap - how to swizzle from GL_RGBA to dst format:
- *
- * FIXME - add !litteEndian and _rev varients:
+ /* dstmap - how to swizzle from RGBA to dst format:
*/
- dstmap[3] = 0;
- dstmap[2] = 1;
- dstmap[1] = 2;
- dstmap[0] = 3;
+ if ((littleEndian && dstFormat == &_mesa_texformat_rgba8888) ||
+ (!littleEndian && dstFormat == &_mesa_texformat_rgba8888_rev)) {
+ dstmap[3] = 0;
+ dstmap[2] = 1;
+ dstmap[1] = 2;
+ dstmap[0] = 3;
+ }
+ else {
+ dstmap[3] = 3;
+ dstmap[2] = 2;
+ dstmap[1] = 1;
+ dstmap[0] = 0;
+ }
_mesa_swizzle_ubyte_image(ctx, dims,
srcFormat,
+ srcType,
+ baseInternalFormat,
dstmap, 4,
dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageStride,
+ dstRowStride, dstImageOffsets,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
-#endif
else {
/* general path */
const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
@@ -1177,8 +1399,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_argb8888(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
ASSERT(dstFormat == &_mesa_texformat_argb8888 ||
dstFormat == &_mesa_texformat_argb8888_rev);
@@ -1218,6 +1439,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
!srcPacking->SwapBytes &&
dstFormat == &_mesa_texformat_argb8888 &&
srcFormat == GL_RGB &&
+ (baseInternalFormat == GL_RGBA ||
+ baseInternalFormat == GL_RGB) &&
srcType == GL_UNSIGNED_BYTE) {
int img, row, col;
@@ -1246,6 +1469,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
!srcPacking->SwapBytes &&
dstFormat == &_mesa_texformat_argb8888 &&
srcFormat == GL_RGBA &&
+ baseInternalFormat == GL_RGBA &&
(srcType == GL_UNSIGNED_BYTE && littleEndian)) {
GLint img, row, col;
/* For some reason, streaming copies to write-combined regions
@@ -1280,6 +1504,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
!srcPacking->SwapBytes &&
dstFormat == &_mesa_texformat_argb8888 &&
srcFormat == GL_RGBA &&
+ baseInternalFormat == GL_RGBA &&
srcType == GL_UNSIGNED_BYTE) {
GLint img, row, col;
@@ -1305,29 +1530,37 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
}
}
else if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == &_mesa_texformat_argb8888 &&
- srcType == GL_UNSIGNED_BYTE &&
- littleEndian &&
- /* Three texture formats involved: srcFormat,
- * baseInternalFormat and destFormat (GL_RGBA). Only two
- * may differ. _mesa_swizzle_ubyte_image can't handle two
- * propagations at once correctly. */
- (srcFormat == baseInternalFormat ||
- baseInternalFormat == GL_RGBA) &&
+ (srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV) &&
+ can_swizzle(baseInternalFormat) &&
can_swizzle(srcFormat)) {
GLubyte dstmap[4];
- /* dstmap - how to swizzle from GL_RGBA to dst format:
+ /* dstmap - how to swizzle from RGBA to dst format:
*/
- dstmap[3] = 3; /* alpha */
- dstmap[2] = 0; /* red */
- dstmap[1] = 1; /* green */
- dstmap[0] = 2; /* blue */
+ if ((littleEndian && dstFormat == &_mesa_texformat_argb8888) ||
+ (!littleEndian && dstFormat == &_mesa_texformat_argb8888_rev)) {
+ dstmap[3] = 3; /* alpha */
+ dstmap[2] = 0; /* red */
+ dstmap[1] = 1; /* green */
+ dstmap[0] = 2; /* blue */
+ }
+ else {
+ assert((littleEndian && dstFormat == &_mesa_texformat_argb8888_rev) ||
+ (!littleEndian && dstFormat == &_mesa_texformat_argb8888));
+ dstmap[3] = 2;
+ dstmap[2] = 1;
+ dstmap[1] = 0;
+ dstmap[0] = 3;
+ }
_mesa_swizzle_ubyte_image(ctx, dims,
srcFormat,
+ srcType,
+
+ baseInternalFormat,
dstmap, 4,
dstAddr, dstXoffset, dstYoffset, dstZoffset,
dstRowStride,
@@ -1385,8 +1618,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_rgb888(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
ASSERT(dstFormat == &_mesa_texformat_rgb888);
ASSERT(dstFormat->TexelBytes == 3);
@@ -1431,6 +1663,30 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
}
}
}
+ else if (!ctx->_ImageTransferState &&
+ srcType == GL_UNSIGNED_BYTE &&
+ can_swizzle(baseInternalFormat) &&
+ can_swizzle(srcFormat)) {
+
+ GLubyte dstmap[4];
+
+ /* dstmap - how to swizzle from RGBA to dst format:
+ */
+ dstmap[0] = 2;
+ dstmap[1] = 1;
+ dstmap[2] = 0;
+ dstmap[3] = ONE; /* ? */
+
+ _mesa_swizzle_ubyte_image(ctx, dims,
+ srcFormat,
+ srcType,
+ baseInternalFormat,
+ dstmap, 3,
+ dstAddr, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstImageOffsets,
+ srcWidth, srcHeight, srcDepth, srcAddr,
+ srcPacking);
+ }
else {
/* general path */
const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
@@ -1487,8 +1743,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_bgr888(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
ASSERT(dstFormat == &_mesa_texformat_bgr888);
ASSERT(dstFormat->TexelBytes == 3);
@@ -1533,6 +1788,30 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
}
}
}
+ else if (!ctx->_ImageTransferState &&
+ srcType == GL_UNSIGNED_BYTE &&
+ can_swizzle(baseInternalFormat) &&
+ can_swizzle(srcFormat)) {
+
+ GLubyte dstmap[4];
+
+ /* dstmap - how to swizzle from RGBA to dst format:
+ */
+ dstmap[0] = 0;
+ dstmap[1] = 1;
+ dstmap[2] = 2;
+ dstmap[3] = ONE; /* ? */
+
+ _mesa_swizzle_ubyte_image(ctx, dims,
+ srcFormat,
+ srcType,
+ baseInternalFormat,
+ dstmap, 3,
+ dstAddr, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstImageOffsets,
+ srcWidth, srcHeight, srcDepth, srcAddr,
+ srcPacking);
+ }
else {
/* general path */
const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
@@ -1707,8 +1986,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_al88(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
ASSERT(dstFormat == &_mesa_texformat_al88 ||
dstFormat == &_mesa_texformat_al88_rev);
@@ -1729,6 +2007,38 @@ _mesa_texstore_al88(TEXSTORE_PARAMS)
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
+ else if (!ctx->_ImageTransferState &&
+ littleEndian &&
+ srcType == GL_UNSIGNED_BYTE &&
+ can_swizzle(baseInternalFormat) &&
+ can_swizzle(srcFormat)) {
+
+ GLubyte dstmap[4];
+
+ /* dstmap - how to swizzle from RGBA to dst format:
+ */
+ if ((littleEndian && dstFormat == &_mesa_texformat_al88) ||
+ (!littleEndian && dstFormat == &_mesa_texformat_al88_rev)) {
+ dstmap[0] = 0;
+ dstmap[1] = 3;
+ }
+ else {
+ dstmap[0] = 3;
+ dstmap[1] = 0;
+ }
+ dstmap[2] = ZERO; /* ? */
+ dstmap[3] = ONE; /* ? */
+
+ _mesa_swizzle_ubyte_image(ctx, dims,
+ srcFormat,
+ srcType,
+ baseInternalFormat,
+ dstmap, 2,
+ dstAddr, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstImageOffsets,
+ srcWidth, srcHeight, srcDepth, srcAddr,
+ srcPacking);
+ }
else {
/* general path */
const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
@@ -1849,6 +2159,35 @@ _mesa_texstore_a8(TEXSTORE_PARAMS)
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
+ else if (!ctx->_ImageTransferState &&
+ srcType == GL_UNSIGNED_BYTE &&
+ can_swizzle(baseInternalFormat) &&
+ can_swizzle(srcFormat)) {
+
+ GLubyte dstmap[4];
+
+ /* dstmap - how to swizzle from RGBA to dst format:
+ */
+ if (dstFormat == &_mesa_texformat_a8) {
+ dstmap[0] = 3;
+ }
+ else {
+ dstmap[0] = 0;
+ }
+ dstmap[1] = ZERO; /* ? */
+ dstmap[2] = ZERO; /* ? */
+ dstmap[3] = ONE; /* ? */
+
+ _mesa_swizzle_ubyte_image(ctx, dims,
+ srcFormat,
+ srcType,
+ baseInternalFormat,
+ dstmap, 1,
+ dstAddr, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstImageOffsets,
+ srcWidth, srcHeight, srcDepth, srcAddr,
+ srcPacking);
+ }
else {
/* general path */
const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
@@ -1930,8 +2269,7 @@ _mesa_texstore_ci8(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_ycbcr(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
(void) ctx; (void) dims; (void) baseInternalFormat;
ASSERT((dstFormat == &_mesa_texformat_ycbcr) ||
@@ -2186,8 +2524,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_srgb8(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
const struct gl_texture_format *newDstFormat;
StoreTexImageFunc store;
GLboolean k;
@@ -2218,8 +2555,7 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_srgba8(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
const struct gl_texture_format *newDstFormat;
GLboolean k;
@@ -2267,8 +2603,7 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_sla8(TEXSTORE_PARAMS)
{
- const GLuint ui = 1;
- const GLubyte littleEndian = *((const GLubyte *) &ui);
+ const GLboolean littleEndian = _mesa_little_endian();
const struct gl_texture_format *newDstFormat;
GLboolean k;
@@ -2386,8 +2721,8 @@ _mesa_unmap_teximage_pbo(GLcontext *ctx,
* Adaptor for fetching a GLchan texel from a float-valued texture.
*/
static void
-FetchTexelFloatToChan( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texelOut )
+fetch_texel_float_to_chan(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLchan *texelOut)
{
GLfloat temp[4];
ASSERT(texImage->FetchTexelf);
@@ -2411,8 +2746,8 @@ FetchTexelFloatToChan( const struct gl_texture_image *texImage,
* Adaptor for fetching a float texel from a GLchan-valued texture.
*/
static void
-FetchTexelChanToFloat( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texelOut )
+fetch_texel_chan_to_float(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texelOut)
{
GLchan temp[4];
ASSERT(texImage->FetchTexelc);
@@ -2460,10 +2795,10 @@ set_fetch_functions(struct gl_texture_image *texImage, GLuint dims)
/* now check if we need to use a float/chan adaptor */
if (!texImage->FetchTexelc) {
- texImage->FetchTexelc = FetchTexelFloatToChan;
+ texImage->FetchTexelc = fetch_texel_float_to_chan;
}
else if (!texImage->FetchTexelf) {
- texImage->FetchTexelf = FetchTexelChanToFloat;
+ texImage->FetchTexelf = fetch_texel_chan_to_float;
}
@@ -3119,1114 +3454,6 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
}
-/*
- * Average together two rows of a source image to produce a single new
- * row in the dest image. It's legal for the two source rows to point
- * to the same data. The source width must be equal to either the
- * dest width or two times the dest width.
- */
-static void
-do_row(const struct gl_texture_format *format, GLint srcWidth,
- const GLvoid *srcRowA, const GLvoid *srcRowB,
- GLint dstWidth, GLvoid *dstRow)
-{
- const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1;
- const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2;
-
- /* This assertion is no longer valid with non-power-of-2 textures
- assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth);
- */
-
- switch (format->MesaFormat) {
- case MESA_FORMAT_RGBA:
- {
- GLuint i, j, k;
- const GLchan (*rowA)[4] = (const GLchan (*)[4]) srcRowA;
- const GLchan (*rowB)[4] = (const GLchan (*)[4]) srcRowB;
- GLchan (*dst)[4] = (GLchan (*)[4]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) / 4;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) / 4;
- dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) / 4;
- dst[i][3] = (rowA[j][3] + rowA[k][3] +
- rowB[j][3] + rowB[k][3]) / 4;
- }
- }
- return;
- case MESA_FORMAT_RGB:
- {
- GLuint i, j, k;
- const GLchan (*rowA)[3] = (const GLchan (*)[3]) srcRowA;
- const GLchan (*rowB)[3] = (const GLchan (*)[3]) srcRowB;
- GLchan (*dst)[3] = (GLchan (*)[3]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) / 4;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) / 4;
- dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) / 4;
- }
- }
- return;
- case MESA_FORMAT_ALPHA:
- case MESA_FORMAT_LUMINANCE:
- case MESA_FORMAT_INTENSITY:
- {
- GLuint i, j, k;
- const GLchan *rowA = (const GLchan *) srcRowA;
- const GLchan *rowB = (const GLchan *) srcRowB;
- GLchan *dst = (GLchan *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
- }
- }
- return;
- case MESA_FORMAT_LUMINANCE_ALPHA:
- {
- GLuint i, j, k;
- const GLchan (*rowA)[2] = (const GLchan (*)[2]) srcRowA;
- const GLchan (*rowB)[2] = (const GLchan (*)[2]) srcRowB;
- GLchan (*dst)[2] = (GLchan (*)[2]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) / 4;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) / 4;
- }
- }
- return;
- case MESA_FORMAT_Z32:
- {
- GLuint i, j, k;
- const GLuint *rowA = (const GLuint *) srcRowA;
- const GLuint *rowB = (const GLuint *) srcRowB;
- GLfloat *dst = (GLfloat *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i] = rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4;
- }
- }
- return;
- case MESA_FORMAT_Z16:
- {
- GLuint i, j, k;
- const GLushort *rowA = (const GLushort *) srcRowA;
- const GLushort *rowB = (const GLushort *) srcRowB;
- GLushort *dst = (GLushort *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
- }
- }
- return;
- /* Begin hardware formats */
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
-#if FEATURE_EXT_texture_sRGB
- case MESA_FORMAT_SRGBA8:
-#endif
- {
- GLuint i, j, k;
- const GLubyte (*rowA)[4] = (const GLubyte (*)[4]) srcRowA;
- const GLubyte (*rowB)[4] = (const GLubyte (*)[4]) srcRowB;
- GLubyte (*dst)[4] = (GLubyte (*)[4]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) / 4;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) / 4;
- dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) / 4;
- dst[i][3] = (rowA[j][3] + rowA[k][3] +
- rowB[j][3] + rowB[k][3]) / 4;
- }
- }
- return;
- case MESA_FORMAT_RGB888:
- case MESA_FORMAT_BGR888:
-#if FEATURE_EXT_texture_sRGB
- case MESA_FORMAT_SRGB8:
-#endif
- {
- GLuint i, j, k;
- const GLubyte (*rowA)[3] = (const GLubyte (*)[3]) srcRowA;
- const GLubyte (*rowB)[3] = (const GLubyte (*)[3]) srcRowB;
- GLubyte (*dst)[3] = (GLubyte (*)[3]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) / 4;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) / 4;
- dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) / 4;
- }
- }
- return;
- case MESA_FORMAT_RGB565:
- case MESA_FORMAT_RGB565_REV:
- {
- GLuint i, j, k;
- const GLushort *rowA = (const GLushort *) srcRowA;
- const GLushort *rowB = (const GLushort *) srcRowB;
- GLushort *dst = (GLushort *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- const GLint rowAr0 = rowA[j] & 0x1f;
- const GLint rowAr1 = rowA[k] & 0x1f;
- const GLint rowBr0 = rowB[j] & 0x1f;
- const GLint rowBr1 = rowB[k] & 0x1f;
- const GLint rowAg0 = (rowA[j] >> 5) & 0x3f;
- const GLint rowAg1 = (rowA[k] >> 5) & 0x3f;
- const GLint rowBg0 = (rowB[j] >> 5) & 0x3f;
- const GLint rowBg1 = (rowB[k] >> 5) & 0x3f;
- const GLint rowAb0 = (rowA[j] >> 11) & 0x1f;
- const GLint rowAb1 = (rowA[k] >> 11) & 0x1f;
- const GLint rowBb0 = (rowB[j] >> 11) & 0x1f;
- const GLint rowBb1 = (rowB[k] >> 11) & 0x1f;
- const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
- const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
- const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
- dst[i] = (blue << 11) | (green << 5) | red;
- }
- }
- return;
- case MESA_FORMAT_ARGB4444:
- case MESA_FORMAT_ARGB4444_REV:
- {
- GLuint i, j, k;
- const GLushort *rowA = (const GLushort *) srcRowA;
- const GLushort *rowB = (const GLushort *) srcRowB;
- GLushort *dst = (GLushort *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- const GLint rowAr0 = rowA[j] & 0xf;
- const GLint rowAr1 = rowA[k] & 0xf;
- const GLint rowBr0 = rowB[j] & 0xf;
- const GLint rowBr1 = rowB[k] & 0xf;
- const GLint rowAg0 = (rowA[j] >> 4) & 0xf;
- const GLint rowAg1 = (rowA[k] >> 4) & 0xf;
- const GLint rowBg0 = (rowB[j] >> 4) & 0xf;
- const GLint rowBg1 = (rowB[k] >> 4) & 0xf;
- const GLint rowAb0 = (rowA[j] >> 8) & 0xf;
- const GLint rowAb1 = (rowA[k] >> 8) & 0xf;
- const GLint rowBb0 = (rowB[j] >> 8) & 0xf;
- const GLint rowBb1 = (rowB[k] >> 8) & 0xf;
- const GLint rowAa0 = (rowA[j] >> 12) & 0xf;
- const GLint rowAa1 = (rowA[k] >> 12) & 0xf;
- const GLint rowBa0 = (rowB[j] >> 12) & 0xf;
- const GLint rowBa1 = (rowB[k] >> 12) & 0xf;
- const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
- const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
- const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
- const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2;
- dst[i] = (alpha << 12) | (blue << 8) | (green << 4) | red;
- }
- }
- return;
- case MESA_FORMAT_ARGB1555:
- case MESA_FORMAT_ARGB1555_REV: /* XXX broken? */
- {
- GLuint i, j, k;
- const GLushort *rowA = (const GLushort *) srcRowA;
- const GLushort *rowB = (const GLushort *) srcRowB;
- GLushort *dst = (GLushort *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- const GLint rowAr0 = rowA[j] & 0x1f;
- const GLint rowAr1 = rowA[k] & 0x1f;
- const GLint rowBr0 = rowB[j] & 0x1f;
- const GLint rowBr1 = rowB[k] & 0xf;
- const GLint rowAg0 = (rowA[j] >> 5) & 0x1f;
- const GLint rowAg1 = (rowA[k] >> 5) & 0x1f;
- const GLint rowBg0 = (rowB[j] >> 5) & 0x1f;
- const GLint rowBg1 = (rowB[k] >> 5) & 0x1f;
- const GLint rowAb0 = (rowA[j] >> 10) & 0x1f;
- const GLint rowAb1 = (rowA[k] >> 10) & 0x1f;
- const GLint rowBb0 = (rowB[j] >> 10) & 0x1f;
- const GLint rowBb1 = (rowB[k] >> 10) & 0x1f;
- const GLint rowAa0 = (rowA[j] >> 15) & 0x1;
- const GLint rowAa1 = (rowA[k] >> 15) & 0x1;
- const GLint rowBa0 = (rowB[j] >> 15) & 0x1;
- const GLint rowBa1 = (rowB[k] >> 15) & 0x1;
- const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
- const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
- const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
- const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2;
- dst[i] = (alpha << 15) | (blue << 10) | (green << 5) | red;
- }
- }
- return;
- case MESA_FORMAT_AL88:
- case MESA_FORMAT_AL88_REV:
-#if FEATURE_EXT_texture_sRGB
- case MESA_FORMAT_SLA8:
-#endif
- {
- GLuint i, j, k;
- const GLubyte (*rowA)[2] = (const GLubyte (*)[2]) srcRowA;
- const GLubyte (*rowB)[2] = (const GLubyte (*)[2]) srcRowB;
- GLubyte (*dst)[2] = (GLubyte (*)[2]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) >> 2;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) >> 2;
- }
- }
- return;
- case MESA_FORMAT_RGB332:
- {
- GLuint i, j, k;
- const GLubyte *rowA = (const GLubyte *) srcRowA;
- const GLubyte *rowB = (const GLubyte *) srcRowB;
- GLubyte *dst = (GLubyte *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- const GLint rowAr0 = rowA[j] & 0x3;
- const GLint rowAr1 = rowA[k] & 0x3;
- const GLint rowBr0 = rowB[j] & 0x3;
- const GLint rowBr1 = rowB[k] & 0x3;
- const GLint rowAg0 = (rowA[j] >> 2) & 0x7;
- const GLint rowAg1 = (rowA[k] >> 2) & 0x7;
- const GLint rowBg0 = (rowB[j] >> 2) & 0x7;
- const GLint rowBg1 = (rowB[k] >> 2) & 0x7;
- const GLint rowAb0 = (rowA[j] >> 5) & 0x7;
- const GLint rowAb1 = (rowA[k] >> 5) & 0x7;
- const GLint rowBb0 = (rowB[j] >> 5) & 0x7;
- const GLint rowBb1 = (rowB[k] >> 5) & 0x7;
- const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
- const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
- const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
- dst[i] = (blue << 5) | (green << 2) | red;
- }
- }
- return;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
-#if FEATURE_EXT_texture_sRGB
- case MESA_FORMAT_SL8:
-#endif
- {
- GLuint i, j, k;
- const GLubyte *rowA = (const GLubyte *) srcRowA;
- const GLubyte *rowB = (const GLubyte *) srcRowB;
- GLubyte *dst = (GLubyte *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) >> 2;
- }
- }
- return;
- case MESA_FORMAT_RGBA_FLOAT32:
- {
- GLuint i, j, k;
- const GLfloat (*rowA)[4] = (const GLfloat (*)[4]) srcRowA;
- const GLfloat (*rowB)[4] = (const GLfloat (*)[4]) srcRowB;
- GLfloat (*dst)[4] = (GLfloat (*)[4]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) * 0.25F;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) * 0.25F;
- dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) * 0.25F;
- dst[i][3] = (rowA[j][3] + rowA[k][3] +
- rowB[j][3] + rowB[k][3]) * 0.25F;
- }
- }
- return;
- case MESA_FORMAT_RGBA_FLOAT16:
- {
- GLuint i, j, k, comp;
- const GLhalfARB (*rowA)[4] = (const GLhalfARB (*)[4]) srcRowA;
- const GLhalfARB (*rowB)[4] = (const GLhalfARB (*)[4]) srcRowB;
- GLhalfARB (*dst)[4] = (GLhalfARB (*)[4]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- for (comp = 0; comp < 4; comp++) {
- GLfloat aj, ak, bj, bk;
- aj = _mesa_half_to_float(rowA[j][comp]);
- ak = _mesa_half_to_float(rowA[k][comp]);
- bj = _mesa_half_to_float(rowB[j][comp]);
- bk = _mesa_half_to_float(rowB[k][comp]);
- dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
- }
- }
- }
- return;
- case MESA_FORMAT_RGB_FLOAT32:
- {
- GLuint i, j, k;
- const GLfloat (*rowA)[3] = (const GLfloat (*)[3]) srcRowA;
- const GLfloat (*rowB)[3] = (const GLfloat (*)[3]) srcRowB;
- GLfloat (*dst)[3] = (GLfloat (*)[3]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) * 0.25F;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) * 0.25F;
- dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) * 0.25F;
- }
- }
- return;
- case MESA_FORMAT_RGB_FLOAT16:
- {
- GLuint i, j, k, comp;
- const GLhalfARB (*rowA)[3] = (const GLhalfARB (*)[3]) srcRowA;
- const GLhalfARB (*rowB)[3] = (const GLhalfARB (*)[3]) srcRowB;
- GLhalfARB (*dst)[3] = (GLhalfARB (*)[3]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- for (comp = 0; comp < 3; comp++) {
- GLfloat aj, ak, bj, bk;
- aj = _mesa_half_to_float(rowA[j][comp]);
- ak = _mesa_half_to_float(rowA[k][comp]);
- bj = _mesa_half_to_float(rowB[j][comp]);
- bk = _mesa_half_to_float(rowB[k][comp]);
- dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
- }
- }
- }
- return;
- case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32:
- {
- GLuint i, j, k;
- const GLfloat (*rowA)[2] = (const GLfloat (*)[2]) srcRowA;
- const GLfloat (*rowB)[2] = (const GLfloat (*)[2]) srcRowB;
- GLfloat (*dst)[2] = (GLfloat (*)[2]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) * 0.25F;
- dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) * 0.25F;
- }
- }
- return;
- case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16:
- {
- GLuint i, j, k, comp;
- const GLhalfARB (*rowA)[2] = (const GLhalfARB (*)[2]) srcRowA;
- const GLhalfARB (*rowB)[2] = (const GLhalfARB (*)[2]) srcRowB;
- GLhalfARB (*dst)[2] = (GLhalfARB (*)[2]) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- for (comp = 0; comp < 2; comp++) {
- GLfloat aj, ak, bj, bk;
- aj = _mesa_half_to_float(rowA[j][comp]);
- ak = _mesa_half_to_float(rowA[k][comp]);
- bj = _mesa_half_to_float(rowB[j][comp]);
- bk = _mesa_half_to_float(rowB[k][comp]);
- dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
- }
- }
- }
- return;
- case MESA_FORMAT_ALPHA_FLOAT32:
- case MESA_FORMAT_LUMINANCE_FLOAT32:
- case MESA_FORMAT_INTENSITY_FLOAT32:
- {
- GLuint i, j, k;
- const GLfloat *rowA = (const GLfloat *) srcRowA;
- const GLfloat *rowB = (const GLfloat *) srcRowB;
- GLfloat *dst = (GLfloat *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) * 0.25F;
- }
- }
- return;
- case MESA_FORMAT_ALPHA_FLOAT16:
- case MESA_FORMAT_LUMINANCE_FLOAT16:
- case MESA_FORMAT_INTENSITY_FLOAT16:
- {
- GLuint i, j, k;
- const GLhalfARB *rowA = (const GLhalfARB *) srcRowA;
- const GLhalfARB *rowB = (const GLhalfARB *) srcRowB;
- GLhalfARB *dst = (GLhalfARB *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- GLfloat aj, ak, bj, bk;
- aj = _mesa_half_to_float(rowA[j]);
- ak = _mesa_half_to_float(rowA[k]);
- bj = _mesa_half_to_float(rowB[j]);
- bk = _mesa_half_to_float(rowB[k]);
- dst[i] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F);
- }
- }
- return;
-
- default:
- _mesa_problem(NULL, "bad format in do_row()");
- }
-}
-
-
-/*
- * These functions generate a 1/2-size mipmap image from a source image.
- * Texture borders are handled by copying or averaging the source image's
- * border texels, depending on the scale-down factor.
- */
-
-static void
-make_1d_mipmap(const struct gl_texture_format *format, GLint border,
- GLint srcWidth, const GLubyte *srcPtr,
- GLint dstWidth, GLubyte *dstPtr)
-{
- const GLint bpt = format->TexelBytes;
- const GLubyte *src;
- GLubyte *dst;
-
- /* skip the border pixel, if any */
- src = srcPtr + border * bpt;
- dst = dstPtr + border * bpt;
-
- /* we just duplicate the input row, kind of hack, saves code */
- do_row(format, srcWidth - 2 * border, src, src,
- dstWidth - 2 * border, dst);
-
- if (border) {
- /* copy left-most pixel from source */
- MEMCPY(dstPtr, srcPtr, bpt);
- /* copy right-most pixel from source */
- MEMCPY(dstPtr + (dstWidth - 1) * bpt,
- srcPtr + (srcWidth - 1) * bpt,
- bpt);
- }
-}
-
-
-/**
- * XXX need to use the tex image's row stride!
- */
-static void
-make_2d_mipmap(const struct gl_texture_format *format, GLint border,
- GLint srcWidth, GLint srcHeight, const GLubyte *srcPtr,
- GLint dstWidth, GLint dstHeight, GLubyte *dstPtr)
-{
- const GLint bpt = format->TexelBytes;
- const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
- const GLint dstWidthNB = dstWidth - 2 * border;
- const GLint dstHeightNB = dstHeight - 2 * border;
- const GLint srcRowStride = bpt * srcWidth;
- const GLint dstRowStride = bpt * dstWidth;
- const GLubyte *srcA, *srcB;
- GLubyte *dst;
- GLint row;
-
- /* Compute src and dst pointers, skipping any border */
- srcA = srcPtr + border * ((srcWidth + 1) * bpt);
- if (srcHeight > 1)
- srcB = srcA + srcRowStride;
- else
- srcB = srcA;
- dst = dstPtr + border * ((dstWidth + 1) * bpt);
-
- for (row = 0; row < dstHeightNB; row++) {
- do_row(format, srcWidthNB, srcA, srcB,
- dstWidthNB, dst);
- srcA += 2 * srcRowStride;
- srcB += 2 * srcRowStride;
- dst += dstRowStride;
- }
-
- /* This is ugly but probably won't be used much */
- if (border > 0) {
- /* fill in dest border */
- /* lower-left border pixel */
- MEMCPY(dstPtr, srcPtr, bpt);
- /* lower-right border pixel */
- MEMCPY(dstPtr + (dstWidth - 1) * bpt,
- srcPtr + (srcWidth - 1) * bpt, bpt);
- /* upper-left border pixel */
- MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt,
- srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt);
- /* upper-right border pixel */
- MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt,
- srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt);
- /* lower border */
- do_row(format, srcWidthNB,
- srcPtr + bpt,
- srcPtr + bpt,
- dstWidthNB, dstPtr + bpt);
- /* upper border */
- do_row(format, srcWidthNB,
- srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt,
- srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt,
- dstWidthNB,
- dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt);
- /* left and right borders */
- if (srcHeight == dstHeight) {
- /* copy border pixel from src to dst */
- for (row = 1; row < srcHeight; row++) {
- MEMCPY(dstPtr + dstWidth * row * bpt,
- srcPtr + srcWidth * row * bpt, bpt);
- MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt,
- srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt);
- }
- }
- else {
- /* average two src pixels each dest pixel */
- for (row = 0; row < dstHeightNB; row += 2) {
- do_row(format, 1,
- srcPtr + (srcWidth * (row * 2 + 1)) * bpt,
- srcPtr + (srcWidth * (row * 2 + 2)) * bpt,
- 1, dstPtr + (dstWidth * row + 1) * bpt);
- do_row(format, 1,
- srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt,
- srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt,
- 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt);
- }
- }
- }
-}
-
-
-static void
-make_3d_mipmap(const struct gl_texture_format *format, GLint border,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- const GLubyte *srcPtr,
- GLint dstWidth, GLint dstHeight, GLint dstDepth,
- GLubyte *dstPtr)
-{
- const GLint bpt = format->TexelBytes;
- const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
- const GLint srcDepthNB = srcDepth - 2 * border;
- const GLint dstWidthNB = dstWidth - 2 * border;
- const GLint dstHeightNB = dstHeight - 2 * border;
- const GLint dstDepthNB = dstDepth - 2 * border;
- GLvoid *tmpRowA, *tmpRowB;
- GLint img, row;
- GLint bytesPerSrcImage, bytesPerDstImage;
- GLint bytesPerSrcRow, bytesPerDstRow;
- GLint srcImageOffset, srcRowOffset;
-
- (void) srcDepthNB; /* silence warnings */
-
- /* Need two temporary row buffers */
- tmpRowA = _mesa_malloc(srcWidth * bpt);
- if (!tmpRowA)
- return;
- tmpRowB = _mesa_malloc(srcWidth * bpt);
- if (!tmpRowB) {
- _mesa_free(tmpRowA);
- return;
- }
-
- bytesPerSrcImage = srcWidth * srcHeight * bpt;
- bytesPerDstImage = dstWidth * dstHeight * bpt;
-
- bytesPerSrcRow = srcWidth * bpt;
- bytesPerDstRow = dstWidth * bpt;
-
- /* Offset between adjacent src images to be averaged together */
- srcImageOffset = (srcDepth == dstDepth) ? 0 : bytesPerSrcImage;
-
- /* Offset between adjacent src rows to be averaged together */
- srcRowOffset = (srcHeight == dstHeight) ? 0 : srcWidth * bpt;
-
- /*
- * Need to average together up to 8 src pixels for each dest pixel.
- * Break that down into 3 operations:
- * 1. take two rows from source image and average them together.
- * 2. take two rows from next source image and average them together.
- * 3. take the two averaged rows and average them for the final dst row.
- */
-
- /*
- _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n",
- srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth);
- */
-
- for (img = 0; img < dstDepthNB; img++) {
- /* first source image pointer, skipping border */
- const GLubyte *imgSrcA = srcPtr
- + (bytesPerSrcImage + bytesPerSrcRow + border) * bpt * border
- + img * (bytesPerSrcImage + srcImageOffset);
- /* second source image pointer, skipping border */
- const GLubyte *imgSrcB = imgSrcA + srcImageOffset;
- /* address of the dest image, skipping border */
- GLubyte *imgDst = dstPtr
- + (bytesPerDstImage + bytesPerDstRow + border) * bpt * border
- + img * bytesPerDstImage;
-
- /* setup the four source row pointers and the dest row pointer */
- const GLubyte *srcImgARowA = imgSrcA;
- const GLubyte *srcImgARowB = imgSrcA + srcRowOffset;
- const GLubyte *srcImgBRowA = imgSrcB;
- const GLubyte *srcImgBRowB = imgSrcB + srcRowOffset;
- GLubyte *dstImgRow = imgDst;
-
- for (row = 0; row < dstHeightNB; row++) {
- /* Average together two rows from first src image */
- do_row(format, srcWidthNB, srcImgARowA, srcImgARowB,
- srcWidthNB, tmpRowA);
- /* Average together two rows from second src image */
- do_row(format, srcWidthNB, srcImgBRowA, srcImgBRowB,
- srcWidthNB, tmpRowB);
- /* Average together the temp rows to make the final row */
- do_row(format, srcWidthNB, tmpRowA, tmpRowB,
- dstWidthNB, dstImgRow);
- /* advance to next rows */
- srcImgARowA += bytesPerSrcRow + srcRowOffset;
- srcImgARowB += bytesPerSrcRow + srcRowOffset;
- srcImgBRowA += bytesPerSrcRow + srcRowOffset;
- srcImgBRowB += bytesPerSrcRow + srcRowOffset;
- dstImgRow += bytesPerDstRow;
- }
- }
-
- _mesa_free(tmpRowA);
- _mesa_free(tmpRowB);
-
- /* Luckily we can leverage the make_2d_mipmap() function here! */
- if (border > 0) {
- /* do front border image */
- make_2d_mipmap(format, 1, srcWidth, srcHeight, srcPtr,
- dstWidth, dstHeight, dstPtr);
- /* do back border image */
- make_2d_mipmap(format, 1, srcWidth, srcHeight,
- srcPtr + bytesPerSrcImage * (srcDepth - 1),
- dstWidth, dstHeight,
- dstPtr + bytesPerDstImage * (dstDepth - 1));
- /* do four remaining border edges that span the image slices */
- if (srcDepth == dstDepth) {
- /* just copy border pixels from src to dst */
- for (img = 0; img < dstDepthNB; img++) {
- const GLubyte *src;
- GLubyte *dst;
-
- /* do border along [img][row=0][col=0] */
- src = srcPtr + (img + 1) * bytesPerSrcImage;
- dst = dstPtr + (img + 1) * bytesPerDstImage;
- MEMCPY(dst, src, bpt);
-
- /* do border along [img][row=dstHeight-1][col=0] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcHeight - 1) * bytesPerSrcRow;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstHeight - 1) * bytesPerDstRow;
- MEMCPY(dst, src, bpt);
-
- /* do border along [img][row=0][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcWidth - 1) * bpt;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstWidth - 1) * bpt;
- MEMCPY(dst, src, bpt);
-
- /* do border along [img][row=dstHeight-1][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (bytesPerSrcImage - bpt);
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (bytesPerDstImage - bpt);
- MEMCPY(dst, src, bpt);
- }
- }
- else {
- /* average border pixels from adjacent src image pairs */
- ASSERT(srcDepthNB == 2 * dstDepthNB);
- for (img = 0; img < dstDepthNB; img++) {
- const GLubyte *src;
- GLubyte *dst;
-
- /* do border along [img][row=0][col=0] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage;
- dst = dstPtr + (img + 1) * bytesPerDstImage;
- do_row(format, 1, src, src + srcImageOffset, 1, dst);
-
- /* do border along [img][row=dstHeight-1][col=0] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcHeight - 1) * bytesPerSrcRow;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstHeight - 1) * bytesPerDstRow;
- do_row(format, 1, src, src + srcImageOffset, 1, dst);
-
- /* do border along [img][row=0][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcWidth - 1) * bpt;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstWidth - 1) * bpt;
- do_row(format, 1, src, src + srcImageOffset, 1, dst);
-
- /* do border along [img][row=dstHeight-1][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (bytesPerSrcImage - bpt);
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (bytesPerDstImage - bpt);
- do_row(format, 1, src, src + srcImageOffset, 1, dst);
- }
- }
- }
-}
-
-
-/**
- * For GL_SGIX_generate_mipmap:
- * Generate a complete set of mipmaps from texObj's base-level image.
- * Stop at texObj's MaxLevel or when we get to the 1x1 texture.
- */
-void
-_mesa_generate_mipmap(GLcontext *ctx, GLenum target,
- const struct gl_texture_unit *texUnit,
- struct gl_texture_object *texObj)
-{
- const struct gl_texture_image *srcImage;
- const struct gl_texture_format *convertFormat;
- const GLubyte *srcData = NULL;
- GLubyte *dstData = NULL;
- GLint level, maxLevels;
-
- ASSERT(texObj);
- /* XXX choose cube map face here??? */
- srcImage = texObj->Image[0][texObj->BaseLevel];
- ASSERT(srcImage);
-
- maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
- ASSERT(maxLevels > 0); /* bad target */
-
- /* Find convertFormat - the format that do_row() will process */
- if (srcImage->IsCompressed) {
- /* setup for compressed textures */
- GLuint row;
- GLint components, size;
- GLchan *dst;
-
- assert(texObj->Target == GL_TEXTURE_2D);
-
- if (srcImage->_BaseFormat == GL_RGB) {
- convertFormat = &_mesa_texformat_rgb;
- components = 3;
- }
- else if (srcImage->_BaseFormat == GL_RGBA) {
- convertFormat = &_mesa_texformat_rgba;
- components = 4;
- }
- else {
- _mesa_problem(ctx, "bad srcImage->_BaseFormat in _mesa_generate_mipmaps");
- return;
- }
-
- /* allocate storage for uncompressed GL_RGB or GL_RGBA images */
- size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE)
- * srcImage->Width * srcImage->Height * srcImage->Depth + 20;
- /* 20 extra bytes, just be safe when calling last FetchTexel */
- srcData = (GLubyte *) _mesa_malloc(size);
- if (!srcData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
- return;
- }
- dstData = (GLubyte *) _mesa_malloc(size / 2); /* 1/4 would probably be OK */
- if (!dstData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
- _mesa_free((void *) srcData);
- return;
- }
-
- /* decompress base image here */
- dst = (GLchan *) srcData;
- for (row = 0; row < srcImage->Height; row++) {
- GLuint col;
- for (col = 0; col < srcImage->Width; col++) {
- srcImage->FetchTexelc(srcImage, col, row, 0, dst);
- dst += components;
- }
- }
- }
- else {
- /* uncompressed */
- convertFormat = srcImage->TexFormat;
- }
-
- for (level = texObj->BaseLevel; level < texObj->MaxLevel
- && level < maxLevels - 1; level++) {
- /* generate image[level+1] from image[level] */
- const struct gl_texture_image *srcImage;
- struct gl_texture_image *dstImage;
- GLint srcWidth, srcHeight, srcDepth;
- GLint dstWidth, dstHeight, dstDepth;
- GLint border, bytesPerTexel;
-
- /* get src image parameters */
- srcImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(srcImage);
- srcWidth = srcImage->Width;
- srcHeight = srcImage->Height;
- srcDepth = srcImage->Depth;
- border = srcImage->Border;
-
- /* compute next (level+1) image size */
- if (srcWidth - 2 * border > 1) {
- dstWidth = (srcWidth - 2 * border) / 2 + 2 * border;
- }
- else {
- dstWidth = srcWidth; /* can't go smaller */
- }
- if (srcHeight - 2 * border > 1) {
- dstHeight = (srcHeight - 2 * border) / 2 + 2 * border;
- }
- else {
- dstHeight = srcHeight; /* can't go smaller */
- }
- if (srcDepth - 2 * border > 1) {
- dstDepth = (srcDepth - 2 * border) / 2 + 2 * border;
- }
- else {
- dstDepth = srcDepth; /* can't go smaller */
- }
-
- if (dstWidth == srcWidth &&
- dstHeight == srcHeight &&
- dstDepth == srcDepth) {
- /* all done */
- if (srcImage->IsCompressed) {
- _mesa_free((void *) srcData);
- _mesa_free(dstData);
- }
- return;
- }
-
- /* get dest gl_texture_image */
- dstImage = _mesa_get_tex_image(ctx, texUnit, target, level + 1);
- if (!dstImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
- return;
- }
-
- /* Free old image data */
- if (dstImage->Data)
- ctx->Driver.FreeTexImageData(ctx, dstImage);
-
- /* initialize new image */
- _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
- dstDepth, border, srcImage->InternalFormat);
- dstImage->DriverData = NULL;
- dstImage->TexFormat = srcImage->TexFormat;
- dstImage->FetchTexelc = srcImage->FetchTexelc;
- dstImage->FetchTexelf = srcImage->FetchTexelf;
- dstImage->IsCompressed = srcImage->IsCompressed;
- if (dstImage->IsCompressed) {
- dstImage->CompressedSize
- = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width,
- dstImage->Height,
- dstImage->Depth,
- dstImage->TexFormat->MesaFormat);
- ASSERT(dstImage->CompressedSize > 0);
- }
-
- ASSERT(dstImage->TexFormat);
- ASSERT(dstImage->FetchTexelc);
- ASSERT(dstImage->FetchTexelf);
-
- /* Alloc new teximage data buffer.
- * Setup src and dest data pointers.
- */
- if (dstImage->IsCompressed) {
- dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize);
- if (!dstImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
- return;
- }
- /* srcData and dstData are already set */
- ASSERT(srcData);
- ASSERT(dstData);
- }
- else {
- bytesPerTexel = dstImage->TexFormat->TexelBytes;
- ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0);
- dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight
- * dstDepth * bytesPerTexel);
- if (!dstImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
- return;
- }
- srcData = (const GLubyte *) srcImage->Data;
- dstData = (GLubyte *) dstImage->Data;
- }
-
- /*
- * We use simple 2x2 averaging to compute the next mipmap level.
- */
- switch (target) {
- case GL_TEXTURE_1D:
- make_1d_mipmap(convertFormat, border,
- srcWidth, srcData,
- dstWidth, dstData);
- break;
- case GL_TEXTURE_2D:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- make_2d_mipmap(convertFormat, border,
- srcWidth, srcHeight, srcData,
- dstWidth, dstHeight, dstData);
- break;
- case GL_TEXTURE_3D:
- make_3d_mipmap(convertFormat, border,
- srcWidth, srcHeight, srcDepth, srcData,
- dstWidth, dstHeight, dstDepth, dstData);
- break;
- case GL_TEXTURE_RECTANGLE_NV:
- /* no mipmaps, do nothing */
- break;
- default:
- _mesa_problem(ctx, "bad dimensions in _mesa_generate_mipmaps");
- return;
- }
-
- if (dstImage->IsCompressed) {
- GLubyte *temp;
- /* compress image from dstData into dstImage->Data */
- const GLenum srcFormat = convertFormat->BaseFormat;
- GLint dstRowStride
- = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth);
- ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA);
- dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat,
- dstImage->TexFormat,
- dstImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride, 0, /* strides */
- dstWidth, dstHeight, 1, /* size */
- srcFormat, CHAN_TYPE,
- dstData, /* src data, actually */
- &ctx->DefaultPacking);
- /* swap src and dest pointers */
- temp = (GLubyte *) srcData;
- srcData = dstData;
- dstData = temp;
- }
-
- } /* loop over mipmap levels */
-}
-
-
-/**
- * Helper function for drivers which need to rescale texture images to
- * certain aspect ratios.
- * Nearest filtering only (for broken hardware that can't support
- * all aspect ratios). This can be made a lot faster, but I don't
- * really care enough...
- */
-void
-_mesa_rescale_teximage2d (GLuint bytesPerPixel,
- GLuint srcStrideInPixels,
- GLuint dstRowStride,
- GLint srcWidth, GLint srcHeight,
- GLint dstWidth, GLint dstHeight,
- const GLvoid *srcImage, GLvoid *dstImage)
-{
- GLint row, col;
-
-#define INNER_LOOP( TYPE, HOP, WOP ) \
- for ( row = 0 ; row < dstHeight ; row++ ) { \
- GLint srcRow = row HOP hScale; \
- for ( col = 0 ; col < dstWidth ; col++ ) { \
- GLint srcCol = col WOP wScale; \
- dst[col] = src[srcRow * srcStrideInPixels + srcCol]; \
- } \
- dst = (TYPE *) ((GLubyte *) dst + dstRowStride); \
- } \
-
-#define RESCALE_IMAGE( TYPE ) \
-do { \
- const TYPE *src = (const TYPE *)srcImage; \
- TYPE *dst = (TYPE *)dstImage; \
- \
- if ( srcHeight < dstHeight ) { \
- const GLint hScale = dstHeight / srcHeight; \
- if ( srcWidth < dstWidth ) { \
- const GLint wScale = dstWidth / srcWidth; \
- INNER_LOOP( TYPE, /, / ); \
- } \
- else { \
- const GLint wScale = srcWidth / dstWidth; \
- INNER_LOOP( TYPE, /, * ); \
- } \
- } \
- else { \
- const GLint hScale = srcHeight / dstHeight; \
- if ( srcWidth < dstWidth ) { \
- const GLint wScale = dstWidth / srcWidth; \
- INNER_LOOP( TYPE, *, / ); \
- } \
- else { \
- const GLint wScale = srcWidth / dstWidth; \
- INNER_LOOP( TYPE, *, * ); \
- } \
- } \
-} while (0)
-
- switch ( bytesPerPixel ) {
- case 4:
- RESCALE_IMAGE( GLuint );
- break;
-
- case 2:
- RESCALE_IMAGE( GLushort );
- break;
-
- case 1:
- RESCALE_IMAGE( GLubyte );
- break;
- default:
- _mesa_problem(NULL,"unexpected bytes/pixel in _mesa_rescale_teximage2d");
- }
-}
-
-
-/**
- * Upscale an image by replication, not (typical) stretching.
- * We use this when the image width or height is less than a
- * certain size (4, 8) and we need to upscale an image.
- */
-void
-_mesa_upscale_teximage2d (GLsizei inWidth, GLsizei inHeight,
- GLsizei outWidth, GLsizei outHeight,
- GLint comps, const GLchan *src, GLint srcRowStride,
- GLchan *dest )
-{
- GLint i, j, k;
-
- ASSERT(outWidth >= inWidth);
- ASSERT(outHeight >= inHeight);
-#if 0
- ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2);
- ASSERT((outWidth & 3) == 0);
- ASSERT((outHeight & 3) == 0);
-#endif
-
- for (i = 0; i < outHeight; i++) {
- const GLint ii = i % inHeight;
- for (j = 0; j < outWidth; j++) {
- const GLint jj = j % inWidth;
- for (k = 0; k < comps; k++) {
- dest[(i * outWidth + j) * comps + k]
- = src[ii * srcRowStride + jj * comps + k];
- }
- }
- }
-}
#if FEATURE_EXT_texture_sRGB
@@ -4381,10 +3608,9 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
for (col = 0; col < width; col++) {
(*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]);
}
- _mesa_pack_rgba_span_float(ctx, width,
- (const GLfloat (*)[4]) rgba,
- format, type, dest, &ctx->Pack,
- 0 /* no image transfer */);
+ _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
+ format, type, dest,
+ &ctx->Pack, 0x0 /*image xfer ops*/);
} /* format */
} /* row */
} /* img */
diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h
index 7dc82a51c89..f67defc503f 100644
--- a/src/mesa/main/texstore.h
+++ b/src/mesa/main/texstore.h
@@ -201,27 +201,6 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
extern void
-_mesa_generate_mipmap(GLcontext *ctx, GLenum target,
- const struct gl_texture_unit *texUnit,
- struct gl_texture_object *texObj);
-
-
-extern void
-_mesa_rescale_teximage2d(GLuint bytesPerPixel,
- GLuint srcStrideInPixels,
- GLuint dstRowStride,
- GLint srcWidth, GLint srcHeight,
- GLint dstWidth, GLint dstHeight,
- const GLvoid *srcImage, GLvoid *dstImage);
-
-extern void
-_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight,
- GLsizei outWidth, GLsizei outHeight,
- GLint comps, const GLchan *src, GLint srcRowStride,
- GLchan *dest);
-
-
-extern void
_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
GLenum format, GLenum type, GLvoid *pixels,
struct gl_texture_object *texObj,
diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index 1c01d900192..e6196050b9e 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -30,8 +30,8 @@
/* Mesa version */
#define MESA_MAJOR 6
#define MESA_MINOR 5
-#define MESA_PATCH 1
-#define MESA_VERSION_STRING "6.5.1"
+#define MESA_PATCH 2
+#define MESA_VERSION_STRING "6.5.2"
/* To make version comparison easy */
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/src/mesa/math/sources b/src/mesa/math/sources
new file mode 100644
index 00000000000..7c7dcccedfd
--- /dev/null
+++ b/src/mesa/math/sources
@@ -0,0 +1,25 @@
+MESA_MATH_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
+
+MESA_MATH_HEADERS = \
+m_clip_tmp.h \
+m_copy_tmp.h \
+m_debug.h \
+m_debug_util.h \
+m_dotprod_tmp.h \
+m_eval.h \
+m_matrix.h \
+m_norm_tmp.h \
+m_trans_tmp.h \
+m_translate.h \
+m_vector.h \
+m_xform.h \
+m_xform_tmp.h \
+mathmod.h
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index b8e5e4bd8ae..5a61f30193b 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -77,12 +77,6 @@ struct arb_program
};
-#ifndef __extension__
-#if !defined(__GNUC__) || (__GNUC__ < 2) || \
- ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7))
-# define __extension__
-#endif
-#endif
/* TODO:
* Fragment Program Stuff:
@@ -168,10 +162,11 @@ struct arb_program
typedef GLubyte *production;
+
/**
* This is the text describing the rules to parse the grammar
*/
-__extension__ static char arb_grammar_text[] =
+LONGSTRING static char arb_grammar_text[] =
#include "arbprogram_syn.h"
;
@@ -1815,7 +1810,7 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
parse_constant (inst, const_values, Program, use);
idx = _mesa_add_named_constant(Program->Base.Parameters,
(char *) param_var->name,
- const_values);
+ const_values, 4);
if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
@@ -2571,8 +2566,6 @@ parse_fp_vector_src_reg(GLcontext * ctx, const GLubyte ** inst,
reg->File = file;
reg->Index = index;
- reg->Abs = 0; /* NV only */
- reg->NegateAbs = 0; /* NV only */
reg->NegateBase = negate;
reg->Swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1], swizzle[2], swizzle[3]);
return 0;
@@ -2595,8 +2588,6 @@ parse_fp_dst_reg(GLcontext * ctx, const GLubyte ** inst,
if (parse_masked_dst_reg (ctx, inst, vc_head, Program, &file, &idx, &mask))
return 1;
- reg->CondMask = 0; /* NV only */
- reg->CondSwizzle = 0; /* NV only */
reg->File = file;
reg->Index = idx;
reg->WriteMask = mask;
@@ -2632,8 +2623,6 @@ parse_fp_scalar_src_reg (GLcontext * ctx, const GLubyte ** inst,
reg->File = File;
reg->Index = Index;
- reg->Abs = 0; /* NV only */
- reg->NegateAbs = 0; /* NV only */
reg->NegateBase = Negate;
reg->Swizzle = (Swizzle[0] << 0);
@@ -2656,7 +2645,7 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst,
GLubyte instClass, type, code;
GLboolean rel;
- _mesa_init_instruction(fp);
+ _mesa_init_instructions(fp, 1);
/* Record the position in the program string for debugging */
fp->StringPos = Program->Position;
@@ -3148,7 +3137,7 @@ parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst,
/* The actual opcode name */
code = *(*inst)++;
- _mesa_init_instruction(vp);
+ _mesa_init_instructions(vp, 1);
/* Record the position in the program string for debugging */
vp->StringPos = Program->Position;
@@ -3690,7 +3679,7 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst,
/* Finally, tag on an OPCODE_END instruction */
{
const GLuint numInst = Program->Base.NumInstructions;
- _mesa_init_instruction(Program->Base.Instructions + numInst);
+ _mesa_init_instructions(Program->Base.Instructions + numInst, 1);
Program->Base.Instructions[numInst].Opcode = OPCODE_END;
/* YYY Wrong Position in program, whatever, at least not random -> crash
Program->Position = parse_position (&inst);
@@ -4059,7 +4048,8 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
program->Base.Parameters = ap.Base.Parameters;
#if DEBUG_FP
- _mesa_print_program(&program.Base);
+ _mesa_printf("____________Fragment program %u ________\n", program->Base.ID);
+ _mesa_print_program(&program->Base);
#endif
}
@@ -4111,6 +4101,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
program->Base.Parameters = ap.Base.Parameters;
#if DEBUG_VP
+ _mesa_printf("____________Vertex program %u __________\n", program->Base.ID);
_mesa_print_program(&program->Base);
#endif
}
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 89f2d20cc9a..bff80d7ee3a 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -36,6 +36,7 @@
#include "imports.h"
#include "macros.h"
#include "mtypes.h"
+#include "program.h"
void GLAPIENTRY
@@ -101,7 +102,7 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_VERTEX_PROGRAM_ATTRIBS) {
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribfvARB(index)");
return;
}
@@ -123,6 +124,11 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Normalized;
break;
case GL_CURRENT_VERTEX_ATTRIB_ARB:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribfvARB(index==0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]);
break;
@@ -179,6 +185,31 @@ _mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer)
}
+/**
+ * Determine if id names a vertex or fragment program.
+ * \note Not compiled into display lists.
+ * \note Called from both glIsProgramNV and glIsProgramARB.
+ * \param id is the program identifier
+ * \return GL_TRUE if id is a program, else GL_FALSE.
+ */
+GLboolean GLAPIENTRY
+_mesa_IsProgramARB(GLuint id)
+{
+ struct gl_program *prog = NULL;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+
+ if (id == 0)
+ return GL_FALSE;
+
+ prog = _mesa_lookup_program(ctx, id);
+ if (prog && (prog != &_mesa_DummyProgram))
+ return GL_TRUE;
+ else
+ return GL_FALSE;
+}
+
+
void GLAPIENTRY
_mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
const GLvoid *string)
@@ -736,6 +767,7 @@ void GLAPIENTRY
_mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string)
{
const struct gl_program *prog;
+ char *dst = (char *) string;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
@@ -759,5 +791,8 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string)
return;
}
- _mesa_memcpy(string, prog->String, _mesa_strlen((char *) prog->String));
+ if (prog->String)
+ _mesa_memcpy(dst, prog->String, _mesa_strlen((char *) prog->String));
+ else
+ *dst = '\0';
}
diff --git a/src/mesa/shader/arbprogram.h b/src/mesa/shader/arbprogram.h
index 54a14bbb9f8..233f6629650 100644
--- a/src/mesa/shader/arbprogram.h
+++ b/src/mesa/shader/arbprogram.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -51,6 +51,10 @@ extern void GLAPIENTRY
_mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer);
+extern GLboolean GLAPIENTRY
+_mesa_IsProgramARB(GLuint id);
+
+
extern void GLAPIENTRY
_mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
const GLvoid *string);
diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c
index d349a496dc7..4727c1a4365 100644
--- a/src/mesa/shader/atifragshader.c
+++ b/src/mesa/shader/atifragshader.c
@@ -400,6 +400,8 @@ _mesa_EndFragmentShaderATI(void)
}
}
#endif
+ if (ctx->Driver.ProgramStringNotify)
+ ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_SHADER_ATI, NULL );
}
void GLAPIENTRY
diff --git a/src/mesa/shader/descrip.mms b/src/mesa/shader/descrip.mms
index 95569a6f25c..d70cec38300 100644
--- a/src/mesa/shader/descrip.mms
+++ b/src/mesa/shader/descrip.mms
@@ -1,7 +1,6 @@
# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 1 June 2005
-
+# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
+# Last revision : 20 November 2006
.first
define gl [---.include.gl]
define math [-.math]
@@ -16,7 +15,7 @@ VPATH = RCS
INCDIR = [---.include],[.grammar],[-.main],[-.glapi],[.slang]
LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
+CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1,"__extension__=")/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = \
atifragshader.c \
diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c
index 0b767c02cd3..7f2ee42d21d 100644
--- a/src/mesa/shader/grammar/grammar.c
+++ b/src/mesa/shader/grammar/grammar.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.2
+ * Version: 6.6
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -368,9 +368,10 @@ static int str_equal_n (const byte *str1, const byte *str2, unsigned int n)
return grammar_string_compare_n (str1, str2, n) == 0;
}
-static unsigned int str_length (const byte *str)
+static int
+str_length (const byte *str)
{
- return grammar_string_length (str);
+ return (int) (grammar_string_length (str));
}
/*
@@ -655,7 +656,9 @@ static void error_destroy (error **er)
}
struct dict_;
-static byte *error_get_token (error *, struct dict_ *, const byte *, unsigned int);
+
+static byte *
+error_get_token (error *, struct dict_ *, const byte *, int);
/*
condition operand type typedef
@@ -1616,7 +1619,8 @@ static int get_error (const byte **text, error **er, map_str *maps)
/* try to extract "token" from "...$token$..." */
{
byte *processed = NULL;
- unsigned int len = 0, i = 0;
+ unsigned int len = 0;
+ int i = 0;
if (string_grow (&processed, &len, '\0'))
{
@@ -2274,12 +2278,13 @@ typedef enum match_result_
} match_result;
/*
- This function does the main job. It parses the text and generates output data.
-*/
-static match_result match (dict *di, const byte *text, unsigned int *index, rule *ru, barray **ba,
- int filtering_string, regbyte_ctx **rbc)
+ * This function does the main job. It parses the text and generates output data.
+ */
+static match_result
+match (dict *di, const byte *text, int *index, rule *ru, barray **ba, int filtering_string,
+ regbyte_ctx **rbc)
{
- unsigned int ind = *index;
+ int ind = *index;
match_result status = mr_not_matched;
spec *sp = ru->m_specs;
regbyte_ctx *ctx = *rbc;
@@ -2287,7 +2292,7 @@ static match_result match (dict *di, const byte *text, unsigned int *index, rule
/* for every specifier in the rule */
while (sp)
{
- unsigned int i, len, save_ind = ind;
+ int i, len, save_ind = ind;
barray *array = NULL;
if (satisfies_condition (sp->m_cond, ctx))
@@ -2318,7 +2323,7 @@ static match_result match (dict *di, const byte *text, unsigned int *index, rule
if (!filtering_string && di->m_string)
{
barray *ba;
- unsigned int filter_index = 0;
+ int filter_index = 0;
match_result result;
regbyte_ctx *null_ctx = NULL;
@@ -2510,10 +2515,11 @@ static match_result match (dict *di, const byte *text, unsigned int *index, rule
return mr_not_matched;
}
-static match_result fast_match (dict *di, const byte *text, unsigned int *index, rule *ru, int *_PP, bytepool *_BP,
- int filtering_string, regbyte_ctx **rbc)
+static match_result
+fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool *_BP,
+ int filtering_string, regbyte_ctx **rbc)
{
- unsigned int ind = *index;
+ int ind = *index;
int _P = filtering_string ? 0 : *_PP;
int _P2;
match_result status = mr_not_matched;
@@ -2523,7 +2529,7 @@ static match_result fast_match (dict *di, const byte *text, unsigned int *index,
/* for every specifier in the rule */
while (sp)
{
- unsigned int i, len, save_ind = ind;
+ int i, len, save_ind = ind;
_P2 = _P + (sp->m_emits ? emit_size (sp->m_emits) : 0);
if (bytepool_reserve (_BP, _P2))
@@ -2551,7 +2557,7 @@ static match_result fast_match (dict *di, const byte *text, unsigned int *index,
/* prefilter the stream */
if (!filtering_string && di->m_string)
{
- unsigned int filter_index = 0;
+ int filter_index = 0;
match_result result;
regbyte_ctx *null_ctx = NULL;
@@ -2722,14 +2728,15 @@ static match_result fast_match (dict *di, const byte *text, unsigned int *index,
return mr_not_matched;
}
-static byte *error_get_token (error *er, dict *di, const byte *text, unsigned int ind)
+static byte *
+error_get_token (error *er, dict *di, const byte *text, int ind)
{
byte *str = NULL;
if (er->m_token)
{
barray *ba;
- unsigned int filter_index = 0;
+ int filter_index = 0;
regbyte_ctx *ctx = NULL;
barray_create (&ba);
@@ -2990,7 +2997,7 @@ static int _grammar_check (grammar id, const byte *text, byte **prod, unsigned i
unsigned int estimate_prod_size, int use_fast_path)
{
dict *di = NULL;
- unsigned int index = 0;
+ int index = 0;
clear_last_error ();
diff --git a/src/mesa/shader/grammar/grammar_crt.c b/src/mesa/shader/grammar/grammar_crt.c
index bdf2da9b2e2..bdf2da9b2e2 100755..100644
--- a/src/mesa/shader/grammar/grammar_crt.c
+++ b/src/mesa/shader/grammar/grammar_crt.c
diff --git a/src/mesa/shader/grammar/grammar_crt.h b/src/mesa/shader/grammar/grammar_crt.h
index 492711e96ae..492711e96ae 100755..100644
--- a/src/mesa/shader/grammar/grammar_crt.h
+++ b/src/mesa/shader/grammar/grammar_crt.h
diff --git a/src/mesa/shader/grammar/sources b/src/mesa/shader/grammar/sources
new file mode 100644
index 00000000000..a6bbfd3ffd3
--- /dev/null
+++ b/src/mesa/shader/grammar/sources
@@ -0,0 +1,8 @@
+MESA_SHADER_GRAMMAR_SOURCES = \
+grammar_mesa.c
+
+MESA_SHADER_GRAMMAR_HEADERS = \
+grammar.c \
+grammar.h \
+grammar_mesa.h \
+grammar_syn.h
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 49ce220944e..79e6dbd87b7 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -1041,7 +1041,7 @@ Parse_VectorSrc(struct parse_state *parseState,
GLuint paramIndex;
if (!Parse_ScalarConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1052,7 +1052,7 @@ Parse_VectorSrc(struct parse_state *parseState,
(void) Parse_String(parseState, "{");
if (!Parse_VectorConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1142,7 +1142,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
(void) Parse_String(parseState, "{");
if (!Parse_VectorConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1166,7 +1166,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
GLuint paramIndex;
if (!Parse_ScalarConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->Index = paramIndex;
srcReg->File = PROGRAM_NAMED_PARAM;
needSuffix = GL_FALSE;
@@ -1273,7 +1273,7 @@ Parse_InstructionSequence(struct parse_state *parseState,
GLubyte token[100];
/* Initialize the instruction */
- _mesa_init_instruction(inst);
+ _mesa_init_instructions(inst, 1);
/* special instructions */
if (Parse_String(parseState, "DEFINE")) {
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 4e29e0b3f88..4f160b14312 100644
--- a/src/mesa/shader/nvprogram.c
+++ b/src/mesa/shader/nvprogram.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -77,10 +77,7 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
return;
}
- _mesa_init_vp_per_vertex_registers(ctx);
- _mesa_init_vp_per_primitive_registers(ctx);
- COPY_4V(ctx->VertexProgram.Inputs[VERT_ATTRIB_POS], params);
- _mesa_exec_vertex_program(ctx, vprog);
+ _mesa_exec_vertex_state_program(ctx, vprog, params);
}
@@ -89,8 +86,9 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
* \note Not compiled into display lists.
* \note Called from the GL API dispatcher.
*/
-GLboolean GLAPIENTRY _mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids,
- GLboolean *residences)
+GLboolean GLAPIENTRY
+_mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids,
+ GLboolean *residences)
{
GLint i, j;
GLboolean allResident = GL_TRUE;
@@ -362,7 +360,7 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -378,6 +376,11 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribdvNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[index]);
break;
@@ -398,7 +401,7 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -414,6 +417,11 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params)
params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribfvNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[index]);
break;
@@ -434,7 +442,7 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -450,6 +458,11 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribivNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
params[0] = (GLint) ctx->Current.Attrib[index][0];
params[1] = (GLint) ctx->Current.Attrib[index][1];
diff --git a/src/mesa/shader/nvvertexec.c b/src/mesa/shader/nvvertexec.c
index c436f4f0451..10962d7e14a 100644
--- a/src/mesa/shader/nvvertexec.c
+++ b/src/mesa/shader/nvvertexec.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -47,23 +47,23 @@ static const GLfloat ZeroVec[4] = { 0.0F, 0.0F, 0.0F, 0.0F };
* per-vertex.
*/
void
-_mesa_init_vp_per_vertex_registers(GLcontext *ctx)
+_mesa_init_vp_per_vertex_registers(GLcontext *ctx, struct vp_machine *machine)
{
/* Input registers get initialized from the current vertex attribs */
- MEMCPY(ctx->VertexProgram.Inputs, ctx->Current.Attrib,
+ MEMCPY(machine->Inputs, ctx->Current.Attrib,
MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat));
if (ctx->VertexProgram.Current->IsNVProgram) {
GLuint i;
/* Output/result regs are initialized to [0,0,0,1] */
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
- ASSIGN_4V(ctx->VertexProgram.Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
+ ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
}
/* Temp regs are initialized to [0,0,0,0] */
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
- ASSIGN_4V(ctx->VertexProgram.Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F);
+ ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F);
}
- ASSIGN_4V(ctx->VertexProgram.AddressReg, 0, 0, 0, 0);
+ ASSIGN_4V(machine->AddressReg, 0, 0, 0, 0);
}
}
@@ -139,7 +139,7 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx)
continue;
}
- /* load the matrix */
+ /* load the matrix values into sequential registers */
if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_IDENTITY_NV) {
load_matrix(ctx->VertexProgram.Parameters, i*4, mat->m);
}
@@ -161,7 +161,7 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx)
}
}
else {
- /* Using and ARB vertex program */
+ /* ARB vertex program */
if (ctx->VertexProgram.Current->Base.Parameters) {
/* Grab the state GL state and put into registers */
_mesa_load_state_parameters(ctx,
@@ -176,36 +176,37 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx)
* For debugging. Dump the current vertex program machine registers.
*/
void
-_mesa_dump_vp_state( const struct gl_vertex_program_state *state )
+_mesa_dump_vp_state( const struct gl_vertex_program_state *state,
+ const struct vp_machine *machine)
{
int i;
_mesa_printf("VertexIn:\n");
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_INPUTS; i++) {
_mesa_printf("%d: %f %f %f %f ", i,
- state->Inputs[i][0],
- state->Inputs[i][1],
- state->Inputs[i][2],
- state->Inputs[i][3]);
+ machine->Inputs[i][0],
+ machine->Inputs[i][1],
+ machine->Inputs[i][2],
+ machine->Inputs[i][3]);
}
_mesa_printf("\n");
_mesa_printf("VertexOut:\n");
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
_mesa_printf("%d: %f %f %f %f ", i,
- state->Outputs[i][0],
- state->Outputs[i][1],
- state->Outputs[i][2],
- state->Outputs[i][3]);
+ machine->Outputs[i][0],
+ machine->Outputs[i][1],
+ machine->Outputs[i][2],
+ machine->Outputs[i][3]);
}
_mesa_printf("\n");
_mesa_printf("Registers:\n");
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
_mesa_printf("%d: %f %f %f %f ", i,
- state->Temporaries[i][0],
- state->Temporaries[i][1],
- state->Temporaries[i][2],
- state->Temporaries[i][3]);
+ machine->Temporaries[i][0],
+ machine->Temporaries[i][1],
+ machine->Temporaries[i][2],
+ machine->Temporaries[i][3]);
}
_mesa_printf("\n");
@@ -227,41 +228,45 @@ _mesa_dump_vp_state( const struct gl_vertex_program_state *state )
* source register.
*/
static INLINE const GLfloat *
-get_register_pointer( const struct prog_src_register *source,
- const struct gl_vertex_program_state *state )
+get_register_pointer( GLcontext *ctx,
+ const struct prog_src_register *source,
+ struct vp_machine *machine,
+ const struct gl_vertex_program *program )
{
if (source->RelAddr) {
- const GLint reg = source->Index + state->AddressReg[0];
+ const GLint reg = source->Index + machine->AddressReg[0];
ASSERT( (source->File == PROGRAM_ENV_PARAM) ||
(source->File == PROGRAM_STATE_VAR) );
if (reg < 0 || reg > MAX_NV_VERTEX_PROGRAM_PARAMS)
return ZeroVec;
else if (source->File == PROGRAM_ENV_PARAM)
- return state->Parameters[reg];
- else
- return state->Current->Base.Parameters->ParameterValues[reg];
+ return ctx->VertexProgram.Parameters[reg];
+ else {
+ ASSERT(source->File == PROGRAM_LOCAL_PARAM);
+ return program->Base.Parameters->ParameterValues[reg];
+ }
}
else {
switch (source->File) {
case PROGRAM_TEMPORARY:
ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_TEMPS);
- return state->Temporaries[source->Index];
+ return machine->Temporaries[source->Index];
case PROGRAM_INPUT:
ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_INPUTS);
- return state->Inputs[source->Index];
+ return machine->Inputs[source->Index];
case PROGRAM_OUTPUT:
/* This is only needed for the PRINT instruction */
ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_OUTPUTS);
- return state->Outputs[source->Index];
+ return machine->Outputs[source->Index];
case PROGRAM_LOCAL_PARAM:
ASSERT(source->Index < MAX_PROGRAM_LOCAL_PARAMS);
- return state->Current->Base.LocalParams[source->Index];
+ return program->Base.LocalParams[source->Index];
case PROGRAM_ENV_PARAM:
ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_PARAMS);
- return state->Parameters[source->Index];
+ return ctx->VertexProgram.Parameters[source->Index];
case PROGRAM_STATE_VAR:
- ASSERT(source->Index < state->Current->Base.Parameters->NumParameters);
- return state->Current->Base.Parameters->ParameterValues[source->Index];
+ ASSERT(source->Index < program->Base.Parameters->NumParameters);
+ return program->Base.Parameters->ParameterValues[source->Index];
default:
_mesa_problem(NULL,
"Bad source register file in get_register_pointer");
@@ -277,23 +282,23 @@ get_register_pointer( const struct prog_src_register *source,
* Apply swizzling and negating as needed.
*/
static INLINE void
-fetch_vector4( const struct prog_src_register *source,
- const struct gl_vertex_program_state *state,
+fetch_vector4( GLcontext *ctx,
+ const struct prog_src_register *source,
+ struct vp_machine *machine,
+ const struct gl_vertex_program *program,
GLfloat result[4] )
{
- const GLfloat *src = get_register_pointer(source, state);
-
+ const GLfloat *src = get_register_pointer(ctx, source, machine, program);
+ ASSERT(src);
+ result[0] = src[GET_SWZ(source->Swizzle, 0)];
+ result[1] = src[GET_SWZ(source->Swizzle, 1)];
+ result[2] = src[GET_SWZ(source->Swizzle, 2)];
+ result[3] = src[GET_SWZ(source->Swizzle, 3)];
if (source->NegateBase) {
- result[0] = -src[GET_SWZ(source->Swizzle, 0)];
- result[1] = -src[GET_SWZ(source->Swizzle, 1)];
- result[2] = -src[GET_SWZ(source->Swizzle, 2)];
- result[3] = -src[GET_SWZ(source->Swizzle, 3)];
- }
- else {
- result[0] = src[GET_SWZ(source->Swizzle, 0)];
- result[1] = src[GET_SWZ(source->Swizzle, 1)];
- result[2] = src[GET_SWZ(source->Swizzle, 2)];
- result[3] = src[GET_SWZ(source->Swizzle, 3)];
+ result[0] = -result[0];
+ result[1] = -result[1];
+ result[2] = -result[2];
+ result[3] = -result[3];
}
}
@@ -303,17 +308,17 @@ fetch_vector4( const struct prog_src_register *source,
* As above, but only return result[0] element.
*/
static INLINE void
-fetch_vector1( const struct prog_src_register *source,
- const struct gl_vertex_program_state *state,
+fetch_vector1( GLcontext *ctx,
+ const struct prog_src_register *source,
+ struct vp_machine *machine,
+ const struct gl_vertex_program *program,
GLfloat result[4] )
{
- const GLfloat *src = get_register_pointer(source, state);
-
+ const GLfloat *src = get_register_pointer(ctx, source, machine, program);
+ ASSERT(src);
+ result[0] = src[GET_SWZ(source->Swizzle, 0)];
if (source->NegateBase) {
- result[0] = -src[GET_SWZ(source->Swizzle, 0)];
- }
- else {
- result[0] = src[GET_SWZ(source->Swizzle, 0)];
+ result[0] = -result[0];
}
}
@@ -322,19 +327,21 @@ fetch_vector1( const struct prog_src_register *source,
* Store 4 floats into a register.
*/
static void
-store_vector4( const struct prog_dst_register *dest,
- struct gl_vertex_program_state *state,
+store_vector4( const struct prog_instruction *inst,
+ struct vp_machine *machine,
const GLfloat value[4] )
{
+ const struct prog_dst_register *dest = &(inst->DstReg);
GLfloat *dst;
switch (dest->File) {
- case PROGRAM_TEMPORARY:
- dst = state->Temporaries[dest->Index];
- break;
case PROGRAM_OUTPUT:
- dst = state->Outputs[dest->Index];
+ dst = machine->Outputs[dest->Index];
+ break;
+ case PROGRAM_TEMPORARY:
+ dst = machine->Temporaries[dest->Index];
break;
case PROGRAM_ENV_PARAM:
+ /* Only for VP state programs */
{
/* a slight hack */
GET_CURRENT_CONTEXT(ctx);
@@ -379,9 +386,10 @@ store_vector4( const struct prog_dst_register *dest,
* Execute the given vertex program
*/
void
-_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program)
+_mesa_exec_vertex_program(GLcontext *ctx,
+ struct vp_machine *machine,
+ const struct gl_vertex_program *program)
{
- struct gl_vertex_program_state *state = &ctx->VertexProgram;
const struct prog_instruction *inst;
ctx->_CurrentProgram = GL_VERTEX_PROGRAM_ARB; /* or NV, doesn't matter */
@@ -390,9 +398,9 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra
* by the MVP matrix and store in the vertex position result register.
*/
if (ctx->VertexProgram.Current->IsPositionInvariant) {
- TRANSFORM_POINT( ctx->VertexProgram.Outputs[VERT_RESULT_HPOS],
+ TRANSFORM_POINT( machine->Outputs[VERT_RESULT_HPOS],
ctx->_ModelProjectMatrix.m,
- ctx->VertexProgram.Inputs[VERT_ATTRIB_POS]);
+ machine->Inputs[VERT_ATTRIB_POS]);
/* XXX: This could go elsewhere */
ctx->VertexProgram.Current->Base.OutputsWritten |= VERT_BIT_POS;
@@ -411,15 +419,15 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra
case OPCODE_MOV:
{
GLfloat t[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- store_vector4( &inst->DstReg, state, t );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_LIT:
{
const GLfloat epsilon = 1.0F / 256.0F; /* per NV spec */
GLfloat t[4], lit[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
t[0] = MAX2(t[0], 0.0F);
t[1] = MAX2(t[1], 0.0F);
t[3] = CLAMP(t[3], -(128.0F - epsilon), (128.0F - epsilon));
@@ -427,32 +435,32 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra
lit[1] = t[0];
lit[2] = (t[0] > 0.0) ? (GLfloat) _mesa_pow(t[1], t[3]) : 0.0F;
lit[3] = 1.0;
- store_vector4( &inst->DstReg, state, lit );
+ store_vector4( inst, machine, lit );
}
break;
case OPCODE_RCP:
{
GLfloat t[4];
- fetch_vector1( &inst->SrcReg[0], state, t );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
if (t[0] != 1.0F)
t[0] = 1.0F / t[0]; /* div by zero is infinity! */
t[1] = t[2] = t[3] = t[0];
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_RSQ:
{
GLfloat t[4];
- fetch_vector1( &inst->SrcReg[0], state, t );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
t[0] = INV_SQRTF(FABSF(t[0]));
t[1] = t[2] = t[3] = t[0];
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_EXP:
{
GLfloat t[4], q[4], floor_t0;
- fetch_vector1( &inst->SrcReg[0], state, t );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
floor_t0 = FLOORF(t[0]);
if (floor_t0 > FLT_MAX_EXP) {
SET_POS_INFINITY(q[0]);
@@ -475,13 +483,13 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra
}
q[1] = t[0] - floor_t0;
q[3] = 1.0F;
- store_vector4( &inst->DstReg, state, q );
+ store_vector4( inst, machine, q );
}
break;
case OPCODE_LOG:
{
GLfloat t[4], q[4], abs_t0;
- fetch_vector1( &inst->SrcReg[0], state, t );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
abs_t0 = FABSF(t[0]);
if (abs_t0 != 0.0F) {
/* Since we really can't handle infinite values on VMS
@@ -512,147 +520,147 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra
SET_NEG_INFINITY(q[2]);
}
q[3] = 1.0;
- store_vector4( &inst->DstReg, state, q );
+ store_vector4( inst, machine, q );
}
break;
case OPCODE_MUL:
{
GLfloat t[4], u[4], prod[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
prod[0] = t[0] * u[0];
prod[1] = t[1] * u[1];
prod[2] = t[2] * u[2];
prod[3] = t[3] * u[3];
- store_vector4( &inst->DstReg, state, prod );
+ store_vector4( inst, machine, prod );
}
break;
case OPCODE_ADD:
{
GLfloat t[4], u[4], sum[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
sum[0] = t[0] + u[0];
sum[1] = t[1] + u[1];
sum[2] = t[2] + u[2];
sum[3] = t[3] + u[3];
- store_vector4( &inst->DstReg, state, sum );
+ store_vector4( inst, machine, sum );
}
break;
case OPCODE_DP3:
{
GLfloat t[4], u[4], dot[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
dot[0] = t[0] * u[0] + t[1] * u[1] + t[2] * u[2];
dot[1] = dot[2] = dot[3] = dot[0];
- store_vector4( &inst->DstReg, state, dot );
+ store_vector4( inst, machine, dot );
}
break;
case OPCODE_DP4:
{
GLfloat t[4], u[4], dot[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
dot[0] = t[0] * u[0] + t[1] * u[1] + t[2] * u[2] + t[3] * u[3];
dot[1] = dot[2] = dot[3] = dot[0];
- store_vector4( &inst->DstReg, state, dot );
+ store_vector4( inst, machine, dot );
}
break;
case OPCODE_DST:
{
GLfloat t[4], u[4], dst[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
dst[0] = 1.0F;
dst[1] = t[1] * u[1];
dst[2] = t[2];
dst[3] = u[3];
- store_vector4( &inst->DstReg, state, dst );
+ store_vector4( inst, machine, dst );
}
break;
case OPCODE_MIN:
{
GLfloat t[4], u[4], min[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
min[0] = (t[0] < u[0]) ? t[0] : u[0];
min[1] = (t[1] < u[1]) ? t[1] : u[1];
min[2] = (t[2] < u[2]) ? t[2] : u[2];
min[3] = (t[3] < u[3]) ? t[3] : u[3];
- store_vector4( &inst->DstReg, state, min );
+ store_vector4( inst, machine, min );
}
break;
case OPCODE_MAX:
{
GLfloat t[4], u[4], max[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
max[0] = (t[0] > u[0]) ? t[0] : u[0];
max[1] = (t[1] > u[1]) ? t[1] : u[1];
max[2] = (t[2] > u[2]) ? t[2] : u[2];
max[3] = (t[3] > u[3]) ? t[3] : u[3];
- store_vector4( &inst->DstReg, state, max );
+ store_vector4( inst, machine, max );
}
break;
case OPCODE_SLT:
{
GLfloat t[4], u[4], slt[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
slt[0] = (t[0] < u[0]) ? 1.0F : 0.0F;
slt[1] = (t[1] < u[1]) ? 1.0F : 0.0F;
slt[2] = (t[2] < u[2]) ? 1.0F : 0.0F;
slt[3] = (t[3] < u[3]) ? 1.0F : 0.0F;
- store_vector4( &inst->DstReg, state, slt );
+ store_vector4( inst, machine, slt );
}
break;
case OPCODE_SGE:
{
GLfloat t[4], u[4], sge[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
sge[0] = (t[0] >= u[0]) ? 1.0F : 0.0F;
sge[1] = (t[1] >= u[1]) ? 1.0F : 0.0F;
sge[2] = (t[2] >= u[2]) ? 1.0F : 0.0F;
sge[3] = (t[3] >= u[3]) ? 1.0F : 0.0F;
- store_vector4( &inst->DstReg, state, sge );
+ store_vector4( inst, machine, sge );
}
break;
case OPCODE_MAD:
{
GLfloat t[4], u[4], v[4], sum[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
- fetch_vector4( &inst->SrcReg[2], state, v );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
+ fetch_vector4( ctx, &inst->SrcReg[2], machine, program, v );
sum[0] = t[0] * u[0] + v[0];
sum[1] = t[1] * u[1] + v[1];
sum[2] = t[2] * u[2] + v[2];
sum[3] = t[3] * u[3] + v[3];
- store_vector4( &inst->DstReg, state, sum );
+ store_vector4( inst, machine, sum );
}
break;
case OPCODE_ARL:
{
GLfloat t[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- state->AddressReg[0] = (GLint) FLOORF(t[0]);
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ machine->AddressReg[0] = (GLint) FLOORF(t[0]);
}
break;
case OPCODE_DPH:
{
GLfloat t[4], u[4], dot[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
dot[0] = t[0] * u[0] + t[1] * u[1] + t[2] * u[2] + u[3];
dot[1] = dot[2] = dot[3] = dot[0];
- store_vector4( &inst->DstReg, state, dot );
+ store_vector4( inst, machine, dot );
}
break;
case OPCODE_RCC:
{
GLfloat t[4], u;
- fetch_vector1( &inst->SrcReg[0], state, t );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
if (t[0] == 1.0F)
u = 1.0F;
else
@@ -674,115 +682,120 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra
}
}
t[0] = t[1] = t[2] = t[3] = u;
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_SUB: /* GL_NV_vertex_program1_1 */
{
GLfloat t[4], u[4], sum[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
sum[0] = t[0] - u[0];
sum[1] = t[1] - u[1];
sum[2] = t[2] - u[2];
sum[3] = t[3] - u[3];
- store_vector4( &inst->DstReg, state, sum );
+ store_vector4( inst, machine, sum );
}
break;
case OPCODE_ABS: /* GL_NV_vertex_program1_1 */
{
GLfloat t[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
if (t[0] < 0.0) t[0] = -t[0];
if (t[1] < 0.0) t[1] = -t[1];
if (t[2] < 0.0) t[2] = -t[2];
if (t[3] < 0.0) t[3] = -t[3];
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_FLR: /* GL_ARB_vertex_program */
{
GLfloat t[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
t[0] = FLOORF(t[0]);
t[1] = FLOORF(t[1]);
t[2] = FLOORF(t[2]);
t[3] = FLOORF(t[3]);
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_FRC: /* GL_ARB_vertex_program */
{
GLfloat t[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
t[0] = t[0] - FLOORF(t[0]);
t[1] = t[1] - FLOORF(t[1]);
t[2] = t[2] - FLOORF(t[2]);
t[3] = t[3] - FLOORF(t[3]);
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_EX2: /* GL_ARB_vertex_program */
{
GLfloat t[4];
- fetch_vector1( &inst->SrcReg[0], state, t );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
t[0] = t[1] = t[2] = t[3] = (GLfloat)_mesa_pow(2.0, t[0]);
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_LG2: /* GL_ARB_vertex_program */
{
GLfloat t[4];
- fetch_vector1( &inst->SrcReg[0], state, t );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
t[0] = t[1] = t[2] = t[3] = LOG2(t[0]);
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_POW: /* GL_ARB_vertex_program */
{
GLfloat t[4], u[4];
- fetch_vector1( &inst->SrcReg[0], state, t );
- fetch_vector1( &inst->SrcReg[1], state, u );
+ fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector1( ctx, &inst->SrcReg[1], machine, program, u );
t[0] = t[1] = t[2] = t[3] = (GLfloat)_mesa_pow(t[0], u[0]);
- store_vector4( &inst->DstReg, state, t );
+ store_vector4( inst, machine, t );
}
break;
case OPCODE_XPD: /* GL_ARB_vertex_program */
{
GLfloat t[4], u[4], cross[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
- fetch_vector4( &inst->SrcReg[1], state, u );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u );
cross[0] = t[1] * u[2] - t[2] * u[1];
cross[1] = t[2] * u[0] - t[0] * u[2];
cross[2] = t[0] * u[1] - t[1] * u[0];
- store_vector4( &inst->DstReg, state, cross );
+ store_vector4( inst, machine, cross );
}
break;
case OPCODE_SWZ: /* GL_ARB_vertex_program */
{
const struct prog_src_register *source = &inst->SrcReg[0];
- const GLfloat *src = get_register_pointer(source, state);
+ const GLfloat *src = get_register_pointer(ctx, source,
+ machine, program);
GLfloat result[4];
GLuint i;
/* do extended swizzling here */
for (i = 0; i < 4; i++) {
- if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ZERO)
+ const GLuint swz = GET_SWZ(source->Swizzle, i);
+ if (swz == SWIZZLE_ZERO)
result[i] = 0.0;
- else if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ONE)
+ else if (swz == SWIZZLE_ONE)
result[i] = 1.0;
- else
- result[i] = src[GET_SWZ(source->Swizzle, i)];
+ else {
+ ASSERT(swz >= 0);
+ ASSERT(swz <= 3);
+ result[i] = src[swz];
+ }
if (source->NegateBase & (1 << i))
result[i] = -result[i];
}
- store_vector4( &inst->DstReg, state, result );
+ store_vector4( inst, machine, result );
}
break;
case OPCODE_PRINT:
if (inst->SrcReg[0].File) {
GLfloat t[4];
- fetch_vector4( &inst->SrcReg[0], state, t );
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t );
_mesa_printf("%s%g, %g, %g, %g\n",
(char *) inst->Data, t[0], t[1], t[2], t[3]);
}
@@ -805,48 +818,18 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra
}
-
/**
-Thoughts on vertex program optimization:
-
-The obvious thing to do is to compile the vertex program into X86/SSE/3DNow!
-assembly code. That will probably be a lot of work.
-
-Another approach might be to replace the vp_instruction->Opcode field with
-a pointer to a specialized C function which executes the instruction.
-In particular we can write functions which skip swizzling, negating,
-masking, relative addressing, etc. when they're not needed.
-
-For example:
-
-void simple_add( struct prog_instruction *inst )
+ * Execute a vertex state program.
+ * \sa _mesa_ExecuteProgramNV
+ */
+void
+_mesa_exec_vertex_state_program(GLcontext *ctx,
+ struct gl_vertex_program *vprog,
+ const GLfloat *params)
{
- GLfloat *sum = machine->Registers[inst->DstReg.Register];
- GLfloat *a = machine->Registers[inst->SrcReg[0].Register];
- GLfloat *b = machine->Registers[inst->SrcReg[1].Register];
- sum[0] = a[0] + b[0];
- sum[1] = a[1] + b[1];
- sum[2] = a[2] + b[2];
- sum[3] = a[3] + b[3];
+ struct vp_machine machine;
+ _mesa_init_vp_per_vertex_registers(ctx, &machine);
+ _mesa_init_vp_per_primitive_registers(ctx);
+ COPY_4V(machine.Inputs[VERT_ATTRIB_POS], params);
+ _mesa_exec_vertex_program(ctx, &machine, vprog);
}
-
-*/
-
-/*
-
-KW:
-
-A first step would be to 'vectorize' the programs in the same way as
-the normal transformation code in the tnl module. Thus each opcode
-takes zero or more input vectors (registers) and produces one or more
-output vectors.
-
-These operations would intially be coded in C, with machine-specific
-assembly following, as is currently the case for matrix
-transformations in the math/ directory. The preprocessing scheme for
-selecting simpler operations Brian describes above would also work
-here.
-
-This should give reasonable performance without excessive effort.
-
-*/
diff --git a/src/mesa/shader/nvvertexec.h b/src/mesa/shader/nvvertexec.h
index e0fd46a7662..b1cf31bd3c4 100644
--- a/src/mesa/shader/nvvertexec.h
+++ b/src/mesa/shader/nvvertexec.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -28,16 +28,40 @@
#ifndef NVVERTEXEC_H
#define NVVERTEXEC_H
+
+/**
+ * Virtual vertex program machine state.
+ * Only used during program execution.
+ */
+struct vp_machine
+{
+ GLfloat Temporaries[MAX_NV_VERTEX_PROGRAM_TEMPS][4];
+ GLfloat Inputs[MAX_NV_VERTEX_PROGRAM_INPUTS][4];
+ GLuint InputsSize[MAX_NV_VERTEX_PROGRAM_INPUTS];
+ GLfloat Outputs[MAX_NV_VERTEX_PROGRAM_OUTPUTS][4];
+ GLint AddressReg[4];
+};
+
+
+
extern void
-_mesa_init_vp_per_vertex_registers(GLcontext *ctx);
+_mesa_init_vp_per_vertex_registers(GLcontext *ctx, struct vp_machine *machine);
extern void
_mesa_init_vp_per_primitive_registers(GLcontext *ctx);
extern void
-_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program);
+_mesa_exec_vertex_program(GLcontext *ctx,
+ struct vp_machine *machine,
+ const struct gl_vertex_program *program);
+
+extern void
+_mesa_exec_vertex_state_program(GLcontext *ctx,
+ struct gl_vertex_program *vprog,
+ const GLfloat *params);
extern void
-_mesa_dump_vp_state( const struct gl_vertex_program_state *state );
+_mesa_dump_vp_state( const struct gl_vertex_program_state *state,
+ const struct vp_machine *machine);
#endif
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index 3840dca2220..ecfe8ec334f 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -62,8 +62,8 @@ struct parse_state {
GLboolean isStateProgram;
GLboolean isPositionInvariant;
GLboolean isVersion1_1;
- GLuint inputsRead;
- GLuint outputsWritten;
+ GLbitfield inputsRead;
+ GLbitfield outputsWritten;
GLboolean anyProgRegsWritten;
GLuint numInst; /* number of instructions parsed */
};
@@ -1143,7 +1143,7 @@ Parse_InstructionSequence(struct parse_state *parseState,
struct prog_instruction *inst = program + parseState->numInst;
/* Initialize the instruction */
- _mesa_init_instruction(inst);
+ _mesa_init_instructions(inst, 1);
if (Parse_String(parseState, "MOV")) {
if (!Parse_UnaryOpInstruction(parseState, inst, OPCODE_MOV))
@@ -1395,6 +1395,8 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
}
program->Base.Instructions = newInst;
program->Base.InputsRead = parseState.inputsRead;
+ if (parseState.isPositionInvariant)
+ program->Base.InputsRead |= VERT_BIT_POS;
program->Base.NumInstructions = parseState.numInst;
program->Base.OutputsWritten = parseState.outputsWritten;
program->IsPositionInvariant = parseState.isPositionInvariant;
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 590f357b636..ddfad47b894 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -45,7 +45,7 @@
static const char *
make_state_string(const GLint stateTokens[6]);
-static GLuint
+static GLbitfield
make_state_flags(const GLint state[]);
@@ -207,6 +207,7 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog,
prog->Target = target;
prog->Resident = GL_TRUE;
prog->RefCount = 1;
+ prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
}
return prog;
@@ -284,6 +285,9 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
(void) ctx;
ASSERT(prog);
+ if (prog == &_mesa_DummyProgram)
+ return;
+
if (prog->String)
_mesa_free(prog->String);
@@ -430,14 +434,24 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
* This will be used when the program contains something like this:
* PARAM myVals = { 0, 1, 2, 3 };
*
- * \param paramList - the parameter list
- * \param values - four float values
- * \return index of the new parameter.
+ * \param paramList the parameter list
+ * \param name the name for the constant
+ * \param values four float values
+ * \return index/position of the new parameter in the parameter list
*/
GLint
_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
- const char *name, const GLfloat values[4])
+ const char *name, const GLfloat values[4],
+ GLuint size)
{
+#if 0 /* disable this for now -- we need to save the name! */
+ GLuint pos, swizzle;
+ ASSERT(size == 4); /* XXX future feature */
+ /* check if we already have this constant */
+ if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) {
+ return pos;
+ }
+#endif
return add_parameter(paramList, name, values, PROGRAM_CONSTANT);
}
@@ -447,14 +461,20 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList,
* This will be used when the program contains something like this:
* MOV r, { 0, 1, 2, 3 };
*
- * \param paramList - the parameter list
- * \param values - four float values
- * \return index of the new parameter.
+ * \param paramList the parameter list
+ * \param values four float values
+ * \return index/position of the new parameter in the parameter list.
*/
GLint
_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
- const GLfloat values[4])
+ const GLfloat values[4], GLuint size)
{
+ GLuint pos, swizzle;
+ ASSERT(size == 4); /* XXX future feature */
+ /* check if we already have this constant */
+ if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) {
+ return pos;
+ }
return add_parameter(paramList, NULL, values, PROGRAM_CONSTANT);
}
@@ -464,8 +484,8 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
* This will be used when the program contains something like this:
* PARAM ambient = state.material.front.ambient;
*
- * \param paramList - the parameter list
- * \param state - an array of 6 state tokens
+ * \param paramList the parameter list
+ * \param state an array of 6 state tokens
* \return index of the new parameter.
*/
GLint
@@ -485,8 +505,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
paramList->Parameters[index].StateIndexes[i]
= (enum state_index) stateTokens[i];
}
- paramList->StateFlags |=
- make_state_flags(stateTokens);
+ paramList->StateFlags |= make_state_flags(stateTokens);
}
/* free name string here since we duplicated it in add_parameter() */
@@ -501,7 +520,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
* \return pointer to the float[4] values.
*/
GLfloat *
-_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name)
{
GLuint i;
@@ -531,11 +550,15 @@ _mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
/**
- * Lookup a parameter index by name in the given parameter list.
+ * Given a program parameter name, find its position in the list of parameters.
+ * \param paramList the parameter list to search
+ * \param nameLen length of name (in chars).
+ * If length is negative, assume that name is null-terminated.
+ * \param name the name to search for
* \return index of parameter in the list.
*/
GLint
-_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name)
{
GLint i;
@@ -565,6 +588,61 @@ _mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
/**
+ * Look for a float vector in the given parameter list. The float vector
+ * may be of length 1, 2, 3 or 4.
+ * \param paramList the parameter list to search
+ * \param v the float vector to search for
+ * \param size number of element in v
+ * \param posOut returns the position of the constant, if found
+ * \param swizzleOut returns a swizzle mask describing location of the
+ * vector elements if found
+ * \return GL_TRUE if found, GL_FALSE if not found
+ */
+GLboolean
+_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList,
+ const GLfloat v[], GLsizei vSize,
+ GLuint *posOut, GLuint *swizzleOut)
+{
+ GLuint i;
+
+ assert(vSize >= 1);
+ assert(vSize <= 4);
+
+ if (!paramList)
+ return -1;
+
+ for (i = 0; i < paramList->NumParameters; i++) {
+ if (paramList->Parameters[i].Type == PROGRAM_CONSTANT) {
+ const GLint maxShift = 4 - vSize;
+ GLint shift, j;
+ for (shift = 0; shift <= maxShift; shift++) {
+ GLint matched = 0;
+ GLuint swizzle[4];
+ swizzle[0] = swizzle[1] = swizzle[2] = swizzle[3] = 0;
+ /* XXX we could do out-of-order swizzle matches too, someday */
+ for (j = 0; j < vSize; j++) {
+ assert(shift + j < 4);
+ if (paramList->ParameterValues[i][shift + j] == v[j]) {
+ matched++;
+ swizzle[j] = shift + j;
+ }
+ }
+ if (matched == vSize) {
+ /* found! */
+ *posOut = i;
+ *swizzleOut = MAKE_SWIZZLE4(swizzle[0], swizzle[1],
+ swizzle[2], swizzle[3]);
+ return GL_TRUE;
+ }
+ }
+ }
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
* Use the list of tokens in the state[] array to find global GL state
* and return it in <value>. Usually, four values are returned in <value>
* but matrix queries may return as many as 16 values.
@@ -580,37 +658,29 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
{
/* state[1] is either 0=front or 1=back side */
const GLuint face = (GLuint) state[1];
+ const struct gl_material *mat = &ctx->Light.Material;
+ ASSERT(face == 0 || face == 1);
+ /* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */
+ ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT);
+ /* XXX we could get rid of this switch entirely with a little
+ * work in arbprogparse.c's parse_state_single_item().
+ */
/* state[2] is the material attribute */
switch (state[2]) {
case STATE_AMBIENT:
- if (face == 0)
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT]);
- else
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT]);
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_AMBIENT + face]);
return;
case STATE_DIFFUSE:
- if (face == 0)
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE]);
- else
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE]);
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_DIFFUSE + face]);
return;
case STATE_SPECULAR:
- if (face == 0)
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR]);
- else
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_SPECULAR]);
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_SPECULAR + face]);
return;
case STATE_EMISSION:
- if (face == 0)
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION]);
- else
- COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION]);
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_EMISSION + face]);
return;
case STATE_SHININESS:
- if (face == 0)
- value[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0];
- else
- value[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_SHININESS][0];
+ value[0] = mat->Attrib[MAT_ATTRIB_FRONT_SHININESS + face][0];
value[1] = 0.0F;
value[2] = 0.0F;
value[3] = 1.0F;
@@ -917,8 +987,19 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
case STATE_NORMAL_SCALE:
ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1);
break;
+ case STATE_TEXRECT_SCALE: {
+ const int unit = (int) state[2];
+ const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
+ if (texObj) {
+ struct gl_texture_image *texImage = texObj->Image[0][0];
+ ASSIGN_4V(value, 1.0 / texImage->Width, 1.0 / texImage->Height, 0, 1);
+ }
+ break;
+ }
default:
- _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
+ /* unknown state indexes are silently ignored
+ * should be handled by the driver.
+ */
return;
}
}
@@ -932,10 +1013,14 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
/**
- * Return a bit mask of the Mesa state flags under which a parameter's
- * value might change.
+ * Return a bitmask of the Mesa state flags (_NEW_* values) which would
+ * indicate that the given context state may have changed.
+ * The bitmask is used during validation to determine if we need to update
+ * vertex/fragment program parameters (like "state.material.color") when
+ * some GL state has changed.
*/
-static GLuint make_state_flags(const GLint state[])
+static GLbitfield
+make_state_flags(const GLint state[])
{
switch (state[0]) {
case STATE_MATERIAL:
@@ -988,8 +1073,12 @@ static GLuint make_state_flags(const GLint state[])
switch (state[1]) {
case STATE_NORMAL_SCALE:
return _NEW_MODELVIEW;
+ case STATE_TEXRECT_SCALE:
+ return _NEW_TEXTURE;
default:
- _mesa_problem(NULL, "unexpected int. state in make_state_flags()");
+ /* unknown state indexes are silently ignored and
+ * no flag set, since it is handled by the driver.
+ */
return 0;
}
@@ -1261,7 +1350,7 @@ make_state_string(const GLint state[6])
case STATE_INTERNAL:
break;
default:
- _mesa_problem(NULL, "Invalid state in maka_state_string");
+ _mesa_problem(NULL, "Invalid state in make_state_string");
break;
}
@@ -1296,26 +1385,32 @@ _mesa_load_state_parameters(GLcontext *ctx,
/**
* Initialize program instruction fields to defaults.
+ * \param inst first instruction to initialize
+ * \param count number of instructions to initialize
*/
void
-_mesa_init_instruction(struct prog_instruction *inst)
+_mesa_init_instructions(struct prog_instruction *inst, GLuint count)
{
- _mesa_bzero(inst, sizeof(struct prog_instruction));
-
- inst->SrcReg[0].File = PROGRAM_UNDEFINED;
- inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
- inst->SrcReg[1].File = PROGRAM_UNDEFINED;
- inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
- inst->SrcReg[2].File = PROGRAM_UNDEFINED;
- inst->SrcReg[2].Swizzle = SWIZZLE_NOOP;
-
- inst->DstReg.File = PROGRAM_UNDEFINED;
- inst->DstReg.WriteMask = WRITEMASK_XYZW;
- inst->DstReg.CondMask = COND_TR;
- inst->DstReg.CondSwizzle = SWIZZLE_NOOP;
-
- inst->SaturateMode = SATURATE_OFF;
- inst->Precision = FLOAT32;
+ GLuint i;
+
+ _mesa_bzero(inst, count * sizeof(struct prog_instruction));
+
+ for (i = 0; i < count; i++) {
+ inst[i].SrcReg[0].File = PROGRAM_UNDEFINED;
+ inst[i].SrcReg[0].Swizzle = SWIZZLE_NOOP;
+ inst[i].SrcReg[1].File = PROGRAM_UNDEFINED;
+ inst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP;
+ inst[i].SrcReg[2].File = PROGRAM_UNDEFINED;
+ inst[i].SrcReg[2].Swizzle = SWIZZLE_NOOP;
+
+ inst[i].DstReg.File = PROGRAM_UNDEFINED;
+ inst[i].DstReg.WriteMask = WRITEMASK_XYZW;
+ inst[i].DstReg.CondMask = COND_TR;
+ inst[i].DstReg.CondSwizzle = SWIZZLE_NOOP;
+
+ inst[i].SaturateMode = SATURATE_OFF;
+ inst[i].Precision = FLOAT32;
+ }
}
@@ -1450,19 +1545,8 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = {
GLuint
_mesa_num_inst_src_regs(enum prog_opcode opcode)
{
- GLuint i;
-#ifdef DEBUG
- for (i = 0; i < MAX_OPCODE; i++) {
- ASSERT(i == InstInfo[i].Opcode);
- }
-#endif
- for (i = 0; i < MAX_OPCODE; i++) {
- if (InstInfo[i].Opcode == opcode) {
- return InstInfo[i].NumSrcRegs;
- }
- }
- _mesa_problem(NULL, "invalid opcode in _mesa_num_inst_src_regs");
- return 0;
+ ASSERT(opcode == InstInfo[opcode].Opcode);
+ return InstInfo[opcode].NumSrcRegs;
}
@@ -1601,6 +1685,38 @@ print_src_reg(const struct prog_src_register *srcReg)
srcReg->NegateBase, GL_FALSE));
}
+void
+_mesa_print_alu_instruction(const struct prog_instruction *inst,
+ const char *opcode_string,
+ GLuint numRegs)
+{
+ GLuint j;
+
+ _mesa_printf("%s", opcode_string);
+
+ /* frag prog only */
+ if (inst->SaturateMode == SATURATE_ZERO_ONE)
+ _mesa_printf("_SAT");
+
+ if (inst->DstReg.File != PROGRAM_UNDEFINED) {
+ _mesa_printf(" %s[%d]%s",
+ program_file_string((enum register_file) inst->DstReg.File),
+ inst->DstReg.Index,
+ writemask_string(inst->DstReg.WriteMask));
+ }
+
+ if (numRegs > 0)
+ _mesa_printf(", ");
+
+ for (j = 0; j < numRegs; j++) {
+ print_src_reg(inst->SrcReg + j);
+ if (j + 1 < numRegs)
+ _mesa_printf(", ");
+ }
+
+ _mesa_printf(";\n");
+}
+
/**
* Print a single vertex/fragment program instruction.
@@ -1659,37 +1775,16 @@ _mesa_print_instruction(const struct prog_instruction *inst)
print_src_reg(&inst->SrcReg[0]);
_mesa_printf(";\n");
break;
+ case OPCODE_END:
+ _mesa_printf("END;\n");
+ break;
/* XXX may need for other special-case instructions */
default:
/* typical alu instruction */
- {
- const GLuint numRegs = _mesa_num_inst_src_regs(inst->Opcode);
- GLuint j;
-
- _mesa_printf("%s", _mesa_opcode_string(inst->Opcode));
-
- /* frag prog only */
- if (inst->SaturateMode == SATURATE_ZERO_ONE)
- _mesa_printf("_SAT");
-
- if (inst->DstReg.File != PROGRAM_UNDEFINED) {
- _mesa_printf(" %s[%d]%s",
- program_file_string((enum register_file) inst->DstReg.File),
- inst->DstReg.Index,
- writemask_string(inst->DstReg.WriteMask));
- }
-
- if (numRegs > 0)
- _mesa_printf(", ");
-
- for (j = 0; j < numRegs; j++) {
- print_src_reg(inst->SrcReg + j);
- if (j + 1 < numRegs)
- _mesa_printf(", ");
- }
-
- _mesa_printf(";\n");
- }
+ _mesa_print_alu_instruction(inst,
+ _mesa_opcode_string(inst->Opcode),
+ _mesa_num_inst_src_regs(inst->Opcode));
+ break;
}
}
@@ -1961,30 +2056,6 @@ _mesa_GenPrograms(GLsizei n, GLuint *ids)
}
-/**
- * Determine if id names a vertex or fragment program.
- * \note Not compiled into display lists.
- * \note Called from both glIsProgramNV and glIsProgramARB.
- * \param id is the program identifier
- * \return GL_TRUE if id is a program, else GL_FALSE.
- */
-GLboolean GLAPIENTRY
-_mesa_IsProgram(GLuint id)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-
- if (id == 0)
- return GL_FALSE;
-
- if (_mesa_lookup_program(ctx, id))
- return GL_TRUE;
- else
- return GL_FALSE;
-}
-
-
-
/**********************************************************************/
/* GL_MESA_program_debug extension */
/**********************************************************************/
@@ -2091,7 +2162,9 @@ _mesa_GetProgramRegisterfvMESA(GLenum target,
"glGetProgramRegisterfvMESA(registerName)");
return;
}
- COPY_4V(v, ctx->VertexProgram.Temporaries[i]);
+#if 0 /* FIX ME */
+ ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_TEMPORARY, i, v);
+#endif
}
else if (reg[0] == 'v' && reg[1] == '[') {
/* Vertex Input attribute */
@@ -2102,7 +2175,10 @@ _mesa_GetProgramRegisterfvMESA(GLenum target,
_mesa_sprintf(number, "%d", i);
if (_mesa_strncmp(reg + 2, name, 4) == 0 ||
_mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) {
- COPY_4V(v, ctx->VertexProgram.Inputs[i]);
+#if 0 /* FIX ME */
+ ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_INPUT,
+ i, v);
+#endif
return;
}
}
@@ -2155,7 +2231,8 @@ _mesa_GetProgramRegisterfvMESA(GLenum target,
"glGetProgramRegisterfvMESA(registerName)");
return;
}
- COPY_4V(v, ctx->FragmentProgram.Machine.Temporaries[i]);
+ ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_TEMPORARY,
+ i, v);
}
else if (reg[0] == 'f' && reg[1] == '[') {
/* Fragment input attribute */
@@ -2163,7 +2240,8 @@ _mesa_GetProgramRegisterfvMESA(GLenum target,
for (i = 0; i < ctx->Const.FragmentProgram.MaxAttribs; i++) {
const char *name = _mesa_nv_fragment_input_register_name(i);
if (_mesa_strncmp(reg + 2, name, 4) == 0) {
- COPY_4V(v, ctx->FragmentProgram.Machine.Inputs[i]);
+ ctx->Driver.GetFragmentProgramRegister(ctx,
+ PROGRAM_INPUT, i, v);
return;
}
}
@@ -2173,15 +2251,18 @@ _mesa_GetProgramRegisterfvMESA(GLenum target,
}
else if (_mesa_strcmp(reg, "o[COLR]") == 0) {
/* Fragment output color */
- COPY_4V(v, ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_COLR]);
+ ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
+ FRAG_RESULT_COLR, v);
}
else if (_mesa_strcmp(reg, "o[COLH]") == 0) {
/* Fragment output color */
- COPY_4V(v, ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_COLH]);
+ ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
+ FRAG_RESULT_COLH, v);
}
else if (_mesa_strcmp(reg, "o[DEPR]") == 0) {
/* Fragment output depth */
- COPY_4V(v, ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_DEPR]);
+ ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
+ FRAG_RESULT_DEPR, v);
}
else {
/* try user-defined identifiers */
@@ -2202,5 +2283,4 @@ _mesa_GetProgramRegisterfvMESA(GLenum target,
"glGetProgramRegisterfvMESA(target)");
return;
}
-
}
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h
index 6a345339aff..af06c03598f 100644
--- a/src/mesa/shader/program.h
+++ b/src/mesa/shader/program.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -188,7 +188,9 @@ enum state_index {
STATE_INTERNAL, /* Mesa additions */
STATE_NORMAL_SCALE,
- STATE_POSITION_NORMALIZED /* normalized light position */
+ STATE_TEXRECT_SCALE,
+ STATE_POSITION_NORMALIZED, /* normalized light position */
+ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
};
@@ -237,33 +239,42 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
extern GLint
_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
- const char *name, const GLfloat values[4]);
+ const char *name, const GLfloat values[4],
+ GLuint size);
extern GLint
_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
- const GLfloat values[4]);
+ const GLfloat values[4], GLuint size);
extern GLint
_mesa_add_state_reference(struct gl_program_parameter_list *paramList,
const GLint *stateTokens);
extern GLfloat *
-_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name);
extern GLint
-_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name);
+extern GLboolean
+_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList,
+ const GLfloat v[], GLsizei vSize,
+ GLuint *posOut, GLuint *swizzleOut);
+
extern void
_mesa_load_state_parameters(GLcontext *ctx,
struct gl_program_parameter_list *paramList);
-
-
extern void
_mesa_print_instruction(const struct prog_instruction *inst);
+void
+_mesa_print_alu_instruction(const struct prog_instruction *inst,
+ const char *opcode_string,
+ GLuint numRegs);
+
extern void
_mesa_print_program(const struct gl_program *prog);
@@ -284,9 +295,6 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids);
extern void GLAPIENTRY
_mesa_GenPrograms(GLsizei n, GLuint *ids);
-extern GLboolean GLAPIENTRY
-_mesa_IsProgram(GLuint id);
-
/*
diff --git a/src/mesa/shader/program_instruction.h b/src/mesa/shader/program_instruction.h
index 93bcfc240a9..ad3a6d4dd4e 100644
--- a/src/mesa/shader/program_instruction.h
+++ b/src/mesa/shader/program_instruction.h
@@ -286,7 +286,7 @@ struct prog_instruction
GLuint CondUpdate:1;
/**
- * If prog_instruction::cc_update is \c GL_TRUE, this value selects the
+ * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the
* condition code register that is to be updated.
*
* In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition
@@ -339,11 +339,16 @@ struct prog_instruction
*/
GLuint TexSrcTarget:3;
/*@}*/
+
+ /**
+ * For BRA and CAL instructions, the location to jump to.
+ */
+ GLuint BranchTarget;
};
extern void
-_mesa_init_instruction(struct prog_instruction *inst);
+_mesa_init_instructions(struct prog_instruction *inst, GLuint count);
extern GLuint
_mesa_num_inst_src_regs(enum prog_opcode opcode);
diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c
index 199202edf77..783177739d1 100644
--- a/src/mesa/shader/programopt.c
+++ b/src/mesa/shader/programopt.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -85,8 +85,8 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog)
* newInst[2] = DP4 result.position.z, mvp.row[2], vertex.position;
* newInst[3] = DP4 result.position.w, mvp.row[3], vertex.position;
*/
+ _mesa_init_instructions(newInst, 4);
for (i = 0; i < 4; i++) {
- _mesa_init_instruction(newInst + i);
newInst[i].Opcode = OPCODE_DP4;
newInst[i].DstReg.File = PROGRAM_OUTPUT;
newInst[i].DstReg.Index = VERT_RESULT_HPOS;
@@ -117,31 +117,189 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog)
/**
* Append extra instructions onto the given fragment program to implement
- * the fog mode specified by program->FogOption.
- * XXX incomplete.
+ * the fog mode specified by fprog->FogOption.
+ * The fragment.fogcoord input is used to compute the fog blend factor.
+ *
+ * XXX with a little work, this function could be adapted to add fog code
+ * to vertex programs too.
*/
void
_mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
{
- struct prog_instruction newInst[10];
-
- switch (fprog->FogOption) {
- case GL_LINEAR:
- /* lerp */
- break;
- case GL_EXP:
- break;
- case GL_EXP2:
- break;
- case GL_NONE:
- /* no-op */
+ static const GLint fogParamsState[] = { STATE_FOG_PARAMS, 0, 0, 0, 0 };
+ static const GLint fogColorState[] = { STATE_FOG_COLOR, 0, 0, 0, 0 };
+ struct prog_instruction *newInst, *inst;
+ const GLuint origLen = fprog->Base.NumInstructions;
+ const GLuint newLen = origLen + 6;
+ GLuint i;
+ GLint fogParamsRef, fogColorRef; /* state references */
+ GLuint colorTemp, fogFactorTemp; /* temporary registerss */
+ GLfloat fogVals[4];
+ GLuint fogConsts; /* constant values for EXP, EXP2 mode */
+
+ if (fprog->FogOption == GL_NONE) {
+ _mesa_problem(ctx, "_mesa_append_fog_code() called for fragment program"
+ " with FogOption == GL_NONE");
return;
- default:
- _mesa_problem(ctx, "Invalid fog option");
+ }
+
+ /* Alloc storage for new instructions */
+ newInst = _mesa_alloc_instructions(newLen);
+ if (!newInst) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "glProgramString(inserting fog_option code)");
return;
}
+ /* Copy orig instructions into new instruction buffer */
+ _mesa_memcpy(newInst, fprog->Base.Instructions,
+ origLen * sizeof(struct prog_instruction));
+
+ /* PARAM fogParamsRef = state.fog.params; */
+ fogParamsRef
+ = _mesa_add_state_reference(fprog->Base.Parameters, fogParamsState);
+ /* PARAM fogColorRef = state.fog.color; */
+ fogColorRef
+ = _mesa_add_state_reference(fprog->Base.Parameters, fogColorState);
- (void) newInst;
+ /* TEMP colorTemp; */
+ colorTemp = fprog->Base.NumTemporaries++;
+ /* TEMP fogFactorTemp; */
+ fogFactorTemp = fprog->Base.NumTemporaries++;
+ /* PARAM fogVals = { 1/ln(2), 1/sqrt(ln(2), 0, 0 }; */
+ fogVals[0] = 1.0 / log(2.0);
+ fogVals[1] = 1.0 / SQRTF(log(2.0));
+ fogVals[2] = 0.0;
+ fogVals[3] = 0.0;
+ fogConsts = _mesa_add_unnamed_constant(fprog->Base.Parameters, fogVals, 4);
+
+ /* Scan program to find where result.color is written */
+ inst = newInst;
+ for (i = 0; i < fprog->Base.NumInstructions; i++) {
+ if (inst->Opcode == OPCODE_END)
+ break;
+ if (inst->DstReg.File == PROGRAM_OUTPUT &&
+ inst->DstReg.Index == FRAG_RESULT_COLR) {
+ /* change the instruction to write to colorTemp w/ clamping */
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = colorTemp;
+ inst->SaturateMode = SATURATE_ZERO_ONE;
+ /* don't break (may be several writes to result.color) */
+ }
+ inst++;
+ }
+ assert(inst->Opcode == OPCODE_END); /* we'll overwrite this inst */
+
+ _mesa_init_instructions(inst, 6);
+
+ /* emit instructions to compute fog blending factor */
+ if (fprog->FogOption == GL_LINEAR) {
+ /* SUB fogFactorTemp.x, fogParamsRef.z, fragment.fogcoord.x; */
+ inst->Opcode = OPCODE_SUB;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[0].Index = fogParamsRef;
+ inst->SrcReg[0].Swizzle = SWIZZLE_Z;
+ inst->SrcReg[1].File = PROGRAM_INPUT;
+ inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC;
+ inst++;
+ /* MUL fogFactorTemp.x, fogFactorTemp, fogParamsRef.w; */
+ inst->Opcode = OPCODE_MUL;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[1].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[1].Index = fogParamsRef;
+ inst->SrcReg[1].Swizzle = SWIZZLE_W;
+ inst++;
+ }
+ else {
+ ASSERT(fprog->FogOption == GL_EXP || fprog->FogOption == GL_EXP2);
+ /* MUL fogFactorTemp.x, fogParamsRef.x, fragment.fogcoord; */
+ inst->Opcode = OPCODE_MUL;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[0].Index = fogParamsRef;
+ inst->SrcReg[0].Swizzle = SWIZZLE_X; /* X=density */
+ inst->SrcReg[1].File = PROGRAM_INPUT;
+ inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC;
+ inst->SrcReg[1].Swizzle = SWIZZLE_X;
+ inst++;
+ if (fprog->FogOption == GL_EXP2) {
+ /* MUL fogFactorTemp.x, fogFactorTemp.x, fogFactorTemp.x; */
+ inst->Opcode = OPCODE_MUL;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[1].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[1].Index = fogFactorTemp;
+ inst++;
+ }
+ /* EXP: MUL fogFactorTemp.x, fogFactorTemp.x, {1/ln(2)}; */
+ /* EXP2: MUL fogFactorTemp.x, fogFactorTemp.x, {1/sqrt(ln(2))}; */
+ inst->Opcode = OPCODE_MUL;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[1].File = PROGRAM_CONSTANT;
+ inst->SrcReg[1].Index = fogConsts;
+ inst->SrcReg[1].Swizzle
+ = (fprog->FogOption == GL_EXP) ? SWIZZLE_X : SWIZZLE_Y;
+ inst++;
+ /* EX2_SAT fogFactorTemp.x, -fogFactorTemp.x; */
+ inst->Opcode = OPCODE_EX2;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[0].NegateBase = GL_TRUE;
+ inst->SaturateMode = SATURATE_ZERO_ONE;
+ inst++;
+ }
+ /* LRP result.color.xyz, fogFactorTemp.xxxx, colorTemp, fogColorRef; */
+ inst->Opcode = OPCODE_LRP;
+ inst->DstReg.File = PROGRAM_OUTPUT;
+ inst->DstReg.Index = FRAG_RESULT_COLR;
+ inst->DstReg.WriteMask = WRITEMASK_XYZ;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[0].Swizzle
+ = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X);
+ inst->SrcReg[1].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[1].Index = colorTemp;
+ inst->SrcReg[2].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[2].Index = fogColorRef;
+ inst++;
+ /* MOV result.color.w, colorTemp.x; # copy alpha */
+ inst->Opcode = OPCODE_MOV;
+ inst->DstReg.File = PROGRAM_OUTPUT;
+ inst->DstReg.Index = FRAG_RESULT_COLR;
+ inst->DstReg.WriteMask = WRITEMASK_W;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = colorTemp;
+ inst++;
+ /* END; */
+ inst->Opcode = OPCODE_END;
+ inst++;
+
+ /* free old instructions */
+ _mesa_free(fprog->Base.Instructions);
+
+ /* install new instructions */
+ fprog->Base.Instructions = newInst;
+ fprog->Base.NumInstructions = inst - newInst;
+ fprog->Base.InputsRead |= FRAG_BIT_FOGC;
+ /* XXX do this? fprog->FogOption = GL_NONE; */
}
diff --git a/src/mesa/shader/programopt.h b/src/mesa/shader/programopt.h
index 8799da435b3..efaf29b9374 100644
--- a/src/mesa/shader/programopt.h
+++ b/src/mesa/shader/programopt.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c
index f26ff12adf1..da4d5c84721 100644
--- a/src/mesa/shader/shaderobjects.c
+++ b/src/mesa/shader/shaderobjects.c
@@ -50,28 +50,34 @@
#define RELEASE_SHADER(x)\
(**x)._generic._unknown.Release ((struct gl2_unknown_intf **) (x))
+
+
static struct gl2_unknown_intf **
-lookup_handle (GLcontext *ctx, GLhandleARB handle, enum gl2_uiid uiid, const char *function)
+lookup_handle(GLcontext * ctx, GLhandleARB handle, enum gl2_uiid uiid,
+ const char *function)
{
struct gl2_unknown_intf **unk;
/*
- * Note: _mesa_HashLookup() requires non-zero input values, so the passed-in handle value
- * must be checked beforehand.
+ * Note: _mesa_HashLookup() requires non-zero input values, so the
+ * passed-in handle value must be checked beforehand.
*/
if (handle == 0) {
- _mesa_error (ctx, GL_INVALID_VALUE, function);
+ _mesa_error(ctx, GL_INVALID_VALUE, function);
return NULL;
}
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) (_mesa_HashLookup (ctx->Shared->GL2Objects, handle));
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
- if (unk == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, function);
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ unk = (struct gl2_unknown_intf **) _mesa_HashLookup(ctx->Shared->GL2Objects,
+ handle);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+
+ if (unk == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, function);
+ }
else {
- unk = (**unk).QueryInterface (unk, uiid);
+ unk = (**unk).QueryInterface(unk, uiid);
if (unk == NULL)
- _mesa_error (ctx, GL_INVALID_OPERATION, function);
+ _mesa_error(ctx, GL_INVALID_OPERATION, function);
}
return unk;
}
@@ -92,895 +98,635 @@ lookup_handle (GLcontext *ctx, GLhandleARB handle, enum gl2_uiid uiid, const cha
struct gl2_shader_intf **x = (struct gl2_shader_intf **)\
lookup_handle (ctx, handle, UIID_SHADER, function);
-#define GET_LINKED_PROGRAM(x, handle, function)\
- GET_PROGRAM(x, handle, function);\
- if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\
- RELEASE_PROGRAM(x);\
- x = NULL;\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
+
+#define GET_LINKED_PROGRAM(x, handle, function) \
+ GET_PROGRAM(x, handle, function); \
+ if (x && (**x).GetLinkStatus(x) == GL_FALSE) { \
+ RELEASE_PROGRAM(x); \
+ _mesa_error(ctx, GL_INVALID_OPERATION, function); \
+ x = NULL; \
}
-#define GET_CURRENT_LINKED_PROGRAM(x, function)\
- struct gl2_program_intf **x = NULL;\
- if (ctx->ShaderObjects.CurrentProgram == NULL)\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
- else {\
- x = ctx->ShaderObjects.CurrentProgram;\
- if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\
- x = NULL;\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
- }\
+#define GET_CURRENT_LINKED_PROGRAM(x, function) \
+ struct gl2_program_intf **x = ctx->ShaderObjects.CurrentProgram; \
+ if (!x || (**x).GetLinkStatus(x) == GL_FALSE) { \
+ _mesa_error(ctx, GL_INVALID_OPERATION, function); \
+ return; \
}
+
+
#define IS_NAME_WITH_GL_PREFIX(x) ((x)[0] == 'g' && (x)[1] == 'l' && (x)[2] == '_')
GLvoid GLAPIENTRY
-_mesa_DeleteObjectARB (GLhandleARB obj)
+_mesa_DeleteObjectARB(GLhandleARB obj)
{
- if (obj != 0)
- {
+ if (obj != 0) {
GET_CURRENT_CONTEXT(ctx);
GET_GENERIC(gen, obj, "glDeleteObjectARB");
- if (gen != NULL)
- {
- (**gen).Delete (gen);
+ if (gen != NULL) {
+ (**gen).Delete(gen);
RELEASE_GENERIC(gen);
}
}
}
GLhandleARB GLAPIENTRY
-_mesa_GetHandleARB (GLenum pname)
+_mesa_GetHandleARB(GLenum pname)
{
- GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_CONTEXT(ctx);
- switch (pname)
- {
+ switch (pname) {
case GL_PROGRAM_OBJECT_ARB:
{
struct gl2_program_intf **pro = ctx->ShaderObjects.CurrentProgram;
if (pro != NULL)
- return (**pro)._container._generic.GetName ((struct gl2_generic_intf **) (pro));
+ return (**pro)._container._generic.
+ GetName((struct gl2_generic_intf **) (pro));
}
break;
- default:
- _mesa_error (ctx, GL_INVALID_ENUM, "glGetHandleARB");
- }
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB");
+ }
- return 0;
+ return 0;
}
GLvoid GLAPIENTRY
-_mesa_DetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj)
+_mesa_DetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CONTAINER(con, containerObj, "glDetachObjectARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CONTAINER(con, containerObj, "glDetachObjectARB");
- if (con != NULL)
- {
- GET_GENERIC(att, attachedObj, "glDetachObjectARB");
+ if (con != NULL) {
+ GET_GENERIC(att, attachedObj, "glDetachObjectARB");
- if (att != NULL)
- {
- (**con).Detach (con, att);
- RELEASE_GENERIC(att);
- }
- RELEASE_CONTAINER(con);
- }
+ if (att != NULL) {
+ (**con).Detach(con, att);
+ RELEASE_GENERIC(att);
+ }
+ RELEASE_CONTAINER(con);
+ }
}
GLhandleARB GLAPIENTRY
-_mesa_CreateShaderObjectARB (GLenum shaderType)
+_mesa_CreateShaderObjectARB(GLenum shaderType)
+{
+ return _mesa_3dlabs_create_shader_object(shaderType);
+}
+
+GLvoid GLAPIENTRY
+_mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count,
+ const GLcharARB ** string, const GLint * length)
{
- return _mesa_3dlabs_create_shader_object (shaderType);
+ GET_CURRENT_CONTEXT(ctx);
+ GLint *offsets;
+ GLsizei i;
+ GLcharARB *source;
+ GET_SHADER(sha, shaderObj, "glShaderSourceARB");
+
+ if (sha == NULL)
+ return;
+
+ if (string == NULL) {
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB");
+ return;
+ }
+
+ /*
+ * This array holds offsets of where the appropriate string ends, thus the last
+ * element will be set to the total length of the source code.
+ */
+ offsets = (GLint *) _mesa_malloc(count * sizeof(GLint));
+ if (offsets == NULL) {
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ if (string[i] == NULL) {
+ _mesa_free((GLvoid *) offsets);
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB");
+ return;
+ }
+ if (length == NULL || length[i] < 0)
+ offsets[i] = _mesa_strlen(string[i]);
+ else
+ offsets[i] = length[i];
+ /* accumulate string lengths */
+ if (i > 0)
+ offsets[i] += offsets[i - 1];
+ }
+
+ source =
+ (GLcharARB *) _mesa_malloc((offsets[count - 1] + 1) *
+ sizeof(GLcharARB));
+ if (source == NULL) {
+ _mesa_free((GLvoid *) offsets);
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ GLint start = (i > 0) ? offsets[i - 1] : 0;
+ _mesa_memcpy(source + start, string[i],
+ (offsets[i] - start) * sizeof(GLcharARB));
+ }
+ source[offsets[count - 1]] = '\0';
+
+ (**sha).SetSource(sha, source, offsets, count);
+ RELEASE_SHADER(sha);
}
GLvoid GLAPIENTRY
-_mesa_ShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string,
- const GLint *length)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint *offsets;
- GLsizei i;
- GLcharARB *source;
- GET_SHADER(sha, shaderObj, "glShaderSourceARB");
-
- if (sha == NULL)
- return;
-
- if (string == NULL)
- {
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");
- return;
- }
-
- /*
- * This array holds offsets of where the appropriate string ends, thus the last
- * element will be set to the total length of the source code.
- */
- offsets = (GLint *) _mesa_malloc (count * sizeof (GLint));
- if (offsets == NULL)
- {
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
- return;
- }
-
- for (i = 0; i < count; i++)
- {
- if (string[i] == NULL)
- {
- _mesa_free ((GLvoid *) offsets);
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");
- return;
- }
- if (length == NULL || length[i] < 0)
- offsets[i] = _mesa_strlen (string[i]);
- else
- offsets[i] = length[i];
- /* accumulate string lengths */
- if (i > 0)
- offsets[i] += offsets[i - 1];
- }
-
- source = (GLcharARB *) _mesa_malloc ((offsets[count - 1] + 1) * sizeof (GLcharARB));
- if (source == NULL)
- {
- _mesa_free ((GLvoid *) offsets);
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
- return;
- }
-
- for (i = 0; i < count; i++)
- {
- GLint start = (i > 0) ? offsets[i - 1] : 0;
- _mesa_memcpy (source + start, string[i], (offsets[i] - start) * sizeof (GLcharARB));
- }
- source[offsets[count - 1]] = '\0';
-
- (**sha).SetSource (sha, source, offsets, count);
- RELEASE_SHADER(sha);
-}
-
-GLvoid GLAPIENTRY
-_mesa_CompileShaderARB (GLhandleARB shaderObj)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_SHADER(sha, shaderObj, "glCompileShaderARB");
-
- if (sha != NULL)
- {
- (**sha).Compile (sha);
- RELEASE_SHADER(sha);
- }
+_mesa_CompileShaderARB(GLhandleARB shaderObj)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sha, shaderObj, "glCompileShaderARB");
+
+ if (sha != NULL) {
+ (**sha).Compile(sha);
+ RELEASE_SHADER(sha);
+ }
}
GLhandleARB GLAPIENTRY
-_mesa_CreateProgramObjectARB (GLvoid)
+_mesa_CreateProgramObjectARB(GLvoid)
{
- return _mesa_3dlabs_create_program_object ();
+ return _mesa_3dlabs_create_program_object();
}
GLvoid GLAPIENTRY
-_mesa_AttachObjectARB (GLhandleARB containerObj, GLhandleARB obj)
+_mesa_AttachObjectARB(GLhandleARB containerObj, GLhandleARB obj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CONTAINER(con, containerObj, "glAttachObjectARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CONTAINER(con, containerObj, "glAttachObjectARB");
- if (con != NULL)
- {
- GET_GENERIC(att, obj, "glAttachObjectARB");
+ if (con != NULL) {
+ GET_GENERIC(att, obj, "glAttachObjectARB");
- if (att != NULL)
- {
- (**con).Attach (con, att);
- RELEASE_GENERIC(att);
- }
- RELEASE_CONTAINER(con);
- }
+ if (att != NULL) {
+ (**con).Attach(con, att);
+ RELEASE_GENERIC(att);
+ }
+ RELEASE_CONTAINER(con);
+ }
}
GLvoid GLAPIENTRY
-_mesa_LinkProgramARB (GLhandleARB programObj)
+_mesa_LinkProgramARB(GLhandleARB programObj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glLinkProgramARB");
-
- if (pro != NULL)
- {
- (**pro).Link (pro);
- if (pro == ctx->ShaderObjects.CurrentProgram)
- {
- if ((**pro).GetLinkStatus (pro))
- _mesa_UseProgramObjectARB (programObj);
- else
- _mesa_UseProgramObjectARB (0);
- }
- RELEASE_PROGRAM(pro);
- }
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glLinkProgramARB");
+
+ if (pro != NULL) {
+ (**pro).Link(pro);
+ if (pro == ctx->ShaderObjects.CurrentProgram) {
+ if ((**pro).GetLinkStatus(pro))
+ _mesa_UseProgramObjectARB(programObj);
+ else
+ _mesa_UseProgramObjectARB(0);
+ }
+ RELEASE_PROGRAM(pro);
+ }
}
GLvoid GLAPIENTRY
-_mesa_UseProgramObjectARB (GLhandleARB programObj)
+_mesa_UseProgramObjectARB(GLhandleARB programObj)
{
- GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_CONTEXT(ctx);
struct gl2_program_intf **program = NULL;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (programObj != 0)
- {
- GET_PROGRAM(pro, programObj, "glUseProgramObjectARB");
+ if (programObj != 0) {
+ GET_PROGRAM(pro, programObj, "glUseProgramObjectARB(program)");
- if (pro == NULL)
- return;
+ if (pro == NULL)
+ return;
- if ((**pro).GetLinkStatus (pro) == GL_FALSE)
- {
- RELEASE_PROGRAM(pro);
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB");
- return;
- }
+ if ((**pro).GetLinkStatus(pro) == GL_FALSE) {
+ RELEASE_PROGRAM(pro);
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB(not linked)");
+ return;
+ }
- program = pro;
+ program = pro;
- ctx->ShaderObjects._VertexShaderPresent = (**pro).IsShaderPresent (pro, GL_VERTEX_SHADER_ARB);
- ctx->ShaderObjects._FragmentShaderPresent = (**pro).IsShaderPresent (pro,
- GL_FRAGMENT_SHADER_ARB);
- }
- else
- {
- ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
- ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
- }
+ ctx->ShaderObjects._VertexShaderPresent =
+ (**pro).IsShaderPresent(pro, GL_VERTEX_SHADER_ARB);
+ ctx->ShaderObjects._FragmentShaderPresent =
+ (**pro).IsShaderPresent(pro, GL_FRAGMENT_SHADER_ARB);
+ }
+ else {
+ ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
+ ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
+ }
- if (ctx->ShaderObjects.CurrentProgram != NULL)
- RELEASE_PROGRAM(ctx->ShaderObjects.CurrentProgram);
- ctx->ShaderObjects.CurrentProgram = program;
+ if (ctx->ShaderObjects.CurrentProgram != NULL)
+ RELEASE_PROGRAM(ctx->ShaderObjects.CurrentProgram);
+ ctx->ShaderObjects.CurrentProgram = program;
}
GLvoid GLAPIENTRY
-_mesa_ValidateProgramARB (GLhandleARB programObj)
+_mesa_ValidateProgramARB(GLhandleARB programObj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glValidateProgramARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glValidateProgramARB");
- if (pro != NULL)
- {
- (**pro).Validate (pro);
- RELEASE_PROGRAM(pro);
- }
+ if (pro != NULL) {
+ (**pro).Validate(pro);
+ RELEASE_PROGRAM(pro);
+ }
}
-GLvoid GLAPIENTRY
-_mesa_Uniform1fARB (GLint location, GLfloat v0)
+
+/**
+ * Helper function for all the _mesa_Uniform*() functions below.
+ */
+static INLINE void
+uniform(GLint location, GLsizei count, const GLvoid *values, GLenum type,
+ const char *caller)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, caller);
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, 1, &v0, GL_FLOAT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fARB");
- }
+ if (!(**pro).WriteUniform(pro, location, count, values, type))
+ _mesa_error(ctx, GL_INVALID_OPERATION, caller);
}
+
GLvoid GLAPIENTRY
-_mesa_Uniform2fARB (GLint location, GLfloat v0, GLfloat v1)
+_mesa_Uniform1fARB(GLint location, GLfloat v0)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLfloat v[2];
- v[0] = v0;
- v[1] = v1;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fARB");
- }
+ uniform(location, 1, &v0, GL_FLOAT, "glUniform1fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+_mesa_Uniform2fARB(GLint location, GLfloat v0, GLfloat v1)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLfloat v[3];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fARB");
- }
+ GLfloat v[2];
+ v[0] = v0;
+ v[1] = v1;
+ uniform(location, 1, v, GL_FLOAT_VEC2, "glUniform2fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+_mesa_Uniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLfloat v[4];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- v[3] = v3;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fARB");
- }
+ GLfloat v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ uniform(location, 1, v, GL_FLOAT_VEC3, "glUniform3fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform1iARB (GLint location, GLint v0)
+_mesa_Uniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
+ GLfloat v3)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, 1, &v0, GL_INT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1iARB");
- }
+ GLfloat v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ uniform(location, 1, v, GL_FLOAT_VEC4, "glUniform4fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform2iARB (GLint location, GLint v0, GLint v1)
+_mesa_Uniform1iARB(GLint location, GLint v0)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLint v[2];
- v[0] = v0;
- v[1] = v1;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2iARB");
- }
+ uniform(location, 1, &v0, GL_INT, "glUniform1iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3iARB (GLint location, GLint v0, GLint v1, GLint v2)
+_mesa_Uniform2iARB(GLint location, GLint v0, GLint v1)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLint v[3];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3iARB");
- }
+ GLint v[2];
+ v[0] = v0;
+ v[1] = v1;
+ uniform(location, 1, v, GL_INT_VEC2, "glUniform2iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+_mesa_Uniform3iARB(GLint location, GLint v0, GLint v1, GLint v2)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLint v[4];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- v[3] = v3;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4iARB");
- }
+ GLint v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ uniform(location, 1, v, GL_INT_VEC3, "glUniform3iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform1fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform1fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fvARB");
- }
+ GLint v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ uniform(location, 1, v, GL_INT_VEC4, "glUniform4iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform2fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform1fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform2fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fvARB");
- }
+ uniform(location, count, value, GL_FLOAT, "glUniform1fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform2fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform3fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fvARB");
- }
+ uniform(location, count, value, GL_FLOAT_VEC2, "glUniform2fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform4fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform3fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform4fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fvARB");
- }
+ uniform(location, count, value, GL_FLOAT_VEC3, "glUniform3fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform1ivARB (GLint location, GLsizei count, const GLint *value)
+_mesa_Uniform4fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1ivARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform1ivARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1ivARB");
- }
+ uniform(location, count, value, GL_FLOAT_VEC4, "glUniform4fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform2ivARB (GLint location, GLsizei count, const GLint *value)
+_mesa_Uniform1ivARB(GLint location, GLsizei count, const GLint * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2ivARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform2ivARB");
- return;
- }
+ uniform(location, count, value, GL_INT, "glUniform1ivARB");
+}
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+GLvoid GLAPIENTRY
+_mesa_Uniform2ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ uniform(location, count, value, GL_INT_VEC2, "glUniform2ivARB");
+}
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2ivARB");
- }
+GLvoid GLAPIENTRY
+_mesa_Uniform3ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ uniform(location, count, value, GL_INT_VEC3, "glUniform3ivARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3ivARB (GLint location, GLsizei count, const GLint *value)
+_mesa_Uniform4ivARB(GLint location, GLsizei count, const GLint * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3ivARB");
+ uniform(location, count, value, GL_INT_VEC4, "glUniform4ivARB");
+}
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform3ivARB");
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+/**
+ * Helper function used by UniformMatrix**vARB() functions below.
+ */
+static void
+uniform_matrix(GLint cols, GLint rows, const char *caller,
+ GLenum matrixType,
+ GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *values)
+{
+ const GLint matElements = rows * cols;
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, caller);
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3ivARB");
- }
-}
+ if (values == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, caller);
+ return;
+ }
-GLvoid GLAPIENTRY
-_mesa_Uniform4ivARB (GLint location, GLsizei count, const GLint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4ivARB");
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform4ivARB");
- return;
- }
+ if (transpose) {
+ GLfloat *trans, *pt;
+ const GLfloat *pv;
+ GLint i, j, k;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ trans = (GLfloat *) _mesa_malloc(count * matElements * sizeof(GLfloat));
+ if (!trans) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, caller);
+ return;
+ }
+
+ pt = trans;
+ pv = values;
+ for (i = 0; i < count; i++) {
+ /* transpose from pv matrix into pt matrix */
+ for (j = 0; j < cols; j++) {
+ for (k = 0; k < rows; k++) {
+ /* XXX verify this */
+ pt[j * rows + k] = pv[k * cols + j];
+ }
+ }
+ pt += matElements;
+ pv += matElements;
+ }
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4ivARB");
- }
+ if (!(**pro).WriteUniform(pro, location, count, trans, matrixType))
+ _mesa_error(ctx, GL_INVALID_OPERATION, caller);
+ _mesa_free(trans);
+ }
+ else {
+ if (!(**pro).WriteUniform(pro, location, count, values, matrixType))
+ _mesa_error(ctx, GL_INVALID_OPERATION, caller);
+ }
}
+
GLvoid GLAPIENTRY
-_mesa_UniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix2fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix2fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (transpose)
- {
- GLfloat *trans, *pt;
- const GLfloat *pv;
-
- trans = (GLfloat *) _mesa_malloc (count * 4 * sizeof (GLfloat));
- if (trans == NULL)
- {
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix2fvARB");
- return;
- }
- for (pt = trans, pv = value; pt != trans + count * 4; pt += 4, pv += 4)
- {
- pt[0] = pv[0];
- pt[1] = pv[2];
- pt[2] = pv[1];
- pt[3] = pv[3];
- }
- if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB");
- _mesa_free (trans);
- }
- else
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB");
- }
- }
+_mesa_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ uniform_matrix(2, 2, "glUniformMatrix2fvARB", GL_FLOAT_MAT2,
+ location, count, transpose, value);
}
GLvoid GLAPIENTRY
-_mesa_UniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix3fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix3fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (transpose)
- {
- GLfloat *trans, *pt;
- const GLfloat *pv;
-
- trans = (GLfloat *) _mesa_malloc (count * 9 * sizeof (GLfloat));
- if (trans == NULL)
- {
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix3fvARB");
- return;
- }
- for (pt = trans, pv = value; pt != trans + count * 9; pt += 9, pv += 9)
- {
- pt[0] = pv[0];
- pt[1] = pv[3];
- pt[2] = pv[6];
- pt[3] = pv[1];
- pt[4] = pv[4];
- pt[5] = pv[7];
- pt[6] = pv[2];
- pt[7] = pv[5];
- pt[8] = pv[8];
- }
- if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB");
- _mesa_free (trans);
- }
- else
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB");
- }
- }
+_mesa_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ uniform_matrix(3, 3, "glUniformMatrix3fvARB", GL_FLOAT_MAT3,
+ location, count, transpose, value);
}
GLvoid GLAPIENTRY
-_mesa_UniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix4fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix4fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (transpose)
- {
- GLfloat *trans, *pt;
- const GLfloat *pv;
-
- trans = (GLfloat *) _mesa_malloc (count * 16 * sizeof (GLfloat));
- if (trans == NULL)
- {
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix4fvARB");
- return;
- }
- for (pt = trans, pv = value; pt != trans + count * 16; pt += 16, pv += 16)
- {
- _math_transposef (pt, pv);
- }
- if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB");
- _mesa_free (trans);
- }
- else
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB");
- }
- }
+_mesa_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ uniform_matrix(4, 4, "glUniformMatrix4fvARB", GL_FLOAT_MAT4,
+ location, count, transpose, value);
}
static GLboolean
-_mesa_get_object_parameter (GLhandleARB obj, GLenum pname, GLvoid *params, GLboolean *integral,
- GLint *size)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint *ipar = (GLint *) params;
-
- /* set default values */
- *integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */
- *size = 1; /* param array size */
-
- switch (pname)
- {
- case GL_OBJECT_TYPE_ARB:
- case GL_OBJECT_DELETE_STATUS_ARB:
- case GL_OBJECT_INFO_LOG_LENGTH_ARB:
- {
- GET_GENERIC(gen, obj, "glGetObjectParameterivARB");
-
- if (gen == NULL)
- return GL_FALSE;
-
- switch (pname)
- {
- case GL_OBJECT_TYPE_ARB:
- *ipar = (**gen).GetType (gen);
- break;
- case GL_OBJECT_DELETE_STATUS_ARB:
- *ipar = (**gen).GetDeleteStatus (gen);
- break;
+_mesa_get_object_parameter(GLhandleARB obj, GLenum pname, GLvoid * params,
+ GLboolean * integral, GLint * size)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint *ipar = (GLint *) params;
+
+ /* set default values */
+ *integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */
+ *size = 1; /* param array size */
+
+ switch (pname) {
+ case GL_OBJECT_TYPE_ARB:
+ case GL_OBJECT_DELETE_STATUS_ARB:
+ case GL_OBJECT_INFO_LOG_LENGTH_ARB:
+ {
+ GET_GENERIC(gen, obj, "glGetObjectParameterivARB");
+
+ if (gen == NULL)
+ return GL_FALSE;
+
+ switch (pname) {
+ case GL_OBJECT_TYPE_ARB:
+ *ipar = (**gen).GetType(gen);
+ break;
+ case GL_OBJECT_DELETE_STATUS_ARB:
+ *ipar = (**gen).GetDeleteStatus(gen);
+ break;
case GL_OBJECT_INFO_LOG_LENGTH_ARB:
- *ipar = (**gen).GetInfoLogLength (gen);
+ *ipar = (**gen).GetInfoLogLength(gen);
+ break;
+ }
+
+ RELEASE_GENERIC(gen);
+ }
+ break;
+ case GL_OBJECT_SUBTYPE_ARB:
+ case GL_OBJECT_COMPILE_STATUS_ARB:
+ case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
+ {
+ GET_SHADER(sha, obj, "glGetObjectParameterivARB");
+
+ if (sha == NULL)
+ return GL_FALSE;
+
+ switch (pname) {
+ case GL_OBJECT_SUBTYPE_ARB:
+ *ipar = (**sha).GetSubType(sha);
+ break;
+ case GL_OBJECT_COMPILE_STATUS_ARB:
+ *ipar = (**sha).GetCompileStatus(sha);
+ break;
+ case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
+ {
+ const GLcharARB *src = (**sha).GetSource(sha);
+ if (src == NULL)
+ *ipar = 0;
+ else
+ *ipar = _mesa_strlen(src) + 1;
+ }
+ break;
+ }
+
+ RELEASE_SHADER(sha);
+ }
+ break;
+ case GL_OBJECT_LINK_STATUS_ARB:
+ case GL_OBJECT_VALIDATE_STATUS_ARB:
+ case GL_OBJECT_ATTACHED_OBJECTS_ARB:
+ case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
+ case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
+ {
+ GET_PROGRAM(pro, obj, "glGetObjectParameterivARB");
+
+ if (pro == NULL)
+ return GL_FALSE;
+
+ switch (pname) {
+ case GL_OBJECT_LINK_STATUS_ARB:
+ *ipar = (**pro).GetLinkStatus(pro);
+ break;
+ case GL_OBJECT_VALIDATE_STATUS_ARB:
+ *ipar = (**pro).GetValidateStatus(pro);
break;
- }
-
- RELEASE_GENERIC(gen);
- }
- break;
- case GL_OBJECT_SUBTYPE_ARB:
- case GL_OBJECT_COMPILE_STATUS_ARB:
- case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
- {
- GET_SHADER(sha, obj, "glGetObjectParameterivARB");
-
- if (sha == NULL)
- return GL_FALSE;
-
- switch (pname)
- {
- case GL_OBJECT_SUBTYPE_ARB:
- *ipar = (**sha).GetSubType (sha);
- break;
- case GL_OBJECT_COMPILE_STATUS_ARB:
- *ipar = (**sha).GetCompileStatus (sha);
- break;
- case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
- {
- const GLcharARB *src = (**sha).GetSource (sha);
-
- if (src == NULL)
- *ipar = 0;
- else
- *ipar = _mesa_strlen (src) + 1;
- }
- break;
- }
-
- RELEASE_SHADER(sha);
- }
- break;
- case GL_OBJECT_LINK_STATUS_ARB:
- case GL_OBJECT_VALIDATE_STATUS_ARB:
- case GL_OBJECT_ATTACHED_OBJECTS_ARB:
- case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
- case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
- {
- GET_PROGRAM(pro, obj, "glGetObjectParameterivARB");
-
- if (pro == NULL)
- return GL_FALSE;
-
- switch (pname)
- {
- case GL_OBJECT_LINK_STATUS_ARB:
- *ipar = (**pro).GetLinkStatus (pro);
- break;
- case GL_OBJECT_VALIDATE_STATUS_ARB:
- *ipar = (**pro).GetValidateStatus (pro);
- break;
case GL_OBJECT_ATTACHED_OBJECTS_ARB:
- *ipar = (**pro)._container.GetAttachedCount ((struct gl2_container_intf **) (pro));
+ *ipar =
+ (**pro)._container.
+ GetAttachedCount((struct gl2_container_intf **) (pro));
+ break;
+ case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
+ *ipar = (**pro).GetActiveUniformCount(pro);
+ break;
+ case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
+ *ipar = (**pro).GetActiveUniformMaxLength(pro);
+ break;
+ case GL_OBJECT_ACTIVE_ATTRIBUTES_ARB:
+ *ipar = (**pro).GetActiveAttribCount(pro);
break;
- case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
- *ipar = (**pro).GetActiveUniformCount (pro);
- break;
- case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
- *ipar = (**pro).GetActiveUniformMaxLength (pro);
- break;
- case GL_OBJECT_ACTIVE_ATTRIBUTES_ARB:
- *ipar = (**pro).GetActiveAttribCount (pro);
- break;
- case GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB:
- *ipar = (**pro).GetActiveAttribMaxLength (pro);
- break;
- }
-
- RELEASE_PROGRAM(pro);
- }
- break;
- default:
- _mesa_error (ctx, GL_INVALID_ENUM, "glGetObjectParameterivARB");
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ case GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB:
+ *ipar = (**pro).GetActiveAttribMaxLength(pro);
+ break;
+ }
+
+ RELEASE_PROGRAM(pro);
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetObjectParameterivARB");
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
GLvoid GLAPIENTRY
-_mesa_GetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params)
+_mesa_GetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GLboolean integral;
- GLint size;
+ GET_CURRENT_CONTEXT(ctx);
+ GLboolean integral;
+ GLint size;
- if (params == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetObjectParameterfvARB");
- return;
- }
-
- assert (sizeof (GLfloat) == sizeof (GLint));
+ if (params == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterfvARB");
+ return;
+ }
- if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size))
- if (integral)
- {
- GLint i;
+ assert(sizeof(GLfloat) == sizeof(GLint));
- for (i = 0; i < size; i++)
- params[i] = (GLfloat) ((GLint *) params)[i];
- }
+ if (_mesa_get_object_parameter(obj, pname, (GLvoid *) params,
+ &integral, &size)) {
+ if (integral) {
+ GLint i;
+ for (i = 0; i < size; i++)
+ params[i] = (GLfloat) ((GLint *) params)[i];
+ }
+ }
}
GLvoid GLAPIENTRY
-_mesa_GetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params)
+_mesa_GetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GLboolean integral;
- GLint size;
+ GET_CURRENT_CONTEXT(ctx);
+ GLboolean integral;
+ GLint size;
- if (params == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
- return;
- }
-
- assert (sizeof (GLfloat) == sizeof (GLint));
+ if (params == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
+ return;
+ }
- if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size))
- if (!integral)
- {
- GLint i;
+ assert(sizeof(GLfloat) == sizeof(GLint));
- for (i = 0; i < size; i++)
- params[i] = (GLint) ((GLfloat *) params)[i];
- }
+ if (_mesa_get_object_parameter(obj, pname, (GLvoid *) params,
+ &integral, &size)) {
+ if (!integral) {
+ GLint i;
+ for (i = 0; i < size; i++)
+ params[i] = (GLint) ((GLfloat *) params)[i];
+ }
+ }
}
@@ -993,222 +739,453 @@ _mesa_GetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params)
* \param dst the string destination
*/
static GLvoid
-copy_string(const GLcharARB *src, GLsizei maxLength, GLsizei *length,
- GLcharARB *dst)
+copy_string(const GLcharARB * src, GLsizei maxLength, GLsizei * length,
+ GLcharARB * dst)
{
- GLsizei len;
- for (len = 0; len < maxLength - 1 && src && src[len]; len++)
- dst[len] = src[len];
- if (maxLength > 0)
- dst[len] = 0;
- if (length)
- *length = len;
+ GLsizei len;
+ for (len = 0; len < maxLength - 1 && src && src[len]; len++)
+ dst[len] = src[len];
+ if (maxLength > 0)
+ dst[len] = 0;
+ if (length)
+ *length = len;
}
GLvoid GLAPIENTRY
-_mesa_GetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
+_mesa_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length,
+ GLcharARB * infoLog)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_GENERIC(gen, obj, "glGetInfoLogARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_GENERIC(gen, obj, "glGetInfoLogARB");
- if (gen == NULL)
- return;
+ if (gen == NULL)
+ return;
- if (infoLog == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetInfoLogARB");
+ if (infoLog == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetInfoLogARB");
else {
- GLsizei actualsize = (**gen).GetInfoLogLength (gen);
+ GLsizei actualsize = (**gen).GetInfoLogLength(gen);
if (actualsize > maxLength)
actualsize = maxLength;
- (**gen).GetInfoLog (gen, actualsize, infoLog);
+ (**gen).GetInfoLog(gen, actualsize, infoLog);
if (length != NULL)
*length = (actualsize > 0) ? actualsize - 1 : 0;
}
- RELEASE_GENERIC(gen);
+ RELEASE_GENERIC(gen);
}
GLvoid GLAPIENTRY
-_mesa_GetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count,
- GLhandleARB *obj)
+_mesa_GetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount,
+ GLsizei * count, GLhandleARB * obj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CONTAINER(con, containerObj, "glGetAttachedObjectsARB");
-
- if (con == NULL)
- return;
-
- if (obj == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttachedObjectsARB");
- else
- {
- GLsizei cnt, i;
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CONTAINER(con, containerObj, "glGetAttachedObjectsARB");
- cnt = (**con).GetAttachedCount (con);
- if (cnt > maxCount)
- cnt = maxCount;
- if (count != NULL)
- *count = cnt;
+ if (con == NULL)
+ return;
- for (i = 0; i < cnt; i++)
- {
- struct gl2_generic_intf **x = (**con).GetAttached (con, i);
- obj[i] = (**x).GetName (x);
- RELEASE_GENERIC(x);
- }
- }
- RELEASE_CONTAINER(con);
+ if (obj == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttachedObjectsARB");
+ else {
+ GLsizei cnt, i;
+
+ cnt = (**con).GetAttachedCount(con);
+ if (cnt > maxCount)
+ cnt = maxCount;
+ if (count != NULL)
+ *count = cnt;
+
+ for (i = 0; i < cnt; i++) {
+ struct gl2_generic_intf **x = (**con).GetAttached(con, i);
+ obj[i] = (**x).GetName(x);
+ RELEASE_GENERIC(x);
+ }
+ }
+ RELEASE_CONTAINER(con);
}
GLint GLAPIENTRY
-_mesa_GetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name)
+_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB * name)
{
- GET_CURRENT_CONTEXT(ctx);
- GLint loc = -1;
- GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GLint loc = -1;
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB");
- if (pro == NULL)
- return -1;
+ if (!pro)
+ return -1;
- if (name == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetUniformLocationARB");
- else
- {
- if (!IS_NAME_WITH_GL_PREFIX(name))
- loc = (**pro).GetUniformLocation (pro, name);
- }
- RELEASE_PROGRAM(pro);
- return loc;
+ if (name == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetUniformLocationARB");
+ else {
+ if (!IS_NAME_WITH_GL_PREFIX(name))
+ loc = (**pro).GetUniformLocation(pro, name);
+ }
+ RELEASE_PROGRAM(pro);
+ return loc;
}
GLvoid GLAPIENTRY
-_mesa_GetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length,
- GLint *size, GLenum *type, GLcharARB *name)
+_mesa_GetActiveUniformARB(GLhandleARB programObj, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glGetActiveUniformARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glGetActiveUniformARB");
- if (pro == NULL)
- return;
+ if (pro == NULL)
+ return;
- if (size == NULL || type == NULL || name == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
- else
- {
- if (index < (**pro).GetActiveUniformCount (pro))
- (**pro).GetActiveUniform (pro, index, maxLength, length, size, type, name);
- else
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
- }
- RELEASE_PROGRAM(pro);
+ if (size == NULL || type == NULL || name == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
+ else {
+ if (index < (**pro).GetActiveUniformCount(pro))
+ (**pro).GetActiveUniform(pro, index, maxLength, length, size, type,
+ name);
+ else
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
+ }
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
-_mesa_GetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params)
+_mesa_GetUniformfvARB(GLhandleARB programObj, GLint location, GLfloat * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB");
+
+ if (!pro)
+ return;
- if (pro != NULL)
- {
- /* TODO */
- RELEASE_PROGRAM(pro);
- }
+ if (!(**pro).ReadUniform(pro, location, 1, params, GL_FLOAT))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfvARB");
+
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
-_mesa_GetUniformivARB (GLhandleARB programObj, GLint location, GLint *params)
+_mesa_GetUniformivARB(GLhandleARB programObj, GLint location, GLint * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB");
+
+ if (!pro)
+ return;
- if (pro != NULL)
- {
- /* TODO */
- RELEASE_PROGRAM(pro);
- }
+ if (!(**pro).ReadUniform(pro, location, 1, params, GL_INT))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformivARB");
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
-_mesa_GetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source)
+_mesa_GetShaderSourceARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length,
+ GLcharARB * source)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_SHADER(sha, obj, "glGetShaderSourceARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sha, obj, "glGetShaderSourceARB");
- if (sha == NULL)
- return;
+ if (sha == NULL)
+ return;
- if (source == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetShaderSourceARB");
- else
- copy_string ((**sha).GetSource (sha), maxLength, length, source);
- RELEASE_SHADER(sha);
+ if (source == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderSourceARB");
+ else
+ copy_string((**sha).GetSource(sha), maxLength, length, source);
+ RELEASE_SHADER(sha);
}
/* GL_ARB_vertex_shader */
GLvoid GLAPIENTRY
-_mesa_BindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name)
+_mesa_BindAttribLocationARB(GLhandleARB programObj, GLuint index,
+ const GLcharARB * name)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glBindAttribLocationARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glBindAttribLocationARB");
+
+ if (pro == NULL)
+ return;
+
+ if (name == NULL || index >= MAX_VERTEX_ATTRIBS)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocationARB");
+ else if (IS_NAME_WITH_GL_PREFIX(name))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindAttribLocationARB");
+ else
+ (**pro).OverrideAttribBinding(pro, index, name);
+ RELEASE_PROGRAM(pro);
+}
- if (pro == NULL)
- return;
+GLvoid GLAPIENTRY
+_mesa_GetActiveAttribARB(GLhandleARB programObj, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glGetActiveAttribARB");
+
+ if (pro == NULL)
+ return;
+
+ if (name == NULL || index >= (**pro).GetActiveAttribCount(pro))
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttribARB");
+ else
+ (**pro).GetActiveAttrib(pro, index, maxLength, length, size, type,
+ name);
+ RELEASE_PROGRAM(pro);
+}
- if (name == NULL || index >= MAX_VERTEX_ATTRIBS)
- _mesa_error (ctx, GL_INVALID_VALUE, "glBindAttribLocationARB");
- else if (IS_NAME_WITH_GL_PREFIX(name))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glBindAttribLocationARB");
- else
- (**pro).OverrideAttribBinding (pro, index, name);
- RELEASE_PROGRAM(pro);
+GLint GLAPIENTRY
+_mesa_GetAttribLocationARB(GLhandleARB programObj, const GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint loc = -1;
+ GET_LINKED_PROGRAM(pro, programObj, "glGetAttribLocationARB");
+
+ if (!pro)
+ return -1;
+
+ if (name == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttribLocationARB");
+ else if (!IS_NAME_WITH_GL_PREFIX(name))
+ loc = (**pro).GetAttribLocation(pro, name);
+ RELEASE_PROGRAM(pro);
+ return loc;
}
-GLvoid GLAPIENTRY
-_mesa_GetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length,
- GLint *size, GLenum *type, GLcharARB *name)
+
+/**
+ ** OpenGL 2.0 functions which basically wrap the ARB_shader functions
+ **/
+
+void GLAPIENTRY
+_mesa_AttachShader(GLuint program, GLuint shader)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glGetActiveAttribARB");
+ _mesa_AttachObjectARB(program, shader);
+}
- if (pro == NULL)
- return;
- if (name == NULL || index >= (**pro).GetActiveAttribCount (pro))
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveAttribARB");
- else
- (**pro).GetActiveAttrib (pro, index, maxLength, length, size, type, name);
- RELEASE_PROGRAM(pro);
+GLuint GLAPIENTRY
+_mesa_CreateShader(GLenum type)
+{
+ return (GLuint) _mesa_CreateShaderObjectARB(type);
}
-GLint GLAPIENTRY
-_mesa_GetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name)
+GLuint GLAPIENTRY
+_mesa_CreateProgram(void)
+{
+ return (GLuint) _mesa_CreateProgramObjectARB();
+}
+
+void GLAPIENTRY
+_mesa_DeleteProgram(GLuint program)
+{
+ _mesa_DeleteObjectARB(program);
+}
+
+
+void GLAPIENTRY
+_mesa_DeleteShader(GLuint shader)
{
- GET_CURRENT_CONTEXT(ctx);
- GLint loc = -1;
- GET_LINKED_PROGRAM(pro, programObj, "glGetAttribLocationARB");
+ _mesa_DeleteObjectARB(shader);
+}
- if (pro == NULL)
- return -1;
+void GLAPIENTRY
+_mesa_DetachShader(GLuint program, GLuint shader)
+{
+ _mesa_DetachObjectARB(program, shader);
+}
- if (name == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttribLocationARB");
- else if (!IS_NAME_WITH_GL_PREFIX(name))
- loc = (**pro).GetAttribLocation (pro, name);
- RELEASE_PROGRAM(pro);
- return loc;
+void GLAPIENTRY
+_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
+ GLsizei *count, GLuint *obj)
+{
+ _mesa_GetAttachedObjectsARB(program, maxCount, count, obj);
}
+void GLAPIENTRY
+_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, program, "glGetProgramiv");
+
+ if (!pro)
+ return;
+
+ switch (pname) {
+ case GL_DELETE_STATUS:
+ *params = (**pro)._container._generic.GetDeleteStatus((struct gl2_generic_intf **) pro);
+ break;
+ case GL_LINK_STATUS:
+ *params = (**pro).GetLinkStatus(pro);
+ break;
+ case GL_VALIDATE_STATUS:
+ *params = (**pro).GetValidateStatus(pro);
+ break;
+ case GL_INFO_LOG_LENGTH:
+ *params = (**pro)._container._generic.GetInfoLogLength( (struct gl2_generic_intf **) pro );
+ break;
+ case GL_ATTACHED_SHADERS:
+ *params = (**pro)._container.GetAttachedCount( (struct gl2_container_intf **) pro );
+ break;
+ case GL_ACTIVE_ATTRIBUTES:
+ *params = (**pro).GetActiveAttribCount(pro);
+ break;
+ case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
+ *params = (**pro).GetActiveAttribMaxLength(pro);
+ break;
+ case GL_ACTIVE_UNIFORMS:
+ *params = (**pro).GetActiveUniformCount(pro);
+ break;
+ case GL_ACTIVE_UNIFORM_MAX_LENGTH:
+ *params = (**pro).GetActiveUniformMaxLength(pro);
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
+ return;
+ }
+}
+
+void GLAPIENTRY
+_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ _mesa_GetInfoLogARB(program, bufSize, length, infoLog);
+}
+
+void GLAPIENTRY
+_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sh, shader, "glGetShaderiv");
+
+ if (!sh)
+ return;
+
+ switch (pname) {
+ case GL_SHADER_TYPE:
+ *params = (**sh).GetSubType(sh);
+ break;
+ case GL_DELETE_STATUS:
+ *params = (**sh)._generic.GetDeleteStatus((struct gl2_generic_intf **) sh);
+ break;
+ case GL_COMPILE_STATUS:
+ *params = (**sh).GetCompileStatus(sh);
+ break;
+ case GL_INFO_LOG_LENGTH:
+ *params = (**sh)._generic.GetInfoLogLength((struct gl2_generic_intf **)sh);
+ break;
+ case GL_SHADER_SOURCE_LENGTH:
+ {
+ const GLchar *src = (**sh).GetSource(sh);
+ *params = src ? (_mesa_strlen(src) + 1) : 0;
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetShaderiv(pname)");
+ return;
+ }
+}
+
+void GLAPIENTRY
+_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ _mesa_GetInfoLogARB(shader, bufSize, length, infoLog);
+}
+
+GLboolean GLAPIENTRY
+_mesa_IsProgram(GLuint program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, program, "glIsProgram");
+ if (pro) {
+ RELEASE_PROGRAM(pro);
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+GLboolean GLAPIENTRY
+_mesa_IsShader(GLuint shader)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sh, shader, "glIsProgram");
+ if (sh) {
+ RELEASE_SHADER(sh);
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ ** 2.1 functions
+ **/
+
+void GLAPIENTRY
+_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(2, 3, "glUniformMatrix2x3fv", GL_FLOAT_MAT2x3,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(3, 2, "glUniformMatrix3x2fv", GL_FLOAT_MAT3x2,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(2, 4, "glUniformMatrix2x4fv", GL_FLOAT_MAT2x4,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(4, 2, "glUniformMatrix4x2fv", GL_FLOAT_MAT4x2,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(3, 4, "glUniformMatrix3x4fv", GL_FLOAT_MAT3x4,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(4, 3, "glUniformMatrix4x3fv", GL_FLOAT_MAT4x3,
+ location, count, transpose, value);
+}
+
+
+
+
+
#endif
GLvoid
-_mesa_init_shaderobjects (GLcontext *ctx)
+_mesa_init_shaderobjects(GLcontext * ctx)
{
- ctx->ShaderObjects.CurrentProgram = NULL;
- ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
- ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
+ ctx->ShaderObjects.CurrentProgram = NULL;
+ ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
+ ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
- _mesa_init_shaderobjects_3dlabs (ctx);
+ _mesa_init_shaderobjects_3dlabs(ctx);
}
-
diff --git a/src/mesa/shader/shaderobjects.h b/src/mesa/shader/shaderobjects.h
index cc670216292..09ba807255e 100644
--- a/src/mesa/shader/shaderobjects.h
+++ b/src/mesa/shader/shaderobjects.h
@@ -104,6 +104,8 @@ struct gl2_program_intf
GLint (* GetUniformLocation) (struct gl2_program_intf **, const GLchar *name);
GLboolean (* WriteUniform) (struct gl2_program_intf **, GLint loc, GLsizei count,
const GLvoid *data, GLenum type);
+ GLboolean (* ReadUniform) (struct gl2_program_intf **, GLint loc, GLsizei count,
+ GLvoid *data, GLenum type);
GLvoid (* GetActiveAttrib) (struct gl2_program_intf **, GLuint index, GLsizei maxLength,
GLsizei *length, GLint *size, GLenum *type, GLchar *name);
GLuint (* GetActiveAttribMaxLength) (struct gl2_program_intf **);
@@ -270,6 +272,79 @@ _mesa_GetAttribLocationARB (GLhandleARB, const GLcharARB *);
#endif /* FEATURE_ARB_vertex_shader */
+
+/* 2.0 */
+extern void GLAPIENTRY
+_mesa_AttachShader(GLuint program, GLuint shader);
+
+extern GLuint GLAPIENTRY
+_mesa_CreateShader(GLenum);
+
+extern GLuint GLAPIENTRY
+_mesa_CreateProgram(void);
+
+extern void GLAPIENTRY
+_mesa_DeleteProgram(GLuint program);
+
+extern void GLAPIENTRY
+_mesa_DeleteShader(GLuint shader);
+
+extern void GLAPIENTRY
+_mesa_DetachShader(GLuint program, GLuint shader);
+
+extern void GLAPIENTRY
+_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
+ GLsizei *count, GLuint *obj);
+
+extern void GLAPIENTRY
+_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog);
+
+extern void GLAPIENTRY
+_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsProgram(GLuint program);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsShader(GLuint shader);
+
+
+
+/* 2.1 */
+extern void GLAPIENTRY
+_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+
+
#endif /* FEATURE_ARB_shader_objects */
extern void
diff --git a/src/mesa/shader/shaderobjects_3dlabs.c b/src/mesa/shader/shaderobjects_3dlabs.c
index 0def13d3b81..3ead1a17841 100755..100644
--- a/src/mesa/shader/shaderobjects_3dlabs.c
+++ b/src/mesa/shader/shaderobjects_3dlabs.c
@@ -48,1731 +48,1887 @@
struct gl2_unknown_obj
{
- GLuint reference_count;
- void (* _destructor) (struct gl2_unknown_intf **);
+ GLuint reference_count;
+ void (*_destructor) (struct gl2_unknown_intf **);
};
struct gl2_unknown_impl
{
- struct gl2_unknown_intf *_vftbl;
- struct gl2_unknown_obj _obj;
+ struct gl2_unknown_intf *_vftbl;
+ struct gl2_unknown_obj _obj;
};
static void
-_unknown_destructor (struct gl2_unknown_intf **intf)
+_unknown_destructor(struct gl2_unknown_intf **intf)
{
}
static void
-_unknown_AddRef (struct gl2_unknown_intf **intf)
+_unknown_AddRef(struct gl2_unknown_intf **intf)
{
- struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
+ struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
- impl->_obj.reference_count++;
+ impl->_obj.reference_count++;
}
static void
-_unknown_Release (struct gl2_unknown_intf **intf)
+_unknown_Release(struct gl2_unknown_intf **intf)
{
- struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
+ struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
- impl->_obj.reference_count--;
- if (impl->_obj.reference_count == 0)
- {
- impl->_obj._destructor (intf);
- _mesa_free ((void *) intf);
- }
+ impl->_obj.reference_count--;
+ if (impl->_obj.reference_count == 0) {
+ impl->_obj._destructor(intf);
+ _mesa_free((void *) intf);
+ }
}
static struct gl2_unknown_intf **
-_unknown_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_unknown_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_UNKNOWN)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return NULL;
+ if (uiid == UIID_UNKNOWN) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return NULL;
}
static struct gl2_unknown_intf _unknown_vftbl = {
- _unknown_AddRef,
- _unknown_Release,
- _unknown_QueryInterface
+ _unknown_AddRef,
+ _unknown_Release,
+ _unknown_QueryInterface
};
static void
-_unknown_constructor (struct gl2_unknown_impl *impl)
+_unknown_constructor(struct gl2_unknown_impl *impl)
{
- impl->_vftbl = &_unknown_vftbl;
- impl->_obj.reference_count = 1;
- impl->_obj._destructor = _unknown_destructor;
+ impl->_vftbl = &_unknown_vftbl;
+ impl->_obj.reference_count = 1;
+ impl->_obj._destructor = _unknown_destructor;
}
struct gl2_unkinner_obj
{
- struct gl2_unknown_intf **unkouter;
+ struct gl2_unknown_intf **unkouter;
};
struct gl2_unkinner_impl
{
- struct gl2_unknown_intf *_vftbl;
- struct gl2_unkinner_obj _obj;
+ struct gl2_unknown_intf *_vftbl;
+ struct gl2_unkinner_obj _obj;
};
static void
-_unkinner_destructor (struct gl2_unknown_intf **intf)
+_unkinner_destructor(struct gl2_unknown_intf **intf)
{
}
static void
-_unkinner_AddRef (struct gl2_unknown_intf **intf)
+_unkinner_AddRef(struct gl2_unknown_intf **intf)
{
- struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
+ struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
- (**impl->_obj.unkouter).AddRef (impl->_obj.unkouter);
+ (**impl->_obj.unkouter).AddRef(impl->_obj.unkouter);
}
static void
-_unkinner_Release (struct gl2_unknown_intf **intf)
+_unkinner_Release(struct gl2_unknown_intf **intf)
{
- struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
+ struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
- (**impl->_obj.unkouter).Release (impl->_obj.unkouter);
+ (**impl->_obj.unkouter).Release(impl->_obj.unkouter);
}
static struct gl2_unknown_intf **
-_unkinner_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_unkinner_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
+ struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
- return (**impl->_obj.unkouter).QueryInterface (impl->_obj.unkouter, uiid);
+ return (**impl->_obj.unkouter).QueryInterface(impl->_obj.unkouter, uiid);
}
static struct gl2_unknown_intf _unkinner_vftbl = {
- _unkinner_AddRef,
- _unkinner_Release,
- _unkinner_QueryInterface
+ _unkinner_AddRef,
+ _unkinner_Release,
+ _unkinner_QueryInterface
};
static void
-_unkinner_constructor (struct gl2_unkinner_impl *impl, struct gl2_unknown_intf **outer)
+_unkinner_constructor(struct gl2_unkinner_impl *impl,
+ struct gl2_unknown_intf **outer)
{
- impl->_vftbl = &_unkinner_vftbl;
- impl->_obj.unkouter = outer;
+ impl->_vftbl = &_unkinner_vftbl;
+ impl->_obj.unkouter = outer;
}
struct gl2_generic_obj
{
- struct gl2_unknown_obj _unknown;
- GLhandleARB name;
- GLboolean delete_status;
- GLcharARB *info_log;
+ struct gl2_unknown_obj _unknown;
+ GLhandleARB name;
+ GLboolean delete_status;
+ GLcharARB *info_log;
};
struct gl2_generic_impl
{
- struct gl2_generic_intf *_vftbl;
- struct gl2_generic_obj _obj;
+ struct gl2_generic_intf *_vftbl;
+ struct gl2_generic_obj _obj;
};
static void
-_generic_destructor (struct gl2_unknown_intf **intf)
+_generic_destructor(struct gl2_unknown_intf **intf)
{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- _mesa_free ((void *) impl->_obj.info_log);
+ _mesa_free((void *) impl->_obj.info_log);
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- _mesa_HashRemove (ctx->Shared->GL2Objects, impl->_obj.name);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ _mesa_HashRemove(ctx->Shared->GL2Objects, impl->_obj.name);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- _unknown_destructor (intf);
+ _unknown_destructor(intf);
}
static struct gl2_unknown_intf **
-_generic_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_generic_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_GENERIC)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _unknown_QueryInterface (intf, uiid);
+ if (uiid == UIID_GENERIC) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _unknown_QueryInterface(intf, uiid);
}
static void
-_generic_Delete (struct gl2_generic_intf **intf)
+_generic_Delete(struct gl2_generic_intf **intf)
{
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- if (impl->_obj.delete_status == GL_FALSE)
- {
- impl->_obj.delete_status = GL_TRUE;
- (**intf)._unknown.Release ((struct gl2_unknown_intf **) intf);
- }
+ if (impl->_obj.delete_status == GL_FALSE) {
+ impl->_obj.delete_status = GL_TRUE;
+ (**intf)._unknown.Release((struct gl2_unknown_intf **) intf);
+ }
}
static GLhandleARB
-_generic_GetName (struct gl2_generic_intf **intf)
+_generic_GetName(struct gl2_generic_intf **intf)
{
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- return impl->_obj.name;
+ return impl->_obj.name;
}
static GLboolean
-_generic_GetDeleteStatus (struct gl2_generic_intf **intf)
+_generic_GetDeleteStatus(struct gl2_generic_intf **intf)
{
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- return impl->_obj.delete_status;
+ return impl->_obj.delete_status;
}
static GLvoid
-_generic_GetInfoLog (struct gl2_generic_intf **intf, GLsizei maxlen, GLcharARB *infolog)
+_generic_GetInfoLog(struct gl2_generic_intf **intf, GLsizei maxlen,
+ GLcharARB * infolog)
{
struct gl2_generic_impl *impl = (struct gl2_generic_impl *) (intf);
if (maxlen > 0) {
- _mesa_strncpy (infolog, impl->_obj.info_log, maxlen - 1);
+ _mesa_strncpy(infolog, impl->_obj.info_log, maxlen - 1);
infolog[maxlen - 1] = '\0';
}
}
static GLsizei
-_generic_GetInfoLogLength (struct gl2_generic_intf **intf)
+_generic_GetInfoLogLength(struct gl2_generic_intf **intf)
{
struct gl2_generic_impl *impl = (struct gl2_generic_impl *) (intf);
if (impl->_obj.info_log == NULL)
return 1;
- return _mesa_strlen (impl->_obj.info_log) + 1;
+ return _mesa_strlen(impl->_obj.info_log) + 1;
}
static struct gl2_generic_intf _generic_vftbl = {
- {
- _unknown_AddRef,
- _unknown_Release,
- _generic_QueryInterface
- },
- _generic_Delete,
- NULL, /* abstract GetType */
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _generic_QueryInterface},
+ _generic_Delete,
+ NULL, /* abstract GetType */
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_generic_GetInfoLog,
_generic_GetInfoLogLength
};
static void
-_generic_constructor (struct gl2_generic_impl *impl)
+_generic_constructor(struct gl2_generic_impl *impl)
{
- GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_CONTEXT(ctx);
- _unknown_constructor ((struct gl2_unknown_impl *) impl);
- impl->_vftbl = &_generic_vftbl;
- impl->_obj._unknown._destructor = _generic_destructor;
- impl->_obj.delete_status = GL_FALSE;
- impl->_obj.info_log = NULL;
+ _unknown_constructor((struct gl2_unknown_impl *) impl);
+ impl->_vftbl = &_generic_vftbl;
+ impl->_obj._unknown._destructor = _generic_destructor;
+ impl->_obj.delete_status = GL_FALSE;
+ impl->_obj.info_log = NULL;
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- impl->_obj.name = _mesa_HashFindFreeKeyBlock (ctx->Shared->GL2Objects, 1);
- _mesa_HashInsert (ctx->Shared->GL2Objects, impl->_obj.name, (void *) impl);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ impl->_obj.name = _mesa_HashFindFreeKeyBlock(ctx->Shared->GL2Objects, 1);
+ _mesa_HashInsert(ctx->Shared->GL2Objects, impl->_obj.name, (void *) impl);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
}
struct gl2_container_obj
{
- struct gl2_generic_obj _generic;
- struct gl2_generic_intf ***attached;
- GLuint attached_count;
+ struct gl2_generic_obj _generic;
+ struct gl2_generic_intf ***attached;
+ GLuint attached_count;
};
struct gl2_container_impl
{
- struct gl2_container_intf *_vftbl;
- struct gl2_container_obj _obj;
+ struct gl2_container_intf *_vftbl;
+ struct gl2_container_obj _obj;
};
static void
-_container_destructor (struct gl2_unknown_intf **intf)
+_container_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- GLuint i;
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ GLuint i;
- for (i = 0; i < impl->_obj.attached_count; i++)
- {
- struct gl2_generic_intf **x = impl->_obj.attached[i];
- (**x)._unknown.Release ((struct gl2_unknown_intf **) x);
- }
+ for (i = 0; i < impl->_obj.attached_count; i++) {
+ struct gl2_generic_intf **x = impl->_obj.attached[i];
+ (**x)._unknown.Release((struct gl2_unknown_intf **) x);
+ }
- _generic_destructor (intf);
+ _generic_destructor(intf);
}
static struct gl2_unknown_intf **
-_container_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_container_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_CONTAINER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _generic_QueryInterface (intf, uiid);
+ if (uiid == UIID_CONTAINER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _generic_QueryInterface(intf, uiid);
}
static GLboolean
-_container_Attach (struct gl2_container_intf **intf, struct gl2_generic_intf **att)
+_container_Attach(struct gl2_container_intf **intf,
+ struct gl2_generic_intf **att)
{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- GLuint i;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ GLuint i;
- for (i = 0; i < impl->_obj.attached_count; i++)
- if (impl->_obj.attached[i] == att)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "_container_Attach");
- return GL_FALSE;
- }
+ for (i = 0; i < impl->_obj.attached_count; i++)
+ if (impl->_obj.attached[i] == att) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "_container_Attach");
+ return GL_FALSE;
+ }
- impl->_obj.attached = (struct gl2_generic_intf ***) _mesa_realloc (impl->_obj.attached,
- impl->_obj.attached_count * sizeof (*impl->_obj.attached), (impl->_obj.attached_count + 1) *
- sizeof (*impl->_obj.attached));
- if (impl->_obj.attached == NULL)
- return GL_FALSE;
+ impl->_obj.attached = (struct gl2_generic_intf ***)
+ _mesa_realloc(impl->_obj.attached,
+ impl->_obj.attached_count * sizeof(*impl->_obj.attached),
+ (impl->_obj.attached_count + 1) * sizeof(*impl->_obj.attached));
+ if (impl->_obj.attached == NULL)
+ return GL_FALSE;
- impl->_obj.attached[impl->_obj.attached_count] = att;
- impl->_obj.attached_count++;
- (**att)._unknown.AddRef ((struct gl2_unknown_intf **) att);
- return GL_TRUE;
+ impl->_obj.attached[impl->_obj.attached_count] = att;
+ impl->_obj.attached_count++;
+ (**att)._unknown.AddRef((struct gl2_unknown_intf **) att);
+ return GL_TRUE;
}
static GLboolean
-_container_Detach (struct gl2_container_intf **intf, struct gl2_generic_intf **att)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- GLuint i, j;
-
- for (i = 0; i < impl->_obj.attached_count; i++)
- if (impl->_obj.attached[i] == att)
- {
- for (j = i; j < impl->_obj.attached_count - 1; j++)
- impl->_obj.attached[j] = impl->_obj.attached[j + 1];
- impl->_obj.attached = (struct gl2_generic_intf ***) _mesa_realloc (impl->_obj.attached,
- impl->_obj.attached_count * sizeof (*impl->_obj.attached),
- (impl->_obj.attached_count - 1) * sizeof (*impl->_obj.attached));
- impl->_obj.attached_count--;
- (**att)._unknown.Release ((struct gl2_unknown_intf **) att);
- return GL_TRUE;
- }
+_container_Detach(struct gl2_container_intf **intf,
+ struct gl2_generic_intf **att)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ GLuint i, j;
+
+ for (i = 0; i < impl->_obj.attached_count; i++)
+ if (impl->_obj.attached[i] == att) {
+ for (j = i; j < impl->_obj.attached_count - 1; j++)
+ impl->_obj.attached[j] = impl->_obj.attached[j + 1];
+ impl->_obj.attached = (struct gl2_generic_intf ***)
+ _mesa_realloc(impl->_obj.attached,
+ impl->_obj.attached_count * sizeof(*impl->_obj.attached),
+ (impl->_obj.attached_count - 1) * sizeof(*impl->_obj.attached));
+ impl->_obj.attached_count--;
+ (**att)._unknown.Release((struct gl2_unknown_intf **) att);
+ return GL_TRUE;
+ }
- _mesa_error (ctx, GL_INVALID_OPERATION, "_container_Detach");
- return GL_FALSE;
+ _mesa_error(ctx, GL_INVALID_OPERATION, "_container_Detach");
+ return GL_FALSE;
}
static GLsizei
-_container_GetAttachedCount (struct gl2_container_intf **intf)
+_container_GetAttachedCount(struct gl2_container_intf **intf)
{
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- return impl->_obj.attached_count;
+ return impl->_obj.attached_count;
}
static struct gl2_generic_intf **
-_container_GetAttached (struct gl2_container_intf **intf, GLuint index)
+_container_GetAttached(struct gl2_container_intf **intf, GLuint index)
{
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- (**impl->_obj.attached[index])._unknown.AddRef (
- (struct gl2_unknown_intf **)impl->_obj.attached[index]);
- return impl->_obj.attached[index];
+ (**impl->_obj.attached[index])._unknown.AddRef((struct gl2_unknown_intf **)
+ impl->_obj.attached[index]);
+ return impl->_obj.attached[index];
}
static struct gl2_container_intf _container_vftbl = {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _container_QueryInterface
- },
- _generic_Delete,
- NULL, /* abstract GetType */
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _container_QueryInterface
+ },
+ _generic_Delete,
+ NULL, /* abstract GetType */
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_generic_GetInfoLog,
_generic_GetInfoLogLength
- },
- _container_Attach,
- _container_Detach,
- _container_GetAttachedCount,
- _container_GetAttached
+ },
+ _container_Attach,
+ _container_Detach,
+ _container_GetAttachedCount,
+ _container_GetAttached
};
static void
-_container_constructor (struct gl2_container_impl *impl)
+_container_constructor(struct gl2_container_impl *impl)
{
- _generic_constructor ((struct gl2_generic_impl *) impl);
- impl->_vftbl = &_container_vftbl;
- impl->_obj._generic._unknown._destructor = _container_destructor;
- impl->_obj.attached = NULL;
- impl->_obj.attached_count = 0;
+ _generic_constructor((struct gl2_generic_impl *) impl);
+ impl->_vftbl = &_container_vftbl;
+ impl->_obj._generic._unknown._destructor = _container_destructor;
+ impl->_obj.attached = NULL;
+ impl->_obj.attached_count = 0;
}
struct gl2_3dlabs_shhandle_obj
{
- struct gl2_unkinner_obj _unknown;
+ struct gl2_unkinner_obj _unknown;
#if USE_3DLABS_FRONTEND
- ShHandle handle;
+ ShHandle handle;
#endif
};
struct gl2_3dlabs_shhandle_impl
{
- struct gl2_3dlabs_shhandle_intf *_vftbl;
- struct gl2_3dlabs_shhandle_obj _obj;
+ struct gl2_3dlabs_shhandle_intf *_vftbl;
+ struct gl2_3dlabs_shhandle_obj _obj;
};
static void
-_3dlabs_shhandle_destructor (struct gl2_unknown_intf **intf)
+_3dlabs_shhandle_destructor(struct gl2_unknown_intf **intf)
{
#if USE_3DLABS_FRONTEND
- struct gl2_3dlabs_shhandle_impl *impl = (struct gl2_3dlabs_shhandle_impl *) intf;
- ShDestruct (impl->_obj.handle);
+ struct gl2_3dlabs_shhandle_impl *impl =
+ (struct gl2_3dlabs_shhandle_impl *) intf;
+ ShDestruct(impl->_obj.handle);
#endif
- _unkinner_destructor (intf);
+ _unkinner_destructor(intf);
}
static GLvoid *
-_3dlabs_shhandle_GetShHandle (struct gl2_3dlabs_shhandle_intf **intf)
+_3dlabs_shhandle_GetShHandle(struct gl2_3dlabs_shhandle_intf **intf)
{
#if USE_3DLABS_FRONTEND
- struct gl2_3dlabs_shhandle_impl *impl = (struct gl2_3dlabs_shhandle_impl *) intf;
- return impl->_obj.handle;
+ struct gl2_3dlabs_shhandle_impl *impl =
+ (struct gl2_3dlabs_shhandle_impl *) intf;
+ return impl->_obj.handle;
#else
- return NULL;
+ return NULL;
#endif
}
static struct gl2_3dlabs_shhandle_intf _3dlabs_shhandle_vftbl = {
- {
- _unkinner_AddRef,
- _unkinner_Release,
- _unkinner_QueryInterface
- },
- _3dlabs_shhandle_GetShHandle
+ {
+ _unkinner_AddRef,
+ _unkinner_Release,
+ _unkinner_QueryInterface},
+ _3dlabs_shhandle_GetShHandle
};
static void
-_3dlabs_shhandle_constructor (struct gl2_3dlabs_shhandle_impl *impl, struct gl2_unknown_intf **outer)
+_3dlabs_shhandle_constructor(struct gl2_3dlabs_shhandle_impl *impl,
+ struct gl2_unknown_intf **outer)
{
- _unkinner_constructor ((struct gl2_unkinner_impl *) impl, outer);
- impl->_vftbl = &_3dlabs_shhandle_vftbl;
+ _unkinner_constructor((struct gl2_unkinner_impl *) impl, outer);
+ impl->_vftbl = &_3dlabs_shhandle_vftbl;
#if USE_3DLABS_FRONTEND
- impl->_obj.handle = NULL;
+ impl->_obj.handle = NULL;
#endif
}
struct gl2_shader_obj
{
- struct gl2_generic_obj _generic;
- struct gl2_3dlabs_shhandle_impl _3dlabs_shhandle;
- GLboolean compile_status;
- GLcharARB *source;
- GLint *offsets;
- GLsizei offset_count;
+ struct gl2_generic_obj _generic;
+ struct gl2_3dlabs_shhandle_impl _3dlabs_shhandle;
+ GLboolean compile_status;
+ GLcharARB *source;
+ GLint *offsets;
+ GLsizei offset_count;
slang_code_object code;
};
struct gl2_shader_impl
{
- struct gl2_shader_intf *_vftbl;
- struct gl2_shader_obj _obj;
+ struct gl2_shader_intf *_vftbl;
+ struct gl2_shader_obj _obj;
};
static void
-_shader_destructor (struct gl2_unknown_intf **intf)
+_shader_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- _mesa_free ((void *) impl->_obj.source);
- _mesa_free ((void *) impl->_obj.offsets);
- _slang_code_object_dtr (&impl->_obj.code);
- _3dlabs_shhandle_destructor ((struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl);
- _generic_destructor (intf);
+ _mesa_free((void *) impl->_obj.source);
+ _mesa_free((void *) impl->_obj.offsets);
+ _slang_code_object_dtr(&impl->_obj.code);
+ _3dlabs_shhandle_destructor((struct gl2_unknown_intf **) &impl->_obj.
+ _3dlabs_shhandle._vftbl);
+ _generic_destructor(intf);
}
static struct gl2_unknown_intf **
-_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_shader_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
#if USE_3DLABS_FRONTEND
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
#endif
- if (uiid == UIID_SHADER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
+ if (uiid == UIID_SHADER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
#if USE_3DLABS_FRONTEND
- if (uiid == UIID_3DLABS_SHHANDLE)
- {
- (**intf).AddRef (intf);
- return (struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl;
- }
+ if (uiid == UIID_3DLABS_SHHANDLE) {
+ (**intf).AddRef(intf);
+ return (struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl;
+ }
#endif
- return _generic_QueryInterface (intf, uiid);
+ return _generic_QueryInterface(intf, uiid);
}
static GLenum
-_shader_GetType (struct gl2_generic_intf **intf)
+_shader_GetType(struct gl2_generic_intf **intf)
{
- return GL_SHADER_OBJECT_ARB;
+ return GL_SHADER_OBJECT_ARB;
}
static GLvoid
-_shader_GetInfoLog (struct gl2_generic_intf **intf, GLsizei maxlen, GLcharARB *infolog)
+_shader_GetInfoLog(struct gl2_generic_intf **intf, GLsizei maxlen,
+ GLcharARB * infolog)
{
struct gl2_shader_impl *impl = (struct gl2_shader_impl *) (intf);
if (maxlen > 0) {
if (impl->_obj._generic.info_log != NULL) {
- GLsizei len = _mesa_strlen (impl->_obj._generic.info_log);
+ GLsizei len = _mesa_strlen(impl->_obj._generic.info_log);
if (len > maxlen - 1)
len = maxlen - 1;
- _mesa_memcpy (infolog, impl->_obj._generic.info_log, len);
+ _mesa_memcpy(infolog, impl->_obj._generic.info_log, len);
infolog += len;
maxlen -= len;
}
if (impl->_obj.code.machine.infolog != NULL &&
impl->_obj.code.machine.infolog->text != NULL) {
- GLsizei len = _mesa_strlen (impl->_obj.code.machine.infolog->text);
+ GLsizei len = _mesa_strlen(impl->_obj.code.machine.infolog->text);
if (len > maxlen - 1)
len = maxlen - 1;
- _mesa_memcpy (infolog, impl->_obj.code.machine.infolog->text, len);
+ _mesa_memcpy(infolog, impl->_obj.code.machine.infolog->text, len);
}
infolog[maxlen - 1] = '\0';
}
}
static GLsizei
-_shader_GetInfoLogLength (struct gl2_generic_intf **intf)
+_shader_GetInfoLogLength(struct gl2_generic_intf **intf)
{
struct gl2_shader_impl *impl = (struct gl2_shader_impl *) (intf);
GLsizei length = 1;
if (impl->_obj._generic.info_log != NULL)
- length += _mesa_strlen (impl->_obj._generic.info_log);
+ length += _mesa_strlen(impl->_obj._generic.info_log);
if (impl->_obj.code.machine.infolog != NULL &&
impl->_obj.code.machine.infolog->text != NULL)
- length += _mesa_strlen (impl->_obj.code.machine.infolog->text);
+ length += _mesa_strlen(impl->_obj.code.machine.infolog->text);
return length;
}
static GLboolean
-_shader_GetCompileStatus (struct gl2_shader_intf **intf)
+_shader_GetCompileStatus(struct gl2_shader_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- return impl->_obj.compile_status;
+ return impl->_obj.compile_status;
}
static GLvoid
-_shader_SetSource (struct gl2_shader_intf **intf, GLcharARB *src, GLint *off, GLsizei cnt)
+_shader_SetSource(struct gl2_shader_intf **intf, GLcharARB * src, GLint * off,
+ GLsizei cnt)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- _mesa_free ((void *) impl->_obj.source);
- impl->_obj.source = src;
- _mesa_free ((void *) impl->_obj.offsets);
- impl->_obj.offsets = off;
- impl->_obj.offset_count = cnt;
+ _mesa_free((void *) impl->_obj.source);
+ impl->_obj.source = src;
+ _mesa_free((void *) impl->_obj.offsets);
+ impl->_obj.offsets = off;
+ impl->_obj.offset_count = cnt;
}
static const GLcharARB *
-_shader_GetSource (struct gl2_shader_intf **intf)
+_shader_GetSource(struct gl2_shader_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- return impl->_obj.source;
+ return impl->_obj.source;
}
static GLvoid
-_shader_Compile (struct gl2_shader_intf **intf)
+_shader_Compile(struct gl2_shader_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
#if USE_3DLABS_FRONTEND
- char **strings;
- TBuiltInResource res;
+ char **strings;
+ TBuiltInResource res;
#else
- slang_unit_type type;
- slang_info_log info_log;
+ slang_unit_type type;
+ slang_info_log info_log;
#endif
- impl->_obj.compile_status = GL_FALSE;
- _mesa_free ((void *) impl->_obj._generic.info_log);
- impl->_obj._generic.info_log = NULL;
+ impl->_obj.compile_status = GL_FALSE;
+ _mesa_free((void *) impl->_obj._generic.info_log);
+ impl->_obj._generic.info_log = NULL;
#if USE_3DLABS_FRONTEND
- /* 3dlabs compiler expects us to feed it with null-terminated string array,
- we've got only one big string with offsets, so we must split it; but when
- there's only one string to deal with, we pass its address directly */
-
- if (impl->_obj.offset_count <= 1)
- strings = &impl->_obj.source;
- else
- {
- GLsizei i, offset = 0;
-
- strings = (char **) _mesa_malloc (impl->_obj.offset_count * sizeof (char *));
- if (strings == NULL)
- return;
-
- for (i = 0; i < impl->_obj.offset_count; i++)
- {
- GLsizei size = impl->_obj.offsets[i] - offset;
-
- strings[i] = (char *) _mesa_malloc ((size + 1) * sizeof (char));
- if (strings[i] == NULL)
- {
- GLsizei j;
-
- for (j = 0; j < i; j++)
- _mesa_free (strings[j]);
- _mesa_free (strings);
- return;
- }
-
- _mesa_memcpy (strings[i], impl->_obj.source + offset, size * sizeof (char));
- strings[i][size] = '\0';
- offset = impl->_obj.offsets[i];
- }
- }
-
- /* TODO set these fields to some REAL numbers */
- res.maxLights = 8;
- res.maxClipPlanes = 6;
- res.maxTextureUnits = 2;
- res.maxTextureCoords = 2;
- res.maxVertexAttribs = 8;
- res.maxVertexUniformComponents = 64;
- res.maxVaryingFloats = 8;
- res.maxVertexTextureImageUnits = 2;
- res.maxCombinedTextureImageUnits = 2;
- res.maxTextureImageUnits = 2;
- res.maxFragmentUniformComponents = 64;
- res.maxDrawBuffers = 1;
-
- if (ShCompile (impl->_obj._3dlabs_shhandle._obj.handle, strings, impl->_obj.offset_count,
- EShOptFull, &res, 0))
- impl->_obj.compile_status = GL_TRUE;
- if (impl->_obj.offset_count > 1)
- {
- GLsizei i;
-
- for (i = 0; i < impl->_obj.offset_count; i++)
- _mesa_free (strings[i]);
- _mesa_free (strings);
- }
-
- impl->_obj._generic.info_log = _mesa_strdup (ShGetInfoLog (
- impl->_obj._3dlabs_shhandle._obj.handle));
+ /* 3dlabs compiler expects us to feed it with null-terminated string array,
+ we've got only one big string with offsets, so we must split it; but when
+ there's only one string to deal with, we pass its address directly */
+
+ if (impl->_obj.offset_count <= 1)
+ strings = &impl->_obj.source;
+ else {
+ GLsizei i, offset = 0;
+
+ strings =
+ (char **) _mesa_malloc(impl->_obj.offset_count * sizeof(char *));
+ if (strings == NULL)
+ return;
+
+ for (i = 0; i < impl->_obj.offset_count; i++) {
+ GLsizei size = impl->_obj.offsets[i] - offset;
+
+ strings[i] = (char *) _mesa_malloc((size + 1) * sizeof(char));
+ if (strings[i] == NULL) {
+ GLsizei j;
+
+ for (j = 0; j < i; j++)
+ _mesa_free(strings[j]);
+ _mesa_free(strings);
+ return;
+ }
+
+ _mesa_memcpy(strings[i], impl->_obj.source + offset,
+ size * sizeof(char));
+ strings[i][size] = '\0';
+ offset = impl->_obj.offsets[i];
+ }
+ }
+
+ /* TODO set these fields to some REAL numbers */
+ res.maxLights = 8;
+ res.maxClipPlanes = 6;
+ res.maxTextureUnits = 2;
+ res.maxTextureCoords = 2;
+ res.maxVertexAttribs = 8;
+ res.maxVertexUniformComponents = 64;
+ res.maxVaryingFloats = 8;
+ res.maxVertexTextureImageUnits = 2;
+ res.maxCombinedTextureImageUnits = 2;
+ res.maxTextureImageUnits = 2;
+ res.maxFragmentUniformComponents = 64;
+ res.maxDrawBuffers = 1;
+
+ if (ShCompile
+ (impl->_obj._3dlabs_shhandle._obj.handle, strings,
+ impl->_obj.offset_count, EShOptFull, &res, 0))
+ impl->_obj.compile_status = GL_TRUE;
+ if (impl->_obj.offset_count > 1) {
+ GLsizei i;
+
+ for (i = 0; i < impl->_obj.offset_count; i++)
+ _mesa_free(strings[i]);
+ _mesa_free(strings);
+ }
+
+ impl->_obj._generic.info_log =
+ _mesa_strdup(ShGetInfoLog(impl->_obj._3dlabs_shhandle._obj.handle));
#else
- if (impl->_vftbl->GetSubType (intf) == GL_FRAGMENT_SHADER)
- type = slang_unit_fragment_shader;
- else
- type = slang_unit_vertex_shader;
- slang_info_log_construct (&info_log);
- if (_slang_compile (impl->_obj.source, &impl->_obj.code, type, &info_log))
+ if (impl->_vftbl->GetSubType(intf) == GL_FRAGMENT_SHADER)
+ type = slang_unit_fragment_shader;
+ else
+ type = slang_unit_vertex_shader;
+ slang_info_log_construct(&info_log);
+ if (_slang_compile(impl->_obj.source, &impl->_obj.code, type, &info_log))
impl->_obj.compile_status = GL_TRUE;
- if (info_log.text != NULL)
- impl->_obj._generic.info_log = _mesa_strdup (info_log.text);
- else if (impl->_obj.compile_status)
- impl->_obj._generic.info_log = _mesa_strdup ("Compile OK.\n");
+ if (info_log.text != NULL)
+ impl->_obj._generic.info_log = _mesa_strdup(info_log.text);
+ else if (impl->_obj.compile_status)
+ impl->_obj._generic.info_log = _mesa_strdup("Compile OK.\n");
else
- impl->_obj._generic.info_log = _mesa_strdup ("Compile failed.\n");
- slang_info_log_destruct (&info_log);
+ impl->_obj._generic.info_log = _mesa_strdup("Compile failed.\n");
+ slang_info_log_destruct(&info_log);
#endif
}
static struct gl2_shader_intf _shader_vftbl = {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _shader_QueryInterface
- },
- _generic_Delete,
- _shader_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _shader_QueryInterface
+ },
+ _generic_Delete,
+ _shader_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_shader_GetInfoLog,
_shader_GetInfoLogLength
- },
- NULL, /* abstract GetSubType */
- _shader_GetCompileStatus,
- _shader_SetSource,
- _shader_GetSource,
- _shader_Compile
+ },
+ NULL, /* abstract GetSubType */
+ _shader_GetCompileStatus,
+ _shader_SetSource,
+ _shader_GetSource,
+ _shader_Compile
};
static void
-_shader_constructor (struct gl2_shader_impl *impl)
+_shader_constructor(struct gl2_shader_impl *impl)
{
- _generic_constructor ((struct gl2_generic_impl *) impl);
- _3dlabs_shhandle_constructor (&impl->_obj._3dlabs_shhandle, (struct gl2_unknown_intf **)
- &impl->_vftbl);
- impl->_vftbl = &_shader_vftbl;
- impl->_obj._generic._unknown._destructor = _shader_destructor;
- impl->_obj.compile_status = GL_FALSE;
- impl->_obj.source = NULL;
- impl->_obj.offsets = NULL;
- impl->_obj.offset_count = 0;
- _slang_code_object_ctr (&impl->_obj.code);
+ _generic_constructor((struct gl2_generic_impl *) impl);
+ _3dlabs_shhandle_constructor(&impl->_obj._3dlabs_shhandle,
+ (struct gl2_unknown_intf **)
+ &impl->_vftbl);
+ impl->_vftbl = &_shader_vftbl;
+ impl->_obj._generic._unknown._destructor = _shader_destructor;
+ impl->_obj.compile_status = GL_FALSE;
+ impl->_obj.source = NULL;
+ impl->_obj.offsets = NULL;
+ impl->_obj.offset_count = 0;
+ _slang_code_object_ctr(&impl->_obj.code);
}
struct gl2_program_obj
{
- struct gl2_container_obj _container;
- GLboolean link_status;
- GLboolean validate_status;
+ struct gl2_container_obj _container;
+ GLboolean link_status;
+ GLboolean validate_status;
#if USE_3DLABS_FRONTEND
- ShHandle linker;
- ShHandle uniforms;
+ ShHandle linker;
+ ShHandle uniforms;
#endif
- slang_program prog;
+ slang_program prog;
};
struct gl2_program_impl
{
- struct gl2_program_intf *_vftbl;
- struct gl2_program_obj _obj;
+ struct gl2_program_intf *_vftbl;
+ struct gl2_program_obj _obj;
};
static void
-_program_destructor (struct gl2_unknown_intf **intf)
+_program_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
#if USE_3DLABS_FRONTEND
- ShDestruct (impl->_obj.linker);
- ShDestruct (impl->_obj.uniforms);
+ ShDestruct(impl->_obj.linker);
+ ShDestruct(impl->_obj.uniforms);
#endif
- _container_destructor (intf);
- slang_program_dtr (&impl->_obj.prog);
+ _container_destructor(intf);
+ _slang_program_dtr(&impl->_obj.prog);
}
static struct gl2_unknown_intf **
-_program_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_program_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_PROGRAM)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _container_QueryInterface (intf, uiid);
+ if (uiid == UIID_PROGRAM) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _container_QueryInterface(intf, uiid);
}
static GLenum
-_program_GetType (struct gl2_generic_intf **intf)
+_program_GetType(struct gl2_generic_intf **intf)
{
- return GL_PROGRAM_OBJECT_ARB;
+ return GL_PROGRAM_OBJECT_ARB;
}
static GLboolean
-_program_Attach (struct gl2_container_intf **intf, struct gl2_generic_intf **att)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **sha;
-
- sha = (**att)._unknown.QueryInterface ((struct gl2_unknown_intf **) att, UIID_SHADER);
- if (sha == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "_program_Attach");
- return GL_FALSE;
- }
+_program_Attach(struct gl2_container_intf **intf,
+ struct gl2_generic_intf **att)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_unknown_intf **sha;
+
+ sha =
+ (**att)._unknown.QueryInterface((struct gl2_unknown_intf **) att,
+ UIID_SHADER);
+ if (sha == NULL) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "_program_Attach");
+ return GL_FALSE;
+ }
- (**sha).Release (sha);
- return _container_Attach (intf, att);
+ (**sha).Release(sha);
+ return _container_Attach(intf, att);
}
static GLboolean
-_program_GetLinkStatus (struct gl2_program_intf **intf)
+_program_GetLinkStatus(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- return impl->_obj.link_status;
+ return impl->_obj.link_status;
}
static GLboolean
-_program_GetValidateStatus (struct gl2_program_intf **intf)
+_program_GetValidateStatus(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- return impl->_obj.validate_status;
+ return impl->_obj.validate_status;
}
static GLvoid
-_program_Link (struct gl2_program_intf **intf)
+_program_Link(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
#if USE_3DLABS_FRONTEND
- ShHandle *handles;
+ ShHandle *handles;
#endif
- GLuint i, count;
+ GLuint i, count;
slang_code_object *code[2];
GLboolean all_compiled = GL_TRUE;
- impl->_obj.link_status = GL_FALSE;
- _mesa_free ((void *) impl->_obj._container._generic.info_log);
- impl->_obj._container._generic.info_log = NULL;
- slang_program_rst (&impl->_obj.prog);
+ impl->_obj.link_status = GL_FALSE;
+ _mesa_free((void *) impl->_obj._container._generic.info_log);
+ impl->_obj._container._generic.info_log = NULL;
+ _slang_program_rst(&impl->_obj.prog);
#if USE_3DLABS_FRONTEND
- handles = (ShHandle *) _mesa_malloc (impl->_obj._container.attached_count * sizeof (ShHandle));
- if (handles == NULL)
- return;
-
- for (i = 0; i < impl->_obj._container.attached_count; i++)
- {
- struct gl2_generic_intf **gen = impl->_obj._container.attached[i];
- struct gl2_3dlabs_shhandle_intf **sh;
-
- sh = (struct gl2_3dlabs_shhandle_intf **) (**gen)._unknown.QueryInterface (
- (struct gl2_unknown_intf **) gen, UIID_3DLABS_SHHANDLE);
- if (sh != NULL)
- {
- handles[i] = (**sh).GetShHandle (sh);
- (**sh)._unknown.Release ((struct gl2_unknown_intf **) sh);
- }
- else
- {
- _mesa_free (handles);
- return;
- }
- }
-
- if (ShLink (impl->_obj.linker, handles, impl->_obj._container.attached_count,
- impl->_obj.uniforms, NULL, NULL))
- impl->_obj.link_status = GL_TRUE;
-
- impl->_obj._container._generic.info_log = _mesa_strdup (ShGetInfoLog (impl->_obj.linker));
+ handles =
+ (ShHandle *) _mesa_malloc(impl->_obj._container.attached_count *
+ sizeof(ShHandle));
+ if (handles == NULL)
+ return;
+
+ for (i = 0; i < impl->_obj._container.attached_count; i++) {
+ struct gl2_generic_intf **gen = impl->_obj._container.attached[i];
+ struct gl2_3dlabs_shhandle_intf **sh;
+
+ sh =
+ (struct gl2_3dlabs_shhandle_intf **) (**gen)._unknown.
+ QueryInterface((struct gl2_unknown_intf **) gen,
+ UIID_3DLABS_SHHANDLE);
+ if (sh != NULL) {
+ handles[i] = (**sh).GetShHandle(sh);
+ (**sh)._unknown.Release((struct gl2_unknown_intf **) sh);
+ }
+ else {
+ _mesa_free(handles);
+ return;
+ }
+ }
+
+ if (ShLink(impl->_obj.linker, handles, impl->_obj._container.attached_count,
+ impl->_obj.uniforms, NULL, NULL))
+ impl->_obj.link_status = GL_TRUE;
+
+ impl->_obj._container._generic.info_log =
+ _mesa_strdup(ShGetInfoLog(impl->_obj.linker));
#else
count = impl->_obj._container.attached_count;
if (count > 2)
return;
- for (i = 0; i < count; i++)
- {
- struct gl2_generic_intf **obj;
- struct gl2_unknown_intf **unk;
- struct gl2_shader_impl *sha;
-
- obj = impl->_obj._container.attached[i];
- unk = (**obj)._unknown.QueryInterface ((struct gl2_unknown_intf **) obj, UIID_SHADER);
- if (unk == NULL)
- return;
- sha = (struct gl2_shader_impl *) unk;
+
+ for (i = 0; i < count; i++) {
+ struct gl2_generic_intf **obj;
+ struct gl2_unknown_intf **unk;
+ struct gl2_shader_impl *sha;
+
+ obj = impl->_obj._container.attached[i];
+ unk =
+ (**obj)._unknown.QueryInterface((struct gl2_unknown_intf **) obj,
+ UIID_SHADER);
+ if (unk == NULL)
+ return;
+ sha = (struct gl2_shader_impl *) unk;
code[i] = &sha->_obj.code;
all_compiled = all_compiled && sha->_obj.compile_status;
- (**unk).Release (unk);
+ (**unk).Release(unk);
}
impl->_obj.link_status = all_compiled;
- if (!impl->_obj.link_status)
- {
- impl->_obj._container._generic.info_log = _mesa_strdup (
- "Error: One or more shaders has not successfully compiled.\n");
+ if (!impl->_obj.link_status) {
+ impl->_obj._container._generic.info_log =
+ _mesa_strdup
+ ("Error: One or more shaders has not successfully compiled.\n");
return;
}
- impl->_obj.link_status = _slang_link (&impl->_obj.prog, code, count);
- if (!impl->_obj.link_status)
- {
- impl->_obj._container._generic.info_log = _mesa_strdup ("Link failed.\n");
+ impl->_obj.link_status = _slang_link(&impl->_obj.prog, code, count);
+ if (!impl->_obj.link_status) {
+ impl->_obj._container._generic.info_log =
+ _mesa_strdup("Link failed.\n");
return;
}
- impl->_obj._container._generic.info_log = _mesa_strdup ("Link OK.\n");
+ impl->_obj._container._generic.info_log = _mesa_strdup("Link OK.\n");
#endif
}
static GLvoid
-_program_Validate (struct gl2_program_intf **intf)
+_program_Validate(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- impl->_obj.validate_status = GL_FALSE;
- _mesa_free ((void *) impl->_obj._container._generic.info_log);
- impl->_obj._container._generic.info_log = NULL;
+ impl->_obj.validate_status = GL_FALSE;
+ _mesa_free((void *) impl->_obj._container._generic.info_log);
+ impl->_obj._container._generic.info_log = NULL;
- /* TODO validate */
+ /* TODO validate */
}
static GLvoid
-write_common_fixed (slang_program *pro, GLuint index, const GLvoid *src, GLuint off, GLuint size)
+write_common_fixed(slang_program * pro, GLuint index, const GLvoid * src,
+ GLuint off, GLuint size)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- {
- GLuint addr;
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ GLuint addr;
- addr = pro->common_fixed_entries[i][index];
- if (addr != ~0)
- {
- GLubyte *dst;
+ addr = pro->common_fixed_entries[i][index];
+ if (addr != ~0) {
+ GLubyte *dst;
- dst = (GLubyte *) pro->machines[i]->mem + addr + off * size;
- _mesa_memcpy (dst, src, size);
- }
- }
+ dst = (GLubyte *) pro->machines[i]->mem + addr + off * size;
+ _mesa_memcpy(dst, src, size);
+ }
+ }
}
static GLvoid
-write_common_fixed_mat4 (slang_program *pro, GLmatrix *matrix, GLuint off, GLuint i, GLuint ii,
- GLuint it, GLuint iit)
+write_common_fixed_mat4(slang_program * pro, GLmatrix * matrix, GLuint off,
+ GLuint i, GLuint ii, GLuint it, GLuint iit)
{
- GLfloat mat[16];
+ GLfloat mat[16];
- /* we want inverse matrix */
- if (!matrix->inv)
- {
- /* allocate inverse matrix and make it dirty */
- _math_matrix_alloc_inv (matrix);
- _math_matrix_loadf (matrix, matrix->m);
- }
- _math_matrix_analyse (matrix);
+ /* we want inverse matrix */
+ if (!matrix->inv) {
+ /* allocate inverse matrix and make it dirty */
+ _math_matrix_alloc_inv(matrix);
+ _math_matrix_loadf(matrix, matrix->m);
+ }
+ _math_matrix_analyse(matrix);
- write_common_fixed (pro, i, matrix->m, off, 16 * sizeof (GLfloat));
+ write_common_fixed(pro, i, matrix->m, off, 16 * sizeof(GLfloat));
- /* inverse */
- write_common_fixed (pro, ii, matrix->inv, off, 16 * sizeof (GLfloat));
+ /* inverse */
+ write_common_fixed(pro, ii, matrix->inv, off, 16 * sizeof(GLfloat));
- /* transpose */
- _math_transposef (mat, matrix->m);
- write_common_fixed (pro, it, mat, off, 16 * sizeof (GLfloat));
+ /* transpose */
+ _math_transposef(mat, matrix->m);
+ write_common_fixed(pro, it, mat, off, 16 * sizeof(GLfloat));
- /* inverse transpose */
- _math_transposef (mat, matrix->inv);
- write_common_fixed (pro, iit, mat, off, 16 * sizeof (GLfloat));
+ /* inverse transpose */
+ _math_transposef(mat, matrix->inv);
+ write_common_fixed(pro, iit, mat, off, 16 * sizeof(GLfloat));
}
static GLvoid
-write_common_fixed_material (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e, GLuint a,
- GLuint d, GLuint sp, GLuint sh)
+write_common_fixed_material(GLcontext * ctx, slang_program * pro, GLuint i,
+ GLuint e, GLuint a, GLuint d, GLuint sp,
+ GLuint sh)
{
- GLfloat v[17];
+ GLfloat v[17];
- COPY_4FV(v, ctx->Light.Material.Attrib[e]);
- COPY_4FV((v + 4), ctx->Light.Material.Attrib[a]);
- COPY_4FV((v + 8), ctx->Light.Material.Attrib[d]);
- COPY_4FV((v + 12), ctx->Light.Material.Attrib[sp]);
- v[16] = ctx->Light.Material.Attrib[sh][0];
- write_common_fixed (pro, i, v, 0, 17 * sizeof (GLfloat));
+ COPY_4FV(v, ctx->Light.Material.Attrib[e]);
+ COPY_4FV((v + 4), ctx->Light.Material.Attrib[a]);
+ COPY_4FV((v + 8), ctx->Light.Material.Attrib[d]);
+ COPY_4FV((v + 12), ctx->Light.Material.Attrib[sp]);
+ v[16] = ctx->Light.Material.Attrib[sh][0];
+ write_common_fixed(pro, i, v, 0, 17 * sizeof(GLfloat));
}
static GLvoid
-write_common_fixed_light_model_product (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e,
- GLuint a)
+write_common_fixed_light_model_product(GLcontext * ctx, slang_program * pro,
+ GLuint i, GLuint e, GLuint a)
{
- GLfloat v[4];
+ GLfloat v[4];
- SCALE_4V(v, ctx->Light.Material.Attrib[a], ctx->Light.Model.Ambient);
- ACC_4V(v, ctx->Light.Material.Attrib[e]);
- write_common_fixed (pro, i, v, 0, 4 * sizeof (GLfloat));
+ SCALE_4V(v, ctx->Light.Material.Attrib[a], ctx->Light.Model.Ambient);
+ ACC_4V(v, ctx->Light.Material.Attrib[e]);
+ write_common_fixed(pro, i, v, 0, 4 * sizeof(GLfloat));
}
static GLvoid
-write_common_fixed_light_product (GLcontext *ctx, slang_program *pro, GLuint off, GLuint i, GLuint a,
- GLuint d, GLuint s)
+write_common_fixed_light_product(GLcontext * ctx, slang_program * pro,
+ GLuint off, GLuint i, GLuint a, GLuint d,
+ GLuint s)
{
- GLfloat v[12];
-
- SCALE_4V(v, ctx->Light.Light[off].Ambient, ctx->Light.Material.Attrib[a]);
- SCALE_4V((v + 4), ctx->Light.Light[off].Diffuse, ctx->Light.Material.Attrib[d]);
- SCALE_4V((v + 8), ctx->Light.Light[off].Specular, ctx->Light.Material.Attrib[s]);
- write_common_fixed (pro, i, v, off, 12 * sizeof (GLfloat));
-}
+ GLfloat v[12];
-static GLvoid
-_program_UpdateFixedUniforms (struct gl2_program_intf **intf)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint i;
- GLfloat v[29];
- GLfloat *p;
-
- /* MODELVIEW matrix */
- write_common_fixed_mat4 (pro, ctx->ModelviewMatrixStack.Top, 0,
- SLANG_COMMON_FIXED_MODELVIEWMATRIX,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE);
-
- /* PROJECTION matrix */
- write_common_fixed_mat4 (pro, ctx->ProjectionMatrixStack.Top, 0,
- SLANG_COMMON_FIXED_PROJECTIONMATRIX,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE);
-
- /* MVP matrix */
- write_common_fixed_mat4 (pro, &ctx->_ModelProjectMatrix, 0,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE);
-
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
- {
- /* TEXTURE matrix */
- write_common_fixed_mat4 (pro, ctx->TextureMatrixStack[i].Top, i,
- SLANG_COMMON_FIXED_TEXTUREMATRIX,
- SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
- SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE);
-
- /* EYE_PLANE texture-coordinate generation */
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANES, ctx->Texture.Unit[i].EyePlaneS,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANET, ctx->Texture.Unit[i].EyePlaneT,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANER, ctx->Texture.Unit[i].EyePlaneR,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANEQ, ctx->Texture.Unit[i].EyePlaneQ,
- i, 4 * sizeof (GLfloat));
-
- /* OBJECT_PLANE texture-coordinate generation */
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANES, ctx->Texture.Unit[i].ObjectPlaneS,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANET, ctx->Texture.Unit[i].ObjectPlaneT,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANER, ctx->Texture.Unit[i].ObjectPlaneR,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANEQ, ctx->Texture.Unit[i].ObjectPlaneQ,
- i, 4 * sizeof (GLfloat));
- }
-
- /* NORMAL matrix - upper 3x3 inverse transpose of MODELVIEW matrix */
- p = ctx->ModelviewMatrixStack.Top->inv;
- v[0] = p[0];
- v[1] = p[4];
- v[2] = p[8];
- v[3] = p[1];
- v[4] = p[5];
- v[5] = p[9];
- v[6] = p[2];
- v[7] = p[6];
- v[8] = p[10];
- write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALMATRIX, v, 0, 9 * sizeof (GLfloat));
-
- /* normal scale */
- write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALSCALE, &ctx->_ModelViewInvScale, 0, sizeof (GLfloat));
-
- /* depth range parameters */
- v[0] = ctx->Viewport.Near;
- v[1] = ctx->Viewport.Far;
- v[2] = ctx->Viewport.Far - ctx->Viewport.Near;
- write_common_fixed (pro, SLANG_COMMON_FIXED_DEPTHRANGE, v, 0, 3 * sizeof (GLfloat));
-
- /* CLIP_PLANEi */
- for (i = 0; i < ctx->Const.MaxClipPlanes; i++)
- {
- write_common_fixed (pro, SLANG_COMMON_FIXED_CLIPPLANE, ctx->Transform.EyeUserPlane[i], i,
- 4 * sizeof (GLfloat));
- }
-
- /* point parameters */
- v[0] = ctx->Point.Size;
- v[1] = ctx->Point.MinSize;
- v[2] = ctx->Point.MaxSize;
- v[3] = ctx->Point.Threshold;
- COPY_3FV((v + 4), ctx->Point.Params);
- write_common_fixed (pro, SLANG_COMMON_FIXED_POINT, v, 0, 7 * sizeof (GLfloat));
-
- /* material parameters */
- write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_FRONTMATERIAL,
- MAT_ATTRIB_FRONT_EMISSION,
- MAT_ATTRIB_FRONT_AMBIENT,
- MAT_ATTRIB_FRONT_DIFFUSE,
- MAT_ATTRIB_FRONT_SPECULAR,
- MAT_ATTRIB_FRONT_SHININESS);
- write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_BACKMATERIAL,
- MAT_ATTRIB_BACK_EMISSION,
- MAT_ATTRIB_BACK_AMBIENT,
- MAT_ATTRIB_BACK_DIFFUSE,
- MAT_ATTRIB_BACK_SPECULAR,
- MAT_ATTRIB_BACK_SHININESS);
-
- for (i = 0; i < ctx->Const.MaxLights; i++)
- {
- /* light source parameters */
- COPY_4FV(v, ctx->Light.Light[i].Ambient);
- COPY_4FV((v + 4), ctx->Light.Light[i].Diffuse);
- COPY_4FV((v + 8), ctx->Light.Light[i].Specular);
- COPY_4FV((v + 12), ctx->Light.Light[i].EyePosition);
- COPY_2FV((v + 16), ctx->Light.Light[i].EyePosition);
- v[18] = ctx->Light.Light[i].EyePosition[2] + 1.0f;
- NORMALIZE_3FV((v + 16));
- v[19] = 0.0f;
- COPY_3V((v + 20), ctx->Light.Light[i].EyeDirection);
- v[23] = ctx->Light.Light[i].SpotExponent;
- v[24] = ctx->Light.Light[i].SpotCutoff;
- v[25] = ctx->Light.Light[i]._CosCutoffNeg;
- v[26] = ctx->Light.Light[i].ConstantAttenuation;
- v[27] = ctx->Light.Light[i].LinearAttenuation;
- v[28] = ctx->Light.Light[i].QuadraticAttenuation;
- write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTSOURCE, v, i, 29 * sizeof (GLfloat));
-
- /* light product */
- write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
- MAT_ATTRIB_FRONT_AMBIENT,
- MAT_ATTRIB_FRONT_DIFFUSE,
- MAT_ATTRIB_FRONT_SPECULAR);
- write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
- MAT_ATTRIB_BACK_AMBIENT,
- MAT_ATTRIB_BACK_DIFFUSE,
- MAT_ATTRIB_BACK_SPECULAR);
- }
-
- /* light model parameters */
- write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTMODEL, ctx->Light.Model.Ambient, 0, 4 * sizeof (GLfloat));
-
- /* light model product */
- write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
- MAT_ATTRIB_FRONT_EMISSION,
- MAT_ATTRIB_FRONT_AMBIENT);
- write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
- MAT_ATTRIB_BACK_EMISSION,
- MAT_ATTRIB_BACK_AMBIENT);
-
- /* TEXTURE_ENV_COLOR */
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
- {
- write_common_fixed (pro, SLANG_COMMON_FIXED_TEXTUREENVCOLOR, ctx->Texture.Unit[i].EnvColor,
- i, 4 * sizeof (GLfloat));
- }
-
- /* fog parameters */
- COPY_4FV(v, ctx->Fog.Color);
- v[4] = ctx->Fog.Density;
- v[5] = ctx->Fog.Start;
- v[6] = ctx->Fog.End;
- v[7] = ctx->Fog._Scale;
- write_common_fixed (pro, SLANG_COMMON_FIXED_FOG, v, 0, 8 * sizeof (GLfloat));
+ SCALE_4V(v, ctx->Light.Light[off].Ambient, ctx->Light.Material.Attrib[a]);
+ SCALE_4V((v + 4), ctx->Light.Light[off].Diffuse,
+ ctx->Light.Material.Attrib[d]);
+ SCALE_4V((v + 8), ctx->Light.Light[off].Specular,
+ ctx->Light.Material.Attrib[s]);
+ write_common_fixed(pro, i, v, off, 12 * sizeof(GLfloat));
}
static GLvoid
-_program_UpdateFixedAttrib (struct gl2_program_intf **intf, GLuint index, GLvoid *data,
- GLuint offset, GLuint size, GLboolean write)
+_program_UpdateFixedUniforms(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint addr;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint i;
+ GLfloat v[29];
+ GLfloat *p;
+
+ /* MODELVIEW matrix */
+ write_common_fixed_mat4(pro, ctx->ModelviewMatrixStack.Top, 0,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE);
+
+ /* PROJECTION matrix */
+ write_common_fixed_mat4(pro, ctx->ProjectionMatrixStack.Top, 0,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE);
+
+ /* MVP matrix */
+ write_common_fixed_mat4(pro, &ctx->_ModelProjectMatrix, 0,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE);
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ /* TEXTURE matrix */
+ write_common_fixed_mat4(pro, ctx->TextureMatrixStack[i].Top, i,
+ SLANG_COMMON_FIXED_TEXTUREMATRIX,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE);
+
+ /* EYE_PLANE texture-coordinate generation */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANES,
+ ctx->Texture.Unit[i].EyePlaneS, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANET,
+ ctx->Texture.Unit[i].EyePlaneT, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANER,
+ ctx->Texture.Unit[i].EyePlaneR, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANEQ,
+ ctx->Texture.Unit[i].EyePlaneQ, i,
+ 4 * sizeof(GLfloat));
+
+ /* OBJECT_PLANE texture-coordinate generation */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANES,
+ ctx->Texture.Unit[i].ObjectPlaneS, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANET,
+ ctx->Texture.Unit[i].ObjectPlaneT, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANER,
+ ctx->Texture.Unit[i].ObjectPlaneR, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANEQ,
+ ctx->Texture.Unit[i].ObjectPlaneQ, i,
+ 4 * sizeof(GLfloat));
+ }
+
+ /* NORMAL matrix - upper 3x3 inverse transpose of MODELVIEW matrix */
+ p = ctx->ModelviewMatrixStack.Top->inv;
+ v[0] = p[0];
+ v[1] = p[4];
+ v[2] = p[8];
+ v[3] = p[1];
+ v[4] = p[5];
+ v[5] = p[9];
+ v[6] = p[2];
+ v[7] = p[6];
+ v[8] = p[10];
+ write_common_fixed(pro, SLANG_COMMON_FIXED_NORMALMATRIX, v, 0,
+ 9 * sizeof(GLfloat));
+
+ /* normal scale */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_NORMALSCALE,
+ &ctx->_ModelViewInvScale, 0, sizeof(GLfloat));
+
+ /* depth range parameters */
+ v[0] = ctx->Viewport.Near;
+ v[1] = ctx->Viewport.Far;
+ v[2] = ctx->Viewport.Far - ctx->Viewport.Near;
+ write_common_fixed(pro, SLANG_COMMON_FIXED_DEPTHRANGE, v, 0,
+ 3 * sizeof(GLfloat));
+
+ /* CLIP_PLANEi */
+ for (i = 0; i < ctx->Const.MaxClipPlanes; i++) {
+ write_common_fixed(pro, SLANG_COMMON_FIXED_CLIPPLANE,
+ ctx->Transform.EyeUserPlane[i], i,
+ 4 * sizeof(GLfloat));
+ }
- addr = pro->vertex_fixed_entries[index];
- if (addr != ~0)
- {
- GLubyte *mem;
+ /* point parameters */
+ v[0] = ctx->Point.Size;
+ v[1] = ctx->Point.MinSize;
+ v[2] = ctx->Point.MaxSize;
+ v[3] = ctx->Point.Threshold;
+ COPY_3FV((v + 4), ctx->Point.Params);
+ write_common_fixed(pro, SLANG_COMMON_FIXED_POINT, v, 0,
+ 7 * sizeof(GLfloat));
+
+ /* material parameters */
+ write_common_fixed_material(ctx, pro, SLANG_COMMON_FIXED_FRONTMATERIAL,
+ MAT_ATTRIB_FRONT_EMISSION,
+ MAT_ATTRIB_FRONT_AMBIENT,
+ MAT_ATTRIB_FRONT_DIFFUSE,
+ MAT_ATTRIB_FRONT_SPECULAR,
+ MAT_ATTRIB_FRONT_SHININESS);
+ write_common_fixed_material(ctx, pro, SLANG_COMMON_FIXED_BACKMATERIAL,
+ MAT_ATTRIB_BACK_EMISSION,
+ MAT_ATTRIB_BACK_AMBIENT,
+ MAT_ATTRIB_BACK_DIFFUSE,
+ MAT_ATTRIB_BACK_SPECULAR,
+ MAT_ATTRIB_BACK_SHININESS);
+
+ for (i = 0; i < ctx->Const.MaxLights; i++) {
+ /* light source parameters */
+ COPY_4FV(v, ctx->Light.Light[i].Ambient);
+ COPY_4FV((v + 4), ctx->Light.Light[i].Diffuse);
+ COPY_4FV((v + 8), ctx->Light.Light[i].Specular);
+ COPY_4FV((v + 12), ctx->Light.Light[i].EyePosition);
+ COPY_2FV((v + 16), ctx->Light.Light[i].EyePosition);
+ v[18] = ctx->Light.Light[i].EyePosition[2] + 1.0f;
+ NORMALIZE_3FV((v + 16));
+ v[19] = 0.0f;
+ COPY_3V((v + 20), ctx->Light.Light[i].EyeDirection);
+ v[23] = ctx->Light.Light[i].SpotExponent;
+ v[24] = ctx->Light.Light[i].SpotCutoff;
+ v[25] = ctx->Light.Light[i]._CosCutoffNeg;
+ v[26] = ctx->Light.Light[i].ConstantAttenuation;
+ v[27] = ctx->Light.Light[i].LinearAttenuation;
+ v[28] = ctx->Light.Light[i].QuadraticAttenuation;
+ write_common_fixed(pro, SLANG_COMMON_FIXED_LIGHTSOURCE, v, i,
+ 29 * sizeof(GLfloat));
+
+ /* light product */
+ write_common_fixed_light_product(ctx, pro, i,
+ SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
+ MAT_ATTRIB_FRONT_AMBIENT,
+ MAT_ATTRIB_FRONT_DIFFUSE,
+ MAT_ATTRIB_FRONT_SPECULAR);
+ write_common_fixed_light_product(ctx, pro, i,
+ SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
+ MAT_ATTRIB_BACK_AMBIENT,
+ MAT_ATTRIB_BACK_DIFFUSE,
+ MAT_ATTRIB_BACK_SPECULAR);
+ }
- mem = (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr + offset * size;
- if (write)
- _mesa_memcpy (mem, data, size);
- else
- _mesa_memcpy (data, mem, size);
- }
+ /* light model parameters */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_LIGHTMODEL,
+ ctx->Light.Model.Ambient, 0, 4 * sizeof(GLfloat));
+
+ /* light model product */
+ write_common_fixed_light_model_product(ctx, pro,
+ SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
+ MAT_ATTRIB_FRONT_EMISSION,
+ MAT_ATTRIB_FRONT_AMBIENT);
+ write_common_fixed_light_model_product(ctx, pro,
+ SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
+ MAT_ATTRIB_BACK_EMISSION,
+ MAT_ATTRIB_BACK_AMBIENT);
+
+ /* TEXTURE_ENV_COLOR */
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ write_common_fixed(pro, SLANG_COMMON_FIXED_TEXTUREENVCOLOR,
+ ctx->Texture.Unit[i].EnvColor, i,
+ 4 * sizeof(GLfloat));
+ }
+
+ /* fog parameters */
+ COPY_4FV(v, ctx->Fog.Color);
+ v[4] = ctx->Fog.Density;
+ v[5] = ctx->Fog.Start;
+ v[6] = ctx->Fog.End;
+ v[7] = ctx->Fog._Scale;
+ write_common_fixed(pro, SLANG_COMMON_FIXED_FOG, v, 0, 8 * sizeof(GLfloat));
}
static GLvoid
-_program_UpdateFixedVarying (struct gl2_program_intf **intf, GLuint index, GLvoid *data,
- GLuint offset, GLuint size, GLboolean write)
+_program_UpdateFixedAttrib(struct gl2_program_intf **intf, GLuint index,
+ GLvoid * data, GLuint offset, GLuint size,
+ GLboolean write)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint addr;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ addr = pro->vertex_fixed_entries[index];
+ if (addr != ~0) {
+ GLubyte *mem;
+
+ mem =
+ (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr +
+ offset * size;
+ if (write)
+ _mesa_memcpy(mem, data, size);
+ else
+ _mesa_memcpy(data, mem, size);
+ }
+}
- addr = pro->fragment_fixed_entries[index];
- if (addr != ~0)
- {
- GLubyte *mem;
- mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + offset * size;
- if (write)
- _mesa_memcpy (mem, data, size);
- else
- _mesa_memcpy (data, mem, size);
- }
+/**
+ * Called during fragment shader execution to either load a varying
+ * register with values, or fetch values from a varying register.
+ * \param intf the internal program?
+ * \param index which varying register, one of the SLANG_FRAGMENT_FIXED_*
+ * values for example.
+ * \param data source values to load (or dest to write to)
+ * \param offset indicates a texture unit or generic varying attribute
+ * \param size number of bytes to copy
+ * \param write if true, write to the varying register, else store values
+ * in 'data'
+ */
+static GLvoid
+_program_UpdateFixedVarying(struct gl2_program_intf **intf, GLuint index,
+ GLvoid * data,
+ GLuint offset, GLuint size, GLboolean write)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ addr = pro->fragment_fixed_entries[index];
+ if (addr != ~0) {
+ GLubyte *mem;
+
+ mem =
+ (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr +
+ offset * size;
+ if (write)
+ _mesa_memcpy(mem, data, size);
+ else
+ _mesa_memcpy(data, mem, size);
+ }
}
static GLvoid
-_program_GetTextureImageUsage (struct gl2_program_intf **intf, GLbitfield *teximageusage)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint i;
-
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
- teximageusage[i] = 0;
-
- for (i = 0; i < pro->texture_usage.count; i++)
- {
- GLuint n, addr, j;
-
- n = slang_export_data_quant_elements (pro->texture_usage.table[i].quant);
- addr = pro->texture_usage.table[i].frag_address;
- for (j = 0; j < n; j++)
- {
- GLubyte *mem;
- GLuint image;
-
- mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + j * 4;
- image = (GLuint) *((GLfloat *) mem);
- if (image >= 0 && image < ctx->Const.MaxTextureImageUnits)
- {
- switch (slang_export_data_quant_type (pro->texture_usage.table[i].quant))
- {
- case GL_SAMPLER_1D_ARB:
- case GL_SAMPLER_1D_SHADOW_ARB:
- teximageusage[image] |= TEXTURE_1D_BIT;
- break;
- case GL_SAMPLER_2D_ARB:
- case GL_SAMPLER_2D_SHADOW_ARB:
- teximageusage[image] |= TEXTURE_2D_BIT;
- break;
- case GL_SAMPLER_3D_ARB:
- teximageusage[image] |= TEXTURE_3D_BIT;
- break;
- case GL_SAMPLER_CUBE_ARB:
- teximageusage[image] |= TEXTURE_CUBE_BIT;
- break;
- }
- }
- }
- }
-
- /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */
+_program_GetTextureImageUsage(struct gl2_program_intf **intf,
+ GLbitfield * teximageusage)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint i;
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
+ teximageusage[i] = 0;
+
+ for (i = 0; i < pro->texture_usage.count; i++) {
+ GLuint n, addr, j;
+
+ n = slang_export_data_quant_elements(pro->texture_usage.table[i].quant);
+ addr = pro->texture_usage.table[i].frag_address;
+ for (j = 0; j < n; j++) {
+ GLubyte *mem;
+ GLuint image;
+
+ mem =
+ (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr +
+ j * 4;
+ image = (GLuint) * ((GLfloat *) mem);
+ if (image >= 0 && image < ctx->Const.MaxTextureImageUnits) {
+ switch (slang_export_data_quant_type
+ (pro->texture_usage.table[i].quant)) {
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ teximageusage[image] |= TEXTURE_1D_BIT;
+ break;
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ teximageusage[image] |= TEXTURE_2D_BIT;
+ break;
+ case GL_SAMPLER_3D_ARB:
+ teximageusage[image] |= TEXTURE_3D_BIT;
+ break;
+ case GL_SAMPLER_CUBE_ARB:
+ teximageusage[image] |= TEXTURE_CUBE_BIT;
+ break;
+ }
+ }
+ }
+ }
+
+ /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */
}
static GLboolean
-_program_IsShaderPresent (struct gl2_program_intf **intf, GLenum subtype)
+_program_IsShaderPresent(struct gl2_program_intf **intf, GLenum subtype)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
- switch (subtype)
- {
- case GL_VERTEX_SHADER_ARB:
- return pro->machines[SLANG_SHADER_VERTEX] != NULL;
- case GL_FRAGMENT_SHADER_ARB:
- return pro->machines[SLANG_SHADER_FRAGMENT] != NULL;
- default:
- return GL_FALSE;
- }
+ switch (subtype) {
+ case GL_VERTEX_SHADER_ARB:
+ return pro->machines[SLANG_SHADER_VERTEX] != NULL;
+ case GL_FRAGMENT_SHADER_ARB:
+ return pro->machines[SLANG_SHADER_FRAGMENT] != NULL;
+ default:
+ return GL_FALSE;
+ }
}
static GLvoid
-get_active_variable (slang_active_variable *var, GLsizei maxLength, GLsizei *length, GLint *size,
- GLenum *type, GLchar *name)
+get_active_variable(slang_active_variable * var, GLsizei maxLength,
+ GLsizei * length, GLint * size, GLenum * type,
+ GLchar * name)
{
- GLsizei len;
+ GLsizei len;
- len = _mesa_strlen (var->name);
- if (len >= maxLength)
- len = maxLength - 1;
- if (length != NULL)
- *length = len;
- *size = slang_export_data_quant_elements (var->quant);
- *type = slang_export_data_quant_type (var->quant);
- _mesa_memcpy (name, var->name, len);
- name[len] = '\0';
+ len = _mesa_strlen(var->name);
+ if (len >= maxLength)
+ len = maxLength - 1;
+ if (length != NULL)
+ *length = len;
+ *size = slang_export_data_quant_elements(var->quant);
+ *type = slang_export_data_quant_type(var->quant);
+ _mesa_memcpy(name, var->name, len);
+ name[len] = '\0';
}
static GLuint
-get_active_variable_max_length (slang_active_variables *vars)
+get_active_variable_max_length(slang_active_variables * vars)
{
- GLuint i, len = 0;
+ GLuint i, len = 0;
- for (i = 0; i < vars->count; i++)
- {
- GLuint n = _mesa_strlen (vars->table[i].name);
- if (n > len)
- len = n;
- }
- return len;
+ for (i = 0; i < vars->count; i++) {
+ GLuint n = _mesa_strlen(vars->table[i].name);
+ if (n > len)
+ len = n;
+ }
+ return len;
}
static GLvoid
-_program_GetActiveUniform (struct gl2_program_intf **intf, GLuint index, GLsizei maxLength,
- GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+_program_GetActiveUniform(struct gl2_program_intf **intf, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLchar * name)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_active_variable *u = &impl->_obj.prog.active_uniforms.table[index];
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_active_variable *u = &impl->_obj.prog.active_uniforms.table[index];
- get_active_variable (u, maxLength, length, size, type, name);
+ get_active_variable(u, maxLength, length, size, type, name);
}
static GLuint
-_program_GetActiveUniformMaxLength (struct gl2_program_intf **intf)
+_program_GetActiveUniformMaxLength(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return get_active_variable_max_length (&impl->_obj.prog.active_uniforms);
+ return get_active_variable_max_length(&impl->_obj.prog.active_uniforms);
}
static GLuint
-_program_GetActiveUniformCount (struct gl2_program_intf **intf)
+_program_GetActiveUniformCount(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return impl->_obj.prog.active_uniforms.count;
+ return impl->_obj.prog.active_uniforms.count;
}
static GLint
-_program_GetUniformLocation (struct gl2_program_intf **intf, const GLchar *name)
+_program_GetUniformLocation(struct gl2_program_intf **intf,
+ const GLchar * name)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_uniform_bindings *bind = &impl->_obj.prog.uniforms;
- GLuint i;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_uniform_bindings *bind = &impl->_obj.prog.uniforms;
+ GLuint i;
- for (i = 0; i < bind->count; i++)
- if (_mesa_strcmp (bind->table[i].name, name) == 0)
- return i;
- return -1;
+ for (i = 0; i < bind->count; i++)
+ if (_mesa_strcmp(bind->table[i].name, name) == 0)
+ return i;
+ return -1;
}
+/**
+ * Write a uniform variable into program's memory.
+ * \return GL_TRUE for success, GL_FALSE if error
+ */
static GLboolean
-_program_WriteUniform (struct gl2_program_intf **intf, GLint loc, GLsizei count, const GLvoid *data,
- GLenum type)
-{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms;
- slang_uniform_binding *uniform;
- GLuint i;
- GLboolean convert_float_to_bool = GL_FALSE;
- GLboolean convert_int_to_bool = GL_FALSE;
- GLboolean convert_int_to_float = GL_FALSE;
- GLboolean types_match = GL_FALSE;
-
- if (loc == -1)
- return GL_TRUE;
- if (loc >= uniforms->count)
- return GL_FALSE;
-
- uniform = &uniforms->table[loc];
- /* TODO: check sizes */
- if (slang_export_data_quant_struct (uniform->quant))
- return GL_FALSE;
-
- switch (slang_export_data_quant_type (uniform->quant))
- {
- case GL_BOOL_ARB:
- types_match = (type == GL_FLOAT) || (type == GL_INT);
- if (type == GL_FLOAT)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_BOOL_VEC2_ARB:
- types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);
- if (type == GL_FLOAT_VEC2_ARB)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_BOOL_VEC3_ARB:
- types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);
- if (type == GL_FLOAT_VEC3_ARB)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_BOOL_VEC4_ARB:
- types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);
- if (type == GL_FLOAT_VEC4_ARB)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_SAMPLER_1D_ARB:
- case GL_SAMPLER_2D_ARB:
- case GL_SAMPLER_3D_ARB:
- case GL_SAMPLER_CUBE_ARB:
- case GL_SAMPLER_1D_SHADOW_ARB:
- case GL_SAMPLER_2D_SHADOW_ARB:
- types_match = (type == GL_INT);
- break;
- default:
- types_match = (type == slang_export_data_quant_type (uniform->quant));
- break;
- }
-
- if (!types_match)
- return GL_FALSE;
-
- switch (type)
- {
- case GL_INT:
- case GL_INT_VEC2_ARB:
- case GL_INT_VEC3_ARB:
- case GL_INT_VEC4_ARB:
- convert_int_to_float = GL_TRUE;
- break;
- }
-
- if (convert_float_to_bool)
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- const GLfloat *src = (GLfloat *) (data);
- GLfloat *dst = (GLfloat *)
- (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]);
- GLuint j;
- GLuint total = count * slang_export_data_quant_components (uniform->quant);
-
- for (j = 0; j < total; j++)
- dst[j] = src[j] != 0.0f ? 1.0f : 0.0f;
- }
- }
- else if (convert_int_to_bool)
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- const GLuint *src = (GLuint *) (data);
- GLfloat *dst = (GLfloat *)
- (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]);
- GLuint j;
- GLuint total = count * slang_export_data_quant_components (uniform->quant);
-
- for (j = 0; j < total; j++)
- dst[j] = src[j] ? 1.0f : 0.0f;
- }
- }
- else if (convert_int_to_float)
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- const GLuint *src = (GLuint *) (data);
- GLfloat *dst = (GLfloat *)
- (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]);
- GLuint j;
- GLuint total = count * slang_export_data_quant_components (uniform->quant);
-
- for (j = 0; j < total; j++)
- dst[j] = (GLfloat) src[j];
- }
- }
- else
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- _mesa_memcpy (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4], data,
- count * slang_export_data_quant_size (uniform->quant));
- }
- }
- return GL_TRUE;
+_program_WriteUniform(struct gl2_program_intf **intf, GLint loc,
+ GLsizei count, const GLvoid * data, GLenum type)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms;
+ slang_uniform_binding *uniform;
+ GLuint i;
+ GLboolean convert_float_to_bool = GL_FALSE;
+ GLboolean convert_int_to_bool = GL_FALSE;
+ GLboolean convert_int_to_float = GL_FALSE;
+ GLboolean types_match = GL_FALSE;
+
+ if (loc < 0 || loc >= uniforms->count)
+ return GL_FALSE;
+
+ uniform = &uniforms->table[loc];
+ /* TODO: check sizes */
+ if (slang_export_data_quant_struct(uniform->quant))
+ return GL_FALSE;
+
+ switch (slang_export_data_quant_type(uniform->quant)) {
+ case GL_BOOL_ARB:
+ types_match = (type == GL_FLOAT) || (type == GL_INT);
+ if (type == GL_FLOAT)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC2_ARB:
+ types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);
+ if (type == GL_FLOAT_VEC2_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC3_ARB:
+ types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);
+ if (type == GL_FLOAT_VEC3_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC4_ARB:
+ types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);
+ if (type == GL_FLOAT_VEC4_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ types_match = (type == GL_INT);
+ break;
+ default:
+ types_match = (type == slang_export_data_quant_type(uniform->quant));
+ break;
+ }
+
+ if (!types_match)
+ return GL_FALSE;
+
+ switch (type) {
+ case GL_INT:
+ case GL_INT_VEC2_ARB:
+ case GL_INT_VEC3_ARB:
+ case GL_INT_VEC4_ARB:
+ convert_int_to_float = GL_TRUE;
+ break;
+ }
+
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ if (uniform->address[i] != ~0) {
+ void *dest
+ = &impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4];
+ /* total number of values to copy */
+ GLuint total
+ = count * slang_export_data_quant_components(uniform->quant);
+ GLuint j;
+ if (convert_float_to_bool) {
+ const GLfloat *src = (GLfloat *) (data);
+ GLfloat *dst = (GLfloat *) dest;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] != 0.0f ? 1.0f : 0.0f;
+ break;
+ }
+ else if (convert_int_to_bool) {
+ const GLint *src = (GLint *) (data);
+ GLfloat *dst = (GLfloat *) dest;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] ? 1.0f : 0.0f;
+ break;
+ }
+ else if (convert_int_to_float) {
+ const GLint *src = (GLint *) (data);
+ GLfloat *dst = (GLfloat *) dest;
+ for (j = 0; j < total; j++)
+ dst[j] = (GLfloat) src[j];
+ break;
+ }
+ else {
+ _mesa_memcpy(dest, data, total * sizeof(GLfloat));
+ break;
+ }
+ break;
+ }
+ }
+ return GL_TRUE;
+}
+
+/**
+ * Read a uniform variable from program's memory.
+ * \return GL_TRUE for success, GL_FALSE if error
+ */
+static GLboolean
+_program_ReadUniform(struct gl2_program_intf **intf, GLint loc,
+ GLsizei count, GLvoid *data, GLenum type)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ const slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms;
+ const slang_uniform_binding *uniform;
+ GLuint i;
+ GLboolean convert_bool_to_float = GL_FALSE;
+ GLboolean convert_bool_to_int = GL_FALSE;
+ GLboolean convert_float_to_int = GL_FALSE;
+ GLboolean types_match = GL_FALSE;
+
+ if (loc < 0 || loc >= uniforms->count)
+ return GL_FALSE;
+
+ uniform = &uniforms->table[loc];
+
+ if (slang_export_data_quant_struct(uniform->quant))
+ return GL_FALSE;
+
+ switch (slang_export_data_quant_type(uniform->quant)) {
+ case GL_BOOL_ARB:
+ types_match = (type == GL_FLOAT) || (type == GL_INT);
+ if (type == GL_FLOAT)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_BOOL_VEC2_ARB:
+ types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);
+ if (type == GL_FLOAT_VEC2_ARB)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_BOOL_VEC3_ARB:
+ types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);
+ if (type == GL_FLOAT_VEC3_ARB)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_BOOL_VEC4_ARB:
+ types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);
+ if (type == GL_FLOAT_VEC4_ARB)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ types_match = (type == GL_INT);
+ break;
+ default:
+ /* uniform is a float type */
+ types_match = (type == GL_FLOAT);
+ break;
+ }
+
+ if (!types_match)
+ return GL_FALSE;
+
+ switch (type) {
+ case GL_INT:
+ case GL_INT_VEC2_ARB:
+ case GL_INT_VEC3_ARB:
+ case GL_INT_VEC4_ARB:
+ convert_float_to_int = GL_TRUE;
+ break;
+ }
+
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ if (uniform->address[i] != ~0) {
+ /* XXX if bools are really implemented as floats, some of this
+ * could probably be culled out.
+ */
+ const void *source
+ = &impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4];
+ /* total number of values to copy */
+ const GLuint total
+ = count * slang_export_data_quant_components(uniform->quant);
+ GLuint j;
+ if (convert_bool_to_float) {
+ GLfloat *dst = (GLfloat *) (data);
+ const GLfloat *src = (GLfloat *) source;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] == 0.0 ? 0.0 : 1.0;
+ }
+ else if (convert_bool_to_int) {
+ GLint *dst = (GLint *) (data);
+ const GLfloat *src = (GLfloat *) source;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] == 0.0 ? 0 : 1;
+ }
+ else if (convert_float_to_int) {
+ GLint *dst = (GLint *) (data);
+ const GLfloat *src = (GLfloat *) source;
+ for (j = 0; j < total; j++)
+ dst[j] = (GLint) src[j];
+ }
+ else {
+ /* no type conversion needed */
+ _mesa_memcpy(data, source, total * sizeof(GLfloat));
+ }
+ break;
+ } /* if */
+ } /* for */
+
+ return GL_TRUE;
}
+
static GLvoid
-_program_GetActiveAttrib (struct gl2_program_intf **intf, GLuint index, GLsizei maxLength,
- GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+_program_GetActiveAttrib(struct gl2_program_intf **intf, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLchar * name)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_active_variable *a = &impl->_obj.prog.active_attribs.table[index];
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_active_variable *a = &impl->_obj.prog.active_attribs.table[index];
- get_active_variable (a, maxLength, length, size, type, name);
+ get_active_variable(a, maxLength, length, size, type, name);
}
static GLuint
-_program_GetActiveAttribMaxLength (struct gl2_program_intf **intf)
+_program_GetActiveAttribMaxLength(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return get_active_variable_max_length (&impl->_obj.prog.active_attribs);
+ return get_active_variable_max_length(&impl->_obj.prog.active_attribs);
}
static GLuint
-_program_GetActiveAttribCount (struct gl2_program_intf **intf)
+_program_GetActiveAttribCount(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return impl->_obj.prog.active_attribs.count;
+ return impl->_obj.prog.active_attribs.count;
}
static GLint
-_program_GetAttribLocation (struct gl2_program_intf **intf, const GLchar *name)
+_program_GetAttribLocation(struct gl2_program_intf **intf,
+ const GLchar * name)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_attrib_bindings *attribs = &impl->_obj.prog.attribs;
- GLuint i;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_attrib_bindings *attribs = &impl->_obj.prog.attribs;
+ GLuint i;
- for (i = 0; i < attribs->binding_count; i++)
- if (_mesa_strcmp (attribs->bindings[i].name, name) == 0)
- return attribs->bindings[i].first_slot_index;
- return -1;
+ for (i = 0; i < attribs->binding_count; i++)
+ if (_mesa_strcmp(attribs->bindings[i].name, name) == 0)
+ return attribs->bindings[i].first_slot_index;
+ return -1;
}
static GLvoid
-_program_OverrideAttribBinding (struct gl2_program_intf **intf, GLuint index, const GLchar *name)
+_program_OverrideAttribBinding(struct gl2_program_intf **intf, GLuint index,
+ const GLchar * name)
{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_program *pro = &impl->_obj.prog;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_program *pro = &impl->_obj.prog;
- if (!slang_attrib_overrides_add (&pro->attrib_overrides, index, name))
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "_program_OverrideAttribBinding");
+ if (!_slang_attrib_overrides_add(&pro->attrib_overrides, index, name))
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "_program_OverrideAttribBinding");
}
static GLvoid
-_program_WriteAttrib (struct gl2_program_intf **intf, GLuint index, const GLfloat *value)
+_program_WriteAttrib(struct gl2_program_intf **intf, GLuint index,
+ const GLfloat * value)
{
struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
slang_program *pro = &impl->_obj.prog;
slang_attrib_slot *slot = &pro->attribs.slots[index];
/*
- * Generic attributes can be allocated in a shader with scalar, vec or mat type.
- * For scalar and vec types (specifically float, vec2 and vec3) this is simple - just
- * ignore the extra components. For mat type this is more complicated - the vertex_shader
- * spec requires to store every column of a matrix in a separate attrib slot.
- * To prvent from overwriting data from neighbouring matrix columns, the "fill" information
- * is kept to know how many components to copy.
+ * Generic attributes can be allocated in a shader with scalar, vec
+ * or mat type. For scalar and vec types (specifically float, vec2
+ * and vec3) this is simple - just ignore the extra components. For
+ * mat type this is more complicated - the vertex_shader spec
+ * requires to store every column of a matrix in a separate attrib
+ * slot. To prvent from overwriting data from neighbouring matrix
+ * columns, the "fill" information is kept to know how many
+ * components to copy.
*/
if (slot->addr != ~0)
- _mesa_memcpy (&pro->machines[SLANG_SHADER_VERTEX]->mem[slot->addr / 4]._float, value,
- slot->fill * sizeof (GLfloat));
+ _mesa_memcpy(&pro->machines[SLANG_SHADER_VERTEX]->mem[slot->addr / 4].
+ _float, value, slot->fill * sizeof(GLfloat));
}
static GLvoid
-_program_UpdateVarying (struct gl2_program_intf **intf, GLuint index, GLfloat *value,
- GLboolean vert)
-{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint addr;
-
- if (index >= pro->varyings.slot_count)
- return;
- if (vert)
- addr = pro->varyings.slots[index].vert_addr / 4;
- else
- addr = pro->varyings.slots[index].frag_addr / 4;
- if (addr != ~0)
- {
- if (vert)
- *value = pro->machines[SLANG_SHADER_VERTEX]->mem[addr]._float;
- else
- pro->machines[SLANG_SHADER_FRAGMENT]->mem[addr]._float = *value;
- }
+_program_UpdateVarying(struct gl2_program_intf **intf, GLuint index,
+ GLfloat * value, GLboolean vert)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ if (index >= pro->varyings.slot_count)
+ return;
+ if (vert)
+ addr = pro->varyings.slots[index].vert_addr / 4;
+ else
+ addr = pro->varyings.slots[index].frag_addr / 4;
+ if (addr != ~0) {
+ if (vert)
+ *value = pro->machines[SLANG_SHADER_VERTEX]->mem[addr]._float;
+ else
+ pro->machines[SLANG_SHADER_FRAGMENT]->mem[addr]._float = *value;
+ }
}
static struct gl2_program_intf _program_vftbl = {
- {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _program_QueryInterface
- },
- _generic_Delete,
- _program_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _program_QueryInterface
+ },
+ _generic_Delete,
+ _program_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_generic_GetInfoLog,
_generic_GetInfoLogLength
- },
- _program_Attach,
- _container_Detach,
- _container_GetAttachedCount,
- _container_GetAttached
- },
- _program_GetLinkStatus,
- _program_GetValidateStatus,
- _program_Link,
- _program_Validate,
- _program_UpdateFixedUniforms,
- _program_UpdateFixedAttrib,
- _program_UpdateFixedVarying,
- _program_GetTextureImageUsage,
- _program_IsShaderPresent,
- _program_GetActiveUniform,
- _program_GetActiveUniformMaxLength,
- _program_GetActiveUniformCount,
- _program_GetUniformLocation,
- _program_WriteUniform,
- _program_GetActiveAttrib,
- _program_GetActiveAttribMaxLength,
- _program_GetActiveAttribCount,
- _program_GetAttribLocation,
- _program_OverrideAttribBinding,
+ },
+ _program_Attach,
+ _container_Detach,
+ _container_GetAttachedCount,
+ _container_GetAttached
+ },
+ _program_GetLinkStatus,
+ _program_GetValidateStatus,
+ _program_Link,
+ _program_Validate,
+ _program_UpdateFixedUniforms,
+ _program_UpdateFixedAttrib,
+ _program_UpdateFixedVarying,
+ _program_GetTextureImageUsage,
+ _program_IsShaderPresent,
+ _program_GetActiveUniform,
+ _program_GetActiveUniformMaxLength,
+ _program_GetActiveUniformCount,
+ _program_GetUniformLocation,
+ _program_WriteUniform,
+ _program_ReadUniform,
+ _program_GetActiveAttrib,
+ _program_GetActiveAttribMaxLength,
+ _program_GetActiveAttribCount,
+ _program_GetAttribLocation,
+ _program_OverrideAttribBinding,
_program_WriteAttrib,
- _program_UpdateVarying
+ _program_UpdateVarying
};
static void
-_program_constructor (struct gl2_program_impl *impl)
+_program_constructor(struct gl2_program_impl *impl)
{
- _container_constructor ((struct gl2_container_impl *) impl);
- impl->_vftbl = &_program_vftbl;
- impl->_obj._container._generic._unknown._destructor = _program_destructor;
- impl->_obj.link_status = GL_FALSE;
- impl->_obj.validate_status = GL_FALSE;
+ _container_constructor((struct gl2_container_impl *) impl);
+ impl->_vftbl = &_program_vftbl;
+ impl->_obj._container._generic._unknown._destructor = _program_destructor;
+ impl->_obj.link_status = GL_FALSE;
+ impl->_obj.validate_status = GL_FALSE;
#if USE_3DLABS_FRONTEND
- impl->_obj.linker = ShConstructLinker (EShExVertexFragment, 0);
- impl->_obj.uniforms = ShConstructUniformMap ();
+ impl->_obj.linker = ShConstructLinker(EShExVertexFragment, 0);
+ impl->_obj.uniforms = ShConstructUniformMap();
#endif
- slang_program_ctr (&impl->_obj.prog);
+ _slang_program_ctr(&impl->_obj.prog);
}
struct gl2_fragment_shader_obj
{
- struct gl2_shader_obj _shader;
+ struct gl2_shader_obj _shader;
};
struct gl2_fragment_shader_impl
{
- struct gl2_fragment_shader_intf *_vftbl;
- struct gl2_fragment_shader_obj _obj;
+ struct gl2_fragment_shader_intf *_vftbl;
+ struct gl2_fragment_shader_obj _obj;
};
static void
-_fragment_shader_destructor (struct gl2_unknown_intf **intf)
+_fragment_shader_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_fragment_shader_impl *impl = (struct gl2_fragment_shader_impl *) intf;
+ struct gl2_fragment_shader_impl *impl =
+ (struct gl2_fragment_shader_impl *) intf;
- (void) impl;
- /* TODO free fragment shader data */
+ (void) impl;
+ /* TODO free fragment shader data */
- _shader_destructor (intf);
+ _shader_destructor(intf);
}
static struct gl2_unknown_intf **
-_fragment_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_fragment_shader_QueryInterface(struct gl2_unknown_intf **intf,
+ enum gl2_uiid uiid)
{
- if (uiid == UIID_FRAGMENT_SHADER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _shader_QueryInterface (intf, uiid);
+ if (uiid == UIID_FRAGMENT_SHADER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _shader_QueryInterface(intf, uiid);
}
static GLenum
-_fragment_shader_GetSubType (struct gl2_shader_intf **intf)
+_fragment_shader_GetSubType(struct gl2_shader_intf **intf)
{
- return GL_FRAGMENT_SHADER_ARB;
+ return GL_FRAGMENT_SHADER_ARB;
}
static struct gl2_fragment_shader_intf _fragment_shader_vftbl = {
- {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _fragment_shader_QueryInterface
- },
- _generic_Delete,
- _shader_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _fragment_shader_QueryInterface
+ },
+ _generic_Delete,
+ _shader_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_shader_GetInfoLog,
_shader_GetInfoLogLength
- },
- _fragment_shader_GetSubType,
- _shader_GetCompileStatus,
- _shader_SetSource,
- _shader_GetSource,
- _shader_Compile
- }
+ },
+ _fragment_shader_GetSubType,
+ _shader_GetCompileStatus,
+ _shader_SetSource,
+ _shader_GetSource,
+ _shader_Compile
+ }
};
static void
-_fragment_shader_constructor (struct gl2_fragment_shader_impl *impl)
+_fragment_shader_constructor(struct gl2_fragment_shader_impl *impl)
{
- _shader_constructor ((struct gl2_shader_impl *) impl);
- impl->_vftbl = &_fragment_shader_vftbl;
- impl->_obj._shader._generic._unknown._destructor = _fragment_shader_destructor;
+ _shader_constructor((struct gl2_shader_impl *) impl);
+ impl->_vftbl = &_fragment_shader_vftbl;
+ impl->_obj._shader._generic._unknown._destructor =
+ _fragment_shader_destructor;
#if USE_3DLABS_FRONTEND
- impl->_obj._shader._3dlabs_shhandle._obj.handle = ShConstructCompiler (EShLangFragment, 0);
+ impl->_obj._shader._3dlabs_shhandle._obj.handle =
+ ShConstructCompiler(EShLangFragment, 0);
#endif
}
struct gl2_vertex_shader_obj
{
- struct gl2_shader_obj _shader;
+ struct gl2_shader_obj _shader;
};
struct gl2_vertex_shader_impl
{
- struct gl2_vertex_shader_intf *_vftbl;
- struct gl2_vertex_shader_obj _obj;
+ struct gl2_vertex_shader_intf *_vftbl;
+ struct gl2_vertex_shader_obj _obj;
};
static void
-_vertex_shader_destructor (struct gl2_unknown_intf **intf)
+_vertex_shader_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_vertex_shader_impl *impl = (struct gl2_vertex_shader_impl *) intf;
+ struct gl2_vertex_shader_impl *impl =
+ (struct gl2_vertex_shader_impl *) intf;
- (void) impl;
- /* TODO free vertex shader data */
+ (void) impl;
+ /* TODO free vertex shader data */
- _shader_destructor (intf);
+ _shader_destructor(intf);
}
static struct gl2_unknown_intf **
-_vertex_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_vertex_shader_QueryInterface(struct gl2_unknown_intf **intf,
+ enum gl2_uiid uiid)
{
- if (uiid == UIID_VERTEX_SHADER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _shader_QueryInterface (intf, uiid);
+ if (uiid == UIID_VERTEX_SHADER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _shader_QueryInterface(intf, uiid);
}
static GLenum
-_vertex_shader_GetSubType (struct gl2_shader_intf **intf)
+_vertex_shader_GetSubType(struct gl2_shader_intf **intf)
{
- return GL_VERTEX_SHADER_ARB;
+ return GL_VERTEX_SHADER_ARB;
}
static struct gl2_vertex_shader_intf _vertex_shader_vftbl = {
- {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _vertex_shader_QueryInterface
- },
- _generic_Delete,
- _shader_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _vertex_shader_QueryInterface
+ },
+ _generic_Delete,
+ _shader_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_shader_GetInfoLog,
_shader_GetInfoLogLength
- },
- _vertex_shader_GetSubType,
- _shader_GetCompileStatus,
- _shader_SetSource,
- _shader_GetSource,
- _shader_Compile
- }
+ },
+ _vertex_shader_GetSubType,
+ _shader_GetCompileStatus,
+ _shader_SetSource,
+ _shader_GetSource,
+ _shader_Compile
+ }
};
static void
-_vertex_shader_constructor (struct gl2_vertex_shader_impl *impl)
+_vertex_shader_constructor(struct gl2_vertex_shader_impl *impl)
{
- _shader_constructor ((struct gl2_shader_impl *) impl);
- impl->_vftbl = &_vertex_shader_vftbl;
- impl->_obj._shader._generic._unknown._destructor = _vertex_shader_destructor;
+ _shader_constructor((struct gl2_shader_impl *) impl);
+ impl->_vftbl = &_vertex_shader_vftbl;
+ impl->_obj._shader._generic._unknown._destructor =
+ _vertex_shader_destructor;
#if USE_3DLABS_FRONTEND
- impl->_obj._shader._3dlabs_shhandle._obj.handle = ShConstructCompiler (EShLangVertex, 0);
+ impl->_obj._shader._3dlabs_shhandle._obj.handle =
+ ShConstructCompiler(EShLangVertex, 0);
#endif
}
@@ -1788,34 +1944,35 @@ struct gl2_debug_impl
};
static GLvoid
-_debug_destructor (struct gl2_unknown_intf **intf)
+_debug_destructor(struct gl2_unknown_intf **intf)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
(void) (impl);
/* TODO */
- _generic_destructor (intf);
+ _generic_destructor(intf);
}
static struct gl2_unknown_intf **
-_debug_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_debug_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
if (uiid == UIID_DEBUG) {
- (**intf).AddRef (intf);
+ (**intf).AddRef(intf);
return intf;
}
- return _generic_QueryInterface (intf, uiid);
+ return _generic_QueryInterface(intf, uiid);
}
static GLenum
-_debug_GetType (struct gl2_generic_intf **intf)
+_debug_GetType(struct gl2_generic_intf **intf)
{
- return /*GL_DEBUG_OBJECT_MESA*/0;
+ return /*GL_DEBUG_OBJECT_MESA */ 0;
}
static GLvoid
-_debug_ClearDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType)
+_debug_ClearDebugLog(struct gl2_debug_intf **intf, GLenum logType,
+ GLenum shaderType)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
@@ -1824,8 +1981,9 @@ _debug_ClearDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shade
}
static GLvoid
-_debug_GetDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType,
- GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
+_debug_GetDebugLog(struct gl2_debug_intf **intf, GLenum logType,
+ GLenum shaderType, GLsizei maxLength, GLsizei * length,
+ GLcharARB * infoLog)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
@@ -1834,7 +1992,8 @@ _debug_GetDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderT
}
static GLsizei
-_debug_GetDebugLogLength (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType)
+_debug_GetDebugLogLength(struct gl2_debug_intf **intf, GLenum logType,
+ GLenum shaderType)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
@@ -1864,70 +2023,68 @@ static struct gl2_debug_intf _debug_vftbl = {
};
static GLvoid
-_debug_constructor (struct gl2_debug_impl *impl)
+_debug_constructor(struct gl2_debug_impl *impl)
{
- _generic_constructor ((struct gl2_generic_impl *) (impl));
+ _generic_constructor((struct gl2_generic_impl *) (impl));
impl->_vftbl = &_debug_vftbl;
impl->_obj._generic._unknown._destructor = _debug_destructor;
}
GLhandleARB
-_mesa_3dlabs_create_shader_object (GLenum shaderType)
-{
- switch (shaderType)
- {
- case GL_FRAGMENT_SHADER_ARB:
- {
- struct gl2_fragment_shader_impl *x = (struct gl2_fragment_shader_impl *)
- _mesa_malloc (sizeof (struct gl2_fragment_shader_impl));
-
- if (x != NULL)
- {
- _fragment_shader_constructor (x);
- return x->_obj._shader._generic.name;
- }
- }
- break;
- case GL_VERTEX_SHADER_ARB:
- {
- struct gl2_vertex_shader_impl *x = (struct gl2_vertex_shader_impl *)
- _mesa_malloc (sizeof (struct gl2_vertex_shader_impl));
-
- if (x != NULL)
- {
- _vertex_shader_constructor (x);
- return x->_obj._shader._generic.name;
- }
- }
- break;
- }
-
- return 0;
+_mesa_3dlabs_create_shader_object(GLenum shaderType)
+{
+ switch (shaderType) {
+ case GL_FRAGMENT_SHADER_ARB:
+ {
+ struct gl2_fragment_shader_impl *x =
+ (struct gl2_fragment_shader_impl *)
+ _mesa_malloc(sizeof(struct gl2_fragment_shader_impl));
+
+ if (x != NULL) {
+ _fragment_shader_constructor(x);
+ return x->_obj._shader._generic.name;
+ }
+ }
+ break;
+ case GL_VERTEX_SHADER_ARB:
+ {
+ struct gl2_vertex_shader_impl *x = (struct gl2_vertex_shader_impl *)
+ _mesa_malloc(sizeof(struct gl2_vertex_shader_impl));
+
+ if (x != NULL) {
+ _vertex_shader_constructor(x);
+ return x->_obj._shader._generic.name;
+ }
+ }
+ break;
+ }
+
+ return 0;
}
GLhandleARB
-_mesa_3dlabs_create_program_object (void)
+_mesa_3dlabs_create_program_object(void)
{
- struct gl2_program_impl *x = (struct gl2_program_impl *)
- _mesa_malloc (sizeof (struct gl2_program_impl));
+ struct gl2_program_impl *x = (struct gl2_program_impl *)
+ _mesa_malloc(sizeof(struct gl2_program_impl));
- if (x != NULL)
- {
- _program_constructor (x);
- return x->_obj._container._generic.name;
- }
+ if (x != NULL) {
+ _program_constructor(x);
+ return x->_obj._container._generic.name;
+ }
- return 0;
+ return 0;
}
GLhandleARB
-_mesa_3dlabs_create_debug_object (GLvoid)
+_mesa_3dlabs_create_debug_object(GLvoid)
{
struct gl2_debug_impl *obj;
- obj = (struct gl2_debug_impl *) (_mesa_malloc (sizeof (struct gl2_debug_impl)));
+ obj =
+ (struct gl2_debug_impl *) (_mesa_malloc(sizeof(struct gl2_debug_impl)));
if (obj != NULL) {
- _debug_constructor (obj);
+ _debug_constructor(obj);
return obj->_obj._generic.name;
}
return 0;
@@ -1936,47 +2093,52 @@ _mesa_3dlabs_create_debug_object (GLvoid)
#include "slang_assemble.h"
#include "slang_execute.h"
-int _slang_fetch_discard (struct gl2_program_intf **pro, GLboolean *val)
+int
+_slang_fetch_discard(struct gl2_program_intf **pro, GLboolean * val)
{
- struct gl2_program_impl *impl;
+ struct gl2_program_impl *impl;
- impl = (struct gl2_program_impl *) pro;
- *val = impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]->kill ? GL_TRUE : GL_FALSE;
- return 1;
+ impl = (struct gl2_program_impl *) pro;
+ *val =
+ impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]->
+ kill ? GL_TRUE : GL_FALSE;
+ return 1;
}
-static GLvoid exec_shader (struct gl2_program_intf **pro, GLuint i)
+static GLvoid
+exec_shader(struct gl2_program_intf **pro, GLuint i)
{
- struct gl2_program_impl *impl;
- slang_program *p;
+ struct gl2_program_impl *impl;
+ slang_program *p;
- impl = (struct gl2_program_impl *) pro;
- p = &impl->_obj.prog;
+ impl = (struct gl2_program_impl *) pro;
+ p = &impl->_obj.prog;
- slang_machine_init (p->machines[i]);
- p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN];
+ slang_machine_init(p->machines[i]);
+ p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN];
- _slang_execute2 (p->assemblies[i], p->machines[i]);
+ _slang_execute2(p->assemblies[i], p->machines[i]);
}
-GLvoid _slang_exec_fragment_shader (struct gl2_program_intf **pro)
+GLvoid
+_slang_exec_fragment_shader(struct gl2_program_intf **pro)
{
- exec_shader (pro, SLANG_SHADER_FRAGMENT);
+ exec_shader(pro, SLANG_SHADER_FRAGMENT);
}
-GLvoid _slang_exec_vertex_shader (struct gl2_program_intf **pro)
+GLvoid
+_slang_exec_vertex_shader(struct gl2_program_intf **pro)
{
- exec_shader (pro, SLANG_SHADER_VERTEX);
+ exec_shader(pro, SLANG_SHADER_VERTEX);
}
#endif
void
-_mesa_init_shaderobjects_3dlabs (GLcontext *ctx)
+_mesa_init_shaderobjects_3dlabs(GLcontext * ctx)
{
#if USE_3DLABS_FRONTEND
- _glslang_3dlabs_InitProcess ();
- _glslang_3dlabs_ShInitialize ();
+ _glslang_3dlabs_InitProcess();
+ _glslang_3dlabs_ShInitialize();
#endif
}
-
diff --git a/src/mesa/shader/shaderobjects_3dlabs.h b/src/mesa/shader/shaderobjects_3dlabs.h
index 2092dd923e6..2092dd923e6 100755..100644
--- a/src/mesa/shader/shaderobjects_3dlabs.h
+++ b/src/mesa/shader/shaderobjects_3dlabs.h
diff --git a/src/mesa/shader/slang/Include/BaseTypes.h b/src/mesa/shader/slang/Include/BaseTypes.h
deleted file mode 100755
index c5bf8de17fe..00000000000
--- a/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/src/mesa/shader/slang/Include/Common.h b/src/mesa/shader/slang/Include/Common.h
deleted file mode 100755
index 4a9c0d34a74..00000000000
--- a/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/src/mesa/shader/slang/Include/ConstantUnion.h b/src/mesa/shader/slang/Include/ConstantUnion.h
deleted file mode 100755
index a60ae114f68..00000000000
--- a/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/src/mesa/shader/slang/Include/InfoSink.h b/src/mesa/shader/slang/Include/InfoSink.h
deleted file mode 100755
index 14d44a34adc..00000000000
--- a/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/src/mesa/shader/slang/Include/InitializeGlobals.h b/src/mesa/shader/slang/Include/InitializeGlobals.h
deleted file mode 100755
index 3d9a42a2b5f..00000000000
--- a/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/src/mesa/shader/slang/Include/InitializeParseContext.h b/src/mesa/shader/slang/Include/InitializeParseContext.h
deleted file mode 100755
index 7d565b31321..00000000000
--- a/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/src/mesa/shader/slang/Include/PoolAlloc.h b/src/mesa/shader/slang/Include/PoolAlloc.h
deleted file mode 100755
index e224d3b8676..00000000000
--- a/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/src/mesa/shader/slang/Include/ResourceLimits.h b/src/mesa/shader/slang/Include/ResourceLimits.h
deleted file mode 100755
index ef24244c288..00000000000
--- a/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/src/mesa/shader/slang/Include/ShHandle.h b/src/mesa/shader/slang/Include/ShHandle.h
deleted file mode 100755
index 82c0314f348..00000000000
--- a/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/src/mesa/shader/slang/Include/Types.h b/src/mesa/shader/slang/Include/Types.h
deleted file mode 100755
index 9415879afe3..00000000000
--- a/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/src/mesa/shader/slang/Include/intermediate.h b/src/mesa/shader/slang/Include/intermediate.h
deleted file mode 100755
index 13e22c2749a..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp b/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp
deleted file mode 100755
index e54af8bd9f4..00000000000
--- a/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: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp,v 1.3 2005/03/18 14:30:27 michal 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/src/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp b/src/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp
deleted file mode 100755
index 69aa6087262..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/InfoSink.cpp b/src/mesa/shader/slang/MachineIndependent/InfoSink.cpp
deleted file mode 100755
index 9a1aaa26f9e..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/Initialize.cpp b/src/mesa/shader/slang/MachineIndependent/Initialize.cpp
deleted file mode 100755
index 0913e531afb..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/Initialize.h b/src/mesa/shader/slang/MachineIndependent/Initialize.h
deleted file mode 100755
index b273f06caea..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/IntermTraverse.cpp b/src/mesa/shader/slang/MachineIndependent/IntermTraverse.cpp
deleted file mode 100755
index da77806ddc2..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp b/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp
deleted file mode 100755
index 056fe17de02..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/MMap.h b/src/mesa/shader/slang/MachineIndependent/MMap.h
deleted file mode 100755
index 66703cdd9be..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/ParseHelper.cpp b/src/mesa/shader/slang/MachineIndependent/ParseHelper.cpp
deleted file mode 100755
index cfc42746ae1..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/ParseHelper.h b/src/mesa/shader/slang/MachineIndependent/ParseHelper.h
deleted file mode 100755
index 00552b85548..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp b/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp
deleted file mode 100755
index ba717fce12b..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/QualifierAlive.cpp b/src/mesa/shader/slang/MachineIndependent/QualifierAlive.cpp
deleted file mode 100755
index 2897f48b19c..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/QualifierAlive.h b/src/mesa/shader/slang/MachineIndependent/QualifierAlive.h
deleted file mode 100755
index 73e902cd0dd..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/RemoveTree.cpp b/src/mesa/shader/slang/MachineIndependent/RemoveTree.cpp
deleted file mode 100755
index 2435a485b61..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/RemoveTree.h b/src/mesa/shader/slang/MachineIndependent/RemoveTree.h
deleted file mode 100755
index 171092f1abe..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/ShaderLang.cpp b/src/mesa/shader/slang/MachineIndependent/ShaderLang.cpp
deleted file mode 100755
index 3f37e15f376..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/SymbolTable.cpp b/src/mesa/shader/slang/MachineIndependent/SymbolTable.cpp
deleted file mode 100755
index 0e052c2ea76..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/SymbolTable.h b/src/mesa/shader/slang/MachineIndependent/SymbolTable.h
deleted file mode 100755
index 7e4ff682478..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/glslang.l b/src/mesa/shader/slang/MachineIndependent/glslang.l
deleted file mode 100644
index f6cd3ca6631..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/glslang.y b/src/mesa/shader/slang/MachineIndependent/glslang.y
deleted file mode 100644
index d2dc1db3769..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/glslang_tab.h b/src/mesa/shader/slang/MachineIndependent/glslang_tab.h
deleted file mode 100755
index 97d827fe902..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/intermOut.cpp b/src/mesa/shader/slang/MachineIndependent/intermOut.cpp
deleted file mode 100755
index e75608c45a1..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/localintermediate.h b/src/mesa/shader/slang/MachineIndependent/localintermediate.h
deleted file mode 100755
index 5b4e5ea118f..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/parseConst.cpp b/src/mesa/shader/slang/MachineIndependent/parseConst.cpp
deleted file mode 100755
index 1ea91b3c52d..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.c
deleted file mode 100755
index b409c99bb74..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.h
deleted file mode 100755
index 4e509d6ba4c..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/compile.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/compile.h
deleted file mode 100755
index 24673461e68..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.c
deleted file mode 100755
index f8da59b382c..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.h
deleted file mode 100755
index 03449a17a98..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp_comment_fix.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp_comment_fix.c
deleted file mode 100644
index 0c3073590df..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/cppstruct.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/cppstruct.c
deleted file mode 100755
index c55b3f7c709..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.c
deleted file mode 100755
index ed0f4fb4b93..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.h
deleted file mode 100755
index 89a57e24c9c..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/parser.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/parser.h
deleted file mode 100755
index 5f70bdd1ac7..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/preprocess.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/preprocess.h
deleted file mode 100755
index 63996d6695c..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.c
deleted file mode 100755
index d80e37b8e9b..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.h
deleted file mode 100755
index 15472b5bf18..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/slglobals.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/slglobals.h
deleted file mode 100755
index 667ada6a293..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.c
deleted file mode 100755
index e807fe34346..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.h
deleted file mode 100755
index 65cba9d6c9f..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.c b/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.c
deleted file mode 100755
index 815277db553..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.h b/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.h
deleted file mode 100755
index 0a25bf7c883..00000000000
--- a/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/src/mesa/shader/slang/MachineIndependent/unistd.h b/src/mesa/shader/slang/MachineIndependent/unistd.h
deleted file mode 100755
index efadd63fd9e..00000000000
--- a/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/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.cpp b/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.cpp
deleted file mode 100755
index 2e6f8c69ba7..00000000000
--- a/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/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.h b/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.h
deleted file mode 100755
index 1cfd97eeb32..00000000000
--- a/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/src/mesa/shader/slang/OSDependent/Linux/osinclude.h b/src/mesa/shader/slang/OSDependent/Linux/osinclude.h
deleted file mode 100755
index 8b20b961c05..00000000000
--- a/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/src/mesa/shader/slang/OSDependent/Linux/ossource.cpp b/src/mesa/shader/slang/OSDependent/Linux/ossource.cpp
deleted file mode 100755
index 4bcd66a3151..00000000000
--- a/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/src/mesa/shader/slang/OSDependent/Windows/osinclude.h b/src/mesa/shader/slang/OSDependent/Windows/osinclude.h
deleted file mode 100755
index 97a9e9f3dfb..00000000000
--- a/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/src/mesa/shader/slang/OSDependent/Windows/ossource.cpp b/src/mesa/shader/slang/OSDependent/Windows/ossource.cpp
deleted file mode 100755
index 35d086614c0..00000000000
--- a/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/src/mesa/shader/slang/Public/ShaderLang.h b/src/mesa/shader/slang/Public/ShaderLang.h
deleted file mode 100755
index 34b1688e877..00000000000
--- a/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/src/mesa/shader/slang/Public/ShaderLangExt.h b/src/mesa/shader/slang/Public/ShaderLangExt.h
deleted file mode 100755
index e44b5f99af8..00000000000
--- a/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/src/mesa/shader/slang/library/Makefile b/src/mesa/shader/slang/library/Makefile
new file mode 100644
index 00000000000..92a313d7b0d
--- /dev/null
+++ b/src/mesa/shader/slang/library/Makefile
@@ -0,0 +1,85 @@
+# src/mesa/shader/slang/library/Makefile
+
+TOP = ../../../../..
+
+include $(TOP)/configs/current
+
+INCDIR = $(TOP)/include
+
+LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
+
+#
+# targets
+#
+
+.PHONY: default clean
+
+default: syntax builtin
+
+clean:
+ rm -f syn_to_c gc_to_bin *_syn.h *_gc.h
+
+syntax: slang_pp_directives_syn.h slang_pp_expression_syn.h slang_shader_syn.h slang_pp_version_syn.h
+
+builtin: builtin_110 builtin_120 builtin_vec4
+
+#
+# executables
+#
+
+syn_to_c: syn_to_c.c
+ $(CC) syn_to_c.c -o syn_to_c
+
+gc_to_bin: gc_to_bin.c slang_shader_syn.h
+ $(CC) gc_to_bin.c -o gc_to_bin
+
+#
+# syntax scripts
+#
+
+slang_pp_directives_syn.h: syn_to_c slang_pp_directives.syn
+ ./syn_to_c slang_pp_directives.syn > slang_pp_directives_syn.h
+
+slang_pp_expression_syn.h: syn_to_c slang_pp_expression.syn
+ ./syn_to_c slang_pp_expression.syn > slang_pp_expression_syn.h
+
+slang_shader_syn.h: syn_to_c slang_shader.syn
+ ./syn_to_c slang_shader.syn > slang_shader_syn.h
+
+slang_pp_version_syn.h: syn_to_c slang_pp_version.syn
+ ./syn_to_c slang_pp_version.syn > slang_pp_version_syn.h
+
+#
+# builtin library sources
+#
+
+builtin_110: slang_common_builtin_gc.h slang_core_gc.h slang_fragment_builtin_gc.h slang_vertex_builtin_gc.h
+
+builtin_120: slang_120_core_gc.h slang_builtin_120_common_gc.h slang_builtin_120_fragment_gc.h
+
+builtin_vec4: slang_builtin_vec4_gc.h
+
+slang_120_core_gc.h: gc_to_bin slang_120_core.gc
+ ./gc_to_bin 1 slang_120_core.gc slang_120_core_gc.h
+
+slang_builtin_120_common_gc.h: gc_to_bin slang_builtin_120_common.gc
+ ./gc_to_bin 1 slang_builtin_120_common.gc slang_builtin_120_common_gc.h
+
+slang_builtin_120_fragment_gc.h: gc_to_bin slang_builtin_120_fragment.gc
+ ./gc_to_bin 1 slang_builtin_120_fragment.gc slang_builtin_120_fragment_gc.h
+
+slang_builtin_vec4_gc.h: gc_to_bin slang_builtin_vec4.gc
+ ./gc_to_bin 1 slang_builtin_vec4.gc slang_builtin_vec4_gc.h
+
+slang_common_builtin_gc.h: gc_to_bin slang_common_builtin.gc
+ ./gc_to_bin 1 slang_common_builtin.gc slang_common_builtin_gc.h
+
+slang_core_gc.h: gc_to_bin slang_core.gc
+ ./gc_to_bin 1 slang_core.gc slang_core_gc.h
+
+slang_fragment_builtin_gc.h: gc_to_bin slang_fragment_builtin.gc
+ ./gc_to_bin 1 slang_fragment_builtin.gc slang_fragment_builtin_gc.h
+
+slang_vertex_builtin_gc.h: gc_to_bin slang_vertex_builtin.gc
+ ./gc_to_bin 2 slang_vertex_builtin.gc slang_vertex_builtin_gc.h
+
diff --git a/src/mesa/shader/slang/library/gc_to_bin.c b/src/mesa/shader/slang/library/gc_to_bin.c
index 69895d84bfd..ce9a6541acc 100755..100644
--- a/src/mesa/shader/slang/library/gc_to_bin.c
+++ b/src/mesa/shader/slang/library/gc_to_bin.c
@@ -1,12 +1,13 @@
#include "../../grammar/grammar_crt.h"
#include "../../grammar/grammar_crt.c"
+#include <stdlib.h>
#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)
+static int gc_to_bin (grammar id, const char *in, const char *out)
{
FILE *f;
byte *source, *prod;
@@ -16,7 +17,7 @@ static void gc_to_bin (grammar id, const char *in, const char *out)
f = fopen (in, "r");
if (f == NULL)
- return;
+ return 1;
fseek (f, 0, SEEK_END);
size = ftell (f);
fseek (f, 0, SEEK_SET);
@@ -27,7 +28,7 @@ static void gc_to_bin (grammar id, const char *in, const char *out)
if (!grammar_fast_check (id, source, &prod, &size, 65536))
{
grammar_alloc_free (source);
- return;
+ return 1;
}
f = fopen (out, "w");
@@ -59,29 +60,23 @@ static void gc_to_bin (grammar id, const char *in, const char *out)
fprintf (f, "\n");
fclose (f);
grammar_alloc_free (prod);
+ return 0;
}
-int main ()
+int main (int argc, char *argv[])
{
- 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.h");
- gc_to_bin (id, "slang_common_builtin.gc", "slang_common_builtin_gc.h");
- gc_to_bin (id, "slang_fragment_builtin.gc", "slang_fragment_builtin_gc.h");
- gc_to_bin (id, "slang_builtin_vec4.gc", "slang_builtin_vec4_gc.h");
-
- grammar_set_reg8 (id, (const byte *) "shader_type", 2);
- gc_to_bin (id, "slang_vertex_builtin.gc", "slang_vertex_builtin_gc.h");
-
- grammar_destroy (id);
+ grammar id;
- return 0;
+ 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", atoi (argv[1]));
+ if (gc_to_bin (id, argv[2], argv[3])) {
+ grammar_destroy (id);
+ return 1;
+ }
+ grammar_destroy (id);
+ return 0;
}
diff --git a/src/mesa/shader/slang/library/slang_builtin_120_common.gc b/src/mesa/shader/slang/library/slang_builtin_120_common.gc
index 7e81c83415e..c6264c3b471 100755
--- a/src/mesa/shader/slang/library/slang_builtin_120_common.gc
+++ b/src/mesa/shader/slang/library/slang_builtin_120_common.gc
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2006 Brian Paul All Rights Reserved.
*
@@ -80,7 +80,7 @@ mat4 outerProduct (vec4 c, vec4 r) {
mat2x3 outerProduct (vec3 c, vec2 r) {
return mat2x3 (
- c.x * r.x, c.y * r.x, c.z * r.x
+ c.x * r.x, c.y * r.x, c.z * r.x,
c.x * r.y, c.y * r.y, c.z * r.y
);
}
@@ -105,7 +105,7 @@ mat4x2 outerProduct (vec2 c, vec4 r) {
c.x * r.x, c.y * r.x,
c.x * r.y, c.y * r.y,
c.x * r.z, c.y * r.z,
- c.x * r.w, c.y * r.w,
+ c.x * r.w, c.y * r.w
);
}
diff --git a/src/mesa/shader/slang/library/slang_pp_directives.syn b/src/mesa/shader/slang/library/slang_pp_directives.syn
new file mode 100755
index 00000000000..d4a321034d1
--- /dev/null
+++ b/src/mesa/shader/slang/library/slang_pp_directives.syn
@@ -0,0 +1,385 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.6
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_pp_directives.syn
+ * slang preprocessor directives parser
+ * \author Michal Krol
+ */
+
+.syntax source;
+
+/*
+ * This syntax script preprocesses a GLSL shader.
+ * It is assumed, that the #version directive has been parsed. Separate pass for parsing
+ * version gives better control on behavior depending on the version number given.
+ *
+ * The output is a source string with comments and directives removed. White spaces and comments
+ * are replaced with on or more spaces. All new-lines are preserved and converted to Linux format.
+ * Directives are escaped with a null character. The end of the source string is marked by
+ * two consecutive null characters. The consumer is responsible for executing the escaped
+ * directives, removing dead portions of code and expanding macros.
+ */
+
+.emtcode ESCAPE_TOKEN 0
+
+/*
+ * The TOKEN_* symbols follow the ESCAPE_TOKEN.
+ *
+ * NOTE:
+ * There is no TOKEN_IFDEF and neither is TOKEN_IFNDEF. They are handled with TOKEN_IF and
+ * operator defined.
+ * The "#ifdef SYMBOL" is replaced with "#if defined SYMBOL"
+ * The "#ifndef SYMBOL" is replaced with "#if !defined SYMBOL"
+ */
+.emtcode TOKEN_END 0
+.emtcode TOKEN_DEFINE 1
+.emtcode TOKEN_UNDEF 2
+.emtcode TOKEN_IF 3
+.emtcode TOKEN_ELSE 4
+.emtcode TOKEN_ELIF 5
+.emtcode TOKEN_ENDIF 6
+.emtcode TOKEN_ERROR 7
+.emtcode TOKEN_PRAGMA 8
+.emtcode TOKEN_EXTENSION 9
+.emtcode TOKEN_LINE 10
+
+/*
+ * The PARAM_* symbols follow the TOKEN_DEFINE.
+ */
+.emtcode PARAM_END 0
+.emtcode PARAM_PARAMETER 1
+
+/*
+ * The BEHAVIOR_* symbols follow the TOKEN_EXTENSION.
+ */
+.emtcode BEHAVIOR_REQUIRE 1
+.emtcode BEHAVIOR_ENABLE 2
+.emtcode BEHAVIOR_WARN 3
+.emtcode BEHAVIOR_DISABLE 4
+
+source
+ optional_directive .and .loop source_element .and '\0' .emit ESCAPE_TOKEN .emit TOKEN_END;
+
+source_element
+ c_style_comment_block .or cpp_style_comment_block .or new_line_directive .or source_token;
+
+c_style_comment_block
+ '/' .and '*' .and c_style_comment_rest .and .true .emit ' ';
+
+c_style_comment_rest
+ .loop c_style_comment_body .and c_style_comment_end;
+
+c_style_comment_body
+ c_style_comment_char_nostar .or c_style_comment_char_star_noslashstar;
+
+c_style_comment_char_nostar
+ new_line .or '\x2B'-'\xFF' .or '\x01'-'\x29';
+
+c_style_comment_char_star_noslashstar
+ '*' .and c_style_comment_char_star_noslashstar_1;
+c_style_comment_char_star_noslashstar_1
+ c_style_comment_char_noslashstar .or c_style_comment_char_star_noslashstar;
+
+c_style_comment_char_noslashstar
+ new_line .or '\x30'-'\xFF' .or '\x01'-'\x29' .or '\x2B'-'\x2E';
+
+c_style_comment_end
+ '*' .and .loop c_style_comment_char_star .and '/';
+
+c_style_comment_char_star
+ '*';
+
+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_directive;
+cpp_style_comment_block_3
+ .loop cpp_style_comment_char;
+
+cpp_style_comment_char
+ '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
+
+new_line_directive
+ new_line .and optional_directive;
+
+new_line
+ generic_new_line .emit '\n';
+
+generic_new_line
+ carriage_return_line_feed .or line_feed_carriage_return .or '\n' .or '\r';
+
+carriage_return_line_feed
+ '\r' .and '\n';
+
+line_feed_carriage_return
+ '\n' .and '\r';
+
+optional_directive
+ directive .emit ESCAPE_TOKEN .or .true;
+
+directive
+ dir_define .emit TOKEN_DEFINE .or
+ dir_undef .emit TOKEN_UNDEF .or
+ dir_if .emit TOKEN_IF .or
+ dir_ifdef .emit TOKEN_IF .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' .emit 'd'
+ .emit ' ' .or
+ dir_ifndef .emit TOKEN_IF .emit '!' .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e'
+ .emit 'd' .emit ' ' .or
+ dir_else .emit TOKEN_ELSE .or
+ dir_elif .emit TOKEN_ELIF .or
+ dir_endif .emit TOKEN_ENDIF .or
+ dir_ext .emit TOKEN_EXTENSION .or
+ dir_line .emit TOKEN_LINE;
+
+dir_define
+ optional_space .and '#' .and optional_space .and "define" .and symbol .and opt_parameters .and
+ definition;
+
+dir_undef
+ optional_space .and '#' .and optional_space .and "undef" .and symbol;
+
+dir_if
+ optional_space .and '#' .and optional_space .and "if" .and expression;
+
+dir_ifdef
+ optional_space .and '#' .and optional_space .and "ifdef" .and symbol;
+
+dir_ifndef
+ optional_space .and '#' .and optional_space .and "ifndef" .and symbol;
+
+dir_else
+ optional_space .and '#' .and optional_space .and "else";
+
+dir_elif
+ optional_space .and '#' .and optional_space .and "elif" .and expression;
+
+dir_endif
+ optional_space .and '#' .and optional_space .and "endif";
+
+dir_ext
+ optional_space .and '#' .and optional_space .and "extension" .and space .and extension_name .and
+ optional_space .and ':' .and optional_space .and extension_behavior;
+
+dir_line
+ optional_space .and '#' .and optional_space .and "line" .and expression;
+
+symbol
+ space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0';
+
+opt_parameters
+ parameters .or .true .emit PARAM_END;
+
+parameters
+ '(' .and parameters_1 .and optional_space .and ')' .emit PARAM_END;
+parameters_1
+ parameters_2 .or .true;
+parameters_2
+ parameter .emit PARAM_PARAMETER .and .loop parameters_3;
+parameters_3
+ optional_space .and ',' .and parameter .emit PARAM_PARAMETER;
+
+parameter
+ optional_space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and
+ .true .emit '\0';
+
+definition
+ .loop definition_character .emit * .and .true .emit '\0';
+
+definition_character
+ '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
+
+expression
+ expression_element .and .loop expression_element .and .true .emit '\0';
+
+expression_element
+ expression_character .emit *;
+
+expression_character
+ '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
+
+extension_name
+ symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0';
+
+extension_behavior
+ "require" .emit BEHAVIOR_REQUIRE .or
+ "enable" .emit BEHAVIOR_ENABLE .or
+ "warn" .emit BEHAVIOR_WARN .or
+ "disable" .emit BEHAVIOR_DISABLE;
+
+optional_space
+ .loop single_space;
+
+space
+ single_space .and .loop single_space;
+
+single_space
+ ' ' .or '\t';
+
+source_token
+ space .emit ' ' .or complex_token .or source_token_1;
+source_token_1
+ simple_token .emit ' ' .and .true .emit ' ';
+
+/*
+ * All possible tokens.
+ */
+
+complex_token
+ identifier .or number;
+
+simple_token
+ increment .or decrement .or lequal .or gequal .or equal .or nequal .or and .or xor .or or .or
+ addto .or subtractfrom .or multiplyto .or divideto .or other;
+
+identifier
+ identifier_char1 .emit * .and .loop identifier_char2 .emit *;
+identifier_char1
+ 'a'-'z' .or 'A'-'Z' .or '_';
+identifier_char2
+ 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';
+
+number
+ float .or integer;
+
+digit_oct
+ '0'-'7';
+
+digit_dec
+ '0'-'9';
+
+digit_hex
+ '0'-'9' .or 'A'-'F' .or 'a'-'f';
+
+float
+ float_1 .or float_2;
+float_1
+ float_fractional_constant .and float_optional_exponent_part;
+float_2
+ float_digit_sequence .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 '.' .emit '.' .and float_digit_sequence;
+float_fractional_constant_2
+ float_digit_sequence .and '.' .emit '.';
+float_fractional_constant_3
+ '.' .emit '.' .and float_digit_sequence;
+
+float_optional_exponent_part
+ float_exponent_part .or .true;
+
+float_digit_sequence
+ digit_dec .emit * .and .loop digit_dec .emit *;
+
+float_exponent_part
+ float_exponent_part_1 .or float_exponent_part_2;
+float_exponent_part_1
+ 'e' .emit 'e' .and float_optional_sign .and float_digit_sequence;
+float_exponent_part_2
+ 'E' .emit 'E' .and float_optional_sign .and float_digit_sequence;
+
+float_optional_sign
+ '+' .emit '+' .or '-' .emit '-' .or .true;
+
+integer
+ integer_hex .or integer_oct .or integer_dec;
+
+integer_hex
+ '0' .emit '0' .and integer_hex_1 .emit * .and digit_hex .emit * .and
+ .loop digit_hex .emit *;
+integer_hex_1
+ 'x' .or 'X';
+
+integer_oct
+ '0' .emit '0' .and .loop digit_oct .emit *;
+
+integer_dec
+ digit_dec .emit * .and .loop digit_dec .emit *;
+
+increment
+ '+' .emit * .and '+' .emit *;
+
+decrement
+ '-' .emit * .and '-' .emit *;
+
+lequal
+ '<' .emit * .and '=' .emit *;
+
+gequal
+ '>' .emit * .and '=' .emit *;
+
+equal
+ '=' .emit * .and '=' .emit *;
+
+nequal
+ '!' .emit * .and '=' .emit *;
+
+and
+ '&' .emit * .and '&' .emit *;
+
+xor
+ '^' .emit * .and '^' .emit *;
+
+or
+ '|' .emit * .and '|' .emit *;
+
+addto
+ '+' .emit * .and '=' .emit *;
+
+subtractfrom
+ '-' .emit * .and '=' .emit *;
+
+multiplyto
+ '*' .emit * .and '=' .emit *;
+
+divideto
+ '/' .emit * .and '=' .emit *;
+
+/*
+ * All characters except '\0' and '#'.
+ */
+other
+ '\x24'-'\xFF' .emit * .or '\x01'-'\x22' .emit *;
+
+symbol_character
+ 'A'-'Z' .or 'a'-'z' .or '_';
+
+symbol_character2
+ 'A'-'Z' .or 'a'-'z' .or '0'-'9' .or '_';
+
+.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 '_';
+
diff --git a/src/mesa/shader/slang/library/slang_pp_directives_syn.h b/src/mesa/shader/slang/library/slang_pp_directives_syn.h
new file mode 100644
index 00000000000..35e7bc27616
--- /dev/null
+++ b/src/mesa/shader/slang/library/slang_pp_directives_syn.h
@@ -0,0 +1,239 @@
+
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */
+
+".syntax source;\n"
+".emtcode ESCAPE_TOKEN 0\n"
+".emtcode TOKEN_END 0\n"
+".emtcode TOKEN_DEFINE 1\n"
+".emtcode TOKEN_UNDEF 2\n"
+".emtcode TOKEN_IF 3\n"
+".emtcode TOKEN_ELSE 4\n"
+".emtcode TOKEN_ELIF 5\n"
+".emtcode TOKEN_ENDIF 6\n"
+".emtcode TOKEN_ERROR 7\n"
+".emtcode TOKEN_PRAGMA 8\n"
+".emtcode TOKEN_EXTENSION 9\n"
+".emtcode TOKEN_LINE 10\n"
+".emtcode PARAM_END 0\n"
+".emtcode PARAM_PARAMETER 1\n"
+".emtcode BEHAVIOR_REQUIRE 1\n"
+".emtcode BEHAVIOR_ENABLE 2\n"
+".emtcode BEHAVIOR_WARN 3\n"
+".emtcode BEHAVIOR_DISABLE 4\n"
+"source\n"
+" optional_directive .and .loop source_element .and '\\0' .emit ESCAPE_TOKEN .emit TOKEN_END;\n"
+"source_element\n"
+" c_style_comment_block .or cpp_style_comment_block .or new_line_directive .or source_token;\n"
+"c_style_comment_block\n"
+" '/' .and '*' .and c_style_comment_rest .and .true .emit ' ';\n"
+"c_style_comment_rest\n"
+" .loop c_style_comment_body .and c_style_comment_end;\n"
+"c_style_comment_body\n"
+" c_style_comment_char_nostar .or c_style_comment_char_star_noslashstar;\n"
+"c_style_comment_char_nostar\n"
+" new_line .or '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"
+"c_style_comment_char_star_noslashstar\n"
+" '*' .and c_style_comment_char_star_noslashstar_1;\n"
+"c_style_comment_char_star_noslashstar_1\n"
+" c_style_comment_char_noslashstar .or c_style_comment_char_star_noslashstar;\n"
+"c_style_comment_char_noslashstar\n"
+" new_line .or '\\x30'-'\\xFF' .or '\\x01'-'\\x29' .or '\\x2B'-'\\x2E';\n"
+"c_style_comment_end\n"
+" '*' .and .loop c_style_comment_char_star .and '/';\n"
+"c_style_comment_char_star\n"
+" '*';\n"
+"cpp_style_comment_block\n"
+" '/' .and '/' .and cpp_style_comment_block_1;\n"
+"cpp_style_comment_block_1\n"
+" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"
+"cpp_style_comment_block_2\n"
+" .loop cpp_style_comment_char .and new_line_directive;\n"
+"cpp_style_comment_block_3\n"
+" .loop cpp_style_comment_char;\n"
+"cpp_style_comment_char\n"
+" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
+"new_line_directive\n"
+" new_line .and optional_directive;\n"
+"new_line\n"
+" generic_new_line .emit '\\n';\n"
+"generic_new_line\n"
+" carriage_return_line_feed .or line_feed_carriage_return .or '\\n' .or '\\r';\n"
+"carriage_return_line_feed\n"
+" '\\r' .and '\\n';\n"
+"line_feed_carriage_return\n"
+" '\\n' .and '\\r';\n"
+"optional_directive\n"
+" directive .emit ESCAPE_TOKEN .or .true;\n"
+"directive\n"
+" dir_define .emit TOKEN_DEFINE .or\n"
+" dir_undef .emit TOKEN_UNDEF .or\n"
+" dir_if .emit TOKEN_IF .or\n"
+" dir_ifdef .emit TOKEN_IF .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' .emit 'd'\n"
+" .emit ' ' .or\n"
+" dir_ifndef .emit TOKEN_IF .emit '!' .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e'\n"
+" .emit 'd' .emit ' ' .or\n"
+" dir_else .emit TOKEN_ELSE .or\n"
+" dir_elif .emit TOKEN_ELIF .or\n"
+" dir_endif .emit TOKEN_ENDIF .or\n"
+" dir_ext .emit TOKEN_EXTENSION .or\n"
+" dir_line .emit TOKEN_LINE;\n"
+"dir_define\n"
+" optional_space .and '#' .and optional_space .and \"define\" .and symbol .and opt_parameters .and\n"
+" definition;\n"
+"dir_undef\n"
+" optional_space .and '#' .and optional_space .and \"undef\" .and symbol;\n"
+"dir_if\n"
+" optional_space .and '#' .and optional_space .and \"if\" .and expression;\n"
+"dir_ifdef\n"
+" optional_space .and '#' .and optional_space .and \"ifdef\" .and symbol;\n"
+"dir_ifndef\n"
+" optional_space .and '#' .and optional_space .and \"ifndef\" .and symbol;\n"
+"dir_else\n"
+" optional_space .and '#' .and optional_space .and \"else\";\n"
+"dir_elif\n"
+" optional_space .and '#' .and optional_space .and \"elif\" .and expression;\n"
+"dir_endif\n"
+" optional_space .and '#' .and optional_space .and \"endif\";\n"
+"dir_ext\n"
+" optional_space .and '#' .and optional_space .and \"extension\" .and space .and extension_name .and\n"
+" optional_space .and ':' .and optional_space .and extension_behavior;\n"
+"dir_line\n"
+" optional_space .and '#' .and optional_space .and \"line\" .and expression;\n"
+"symbol\n"
+" space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n"
+"opt_parameters\n"
+" parameters .or .true .emit PARAM_END;\n"
+"parameters\n"
+" '(' .and parameters_1 .and optional_space .and ')' .emit PARAM_END;\n"
+"parameters_1\n"
+" parameters_2 .or .true;\n"
+"parameters_2\n"
+" parameter .emit PARAM_PARAMETER .and .loop parameters_3;\n"
+"parameters_3\n"
+" optional_space .and ',' .and parameter .emit PARAM_PARAMETER;\n"
+"parameter\n"
+" optional_space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and\n"
+" .true .emit '\\0';\n"
+"definition\n"
+" .loop definition_character .emit * .and .true .emit '\\0';\n"
+"definition_character\n"
+" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
+"expression\n"
+" expression_element .and .loop expression_element .and .true .emit '\\0';\n"
+"expression_element\n"
+" expression_character .emit *;\n"
+"expression_character\n"
+" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
+"extension_name\n"
+" symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n"
+"extension_behavior\n"
+" \"require\" .emit BEHAVIOR_REQUIRE .or\n"
+" \"enable\" .emit BEHAVIOR_ENABLE .or\n"
+" \"warn\" .emit BEHAVIOR_WARN .or\n"
+" \"disable\" .emit BEHAVIOR_DISABLE;\n"
+"optional_space\n"
+" .loop single_space;\n"
+"space\n"
+" single_space .and .loop single_space;\n"
+"single_space\n"
+" ' ' .or '\\t';\n"
+"source_token\n"
+" space .emit ' ' .or complex_token .or source_token_1;\n"
+"source_token_1\n"
+" simple_token .emit ' ' .and .true .emit ' ';\n"
+"complex_token\n"
+" identifier .or number;\n"
+"simple_token\n"
+" increment .or decrement .or lequal .or gequal .or equal .or nequal .or and .or xor .or or .or\n"
+" addto .or subtractfrom .or multiplyto .or divideto .or other;\n"
+"identifier\n"
+" identifier_char1 .emit * .and .loop identifier_char2 .emit *;\n"
+"identifier_char1\n"
+" 'a'-'z' .or 'A'-'Z' .or '_';\n"
+"identifier_char2\n"
+" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n"
+"number\n"
+" float .or integer;\n"
+"digit_oct\n"
+" '0'-'7';\n"
+"digit_dec\n"
+" '0'-'9';\n"
+"digit_hex\n"
+" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n"
+"float\n"
+" float_1 .or float_2;\n"
+"float_1\n"
+" float_fractional_constant .and float_optional_exponent_part;\n"
+"float_2\n"
+" float_digit_sequence .and float_exponent_part;\n"
+"float_fractional_constant\n"
+" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n"
+"float_fractional_constant_1\n"
+" float_digit_sequence .and '.' .emit '.' .and float_digit_sequence;\n"
+"float_fractional_constant_2\n"
+" float_digit_sequence .and '.' .emit '.';\n"
+"float_fractional_constant_3\n"
+" '.' .emit '.' .and float_digit_sequence;\n"
+"float_optional_exponent_part\n"
+" float_exponent_part .or .true;\n"
+"float_digit_sequence\n"
+" digit_dec .emit * .and .loop digit_dec .emit *;\n"
+"float_exponent_part\n"
+" float_exponent_part_1 .or float_exponent_part_2;\n"
+"float_exponent_part_1\n"
+" 'e' .emit 'e' .and float_optional_sign .and float_digit_sequence;\n"
+"float_exponent_part_2\n"
+" 'E' .emit 'E' .and float_optional_sign .and float_digit_sequence;\n"
+"float_optional_sign\n"
+" '+' .emit '+' .or '-' .emit '-' .or .true;\n"
+"integer\n"
+" integer_hex .or integer_oct .or integer_dec;\n"
+"integer_hex\n"
+" '0' .emit '0' .and integer_hex_1 .emit * .and digit_hex .emit * .and\n"
+" .loop digit_hex .emit *;\n"
+"integer_hex_1\n"
+" 'x' .or 'X';\n"
+"integer_oct\n"
+" '0' .emit '0' .and .loop digit_oct .emit *;\n"
+"integer_dec\n"
+" digit_dec .emit * .and .loop digit_dec .emit *;\n"
+"increment\n"
+" '+' .emit * .and '+' .emit *;\n"
+"decrement\n"
+" '-' .emit * .and '-' .emit *;\n"
+"lequal\n"
+" '<' .emit * .and '=' .emit *;\n"
+"gequal\n"
+" '>' .emit * .and '=' .emit *;\n"
+"equal\n"
+" '=' .emit * .and '=' .emit *;\n"
+"nequal\n"
+" '!' .emit * .and '=' .emit *;\n"
+"and\n"
+" '&' .emit * .and '&' .emit *;\n"
+"xor\n"
+" '^' .emit * .and '^' .emit *;\n"
+"or\n"
+" '|' .emit * .and '|' .emit *;\n"
+"addto\n"
+" '+' .emit * .and '=' .emit *;\n"
+"subtractfrom\n"
+" '-' .emit * .and '=' .emit *;\n"
+"multiplyto\n"
+" '*' .emit * .and '=' .emit *;\n"
+"divideto\n"
+" '/' .emit * .and '=' .emit *;\n"
+"other\n"
+" '\\x24'-'\\xFF' .emit * .or '\\x01'-'\\x22' .emit *;\n"
+"symbol_character\n"
+" 'A'-'Z' .or 'a'-'z' .or '_';\n"
+"symbol_character2\n"
+" 'A'-'Z' .or 'a'-'z' .or '0'-'9' .or '_';\n"
+".string string_lexer;\n"
+"string_lexer\n"
+" lex_first_identifier_character .and .loop lex_next_identifier_character;\n"
+"lex_first_identifier_character\n"
+" 'a'-'z' .or 'A'-'Z' .or '_';\n"
+"lex_next_identifier_character\n"
+" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n"
+""
diff --git a/src/mesa/shader/slang/library/slang_pp_expression.syn b/src/mesa/shader/slang/library/slang_pp_expression.syn
new file mode 100755
index 00000000000..bfdb220bf5c
--- /dev/null
+++ b/src/mesa/shader/slang/library/slang_pp_expression.syn
@@ -0,0 +1,265 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.6
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_pp_expression.syn
+ * slang preprocessor expression parser
+ * \author Michal Krol
+ */
+
+/*
+ * Parses one or two (optional) expressions on literal integer constants. Those expressions come
+ * from #if #elif and #line directives. The preprocessor already parsed those directives and
+ * expanded the expression (expressions). All occurences of the operator "defined" are already
+ * replaced with either "0" or "1" literals.
+ */
+
+.syntax expression;
+
+/*
+ * Those separate individual expressions.
+ * For #if/#elif case it is: EXP_EXPRESSION ... EXP_END
+ * For #line case it may be: EXP_EXPRESSION ... EXP_EXPRESSION ... EXP_END
+ */
+.emtcode EXP_END 0
+.emtcode EXP_EXPRESSION 1
+
+.emtcode OP_END 0
+.emtcode OP_PUSHINT 1
+.emtcode OP_LOGICALOR 2
+.emtcode OP_LOGICALAND 3
+.emtcode OP_OR 4
+.emtcode OP_XOR 5
+.emtcode OP_AND 6
+.emtcode OP_EQUAL 7
+.emtcode OP_NOTEQUAL 8
+.emtcode OP_LESSEQUAL 9
+.emtcode OP_GREATEREQUAL 10
+.emtcode OP_LESS 11
+.emtcode OP_GREATER 12
+.emtcode OP_LEFTSHIFT 13
+.emtcode OP_RIGHTSHIFT 14
+.emtcode OP_ADD 15
+.emtcode OP_SUBTRACT 16
+.emtcode OP_MULTIPLY 17
+.emtcode OP_DIVIDE 18
+.emtcode OP_MODULUS 19
+.emtcode OP_PLUS 20
+.emtcode OP_MINUS 21
+.emtcode OP_NEGATE 22
+.emtcode OP_COMPLEMENT 23
+
+expression
+ first_expression .and optional_second_expression .and optional_space .and '\0' .emit EXP_END;
+
+first_expression
+ optional_space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;
+
+optional_second_expression
+ second_expression .or .true;
+
+second_expression
+ space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;
+
+logical_or_expression
+ logical_and_expression .and .loop logical_or_expression_1;
+logical_or_expression_1
+ barbar .and logical_and_expression .and .true .emit OP_LOGICALOR;
+
+logical_and_expression
+ or_expression .and .loop logical_and_expression_1;
+logical_and_expression_1
+ ampersandampersand .and or_expression .and .true .emit OP_LOGICALAND;
+
+or_expression
+ xor_expression .and .loop or_expression_1;
+or_expression_1
+ bar .and xor_expression .and .true .emit OP_OR;
+
+xor_expression
+ and_expression .and .loop xor_expression_1;
+xor_expression_1
+ caret .and and_expression .and .true .emit OP_XOR;
+
+and_expression
+ equality_expression .and .loop and_expression_1;
+and_expression_1
+ ampersand .and equality_expression .and .true .emit OP_AND;
+
+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;
+
+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;
+
+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_LEFTSHIFT;
+shift_expression_3
+ greatergreater .and additive_expression .and .true .emit OP_RIGHTSHIFT;
+
+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
+ dash .and multiplicative_expression .and .true .emit OP_SUBTRACT;
+
+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;
+
+unary_expression
+ primary_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or
+ unary_expression_4;
+unary_expression_1
+ plus .and unary_expression .and .true .emit OP_PLUS;
+unary_expression_2
+ dash .and unary_expression .and .true .emit OP_MINUS;
+unary_expression_3
+ bang .and unary_expression .and .true .emit OP_NEGATE;
+unary_expression_4
+ tilda .and unary_expression .and .true .emit OP_COMPLEMENT;
+
+primary_expression
+ intconstant .or primary_expression_1;
+primary_expression_1
+ lparen .and logical_or_expression .and rparen;
+
+intconstant
+ integer .emit OP_PUSHINT;
+
+integer
+ integer_dec;
+
+integer_dec
+ digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0';
+
+digit_dec
+ '0'-'9';
+
+optional_space
+ .loop single_space;
+
+space
+ single_space .and .loop single_space;
+
+single_space
+ ' ' .or '\t';
+
+ampersand
+ optional_space .and '&' .and optional_space;
+
+ampersandampersand
+ optional_space .and '&' .and '&' .and optional_space;
+
+bang
+ optional_space .and '!' .and optional_space;
+
+bangequals
+ optional_space .and '!' .and '=' .and optional_space;
+
+bar
+ optional_space .and '|' .and optional_space;
+
+barbar
+ optional_space .and '|' .and '|' .and optional_space;
+
+caret
+ optional_space .and '^' .and optional_space;
+
+dash
+ 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;
+
+less
+ optional_space .and '<' .and optional_space;
+
+lessequals
+ optional_space .and '<' .and '=' .and optional_space;
+
+lessless
+ optional_space .and '<' .and '<' .and optional_space;
+
+lparen
+ optional_space .and '(' .and optional_space;
+
+percent
+ optional_space .and '%' .and optional_space;
+
+plus
+ optional_space .and '+' .and optional_space;
+
+rparen
+ optional_space .and ')' .and optional_space;
+
+slash
+ optional_space .and '/' .and optional_space;
+
+star
+ optional_space .and '*' .and optional_space;
+
+tilda
+ optional_space .and '~' .and optional_space;
+
diff --git a/src/mesa/shader/slang/library/slang_pp_expression_syn.h b/src/mesa/shader/slang/library/slang_pp_expression_syn.h
new file mode 100644
index 00000000000..f3e9ef6b229
--- /dev/null
+++ b/src/mesa/shader/slang/library/slang_pp_expression_syn.h
@@ -0,0 +1,179 @@
+
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */
+
+".syntax expression;\n"
+".emtcode EXP_END 0\n"
+".emtcode EXP_EXPRESSION 1\n"
+".emtcode OP_END 0\n"
+".emtcode OP_PUSHINT 1\n"
+".emtcode OP_LOGICALOR 2\n"
+".emtcode OP_LOGICALAND 3\n"
+".emtcode OP_OR 4\n"
+".emtcode OP_XOR 5\n"
+".emtcode OP_AND 6\n"
+".emtcode OP_EQUAL 7\n"
+".emtcode OP_NOTEQUAL 8\n"
+".emtcode OP_LESSEQUAL 9\n"
+".emtcode OP_GREATEREQUAL 10\n"
+".emtcode OP_LESS 11\n"
+".emtcode OP_GREATER 12\n"
+".emtcode OP_LEFTSHIFT 13\n"
+".emtcode OP_RIGHTSHIFT 14\n"
+".emtcode OP_ADD 15\n"
+".emtcode OP_SUBTRACT 16\n"
+".emtcode OP_MULTIPLY 17\n"
+".emtcode OP_DIVIDE 18\n"
+".emtcode OP_MODULUS 19\n"
+".emtcode OP_PLUS 20\n"
+".emtcode OP_MINUS 21\n"
+".emtcode OP_NEGATE 22\n"
+".emtcode OP_COMPLEMENT 23\n"
+"expression\n"
+" first_expression .and optional_second_expression .and optional_space .and '\\0' .emit EXP_END;\n"
+"first_expression\n"
+" optional_space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n"
+"optional_second_expression\n"
+" second_expression .or .true;\n"
+"second_expression\n"
+" space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n"
+"logical_or_expression\n"
+" logical_and_expression .and .loop logical_or_expression_1;\n"
+"logical_or_expression_1\n"
+" barbar .and logical_and_expression .and .true .emit OP_LOGICALOR;\n"
+"logical_and_expression\n"
+" or_expression .and .loop logical_and_expression_1;\n"
+"logical_and_expression_1\n"
+" ampersandampersand .and or_expression .and .true .emit OP_LOGICALAND;\n"
+"or_expression\n"
+" xor_expression .and .loop or_expression_1;\n"
+"or_expression_1\n"
+" bar .and xor_expression .and .true .emit OP_OR;\n"
+"xor_expression\n"
+" and_expression .and .loop xor_expression_1;\n"
+"xor_expression_1\n"
+" caret .and and_expression .and .true .emit OP_XOR;\n"
+"and_expression\n"
+" equality_expression .and .loop and_expression_1;\n"
+"and_expression_1\n"
+" ampersand .and equality_expression .and .true .emit OP_AND;\n"
+"equality_expression\n"
+" relational_expression .and .loop equality_expression_1;\n"
+"equality_expression_1\n"
+" equality_expression_2 .or equality_expression_3;\n"
+"equality_expression_2\n"
+" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n"
+"equality_expression_3\n"
+" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n"
+"relational_expression\n"
+" shift_expression .and .loop relational_expression_1;\n"
+"relational_expression_1\n"
+" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n"
+" relational_expression_5;\n"
+"relational_expression_2\n"
+" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n"
+"relational_expression_3\n"
+" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n"
+"relational_expression_4\n"
+" less .and shift_expression .and .true .emit OP_LESS;\n"
+"relational_expression_5\n"
+" greater .and shift_expression .and .true .emit OP_GREATER;\n"
+"shift_expression\n"
+" additive_expression .and .loop shift_expression_1;\n"
+"shift_expression_1\n"
+" shift_expression_2 .or shift_expression_3;\n"
+"shift_expression_2\n"
+" lessless .and additive_expression .and .true .emit OP_LEFTSHIFT;\n"
+"shift_expression_3\n"
+" greatergreater .and additive_expression .and .true .emit OP_RIGHTSHIFT;\n"
+"additive_expression\n"
+" multiplicative_expression .and .loop additive_expression_1;\n"
+"additive_expression_1\n"
+" additive_expression_2 .or additive_expression_3;\n"
+"additive_expression_2\n"
+" plus .and multiplicative_expression .and .true .emit OP_ADD;\n"
+"additive_expression_3\n"
+" dash .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n"
+"multiplicative_expression\n"
+" unary_expression .and .loop multiplicative_expression_1;\n"
+"multiplicative_expression_1\n"
+" multiplicative_expression_2 .or multiplicative_expression_3 .or multiplicative_expression_4;\n"
+"multiplicative_expression_2\n"
+" star .and unary_expression .and .true .emit OP_MULTIPLY;\n"
+"multiplicative_expression_3\n"
+" slash .and unary_expression .and .true .emit OP_DIVIDE;\n"
+"multiplicative_expression_4\n"
+" percent .and unary_expression .and .true .emit OP_MODULUS;\n"
+"unary_expression\n"
+" primary_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n"
+" unary_expression_4;\n"
+"unary_expression_1\n"
+" plus .and unary_expression .and .true .emit OP_PLUS;\n"
+"unary_expression_2\n"
+" dash .and unary_expression .and .true .emit OP_MINUS;\n"
+"unary_expression_3\n"
+" bang .and unary_expression .and .true .emit OP_NEGATE;\n"
+"unary_expression_4\n"
+" tilda .and unary_expression .and .true .emit OP_COMPLEMENT;\n"
+"primary_expression\n"
+" intconstant .or primary_expression_1;\n"
+"primary_expression_1\n"
+" lparen .and logical_or_expression .and rparen;\n"
+"intconstant\n"
+" integer .emit OP_PUSHINT;\n"
+"integer\n"
+" integer_dec;\n"
+"integer_dec\n"
+" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n"
+"digit_dec\n"
+" '0'-'9';\n"
+"optional_space\n"
+" .loop single_space;\n"
+"space\n"
+" single_space .and .loop single_space;\n"
+"single_space\n"
+" ' ' .or '\\t';\n"
+"ampersand\n"
+" optional_space .and '&' .and optional_space;\n"
+"ampersandampersand\n"
+" optional_space .and '&' .and '&' .and optional_space;\n"
+"bang\n"
+" optional_space .and '!' .and optional_space;\n"
+"bangequals\n"
+" optional_space .and '!' .and '=' .and optional_space;\n"
+"bar\n"
+" optional_space .and '|' .and optional_space;\n"
+"barbar\n"
+" optional_space .and '|' .and '|' .and optional_space;\n"
+"caret\n"
+" optional_space .and '^' .and optional_space;\n"
+"dash\n"
+" optional_space .and '-' .and optional_space;\n"
+"equalsequals\n"
+" optional_space .and '=' .and '=' .and optional_space;\n"
+"greater\n"
+" optional_space .and '>' .and optional_space;\n"
+"greaterequals\n"
+" optional_space .and '>' .and '=' .and optional_space;\n"
+"greatergreater\n"
+" optional_space .and '>' .and '>' .and optional_space;\n"
+"less\n"
+" optional_space .and '<' .and optional_space;\n"
+"lessequals\n"
+" optional_space .and '<' .and '=' .and optional_space;\n"
+"lessless\n"
+" optional_space .and '<' .and '<' .and optional_space;\n"
+"lparen\n"
+" optional_space .and '(' .and optional_space;\n"
+"percent\n"
+" optional_space .and '%' .and optional_space;\n"
+"plus\n"
+" optional_space .and '+' .and optional_space;\n"
+"rparen\n"
+" optional_space .and ')' .and optional_space;\n"
+"slash\n"
+" optional_space .and '/' .and optional_space;\n"
+"star\n"
+" optional_space .and '*' .and optional_space;\n"
+"tilda\n"
+" optional_space .and '~' .and optional_space;\n"
+""
diff --git a/src/mesa/shader/slang/library/slang_pp_version.syn b/src/mesa/shader/slang/library/slang_pp_version.syn
index f48f3ddf0ba..d5e9317b5d4 100644
--- a/src/mesa/shader/slang/library/slang_pp_version.syn
+++ b/src/mesa/shader/slang/library/slang_pp_version.syn
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -23,7 +23,7 @@
*/
/**
- * \file slang_version.syn
+ * \file slang_pp_version.syn
* slang #version directive syntax
* \author Michal Krol
*/
diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h
index f08c329303c..ad89472ba3b 100644
--- a/src/mesa/shader/slang/library/slang_shader_syn.h
+++ b/src/mesa/shader/slang/library/slang_shader_syn.h
@@ -1,3 +1,6 @@
+
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */
+
".syntax translation_unit;\n"
".emtcode REVISION 3\n"
".emtcode EXTERNAL_NULL 0\n"
diff --git a/src/mesa/shader/slang/library/slang_version_syn.h b/src/mesa/shader/slang/library/slang_version_syn.h
index 3b94d85927a..3b94d85927a 100755..100644
--- a/src/mesa/shader/slang/library/slang_version_syn.h
+++ b/src/mesa/shader/slang/library/slang_version_syn.h
diff --git a/src/mesa/shader/slang/slang_analyse.c b/src/mesa/shader/slang/slang_analyse.c
index 7a38dbbcbb5..fe48a670eeb 100644
--- a/src/mesa/shader/slang/slang_analyse.c
+++ b/src/mesa/shader/slang/slang_analyse.c
@@ -36,8 +36,8 @@ GLboolean _slang_analyse_texture_usage (slang_program *prog)
{
GLuint i, count = 0;
- slang_texture_usages_dtr (&prog->texture_usage);
- slang_texture_usages_ctr (&prog->texture_usage);
+ _slang_texture_usages_dtr (&prog->texture_usage);
+ _slang_texture_usages_ctr (&prog->texture_usage);
/*
* We could do a full code analysis to find out which uniforms are actually used.
diff --git a/src/mesa/shader/slang/slang_assemble.c b/src/mesa/shader/slang/slang_assemble.c
index 36fb2305f68..0cba5d5d007 100644
--- a/src/mesa/shader/slang/slang_assemble.c
+++ b/src/mesa/shader/slang/slang_assemble.c
@@ -35,13 +35,15 @@
/* slang_assembly */
-static GLboolean slang_assembly_construct (slang_assembly *assem)
+static GLboolean
+slang_assembly_construct(slang_assembly * assem)
{
- assem->type = slang_asm_none;
- return GL_TRUE;
+ assem->type = slang_asm_none;
+ return GL_TRUE;
}
-static GLvoid slang_assembly_destruct (slang_assembly *assem)
+static GLvoid
+slang_assembly_destruct(slang_assembly * assem)
{
}
@@ -50,80 +52,89 @@ static GLvoid slang_assembly_destruct (slang_assembly *assem)
*/
GLvoid
-_slang_assembly_file_ctr (slang_assembly_file *self)
+_slang_assembly_file_ctr(slang_assembly_file * self)
{
self->code = NULL;
self->count = 0;
self->capacity = 0;
}
-GLvoid slang_assembly_file_destruct (slang_assembly_file *file)
+GLvoid
+slang_assembly_file_destruct(slang_assembly_file * file)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < file->count; i++)
- slang_assembly_destruct (&file->code[i]);
- slang_alloc_free (file->code);
+ for (i = 0; i < file->count; i++)
+ slang_assembly_destruct(&file->code[i]);
+ slang_alloc_free(file->code);
}
-static GLboolean push_new (slang_assembly_file *file)
+static GLboolean
+push_new(slang_assembly_file * file)
{
- if (file->count == file->capacity)
- {
- GLuint n;
-
- if (file->capacity == 0)
- n = 256;
- else
- n = file->capacity * 2;
- file->code = (slang_assembly *) slang_alloc_realloc (file->code,
- file->capacity * sizeof (slang_assembly), n * sizeof (slang_assembly));
- if (file->code == NULL)
- return GL_FALSE;
- file->capacity = n;
- }
- if (!slang_assembly_construct (&file->code[file->count]))
- return GL_FALSE;
- file->count++;
- return GL_TRUE;
+ if (file->count == file->capacity) {
+ GLuint n;
+
+ if (file->capacity == 0)
+ n = 256;
+ else
+ n = file->capacity * 2;
+ file->code = (slang_assembly *)
+ slang_alloc_realloc(file->code,
+ file->capacity * sizeof(slang_assembly),
+ n * sizeof(slang_assembly));
+ if (file->code == NULL)
+ return GL_FALSE;
+ file->capacity = n;
+ }
+ if (!slang_assembly_construct(&file->code[file->count]))
+ return GL_FALSE;
+ file->count++;
+ return GL_TRUE;
}
-static GLboolean push_gen (slang_assembly_file *file, slang_assembly_type type, GLfloat literal,
- GLuint label, GLuint size)
+static GLboolean
+push_gen(slang_assembly_file * file, slang_assembly_type type,
+ GLfloat literal, GLuint label, GLuint size)
{
- slang_assembly *assem;
-
- if (!push_new (file))
- return GL_FALSE;
- assem = &file->code[file->count - 1];
- assem->type = type;
- assem->literal = literal;
- assem->param[0] = label;
- assem->param[1] = size;
- return GL_TRUE;
+ slang_assembly *assem;
+
+ if (!push_new(file))
+ return GL_FALSE;
+ assem = &file->code[file->count - 1];
+ assem->type = type;
+ assem->literal = literal;
+ assem->param[0] = label;
+ assem->param[1] = size;
+ return GL_TRUE;
}
-GLboolean slang_assembly_file_push (slang_assembly_file *file, slang_assembly_type type)
+GLboolean
+slang_assembly_file_push(slang_assembly_file * file, slang_assembly_type type)
{
- return push_gen (file, type, (GLfloat) 0, 0, 0);
+ return push_gen(file, type, (GLfloat) 0, 0, 0);
}
-GLboolean slang_assembly_file_push_label (slang_assembly_file *file, slang_assembly_type type,
- GLuint label)
+GLboolean
+slang_assembly_file_push_label(slang_assembly_file * file,
+ slang_assembly_type type, GLuint label)
{
- return push_gen (file, type, (GLfloat) 0, label, 0);
+ return push_gen(file, type, (GLfloat) 0, label, 0);
}
-GLboolean slang_assembly_file_push_label2 (slang_assembly_file *file, slang_assembly_type type,
- GLuint label1, GLuint label2)
+GLboolean
+slang_assembly_file_push_label2(slang_assembly_file * file,
+ slang_assembly_type type, GLuint label1,
+ GLuint label2)
{
- return push_gen (file, type, (GLfloat) 0, label1, label2);
+ return push_gen(file, type, (GLfloat) 0, label1, label2);
}
-GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_assembly_type type,
- GLfloat literal)
+GLboolean
+slang_assembly_file_push_literal(slang_assembly_file * file,
+ slang_assembly_type type, GLfloat literal)
{
- return push_gen (file, type, literal, 0, 0);
+ return push_gen(file, type, literal, 0, 0);
}
#define PUSH slang_assembly_file_push
@@ -133,284 +144,296 @@ GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_ass
/* slang_assembly_file_restore_point */
-GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *file,
- slang_assembly_file_restore_point *point)
+GLboolean
+slang_assembly_file_restore_point_save(slang_assembly_file * file,
+ slang_assembly_file_restore_point *
+ point)
{
- point->count = file->count;
- return GL_TRUE;
+ point->count = file->count;
+ return GL_TRUE;
}
-GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *file,
- slang_assembly_file_restore_point *point)
+GLboolean
+slang_assembly_file_restore_point_load(slang_assembly_file * file,
+ slang_assembly_file_restore_point *
+ point)
{
- GLuint i;
+ GLuint i;
- for (i = point->count; i < file->count; i++)
- slang_assembly_destruct (&file->code[i]);
- file->count = point->count;
- return GL_TRUE;
+ for (i = point->count; i < file->count; i++)
+ slang_assembly_destruct(&file->code[i]);
+ file->count = point->count;
+ return GL_TRUE;
}
/* utility functions */
-static GLboolean sizeof_variable (slang_assemble_ctx *A, slang_type_specifier *spec,
- slang_type_qualifier qual, GLuint array_len, GLuint *size)
+static GLboolean
+sizeof_variable(slang_assemble_ctx * A, slang_type_specifier * spec,
+ slang_type_qualifier qual, GLuint array_len, GLuint * size)
{
- slang_storage_aggregate agg;
-
- /* calculate the size of the variable's aggregate */
- if (!slang_storage_aggregate_construct (&agg))
- return GL_FALSE;
- if (!_slang_aggregate_variable (&agg, spec, array_len, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- {
- slang_storage_aggregate_destruct (&agg);
- return GL_FALSE;
- }
- *size += _slang_sizeof_aggregate (&agg);
- slang_storage_aggregate_destruct (&agg);
-
- /* for reference variables consider the additional address overhead */
- if (qual == slang_qual_out || qual == slang_qual_inout)
- *size += 4;
-
- return GL_TRUE;
+ slang_storage_aggregate agg;
+
+ /* calculate the size of the variable's aggregate */
+ if (!slang_storage_aggregate_construct(&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable
+ (&agg, spec, array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms)) {
+ slang_storage_aggregate_destruct(&agg);
+ return GL_FALSE;
+ }
+ *size += _slang_sizeof_aggregate(&agg);
+ slang_storage_aggregate_destruct(&agg);
+
+ /* for reference variables consider the additional address overhead */
+ if (qual == slang_qual_out || qual == slang_qual_inout)
+ *size += 4;
+
+ return GL_TRUE;
}
-static GLboolean sizeof_variable2 (slang_assemble_ctx *A, slang_variable *var, GLuint *size)
+static GLboolean
+sizeof_variable2(slang_assemble_ctx * A, slang_variable * var, GLuint * size)
{
- var->address = *size;
- if (var->type.qualifier == slang_qual_out || var->type.qualifier == slang_qual_inout)
- var->address += 4;
- return sizeof_variable (A, &var->type.specifier, var->type.qualifier, var->array_len, size);
+ var->address = *size;
+ if (var->type.qualifier == slang_qual_out
+ || var->type.qualifier == slang_qual_inout)
+ var->address += 4;
+ return sizeof_variable(A, &var->type.specifier, var->type.qualifier,
+ var->array_len, size);
}
-static GLboolean sizeof_variables (slang_assemble_ctx *A, slang_variable_scope *vars, GLuint start,
- GLuint stop, GLuint *size)
+static GLboolean
+sizeof_variables(slang_assemble_ctx * A, slang_variable_scope * vars,
+ GLuint start, GLuint stop, GLuint * size)
{
- GLuint i;
+ GLuint i;
- for (i = start; i < stop; i++)
- if (!sizeof_variable2 (A, &vars->variables[i], size))
- return GL_FALSE;
- return GL_TRUE;
+ for (i = start; i < stop; i++)
+ if (!sizeof_variable2(A, &vars->variables[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
}
-static GLboolean collect_locals (slang_assemble_ctx *A, slang_operation *op, GLuint *size)
+static GLboolean
+collect_locals(slang_assemble_ctx * A, slang_operation * op, GLuint * size)
{
- GLuint i;
-
- if (!sizeof_variables (A, op->locals, 0, op->locals->num_variables, size))
- return GL_FALSE;
- for (i = 0; i < op->num_children; i++)
- if (!collect_locals (A, &op->children[i], size))
- return GL_FALSE;
- return GL_TRUE;
+ GLuint i;
+
+ if (!sizeof_variables(A, op->locals, 0, op->locals->num_variables, size))
+ return GL_FALSE;
+ for (i = 0; i < op->num_children; i++)
+ if (!collect_locals(A, &op->children[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
}
/* _slang_locate_function() */
-slang_function *_slang_locate_function (slang_function_scope *funcs, slang_atom a_name,
- slang_operation *params, GLuint num_params, slang_assembly_name_space *space,
- slang_atom_pool *atoms)
+slang_function *
+_slang_locate_function(const slang_function_scope * funcs, slang_atom a_name,
+ const slang_operation * params, GLuint num_params,
+ const slang_assembly_name_space * space,
+ slang_atom_pool * atoms)
{
- GLuint i;
-
- for (i = 0; i < funcs->num_functions; i++)
- {
- GLuint j;
- slang_function *f = &funcs->functions[i];
-
- if (a_name != f->header.a_name)
- continue;
- if (f->param_count != num_params)
- continue;
- for (j = 0; j < num_params; j++)
- {
- slang_assembly_typeinfo ti;
-
- if (!slang_assembly_typeinfo_construct (&ti))
- return NULL;
- if (!_slang_typeof_operation_ (&params[j], space, &ti, atoms))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return NULL;
- }
- if (!slang_type_specifier_equal (&ti.spec, &f->parameters->variables[j].type.specifier))
- {
- slang_assembly_typeinfo_destruct (&ti);
- break;
- }
- slang_assembly_typeinfo_destruct (&ti);
-
- /* "out" and "inout" formal parameter requires the actual parameter to be l-value */
- if (!ti.can_be_referenced &&
- (f->parameters->variables[j].type.qualifier == slang_qual_out ||
- f->parameters->variables[j].type.qualifier == slang_qual_inout))
- break;
- }
- if (j == num_params)
- return f;
- }
- if (funcs->outer_scope != NULL)
- return _slang_locate_function (funcs->outer_scope, a_name, params, num_params, space, atoms);
- return NULL;
+ GLuint i;
+
+ for (i = 0; i < funcs->num_functions; i++) {
+ GLuint j;
+ slang_function *f = &funcs->functions[i];
+
+ if (a_name != f->header.a_name)
+ continue;
+ if (f->param_count != num_params)
+ continue;
+ for (j = 0; j < num_params; j++) {
+ slang_assembly_typeinfo ti;
+
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return NULL;
+ if (!_slang_typeof_operation_(&params[j], space, &ti, atoms)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ return NULL;
+ }
+ if (!slang_type_specifier_equal
+ (&ti.spec, &f->parameters->variables[j].type.specifier)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ break;
+ }
+ slang_assembly_typeinfo_destruct(&ti);
+
+ /* "out" and "inout" formal parameter requires the actual parameter to be l-value */
+ if (!ti.can_be_referenced &&
+ (f->parameters->variables[j].type.qualifier == slang_qual_out ||
+ f->parameters->variables[j].type.qualifier == slang_qual_inout))
+ break;
+ }
+ if (j == num_params)
+ return f;
+ }
+ if (funcs->outer_scope != NULL)
+ return _slang_locate_function(funcs->outer_scope, a_name, params,
+ num_params, space, atoms);
+ return NULL;
}
/* _slang_assemble_function() */
-GLboolean _slang_assemble_function (slang_assemble_ctx *A, slang_function *fun)
+GLboolean
+_slang_assemble_function(slang_assemble_ctx * A, slang_function * fun)
{
- GLuint param_size, local_size;
- GLuint skip, cleanup;
-
- fun->address = A->file->count;
-
- if (fun->body == NULL)
- {
- /* jump to the actual function body - we do not know it, so add the instruction
- * to fixup table */
- fun->fixups.table = (GLuint *) slang_alloc_realloc (fun->fixups.table,
- fun->fixups.count * sizeof (GLuint), (fun->fixups.count + 1) * sizeof (GLuint));
- if (fun->fixups.table == NULL)
- return GL_FALSE;
- fun->fixups.table[fun->fixups.count] = fun->address;
- fun->fixups.count++;
- if (!PUSH (A->file, slang_asm_jump))
- return GL_FALSE;
- return GL_TRUE;
- }
- else
- {
- GLuint i;
-
- /* resolve all fixup table entries and delete it */
- for (i = 0; i < fun->fixups.count; i++)
- A->file->code[fun->fixups.table[i]].param[0] = fun->address;
- slang_fixup_table_free (&fun->fixups);
- }
-
- /* At this point traverse function formal parameters and code to calculate
- * total memory size to be allocated on the stack.
- * During this process the variables will be assigned local addresses to
- * reference them in the code.
- * No storage optimizations are performed so exclusive scopes are not detected and shared. */
-
- /* calculate return value size */
- param_size = 0;
- if (fun->header.type.specifier.type != slang_spec_void)
- if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &param_size))
- return GL_FALSE;
- A->local.ret_size = param_size;
-
- /* calculate formal parameter list size */
- if (!sizeof_variables (A, fun->parameters, 0, fun->param_count, &param_size))
- return GL_FALSE;
-
- /* calculate local variables size - take into account the four-byte return address and
- * temporaries for various tasks (4 for addr and 16 for swizzle temporaries).
- * these include variables from the formal parameter scope and from the code */
- A->local.addr_tmp = param_size + 4;
- A->local.swizzle_tmp = param_size + 4 + 4;
- local_size = param_size + 4 + 4 + 16;
- if (!sizeof_variables (A, fun->parameters, fun->param_count, fun->parameters->num_variables,
- &local_size))
- return GL_FALSE;
- if (!collect_locals (A, fun->body, &local_size))
- return GL_FALSE;
-
- /* allocate local variable storage */
- if (!PLAB (A->file, slang_asm_local_alloc, local_size - param_size - 4))
- return GL_FALSE;
-
- /* mark a new frame for function variable storage */
- if (!PLAB (A->file, slang_asm_enter, local_size))
- return GL_FALSE;
-
- /* jump directly to the actual code */
- skip = A->file->count;
- if (!push_new (A->file))
- return GL_FALSE;
- A->file->code[skip].type = slang_asm_jump;
-
- /* all "return" statements will be directed here */
- A->flow.function_end = A->file->count;
- cleanup = A->file->count;
- if (!push_new (A->file))
- return GL_FALSE;
- A->file->code[cleanup].type = slang_asm_jump;
-
- /* execute the function body */
- A->file->code[skip].param[0] = A->file->count;
- if (!_slang_assemble_operation (A, fun->body, /*slang_ref_freelance*/slang_ref_forbid))
- return GL_FALSE;
-
- /* this is the end of the function - restore the old function frame */
- A->file->code[cleanup].param[0] = A->file->count;
- if (!PUSH (A->file, slang_asm_leave))
- return GL_FALSE;
-
- /* free local variable storage */
- if (!PLAB (A->file, slang_asm_local_free, local_size - param_size - 4))
- return GL_FALSE;
-
- /* return from the function */
- if (!PUSH (A->file, slang_asm_return))
- return GL_FALSE;
-
- return GL_TRUE;
+ GLuint param_size, local_size;
+ GLuint skip, cleanup;
+
+ fun->address = A->file->count;
+
+ if (fun->body == NULL) {
+ /* jump to the actual function body - we do not know it, so add
+ * the instruction to fixup table
+ */
+ if (!slang_fixup_save(&fun->fixups, fun->address))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_jump))
+ return GL_FALSE;
+ return GL_TRUE;
+ }
+ else {
+ /* resolve all fixup table entries and delete it */
+ GLuint i;
+ for (i = 0; i < fun->fixups.count; i++)
+ A->file->code[fun->fixups.table[i]].param[0] = fun->address;
+ slang_fixup_table_free(&fun->fixups);
+ }
+
+ /* At this point traverse function formal parameters and code to calculate
+ * total memory size to be allocated on the stack.
+ * During this process the variables will be assigned local addresses to
+ * reference them in the code.
+ * No storage optimizations are performed so exclusive scopes are not
+ * detected and shared.
+ */
+
+ /* calculate return value size */
+ param_size = 0;
+ if (fun->header.type.specifier.type != slang_spec_void)
+ if (!sizeof_variable
+ (A, &fun->header.type.specifier, slang_qual_none, 0, &param_size))
+ return GL_FALSE;
+ A->local.ret_size = param_size;
+
+ /* calculate formal parameter list size */
+ if (!sizeof_variables
+ (A, fun->parameters, 0, fun->param_count, &param_size))
+ return GL_FALSE;
+
+ /* calculate local variables size - take into account the four-byte
+ * return address and temporaries for various tasks (4 for addr and
+ * 16 for swizzle temporaries). these include variables from the
+ * formal parameter scope and from the code
+ */
+ A->local.addr_tmp = param_size + 4;
+ A->local.swizzle_tmp = param_size + 4 + 4;
+ local_size = param_size + 4 + 4 + 16;
+ if (!sizeof_variables
+ (A, fun->parameters, fun->param_count, fun->parameters->num_variables,
+ &local_size))
+ return GL_FALSE;
+ if (!collect_locals(A, fun->body, &local_size))
+ return GL_FALSE;
+
+ /* allocate local variable storage */
+ if (!PLAB(A->file, slang_asm_local_alloc, local_size - param_size - 4))
+ return GL_FALSE;
+
+ /* mark a new frame for function variable storage */
+ if (!PLAB(A->file, slang_asm_enter, local_size))
+ return GL_FALSE;
+
+ /* jump directly to the actual code */
+ skip = A->file->count;
+ if (!push_new(A->file))
+ return GL_FALSE;
+ A->file->code[skip].type = slang_asm_jump;
+
+ /* all "return" statements will be directed here */
+ A->flow.function_end = A->file->count;
+ cleanup = A->file->count;
+ if (!push_new(A->file))
+ return GL_FALSE;
+ A->file->code[cleanup].type = slang_asm_jump;
+
+ /* execute the function body */
+ A->file->code[skip].param[0] = A->file->count;
+ if (!_slang_assemble_operation
+ (A, fun->body, /*slang_ref_freelance */ slang_ref_forbid))
+ return GL_FALSE;
+
+ /* this is the end of the function - restore the old function frame */
+ A->file->code[cleanup].param[0] = A->file->count;
+ if (!PUSH(A->file, slang_asm_leave))
+ return GL_FALSE;
+
+ /* free local variable storage */
+ if (!PLAB(A->file, slang_asm_local_free, local_size - param_size - 4))
+ return GL_FALSE;
+
+ /* return from the function */
+ if (!PUSH(A->file, slang_asm_return))
+ return GL_FALSE;
+
+ return GL_TRUE;
}
-GLboolean _slang_cleanup_stack (slang_assemble_ctx *A, slang_operation *op)
+GLboolean
+_slang_cleanup_stack(slang_assemble_ctx * A, slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLuint size = 0;
-
- /* get type info of the operation and calculate its size */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return GL_FALSE;
- }
- if (ti.spec.type != slang_spec_void) {
- if (A->ref == slang_ref_force) {
- size = 4;
- }
- else if (!sizeof_variable (A, &ti.spec, slang_qual_none, 0, &size))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return GL_FALSE;
- }
- }
- slang_assembly_typeinfo_destruct (&ti);
-
- /* if nonzero, free it from the stack */
- if (size != 0)
- {
- if (!PLAB (A->file, slang_asm_local_free, size))
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ slang_assembly_typeinfo ti;
+ GLuint size = 0;
+
+ /* get type info of the operation and calculate its size */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ return GL_FALSE;
+ }
+ if (ti.spec.type != slang_spec_void) {
+ if (A->ref == slang_ref_force) {
+ size = 4;
+ }
+ else if (!sizeof_variable(A, &ti.spec, slang_qual_none, 0, &size)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ return GL_FALSE;
+ }
+ }
+ slang_assembly_typeinfo_destruct(&ti);
+
+ /* if nonzero, free it from the stack */
+ if (size != 0) {
+ if (!PLAB(A->file, slang_asm_local_free, size))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
/* _slang_assemble_operation() */
static GLboolean
-dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size, slang_swizzle *swz,
- GLboolean is_swizzled)
+dereference_basic(slang_assemble_ctx * A, slang_storage_type type,
+ GLuint * size, slang_swizzle * swz, GLboolean is_swizzled)
{
GLuint src_offset;
slang_assembly_type ty;
- *size -= _slang_sizeof_type (type);
+ *size -= _slang_sizeof_type(type);
- /* If swizzling is taking place, we are forced to use scalar operations, even if we have
- * vec4 instructions enabled (this should be actually done with special vec4 shuffle
- * instructions).
- * Adjust the size and calculate the offset within source variable to read.
+ /* If swizzling is taking place, we are forced to use scalar
+ * operations, even if we have vec4 instructions enabled (this
+ * should be actually done with special vec4 shuffle instructions).
+ * Adjust the size and calculate the offset within source variable
+ * to read.
*/
if (is_swizzled)
src_offset = swz->swizzle[*size / 4] * 4;
@@ -418,14 +441,14 @@ dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size,
src_offset = *size;
/* dereference data slot of a basic type */
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
+ if (!PUSH(A->file, slang_asm_addr_deref))
return GL_FALSE;
if (src_offset != 0) {
- if (!PLAB (A->file, slang_asm_addr_push, src_offset))
+ if (!PLAB(A->file, slang_asm_addr_push, src_offset))
return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
+ if (!PUSH(A->file, slang_asm_addr_add))
return GL_FALSE;
}
@@ -449,12 +472,13 @@ dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size,
ty = slang_asm_none;
}
- return PUSH (A->file, ty);
+ return PUSH(A->file, ty);
}
static GLboolean
-dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *size,
- slang_swizzle *swz, GLboolean is_swizzled)
+dereference_aggregate(slang_assemble_ctx * A,
+ const slang_storage_aggregate * agg, GLuint * size,
+ slang_swizzle * swz, GLboolean is_swizzled)
{
GLuint i;
@@ -464,22 +488,27 @@ dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg
for (j = arr->length; j > 0; j--) {
if (arr->type == slang_stor_aggregate) {
- if (!dereference_aggregate (A, arr->aggregate, size, swz, is_swizzled))
+ if (!dereference_aggregate
+ (A, arr->aggregate, size, swz, is_swizzled))
return GL_FALSE;
}
else {
if (is_swizzled && arr->type == slang_stor_vec4) {
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
}
else {
- if (!dereference_basic (A, arr->type, size, swz, is_swizzled))
+ if (!dereference_basic(A, arr->type, size, swz, is_swizzled))
return GL_FALSE;
}
}
@@ -489,235 +518,240 @@ dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg
return GL_TRUE;
}
-GLboolean _slang_dereference (slang_assemble_ctx *A, slang_operation *op)
+GLboolean
+_slang_dereference(slang_assemble_ctx * A, slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg;
- GLuint size;
-
- /* get type information of the given operation */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- /* construct aggregate from the type info */
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end;
-
- /* dereference the resulting aggregate */
- size = _slang_sizeof_aggregate (&agg);
- result = dereference_aggregate (A, &agg, &size, &ti.swz, ti.is_swizzled);
-
-end:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint size;
+
+ /* get type information of the given operation */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ /* construct aggregate from the type info */
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable
+ (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end;
+
+ /* dereference the resulting aggregate */
+ size = _slang_sizeof_aggregate(&agg);
+ result = dereference_aggregate(A, &agg, &size, &ti.swz, ti.is_swizzled);
+
+ end:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-GLboolean _slang_assemble_function_call (slang_assemble_ctx *A, slang_function *fun,
- slang_operation *params, GLuint param_count, GLboolean assignment)
+GLboolean
+_slang_assemble_function_call(slang_assemble_ctx * A, slang_function * fun,
+ slang_operation * params, GLuint param_count,
+ GLboolean assignment)
{
- GLuint i;
- slang_swizzle p_swz[64];
- slang_ref_type p_ref[64];
-
- /* TODO: fix this, allocate dynamically */
- if (param_count > 64)
- return GL_FALSE;
-
- /* make room for the return value, if any */
- if (fun->header.type.specifier.type != slang_spec_void)
- {
- GLuint ret_size = 0;
-
- if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_alloc, ret_size))
- return GL_FALSE;
- }
-
- /* push the actual parameters on the stack */
- for (i = 0; i < param_count; i++)
- {
- if (fun->parameters->variables[i].type.qualifier == slang_qual_inout ||
- fun->parameters->variables[i].type.qualifier == slang_qual_out)
- {
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
- /* TODO: optimize the "out" parameter case */
- if (!_slang_assemble_operation (A, &params[i], slang_ref_force))
- return GL_FALSE;
- p_swz[i] = A->swz;
- p_ref[i] = A->ref;
- if (!PUSH (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
- return GL_FALSE;
- if (i == 0 && assignment)
- {
- /* duplicate the resulting address */
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
- return GL_FALSE;
- }
- if (!_slang_dereference (A, &params[i]))
- return GL_FALSE;
- }
- else
- {
- if (!_slang_assemble_operation (A, &params[i], slang_ref_forbid))
- return GL_FALSE;
- p_swz[i] = A->swz;
- p_ref[i] = A->ref;
- }
- }
-
- /* call the function */
- if (!PLAB (A->file, slang_asm_call, fun->address))
- return GL_FALSE;
-
- /* pop the parameters from the stack */
- for (i = param_count; i > 0; i--)
- {
- GLuint j = i - 1;
-
- A->swz = p_swz[j];
- A->ref = p_ref[j];
- if (fun->parameters->variables[j].type.qualifier == slang_qual_inout ||
- fun->parameters->variables[j].type.qualifier == slang_qual_out)
- {
- /* for output parameter copy the contents of the formal parameter
- * back to the original actual parameter */
- if (!_slang_assemble_assignment (A, &params[j]))
- return GL_FALSE;
- /* pop the actual parameter's address */
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- }
- else
- {
- /* pop the value of the parameter */
- if (!_slang_cleanup_stack (A, &params[j]))
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
+ GLuint i;
+ slang_swizzle p_swz[64];
+ slang_ref_type p_ref[64];
+
+ /* TODO: fix this, allocate dynamically */
+ if (param_count > 64)
+ return GL_FALSE;
+
+ /* make room for the return value, if any */
+ if (fun->header.type.specifier.type != slang_spec_void) {
+ GLuint ret_size = 0;
+
+ if (!sizeof_variable
+ (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_alloc, ret_size))
+ return GL_FALSE;
+ }
+
+ /* push the actual parameters on the stack */
+ for (i = 0; i < param_count; i++) {
+ if (fun->parameters->variables[i].type.qualifier == slang_qual_inout ||
+ fun->parameters->variables[i].type.qualifier == slang_qual_out) {
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ /* TODO: optimize the "out" parameter case */
+ if (!_slang_assemble_operation(A, &params[i], slang_ref_force))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
+ if (!PUSH(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ if (i == 0 && assignment) {
+ /* duplicate the resulting address */
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ }
+ if (!_slang_dereference(A, &params[i]))
+ return GL_FALSE;
+ }
+ else {
+ if (!_slang_assemble_operation(A, &params[i], slang_ref_forbid))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
+ }
+ }
+
+ /* call the function */
+ if (!PLAB(A->file, slang_asm_call, fun->address))
+ return GL_FALSE;
+
+ /* pop the parameters from the stack */
+ for (i = param_count; i > 0; i--) {
+ GLuint j = i - 1;
+
+ A->swz = p_swz[j];
+ A->ref = p_ref[j];
+ if (fun->parameters->variables[j].type.qualifier == slang_qual_inout ||
+ fun->parameters->variables[j].type.qualifier == slang_qual_out) {
+ /* for output parameter copy the contents of the formal parameter
+ * back to the original actual parameter
+ */
+ if (!_slang_assemble_assignment(A, &params[j]))
+ return GL_FALSE;
+ /* pop the actual parameter's address */
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+ else {
+ /* pop the value of the parameter */
+ if (!_slang_cleanup_stack(A, &params[j]))
+ return GL_FALSE;
+ }
+ }
+
+ return GL_TRUE;
}
-GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *A, const char *name,
- slang_operation *params, GLuint param_count, GLboolean assignment)
+GLboolean
+_slang_assemble_function_call_name(slang_assemble_ctx * A, const char *name,
+ slang_operation * params,
+ GLuint param_count, GLboolean assignment)
{
- slang_atom atom;
- slang_function *fun;
-
- atom = slang_atom_pool_atom (A->atoms, name);
- if (atom == SLANG_ATOM_NULL)
- return GL_FALSE;
- fun = _slang_locate_function (A->space.funcs, atom, params, param_count, &A->space, A->atoms);
- if (fun == NULL)
- return GL_FALSE;
- return _slang_assemble_function_call (A, fun, params, param_count, assignment);
+ slang_atom atom;
+ slang_function *fun;
+
+ atom = slang_atom_pool_atom(A->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+ fun =
+ _slang_locate_function(A->space.funcs, atom, params, param_count,
+ &A->space, A->atoms);
+ if (fun == NULL)
+ return GL_FALSE;
+ return _slang_assemble_function_call(A, fun, params, param_count,
+ assignment);
}
-static GLboolean assemble_function_call_name_dummyint (slang_assemble_ctx *A, const char *name,
- slang_operation *params)
+static GLboolean
+assemble_function_call_name_dummyint(slang_assemble_ctx * A, const char *name,
+ slang_operation * params)
{
- slang_operation p[2];
- GLboolean result;
-
- p[0] = params[0];
- if (!slang_operation_construct (&p[1]))
- return GL_FALSE;
- p[1].type = slang_oper_literal_int;
- result = _slang_assemble_function_call_name (A, name, p, 2, GL_FALSE);
- slang_operation_destruct (&p[1]);
- return result;
+ slang_operation p[2];
+ GLboolean result;
+
+ p[0] = params[0];
+ if (!slang_operation_construct(&p[1]))
+ return GL_FALSE;
+ p[1].type = slang_oper_literal_int;
+ result = _slang_assemble_function_call_name(A, name, p, 2, GL_FALSE);
+ slang_operation_destruct(&p[1]);
+ return result;
}
static const struct
{
- const char *name;
- slang_assembly_type code1, code2;
+ const char *name;
+ slang_assembly_type code1, code2;
} inst[] = {
- /* core */
- { "float_add", slang_asm_float_add, slang_asm_float_copy },
- { "float_multiply", slang_asm_float_multiply, slang_asm_float_copy },
- { "float_divide", slang_asm_float_divide, slang_asm_float_copy },
- { "float_negate", slang_asm_float_negate, slang_asm_float_copy },
- { "float_less", slang_asm_float_less, slang_asm_bool_copy },
- { "float_equal", slang_asm_float_equal_exp,slang_asm_bool_copy },
- { "float_to_int", slang_asm_float_to_int, slang_asm_int_copy },
- { "float_sine", slang_asm_float_sine, slang_asm_float_copy },
- { "float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy },
- { "float_arctan", slang_asm_float_arctan, slang_asm_float_copy },
- { "float_power", slang_asm_float_power, slang_asm_float_copy },
- { "float_log2", slang_asm_float_log2, slang_asm_float_copy },
- { "float_floor", slang_asm_float_floor, slang_asm_float_copy },
- { "float_ceil", slang_asm_float_ceil, slang_asm_float_copy },
- { "float_noise1", slang_asm_float_noise1, slang_asm_float_copy },
- { "float_noise2", slang_asm_float_noise2, slang_asm_float_copy },
- { "float_noise3", slang_asm_float_noise3, slang_asm_float_copy },
- { "float_noise4", slang_asm_float_noise4, slang_asm_float_copy },
- { "int_to_float", slang_asm_int_to_float, slang_asm_float_copy },
- { "vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none },
- { "vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none },
- { "vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none },
- { "vec4_texcube", slang_asm_vec4_texcube, slang_asm_none },
- { "vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none },
- { "vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none },
- /* GL_MESA_shader_debug */
- { "float_print", slang_asm_float_deref, slang_asm_float_print },
- { "int_print", slang_asm_int_deref, slang_asm_int_print },
- { "bool_print", slang_asm_bool_deref, slang_asm_bool_print },
+ /* core */
+ {"float_add", slang_asm_float_add, slang_asm_float_copy},
+ {"float_multiply", slang_asm_float_multiply, slang_asm_float_copy},
+ {"float_divide", slang_asm_float_divide, slang_asm_float_copy},
+ {"float_negate", slang_asm_float_negate, slang_asm_float_copy},
+ {"float_less", slang_asm_float_less, slang_asm_bool_copy},
+ {"float_equal", slang_asm_float_equal_exp, slang_asm_bool_copy},
+ {"float_to_int", slang_asm_float_to_int, slang_asm_int_copy},
+ {"float_sine", slang_asm_float_sine, slang_asm_float_copy},
+ {"float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy},
+ {"float_arctan", slang_asm_float_arctan, slang_asm_float_copy},
+ {"float_power", slang_asm_float_power, slang_asm_float_copy},
+ {"float_log2", slang_asm_float_log2, slang_asm_float_copy},
+ {"float_floor", slang_asm_float_floor, slang_asm_float_copy},
+ {"float_ceil", slang_asm_float_ceil, slang_asm_float_copy},
+ {"float_noise1", slang_asm_float_noise1, slang_asm_float_copy},
+ {"float_noise2", slang_asm_float_noise2, slang_asm_float_copy},
+ {"float_noise3", slang_asm_float_noise3, slang_asm_float_copy},
+ {"float_noise4", slang_asm_float_noise4, slang_asm_float_copy},
+ {"int_to_float", slang_asm_int_to_float, slang_asm_float_copy},
+ {"vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none},
+ {"vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none},
+ {"vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none},
+ {"vec4_texcube", slang_asm_vec4_texcube, slang_asm_none},
+ {"vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none},
+ {"vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none},
+ /* GL_MESA_shader_debug */
+ {"float_print", slang_asm_float_deref, slang_asm_float_print},
+ {"int_print", slang_asm_int_deref, slang_asm_int_print},
+ {"bool_print", slang_asm_bool_deref, slang_asm_bool_print},
/* vec4 */
- { "float_to_vec4", slang_asm_float_to_vec4, slang_asm_none },
- { "vec4_add", slang_asm_vec4_add, slang_asm_none },
- { "vec4_subtract", slang_asm_vec4_subtract, slang_asm_none },
- { "vec4_multiply", slang_asm_vec4_multiply, slang_asm_none },
- { "vec4_divide", slang_asm_vec4_divide, slang_asm_none },
- { "vec4_negate", slang_asm_vec4_negate, slang_asm_none },
- { "vec4_dot", slang_asm_vec4_dot, slang_asm_none },
-
- { NULL, slang_asm_none, slang_asm_none }
+ {"float_to_vec4", slang_asm_float_to_vec4, slang_asm_none},
+ {"vec4_add", slang_asm_vec4_add, slang_asm_none},
+ {"vec4_subtract", slang_asm_vec4_subtract, slang_asm_none},
+ {"vec4_multiply", slang_asm_vec4_multiply, slang_asm_none},
+ {"vec4_divide", slang_asm_vec4_divide, slang_asm_none},
+ {"vec4_negate", slang_asm_vec4_negate, slang_asm_none},
+ {"vec4_dot", slang_asm_vec4_dot, slang_asm_none},
+ {NULL, slang_asm_none, slang_asm_none}
};
-static GLboolean call_asm_instruction (slang_assemble_ctx *A, slang_atom a_name)
+static GLboolean
+call_asm_instruction(slang_assemble_ctx * A, slang_atom a_name)
{
- const char *id;
- GLuint i;
+ const char *id;
+ GLuint i;
- id = slang_atom_pool_id (A->atoms, a_name);
+ id = slang_atom_pool_id(A->atoms, a_name);
- for (i = 0; inst[i].name != NULL; i++)
- if (slang_string_compare (id, inst[i].name) == 0)
- break;
- if (inst[i].name == NULL)
- return GL_FALSE;
+ for (i = 0; inst[i].name != NULL; i++)
+ if (slang_string_compare(id, inst[i].name) == 0)
+ break;
+ if (inst[i].name == NULL)
+ return GL_FALSE;
- if (!PLAB2 (A->file, inst[i].code1, 4, 0))
- return GL_FALSE;
- if (inst[i].code2 != slang_asm_none)
- if (!PLAB2 (A->file, inst[i].code2, 4, 0))
- return GL_FALSE;
+ if (!PLAB2(A->file, inst[i].code1, 4, 0))
+ return GL_FALSE;
+ if (inst[i].code2 != slang_asm_none)
+ if (!PLAB2(A->file, inst[i].code2, 4, 0))
+ return GL_FALSE;
- /* clean-up the stack from the remaining dst address */
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
+ /* clean-up the stack from the remaining dst address */
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
- return GL_TRUE;
+ return GL_TRUE;
}
static GLboolean
-equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *index,
- GLuint size, GLuint z_label)
+equality_aggregate(slang_assemble_ctx * A,
+ const slang_storage_aggregate * agg, GLuint * index,
+ GLuint size, GLuint z_label)
{
GLuint i;
@@ -727,22 +761,25 @@ equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, G
for (j = 0; j < arr->length; j++) {
if (arr->type == slang_stor_aggregate) {
- if (!equality_aggregate (A, arr->aggregate, index, size, z_label))
+ if (!equality_aggregate(A, arr->aggregate, index, size, z_label))
return GL_FALSE;
}
else {
#if defined(USE_X86_ASM) || defined(SLANG_X86)
if (arr->type == slang_stor_vec4) {
- if (!PLAB2 (A->file, slang_asm_vec4_equal_int, size + *index, *index))
+ if (!PLAB2
+ (A->file, slang_asm_vec4_equal_int, size + *index, *index))
return GL_FALSE;
}
else
#endif
- if (!PLAB2 (A->file, slang_asm_float_equal_int, size + *index, *index))
- return GL_FALSE;
+ if (!PLAB2
+ (A->file, slang_asm_float_equal_int, size + *index,
+ *index))
+ return GL_FALSE;
- *index += _slang_sizeof_type (arr->type);
- if (!PLAB (A->file, slang_asm_jump_if_zero, z_label))
+ *index += _slang_sizeof_type(arr->type);
+ if (!PLAB(A->file, slang_asm_jump_if_zero, z_label))
return GL_FALSE;
}
}
@@ -751,753 +788,755 @@ equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, G
return GL_TRUE;
}
-static GLboolean equality (slang_assemble_ctx *A, slang_operation *op, GLboolean equal)
+static GLboolean
+equality(slang_assemble_ctx * A, slang_operation * op, GLboolean equal)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg;
- GLuint index, size;
- GLuint skip_jump, true_label, true_jump, false_label, false_jump;
-
- /* get type of operation */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- /* convert it to an aggregate */
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end;
-
- /* compute the size of the agregate - there are two such aggregates on the stack */
- size = _slang_sizeof_aggregate (&agg);
-
- /* jump to the actual data-comparison code */
- skip_jump = A->file->count;
- if (!PUSH (A->file, slang_asm_jump))
- goto end;
-
- /* pop off the stack the compared data and push 1 */
- true_label = A->file->count;
- if (!PLAB (A->file, slang_asm_local_free, size * 2))
- goto end;
- if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 1))
- goto end;
- true_jump = A->file->count;
- if (!PUSH (A->file, slang_asm_jump))
- goto end;
-
- false_label = A->file->count;
- if (!PLAB (A->file, slang_asm_local_free, size * 2))
- goto end;
- if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 0))
- goto end;
- false_jump = A->file->count;
- if (!PUSH (A->file, slang_asm_jump))
- goto end;
-
- A->file->code[skip_jump].param[0] = A->file->count;
-
- /* compare the data on stack, it will eventually jump either to true or false label */
- index = 0;
- if (!equality_aggregate (A, &agg, &index, size, equal ? false_label : true_label))
- goto end;
- if (!PLAB (A->file, slang_asm_jump, equal ? true_label : false_label))
- goto end;
-
- A->file->code[true_jump].param[0] = A->file->count;
- A->file->code[false_jump].param[0] = A->file->count;
-
- result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint index, size;
+ GLuint skip_jump, true_label, true_jump, false_label, false_jump;
+
+ /* get type of operation */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ /* convert it to an aggregate */
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable
+ (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end;
+
+ /* compute the size of the agregate - there are two such aggregates on the stack */
+ size = _slang_sizeof_aggregate(&agg);
+
+ /* jump to the actual data-comparison code */
+ skip_jump = A->file->count;
+ if (!PUSH(A->file, slang_asm_jump))
+ goto end;
+
+ /* pop off the stack the compared data and push 1 */
+ true_label = A->file->count;
+ if (!PLAB(A->file, slang_asm_local_free, size * 2))
+ goto end;
+ if (!PLIT(A->file, slang_asm_bool_push, (GLfloat) 1))
+ goto end;
+ true_jump = A->file->count;
+ if (!PUSH(A->file, slang_asm_jump))
+ goto end;
+
+ false_label = A->file->count;
+ if (!PLAB(A->file, slang_asm_local_free, size * 2))
+ goto end;
+ if (!PLIT(A->file, slang_asm_bool_push, (GLfloat) 0))
+ goto end;
+ false_jump = A->file->count;
+ if (!PUSH(A->file, slang_asm_jump))
+ goto end;
+
+ A->file->code[skip_jump].param[0] = A->file->count;
+
+ /* compare the data on stack, it will eventually jump either to true or false label */
+ index = 0;
+ if (!equality_aggregate
+ (A, &agg, &index, size, equal ? false_label : true_label))
+ goto end;
+ if (!PLAB(A->file, slang_asm_jump, equal ? true_label : false_label))
+ goto end;
+
+ A->file->code[true_jump].param[0] = A->file->count;
+ A->file->code[false_jump].param[0] = A->file->count;
+
+ result = GL_TRUE;
+ end:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-static GLboolean handle_subscript (slang_assemble_ctx *A, slang_assembly_typeinfo *tie,
- slang_assembly_typeinfo *tia, slang_operation *op, slang_ref_type ref)
+static GLboolean
+handle_subscript(slang_assemble_ctx * A, slang_assembly_typeinfo * tie,
+ slang_assembly_typeinfo * tia, slang_operation * op,
+ slang_ref_type ref)
{
- GLuint asize = 0, esize = 0;
-
- /* get type info of the master expression (matrix, vector or an array */
- if (!_slang_typeof_operation (A, &op->children[0], tia))
- return GL_FALSE;
- if (!sizeof_variable (A, &tia->spec, slang_qual_none, tia->array_len, &asize))
- return GL_FALSE;
-
- /* get type info of the result (matrix column, vector row or array element) */
- if (!_slang_typeof_operation (A, op, tie))
- return GL_FALSE;
- if (!sizeof_variable (A, &tie->spec, slang_qual_none, 0, &esize))
- return GL_FALSE;
-
- /* assemble the master expression */
- if (!_slang_assemble_operation (A, &op->children[0], ref))
- return GL_FALSE;
-
- /* when indexing an l-value swizzle, push the swizzle_tmp */
- if (ref == slang_ref_force && tia->is_swizzled)
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
-
- /* assemble the subscript expression */
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
-
- if (ref == slang_ref_force && tia->is_swizzled)
- {
- GLuint i;
-
- /* copy the swizzle indexes to the swizzle_tmp */
- for (i = 0; i < tia->swz.num_components; i++)
- {
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_addr_push, i * 4))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_addr_push, tia->swz.swizzle[i]))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- }
-
- /* offset the pushed swizzle_tmp address and dereference it */
- if (!PUSH (A->file, slang_asm_int_to_addr))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_addr_push, 4))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_multiply))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
- return GL_FALSE;
- }
- else
- {
- /* convert the integer subscript to a relative address */
- if (!PUSH (A->file, slang_asm_int_to_addr))
- return GL_FALSE;
- }
-
- if (!PLAB (A->file, slang_asm_addr_push, esize))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_multiply))
- return GL_FALSE;
-
- if (ref == slang_ref_force)
- {
- /* offset the base address with the relative address */
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- }
- else
- {
- GLuint i;
-
- /* move the selected element to the beginning of the master expression */
- for (i = 0; i < esize; i += 4)
- if (!PLAB2 (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
-
- /* free the rest of the master expression */
- if (!PLAB (A->file, slang_asm_local_free, asize - esize))
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ GLuint asize = 0, esize = 0;
+
+ /* get type info of the master expression (matrix, vector or an array */
+ if (!_slang_typeof_operation(A, &op->children[0], tia))
+ return GL_FALSE;
+ if (!sizeof_variable
+ (A, &tia->spec, slang_qual_none, tia->array_len, &asize))
+ return GL_FALSE;
+
+ /* get type info of the result (matrix column, vector row or array element) */
+ if (!_slang_typeof_operation(A, op, tie))
+ return GL_FALSE;
+ if (!sizeof_variable(A, &tie->spec, slang_qual_none, 0, &esize))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation(A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* when indexing an l-value swizzle, push the swizzle_tmp */
+ if (ref == slang_ref_force && tia->is_swizzled)
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the subscript expression */
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force && tia->is_swizzled) {
+ GLuint i;
+
+ /* copy the swizzle indexes to the swizzle_tmp */
+ for (i = 0; i < tia->swz.num_components; i++) {
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_addr_push, i * 4))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_addr_push, tia->swz.swizzle[i]))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+
+ /* offset the pushed swizzle_tmp address and dereference it */
+ if (!PUSH(A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_addr_push, 4))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ }
+ else {
+ /* convert the integer subscript to a relative address */
+ if (!PUSH(A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ }
+
+ if (!PLAB(A->file, slang_asm_addr_push, esize))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force) {
+ /* offset the base address with the relative address */
+ if (!PUSH(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ }
+ else {
+ GLuint i;
+
+ /* move the selected element to the beginning of the master expression */
+ for (i = 0; i < esize; i += 4)
+ if (!PLAB2
+ (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+
+ /* free the rest of the master expression */
+ if (!PLAB(A->file, slang_asm_local_free, asize - esize))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
-static GLboolean handle_field (slang_assemble_ctx *A, slang_assembly_typeinfo *tia,
- slang_assembly_typeinfo *tib, slang_operation *op, slang_ref_type ref)
+static GLboolean
+handle_field(slang_assemble_ctx * A, slang_assembly_typeinfo * tia,
+ slang_assembly_typeinfo * tib, slang_operation * op,
+ slang_ref_type ref)
{
- /* get type info of the result (field or swizzle) */
- if (!_slang_typeof_operation (A, op, tia))
- return GL_FALSE;
-
- /* get type info of the master expression being accessed (struct or vector) */
- if (!_slang_typeof_operation (A, &op->children[0], tib))
- return GL_FALSE;
-
- /* if swizzling a vector in-place, the swizzle temporary is needed */
- if (ref == slang_ref_forbid && tia->is_swizzled)
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
-
- /* assemble the master expression */
- if (!_slang_assemble_operation (A, &op->children[0], ref))
- return GL_FALSE;
-
- /* assemble the field expression */
- if (tia->is_swizzled)
- {
- if (ref == slang_ref_force)
- {
+ /* get type info of the result (field or swizzle) */
+ if (!_slang_typeof_operation(A, op, tia))
+ return GL_FALSE;
+
+ /* get type info of the master expression being accessed (struct or vector) */
+ if (!_slang_typeof_operation(A, &op->children[0], tib))
+ return GL_FALSE;
+
+ /* if swizzling a vector in-place, the swizzle temporary is needed */
+ if (ref == slang_ref_forbid && tia->is_swizzled)
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation(A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* assemble the field expression */
+ if (tia->is_swizzled) {
+ if (ref == slang_ref_force) {
#if 0
- if (tia->swz.num_components == 1)
- {
- /* simple case - adjust the vector's address to point to the selected component */
- if (!PLAB (file, slang_asm_addr_push, tia->swz.swizzle[0] * 4))
- return 0;
- if (!PUSH (file, slang_asm_addr_add))
- return 0;
- }
- else
+ if (tia->swz.num_components == 1) {
+ /* simple case - adjust the vector's address to point to
+ * the selected component
+ */
+ if (!PLAB(file, slang_asm_addr_push, tia->swz.swizzle[0] * 4))
+ return 0;
+ if (!PUSH(file, slang_asm_addr_add))
+ return 0;
+ }
+ else
#endif
- {
- /* two or more vector components are being referenced - the so-called write mask
- * must be passed to the upper operations and applied when assigning value
- * to this swizzle */
- A->swz = tia->swz;
- }
- }
- else
- {
- /* swizzle the vector in-place using the swizzle temporary */
- if (!_slang_assemble_constructor_from_swizzle (A, &tia->swz, &tia->spec, &tib->spec))
- return GL_FALSE;
- }
- }
- else
- {
- GLuint i, struct_size = 0, field_offset = 0, field_size = 0;
+ {
+ /* two or more vector components are being referenced -
+ * the so-called write mask must be passed to the upper
+ * operations and applied when assigning value to this swizzle
+ */
+ A->swz = tia->swz;
+ }
+ }
+ else {
+ /* swizzle the vector in-place using the swizzle temporary */
+ if (!_slang_assemble_constructor_from_swizzle
+ (A, &tia->swz, &tia->spec, &tib->spec))
+ return GL_FALSE;
+ }
+ }
+ else {
+ GLuint i, struct_size = 0, field_offset = 0, field_size = 0;
/*
* Calculate struct size, field offset and field size.
*/
- for (i = 0; i < tib->spec._struct->fields->num_variables; i++)
- {
- slang_variable *field;
- slang_storage_aggregate agg;
- GLuint size;
-
- field = &tib->spec._struct->fields->variables[i];
- if (!slang_storage_aggregate_construct (&agg))
- return GL_FALSE;
- if (!_slang_aggregate_variable (&agg, &field->type.specifier, field->array_len,
- A->space.funcs, A->space.structs, A->space.vars, A->mach, A->file, A->atoms))
- {
- slang_storage_aggregate_destruct (&agg);
- return GL_FALSE;
- }
- size = _slang_sizeof_aggregate (&agg);
- slang_storage_aggregate_destruct (&agg);
+ for (i = 0; i < tib->spec._struct->fields->num_variables; i++) {
+ slang_variable *field;
+ slang_storage_aggregate agg;
+ GLuint size;
+
+ field = &tib->spec._struct->fields->variables[i];
+ if (!slang_storage_aggregate_construct(&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable
+ (&agg, &field->type.specifier, field->array_len, A->space.funcs,
+ A->space.structs, A->space.vars, A->mach, A->file, A->atoms)) {
+ slang_storage_aggregate_destruct(&agg);
+ return GL_FALSE;
+ }
+ size = _slang_sizeof_aggregate(&agg);
+ slang_storage_aggregate_destruct(&agg);
if (op->a_id == field->a_name) {
field_size = size;
field_offset = struct_size;
}
struct_size += size;
- }
+ }
- if (ref == slang_ref_force)
- {
+ if (ref == slang_ref_force) {
GLboolean shift;
/*
- * OPTIMIZATION: If selecting first field, no address shifting is needed.
- */
+ * OPTIMIZATION: If selecting first field, no address shifting
+ * is needed.
+ */
shift = (field_offset != 0);
if (shift) {
- if (!PLAB (A->file, slang_asm_addr_push, field_offset))
+ if (!PLAB(A->file, slang_asm_addr_push, field_offset))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_add))
return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- }
- }
- else
- {
+ }
+ }
+ else {
GLboolean relocate, shrink;
- GLuint free_b = 0;
+ GLuint free_b = 0;
/*
- * OPTIMIZATION: If selecting last field, no relocation is needed.
- */
+ * OPTIMIZATION: If selecting last field, no relocation is needed.
+ */
relocate = (field_offset != (struct_size - field_size));
/*
- * OPTIMIZATION: If field and struct sizes are equal, no partial free is needed.
- */
+ * OPTIMIZATION: If field and struct sizes are equal, no partial
+ * free is needed.
+ */
shrink = (field_size != struct_size);
- if (relocate)
- {
- GLuint i;
+ if (relocate) {
+ GLuint i;
+
+ /*
+ * Move the selected element to the end of the master expression.
+ * Do it in reverse order to avoid overwriting itself.
+ */
+ if (!PLAB(A->file, slang_asm_addr_push, field_offset))
+ return GL_FALSE;
+ for (i = field_size; i > 0; i -= 4)
+ if (!PLAB2
+ (A->file, slang_asm_float_move,
+ struct_size - field_size + i, i))
+ return GL_FALSE;
+ free_b += 4;
+ }
+
+ if (shrink) {
+ /* free the rest of the master expression */
+ free_b += struct_size - field_size;
+ }
- /*
- * Move the selected element to the end of the master expression.
- * Do it in reverse order to avoid overwriting itself.
- */
- if (!PLAB (A->file, slang_asm_addr_push, field_offset))
+ if (free_b) {
+ if (!PLAB(A->file, slang_asm_local_free, free_b))
return GL_FALSE;
- for (i = field_size; i > 0; i -= 4)
- if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i, i))
- return GL_FALSE;
- free_b += 4;
- }
-
- if (shrink)
- {
- /* free the rest of the master expression */
- free_b += struct_size - field_size;
- }
-
- if (free_b)
- {
- if (!PLAB (A->file, slang_asm_local_free, free_b))
- return GL_FALSE;
- }
- }
- }
-
- return GL_TRUE;
+ }
+ }
+ }
+
+ return GL_TRUE;
}
-GLboolean _slang_assemble_operation (slang_assemble_ctx *A, slang_operation *op, slang_ref_type ref)
+GLboolean
+_slang_assemble_operation(slang_assemble_ctx * A, slang_operation * op,
+ slang_ref_type ref)
{
- /* set default results */
- A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ref;
- A->swz.num_components = 0;
-
- switch (op->type)
- {
- case slang_oper_block_no_new_scope:
- case slang_oper_block_new_scope:
- {
- GLuint i;
-
- for (i = 0; i < op->num_children; i++)
- {
- if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid/*slang_ref_freelance*/))
- return GL_FALSE;
- if (!_slang_cleanup_stack (A, &op->children[i]))
- return GL_FALSE;
- }
- }
- break;
- case slang_oper_variable_decl:
- {
- GLuint i;
- slang_operation assign;
- GLboolean result;
-
- /* Construct assignment expression placeholder. */
- if (!slang_operation_construct (&assign))
- return GL_FALSE;
- assign.type = slang_oper_assign;
- assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
- if (assign.children == NULL)
- {
- slang_operation_destruct (&assign);
- return GL_FALSE;
- }
- for (assign.num_children = 0; assign.num_children < 2; assign.num_children++)
- if (!slang_operation_construct (&assign.children[assign.num_children]))
- {
- slang_operation_destruct (&assign);
- return GL_FALSE;
- }
-
- result = GL_TRUE;
- for (i = 0; i < op->num_children; i++)
- {
- slang_variable *var;
-
- var = _slang_locate_variable (op->children[i].locals, op->children[i].a_id, GL_TRUE);
- if (var == NULL)
- {
- result = GL_FALSE;
- break;
- }
- if (var->initializer == NULL)
- continue;
-
- if (!slang_operation_copy (&assign.children[0], &op->children[i]) ||
- !slang_operation_copy (&assign.children[1], var->initializer) ||
- !_slang_assemble_assign (A, &assign, "=", slang_ref_forbid) ||
- !_slang_cleanup_stack (A, &assign))
- {
- result = GL_FALSE;
- break;
- }
- }
- slang_operation_destruct (&assign);
- if (!result)
- return GL_FALSE;
- }
- break;
- case slang_oper_asm:
- {
- GLuint i;
-
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
- return GL_FALSE;
- for (i = 1; i < op->num_children; i++)
- if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid))
- return GL_FALSE;
- if (!call_asm_instruction (A, op->a_id))
- return GL_FALSE;
- }
- break;
- case slang_oper_break:
- if (!PLAB (A->file, slang_asm_jump, A->flow.loop_end))
- return GL_FALSE;
- break;
- case slang_oper_continue:
- if (!PLAB (A->file, slang_asm_jump, A->flow.loop_start))
- return GL_FALSE;
- break;
- case slang_oper_discard:
- if (!PUSH (A->file, slang_asm_discard))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_exit))
- return GL_FALSE;
- break;
- case slang_oper_return:
- if (A->local.ret_size != 0)
- {
- /* push the result's address */
- if (!PLAB2 (A->file, slang_asm_local_addr, 0, A->local.ret_size))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
- return GL_FALSE;
-
- A->swz.num_components = 0;
- /* assign the operation to the function result (it was reserved on the stack) */
- if (!_slang_assemble_assignment (A, op->children))
- return GL_FALSE;
-
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- }
- if (!PLAB (A->file, slang_asm_jump, A->flow.function_end))
- return GL_FALSE;
- break;
- case slang_oper_expression:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[0], ref))
- return GL_FALSE;
- break;
- case slang_oper_if:
- if (!_slang_assemble_if (A, op))
- return GL_FALSE;
- break;
- case slang_oper_while:
- if (!_slang_assemble_while (A, op))
- return GL_FALSE;
- break;
- case slang_oper_do:
- if (!_slang_assemble_do (A, op))
- return GL_FALSE;
- break;
- case slang_oper_for:
- if (!_slang_assemble_for (A, op))
- return GL_FALSE;
- break;
- case slang_oper_void:
- break;
- case slang_oper_literal_bool:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!PLIT (A->file, slang_asm_bool_push, op->literal))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_literal_int:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!PLIT (A->file, slang_asm_int_push, op->literal))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_literal_float:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!PLIT (A->file, slang_asm_float_push, op->literal))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_identifier:
- {
- slang_variable *var;
- GLuint size;
-
- /* find the variable and calculate its size */
- var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
- if (var == NULL)
- return GL_FALSE;
- size = 0;
- if (!sizeof_variable (A, &var->type.specifier, slang_qual_none, var->array_len, &size))
- return GL_FALSE;
-
- /* prepare stack for dereferencing */
- if (ref == slang_ref_forbid)
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
-
- /* push the variable's address */
- if (var->global)
- {
- if (!PLAB (A->file, slang_asm_global_addr, var->address))
- return GL_FALSE;
- }
- else
- {
- if (!PLAB2 (A->file, slang_asm_local_addr, var->address, size))
- return GL_FALSE;
- }
-
- /* perform the dereference */
- if (ref == slang_ref_forbid)
- {
- if (!PUSH (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- if (!_slang_dereference (A, op))
- return GL_FALSE;
- }
- }
- break;
- case slang_oper_sequence:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
- return GL_FALSE;
- if (!_slang_cleanup_stack (A, &op->children[0]))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_assign:
- if (!_slang_assemble_assign (A, op, "=", ref))
- return GL_FALSE;
- break;
- case slang_oper_addassign:
- if (!_slang_assemble_assign (A, op, "+=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_subassign:
- if (!_slang_assemble_assign (A, op, "-=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_mulassign:
- if (!_slang_assemble_assign (A, op, "*=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- /*case slang_oper_modassign:*/
- /*case slang_oper_lshassign:*/
- /*case slang_oper_rshassign:*/
- /*case slang_oper_orassign:*/
- /*case slang_oper_xorassign:*/
- /*case slang_oper_andassign:*/
- case slang_oper_divassign:
- if (!_slang_assemble_assign (A, op, "/=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_select:
- if (!_slang_assemble_select (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_logicalor:
- if (!_slang_assemble_logicalor (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_logicaland:
- if (!_slang_assemble_logicaland (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_logicalxor:
- if (!_slang_assemble_function_call_name (A, "^^", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_bitor:*/
- /*case slang_oper_bitxor:*/
- /*case slang_oper_bitand:*/
- case slang_oper_less:
- if (!_slang_assemble_function_call_name (A, "<", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_greater:
- if (!_slang_assemble_function_call_name (A, ">", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_lessequal:
- if (!_slang_assemble_function_call_name (A, "<=", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_greaterequal:
- if (!_slang_assemble_function_call_name (A, ">=", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_lshift:*/
- /*case slang_oper_rshift:*/
- case slang_oper_add:
- if (!_slang_assemble_function_call_name (A, "+", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_subtract:
- if (!_slang_assemble_function_call_name (A, "-", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_multiply:
- if (!_slang_assemble_function_call_name (A, "*", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_modulus:*/
- case slang_oper_divide:
- if (!_slang_assemble_function_call_name (A, "/", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_equal:
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- if (!equality (A, op->children, GL_TRUE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_notequal:
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- if (!equality (A, op->children, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_preincrement:
- if (!_slang_assemble_assign (A, op, "++", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_predecrement:
- if (!_slang_assemble_assign (A, op, "--", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_plus:
- if (!_slang_dereference (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_minus:
- if (!_slang_assemble_function_call_name (A, "-", op->children, 1, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_complement:*/
- case slang_oper_not:
- if (!_slang_assemble_function_call_name (A, "!", op->children, 1, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_subscript:
- {
- slang_assembly_typeinfo ti_arr, ti_elem;
-
- if (!slang_assembly_typeinfo_construct (&ti_arr))
- return GL_FALSE;
- if (!slang_assembly_typeinfo_construct (&ti_elem))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- return GL_FALSE;
- }
- if (!handle_subscript (A, &ti_elem, &ti_arr, op, ref))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return GL_FALSE;
- }
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- }
- break;
- case slang_oper_call:
- {
- slang_function *fun;
-
- fun = _slang_locate_function (A->space.funcs, op->a_id, op->children, op->num_children,
- &A->space, A->atoms);
- if (fun == NULL)
- {
- if (!_slang_assemble_constructor (A, op))
- return GL_FALSE;
- }
- else
- {
- if (!_slang_assemble_function_call (A, fun, op->children, op->num_children, GL_FALSE))
- return GL_FALSE;
- }
- A->ref = slang_ref_forbid;
- }
- break;
- case slang_oper_field:
- {
- slang_assembly_typeinfo ti_after, ti_before;
-
- if (!slang_assembly_typeinfo_construct (&ti_after))
- return GL_FALSE;
- if (!slang_assembly_typeinfo_construct (&ti_before))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- return GL_FALSE;
- }
- if (!handle_field (A, &ti_after, &ti_before, op, ref))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- return GL_FALSE;
- }
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- }
- break;
- case slang_oper_postincrement:
- if (!assemble_function_call_name_dummyint (A, "++", op->children))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_postdecrement:
- if (!assemble_function_call_name_dummyint (A, "--", op->children))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- default:
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
+ /* set default results */
+ A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ ref;
+ A->swz.num_components = 0;
+
+ switch (op->type) {
+ case slang_oper_block_no_new_scope:
+ case slang_oper_block_new_scope:
+ {
+ GLuint i;
+
+ for (i = 0; i < op->num_children; i++) {
+ if (!_slang_assemble_operation
+ (A, &op->children[i],
+ slang_ref_forbid /*slang_ref_freelance */ ))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack(A, &op->children[i]))
+ return GL_FALSE;
+ }
+ }
+ break;
+ case slang_oper_variable_decl:
+ {
+ GLuint i;
+ slang_operation assign;
+ GLboolean result;
+
+ /* Construct assignment expression placeholder. */
+ if (!slang_operation_construct(&assign))
+ return GL_FALSE;
+ assign.type = slang_oper_assign;
+ assign.children =
+ (slang_operation *) slang_alloc_malloc(2 *
+ sizeof(slang_operation));
+ if (assign.children == NULL) {
+ slang_operation_destruct(&assign);
+ return GL_FALSE;
+ }
+ for (assign.num_children = 0; assign.num_children < 2;
+ assign.num_children++)
+ if (!slang_operation_construct
+ (&assign.children[assign.num_children])) {
+ slang_operation_destruct(&assign);
+ return GL_FALSE;
+ }
+
+ result = GL_TRUE;
+ for (i = 0; i < op->num_children; i++) {
+ slang_variable *var;
+
+ var =
+ _slang_locate_variable(op->children[i].locals,
+ op->children[i].a_id, GL_TRUE);
+ if (var == NULL) {
+ result = GL_FALSE;
+ break;
+ }
+ if (var->initializer == NULL)
+ continue;
+
+ if (!slang_operation_copy(&assign.children[0], &op->children[i])
+ || !slang_operation_copy(&assign.children[1],
+ var->initializer)
+ || !_slang_assemble_assign(A, &assign, "=", slang_ref_forbid)
+ || !_slang_cleanup_stack(A, &assign)) {
+ result = GL_FALSE;
+ break;
+ }
+ }
+ slang_operation_destruct(&assign);
+ if (!result)
+ return GL_FALSE;
+ }
+ break;
+ case slang_oper_asm:
+ {
+ GLuint i;
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ for (i = 1; i < op->num_children; i++)
+ if (!_slang_assemble_operation
+ (A, &op->children[i], slang_ref_forbid))
+ return GL_FALSE;
+ if (!call_asm_instruction(A, op->a_id))
+ return GL_FALSE;
+ }
+ break;
+ case slang_oper_break:
+ if (!PLAB(A->file, slang_asm_jump, A->flow.loop_end))
+ return GL_FALSE;
+ break;
+ case slang_oper_continue:
+ if (!PLAB(A->file, slang_asm_jump, A->flow.loop_start))
+ return GL_FALSE;
+ break;
+ case slang_oper_discard:
+ if (!PUSH(A->file, slang_asm_discard))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_exit))
+ return GL_FALSE;
+ break;
+ case slang_oper_return:
+ if (A->local.ret_size != 0) {
+ /* push the result's address */
+ if (!PLAB2(A->file, slang_asm_local_addr, 0, A->local.ret_size))
+ return GL_FALSE;
+ if (!_slang_assemble_operation
+ (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ A->swz.num_components = 0;
+ /* assign the operation to the function result (it was reserved on the stack) */
+ if (!_slang_assemble_assignment(A, op->children))
+ return GL_FALSE;
+
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+ if (!PLAB(A->file, slang_asm_jump, A->flow.function_end))
+ return GL_FALSE;
+ break;
+ case slang_oper_expression:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[0], ref))
+ return GL_FALSE;
+ break;
+ case slang_oper_if:
+ if (!_slang_assemble_if(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_while:
+ if (!_slang_assemble_while(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_do:
+ if (!_slang_assemble_do(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_for:
+ if (!_slang_assemble_for(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_void:
+ break;
+ case slang_oper_literal_bool:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT(A->file, slang_asm_bool_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_literal_int:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT(A->file, slang_asm_int_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_literal_float:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT(A->file, slang_asm_float_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_identifier:
+ {
+ slang_variable *var;
+ GLuint size;
+
+ /* find the variable and calculate its size */
+ var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE);
+ if (var == NULL)
+ return GL_FALSE;
+ size = 0;
+ if (!sizeof_variable
+ (A, &var->type.specifier, slang_qual_none, var->array_len,
+ &size))
+ return GL_FALSE;
+
+ /* prepare stack for dereferencing */
+ if (ref == slang_ref_forbid)
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+
+ /* push the variable's address */
+ if (var->global) {
+ if (!PLAB(A->file, slang_asm_global_addr, var->address))
+ return GL_FALSE;
+ }
+ else {
+ if (!PLAB2(A->file, slang_asm_local_addr, var->address, size))
+ return GL_FALSE;
+ }
+
+ /* perform the dereference */
+ if (ref == slang_ref_forbid) {
+ if (!PUSH(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference(A, op))
+ return GL_FALSE;
+ }
+ }
+ break;
+ case slang_oper_sequence:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[0],
+ slang_ref_forbid /*slang_ref_freelance */ ))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack(A, &op->children[0]))
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_assign:
+ if (!_slang_assemble_assign(A, op, "=", ref))
+ return GL_FALSE;
+ break;
+ case slang_oper_addassign:
+ if (!_slang_assemble_assign(A, op, "+=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_subassign:
+ if (!_slang_assemble_assign(A, op, "-=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_mulassign:
+ if (!_slang_assemble_assign(A, op, "*=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ /*case slang_oper_modassign: */
+ /*case slang_oper_lshassign: */
+ /*case slang_oper_rshassign: */
+ /*case slang_oper_orassign: */
+ /*case slang_oper_xorassign: */
+ /*case slang_oper_andassign: */
+ case slang_oper_divassign:
+ if (!_slang_assemble_assign(A, op, "/=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_select:
+ if (!_slang_assemble_select(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicalor:
+ if (!_slang_assemble_logicalor(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicaland:
+ if (!_slang_assemble_logicaland(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicalxor:
+ if (!_slang_assemble_function_call_name(A, "^^", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_bitor: */
+ /*case slang_oper_bitxor: */
+ /*case slang_oper_bitand: */
+ case slang_oper_less:
+ if (!_slang_assemble_function_call_name(A, "<", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_greater:
+ if (!_slang_assemble_function_call_name(A, ">", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_lessequal:
+ if (!_slang_assemble_function_call_name(A, "<=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_greaterequal:
+ if (!_slang_assemble_function_call_name(A, ">=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_lshift: */
+ /*case slang_oper_rshift: */
+ case slang_oper_add:
+ if (!_slang_assemble_function_call_name(A, "+", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_subtract:
+ if (!_slang_assemble_function_call_name(A, "-", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_multiply:
+ if (!_slang_assemble_function_call_name(A, "*", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_modulus: */
+ case slang_oper_divide:
+ if (!_slang_assemble_function_call_name(A, "/", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_equal:
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality(A, op->children, GL_TRUE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_notequal:
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality(A, op->children, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_preincrement:
+ if (!_slang_assemble_assign(A, op, "++", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_predecrement:
+ if (!_slang_assemble_assign(A, op, "--", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_plus:
+ if (!_slang_dereference(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_minus:
+ if (!_slang_assemble_function_call_name
+ (A, "-", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_complement: */
+ case slang_oper_not:
+ if (!_slang_assemble_function_call_name
+ (A, "!", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_subscript:
+ {
+ slang_assembly_typeinfo ti_arr, ti_elem;
+
+ if (!slang_assembly_typeinfo_construct(&ti_arr))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct(&ti_elem)) {
+ slang_assembly_typeinfo_destruct(&ti_arr);
+ return GL_FALSE;
+ }
+ if (!handle_subscript(A, &ti_elem, &ti_arr, op, ref)) {
+ slang_assembly_typeinfo_destruct(&ti_arr);
+ slang_assembly_typeinfo_destruct(&ti_elem);
+ return GL_FALSE;
+ }
+ slang_assembly_typeinfo_destruct(&ti_arr);
+ slang_assembly_typeinfo_destruct(&ti_elem);
+ }
+ break;
+ case slang_oper_call:
+ {
+ slang_function *fun;
+
+ fun =
+ _slang_locate_function(A->space.funcs, op->a_id, op->children,
+ op->num_children, &A->space, A->atoms);
+ if (fun == NULL) {
+ if (!_slang_assemble_constructor(A, op))
+ return GL_FALSE;
+ }
+ else {
+ if (!_slang_assemble_function_call
+ (A, fun, op->children, op->num_children, GL_FALSE))
+ return GL_FALSE;
+ }
+ A->ref = slang_ref_forbid;
+ }
+ break;
+ case slang_oper_field:
+ {
+ slang_assembly_typeinfo ti_after, ti_before;
+
+ if (!slang_assembly_typeinfo_construct(&ti_after))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct(&ti_before)) {
+ slang_assembly_typeinfo_destruct(&ti_after);
+ return GL_FALSE;
+ }
+ if (!handle_field(A, &ti_after, &ti_before, op, ref)) {
+ slang_assembly_typeinfo_destruct(&ti_after);
+ slang_assembly_typeinfo_destruct(&ti_before);
+ return GL_FALSE;
+ }
+ slang_assembly_typeinfo_destruct(&ti_after);
+ slang_assembly_typeinfo_destruct(&ti_before);
+ }
+ break;
+ case slang_oper_postincrement:
+ if (!assemble_function_call_name_dummyint(A, "++", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_postdecrement:
+ if (!assemble_function_call_name_dummyint(A, "--", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+}
diff --git a/src/mesa/shader/slang/slang_assemble.h b/src/mesa/shader/slang/slang_assemble.h
index 95e4fa263a3..d004e665003 100644
--- a/src/mesa/shader/slang/slang_assemble.h
+++ b/src/mesa/shader/slang/slang_assemble.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_ASSEMBLE_H
+#ifndef SLANG_ASSEMBLE_H
#define SLANG_ASSEMBLE_H
#include "slang_utility.h"
@@ -31,72 +31,82 @@
extern "C" {
#endif
+
struct slang_operation_;
typedef enum slang_assembly_type_
{
- /* core */
- slang_asm_none,
- slang_asm_float_copy,
- slang_asm_float_move,
- slang_asm_float_push,
- slang_asm_float_deref,
- slang_asm_float_add,
- slang_asm_float_multiply,
- slang_asm_float_divide,
- slang_asm_float_negate,
- slang_asm_float_less,
- slang_asm_float_equal_exp,
- slang_asm_float_equal_int,
- slang_asm_float_to_int,
- slang_asm_float_sine,
- slang_asm_float_arcsine,
- slang_asm_float_arctan,
- slang_asm_float_power,
- slang_asm_float_log2,
- slang_asm_float_floor,
- slang_asm_float_ceil,
- slang_asm_float_noise1,
- slang_asm_float_noise2,
- slang_asm_float_noise3,
- slang_asm_float_noise4,
- slang_asm_int_copy,
- slang_asm_int_move,
- slang_asm_int_push,
- slang_asm_int_deref,
- slang_asm_int_to_float,
- slang_asm_int_to_addr,
- slang_asm_bool_copy,
- slang_asm_bool_move,
- slang_asm_bool_push,
- slang_asm_bool_deref,
- slang_asm_addr_copy,
- slang_asm_addr_push,
- slang_asm_addr_deref,
- slang_asm_addr_add,
- slang_asm_addr_multiply,
- slang_asm_vec4_tex1d,
- slang_asm_vec4_tex2d,
- slang_asm_vec4_tex3d,
- slang_asm_vec4_texcube,
- slang_asm_vec4_shad1d,
- slang_asm_vec4_shad2d,
- slang_asm_jump,
- slang_asm_jump_if_zero,
- slang_asm_enter,
- slang_asm_leave,
- slang_asm_local_alloc,
- slang_asm_local_free,
- slang_asm_local_addr,
- slang_asm_global_addr,
- slang_asm_call,
- slang_asm_return,
- slang_asm_discard,
- slang_asm_exit,
+ /* core */
+ slang_asm_none,
+ slang_asm_float_copy,
+ slang_asm_float_move,
+ slang_asm_float_push,
+ slang_asm_float_deref,
+ slang_asm_float_add, /* a = pop(); b = pop(); push(a + b); */
+ slang_asm_float_multiply,
+ slang_asm_float_divide,
+ slang_asm_float_negate, /* push(-pop()) */
+ slang_asm_float_less, /* a = pop(); b = pop(); push(a < b); */
+ slang_asm_float_equal_exp,
+ slang_asm_float_equal_int,
+ slang_asm_float_to_int, /* push(floatToInt(pop())) */
+ slang_asm_float_sine, /* push(sin(pop()) */
+ slang_asm_float_arcsine,
+ slang_asm_float_arctan,
+ slang_asm_float_power, /* push(pow(pop(), pop())) */
+ slang_asm_float_log2,
+ slang_asm_float_floor,
+ slang_asm_float_ceil,
+ slang_asm_float_noise1, /* push(noise1(pop()) */
+ slang_asm_float_noise2, /* push(noise2(pop(), pop())) */
+ slang_asm_float_noise3,
+ slang_asm_float_noise4,
+
+ slang_asm_int_copy,
+ slang_asm_int_move,
+ slang_asm_int_push,
+ slang_asm_int_deref,
+ slang_asm_int_to_float,
+ slang_asm_int_to_addr,
+
+ slang_asm_bool_copy,
+ slang_asm_bool_move,
+ slang_asm_bool_push,
+ slang_asm_bool_deref,
+
+ slang_asm_addr_copy,
+ slang_asm_addr_push,
+ slang_asm_addr_deref,
+ slang_asm_addr_add,
+ slang_asm_addr_multiply,
+
+ slang_asm_vec4_tex1d,
+ slang_asm_vec4_tex2d,
+ slang_asm_vec4_tex3d,
+ slang_asm_vec4_texcube,
+ slang_asm_vec4_shad1d,
+ slang_asm_vec4_shad2d,
+
+ slang_asm_jump,
+ slang_asm_jump_if_zero,
+
+ slang_asm_enter,
+ slang_asm_leave,
+
+ slang_asm_local_alloc,
+ slang_asm_local_free,
+ slang_asm_local_addr,
+ slang_asm_global_addr,
+
+ slang_asm_call, /* push(ip); jump(inst->param[0]); */
+ slang_asm_return,
+
+ slang_asm_discard,
+ slang_asm_exit,
/* GL_MESA_shader_debug */
- slang_asm_float_print,
- slang_asm_int_print,
- slang_asm_bool_print,
+ slang_asm_float_print,
+ slang_asm_int_print,
+ slang_asm_bool_print,
/* vec4 */
slang_asm_float_to_vec4,
slang_asm_vec4_add,
@@ -109,111 +119,152 @@ typedef enum slang_assembly_type_
slang_asm_vec4_deref,
slang_asm_vec4_equal_int,
/* not a real assembly instruction */
- slang_asm__last
+ slang_asm__last
} slang_assembly_type;
+
+/**
+ * An assembly-level shader instruction.
+ */
typedef struct slang_assembly_
{
- slang_assembly_type type;
- GLfloat literal;
- GLuint param[2];
+ slang_assembly_type type; /**< The instruction opcode */
+ GLfloat literal; /**< float literal */
+ GLuint param[2]; /**< Two integer/address parameters */
} slang_assembly;
+
+/**
+ * A list of slang_assembly instructions
+ */
typedef struct slang_assembly_file_
{
- slang_assembly *code;
- GLuint count;
- GLuint capacity;
+ slang_assembly *code;
+ GLuint count;
+ GLuint capacity;
} slang_assembly_file;
+
+extern GLvoid
+_slang_assembly_file_ctr(slang_assembly_file *);
+
extern GLvoid
-_slang_assembly_file_ctr (slang_assembly_file *);
+slang_assembly_file_destruct(slang_assembly_file *);
+
+extern GLboolean
+slang_assembly_file_push(slang_assembly_file *, slang_assembly_type);
+
+extern GLboolean
+slang_assembly_file_push_label(slang_assembly_file *,
+ slang_assembly_type, GLuint);
+
+extern GLboolean
+slang_assembly_file_push_label2(slang_assembly_file *, slang_assembly_type,
+ GLuint, GLuint);
+
+extern GLboolean
+slang_assembly_file_push_literal(slang_assembly_file *,
+ slang_assembly_type, GLfloat);
-GLvoid slang_assembly_file_destruct (slang_assembly_file *);
-GLboolean slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);
-GLboolean slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);
-GLboolean slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);
-GLboolean slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);
typedef struct slang_assembly_file_restore_point_
{
- GLuint count;
+ GLuint count;
} slang_assembly_file_restore_point;
-GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *,
- slang_assembly_file_restore_point *);
-GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *,
- slang_assembly_file_restore_point *);
+
+extern GLboolean
+slang_assembly_file_restore_point_save(slang_assembly_file *,
+ slang_assembly_file_restore_point *);
+
+extern GLboolean
+slang_assembly_file_restore_point_load(slang_assembly_file *,
+ slang_assembly_file_restore_point *);
+
typedef struct slang_assembly_flow_control_
{
- GLuint loop_start; /* for "continue" statement */
- GLuint loop_end; /* for "break" statement */
- GLuint function_end; /* for "return" statement */
+ GLuint loop_start; /**< for "continue" statement */
+ GLuint loop_end; /**< for "break" statement */
+ GLuint function_end; /**< for "return" statement */
} slang_assembly_flow_control;
typedef struct slang_assembly_local_info_
{
- GLuint ret_size;
- GLuint addr_tmp;
- GLuint swizzle_tmp;
+ GLuint ret_size;
+ GLuint addr_tmp;
+ GLuint swizzle_tmp;
} slang_assembly_local_info;
typedef enum
{
- slang_ref_force,
- slang_ref_forbid/*,
- slang_ref_freelance*/
+ slang_ref_force,
+ slang_ref_forbid /**< slang_ref_freelance */
} slang_ref_type;
-/*
- * Holds a complete information about vector swizzle - the <swizzle> array contains
- * vector component source indices, where 0 is "x", 1 is "y", 2 is "z" and 3 is "w".
+/**
+ * Holds complete information about vector swizzle - the <swizzle>
+ * array contains vector component source indices, where 0 is "x", 1
+ * is "y", 2 is "z" and 3 is "w".
* Example: "xwz" --> { 3, { 0, 3, 2, not used } }.
*/
typedef struct slang_swizzle_
{
- GLuint num_components;
- GLuint swizzle[4];
+ GLuint num_components;
+ GLuint swizzle[4];
} slang_swizzle;
typedef struct slang_assembly_name_space_
{
- struct slang_function_scope_ *funcs;
- struct slang_struct_scope_ *structs;
- struct slang_variable_scope_ *vars;
+ struct slang_function_scope_ *funcs;
+ struct slang_struct_scope_ *structs;
+ struct slang_variable_scope_ *vars;
} slang_assembly_name_space;
typedef struct slang_assemble_ctx_
{
- slang_assembly_file *file;
- struct slang_machine_ *mach;
- slang_atom_pool *atoms;
- slang_assembly_name_space space;
- slang_assembly_flow_control flow;
- slang_assembly_local_info local;
- slang_ref_type ref;
- slang_swizzle swz;
+ slang_assembly_file *file;
+ struct slang_machine_ *mach;
+ slang_atom_pool *atoms;
+ slang_assembly_name_space space;
+ slang_assembly_flow_control flow;
+ slang_assembly_local_info local;
+ slang_ref_type ref;
+ slang_swizzle swz;
} slang_assemble_ctx;
-struct slang_function_ *_slang_locate_function (struct slang_function_scope_ *funcs, slang_atom name,
- struct slang_operation_ *params, GLuint num_params, slang_assembly_name_space *space,
- slang_atom_pool *);
+extern struct slang_function_ *
+_slang_locate_function(const struct slang_function_scope_ *funcs,
+ slang_atom name, const struct slang_operation_ *params,
+ GLuint num_params,
+ const slang_assembly_name_space *space,
+ slang_atom_pool *);
-GLboolean _slang_assemble_function (slang_assemble_ctx *, struct slang_function_ *);
+extern GLboolean
+_slang_assemble_function(slang_assemble_ctx *, struct slang_function_ *);
-GLboolean _slang_cleanup_stack (slang_assemble_ctx *, struct slang_operation_ *);
+extern GLboolean
+_slang_assemble_function2(slang_assemble_ctx * , struct slang_function_ *);
-GLboolean _slang_dereference (slang_assemble_ctx *, struct slang_operation_ *);
+extern GLboolean
+_slang_cleanup_stack(slang_assemble_ctx *, struct slang_operation_ *);
-GLboolean _slang_assemble_function_call (slang_assemble_ctx *, struct slang_function_ *,
- struct slang_operation_ *, GLuint, GLboolean);
+extern GLboolean
+_slang_dereference(slang_assemble_ctx *, struct slang_operation_ *);
-GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *, const char *,
- struct slang_operation_ *, GLuint, GLboolean);
+extern GLboolean
+_slang_assemble_function_call(slang_assemble_ctx *, struct slang_function_ *,
+ struct slang_operation_ *, GLuint, GLboolean);
+
+extern GLboolean
+_slang_assemble_function_call_name(slang_assemble_ctx *, const char *,
+ struct slang_operation_ *, GLuint,
+ GLboolean);
+
+extern GLboolean
+_slang_assemble_operation(slang_assemble_ctx *, struct slang_operation_ *,
+ slang_ref_type);
-GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operation_ *,
- slang_ref_type);
#ifdef __cplusplus
}
@@ -225,4 +276,3 @@ GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operatio
#include "slang_assemble_conditional.h"
#endif
-
diff --git a/src/mesa/shader/slang/slang_assemble_assignment.c b/src/mesa/shader/slang/slang_assemble_assignment.c
index d894a8db18c..a1038671c41 100644
--- a/src/mesa/shader/slang/slang_assemble_assignment.c
+++ b/src/mesa/shader/slang/slang_assemble_assignment.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -53,8 +53,11 @@
* +------------------+
*/
+
+
static GLboolean
-assign_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *index, GLuint size)
+assign_basic(slang_assemble_ctx * A, slang_storage_type type, GLuint * index,
+ GLuint size)
{
GLuint dst_offset, dst_addr_loc;
slang_assembly_type ty;
@@ -85,22 +88,25 @@ assign_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *index, GLu
ty = slang_asm_none;
}
- /* Calculate the distance from top of the stack to the destination address. As the
- * copy operation progresses, components of the source are being successively popped
- * off the stack by the amount of *index increase step.
- */
+ /* Calculate the distance from top of the stack to the destination
+ * address. As the copy operation progresses, components of the
+ * source are being successively popped off the stack by the amount
+ * of *index increase step.
+ */
dst_addr_loc = size - *index;
- if (!slang_assembly_file_push_label2 (A->file, ty, dst_addr_loc, dst_offset))
+ if (!slang_assembly_file_push_label2
+ (A->file, ty, dst_addr_loc, dst_offset))
return GL_FALSE;
- *index += _slang_sizeof_type (type);
+ *index += _slang_sizeof_type(type);
return GL_TRUE;
}
+
static GLboolean
-assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *index,
- GLuint size)
+assign_aggregate(slang_assemble_ctx * A, const slang_storage_aggregate * agg,
+ GLuint * index, GLuint size)
{
GLuint i;
@@ -110,25 +116,26 @@ assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLu
for (j = 0; j < arr->length; j++) {
if (arr->type == slang_stor_aggregate) {
- if (!assign_aggregate (A, arr->aggregate, index, size))
+ if (!assign_aggregate(A, arr->aggregate, index, size))
return GL_FALSE;
}
else {
- /* When the destination is swizzled, we are forced to do float_copy, even if
- * vec4 extension is enabled with vec4_copy operation.
+ /* When the destination is swizzled, we are forced to do
+ * float_copy, even if vec4 extension is enabled with
+ * vec4_copy operation.
*/
if (A->swz.num_components != 0 && arr->type == slang_stor_vec4) {
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
}
else {
- if (!assign_basic (A, arr->type, index, size))
+ if (!assign_basic(A, arr->type, index, size))
return GL_FALSE;
}
}
@@ -138,80 +145,79 @@ assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLu
return GL_TRUE;
}
-GLboolean _slang_assemble_assignment (slang_assemble_ctx *A, slang_operation *op)
+
+GLboolean
+_slang_assemble_assignment(slang_assemble_ctx * A, const slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg;
- GLuint index, size;
-
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end;
-
- index = 0;
- size = _slang_sizeof_aggregate (&agg);
- result = assign_aggregate (A, &agg, &index, size);
-
-end1:
- slang_storage_aggregate_destruct (&agg);
-end:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint index, size;
+
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end;
+
+ index = 0;
+ size = _slang_sizeof_aggregate(&agg);
+ result = assign_aggregate(A, &agg, &index, size);
+
+ end1:
+ slang_storage_aggregate_destruct(&agg);
+ end:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-/*
- * _slang_assemble_assign()
- *
- * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) assignment on the operation's
- * children.
- */
-GLboolean _slang_assemble_assign (slang_assemble_ctx *A, slang_operation *op, const char *oper,
- slang_ref_type ref)
+/**
+ * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=)
+ * assignment on the operation's children.
+ */
+GLboolean
+_slang_assemble_assign(slang_assemble_ctx * A, slang_operation * op,
+ const char *oper, slang_ref_type ref)
{
- slang_swizzle swz;
-
- if (ref == slang_ref_forbid)
- {
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
- }
-
- if (slang_string_compare ("=", oper) == 0)
- {
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
- return GL_FALSE;
- swz = A->swz;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- A->swz = swz;
- if (!_slang_assemble_assignment (A, op->children))
- return GL_FALSE;
- }
- else
- {
- if (!_slang_assemble_function_call_name (A, oper, op->children, op->num_children, GL_TRUE))
- return GL_FALSE;
- }
-
- if (ref == slang_ref_forbid)
- {
- if (!slang_assembly_file_push (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- if (!_slang_dereference (A, op->children))
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
+ slang_swizzle swz;
+
+ if (ref == slang_ref_forbid) {
+ if (!slang_assembly_file_push_label2
+ (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ }
+
+ if (slang_string_compare("=", oper) == 0) {
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ swz = A->swz;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->swz = swz;
+ if (!_slang_assemble_assignment(A, op->children))
+ return GL_FALSE;
+ }
+ else {
+ if (!_slang_assemble_function_call_name
+ (A, oper, op->children, op->num_children, GL_TRUE))
+ return GL_FALSE;
+ }
+
+ if (ref == slang_ref_forbid) {
+ if (!slang_assembly_file_push(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference(A, op->children))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+}
diff --git a/src/mesa/shader/slang/slang_assemble_assignment.h b/src/mesa/shader/slang/slang_assemble_assignment.h
index 7b993b543b1..3c1ecdedab8 100644
--- a/src/mesa/shader/slang/slang_assemble_assignment.h
+++ b/src/mesa/shader/slang/slang_assemble_assignment.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,21 +22,24 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H
+#ifndef SLANG_ASSEMBLE_ASSIGNMENT_H
#define SLANG_ASSEMBLE_ASSIGNMENT_H
#if defined __cplusplus
extern "C" {
#endif
-GLboolean _slang_assemble_assignment (slang_assemble_ctx *, struct slang_operation_ *);
-GLboolean _slang_assemble_assign (slang_assemble_ctx *, struct slang_operation_ *, const char *,
- slang_ref_type);
+extern GLboolean
+_slang_assemble_assignment(slang_assemble_ctx *, const struct slang_operation_ *);
+
+extern GLboolean
+_slang_assemble_assign(slang_assemble_ctx *, struct slang_operation_ *,
+ const char *, slang_ref_type);
+
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_ASSEMBLE_ASSIGNMENT_H */
diff --git a/src/mesa/shader/slang/slang_assemble_constructor.c b/src/mesa/shader/slang/slang_assemble_constructor.c
index 9d1aa707182..6cd320d4466 100644
--- a/src/mesa/shader/slang/slang_assemble_constructor.c
+++ b/src/mesa/shader/slang/slang_assemble_constructor.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -32,348 +32,370 @@
#include "slang_assemble.h"
#include "slang_storage.h"
-/* _slang_is_swizzle() */
-GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz)
+
+/**
+ * Checks if a field selector is a general swizzle (an r-value swizzle
+ * with replicated components or an l-value swizzle mask) for a
+ * vector. Returns GL_TRUE if this is the case, <swz> is filled with
+ * swizzle information. Returns GL_FALSE otherwise.
+ */
+GLboolean
+_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz)
{
- GLuint i;
- GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE;
-
- /* the swizzle can be at most 4-component long */
- swz->num_components = slang_string_length (field);
- if (swz->num_components > 4)
- return GL_FALSE;
-
- for (i = 0; i < swz->num_components; i++)
- {
- /* mark which swizzle group is used */
- switch (field[i])
- {
- case 'x':
- case 'y':
- case 'z':
- case 'w':
- xyzw = GL_TRUE;
- break;
- case 'r':
- case 'g':
- case 'b':
- case 'a':
- rgba = GL_TRUE;
- break;
- case 's':
- case 't':
- case 'p':
- case 'q':
- stpq = GL_TRUE;
- break;
- default:
- return GL_FALSE;
- }
-
- /* collect swizzle component */
- switch (field[i])
- {
- case 'x':
- case 'r':
- case 's':
- swz->swizzle[i] = 0;
- break;
- case 'y':
- case 'g':
- case 't':
- swz->swizzle[i] = 1;
- break;
- case 'z':
- case 'b':
- case 'p':
- swz->swizzle[i] = 2;
- break;
- case 'w':
- case 'a':
- case 'q':
- swz->swizzle[i] = 3;
- break;
- }
-
- /* check if the component is valid for given vector's row count */
- if (rows <= swz->swizzle[i])
- return GL_FALSE;
- }
-
- /* only one swizzle group can be used */
- if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq))
- return GL_FALSE;
-
- return GL_TRUE;
+ GLuint i;
+ GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE;
+
+ /* the swizzle can be at most 4-component long */
+ swz->num_components = slang_string_length(field);
+ if (swz->num_components > 4)
+ return GL_FALSE;
+
+ for (i = 0; i < swz->num_components; i++) {
+ /* mark which swizzle group is used */
+ switch (field[i]) {
+ case 'x':
+ case 'y':
+ case 'z':
+ case 'w':
+ xyzw = GL_TRUE;
+ break;
+ case 'r':
+ case 'g':
+ case 'b':
+ case 'a':
+ rgba = GL_TRUE;
+ break;
+ case 's':
+ case 't':
+ case 'p':
+ case 'q':
+ stpq = GL_TRUE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ /* collect swizzle component */
+ switch (field[i]) {
+ case 'x':
+ case 'r':
+ case 's':
+ swz->swizzle[i] = 0;
+ break;
+ case 'y':
+ case 'g':
+ case 't':
+ swz->swizzle[i] = 1;
+ break;
+ case 'z':
+ case 'b':
+ case 'p':
+ swz->swizzle[i] = 2;
+ break;
+ case 'w':
+ case 'a':
+ case 'q':
+ swz->swizzle[i] = 3;
+ break;
+ }
+
+ /* check if the component is valid for given vector's row count */
+ if (rows <= swz->swizzle[i])
+ return GL_FALSE;
+ }
+
+ /* only one swizzle group can be used */
+ if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq))
+ return GL_FALSE;
+
+ return GL_TRUE;
}
-/* _slang_is_swizzle_mask() */
-GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows)
+
+/**
+ * Checks if a general swizzle is an l-value swizzle - these swizzles
+ * do not have duplicated fields. Returns GL_TRUE if this is a
+ * swizzle mask. Returns GL_FALSE otherwise
+ */
+GLboolean
+_slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows)
{
- GLuint i, c = 0;
+ GLuint i, c = 0;
- /* the swizzle may not be longer than the vector dim */
- if (swz->num_components > rows)
- return GL_FALSE;
+ /* the swizzle may not be longer than the vector dim */
+ if (swz->num_components > rows)
+ return GL_FALSE;
- /* the swizzle components cannot be duplicated */
- for (i = 0; i < swz->num_components; i++)
- {
- if ((c & (1 << swz->swizzle[i])) != 0)
- return GL_FALSE;
- c |= 1 << swz->swizzle[i];
- }
+ /* the swizzle components cannot be duplicated */
+ for (i = 0; i < swz->num_components; i++) {
+ if ((c & (1 << swz->swizzle[i])) != 0)
+ return GL_FALSE;
+ c |= 1 << swz->swizzle[i];
+ }
- return GL_TRUE;
+ return GL_TRUE;
}
-/* _slang_multiply_swizzles() */
-GLvoid _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left,
- const slang_swizzle *right)
+
+/**
+ * Combines (multiplies) two swizzles to form single swizzle.
+ * Example: "vec.wzyx.yx" --> "vec.zw".
+ */
+GLvoid
+_slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left,
+ const slang_swizzle * right)
{
- GLuint i;
+ GLuint i;
- dst->num_components = right->num_components;
- for (i = 0; i < right->num_components; i++)
- dst->swizzle[i] = left->swizzle[right->swizzle[i]];
+ dst->num_components = right->num_components;
+ for (i = 0; i < right->num_components; i++)
+ dst->swizzle[i] = left->swizzle[right->swizzle[i]];
}
-/* _slang_assemble_constructor() */
+
static GLboolean
-sizeof_argument (slang_assemble_ctx *A, GLuint *size, slang_operation *op)
+sizeof_argument(slang_assemble_ctx * A, GLuint * size, slang_operation * op)
{
slang_assembly_typeinfo ti;
GLboolean result = GL_FALSE;
slang_storage_aggregate agg;
- if (!slang_assembly_typeinfo_construct (&ti))
+ if (!slang_assembly_typeinfo_construct(&ti))
return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
+ if (!_slang_typeof_operation(A, op, &ti))
goto end1;
- if (!slang_storage_aggregate_construct (&agg))
+ if (!slang_storage_aggregate_construct(&agg))
goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
goto end;
- *size = _slang_sizeof_aggregate (&agg);
+ *size = _slang_sizeof_aggregate(&agg);
result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
+ end:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
return result;
}
-static GLboolean constructor_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *flat,
- slang_operation *op, GLuint garbage_size)
+
+static GLboolean
+constructor_aggregate(slang_assemble_ctx * A,
+ const slang_storage_aggregate * flat,
+ slang_operation * op, GLuint garbage_size)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg, flat_agg;
-
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end2;
-
- if (!slang_storage_aggregate_construct (&flat_agg))
- goto end2;
- if (!_slang_flatten_aggregate (&flat_agg, &agg))
- goto end;
-
- if (!_slang_assemble_operation (A, op, slang_ref_forbid))
- goto end;
-
- /* TODO: convert (generic) elements */
-
- /* free the garbage */
- if (garbage_size != 0)
- {
- GLuint i;
-
- /* move the non-garbage part to the end of the argument */
- if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, 0))
- goto end;
- for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4)
- {
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_move,
- garbage_size + i, i))
- {
- goto end;
- }
- }
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, garbage_size + 4))
- goto end;
- }
-
- result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&flat_agg);
-end2:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat_agg;
+
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end2;
+
+ if (!slang_storage_aggregate_construct(&flat_agg))
+ goto end2;
+ if (!_slang_flatten_aggregate(&flat_agg, &agg))
+ goto end;
+
+ if (!_slang_assemble_operation(A, op, slang_ref_forbid))
+ goto end;
+
+ /* TODO: convert (generic) elements */
+
+ /* free the garbage */
+ if (garbage_size != 0) {
+ GLuint i;
+
+ /* move the non-garbage part to the end of the argument */
+ if (!slang_assembly_file_push_label(A->file, slang_asm_addr_push, 0))
+ goto end;
+ for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4) {
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_float_move,
+ garbage_size + i, i)) {
+ goto end;
+ }
+ }
+ if (!slang_assembly_file_push_label
+ (A->file, slang_asm_local_free, garbage_size + 4))
+ goto end;
+ }
+
+ result = GL_TRUE;
+ end:
+ slang_storage_aggregate_destruct(&flat_agg);
+ end2:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-GLboolean _slang_assemble_constructor (slang_assemble_ctx *A, slang_operation *op)
+
+GLboolean
+_slang_assemble_constructor(slang_assemble_ctx * A, const slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg, flat;
- GLuint size, i;
- GLuint arg_sums[2];
-
- /* get typeinfo of the constructor (the result of constructor expression) */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- /* create an aggregate of the constructor */
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end2;
-
- /* calculate size of the constructor */
- size = _slang_sizeof_aggregate (&agg);
-
- /* flatten the constructor */
- if (!slang_storage_aggregate_construct (&flat))
- goto end2;
- if (!_slang_flatten_aggregate (&flat, &agg))
- goto end;
-
- /* collect the last two constructor's argument size sums */
- arg_sums[0] = 0; /* will hold all but the last argument's size sum */
- arg_sums[1] = 0; /* will hold all argument's size sum */
- for (i = 0; i < op->num_children; i++)
- {
- GLuint arg_size = 0;
-
- if (!sizeof_argument (A, &arg_size, &op->children[i]))
- goto end;
- if (i > 0)
- arg_sums[0] = arg_sums[1];
- arg_sums[1] += arg_size;
- }
-
- /* check if there are too many arguments */
- if (arg_sums[0] >= size)
- {
- /* TODO: info log: too many arguments in constructor list */
- goto end;
- }
-
- /* check if there are too few arguments */
- if (arg_sums[1] < size)
- {
- /* TODO: info log: too few arguments in constructor list */
- goto end;
- }
-
- /* traverse the children that form the constructor expression */
- for (i = op->num_children; i > 0; i--)
- {
- GLuint garbage_size;
-
- /* the last argument may be too big - calculate the unnecessary data size */
- if (i == op->num_children)
- garbage_size = arg_sums[1] - size;
- else
- garbage_size = 0;
-
- if (!constructor_aggregate (A, &flat, &op->children[i - 1], garbage_size))
- goto end;
- }
-
- result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&flat);
-end2:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat;
+ GLuint size, i;
+ GLuint arg_sums[2];
+
+ /* get typeinfo of the constructor (the result of constructor expression) */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ /* create an aggregate of the constructor */
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end2;
+
+ /* calculate size of the constructor */
+ size = _slang_sizeof_aggregate(&agg);
+
+ /* flatten the constructor */
+ if (!slang_storage_aggregate_construct(&flat))
+ goto end2;
+ if (!_slang_flatten_aggregate(&flat, &agg))
+ goto end;
+
+ /* collect the last two constructor's argument size sums */
+ arg_sums[0] = 0; /* will hold all but the last argument's size sum */
+ arg_sums[1] = 0; /* will hold all argument's size sum */
+ for (i = 0; i < op->num_children; i++) {
+ GLuint arg_size = 0;
+
+ if (!sizeof_argument(A, &arg_size, &op->children[i]))
+ goto end;
+ if (i > 0)
+ arg_sums[0] = arg_sums[1];
+ arg_sums[1] += arg_size;
+ }
+
+ /* check if there are too many arguments */
+ if (arg_sums[0] >= size) {
+ /* TODO: info log: too many arguments in constructor list */
+ goto end;
+ }
+
+ /* check if there are too few arguments */
+ if (arg_sums[1] < size) {
+ /* TODO: info log: too few arguments in constructor list */
+ goto end;
+ }
+
+ /* traverse the children that form the constructor expression */
+ for (i = op->num_children; i > 0; i--) {
+ GLuint garbage_size;
+
+ /* the last argument may be too big - calculate the unnecessary
+ * data size
+ */
+ if (i == op->num_children)
+ garbage_size = arg_sums[1] - size;
+ else
+ garbage_size = 0;
+
+ if (!constructor_aggregate
+ (A, &flat, &op->children[i - 1], garbage_size))
+ goto end;
+ }
+
+ result = GL_TRUE;
+ end:
+ slang_storage_aggregate_destruct(&flat);
+ end2:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-/* _slang_assemble_constructor_from_swizzle() */
-GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *A, const slang_swizzle *swz,
- slang_type_specifier *spec, slang_type_specifier *master_spec)
+
+GLboolean
+_slang_assemble_constructor_from_swizzle(slang_assemble_ctx * A,
+ const slang_swizzle * swz,
+ const slang_type_specifier * spec,
+ const slang_type_specifier * master_spec)
{
- GLuint master_rows, i;
-
- master_rows = _slang_type_dim (master_spec->type);
- for (i = 0; i < master_rows; i++)
- {
- switch (_slang_type_base (master_spec->type))
- {
- case slang_spec_bool:
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_bool_copy,
- (master_rows - i) * 4, i * 4))
- return GL_FALSE;
- break;
- case slang_spec_int:
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_int_copy,
- (master_rows - i) * 4, i * 4))
- return GL_FALSE;
- break;
- case slang_spec_float:
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_copy,
- (master_rows - i) * 4, i * 4))
- return GL_FALSE;
- break;
- default:
- break;
- }
- }
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- for (i = swz->num_components; i > 0; i--)
- {
- GLuint n = i - 1;
-
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
- if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, swz->swizzle[n] * 4))
- return GL_FALSE;
- if (!slang_assembly_file_push (A->file, slang_asm_addr_add))
- return GL_FALSE;
- switch (_slang_type_base (master_spec->type))
- {
- case slang_spec_bool:
- if (!slang_assembly_file_push (A->file, slang_asm_bool_deref))
- return GL_FALSE;
- break;
- case slang_spec_int:
- if (!slang_assembly_file_push (A->file, slang_asm_int_deref))
- return GL_FALSE;
- break;
- case slang_spec_float:
- if (!slang_assembly_file_push (A->file, slang_asm_float_deref))
- return GL_FALSE;
- break;
- default:
- break;
- }
- }
-
- return GL_TRUE;
-}
+ const GLuint master_rows = _slang_type_dim(master_spec->type);
+ GLuint i;
+
+ for (i = 0; i < master_rows; i++) {
+ switch (_slang_type_base(master_spec->type)) {
+ case slang_spec_bool:
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_bool_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ case slang_spec_int:
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_int_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ case slang_spec_float:
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_float_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!slang_assembly_file_push_label(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ for (i = swz->num_components; i > 0; i--) {
+ const GLuint n = i - 1;
+
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_local_addr,
+ A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_addr_push,
+ swz->swizzle[n] * 4))
+ return GL_FALSE;
+ if (!slang_assembly_file_push(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+
+ switch (_slang_type_base(master_spec->type)) {
+ case slang_spec_bool:
+ if (!slang_assembly_file_push(A->file, slang_asm_bool_deref))
+ return GL_FALSE;
+ break;
+ case slang_spec_int:
+ if (!slang_assembly_file_push(A->file, slang_asm_int_deref))
+ return GL_FALSE;
+ break;
+ case slang_spec_float:
+ if (!slang_assembly_file_push(A->file, slang_asm_float_deref))
+ return GL_FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return GL_TRUE;
+}
diff --git a/src/mesa/shader/slang/slang_assemble_constructor.h b/src/mesa/shader/slang/slang_assemble_constructor.h
index 41a03943cf5..c0deb913448 100644
--- a/src/mesa/shader/slang/slang_assemble_constructor.h
+++ b/src/mesa/shader/slang/slang_assemble_constructor.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,43 +22,36 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H
+#ifndef SLANG_ASSEMBLE_CONSTRUCTOR_H
#define SLANG_ASSEMBLE_CONSTRUCTOR_H
#if defined __cplusplus
extern "C" {
#endif
-/*
- * Checks if a field selector is a general swizzle (an r-value swizzle with replicated
- * components or an l-value swizzle mask) for a vector.
- * Returns GL_TRUE if this is the case, <swz> is filled with swizzle information.
- * Returns GL_FALSE otherwise.
- */
-GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz);
-/*
- * Checks if a general swizzle is an l-value swizzle - these swizzles do not have
- * duplicated fields.
- * Returns GL_TRUE if this is a swizzle mask.
- * Returns GL_FALSE otherwise
- */
-GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows);
+extern GLboolean
+_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz);
-/*
- * Combines (multiplies) two swizzles to form single swizzle.
- * Example: "vec.wzyx.yx" --> "vec.zw".
- */
-GLvoid _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);
+extern GLboolean
+_slang_is_swizzle_mask(const slang_swizzle *swz, GLuint rows);
+
+extern GLvoid
+_slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *,
+ const slang_swizzle *);
-GLboolean _slang_assemble_constructor (slang_assemble_ctx *, struct slang_operation_ *);
+extern GLboolean
+_slang_assemble_constructor(slang_assemble_ctx *,
+ const struct slang_operation_ *);
-GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *, const slang_swizzle *,
- slang_type_specifier *, slang_type_specifier *);
+extern GLboolean
+_slang_assemble_constructor_from_swizzle(slang_assemble_ctx *,
+ const slang_swizzle *,
+ const slang_type_specifier *,
+ const slang_type_specifier *);
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_ASSEMBLE_CONSTRUCTOR_H */
diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.c b/src/mesa/shader/slang/slang_assemble_typeinfo.c
index 58f4e24f256..265e417dadd 100644
--- a/src/mesa/shader/slang/slang_assemble_typeinfo.c
+++ b/src/mesa/shader/slang/slang_assemble_typeinfo.c
@@ -36,552 +36,590 @@
* slang_type_specifier
*/
-GLvoid slang_type_specifier_ctr (slang_type_specifier *self)
+GLvoid
+slang_type_specifier_ctr(slang_type_specifier * self)
{
- self->type = slang_spec_void;
- self->_struct = NULL;
- self->_array = NULL;
+ self->type = slang_spec_void;
+ self->_struct = NULL;
+ self->_array = NULL;
}
-GLvoid slang_type_specifier_dtr (slang_type_specifier *self)
+GLvoid
+slang_type_specifier_dtr(slang_type_specifier * self)
{
- if (self->_struct != NULL)
- {
- slang_struct_destruct (self->_struct);
- slang_alloc_free (self->_struct);
- }
- if (self->_array != NULL)
- {
- slang_type_specifier_dtr (self->_array);
- slang_alloc_free (self->_array);
- }
+ if (self->_struct != NULL) {
+ slang_struct_destruct(self->_struct);
+ slang_alloc_free(self->_struct);
+ }
+ if (self->_array != NULL) {
+ slang_type_specifier_dtr(self->_array);
+ slang_alloc_free(self->_array);
+ }
}
-GLboolean slang_type_specifier_copy (slang_type_specifier *x, const slang_type_specifier *y)
+GLboolean
+slang_type_specifier_copy(slang_type_specifier * x,
+ const slang_type_specifier * y)
{
- slang_type_specifier z;
-
- slang_type_specifier_ctr (&z);
- z.type = y->type;
- if (z.type == slang_spec_struct)
- {
- z._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (z._struct == NULL)
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- if (!slang_struct_construct (z._struct))
- {
- slang_alloc_free (z._struct);
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- if (!slang_struct_copy (z._struct, y->_struct))
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- }
- else if (z.type == slang_spec_array)
- {
- z._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (slang_type_specifier));
- if (z._array == NULL)
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- slang_type_specifier_ctr (z._array);
- if (!slang_type_specifier_copy (z._array, y->_array))
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- }
- slang_type_specifier_dtr (x);
- *x = z;
- return GL_TRUE;
+ slang_type_specifier z;
+
+ slang_type_specifier_ctr(&z);
+ z.type = y->type;
+ if (z.type == slang_spec_struct) {
+ z._struct = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (z._struct == NULL) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_construct(z._struct)) {
+ slang_alloc_free(z._struct);
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_copy(z._struct, y->_struct)) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ }
+ else if (z.type == slang_spec_array) {
+ z._array =
+ (slang_type_specifier *)
+ slang_alloc_malloc(sizeof(slang_type_specifier));
+ if (z._array == NULL) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ slang_type_specifier_ctr(z._array);
+ if (!slang_type_specifier_copy(z._array, y->_array)) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ }
+ slang_type_specifier_dtr(x);
+ *x = z;
+ return GL_TRUE;
}
-GLboolean slang_type_specifier_equal (const slang_type_specifier *x, const slang_type_specifier *y)
+GLboolean
+slang_type_specifier_equal(const slang_type_specifier * x,
+ const slang_type_specifier * y)
{
- if (x->type != y->type)
- return 0;
- if (x->type == slang_spec_struct)
- return slang_struct_equal (x->_struct, y->_struct);
- if (x->type == slang_spec_array)
- return slang_type_specifier_equal (x->_array, y->_array);
- return 1;
+ if (x->type != y->type)
+ return 0;
+ if (x->type == slang_spec_struct)
+ return slang_struct_equal(x->_struct, y->_struct);
+ if (x->type == slang_spec_array)
+ return slang_type_specifier_equal(x->_array, y->_array);
+ return 1;
}
/* slang_assembly_typeinfo */
-GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *ti)
+GLboolean
+slang_assembly_typeinfo_construct(slang_assembly_typeinfo * ti)
{
- slang_type_specifier_ctr (&ti->spec);
- ti->array_len = 0;
- return GL_TRUE;
+ slang_type_specifier_ctr(&ti->spec);
+ ti->array_len = 0;
+ return GL_TRUE;
}
-GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *ti)
+GLvoid
+slang_assembly_typeinfo_destruct(slang_assembly_typeinfo * ti)
{
- slang_type_specifier_dtr (&ti->spec);
+ slang_type_specifier_dtr(&ti->spec);
}
/* _slang_typeof_operation() */
-static GLboolean typeof_existing_function (const char *name, slang_operation *params,
- GLuint num_params, slang_assembly_name_space *space, slang_type_specifier *spec,
- slang_atom_pool *atoms)
+/**
+ * Determine the return type of a function.
+ * \param name name of the function
+ * \param params array of function parameters
+ * \param num_params number of parameters
+ * \param space namespace to use
+ * \param spec returns the function's type
+ * \param atoms atom pool
+ * \return GL_TRUE for success, GL_FALSE if failure
+ */
+static GLboolean
+typeof_existing_function(const char *name, const slang_operation * params,
+ GLuint num_params,
+ const slang_assembly_name_space * space,
+ slang_type_specifier * spec,
+ slang_atom_pool * atoms)
{
- slang_atom atom;
- GLboolean exists;
-
- atom = slang_atom_pool_atom (atoms, name);
- if (!_slang_typeof_function (atom, params, num_params, space, spec, &exists, atoms))
- return GL_FALSE;
- return exists;
+ slang_atom atom;
+ GLboolean exists;
+
+ atom = slang_atom_pool_atom(atoms, name);
+ if (!_slang_typeof_function(atom, params, num_params, space, spec,
+ &exists, atoms))
+ return GL_FALSE;
+ return exists;
}
-GLboolean _slang_typeof_operation (slang_assemble_ctx *A, slang_operation *op,
- slang_assembly_typeinfo *ti)
+GLboolean
+_slang_typeof_operation(const slang_assemble_ctx * A,
+ const slang_operation * op,
+ slang_assembly_typeinfo * ti)
{
- return _slang_typeof_operation_ (op, &A->space, ti, A->atoms);
+ return _slang_typeof_operation_(op, &A->space, ti, A->atoms);
}
-GLboolean _slang_typeof_operation_ (slang_operation *op, slang_assembly_name_space *space,
- slang_assembly_typeinfo *ti, slang_atom_pool *atoms)
+
+/**
+ * Determine the return type of an operation.
+ * \param op the operation node
+ * \param space the namespace to use
+ * \param ti the returned type
+ * \param atoms atom pool
+ * \return GL_TRUE for success, GL_FALSE if failure
+ */
+GLboolean
+_slang_typeof_operation_(const slang_operation * op,
+ const slang_assembly_name_space * space,
+ slang_assembly_typeinfo * ti,
+ slang_atom_pool * atoms)
{
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
-
- switch (op->type)
- {
- case slang_oper_block_no_new_scope:
- case slang_oper_block_new_scope:
- case slang_oper_variable_decl:
- case slang_oper_asm:
- case slang_oper_break:
- case slang_oper_continue:
- case slang_oper_discard:
- case slang_oper_return:
- case slang_oper_if:
- case slang_oper_while:
- case slang_oper_do:
- case slang_oper_for:
- case slang_oper_void:
- ti->spec.type = slang_spec_void;
- break;
- case slang_oper_expression:
- case slang_oper_assign:
- case slang_oper_addassign:
- case slang_oper_subassign:
- case slang_oper_mulassign:
- case slang_oper_divassign:
- case slang_oper_preincrement:
- case slang_oper_predecrement:
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
- return 0;
- break;
- case slang_oper_literal_bool:
- case slang_oper_logicalor:
- case slang_oper_logicalxor:
- case slang_oper_logicaland:
- case slang_oper_equal:
- case slang_oper_notequal:
- case slang_oper_less:
- case slang_oper_greater:
- case slang_oper_lessequal:
- case slang_oper_greaterequal:
- case slang_oper_not:
- ti->spec.type = slang_spec_bool;
- break;
- case slang_oper_literal_int:
- ti->spec.type = slang_spec_int;
- break;
- case slang_oper_literal_float:
- ti->spec.type = slang_spec_float;
- break;
- case slang_oper_identifier:
- {
- slang_variable *var;
-
- var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
- if (var == NULL)
- return GL_FALSE;
- if (!slang_type_specifier_copy (&ti->spec, &var->type.specifier))
- return GL_FALSE;
- ti->can_be_referenced = GL_TRUE;
- ti->array_len = var->array_len;
- }
- break;
- case slang_oper_sequence:
- /* TODO: check [0] and [1] if they match */
- if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- /*case slang_oper_modassign:*/
- /*case slang_oper_lshassign:*/
- /*case slang_oper_rshassign:*/
- /*case slang_oper_orassign:*/
- /*case slang_oper_xorassign:*/
- /*case slang_oper_andassign:*/
- case slang_oper_select:
- /* TODO: check [1] and [2] if they match */
- if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- /*case slang_oper_bitor:*/
- /*case slang_oper_bitxor:*/
- /*case slang_oper_bitand:*/
- /*case slang_oper_lshift:*/
- /*case slang_oper_rshift:*/
- case slang_oper_add:
- if (!typeof_existing_function ("+", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- case slang_oper_subtract:
- if (!typeof_existing_function ("-", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- case slang_oper_multiply:
- if (!typeof_existing_function ("*", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- case slang_oper_divide:
- if (!typeof_existing_function ("/", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- /*case slang_oper_modulus:*/
- case slang_oper_plus:
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- case slang_oper_minus:
- if (!typeof_existing_function ("-", op->children, 1, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- /*case slang_oper_complement:*/
- case slang_oper_subscript:
- {
- slang_assembly_typeinfo _ti;
-
- if (!slang_assembly_typeinfo_construct (&_ti))
- return GL_FALSE;
- if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->can_be_referenced = _ti.can_be_referenced;
- if (_ti.spec.type == slang_spec_array)
- {
- if (!slang_type_specifier_copy (&ti->spec, _ti.spec._array))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- }
- else
- {
- if (!_slang_type_is_vector (_ti.spec.type) && !_slang_type_is_matrix (_ti.spec.type))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->spec.type = _slang_type_base (_ti.spec.type);
- }
- slang_assembly_typeinfo_destruct (&_ti);
- }
- break;
- case slang_oper_call:
- {
- GLboolean exists;
-
- if (!_slang_typeof_function (op->a_id, op->children, op->num_children, space, &ti->spec,
- &exists, atoms))
- return GL_FALSE;
- if (!exists)
- {
- slang_struct *s = slang_struct_scope_find (space->structs, op->a_id, GL_TRUE);
- if (s != NULL)
- {
- ti->spec.type = slang_spec_struct;
- ti->spec._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (ti->spec._struct == NULL)
- return GL_FALSE;
- if (!slang_struct_construct (ti->spec._struct))
- {
- slang_alloc_free (ti->spec._struct);
- ti->spec._struct = NULL;
- return GL_FALSE;
- }
- if (!slang_struct_copy (ti->spec._struct, s))
- return GL_FALSE;
- }
- else
- {
- const char *name;
- slang_type_specifier_type type;
-
- name = slang_atom_pool_id (atoms, op->a_id);
- type = slang_type_specifier_type_from_string (name);
- if (type == slang_spec_void)
- return GL_FALSE;
- ti->spec.type = type;
- }
- }
- }
- break;
- case slang_oper_field:
- {
- slang_assembly_typeinfo _ti;
-
- if (!slang_assembly_typeinfo_construct (&_ti))
- return GL_FALSE;
- if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- if (_ti.spec.type == slang_spec_struct)
- {
- slang_variable *field;
-
- field = _slang_locate_variable (_ti.spec._struct->fields, op->a_id, GL_FALSE);
- if (field == NULL)
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- if (!slang_type_specifier_copy (&ti->spec, &field->type.specifier))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->can_be_referenced = _ti.can_be_referenced;
- }
- else
- {
- GLuint rows;
- const char *swizzle;
- slang_type_specifier_type base;
-
- /* determine the swizzle of the field expression */
- if (!_slang_type_is_vector (_ti.spec.type))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- rows = _slang_type_dim (_ti.spec.type);
- swizzle = slang_atom_pool_id (atoms, op->a_id);
- if (!_slang_is_swizzle (swizzle, rows, &ti->swz))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->is_swizzled = GL_TRUE;
- ti->can_be_referenced = _ti.can_be_referenced && _slang_is_swizzle_mask (&ti->swz,
- rows);
- if (_ti.is_swizzled)
- {
- slang_swizzle swz;
-
- /* swizzle the swizzle */
- _slang_multiply_swizzles (&swz, &_ti.swz, &ti->swz);
- ti->swz = swz;
- }
- base = _slang_type_base (_ti.spec.type);
- switch (ti->swz.num_components)
- {
- case 1:
- ti->spec.type = base;
- break;
- case 2:
- switch (base)
- {
- case slang_spec_float:
- ti->spec.type = slang_spec_vec2;
- break;
- case slang_spec_int:
- ti->spec.type = slang_spec_ivec2;
- break;
- case slang_spec_bool:
- ti->spec.type = slang_spec_bvec2;
- break;
- default:
- break;
- }
- break;
- case 3:
- switch (base)
- {
- case slang_spec_float:
- ti->spec.type = slang_spec_vec3;
- break;
- case slang_spec_int:
- ti->spec.type = slang_spec_ivec3;
- break;
- case slang_spec_bool:
- ti->spec.type = slang_spec_bvec3;
- break;
- default:
- break;
- }
- break;
- case 4:
- switch (base)
- {
- case slang_spec_float:
- ti->spec.type = slang_spec_vec4;
- break;
- case slang_spec_int:
- ti->spec.type = slang_spec_ivec4;
- break;
- case slang_spec_bool:
- ti->spec.type = slang_spec_bvec4;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- slang_assembly_typeinfo_destruct (&_ti);
- }
- break;
- case slang_oper_postincrement:
- case slang_oper_postdecrement:
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- default:
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+
+ switch (op->type) {
+ case slang_oper_block_no_new_scope:
+ case slang_oper_block_new_scope:
+ case slang_oper_variable_decl:
+ case slang_oper_asm:
+ case slang_oper_break:
+ case slang_oper_continue:
+ case slang_oper_discard:
+ case slang_oper_return:
+ case slang_oper_if:
+ case slang_oper_while:
+ case slang_oper_do:
+ case slang_oper_for:
+ case slang_oper_void:
+ ti->spec.type = slang_spec_void;
+ break;
+ case slang_oper_expression:
+ case slang_oper_assign:
+ case slang_oper_addassign:
+ case slang_oper_subassign:
+ case slang_oper_mulassign:
+ case slang_oper_divassign:
+ case slang_oper_preincrement:
+ case slang_oper_predecrement:
+ if (!_slang_typeof_operation_(op->children, space, ti, atoms))
+ return 0;
+ break;
+ case slang_oper_literal_bool:
+ case slang_oper_logicalor:
+ case slang_oper_logicalxor:
+ case slang_oper_logicaland:
+ case slang_oper_equal:
+ case slang_oper_notequal:
+ case slang_oper_less:
+ case slang_oper_greater:
+ case slang_oper_lessequal:
+ case slang_oper_greaterequal:
+ case slang_oper_not:
+ ti->spec.type = slang_spec_bool;
+ break;
+ case slang_oper_literal_int:
+ ti->spec.type = slang_spec_int;
+ break;
+ case slang_oper_literal_float:
+ ti->spec.type = slang_spec_float;
+ break;
+ case slang_oper_identifier:
+ {
+ slang_variable *var;
+
+ var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE);
+ if (var == NULL)
+ return GL_FALSE;
+ if (!slang_type_specifier_copy(&ti->spec, &var->type.specifier))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_TRUE;
+ ti->array_len = var->array_len;
+ }
+ break;
+ case slang_oper_sequence:
+ /* TODO: check [0] and [1] if they match */
+ if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ /*case slang_oper_modassign: */
+ /*case slang_oper_lshassign: */
+ /*case slang_oper_rshassign: */
+ /*case slang_oper_orassign: */
+ /*case slang_oper_xorassign: */
+ /*case slang_oper_andassign: */
+ case slang_oper_select:
+ /* TODO: check [1] and [2] if they match */
+ if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ /*case slang_oper_bitor: */
+ /*case slang_oper_bitxor: */
+ /*case slang_oper_bitand: */
+ /*case slang_oper_lshift: */
+ /*case slang_oper_rshift: */
+ case slang_oper_add:
+ if (!typeof_existing_function("+", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_subtract:
+ if (!typeof_existing_function("-", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_multiply:
+ if (!typeof_existing_function("*", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_divide:
+ if (!typeof_existing_function("/", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ /*case slang_oper_modulus: */
+ case slang_oper_plus:
+ if (!_slang_typeof_operation_(op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ case slang_oper_minus:
+ if (!typeof_existing_function
+ ("-", op->children, 1, space, &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ /*case slang_oper_complement: */
+ case slang_oper_subscript:
+ {
+ slang_assembly_typeinfo _ti;
+
+ if (!slang_assembly_typeinfo_construct(&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_(op->children, space, &_ti, atoms)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->can_be_referenced = _ti.can_be_referenced;
+ if (_ti.spec.type == slang_spec_array) {
+ if (!slang_type_specifier_copy(&ti->spec, _ti.spec._array)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ }
+ else {
+ if (!_slang_type_is_vector(_ti.spec.type)
+ && !_slang_type_is_matrix(_ti.spec.type)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->spec.type = _slang_type_base(_ti.spec.type);
+ }
+ slang_assembly_typeinfo_destruct(&_ti);
+ }
+ break;
+ case slang_oper_call:
+ {
+ GLboolean exists;
+
+ if (!_slang_typeof_function(op->a_id, op->children, op->num_children,
+ space, &ti->spec, &exists, atoms))
+ return GL_FALSE;
+ if (!exists) {
+ slang_struct *s =
+ slang_struct_scope_find(space->structs, op->a_id, GL_TRUE);
+ if (s != NULL) {
+ ti->spec.type = slang_spec_struct;
+ ti->spec._struct =
+ (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (ti->spec._struct == NULL)
+ return GL_FALSE;
+ if (!slang_struct_construct(ti->spec._struct)) {
+ slang_alloc_free(ti->spec._struct);
+ ti->spec._struct = NULL;
+ return GL_FALSE;
+ }
+ if (!slang_struct_copy(ti->spec._struct, s))
+ return GL_FALSE;
+ }
+ else {
+ const char *name;
+ slang_type_specifier_type type;
+
+ name = slang_atom_pool_id(atoms, op->a_id);
+ type = slang_type_specifier_type_from_string(name);
+ if (type == slang_spec_void)
+ return GL_FALSE;
+ ti->spec.type = type;
+ }
+ }
+ }
+ break;
+ case slang_oper_field:
+ {
+ slang_assembly_typeinfo _ti;
+
+ if (!slang_assembly_typeinfo_construct(&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_(op->children, space, &_ti, atoms)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ if (_ti.spec.type == slang_spec_struct) {
+ slang_variable *field;
+
+ field =
+ _slang_locate_variable(_ti.spec._struct->fields, op->a_id,
+ GL_FALSE);
+ if (field == NULL) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ if (!slang_type_specifier_copy(&ti->spec, &field->type.specifier)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->can_be_referenced = _ti.can_be_referenced;
+ }
+ else {
+ GLuint rows;
+ const char *swizzle;
+ slang_type_specifier_type base;
+
+ /* determine the swizzle of the field expression */
+ if (!_slang_type_is_vector(_ti.spec.type)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ rows = _slang_type_dim(_ti.spec.type);
+ swizzle = slang_atom_pool_id(atoms, op->a_id);
+ if (!_slang_is_swizzle(swizzle, rows, &ti->swz)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->is_swizzled = GL_TRUE;
+ ti->can_be_referenced = _ti.can_be_referenced
+ && _slang_is_swizzle_mask(&ti->swz, rows);
+ if (_ti.is_swizzled) {
+ slang_swizzle swz;
+
+ /* swizzle the swizzle */
+ _slang_multiply_swizzles(&swz, &_ti.swz, &ti->swz);
+ ti->swz = swz;
+ }
+ base = _slang_type_base(_ti.spec.type);
+ switch (ti->swz.num_components) {
+ case 1:
+ ti->spec.type = base;
+ break;
+ case 2:
+ switch (base) {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec2;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec2;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec2;
+ break;
+ default:
+ break;
+ }
+ break;
+ case 3:
+ switch (base) {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec3;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec3;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec3;
+ break;
+ default:
+ break;
+ }
+ break;
+ case 4:
+ switch (base) {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec4;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec4;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec4;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ slang_assembly_typeinfo_destruct(&_ti);
+ }
+ break;
+ case slang_oper_postincrement:
+ case slang_oper_postdecrement:
+ if (!_slang_typeof_operation_(op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
-/* _slang_typeof_function() */
-GLboolean _slang_typeof_function (slang_atom a_name, slang_operation *params, GLuint num_params,
- slang_assembly_name_space *space, slang_type_specifier *spec, GLboolean *exists,
- slang_atom_pool *atoms)
+
+/**
+ * Determine the return type of a function.
+ * \param a_name the function name
+ * \param param function parameters (overloading)
+ * \param num_params number of parameters to function
+ * \param space namespace to search
+ * \param exists returns GL_TRUE or GL_FALSE to indicate existance of function
+ * \return GL_TRUE for success, GL_FALSE if failure (bad function name)
+ */
+GLboolean
+_slang_typeof_function(slang_atom a_name, const slang_operation * params,
+ GLuint num_params,
+ const slang_assembly_name_space * space,
+ slang_type_specifier * spec, GLboolean * exists,
+ slang_atom_pool * atoms)
{
- slang_function *fun;
-
- fun = _slang_locate_function (space->funcs, a_name, params, num_params, space, atoms);
- *exists = fun != NULL;
- if (fun == NULL)
- return GL_TRUE;
- return slang_type_specifier_copy (spec, &fun->header.type.specifier);
+ slang_function *fun = _slang_locate_function(space->funcs, a_name, params,
+ num_params, space, atoms);
+ *exists = fun != NULL;
+ if (!fun)
+ return GL_TRUE; /* yes, not false */
+ return slang_type_specifier_copy(spec, &fun->header.type.specifier);
}
-/* _slang_type_is_matrix() */
-GLboolean _slang_type_is_matrix (slang_type_specifier_type ty)
+
+/**
+ * Determine if a type is a matrix.
+ * \return GL_TRUE if is a matrix, GL_FALSE otherwise.
+ */
+GLboolean
+_slang_type_is_matrix(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_mat2:
- case slang_spec_mat3:
- case slang_spec_mat4:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
+ switch (ty) {
+ case slang_spec_mat2:
+ case slang_spec_mat3:
+ case slang_spec_mat4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
}
-/* _slang_type_is_vector() */
-GLboolean _slang_type_is_vector (slang_type_specifier_type ty)
+/**
+ * Determine if a type is a vector.
+ * \return GL_TRUE if is a vector, GL_FALSE otherwise.
+ */
+GLboolean
+_slang_type_is_vector(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
+ switch (ty) {
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
}
-/* _slang_type_base_of_vector() */
-slang_type_specifier_type _slang_type_base (slang_type_specifier_type ty)
+/**
+ * Given a vector type, return the type of the vector's elements
+ */
+slang_type_specifier_type
+_slang_type_base(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_float:
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- return slang_spec_float;
- case slang_spec_int:
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- return slang_spec_int;
- case slang_spec_bool:
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- return slang_spec_bool;
- case slang_spec_mat2:
- return slang_spec_vec2;
- case slang_spec_mat3:
- return slang_spec_vec3;
- case slang_spec_mat4:
- return slang_spec_vec4;
- default:
- return slang_spec_void;
- }
+ switch (ty) {
+ case slang_spec_float:
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ return slang_spec_float;
+ case slang_spec_int:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ return slang_spec_int;
+ case slang_spec_bool:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return slang_spec_bool;
+ case slang_spec_mat2:
+ return slang_spec_vec2;
+ case slang_spec_mat3:
+ return slang_spec_vec3;
+ case slang_spec_mat4:
+ return slang_spec_vec4;
+ default:
+ return slang_spec_void;
+ }
}
-/* _slang_type_dim */
-GLuint _slang_type_dim (slang_type_specifier_type ty)
+/**
+ * Return the dimensionality of a vector or matrix type.
+ */
+GLuint
+_slang_type_dim(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_float:
- case slang_spec_int:
- case slang_spec_bool:
- return 1;
- case slang_spec_vec2:
- case slang_spec_ivec2:
- case slang_spec_bvec2:
- case slang_spec_mat2:
- return 2;
- case slang_spec_vec3:
- case slang_spec_ivec3:
- case slang_spec_bvec3:
- case slang_spec_mat3:
- return 3;
- case slang_spec_vec4:
- case slang_spec_ivec4:
- case slang_spec_bvec4:
- case slang_spec_mat4:
- return 4;
- default:
- return 0;
- }
+ switch (ty) {
+ case slang_spec_float:
+ case slang_spec_int:
+ case slang_spec_bool:
+ return 1;
+ case slang_spec_vec2:
+ case slang_spec_ivec2:
+ case slang_spec_bvec2:
+ case slang_spec_mat2:
+ return 2;
+ case slang_spec_vec3:
+ case slang_spec_ivec3:
+ case slang_spec_bvec3:
+ case slang_spec_mat3:
+ return 3;
+ case slang_spec_vec4:
+ case slang_spec_ivec4:
+ case slang_spec_bvec4:
+ case slang_spec_mat4:
+ return 4;
+ default:
+ return 0;
+ }
}
-
diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.h b/src/mesa/shader/slang/slang_assemble_typeinfo.h
index 7e8af96915b..777dc21f3a7 100644
--- a/src/mesa/shader/slang/slang_assemble_typeinfo.h
+++ b/src/mesa/shader/slang/slang_assemble_typeinfo.h
@@ -29,84 +29,120 @@
extern "C" {
#endif
+
+/**
+ * The basic shading language types (float, vec4, mat3, etc)
+ */
typedef enum slang_type_specifier_type_
{
- slang_spec_void,
- slang_spec_bool,
- slang_spec_bvec2,
- slang_spec_bvec3,
- slang_spec_bvec4,
- slang_spec_int,
- slang_spec_ivec2,
- slang_spec_ivec3,
- slang_spec_ivec4,
- slang_spec_float,
- slang_spec_vec2,
- slang_spec_vec3,
- slang_spec_vec4,
- slang_spec_mat2,
- slang_spec_mat3,
- slang_spec_mat4,
- slang_spec_sampler1D,
- slang_spec_sampler2D,
- slang_spec_sampler3D,
- slang_spec_samplerCube,
- slang_spec_sampler1DShadow,
- slang_spec_sampler2DShadow,
- slang_spec_struct,
- slang_spec_array
+ slang_spec_void,
+ slang_spec_bool,
+ slang_spec_bvec2,
+ slang_spec_bvec3,
+ slang_spec_bvec4,
+ slang_spec_int,
+ slang_spec_ivec2,
+ slang_spec_ivec3,
+ slang_spec_ivec4,
+ slang_spec_float,
+ slang_spec_vec2,
+ slang_spec_vec3,
+ slang_spec_vec4,
+ slang_spec_mat2,
+ slang_spec_mat3,
+ slang_spec_mat4,
+ slang_spec_sampler1D,
+ slang_spec_sampler2D,
+ slang_spec_sampler3D,
+ slang_spec_samplerCube,
+ slang_spec_sampler1DShadow,
+ slang_spec_sampler2DShadow,
+ slang_spec_struct,
+ slang_spec_array
} slang_type_specifier_type;
+
+/**
+ * Describes more sophisticated types, like structs and arrays.
+ */
typedef struct slang_type_specifier_
{
- slang_type_specifier_type type;
- struct slang_struct_ *_struct; /* type: spec_struct */
- struct slang_type_specifier_ *_array; /* type: spec_array */
+ slang_type_specifier_type type;
+ struct slang_struct_ *_struct; /**< used if type == spec_struct */
+ struct slang_type_specifier_ *_array; /**< used if type == spec_array */
} slang_type_specifier;
-GLvoid slang_type_specifier_ctr (slang_type_specifier *);
-GLvoid slang_type_specifier_dtr (slang_type_specifier *);
-GLboolean slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);
-GLboolean slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *);
+
+extern GLvoid
+slang_type_specifier_ctr(slang_type_specifier *);
+
+extern GLvoid
+slang_type_specifier_dtr(slang_type_specifier *);
+
+extern GLboolean
+slang_type_specifier_copy(slang_type_specifier *, const slang_type_specifier *);
+
+extern GLboolean
+slang_type_specifier_equal(const slang_type_specifier *,
+ const slang_type_specifier *);
+
typedef struct slang_assembly_typeinfo_
{
- GLboolean can_be_referenced;
- GLboolean is_swizzled;
- slang_swizzle swz;
- slang_type_specifier spec;
- GLuint array_len;
+ GLboolean can_be_referenced;
+ GLboolean is_swizzled;
+ slang_swizzle swz;
+ slang_type_specifier spec;
+ GLuint array_len;
} slang_assembly_typeinfo;
-GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);
-GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);
+extern GLboolean
+slang_assembly_typeinfo_construct(slang_assembly_typeinfo *);
-/*
+extern GLvoid
+slang_assembly_typeinfo_destruct(slang_assembly_typeinfo *);
+
+
+/**
* Retrieves type information about an operation.
* Returns GL_TRUE on success.
* Returns GL_FALSE otherwise.
*/
-GLboolean _slang_typeof_operation (slang_assemble_ctx *, struct slang_operation_ *,
- slang_assembly_typeinfo *);
-GLboolean _slang_typeof_operation_ (struct slang_operation_ *, slang_assembly_name_space *,
- slang_assembly_typeinfo *, slang_atom_pool *);
+extern GLboolean
+_slang_typeof_operation(const slang_assemble_ctx *,
+ const struct slang_operation_ *,
+ slang_assembly_typeinfo *);
-/*
+extern GLboolean
+_slang_typeof_operation_(const struct slang_operation_ *,
+ const slang_assembly_name_space *,
+ slang_assembly_typeinfo *, slang_atom_pool *);
+
+/**
* Retrieves type of a function prototype, if one exists.
* Returns GL_TRUE on success, even if the function was not found.
* Returns GL_FALSE otherwise.
*/
-GLboolean _slang_typeof_function (slang_atom a_name, struct slang_operation_ *params,
- GLuint num_params, slang_assembly_name_space *, slang_type_specifier *spec, GLboolean *exists,
- slang_atom_pool *);
+extern GLboolean
+_slang_typeof_function(slang_atom a_name,
+ const struct slang_operation_ *params,
+ GLuint num_params, const slang_assembly_name_space *,
+ slang_type_specifier *spec, GLboolean *exists,
+ slang_atom_pool *);
+
+extern GLboolean
+_slang_type_is_matrix(slang_type_specifier_type);
+
+extern GLboolean
+_slang_type_is_vector(slang_type_specifier_type);
-GLboolean _slang_type_is_matrix (slang_type_specifier_type);
+extern slang_type_specifier_type
+_slang_type_base(slang_type_specifier_type);
-GLboolean _slang_type_is_vector (slang_type_specifier_type);
+extern GLuint
+_slang_type_dim(slang_type_specifier_type);
-slang_type_specifier_type _slang_type_base (slang_type_specifier_type);
-GLuint _slang_type_dim (slang_type_specifier_type);
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 46bdf830f92..c49ab4a68dc 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -35,21 +35,25 @@
#include "slang_storage.h"
/*
- * This is a straightforward implementation of the slang front-end compiler.
- * Lots of error-checking functionality is missing but every well-formed shader source should
- * compile successfully and execute as expected. However, some semantically ill-formed shaders
+ * This is a straightforward implementation of the slang front-end
+ * compiler. Lots of error-checking functionality is missing but
+ * every well-formed shader source should compile successfully and
+ * execute as expected. However, some semantically ill-formed shaders
* may be accepted resulting in undefined behaviour.
*/
-/* slang_var_pool */
-static GLuint slang_var_pool_alloc (slang_var_pool *pool, unsigned int size)
-{
- GLuint addr;
- addr = pool->next_addr;
- pool->next_addr += size;
- return addr;
+/**
+ * Allocate storage for a variable of 'size' bytes from given pool.
+ * Return the allocated address for the variable.
+ */
+static GLuint
+slang_var_pool_alloc(slang_var_pool * pool, unsigned int size)
+{
+ const GLuint addr = pool->next_addr;
+ pool->next_addr += size;
+ return addr;
}
/*
@@ -57,20 +61,21 @@ static GLuint slang_var_pool_alloc (slang_var_pool *pool, unsigned int size)
*/
GLvoid
-_slang_code_unit_ctr (slang_code_unit *self, struct slang_code_object_ *object)
+_slang_code_unit_ctr(slang_code_unit * self,
+ struct slang_code_object_ * object)
{
- _slang_variable_scope_ctr (&self->vars);
- _slang_function_scope_ctr (&self->funs);
- _slang_struct_scope_ctr (&self->structs);
+ _slang_variable_scope_ctr(&self->vars);
+ _slang_function_scope_ctr(&self->funs);
+ _slang_struct_scope_ctr(&self->structs);
self->object = object;
}
GLvoid
-_slang_code_unit_dtr (slang_code_unit *self)
+_slang_code_unit_dtr(slang_code_unit * self)
{
- slang_variable_scope_destruct (&self->vars);
- slang_function_scope_destruct (&self->funs);
- slang_struct_scope_destruct (&self->structs);
+ slang_variable_scope_destruct(&self->vars);
+ slang_function_scope_destruct(&self->funs);
+ slang_struct_scope_destruct(&self->structs);
}
/*
@@ -78,296 +83,313 @@ _slang_code_unit_dtr (slang_code_unit *self)
*/
GLvoid
-_slang_code_object_ctr (slang_code_object *self)
+_slang_code_object_ctr(slang_code_object * self)
{
GLuint i;
for (i = 0; i < SLANG_BUILTIN_TOTAL; i++)
- _slang_code_unit_ctr (&self->builtin[i], self);
- _slang_code_unit_ctr (&self->unit, self);
- _slang_assembly_file_ctr (&self->assembly);
- slang_machine_ctr (&self->machine);
+ _slang_code_unit_ctr(&self->builtin[i], self);
+ _slang_code_unit_ctr(&self->unit, self);
+ _slang_assembly_file_ctr(&self->assembly);
+ slang_machine_ctr(&self->machine);
self->varpool.next_addr = 0;
- slang_atom_pool_construct (&self->atompool);
- slang_export_data_table_ctr (&self->expdata);
+ slang_atom_pool_construct(&self->atompool);
+ slang_export_data_table_ctr(&self->expdata);
self->expdata.atoms = &self->atompool;
- slang_export_code_table_ctr (&self->expcode);
+ slang_export_code_table_ctr(&self->expcode);
self->expcode.atoms = &self->atompool;
}
GLvoid
-_slang_code_object_dtr (slang_code_object *self)
+_slang_code_object_dtr(slang_code_object * self)
{
GLuint i;
for (i = 0; i < SLANG_BUILTIN_TOTAL; i++)
- _slang_code_unit_dtr (&self->builtin[i]);
- _slang_code_unit_dtr (&self->unit);
- slang_assembly_file_destruct (&self->assembly);
- slang_machine_dtr (&self->machine);
- slang_atom_pool_destruct (&self->atompool);
- slang_export_data_table_dtr (&self->expdata);
- slang_export_code_table_ctr (&self->expcode);
+ _slang_code_unit_dtr(&self->builtin[i]);
+ _slang_code_unit_dtr(&self->unit);
+ slang_assembly_file_destruct(&self->assembly);
+ slang_machine_dtr(&self->machine);
+ slang_atom_pool_destruct(&self->atompool);
+ slang_export_data_table_dtr(&self->expdata);
+ slang_export_code_table_ctr(&self->expcode);
}
/* slang_info_log */
static char *out_of_memory = "Error: Out of memory.\n";
-void slang_info_log_construct (slang_info_log *log)
+void
+slang_info_log_construct(slang_info_log * log)
{
- log->text = NULL;
- log->dont_free_text = 0;
+ log->text = NULL;
+ log->dont_free_text = 0;
}
-void slang_info_log_destruct (slang_info_log *log)
+void
+slang_info_log_destruct(slang_info_log * log)
{
- if (!log->dont_free_text)
- slang_alloc_free (log->text);
+ if (!log->dont_free_text)
+ slang_alloc_free(log->text);
}
-static int slang_info_log_message (slang_info_log *log, const char *prefix, const char *msg)
+static int
+slang_info_log_message(slang_info_log * log, const char *prefix,
+ const char *msg)
{
GLuint size;
- if (log->dont_free_text)
- return 0;
- size = slang_string_length (msg) + 2;
+ if (log->dont_free_text)
+ return 0;
+ size = slang_string_length(msg) + 2;
if (prefix != NULL)
- size += slang_string_length (prefix) + 2;
+ size += slang_string_length(prefix) + 2;
if (log->text != NULL) {
- GLuint old_len = slang_string_length (log->text);
- log->text = (char *) (slang_alloc_realloc (log->text, old_len + 1, old_len + size));
+ GLuint old_len = slang_string_length(log->text);
+ log->text = (char *)
+ slang_alloc_realloc(log->text, old_len + 1, old_len + size);
}
else {
- log->text = (char *) (slang_alloc_malloc (size));
+ log->text = (char *) (slang_alloc_malloc(size));
if (log->text != NULL)
log->text[0] = '\0';
}
- if (log->text == NULL)
- return 0;
+ if (log->text == NULL)
+ return 0;
if (prefix != NULL) {
- slang_string_concat (log->text, prefix);
- slang_string_concat (log->text, ": ");
+ slang_string_concat(log->text, prefix);
+ slang_string_concat(log->text, ": ");
}
- slang_string_concat (log->text, msg);
- slang_string_concat (log->text, "\n");
- return 1;
+ slang_string_concat(log->text, msg);
+ slang_string_concat(log->text, "\n");
+ return 1;
}
-int slang_info_log_print (slang_info_log *log, const char *msg, ...)
+int
+slang_info_log_print(slang_info_log * log, const char *msg, ...)
{
va_list va;
char buf[1024];
- va_start (va, msg);
- _mesa_vsprintf (buf, msg, va);
- va_end (va);
- return slang_info_log_message (log, NULL, buf);
+ va_start(va, msg);
+ _mesa_vsprintf(buf, msg, va);
+ va_end(va);
+ return slang_info_log_message(log, NULL, buf);
}
-int slang_info_log_error (slang_info_log *log, const char *msg, ...)
+int
+slang_info_log_error(slang_info_log * log, const char *msg, ...)
{
- va_list va;
- char buf[1024];
-
- va_start (va, msg);
- _mesa_vsprintf (buf, msg, va);
- va_end (va);
- if (slang_info_log_message (log, "Error", buf))
- return 1;
- slang_info_log_memory (log);
- return 0;
+ va_list va;
+ char buf[1024];
+
+ va_start(va, msg);
+ _mesa_vsprintf(buf, msg, va);
+ va_end(va);
+ if (slang_info_log_message(log, "Error", buf))
+ return 1;
+ slang_info_log_memory(log);
+ return 0;
}
-int slang_info_log_warning (slang_info_log *log, const char *msg, ...)
+int
+slang_info_log_warning(slang_info_log * log, const char *msg, ...)
{
- va_list va;
- char buf[1024];
-
- va_start (va, msg);
- _mesa_vsprintf (buf, msg, va);
- va_end (va);
- if (slang_info_log_message (log, "Warning", buf))
- return 1;
- slang_info_log_memory (log);
- return 0;
+ va_list va;
+ char buf[1024];
+
+ va_start(va, msg);
+ _mesa_vsprintf(buf, msg, va);
+ va_end(va);
+ if (slang_info_log_message(log, "Warning", buf))
+ return 1;
+ slang_info_log_memory(log);
+ return 0;
}
-void slang_info_log_memory (slang_info_log *log)
+void
+slang_info_log_memory(slang_info_log * log)
{
- if (!slang_info_log_message (log, "Error", "Out of memory."))
- {
- log->dont_free_text = 1;
- log->text = out_of_memory;
- }
+ if (!slang_info_log_message(log, "Error", "Out of memory.")) {
+ log->dont_free_text = 1;
+ log->text = out_of_memory;
+ }
}
/* slang_parse_ctx */
typedef struct slang_parse_ctx_
{
- const byte *I;
- slang_info_log *L;
- int parsing_builtin;
- int global_scope;
- slang_atom_pool *atoms;
+ const byte *I;
+ slang_info_log *L;
+ int parsing_builtin;
+ GLboolean global_scope; /**< Is object being declared a global? */
+ slang_atom_pool *atoms;
} slang_parse_ctx;
/* slang_output_ctx */
typedef struct slang_output_ctx_
{
- slang_variable_scope *vars;
- slang_function_scope *funs;
- slang_struct_scope *structs;
- slang_assembly_file *assembly;
- slang_var_pool *global_pool;
- slang_machine *machine;
+ slang_variable_scope *vars;
+ slang_function_scope *funs;
+ slang_struct_scope *structs;
+ slang_assembly_file *assembly;
+ slang_var_pool *global_pool;
+ slang_machine *machine;
} slang_output_ctx;
/* _slang_compile() */
-static void parse_identifier_str (slang_parse_ctx *C, char **id)
+static void
+parse_identifier_str(slang_parse_ctx * C, char **id)
{
- *id = (char *) C->I;
- C->I += _mesa_strlen (*id) + 1;
+ *id = (char *) C->I;
+ C->I += _mesa_strlen(*id) + 1;
}
-static slang_atom parse_identifier (slang_parse_ctx *C)
+static slang_atom
+parse_identifier(slang_parse_ctx * C)
{
- const char *id;
-
- id = (const char *) C->I;
- C->I += _mesa_strlen (id) + 1;
- return slang_atom_pool_atom (C->atoms, id);
+ const char *id;
+
+ id = (const char *) C->I;
+ C->I += _mesa_strlen(id) + 1;
+ return slang_atom_pool_atom(C->atoms, id);
}
-static int parse_number (slang_parse_ctx *C, int *number)
+static int
+parse_number(slang_parse_ctx * C, int *number)
{
- const int radix = (int) (*C->I++);
- *number = 0;
- while (*C->I != '\0')
- {
- int digit;
- if (*C->I >= '0' && *C->I <= '9')
- digit = (int) (*C->I - '0');
- else if (*C->I >= 'A' && *C->I <= 'Z')
- digit = (int) (*C->I - 'A') + 10;
- else
- digit = (int) (*C->I - 'a') + 10;
- *number = *number * radix + digit;
- C->I++;
- }
- C->I++;
- if (*number > 65535)
- slang_info_log_warning (C->L, "%d: literal integer overflow.", *number);
- return 1;
+ const int radix = (int) (*C->I++);
+ *number = 0;
+ while (*C->I != '\0') {
+ int digit;
+ if (*C->I >= '0' && *C->I <= '9')
+ digit = (int) (*C->I - '0');
+ else if (*C->I >= 'A' && *C->I <= 'Z')
+ digit = (int) (*C->I - 'A') + 10;
+ else
+ digit = (int) (*C->I - 'a') + 10;
+ *number = *number * radix + digit;
+ C->I++;
+ }
+ C->I++;
+ if (*number > 65535)
+ slang_info_log_warning(C->L, "%d: literal integer overflow.", *number);
+ return 1;
}
-static int parse_float (slang_parse_ctx *C, float *number)
+static int
+parse_float(slang_parse_ctx * C, float *number)
{
- char *integral = NULL;
- char *fractional = NULL;
- char *exponent = NULL;
- char *whole = NULL;
-
- parse_identifier_str (C, &integral);
- parse_identifier_str (C, &fractional);
- parse_identifier_str (C, &exponent);
-
- whole = (char *) (slang_alloc_malloc ((_mesa_strlen (integral) + _mesa_strlen (fractional) +
- _mesa_strlen (exponent) + 3) * sizeof (char)));
- if (whole == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
-
- slang_string_copy (whole, integral);
- slang_string_concat (whole, ".");
- slang_string_concat (whole, fractional);
- slang_string_concat (whole, "E");
- slang_string_concat (whole, exponent);
-
- *number = (float) (_mesa_strtod(whole, (char **)NULL));
-
- slang_alloc_free (whole);
- return 1;
+ char *integral = NULL;
+ char *fractional = NULL;
+ char *exponent = NULL;
+ char *whole = NULL;
+
+ parse_identifier_str(C, &integral);
+ parse_identifier_str(C, &fractional);
+ parse_identifier_str(C, &exponent);
+
+ whole = (char *) (slang_alloc_malloc((_mesa_strlen(integral) +
+ _mesa_strlen(fractional) +
+ _mesa_strlen(exponent) + 3) * sizeof(char)));
+ if (whole == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ slang_string_copy(whole, integral);
+ slang_string_concat(whole, ".");
+ slang_string_concat(whole, fractional);
+ slang_string_concat(whole, "E");
+ slang_string_concat(whole, exponent);
+
+ *number = (float) (_mesa_strtod(whole, (char **) NULL));
+
+ slang_alloc_free(whole);
+ return 1;
}
/* revision number - increment after each change affecting emitted output */
#define REVISION 3
-static int check_revision (slang_parse_ctx *C)
+static int
+check_revision(slang_parse_ctx * C)
{
- if (*C->I != REVISION)
- {
- slang_info_log_error (C->L, "Internal compiler error.");
- return 0;
- }
- C->I++;
- return 1;
+ if (*C->I != REVISION) {
+ slang_info_log_error(C->L, "Internal compiler error.");
+ return 0;
+ }
+ C->I++;
+ return 1;
}
-static int parse_statement (slang_parse_ctx *, slang_output_ctx *, slang_operation *);
-static int parse_expression (slang_parse_ctx *, slang_output_ctx *, slang_operation *);
-static int parse_type_specifier (slang_parse_ctx *, slang_output_ctx *, slang_type_specifier *);
+static int parse_statement(slang_parse_ctx *, slang_output_ctx *,
+ slang_operation *);
+static int parse_expression(slang_parse_ctx *, slang_output_ctx *,
+ slang_operation *);
+static int parse_type_specifier(slang_parse_ctx *, slang_output_ctx *,
+ slang_type_specifier *);
-static GLboolean parse_array_len (slang_parse_ctx *C, slang_output_ctx *O, GLuint *len)
+static GLboolean
+parse_array_len(slang_parse_ctx * C, slang_output_ctx * O, GLuint * len)
{
- slang_operation array_size;
- slang_assembly_name_space space;
- GLboolean result;
-
- if (!slang_operation_construct (&array_size))
- return GL_FALSE;
- if (!parse_expression (C, O, &array_size))
- {
- slang_operation_destruct (&array_size);
- return GL_FALSE;
- }
-
- space.funcs = O->funs;
- space.structs = O->structs;
- space.vars = O->vars;
- result = _slang_evaluate_int (O->assembly, O->machine, &space, &array_size, len, C->atoms);
- slang_operation_destruct (&array_size);
- return result;
+ slang_operation array_size;
+ slang_assembly_name_space space;
+ GLboolean result;
+
+ if (!slang_operation_construct(&array_size))
+ return GL_FALSE;
+ if (!parse_expression(C, O, &array_size)) {
+ slang_operation_destruct(&array_size);
+ return GL_FALSE;
+ }
+
+ space.funcs = O->funs;
+ space.structs = O->structs;
+ space.vars = O->vars;
+ result = _slang_evaluate_int(O->assembly, O->machine, &space,
+ &array_size, len, C->atoms);
+ slang_operation_destruct(&array_size);
+ return result;
}
-static GLboolean calculate_var_size (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var)
+static GLboolean
+calculate_var_size(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_variable * var)
{
- slang_storage_aggregate agg;
-
- if (!slang_storage_aggregate_construct (&agg))
- return GL_FALSE;
- if (!_slang_aggregate_variable (&agg, &var->type.specifier, var->array_len, O->funs, O->structs,
- O->vars, O->machine, O->assembly, C->atoms))
- {
- slang_storage_aggregate_destruct (&agg);
- return GL_FALSE;
- }
- var->size = _slang_sizeof_aggregate (&agg);
- slang_storage_aggregate_destruct (&agg);
- return GL_TRUE;
+ slang_storage_aggregate agg;
+
+ if (!slang_storage_aggregate_construct(&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable(&agg, &var->type.specifier, var->array_len,
+ O->funs, O->structs, O->vars, O->machine,
+ O->assembly, C->atoms)) {
+ slang_storage_aggregate_destruct(&agg);
+ return GL_FALSE;
+ }
+ var->size = _slang_sizeof_aggregate(&agg);
+ slang_storage_aggregate_destruct(&agg);
+ return GL_TRUE;
}
-static GLboolean convert_to_array (slang_parse_ctx *C, slang_variable *var,
- const slang_type_specifier *sp)
+static GLboolean
+convert_to_array(slang_parse_ctx * C, slang_variable * var,
+ const slang_type_specifier * sp)
{
- /* sized array - mark it as array, copy the specifier to the array element and
- * parse the expression */
- var->type.specifier.type = slang_spec_array;
- var->type.specifier._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (
- slang_type_specifier));
- if (var->type.specifier._array == NULL)
- {
- slang_info_log_memory (C->L);
- return GL_FALSE;
- }
- slang_type_specifier_ctr (var->type.specifier._array);
- return slang_type_specifier_copy (var->type.specifier._array, sp);
+ /* sized array - mark it as array, copy the specifier to the array element and
+ * parse the expression */
+ var->type.specifier.type = slang_spec_array;
+ var->type.specifier._array = (slang_type_specifier *)
+ slang_alloc_malloc(sizeof(slang_type_specifier));
+ if (var->type.specifier._array == NULL) {
+ slang_info_log_memory(C->L);
+ return GL_FALSE;
+ }
+ slang_type_specifier_ctr(var->type.specifier._array);
+ return slang_type_specifier_copy(var->type.specifier._array, sp);
}
/* structure field */
@@ -375,136 +397,128 @@ static GLboolean convert_to_array (slang_parse_ctx *C, slang_variable *var,
#define FIELD_NEXT 1
#define FIELD_ARRAY 2
-static GLboolean parse_struct_field_var (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var,
- const slang_type_specifier *sp)
+static GLboolean
+parse_struct_field_var(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_variable * var, const slang_type_specifier * sp)
{
- var->a_name = parse_identifier (C);
- if (var->a_name == SLANG_ATOM_NULL)
- return GL_FALSE;
-
- switch (*C->I++)
- {
- case FIELD_NONE:
- if (!slang_type_specifier_copy (&var->type.specifier, sp))
- return GL_FALSE;
- break;
- case FIELD_ARRAY:
- if (!convert_to_array (C, var, sp))
- return GL_FALSE;
- if (!parse_array_len (C, O, &var->array_len))
- return GL_FALSE;
- break;
- default:
- return GL_FALSE;
- }
-
- return calculate_var_size (C, O, var);
+ var->a_name = parse_identifier(C);
+ if (var->a_name == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ switch (*C->I++) {
+ case FIELD_NONE:
+ if (!slang_type_specifier_copy(&var->type.specifier, sp))
+ return GL_FALSE;
+ break;
+ case FIELD_ARRAY:
+ if (!convert_to_array(C, var, sp))
+ return GL_FALSE;
+ if (!parse_array_len(C, O, &var->array_len))
+ return GL_FALSE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ return calculate_var_size(C, O, var);
}
-static int parse_struct_field (slang_parse_ctx *C, slang_output_ctx *O, slang_struct *st,
- slang_type_specifier *sp)
+static int
+parse_struct_field(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_struct * st, slang_type_specifier * sp)
{
- slang_output_ctx o = *O;
-
- o.structs = st->structs;
- if (!parse_type_specifier (C, &o, sp))
- return 0;
- do
- {
- slang_variable *var;
-
- st->fields->variables = (slang_variable *) slang_alloc_realloc (st->fields->variables,
- st->fields->num_variables * sizeof (slang_variable),
- (st->fields->num_variables + 1) * sizeof (slang_variable));
- if (st->fields->variables == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- var = &st->fields->variables[st->fields->num_variables];
- if (!slang_variable_construct (var))
- return 0;
- st->fields->num_variables++;
- if (!parse_struct_field_var (C, &o, var, sp))
- return 0;
- }
- while (*C->I++ != FIELD_NONE);
-
- return 1;
+ slang_output_ctx o = *O;
+
+ o.structs = st->structs;
+ if (!parse_type_specifier(C, &o, sp))
+ return 0;
+
+ do {
+ slang_variable *var = slang_variable_scope_grow(st->fields);
+ if (!var) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!parse_struct_field_var(C, &o, var, sp))
+ return 0;
+ }
+ while (*C->I++ != FIELD_NONE);
+
+ return 1;
}
-static int parse_struct (slang_parse_ctx *C, slang_output_ctx *O, slang_struct **st)
+static int
+parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st)
{
- slang_atom a_name;
- const char *name;
-
- /* parse struct name (if any) and make sure it is unique in current scope */
- a_name = parse_identifier (C);
- if (a_name == SLANG_ATOM_NULL)
- return 0;
- name = slang_atom_pool_id (C->atoms, a_name);
- if (name[0] != '\0' && slang_struct_scope_find (O->structs, a_name, 0) != NULL)
- {
- slang_info_log_error (C->L, "%s: duplicate type name.", name);
- return 0;
- }
-
- /* set-up a new struct */
- *st = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (*st == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_struct_construct (*st))
- {
- slang_alloc_free (*st);
- *st = NULL;
- slang_info_log_memory (C->L);
- return 0;
- }
- (**st).a_name = a_name;
- (**st).structs->outer_scope = O->structs;
-
- /* parse individual struct fields */
- do
- {
- slang_type_specifier sp;
-
- slang_type_specifier_ctr (&sp);
- if (!parse_struct_field (C, O, *st, &sp))
- {
- slang_type_specifier_dtr (&sp);
- return 0;
- }
- slang_type_specifier_dtr (&sp);
- }
- while (*C->I++ != FIELD_NONE);
-
- /* if named struct, copy it to current scope */
- if (name[0] != '\0')
- {
- slang_struct *s;
-
- O->structs->structs = (slang_struct *) slang_alloc_realloc (O->structs->structs,
- O->structs->num_structs * sizeof (slang_struct),
- (O->structs->num_structs + 1) * sizeof (slang_struct));
- if (O->structs->structs == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- s = &O->structs->structs[O->structs->num_structs];
- if (!slang_struct_construct (s))
- return 0;
- O->structs->num_structs++;
- if (!slang_struct_copy (s, *st))
- return 0;
- }
-
- return 1;
+ slang_atom a_name;
+ const char *name;
+
+ /* parse struct name (if any) and make sure it is unique in current scope */
+ a_name = parse_identifier(C);
+ if (a_name == SLANG_ATOM_NULL)
+ return 0;
+
+ name = slang_atom_pool_id(C->atoms, a_name);
+ if (name[0] != '\0'
+ && slang_struct_scope_find(O->structs, a_name, 0) != NULL) {
+ slang_info_log_error(C->L, "%s: duplicate type name.", name);
+ return 0;
+ }
+
+ /* set-up a new struct */
+ *st = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (*st == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_struct_construct(*st)) {
+ slang_alloc_free(*st);
+ *st = NULL;
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ (**st).a_name = a_name;
+ (**st).structs->outer_scope = O->structs;
+
+ /* parse individual struct fields */
+ do {
+ slang_type_specifier sp;
+
+ slang_type_specifier_ctr(&sp);
+ if (!parse_struct_field(C, O, *st, &sp)) {
+ slang_type_specifier_dtr(&sp);
+ return 0;
+ }
+ slang_type_specifier_dtr(&sp);
+ }
+ while (*C->I++ != FIELD_NONE);
+
+ /* if named struct, copy it to current scope */
+ if (name[0] != '\0') {
+ slang_struct *s;
+
+ O->structs->structs =
+ (slang_struct *) slang_alloc_realloc(O->structs->structs,
+ O->structs->num_structs *
+ sizeof(slang_struct),
+ (O->structs->num_structs +
+ 1) * sizeof(slang_struct));
+ if (O->structs->structs == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ s = &O->structs->structs[O->structs->num_structs];
+ if (!slang_struct_construct(s))
+ return 0;
+ O->structs->num_structs++;
+ if (!slang_struct_copy(s, *st))
+ return 0;
+ }
+
+ return 1;
}
+
/* type qualifier */
#define TYPE_QUALIFIER_NONE 0
#define TYPE_QUALIFIER_CONST 1
@@ -514,35 +528,35 @@ static int parse_struct (slang_parse_ctx *C, slang_output_ctx *O, slang_struct *
#define TYPE_QUALIFIER_FIXEDOUTPUT 5
#define TYPE_QUALIFIER_FIXEDINPUT 6
-static int parse_type_qualifier (slang_parse_ctx *C, slang_type_qualifier *qual)
+static int
+parse_type_qualifier(slang_parse_ctx * C, slang_type_qualifier * qual)
{
- switch (*C->I++)
- {
- case TYPE_QUALIFIER_NONE:
- *qual = slang_qual_none;
- break;
- case TYPE_QUALIFIER_CONST:
- *qual = slang_qual_const;
- break;
- case TYPE_QUALIFIER_ATTRIBUTE:
- *qual = slang_qual_attribute;
- break;
- case TYPE_QUALIFIER_VARYING:
- *qual = slang_qual_varying;
- break;
- case TYPE_QUALIFIER_UNIFORM:
- *qual = slang_qual_uniform;
- break;
- case TYPE_QUALIFIER_FIXEDOUTPUT:
- *qual = slang_qual_fixedoutput;
- break;
- case TYPE_QUALIFIER_FIXEDINPUT:
- *qual = slang_qual_fixedinput;
- break;
- default:
- return 0;
- }
- return 1;
+ switch (*C->I++) {
+ case TYPE_QUALIFIER_NONE:
+ *qual = slang_qual_none;
+ break;
+ case TYPE_QUALIFIER_CONST:
+ *qual = slang_qual_const;
+ break;
+ case TYPE_QUALIFIER_ATTRIBUTE:
+ *qual = slang_qual_attribute;
+ break;
+ case TYPE_QUALIFIER_VARYING:
+ *qual = slang_qual_varying;
+ break;
+ case TYPE_QUALIFIER_UNIFORM:
+ *qual = slang_qual_uniform;
+ break;
+ case TYPE_QUALIFIER_FIXEDOUTPUT:
+ *qual = slang_qual_fixedoutput;
+ break;
+ case TYPE_QUALIFIER_FIXEDINPUT:
+ *qual = slang_qual_fixedinput;
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
/* type specifier */
@@ -571,127 +585,127 @@ static int parse_type_qualifier (slang_parse_ctx *C, slang_type_qualifier *qual)
#define TYPE_SPECIFIER_STRUCT 22
#define TYPE_SPECIFIER_TYPENAME 23
-static int parse_type_specifier (slang_parse_ctx *C, slang_output_ctx *O, slang_type_specifier *spec)
+static int
+parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_type_specifier * spec)
{
- switch (*C->I++)
- {
- case TYPE_SPECIFIER_VOID:
- spec->type = slang_spec_void;
- break;
- case TYPE_SPECIFIER_BOOL:
- spec->type = slang_spec_bool;
- break;
- case TYPE_SPECIFIER_BVEC2:
- spec->type = slang_spec_bvec2;
- break;
- case TYPE_SPECIFIER_BVEC3:
- spec->type = slang_spec_bvec3;
- break;
- case TYPE_SPECIFIER_BVEC4:
- spec->type = slang_spec_bvec4;
- break;
- case TYPE_SPECIFIER_INT:
- spec->type = slang_spec_int;
- break;
- case TYPE_SPECIFIER_IVEC2:
- spec->type = slang_spec_ivec2;
- break;
- case TYPE_SPECIFIER_IVEC3:
- spec->type = slang_spec_ivec3;
- break;
- case TYPE_SPECIFIER_IVEC4:
- spec->type = slang_spec_ivec4;
- break;
- case TYPE_SPECIFIER_FLOAT:
- spec->type = slang_spec_float;
- break;
- case TYPE_SPECIFIER_VEC2:
- spec->type = slang_spec_vec2;
- break;
- case TYPE_SPECIFIER_VEC3:
- spec->type = slang_spec_vec3;
- break;
- case TYPE_SPECIFIER_VEC4:
- spec->type = slang_spec_vec4;
- break;
- case TYPE_SPECIFIER_MAT2:
- spec->type = slang_spec_mat2;
- break;
- case TYPE_SPECIFIER_MAT3:
- spec->type = slang_spec_mat3;
- break;
- case TYPE_SPECIFIER_MAT4:
- spec->type = slang_spec_mat4;
- break;
- case TYPE_SPECIFIER_SAMPLER1D:
- spec->type = slang_spec_sampler1D;
- break;
- case TYPE_SPECIFIER_SAMPLER2D:
- spec->type = slang_spec_sampler2D;
- break;
- case TYPE_SPECIFIER_SAMPLER3D:
- spec->type = slang_spec_sampler3D;
- break;
- case TYPE_SPECIFIER_SAMPLERCUBE:
- spec->type = slang_spec_samplerCube;
- break;
- case TYPE_SPECIFIER_SAMPLER1DSHADOW:
- spec->type = slang_spec_sampler1DShadow;
- break;
- case TYPE_SPECIFIER_SAMPLER2DSHADOW:
- spec->type = slang_spec_sampler2DShadow;
- break;
- case TYPE_SPECIFIER_STRUCT:
- spec->type = slang_spec_struct;
- if (!parse_struct (C, O, &spec->_struct))
- return 0;
- break;
- case TYPE_SPECIFIER_TYPENAME:
- spec->type = slang_spec_struct;
- {
- slang_atom a_name;
- slang_struct *stru;
-
- a_name = parse_identifier (C);
- if (a_name == NULL)
- return 0;
-
- stru = slang_struct_scope_find (O->structs, a_name, 1);
- if (stru == NULL)
- {
- slang_info_log_error (C->L, "%s: undeclared type name.",
- slang_atom_pool_id (C->atoms, a_name));
- return 0;
- }
-
- spec->_struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (spec->_struct == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_struct_construct (spec->_struct))
- {
- slang_alloc_free (spec->_struct);
- spec->_struct = NULL;
- return 0;
- }
- if (!slang_struct_copy (spec->_struct, stru))
- return 0;
- }
- break;
- default:
- return 0;
- }
- return 1;
+ switch (*C->I++) {
+ case TYPE_SPECIFIER_VOID:
+ spec->type = slang_spec_void;
+ break;
+ case TYPE_SPECIFIER_BOOL:
+ spec->type = slang_spec_bool;
+ break;
+ case TYPE_SPECIFIER_BVEC2:
+ spec->type = slang_spec_bvec2;
+ break;
+ case TYPE_SPECIFIER_BVEC3:
+ spec->type = slang_spec_bvec3;
+ break;
+ case TYPE_SPECIFIER_BVEC4:
+ spec->type = slang_spec_bvec4;
+ break;
+ case TYPE_SPECIFIER_INT:
+ spec->type = slang_spec_int;
+ break;
+ case TYPE_SPECIFIER_IVEC2:
+ spec->type = slang_spec_ivec2;
+ break;
+ case TYPE_SPECIFIER_IVEC3:
+ spec->type = slang_spec_ivec3;
+ break;
+ case TYPE_SPECIFIER_IVEC4:
+ spec->type = slang_spec_ivec4;
+ break;
+ case TYPE_SPECIFIER_FLOAT:
+ spec->type = slang_spec_float;
+ break;
+ case TYPE_SPECIFIER_VEC2:
+ spec->type = slang_spec_vec2;
+ break;
+ case TYPE_SPECIFIER_VEC3:
+ spec->type = slang_spec_vec3;
+ break;
+ case TYPE_SPECIFIER_VEC4:
+ spec->type = slang_spec_vec4;
+ break;
+ case TYPE_SPECIFIER_MAT2:
+ spec->type = slang_spec_mat2;
+ break;
+ case TYPE_SPECIFIER_MAT3:
+ spec->type = slang_spec_mat3;
+ break;
+ case TYPE_SPECIFIER_MAT4:
+ spec->type = slang_spec_mat4;
+ break;
+ case TYPE_SPECIFIER_SAMPLER1D:
+ spec->type = slang_spec_sampler1D;
+ break;
+ case TYPE_SPECIFIER_SAMPLER2D:
+ spec->type = slang_spec_sampler2D;
+ break;
+ case TYPE_SPECIFIER_SAMPLER3D:
+ spec->type = slang_spec_sampler3D;
+ break;
+ case TYPE_SPECIFIER_SAMPLERCUBE:
+ spec->type = slang_spec_samplerCube;
+ break;
+ case TYPE_SPECIFIER_SAMPLER1DSHADOW:
+ spec->type = slang_spec_sampler1DShadow;
+ break;
+ case TYPE_SPECIFIER_SAMPLER2DSHADOW:
+ spec->type = slang_spec_sampler2DShadow;
+ break;
+ case TYPE_SPECIFIER_STRUCT:
+ spec->type = slang_spec_struct;
+ if (!parse_struct(C, O, &spec->_struct))
+ return 0;
+ break;
+ case TYPE_SPECIFIER_TYPENAME:
+ spec->type = slang_spec_struct;
+ {
+ slang_atom a_name;
+ slang_struct *stru;
+
+ a_name = parse_identifier(C);
+ if (a_name == NULL)
+ return 0;
+
+ stru = slang_struct_scope_find(O->structs, a_name, 1);
+ if (stru == NULL) {
+ slang_info_log_error(C->L, "%s: undeclared type name.",
+ slang_atom_pool_id(C->atoms, a_name));
+ return 0;
+ }
+
+ spec->_struct =
+ (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (spec->_struct == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_struct_construct(spec->_struct)) {
+ slang_alloc_free(spec->_struct);
+ spec->_struct = NULL;
+ return 0;
+ }
+ if (!slang_struct_copy(spec->_struct, stru))
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
-static int parse_fully_specified_type (slang_parse_ctx *C, slang_output_ctx *O,
- slang_fully_specified_type *type)
+static int
+parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_fully_specified_type * type)
{
- if (!parse_type_qualifier (C, &type->qualifier))
- return 0;
- return parse_type_specifier (C, O, &type->specifier);
+ if (!parse_type_qualifier(C, &type->qualifier))
+ return 0;
+ return parse_type_specifier(C, O, &type->specifier);
}
/* operation */
@@ -758,459 +772,487 @@ static int parse_fully_specified_type (slang_parse_ctx *C, slang_output_ctx *O,
#define OP_POSTINCREMENT 60
#define OP_POSTDECREMENT 61
-static int parse_child_operation (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper,
- int statement)
+
+/**
+ * When parsing a compound production, this function is used to parse the
+ * children.
+ * For example, a a while-loop compound will have two children, the
+ * while condition expression and the loop body. So, this function will
+ * be called twice to parse those two sub-expressions.
+ * \param C the parsing context
+ * \param O the output context
+ * \param oper the operation we're parsing
+ * \param statment which child of the operation is being parsed
+ * \return 1 if success, 0 if error
+ */
+static int
+parse_child_operation(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_operation * oper, unsigned int statement)
{
- slang_operation *ch;
-
- oper->children = (slang_operation *) slang_alloc_realloc (oper->children,
- oper->num_children * sizeof (slang_operation),
- (oper->num_children + 1) * sizeof (slang_operation));
- if (oper->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- ch = &oper->children[oper->num_children];
- if (!slang_operation_construct (ch))
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- oper->num_children++;
- if (statement)
- return parse_statement (C, O, ch);
- return parse_expression (C, O, ch);
+ slang_operation *ch;
+
+ /* grow child array */
+ oper->children = (slang_operation *)
+ slang_alloc_realloc(oper->children,
+ oper->num_children * sizeof(slang_operation),
+ (oper->num_children + 1) * sizeof(slang_operation));
+ if (oper->children == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ ch = &oper->children[oper->num_children];
+ if (!slang_operation_construct(ch)) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ oper->num_children++;
+ /* XXX I guess the 0th "statement" is not really a statement? */
+ if (statement)
+ return parse_statement(C, O, ch);
+ return parse_expression(C, O, ch);
}
-static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O);
+static int parse_declaration(slang_parse_ctx * C, slang_output_ctx * O);
-static int parse_statement (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper)
+static int
+parse_statement(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_operation * oper)
{
- oper->locals->outer_scope = O->vars;
- switch (*C->I++)
- {
- case OP_BLOCK_BEGIN_NO_NEW_SCOPE:
- /* parse child statements, do not create new variable scope */
- oper->type = slang_oper_block_no_new_scope;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- C->I++;
- break;
- case OP_BLOCK_BEGIN_NEW_SCOPE:
- /* parse child statements, create new variable scope */
- {
- slang_output_ctx o = *O;
-
- oper->type = slang_oper_block_new_scope;
- o.vars = oper->locals;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- C->I++;
- }
- break;
- case OP_DECLARE:
- /* local variable declaration, individual declarators are stored as children identifiers */
- oper->type = slang_oper_variable_decl;
- {
- const unsigned int first_var = O->vars->num_variables;
-
- /* parse the declaration, note that there can be zero or more than one declarators */
- if (!parse_declaration (C, O))
- return 0;
- if (first_var < O->vars->num_variables)
- {
- const unsigned int num_vars = O->vars->num_variables - first_var;
- unsigned int i;
-
- oper->children = (slang_operation *) slang_alloc_malloc (num_vars * sizeof (
- slang_operation));
- if (oper->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- for (oper->num_children = 0; oper->num_children < num_vars; oper->num_children++)
- if (!slang_operation_construct (&oper->children[oper->num_children]))
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- for (i = first_var; i < O->vars->num_variables; i++)
- {
- slang_operation *o = &oper->children[i - first_var];
-
- o->type = slang_oper_identifier;
- o->locals->outer_scope = O->vars;
- o->a_id = O->vars->variables[i].a_name;
- }
- }
- }
- break;
- case OP_ASM:
- /* the __asm statement, parse the mnemonic and all its arguments as expressions */
- oper->type = slang_oper_asm;
- oper->a_id = parse_identifier (C);
- if (oper->a_id == SLANG_ATOM_NULL)
- return 0;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- C->I++;
- break;
- case OP_BREAK:
- oper->type = slang_oper_break;
- break;
- case OP_CONTINUE:
- oper->type = slang_oper_continue;
- break;
- case OP_DISCARD:
- oper->type = slang_oper_discard;
- break;
- case OP_RETURN:
- oper->type = slang_oper_return;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- break;
- case OP_EXPRESSION:
- oper->type = slang_oper_expression;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- break;
- case OP_IF:
- oper->type = slang_oper_if;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- break;
- case OP_WHILE:
- {
- slang_output_ctx o = *O;
-
- oper->type = slang_oper_while;
- o.vars = oper->locals;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- }
- break;
- case OP_DO:
- oper->type = slang_oper_do;
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- break;
- case OP_FOR:
- {
- slang_output_ctx o = *O;
-
- oper->type = slang_oper_for;
- o.vars = oper->locals;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- if (!parse_child_operation (C, &o, oper, 0))
- return 0;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- }
- break;
- default:
- return 0;
- }
- return 1;
+ oper->locals->outer_scope = O->vars;
+ switch (*C->I++) {
+ case OP_BLOCK_BEGIN_NO_NEW_SCOPE:
+ /* parse child statements, do not create new variable scope */
+ oper->type = slang_oper_block_no_new_scope;
+ while (*C->I != OP_END)
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ C->I++;
+ break;
+ case OP_BLOCK_BEGIN_NEW_SCOPE:
+ /* parse child statements, create new variable scope */
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_block_new_scope;
+ o.vars = oper->locals;
+ while (*C->I != OP_END)
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ C->I++;
+ }
+ break;
+ case OP_DECLARE:
+ /* local variable declaration, individual declarators are stored as
+ * children identifiers
+ */
+ oper->type = slang_oper_variable_decl;
+ {
+ const unsigned int first_var = O->vars->num_variables;
+
+ /* parse the declaration, note that there can be zero or more
+ * than one declarators
+ */
+ if (!parse_declaration(C, O))
+ return 0;
+ if (first_var < O->vars->num_variables) {
+ const unsigned int num_vars = O->vars->num_variables - first_var;
+ unsigned int i;
+
+ oper->children = (slang_operation *)
+ slang_alloc_malloc(num_vars * sizeof(slang_operation));
+ if (oper->children == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ for (oper->num_children = 0; oper->num_children < num_vars;
+ oper->num_children++) {
+ if (!slang_operation_construct
+ (&oper->children[oper->num_children])) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ }
+ for (i = first_var; i < O->vars->num_variables; i++) {
+ slang_operation *o = &oper->children[i - first_var];
+ o->type = slang_oper_identifier;
+ o->locals->outer_scope = O->vars;
+ o->a_id = O->vars->variables[i].a_name;
+ }
+ }
+ }
+ break;
+ case OP_ASM:
+ /* the __asm statement, parse the mnemonic and all its arguments
+ * as expressions
+ */
+ oper->type = slang_oper_asm;
+ oper->a_id = parse_identifier(C);
+ if (oper->a_id == SLANG_ATOM_NULL)
+ return 0;
+ while (*C->I != OP_END) {
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ }
+ C->I++;
+ break;
+ case OP_BREAK:
+ oper->type = slang_oper_break;
+ break;
+ case OP_CONTINUE:
+ oper->type = slang_oper_continue;
+ break;
+ case OP_DISCARD:
+ oper->type = slang_oper_discard;
+ break;
+ case OP_RETURN:
+ oper->type = slang_oper_return;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ break;
+ case OP_EXPRESSION:
+ oper->type = slang_oper_expression;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ break;
+ case OP_IF:
+ oper->type = slang_oper_if;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ break;
+ case OP_WHILE:
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_while;
+ o.vars = oper->locals;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ }
+ break;
+ case OP_DO:
+ oper->type = slang_oper_do;
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ break;
+ case OP_FOR:
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_for;
+ o.vars = oper->locals;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 0))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
-static int handle_nary_expression (slang_parse_ctx *C, slang_operation *op, slang_operation **ops,
- unsigned int *total_ops, unsigned int n)
+static int
+handle_nary_expression(slang_parse_ctx * C, slang_operation * op,
+ slang_operation ** ops, unsigned int *total_ops,
+ unsigned int n)
{
- unsigned int i;
-
- op->children = (slang_operation *) slang_alloc_malloc (n * sizeof (slang_operation));
- if (op->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- op->num_children = n;
-
- for (i = 0; i < n; i++)
- op->children[i] = (*ops)[*total_ops - (n + 1 - i)];
- (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1];
- *total_ops -= n;
-
- *ops = (slang_operation *) slang_alloc_realloc (*ops, (*total_ops + n) * sizeof (slang_operation),
- *total_ops * sizeof (slang_operation));
- if (*ops == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- return 1;
+ unsigned int i;
+
+ op->children =
+ (slang_operation *) slang_alloc_malloc(n * sizeof(slang_operation));
+ if (op->children == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ op->num_children = n;
+
+ for (i = 0; i < n; i++)
+ op->children[i] = (*ops)[*total_ops - (n + 1 - i)];
+ (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1];
+ *total_ops -= n;
+
+ *ops = (slang_operation *)
+ slang_alloc_realloc(*ops,
+ (*total_ops + n) * sizeof(slang_operation),
+ *total_ops * sizeof(slang_operation));
+ if (*ops == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ return 1;
}
-static int is_constructor_name (const char *name, slang_atom a_name, slang_struct_scope *structs)
+static int
+is_constructor_name(const char *name, slang_atom a_name,
+ slang_struct_scope * structs)
{
- if (slang_type_specifier_type_from_string (name) != slang_spec_void)
- return 1;
- return slang_struct_scope_find (structs, a_name, 1) != NULL;
+ if (slang_type_specifier_type_from_string(name) != slang_spec_void)
+ return 1;
+ return slang_struct_scope_find(structs, a_name, 1) != NULL;
}
-static int parse_expression (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper)
+static int
+parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_operation * oper)
{
- slang_operation *ops = NULL;
- unsigned int num_ops = 0;
- int number;
-
- while (*C->I != OP_END)
- {
- slang_operation *op;
- const unsigned int op_code = *C->I++;
-
- /* allocate default operation, becomes a no-op if not used */
- ops = (slang_operation *) slang_alloc_realloc (ops,
- num_ops * sizeof (slang_operation), (num_ops + 1) * sizeof (slang_operation));
- if (ops == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- op = &ops[num_ops];
- if (!slang_operation_construct (op))
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- num_ops++;
- op->locals->outer_scope = O->vars;
-
- switch (op_code)
- {
- case OP_PUSH_VOID:
- op->type = slang_oper_void;
- break;
- case OP_PUSH_BOOL:
- op->type = slang_oper_literal_bool;
- if (!parse_number (C, &number))
- return 0;
- op->literal = (GLfloat) number;
- break;
- case OP_PUSH_INT:
- op->type = slang_oper_literal_int;
- if (!parse_number (C, &number))
- return 0;
- op->literal = (GLfloat) number;
- break;
- case OP_PUSH_FLOAT:
- op->type = slang_oper_literal_float;
- if (!parse_float (C, &op->literal))
- return 0;
- break;
- case OP_PUSH_IDENTIFIER:
- op->type = slang_oper_identifier;
- op->a_id = parse_identifier (C);
- if (op->a_id == SLANG_ATOM_NULL)
- return 0;
- break;
- case OP_SEQUENCE:
- op->type = slang_oper_sequence;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_ASSIGN:
- op->type = slang_oper_assign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_ADDASSIGN:
- op->type = slang_oper_addassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_SUBASSIGN:
- op->type = slang_oper_subassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_MULASSIGN:
- op->type = slang_oper_mulassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_DIVASSIGN:
- op->type = slang_oper_divassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_MODASSIGN:*/
- /*case OP_LSHASSIGN:*/
- /*case OP_RSHASSIGN:*/
- /*case OP_ORASSIGN:*/
- /*case OP_XORASSIGN:*/
- /*case OP_ANDASSIGN:*/
- case OP_SELECT:
- op->type = slang_oper_select;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 3))
- return 0;
- break;
- case OP_LOGICALOR:
- op->type = slang_oper_logicalor;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LOGICALXOR:
- op->type = slang_oper_logicalxor;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LOGICALAND:
- op->type = slang_oper_logicaland;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_BITOR:*/
- /*case OP_BITXOR:*/
- /*case OP_BITAND:*/
- case OP_EQUAL:
- op->type = slang_oper_equal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_NOTEQUAL:
- op->type = slang_oper_notequal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LESS:
- op->type = slang_oper_less;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_GREATER:
- op->type = slang_oper_greater;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LESSEQUAL:
- op->type = slang_oper_lessequal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_GREATEREQUAL:
- op->type = slang_oper_greaterequal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_LSHIFT:*/
- /*case OP_RSHIFT:*/
- case OP_ADD:
- op->type = slang_oper_add;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_SUBTRACT:
- op->type = slang_oper_subtract;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_MULTIPLY:
- op->type = slang_oper_multiply;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_DIVIDE:
- op->type = slang_oper_divide;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_MODULUS:*/
- case OP_PREINCREMENT:
- op->type = slang_oper_preincrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_PREDECREMENT:
- op->type = slang_oper_predecrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_PLUS:
- op->type = slang_oper_plus;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_MINUS:
- op->type = slang_oper_minus;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_NOT:
- op->type = slang_oper_not;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- /*case OP_COMPLEMENT:*/
- case OP_SUBSCRIPT:
- op->type = slang_oper_subscript;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_CALL:
- op->type = slang_oper_call;
- op->a_id = parse_identifier (C);
- if (op->a_id == SLANG_ATOM_NULL)
- return 0;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, O, op, 0))
- return 0;
- C->I++;
- if (!C->parsing_builtin && !slang_function_scope_find_by_name (O->funs, op->a_id, 1))
- {
- const char *id;
-
- id = slang_atom_pool_id (C->atoms, op->a_id);
- if (!is_constructor_name (id, op->a_id, O->structs))
- {
- slang_info_log_error (C->L, "%s: undeclared function name.", id);
- return 0;
- }
- }
- break;
- case OP_FIELD:
- op->type = slang_oper_field;
- op->a_id = parse_identifier (C);
- if (op->a_id == SLANG_ATOM_NULL)
- return 0;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_POSTINCREMENT:
- op->type = slang_oper_postincrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_POSTDECREMENT:
- op->type = slang_oper_postdecrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- default:
- return 0;
- }
- }
- C->I++;
-
- *oper = *ops;
- slang_alloc_free (ops);
- return 1;
+ slang_operation *ops = NULL;
+ unsigned int num_ops = 0;
+ int number;
+
+ while (*C->I != OP_END) {
+ slang_operation *op;
+ const unsigned int op_code = *C->I++;
+
+ /* allocate default operation, becomes a no-op if not used */
+ ops = (slang_operation *)
+ slang_alloc_realloc(ops,
+ num_ops * sizeof(slang_operation),
+ (num_ops + 1) * sizeof(slang_operation));
+ if (ops == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ op = &ops[num_ops];
+ if (!slang_operation_construct(op)) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ num_ops++;
+ op->locals->outer_scope = O->vars;
+
+ switch (op_code) {
+ case OP_PUSH_VOID:
+ op->type = slang_oper_void;
+ break;
+ case OP_PUSH_BOOL:
+ op->type = slang_oper_literal_bool;
+ if (!parse_number(C, &number))
+ return 0;
+ op->literal = (GLfloat) number;
+ break;
+ case OP_PUSH_INT:
+ op->type = slang_oper_literal_int;
+ if (!parse_number(C, &number))
+ return 0;
+ op->literal = (GLfloat) number;
+ break;
+ case OP_PUSH_FLOAT:
+ op->type = slang_oper_literal_float;
+ if (!parse_float(C, &op->literal))
+ return 0;
+ break;
+ case OP_PUSH_IDENTIFIER:
+ op->type = slang_oper_identifier;
+ op->a_id = parse_identifier(C);
+ if (op->a_id == SLANG_ATOM_NULL)
+ return 0;
+ break;
+ case OP_SEQUENCE:
+ op->type = slang_oper_sequence;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_ASSIGN:
+ op->type = slang_oper_assign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_ADDASSIGN:
+ op->type = slang_oper_addassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_SUBASSIGN:
+ op->type = slang_oper_subassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_MULASSIGN:
+ op->type = slang_oper_mulassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_DIVASSIGN:
+ op->type = slang_oper_divassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_MODASSIGN: */
+ /*case OP_LSHASSIGN: */
+ /*case OP_RSHASSIGN: */
+ /*case OP_ORASSIGN: */
+ /*case OP_XORASSIGN: */
+ /*case OP_ANDASSIGN: */
+ case OP_SELECT:
+ op->type = slang_oper_select;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 3))
+ return 0;
+ break;
+ case OP_LOGICALOR:
+ op->type = slang_oper_logicalor;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LOGICALXOR:
+ op->type = slang_oper_logicalxor;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LOGICALAND:
+ op->type = slang_oper_logicaland;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_BITOR: */
+ /*case OP_BITXOR: */
+ /*case OP_BITAND: */
+ case OP_EQUAL:
+ op->type = slang_oper_equal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_NOTEQUAL:
+ op->type = slang_oper_notequal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LESS:
+ op->type = slang_oper_less;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_GREATER:
+ op->type = slang_oper_greater;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LESSEQUAL:
+ op->type = slang_oper_lessequal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_GREATEREQUAL:
+ op->type = slang_oper_greaterequal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_LSHIFT: */
+ /*case OP_RSHIFT: */
+ case OP_ADD:
+ op->type = slang_oper_add;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_SUBTRACT:
+ op->type = slang_oper_subtract;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_MULTIPLY:
+ op->type = slang_oper_multiply;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_DIVIDE:
+ op->type = slang_oper_divide;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_MODULUS: */
+ case OP_PREINCREMENT:
+ op->type = slang_oper_preincrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_PREDECREMENT:
+ op->type = slang_oper_predecrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_PLUS:
+ op->type = slang_oper_plus;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_MINUS:
+ op->type = slang_oper_minus;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_NOT:
+ op->type = slang_oper_not;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ /*case OP_COMPLEMENT: */
+ case OP_SUBSCRIPT:
+ op->type = slang_oper_subscript;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_CALL:
+ op->type = slang_oper_call;
+ op->a_id = parse_identifier(C);
+ if (op->a_id == SLANG_ATOM_NULL)
+ return 0;
+ while (*C->I != OP_END)
+ if (!parse_child_operation(C, O, op, 0))
+ return 0;
+ C->I++;
+
+ if (!C->parsing_builtin
+ && !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) {
+ const char *id;
+
+ id = slang_atom_pool_id(C->atoms, op->a_id);
+ if (!is_constructor_name(id, op->a_id, O->structs)) {
+ slang_info_log_error(C->L, "%s: undeclared function name.", id);
+ return 0;
+ }
+ }
+ break;
+ case OP_FIELD:
+ op->type = slang_oper_field;
+ op->a_id = parse_identifier(C);
+ if (op->a_id == SLANG_ATOM_NULL)
+ return 0;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_POSTINCREMENT:
+ op->type = slang_oper_postincrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_POSTDECREMENT:
+ op->type = slang_oper_postdecrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+ }
+ C->I++;
+
+ *oper = *ops;
+ slang_alloc_free(ops);
+
+ return 1;
}
/* parameter qualifier */
@@ -1222,78 +1264,76 @@ static int parse_expression (slang_parse_ctx *C, slang_output_ctx *O, slang_oper
#define PARAMETER_ARRAY_NOT_PRESENT 0
#define PARAMETER_ARRAY_PRESENT 1
-static int parse_parameter_declaration (slang_parse_ctx *C, slang_output_ctx *O,
- slang_variable *param)
+static int
+parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_variable * param)
{
- /* parse and validate the parameter's type qualifiers (there can be two at most) because
- * not all combinations are valid */
- if (!parse_type_qualifier (C, &param->type.qualifier))
- return 0;
- switch (*C->I++)
- {
- case PARAM_QUALIFIER_IN:
- if (param->type.qualifier != slang_qual_const && param->type.qualifier != slang_qual_none)
- {
- slang_info_log_error (C->L, "Invalid type qualifier.");
- return 0;
- }
- break;
- case PARAM_QUALIFIER_OUT:
- if (param->type.qualifier == slang_qual_none)
- param->type.qualifier = slang_qual_out;
- else
- {
- slang_info_log_error (C->L, "Invalid type qualifier.");
- return 0;
- }
- break;
- case PARAM_QUALIFIER_INOUT:
- if (param->type.qualifier == slang_qual_none)
- param->type.qualifier = slang_qual_inout;
- else
- {
- slang_info_log_error (C->L, "Invalid type qualifier.");
- return 0;
- }
- break;
- default:
- return 0;
- }
-
- /* parse parameter's type specifier and name */
- if (!parse_type_specifier (C, O, &param->type.specifier))
- return 0;
- param->a_name = parse_identifier (C);
- if (param->a_name == SLANG_ATOM_NULL)
- return 0;
-
- /* if the parameter is an array, parse its size (the size must be explicitly defined */
- if (*C->I++ == PARAMETER_ARRAY_PRESENT)
- {
- slang_type_specifier p;
-
- slang_type_specifier_ctr (&p);
- if (!slang_type_specifier_copy (&p, &param->type.specifier))
- {
- slang_type_specifier_dtr (&p);
- return GL_FALSE;
- }
- if (!convert_to_array (C, param, &p))
- {
- slang_type_specifier_dtr (&p);
- return GL_FALSE;
- }
- slang_type_specifier_dtr (&p);
- if (!parse_array_len (C, O, &param->array_len))
- return GL_FALSE;
- }
-
- /* calculate the parameter size */
- if (!calculate_var_size (C, O, param))
- return GL_FALSE;
-
- /* TODO: allocate the local address here? */
- return 1;
+ /* parse and validate the parameter's type qualifiers (there can be
+ * two at most) because not all combinations are valid
+ */
+ if (!parse_type_qualifier(C, &param->type.qualifier))
+ return 0;
+ switch (*C->I++) {
+ case PARAM_QUALIFIER_IN:
+ if (param->type.qualifier != slang_qual_const
+ && param->type.qualifier != slang_qual_none) {
+ slang_info_log_error(C->L, "Invalid type qualifier.");
+ return 0;
+ }
+ break;
+ case PARAM_QUALIFIER_OUT:
+ if (param->type.qualifier == slang_qual_none)
+ param->type.qualifier = slang_qual_out;
+ else {
+ slang_info_log_error(C->L, "Invalid type qualifier.");
+ return 0;
+ }
+ break;
+ case PARAM_QUALIFIER_INOUT:
+ if (param->type.qualifier == slang_qual_none)
+ param->type.qualifier = slang_qual_inout;
+ else {
+ slang_info_log_error(C->L, "Invalid type qualifier.");
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+
+ /* parse parameter's type specifier and name */
+ if (!parse_type_specifier(C, O, &param->type.specifier))
+ return 0;
+ param->a_name = parse_identifier(C);
+ if (param->a_name == SLANG_ATOM_NULL)
+ return 0;
+
+ /* if the parameter is an array, parse its size (the size must be
+ * explicitly defined
+ */
+ if (*C->I++ == PARAMETER_ARRAY_PRESENT) {
+ slang_type_specifier p;
+
+ slang_type_specifier_ctr(&p);
+ if (!slang_type_specifier_copy(&p, &param->type.specifier)) {
+ slang_type_specifier_dtr(&p);
+ return GL_FALSE;
+ }
+ if (!convert_to_array(C, param, &p)) {
+ slang_type_specifier_dtr(&p);
+ return GL_FALSE;
+ }
+ slang_type_specifier_dtr(&p);
+ if (!parse_array_len(C, O, &param->array_len))
+ return GL_FALSE;
+ }
+
+ /* calculate the parameter size */
+ if (!calculate_var_size(C, O, param))
+ return GL_FALSE;
+
+ /* TODO: allocate the local address here? */
+ return 1;
}
/* function type */
@@ -1336,251 +1376,247 @@ static int parse_parameter_declaration (slang_parse_ctx *C, slang_output_ctx *O,
/*#define OPERATOR_COMPLEMENT 28*/
#define OPERATOR_NOT 29
-static const struct {
- unsigned int o_code;
- const char *o_name;
+static const struct
+{
+ unsigned int o_code;
+ const char *o_name;
} operator_names[] = {
- { OPERATOR_INCREMENT, "++" },
- { OPERATOR_ADDASSIGN, "+=" },
- { OPERATOR_PLUS, "+" },
- { OPERATOR_DECREMENT, "--" },
- { OPERATOR_SUBASSIGN, "-=" },
- { OPERATOR_MINUS, "-" },
- { OPERATOR_NOT, "!" },
- { OPERATOR_MULASSIGN, "*=" },
- { OPERATOR_MULTIPLY, "*" },
- { OPERATOR_DIVASSIGN, "/=" },
- { OPERATOR_DIVIDE, "/" },
- { OPERATOR_LESSEQUAL, "<=" },
- /*{ OPERATOR_LSHASSIGN, "<<=" },*/
- /*{ OPERATOR_LSHIFT, "<<" },*/
- { OPERATOR_LESS, "<" },
- { OPERATOR_GREATEREQUAL, ">=" },
- /*{ OPERATOR_RSHASSIGN, ">>=" },*/
- /*{ OPERATOR_RSHIFT, ">>" },*/
- { OPERATOR_GREATER, ">" },
- /*{ OPERATOR_MODASSIGN, "%=" },*/
- /*{ OPERATOR_MODULUS, "%" },*/
- /*{ OPERATOR_ANDASSIGN, "&=" },*/
- /*{ OPERATOR_BITAND, "&" },*/
- /*{ OPERATOR_ORASSIGN, "|=" },*/
- /*{ OPERATOR_BITOR, "|" },*/
- /*{ OPERATOR_COMPLEMENT, "~" },*/
- /*{ OPERATOR_XORASSIGN, "^=" },*/
- { OPERATOR_LOGICALXOR, "^^" },
- /*{ OPERATOR_BITXOR, "^" }*/
+ {OPERATOR_INCREMENT, "++"},
+ {OPERATOR_ADDASSIGN, "+="},
+ {OPERATOR_PLUS, "+"},
+ {OPERATOR_DECREMENT, "--"},
+ {OPERATOR_SUBASSIGN, "-="},
+ {OPERATOR_MINUS, "-"},
+ {OPERATOR_NOT, "!"},
+ {OPERATOR_MULASSIGN, "*="},
+ {OPERATOR_MULTIPLY, "*"},
+ {OPERATOR_DIVASSIGN, "/="},
+ {OPERATOR_DIVIDE, "/"},
+ {OPERATOR_LESSEQUAL, "<="},
+ /*{ OPERATOR_LSHASSIGN, "<<=" }, */
+ /*{ OPERATOR_LSHIFT, "<<" }, */
+ {OPERATOR_LESS, "<"},
+ {OPERATOR_GREATEREQUAL, ">="},
+ /*{ OPERATOR_RSHASSIGN, ">>=" }, */
+ /*{ OPERATOR_RSHIFT, ">>" }, */
+ {OPERATOR_GREATER, ">"},
+ /*{ OPERATOR_MODASSIGN, "%=" }, */
+ /*{ OPERATOR_MODULUS, "%" }, */
+ /*{ OPERATOR_ANDASSIGN, "&=" }, */
+ /*{ OPERATOR_BITAND, "&" }, */
+ /*{ OPERATOR_ORASSIGN, "|=" }, */
+ /*{ OPERATOR_BITOR, "|" }, */
+ /*{ OPERATOR_COMPLEMENT, "~" }, */
+ /*{ OPERATOR_XORASSIGN, "^=" }, */
+ {OPERATOR_LOGICALXOR, "^^"},
+ /*{ OPERATOR_BITXOR, "^" } */
};
-static slang_atom parse_operator_name (slang_parse_ctx *C)
+static slang_atom
+parse_operator_name(slang_parse_ctx * C)
{
- unsigned int i;
-
- for (i = 0; i < sizeof (operator_names) / sizeof (*operator_names); i++)
- {
- if (operator_names[i].o_code == (unsigned int) (*C->I))
- {
- slang_atom atom = slang_atom_pool_atom (C->atoms, operator_names[i].o_name);
- if (atom == SLANG_ATOM_NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- C->I++;
- return atom;
- }
- }
- return 0;
+ unsigned int i;
+
+ for (i = 0; i < sizeof(operator_names) / sizeof(*operator_names); i++) {
+ if (operator_names[i].o_code == (unsigned int) (*C->I)) {
+ slang_atom atom =
+ slang_atom_pool_atom(C->atoms, operator_names[i].o_name);
+ if (atom == SLANG_ATOM_NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ C->I++;
+ return atom;
+ }
+ }
+ return 0;
}
-static int parse_function_prototype (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func)
+static int
+parse_function_prototype(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_function * func)
{
- /* parse function type and name */
- if (!parse_fully_specified_type (C, O, &func->header.type))
- return 0;
- switch (*C->I++)
- {
- case FUNCTION_ORDINARY:
- func->kind = slang_func_ordinary;
- func->header.a_name = parse_identifier (C);
- if (func->header.a_name == SLANG_ATOM_NULL)
- return 0;
- break;
- case FUNCTION_CONSTRUCTOR:
- func->kind = slang_func_constructor;
- if (func->header.type.specifier.type == slang_spec_struct)
- return 0;
- func->header.a_name = slang_atom_pool_atom (C->atoms,
- slang_type_specifier_type_to_string (func->header.type.specifier.type));
- if (func->header.a_name == SLANG_ATOM_NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- break;
- case FUNCTION_OPERATOR:
- func->kind = slang_func_operator;
- func->header.a_name = parse_operator_name (C);
- if (func->header.a_name == SLANG_ATOM_NULL)
- return 0;
- break;
- default:
- return 0;
- }
-
- /* parse function parameters */
- while (*C->I++ == PARAMETER_NEXT)
- {
- slang_variable *p;
-
- func->parameters->variables = (slang_variable *) slang_alloc_realloc (
- func->parameters->variables,
- func->parameters->num_variables * sizeof (slang_variable),
- (func->parameters->num_variables + 1) * sizeof (slang_variable));
- if (func->parameters->variables == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- p = &func->parameters->variables[func->parameters->num_variables];
- if (!slang_variable_construct (p))
- return 0;
- func->parameters->num_variables++;
- if (!parse_parameter_declaration (C, O, p))
- return 0;
- }
-
- /* function formal parameters and local variables share the same scope, so save
- * the information about param count in a seperate place
- * also link the scope to the global variable scope so when a given identifier is not
- * found here, the search process continues in the global space */
- func->param_count = func->parameters->num_variables;
- func->parameters->outer_scope = O->vars;
- return 1;
+ /* parse function type and name */
+ if (!parse_fully_specified_type(C, O, &func->header.type))
+ return 0;
+ switch (*C->I++) {
+ case FUNCTION_ORDINARY:
+ func->kind = slang_func_ordinary;
+ func->header.a_name = parse_identifier(C);
+ if (func->header.a_name == SLANG_ATOM_NULL)
+ return 0;
+ break;
+ case FUNCTION_CONSTRUCTOR:
+ func->kind = slang_func_constructor;
+ if (func->header.type.specifier.type == slang_spec_struct)
+ return 0;
+ func->header.a_name =
+ slang_atom_pool_atom(C->atoms,
+ slang_type_specifier_type_to_string
+ (func->header.type.specifier.type));
+ if (func->header.a_name == SLANG_ATOM_NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ break;
+ case FUNCTION_OPERATOR:
+ func->kind = slang_func_operator;
+ func->header.a_name = parse_operator_name(C);
+ if (func->header.a_name == SLANG_ATOM_NULL)
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+
+ /* parse function parameters */
+ while (*C->I++ == PARAMETER_NEXT) {
+ slang_variable *p = slang_variable_scope_grow(func->parameters);
+ if (!p) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!parse_parameter_declaration(C, O, p))
+ return 0;
+ }
+
+ /* function formal parameters and local variables share the same
+ * scope, so save the information about param count in a seperate
+ * place also link the scope to the global variable scope so when a
+ * given identifier is not found here, the search process continues
+ * in the global space
+ */
+ func->param_count = func->parameters->num_variables;
+ func->parameters->outer_scope = O->vars;
+ return 1;
}
-static int parse_function_definition (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func)
+static int
+parse_function_definition(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_function * func)
{
- slang_output_ctx o = *O;
-
- if (!parse_function_prototype (C, O, func))
- return 0;
-
- /* create function's body operation */
- func->body = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (func->body == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_operation_construct (func->body))
- {
- slang_alloc_free (func->body);
- func->body = NULL;
- slang_info_log_memory (C->L);
- return 0;
- }
-
- /* to parse the body the parse context is modified in order to capture parsed variables
- * into function's local variable scope */
- C->global_scope = 0;
- o.vars = func->parameters;
- if (!parse_statement (C, &o, func->body))
- return 0;
- C->global_scope = 1;
- return 1;
+ slang_output_ctx o = *O;
+
+ if (!parse_function_prototype(C, O, func))
+ return 0;
+
+ /* create function's body operation */
+ func->body =
+ (slang_operation *) slang_alloc_malloc(sizeof(slang_operation));
+ if (func->body == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_operation_construct(func->body)) {
+ slang_alloc_free(func->body);
+ func->body = NULL;
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ /* to parse the body the parse context is modified in order to
+ * capture parsed variables into function's local variable scope
+ */
+ C->global_scope = GL_FALSE;
+ o.vars = func->parameters;
+ if (!parse_statement(C, &o, func->body))
+ return 0;
+
+ C->global_scope = GL_TRUE;
+ return 1;
}
-static GLboolean initialize_global (slang_assemble_ctx *A, slang_variable *var)
+static GLboolean
+initialize_global(slang_assemble_ctx * A, slang_variable * var)
{
- slang_assembly_file_restore_point point;
- slang_machine mach;
- slang_assembly_local_info save_local = A->local;
- slang_operation op_id, op_assign;
- GLboolean result;
-
- /* save the current assembly */
- if (!slang_assembly_file_restore_point_save (A->file, &point))
- return GL_FALSE;
-
- /* setup the machine */
- mach = *A->mach;
- mach.ip = A->file->count;
-
- /* allocate local storage for expression */
- A->local.ret_size = 0;
- A->local.addr_tmp = 0;
- A->local.swizzle_tmp = 4;
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_alloc, 20))
- return GL_FALSE;
- if (!slang_assembly_file_push_label (A->file, slang_asm_enter, 20))
- return GL_FALSE;
-
- /* construct the left side of assignment */
- if (!slang_operation_construct (&op_id))
- return GL_FALSE;
- op_id.type = slang_oper_identifier;
- op_id.a_id = var->a_name;
-
- /* put the variable into operation's scope */
- op_id.locals->variables = (slang_variable *) slang_alloc_malloc (sizeof (slang_variable));
- if (op_id.locals->variables == NULL)
- {
- slang_operation_destruct (&op_id);
- return GL_FALSE;
- }
- op_id.locals->num_variables = 1;
- op_id.locals->variables[0] = *var;
-
- /* construct the assignment expression */
- if (!slang_operation_construct (&op_assign))
- {
- op_id.locals->num_variables = 0;
- slang_operation_destruct (&op_id);
- return GL_FALSE;
- }
- op_assign.type = slang_oper_assign;
- op_assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
- if (op_assign.children == NULL)
- {
- slang_operation_destruct (&op_assign);
- op_id.locals->num_variables = 0;
- slang_operation_destruct (&op_id);
- return GL_FALSE;
- }
- op_assign.num_children = 2;
- op_assign.children[0] = op_id;
- op_assign.children[1] = *var->initializer;
-
- /* insert the actual expression */
- result = _slang_assemble_operation (A, &op_assign, slang_ref_forbid);
-
- /* carefully destroy the operations */
- op_assign.num_children = 0;
- slang_alloc_free (op_assign.children);
- op_assign.children = NULL;
- slang_operation_destruct (&op_assign);
- op_id.locals->num_variables = 0;
- slang_operation_destruct (&op_id);
-
- if (!result)
- return GL_FALSE;
- if (!slang_assembly_file_push (A->file, slang_asm_exit))
- return GL_FALSE;
-
- /* execute the expression */
- if (!_slang_execute2 (A->file, &mach))
- return GL_FALSE;
-
- /* restore the old assembly */
- if (!slang_assembly_file_restore_point_load (A->file, &point))
- return GL_FALSE;
- A->local = save_local;
-
- /* now we copy the contents of the initialized variable back to the original machine */
- _mesa_memcpy ((GLubyte *) A->mach->mem + var->address, (GLubyte *) mach.mem + var->address,
- var->size);
-
- return GL_TRUE;
+ slang_assembly_file_restore_point point;
+ slang_machine mach;
+ slang_assembly_local_info save_local = A->local;
+ slang_operation op_id, op_assign;
+ GLboolean result;
+
+ /* save the current assembly */
+ if (!slang_assembly_file_restore_point_save(A->file, &point))
+ return GL_FALSE;
+
+ /* setup the machine */
+ mach = *A->mach;
+ mach.ip = A->file->count;
+
+ /* allocate local storage for expression */
+ A->local.ret_size = 0;
+ A->local.addr_tmp = 0;
+ A->local.swizzle_tmp = 4;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_local_alloc, 20))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_enter, 20))
+ return GL_FALSE;
+
+ /* construct the left side of assignment */
+ if (!slang_operation_construct(&op_id))
+ return GL_FALSE;
+ op_id.type = slang_oper_identifier;
+ op_id.a_id = var->a_name;
+
+ /* put the variable into operation's scope */
+ op_id.locals->variables =
+ (slang_variable *) slang_alloc_malloc(sizeof(slang_variable));
+ if (op_id.locals->variables == NULL) {
+ slang_operation_destruct(&op_id);
+ return GL_FALSE;
+ }
+ op_id.locals->num_variables = 1;
+ op_id.locals->variables[0] = *var;
+
+ /* construct the assignment expression */
+ if (!slang_operation_construct(&op_assign)) {
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct(&op_id);
+ return GL_FALSE;
+ }
+ op_assign.type = slang_oper_assign;
+ op_assign.children =
+ (slang_operation *) slang_alloc_malloc(2 * sizeof(slang_operation));
+ if (op_assign.children == NULL) {
+ slang_operation_destruct(&op_assign);
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct(&op_id);
+ return GL_FALSE;
+ }
+ op_assign.num_children = 2;
+ op_assign.children[0] = op_id;
+ op_assign.children[1] = *var->initializer;
+
+ /* insert the actual expression */
+ result = _slang_assemble_operation(A, &op_assign, slang_ref_forbid);
+
+ /* carefully destroy the operations */
+ op_assign.num_children = 0;
+ slang_alloc_free(op_assign.children);
+ op_assign.children = NULL;
+ slang_operation_destruct(&op_assign);
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct(&op_id);
+
+ if (!result)
+ return GL_FALSE;
+ if (!slang_assembly_file_push(A->file, slang_asm_exit))
+ return GL_FALSE;
+
+ /* execute the expression */
+ if (!_slang_execute2(A->file, &mach))
+ return GL_FALSE;
+
+ /* restore the old assembly */
+ if (!slang_assembly_file_restore_point_load(A->file, &point))
+ return GL_FALSE;
+ A->local = save_local;
+
+ /* now we copy the contents of the initialized variable back to the original machine */
+ _mesa_memcpy((GLubyte *) A->mach->mem + var->address,
+ (GLubyte *) mach.mem + var->address, var->size);
+
+ return GL_TRUE;
}
/* init declarator list */
@@ -1594,89 +1630,88 @@ static GLboolean initialize_global (slang_assemble_ctx *A, slang_variable *var)
#define VARIABLE_ARRAY_EXPLICIT 3
#define VARIABLE_ARRAY_UNKNOWN 4
-static int parse_init_declarator (slang_parse_ctx *C, slang_output_ctx *O,
- const slang_fully_specified_type *type)
+
+/**
+ * Parse the initializer for a variable declaration.
+ */
+static int
+parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
+ const slang_fully_specified_type * type)
{
- slang_variable *var;
-
- /* empty init declatator (without name, e.g. "float ;") */
- if (*C->I++ == VARIABLE_NONE)
- return 1;
-
- /* make room for the new variable and initialize it */
- O->vars->variables = (slang_variable *) slang_alloc_realloc (O->vars->variables,
- O->vars->num_variables * sizeof (slang_variable),
- (O->vars->num_variables + 1) * sizeof (slang_variable));
- if (O->vars->variables == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- var = &O->vars->variables[O->vars->num_variables];
- if (!slang_variable_construct (var))
- return 0;
- O->vars->num_variables++;
-
- /* copy the declarator qualifier type, parse the identifier */
- var->global = C->global_scope;
- var->type.qualifier = type->qualifier;
- var->a_name = parse_identifier (C);
- if (var->a_name == SLANG_ATOM_NULL)
- return 0;
-
- switch (*C->I++)
- {
- case VARIABLE_NONE:
- /* simple variable declarator - just copy the specifier */
- if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier))
- return 0;
- break;
- case VARIABLE_INITIALIZER:
- /* initialized variable - copy the specifier and parse the expression */
- if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier))
- return 0;
- var->initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (var->initializer == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_operation_construct (var->initializer))
- {
- slang_alloc_free (var->initializer);
- var->initializer = NULL;
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!parse_expression (C, O, var->initializer))
- return 0;
- break;
+ slang_variable *var;
+
+ /* empty init declatator (without name, e.g. "float ;") */
+ if (*C->I++ == VARIABLE_NONE)
+ return 1;
+
+ /* make room for the new variable and initialize it */
+ var = slang_variable_scope_grow(O->vars);
+ if (!var) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ /* copy the declarator qualifier type, parse the identifier */
+ var->global = C->global_scope;
+ var->type.qualifier = type->qualifier;
+ var->a_name = parse_identifier(C);
+ if (var->a_name == SLANG_ATOM_NULL)
+ return 0;
+
+ switch (*C->I++) {
+ case VARIABLE_NONE:
+ /* simple variable declarator - just copy the specifier */
+ if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
+ return 0;
+ break;
+ case VARIABLE_INITIALIZER:
+ /* initialized variable - copy the specifier and parse the expression */
+ if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
+ return 0;
+ var->initializer =
+ (slang_operation *) slang_alloc_malloc(sizeof(slang_operation));
+ if (var->initializer == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_operation_construct(var->initializer)) {
+ slang_alloc_free(var->initializer);
+ var->initializer = NULL;
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!parse_expression(C, O, var->initializer))
+ return 0;
+ break;
#if 0
- case VARIABLE_ARRAY_UNKNOWN:
- /* unsized array - mark it as array and copy the specifier to the array element */
- if (!convert_to_array (C, var, &type->specifier))
- return GL_FALSE;
- break;
+ case VARIABLE_ARRAY_UNKNOWN:
+ /* unsized array - mark it as array and copy the specifier to
+ the array element
+ */
+ if (!convert_to_array(C, var, &type->specifier))
+ return GL_FALSE;
+ break;
#endif
- case VARIABLE_ARRAY_EXPLICIT:
- if (!convert_to_array (C, var, &type->specifier))
- return GL_FALSE;
- if (!parse_array_len (C, O, &var->array_len))
- return GL_FALSE;
- break;
- default:
- return 0;
- }
-
- /* allocate global address space for a variable with a known size */
- if (C->global_scope && !(var->type.specifier.type == slang_spec_array && var->array_len == 0))
- {
- if (!calculate_var_size (C, O, var))
- return GL_FALSE;
- var->address = slang_var_pool_alloc (O->global_pool, var->size);
- }
-
- /* initialize global variable */
+ case VARIABLE_ARRAY_EXPLICIT:
+ if (!convert_to_array(C, var, &type->specifier))
+ return GL_FALSE;
+ if (!parse_array_len(C, O, &var->array_len))
+ return GL_FALSE;
+ break;
+ default:
+ return 0;
+ }
+
+ /* allocate global address space for a variable with a known size */
+ if (C->global_scope
+ && !(var->type.specifier.type == slang_spec_array
+ && var->array_len == 0)) {
+ if (!calculate_var_size(C, O, var))
+ return GL_FALSE;
+ var->address = slang_var_pool_alloc(O->global_pool, var->size);
+ }
+
+ /* initialize global variable */
if (C->global_scope) {
if (var->initializer != NULL) {
slang_assemble_ctx A;
@@ -1687,160 +1722,171 @@ static int parse_init_declarator (slang_parse_ctx *C, slang_output_ctx *O,
A.space.funcs = O->funs;
A.space.structs = O->structs;
A.space.vars = O->vars;
- if (!initialize_global (&A, var))
+ if (!initialize_global(&A, var))
return 0;
}
else {
- _mesa_memset ((GLubyte *) (O->machine->mem) + var->address, 0, var->size);
+ _mesa_memset((GLubyte *) (O->machine->mem) + var->address, 0,
+ var->size);
}
- }
- return 1;
+ }
+ return 1;
}
-static int parse_init_declarator_list (slang_parse_ctx *C, slang_output_ctx *O)
+/**
+ * Parse a list of variable declarations. Each variable may have an
+ * initializer.
+ */
+static int
+parse_init_declarator_list(slang_parse_ctx * C, slang_output_ctx * O)
{
- slang_fully_specified_type type;
-
- /* parse the fully specified type, common to all declarators */
- if (!slang_fully_specified_type_construct (&type))
- return 0;
- if (!parse_fully_specified_type (C, O, &type))
- {
- slang_fully_specified_type_destruct (&type);
- return 0;
- }
-
- /* parse declarators, pass-in the parsed type */
- do
- {
- if (!parse_init_declarator (C, O, &type))
- {
- slang_fully_specified_type_destruct (&type);
- return 0;
- }
- }
- while (*C->I++ == DECLARATOR_NEXT);
-
- slang_fully_specified_type_destruct (&type);
- return 1;
+ slang_fully_specified_type type;
+
+ /* parse the fully specified type, common to all declarators */
+ if (!slang_fully_specified_type_construct(&type))
+ return 0;
+ if (!parse_fully_specified_type(C, O, &type)) {
+ slang_fully_specified_type_destruct(&type);
+ return 0;
+ }
+
+ /* parse declarators, pass-in the parsed type */
+ do {
+ if (!parse_init_declarator(C, O, &type)) {
+ slang_fully_specified_type_destruct(&type);
+ return 0;
+ }
+ }
+ while (*C->I++ == DECLARATOR_NEXT);
+
+ slang_fully_specified_type_destruct(&type);
+ return 1;
}
-static int parse_function (slang_parse_ctx *C, slang_output_ctx *O, int definition,
- slang_function **parsed_func_ret)
+
+/**
+ * Parse a function definition or declaration.
+ * \param C parsing context
+ * \param O output context
+ * \param definition if non-zero expect a definition, else a declaration
+ * \param parsed_func_ret returns the parsed function
+ * \return 1 if success, 0 if failure
+ */
+static int
+parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition,
+ slang_function ** parsed_func_ret)
{
- slang_function parsed_func, *found_func;
-
- /* parse function definition/declaration */
- if (!slang_function_construct (&parsed_func))
- return 0;
- if (definition)
- {
- if (!parse_function_definition (C, O, &parsed_func))
- {
- slang_function_destruct (&parsed_func);
- return 0;
- }
- }
- else
- {
- if (!parse_function_prototype (C, O, &parsed_func))
- {
- slang_function_destruct (&parsed_func);
- return 0;
- }
- }
-
- /* find a function with a prototype matching the parsed one - only the current scope
- * is being searched to allow built-in function overriding */
- found_func = slang_function_scope_find (O->funs, &parsed_func, 0);
- if (found_func == NULL)
- {
- /* add the parsed function to the function list */
- O->funs->functions = (slang_function *) slang_alloc_realloc (O->funs->functions,
- O->funs->num_functions * sizeof (slang_function),
- (O->funs->num_functions + 1) * sizeof (slang_function));
- if (O->funs->functions == NULL)
- {
- slang_info_log_memory (C->L);
- slang_function_destruct (&parsed_func);
- return 0;
- }
- O->funs->functions[O->funs->num_functions] = parsed_func;
- O->funs->num_functions++;
-
- /* return the newly parsed function */
- *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1];
- }
- else
- {
- /* TODO: check function return type qualifiers and specifiers */
- if (definition)
- {
- if (found_func->body != NULL)
- {
- slang_info_log_error (C->L, "%s: function already has a body.",
- slang_atom_pool_id (C->atoms, parsed_func.header.a_name));
- slang_function_destruct (&parsed_func);
- return 0;
- }
-
- /* destroy the existing function declaration and replace it with the new one,
- * remember to save the fixup table */
- parsed_func.fixups = found_func->fixups;
- slang_fixup_table_init (&found_func->fixups);
- slang_function_destruct (found_func);
- *found_func = parsed_func;
- }
- else
- {
- /* another declaration of the same function prototype - ignore it */
- slang_function_destruct (&parsed_func);
- }
-
- /* return the found function */
- *parsed_func_ret = found_func;
- }
-
- /* assemble the parsed function */
- {
- slang_assemble_ctx A;
-
- A.file = O->assembly;
- A.mach = O->machine;
- A.atoms = C->atoms;
- A.space.funcs = O->funs;
- A.space.structs = O->structs;
- A.space.vars = O->vars;
- if (!_slang_assemble_function (&A, *parsed_func_ret))
- return 0;
- }
- return 1;
+ slang_function parsed_func, *found_func;
+
+ /* parse function definition/declaration */
+ if (!slang_function_construct(&parsed_func))
+ return 0;
+ if (definition) {
+ if (!parse_function_definition(C, O, &parsed_func)) {
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+ }
+ else {
+ if (!parse_function_prototype(C, O, &parsed_func)) {
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+ }
+
+ /* find a function with a prototype matching the parsed one - only
+ * the current scope is being searched to allow built-in function
+ * overriding
+ */
+ found_func = slang_function_scope_find(O->funs, &parsed_func, 0);
+ if (found_func == NULL) {
+ /* add the parsed function to the function list */
+ O->funs->functions =
+ (slang_function *) slang_alloc_realloc(O->funs->functions,
+ O->funs->num_functions *
+ sizeof(slang_function),
+ (O->funs->num_functions +
+ 1) * sizeof(slang_function));
+ if (O->funs->functions == NULL) {
+ slang_info_log_memory(C->L);
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+ O->funs->functions[O->funs->num_functions] = parsed_func;
+ O->funs->num_functions++;
+
+ /* return the newly parsed function */
+ *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1];
+ }
+ else {
+ /* TODO: check function return type qualifiers and specifiers */
+ if (definition) {
+ if (found_func->body != NULL) {
+ slang_info_log_error(C->L, "%s: function already has a body.",
+ slang_atom_pool_id(C->atoms,
+ parsed_func.header.
+ a_name));
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+
+ /* destroy the existing function declaration and replace it
+ * with the new one, remember to save the fixup table
+ */
+ parsed_func.fixups = found_func->fixups;
+ slang_fixup_table_init(&found_func->fixups);
+ slang_function_destruct(found_func);
+ *found_func = parsed_func;
+ }
+ else {
+ /* another declaration of the same function prototype - ignore it */
+ slang_function_destruct(&parsed_func);
+ }
+
+ /* return the found function */
+ *parsed_func_ret = found_func;
+ }
+
+ /* assemble the parsed function */
+ {
+ slang_assemble_ctx A;
+
+ A.file = O->assembly;
+ A.mach = O->machine;
+ A.atoms = C->atoms;
+ A.space.funcs = O->funs;
+ A.space.structs = O->structs;
+ A.space.vars = O->vars;
+ if (!_slang_assemble_function(&A, *parsed_func_ret))
+ return 0;
+ }
+ return 1;
}
/* declaration */
#define DECLARATION_FUNCTION_PROTOTYPE 1
#define DECLARATION_INIT_DECLARATOR_LIST 2
-static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O)
+static int
+parse_declaration(slang_parse_ctx * C, slang_output_ctx * O)
{
- switch (*C->I++)
- {
- case DECLARATION_INIT_DECLARATOR_LIST:
- if (!parse_init_declarator_list (C, O))
- return 0;
- break;
- case DECLARATION_FUNCTION_PROTOTYPE:
- {
- slang_function *dummy_func;
-
- if (!parse_function (C, O, 0, &dummy_func))
- return 0;
- }
- break;
- default:
- return 0;
- }
- return 1;
+ switch (*C->I++) {
+ case DECLARATION_INIT_DECLARATOR_LIST:
+ if (!parse_init_declarator_list(C, O))
+ return 0;
+ break;
+ case DECLARATION_FUNCTION_PROTOTYPE:
+ {
+ slang_function *dummy_func;
+
+ if (!parse_function(C, O, 0, &dummy_func))
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
/* external declaration */
@@ -1849,9 +1895,9 @@ static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O)
#define EXTERNAL_DECLARATION 2
static GLboolean
-parse_code_unit (slang_parse_ctx *C, slang_code_unit *unit)
+parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit)
{
- slang_output_ctx o;
+ slang_output_ctx o;
/* setup output context */
o.funs = &unit->funs;
@@ -1861,34 +1907,33 @@ parse_code_unit (slang_parse_ctx *C, slang_code_unit *unit)
o.global_pool = &unit->object->varpool;
o.machine = &unit->object->machine;
- /* parse individual functions and declarations */
- while (*C->I != EXTERNAL_NULL)
- {
- switch (*C->I++)
- {
- case EXTERNAL_FUNCTION_DEFINITION:
- {
- slang_function *func;
-
- if (!parse_function (C, &o, 1, &func))
- return 0;
- }
- break;
- case EXTERNAL_DECLARATION:
- if (!parse_declaration (C, &o))
- return 0;
- break;
- default:
- return 0;
- }
- }
- C->I++;
- return 1;
+ /* parse individual functions and declarations */
+ while (*C->I != EXTERNAL_NULL) {
+ switch (*C->I++) {
+ case EXTERNAL_FUNCTION_DEFINITION:
+ {
+ slang_function *func;
+
+ if (!parse_function(C, &o, 1, &func))
+ return 0;
+ }
+ break;
+ case EXTERNAL_DECLARATION:
+ if (!parse_declaration(C, &o))
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+ }
+ C->I++;
+ return 1;
}
static GLboolean
-compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type,
- slang_info_log *infolog, slang_code_unit *builtin, slang_code_unit *downlink)
+compile_binary(const byte * prod, slang_code_unit * unit,
+ slang_unit_type type, slang_info_log * infolog,
+ slang_code_unit * builtin, slang_code_unit * downlink)
{
slang_parse_ctx C;
@@ -1901,7 +1946,7 @@ compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type,
C.global_scope = GL_TRUE;
C.atoms = &unit->object->atompool;
- if (!check_revision (&C))
+ if (!check_revision(&C))
return GL_FALSE;
if (downlink != NULL) {
@@ -1911,48 +1956,64 @@ compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type,
}
/* parse translation unit */
- return parse_code_unit (&C, unit);
+ return parse_code_unit(&C, unit);
}
static GLboolean
-compile_with_grammar (grammar id, const char *source, slang_code_unit *unit, slang_unit_type type,
- slang_info_log *infolog, slang_code_unit *builtin)
+compile_with_grammar(grammar id, const char *source, slang_code_unit * unit,
+ slang_unit_type type, slang_info_log * infolog,
+ slang_code_unit * builtin)
{
- byte *prod;
+ byte *prod;
GLuint size, start, version;
+ slang_string preprocessed;
- /* retrieve version */
- if (!_slang_preprocess_version (source, &version, &start, infolog))
+ /* First retrieve the version number. */
+ if (!_slang_preprocess_version(source, &version, &start, infolog))
return GL_FALSE;
if (version > 110) {
- slang_info_log_error (infolog, "language version specified is not supported.");
+ slang_info_log_error(infolog,
+ "language version specified is not supported.");
return GL_FALSE;
}
- /* check the syntax and generate its binary representation */
- if (!grammar_fast_check (id, (const byte *) source + start, &prod, &size, 65536))
- {
- char buf[1024];
- unsigned int pos;
- grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);
- slang_info_log_error (infolog, buf);
+ /* Now preprocess the source string. */
+ slang_string_init(&preprocessed);
+ if (!_slang_preprocess_directives(&preprocessed, &source[start], infolog)) {
+ slang_string_free(&preprocessed);
+ slang_info_log_error(infolog, "failed to preprocess the source.");
return GL_FALSE;
- }
+ }
+
+ /* Finally check the syntax and generate its binary representation. */
+ if (!grammar_fast_check
+ (id, (const byte *) (slang_string_cstr(&preprocessed)), &prod, &size,
+ 65536)) {
+ char buf[1024];
+ GLint pos;
- /* syntax is okay - translate it to internal representation */
- if (!compile_binary (prod, unit, type, infolog, builtin, &builtin[SLANG_BUILTIN_TOTAL - 1])) {
- grammar_alloc_free (prod);
+ slang_string_free(&preprocessed);
+ grammar_get_last_error((byte *) (buf), sizeof(buf), &pos);
+ slang_info_log_error(infolog, buf);
return GL_FALSE;
}
+ slang_string_free(&preprocessed);
- grammar_alloc_free (prod);
+ /* Syntax is okay - translate it to internal representation. */
+ if (!compile_binary
+ (prod, unit, type, infolog, builtin,
+ &builtin[SLANG_BUILTIN_TOTAL - 1])) {
+ grammar_alloc_free(prod);
+ return GL_FALSE;
+ }
+ grammar_alloc_free(prod);
return GL_TRUE;
}
-static const char *slang_shader_syn =
+LONGSTRING static const char *slang_shader_syn =
#include "library/slang_shader_syn.h"
-;
+ ;
static const byte slang_core_gc[] = {
#include "library/slang_core_gc.h"
@@ -1977,106 +2038,111 @@ static const byte slang_builtin_vec4_gc[] = {
#endif
static GLboolean
-compile_object (grammar *id, const char *source, slang_code_object *object, slang_unit_type type,
- slang_info_log *infolog)
+compile_object(grammar * id, const char *source, slang_code_object * object,
+ slang_unit_type type, slang_info_log * infolog)
{
slang_code_unit *builtins = NULL;
/* load GLSL grammar */
- *id = grammar_load_from_text ((const byte *) (slang_shader_syn));
- if (*id == 0)
- {
- byte buf[1024];
- int pos;
-
- grammar_get_last_error (buf, 1024, &pos);
- slang_info_log_error (infolog, (const char *) (buf));
+ *id = grammar_load_from_text((const byte *) (slang_shader_syn));
+ if (*id == 0) {
+ byte buf[1024];
+ int pos;
+
+ grammar_get_last_error(buf, 1024, &pos);
+ slang_info_log_error(infolog, (const char *) (buf));
return GL_FALSE;
- }
-
- /* set shader type - the syntax is slightly different for different shaders */
- if (type == slang_unit_fragment_shader || type == slang_unit_fragment_builtin)
- grammar_set_reg8 (*id, (const byte *) "shader_type", 1);
- else
- grammar_set_reg8 (*id, (const byte *) "shader_type", 2);
-
- /* enable language extensions */
- grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 1);
-
- /* if parsing user-specified shader, load built-in library */
- if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader)
- {
- /* compile core functionality first */
- if (!compile_binary (slang_core_gc, &object->builtin[SLANG_BUILTIN_CORE],
- slang_unit_fragment_builtin, infolog, NULL, NULL))
+ }
+
+ /* set shader type - the syntax is slightly different for different shaders */
+ if (type == slang_unit_fragment_shader
+ || type == slang_unit_fragment_builtin)
+ grammar_set_reg8(*id, (const byte *) "shader_type", 1);
+ else
+ grammar_set_reg8(*id, (const byte *) "shader_type", 2);
+
+ /* enable language extensions */
+ grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1);
+
+ /* if parsing user-specified shader, load built-in library */
+ if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader) {
+ /* compile core functionality first */
+ if (!compile_binary(slang_core_gc, &object->builtin[SLANG_BUILTIN_CORE],
+ slang_unit_fragment_builtin, infolog, NULL, NULL))
return GL_FALSE;
- /* compile common functions and variables, link to core */
- if (!compile_binary (slang_common_builtin_gc, &object->builtin[SLANG_BUILTIN_COMMON],
- slang_unit_fragment_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_CORE]))
+ /* compile common functions and variables, link to core */
+ if (!compile_binary
+ (slang_common_builtin_gc, &object->builtin[SLANG_BUILTIN_COMMON],
+ slang_unit_fragment_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_CORE]))
return GL_FALSE;
- /* compile target-specific functions and variables, link to common */
- if (type == slang_unit_fragment_shader)
- {
- if (!compile_binary (slang_fragment_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET],
- slang_unit_fragment_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_COMMON]))
+ /* compile target-specific functions and variables, link to common */
+ if (type == slang_unit_fragment_shader) {
+ if (!compile_binary
+ (slang_fragment_builtin_gc,
+ &object->builtin[SLANG_BUILTIN_TARGET],
+ slang_unit_fragment_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_COMMON]))
return GL_FALSE;
- }
- else if (type == slang_unit_vertex_shader)
- {
- if (!compile_binary (slang_vertex_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET],
- slang_unit_vertex_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_COMMON]))
+ }
+ else if (type == slang_unit_vertex_shader) {
+ if (!compile_binary
+ (slang_vertex_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET],
+ slang_unit_vertex_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_COMMON]))
return GL_FALSE;
- }
+ }
#if defined(USE_X86_ASM) || defined(SLANG_X86)
/* compile x86 4-component vector overrides, link to target */
- if (!compile_binary (slang_builtin_vec4_gc, &object->builtin[SLANG_BUILTIN_VEC4],
- slang_unit_fragment_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_TARGET]))
+ if (!compile_binary
+ (slang_builtin_vec4_gc, &object->builtin[SLANG_BUILTIN_VEC4],
+ slang_unit_fragment_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_TARGET]))
return GL_FALSE;
#endif
- /* disable language extensions */
- grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 0);
+ /* disable language extensions */
+ grammar_set_reg8(*id, (const byte *) "parsing_builtin", 0);
builtins = object->builtin;
- }
+ }
- /* compile the actual shader - pass-in built-in library for external shader */
- return compile_with_grammar (*id, source, &object->unit, type, infolog, builtins);
+ /* compile the actual shader - pass-in built-in library for external shader */
+ return compile_with_grammar(*id, source, &object->unit, type, infolog,
+ builtins);
}
GLboolean
-_slang_compile (const char *source, slang_code_object *object, slang_unit_type type,
- slang_info_log *infolog)
+_slang_compile(const char *source, slang_code_object * object,
+ slang_unit_type type, slang_info_log * infolog)
{
GLboolean success;
grammar id = 0;
- _slang_code_object_dtr (object);
- _slang_code_object_ctr (object);
+ _slang_code_object_dtr(object);
+ _slang_code_object_ctr(object);
- success = compile_object (&id, source, object, type, infolog);
+ success = compile_object(&id, source, object, type, infolog);
if (id != 0)
- grammar_destroy (id);
+ grammar_destroy(id);
if (!success)
return GL_FALSE;
- if (!_slang_build_export_data_table (&object->expdata, &object->unit.vars))
+ if (!_slang_build_export_data_table(&object->expdata, &object->unit.vars))
return GL_FALSE;
- if (!_slang_build_export_code_table (&object->expcode, &object->unit.funs, &object->unit))
+ if (!_slang_build_export_code_table
+ (&object->expcode, &object->unit.funs, &object->unit))
return GL_FALSE;
#if defined(USE_X86_ASM) || defined(SLANG_X86)
/* XXX: lookup the @main label */
- if (!_slang_x86_codegen (&object->machine, &object->assembly, object->expcode.entries[0].address))
+ if (!_slang_x86_codegen
+ (&object->machine, &object->assembly,
+ object->expcode.entries[0].address))
return GL_FALSE;
#endif
return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c
index eb8fd1bd40f..e6e0d89ddb6 100644
--- a/src/mesa/shader/slang/slang_compile_function.c
+++ b/src/mesa/shader/slang/slang_compile_function.c
@@ -33,50 +33,74 @@
/* slang_fixup_table */
-void slang_fixup_table_init (slang_fixup_table *fix)
+void
+slang_fixup_table_init(slang_fixup_table * fix)
{
- fix->table = NULL;
- fix->count = 0;
+ fix->table = NULL;
+ fix->count = 0;
}
-void slang_fixup_table_free (slang_fixup_table *fix)
+void
+slang_fixup_table_free(slang_fixup_table * fix)
{
- slang_alloc_free (fix->table);
- slang_fixup_table_init (fix);
+ slang_alloc_free(fix->table);
+ slang_fixup_table_init(fix);
}
+/**
+ * Add a new fixup address to the table.
+ */
+GLboolean
+slang_fixup_save(slang_fixup_table *fixups, GLuint address)
+{
+ fixups->table = (GLuint *)
+ slang_alloc_realloc(fixups->table,
+ fixups->count * sizeof(GLuint),
+ (fixups->count + 1) * sizeof(GLuint));
+ if (fixups->table == NULL)
+ return GL_FALSE;
+ fixups->table[fixups->count] = address;
+ fixups->count++;
+ return GL_TRUE;
+}
+
+
+
/* slang_function */
-int slang_function_construct (slang_function *func)
+int
+slang_function_construct(slang_function * func)
{
- func->kind = slang_func_ordinary;
- if (!slang_variable_construct (&func->header))
- return 0;
- func->parameters = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
- if (func->parameters == NULL)
- {
- slang_variable_destruct (&func->header);
- return 0;
- }
- _slang_variable_scope_ctr (func->parameters);
- func->param_count = 0;
- func->body = NULL;
- func->address = ~0;
- slang_fixup_table_init (&func->fixups);
- return 1;
+ func->kind = slang_func_ordinary;
+ if (!slang_variable_construct(&func->header))
+ return 0;
+
+ func->parameters = (slang_variable_scope *)
+ slang_alloc_malloc(sizeof(slang_variable_scope));
+ if (func->parameters == NULL) {
+ slang_variable_destruct(&func->header);
+ return 0;
+ }
+
+ _slang_variable_scope_ctr(func->parameters);
+ func->param_count = 0;
+ func->body = NULL;
+ func->address = ~0;
+ slang_fixup_table_init(&func->fixups);
+ return 1;
}
-void slang_function_destruct (slang_function *func)
+void
+slang_function_destruct(slang_function * func)
{
- slang_variable_destruct (&func->header);
- slang_variable_scope_destruct (func->parameters);
- slang_alloc_free (func->parameters);
- if (func->body != NULL)
- {
- slang_operation_destruct (func->body);
- slang_alloc_free (func->body);
- }
- slang_fixup_table_free (&func->fixups);
+ slang_variable_destruct(&func->header);
+ slang_variable_scope_destruct(func->parameters);
+ slang_alloc_free(func->parameters);
+ if (func->body != NULL) {
+ slang_operation_destruct(func->body);
+ slang_alloc_free(func->body);
+ }
+ slang_fixup_table_free(&func->fixups);
}
/*
@@ -84,60 +108,82 @@ void slang_function_destruct (slang_function *func)
*/
GLvoid
-_slang_function_scope_ctr (slang_function_scope *self)
+_slang_function_scope_ctr(slang_function_scope * self)
{
self->functions = NULL;
self->num_functions = 0;
self->outer_scope = NULL;
}
-void slang_function_scope_destruct (slang_function_scope *scope)
+void
+slang_function_scope_destruct(slang_function_scope * scope)
{
- unsigned int i;
+ unsigned int i;
- for (i = 0; i < scope->num_functions; i++)
- slang_function_destruct (scope->functions + i);
- slang_alloc_free (scope->functions);
+ for (i = 0; i < scope->num_functions; i++)
+ slang_function_destruct(scope->functions + i);
+ slang_alloc_free(scope->functions);
}
-int slang_function_scope_find_by_name (slang_function_scope *funcs, slang_atom a_name, int all_scopes)
+
+/**
+ * Search a list of functions for a particular function by name.
+ * \param funcs the list of functions to search
+ * \param a_name the name to search for
+ * \param all_scopes if non-zero, search containing scopes too.
+ * \return pointer to found function, or NULL.
+ */
+int
+slang_function_scope_find_by_name(slang_function_scope * funcs,
+ slang_atom a_name, int all_scopes)
{
- unsigned int i;
-
- for (i = 0; i < funcs->num_functions; i++)
- if (a_name == funcs->functions[i].header.a_name)
- return 1;
- if (all_scopes && funcs->outer_scope != NULL)
- return slang_function_scope_find_by_name (funcs->outer_scope, a_name, 1);
- return 0;
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++)
+ if (a_name == funcs->functions[i].header.a_name)
+ return 1;
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find_by_name(funcs->outer_scope, a_name, 1);
+ return 0;
}
-slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_function *fun,
- int all_scopes)
+
+/**
+ * Search a list of functions for a particular function (for implementing
+ * function calls. Matching is done by first comparing the function's name,
+ * then the function's parameter list.
+ *
+ * \param funcs the list of functions to search
+ * \param fun the function to search for
+ * \param all_scopes if non-zero, search containing scopes too.
+ * \return pointer to found function, or NULL.
+ */
+slang_function *
+slang_function_scope_find(slang_function_scope * funcs, slang_function * fun,
+ int all_scopes)
{
- unsigned int i;
-
- for (i = 0; i < funcs->num_functions; i++)
- {
- slang_function *f = &funcs->functions[i];
- unsigned int j;
-
- if (fun->header.a_name != f->header.a_name)
- continue;
- if (fun->param_count != f->param_count)
- continue;
- for (j = 0; j < fun->param_count; j++)
- {
- if (!slang_type_specifier_equal (&fun->parameters->variables[j].type.specifier,
- &f->parameters->variables[j].type.specifier))
- break;
- }
- if (j == fun->param_count)
- return f;
- }
- if (all_scopes && funcs->outer_scope != NULL)
- return slang_function_scope_find (funcs->outer_scope, fun, 1);
- return NULL;
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++) {
+ slang_function *f = &funcs->functions[i];
+ unsigned int j;
+
+ if (fun->header.a_name != f->header.a_name)
+ continue;
+ if (fun->param_count != f->param_count)
+ continue;
+ for (j = 0; j < fun->param_count; j++) {
+ if (!slang_type_specifier_equal
+ (&fun->parameters->variables[j].type.specifier,
+ &f->parameters->variables[j].type.specifier))
+ break;
+ }
+ if (j == fun->param_count)
+ return f;
+ }
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find(funcs->outer_scope, fun, 1);
+ return NULL;
}
/*
@@ -145,31 +191,30 @@ slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_fu
*/
GLboolean
-_slang_build_export_code_table (slang_export_code_table *tbl, slang_function_scope *funs,
- slang_code_unit *unit)
+_slang_build_export_code_table(slang_export_code_table * tbl,
+ slang_function_scope * funs,
+ slang_code_unit * unit)
{
- slang_atom mainAtom;
- GLuint i;
-
- mainAtom = slang_atom_pool_atom (tbl->atoms, "main");
- if (mainAtom == SLANG_ATOM_NULL)
- return GL_FALSE;
-
- for (i = 0; i < funs->num_functions; i++)
- {
- if (funs->functions[i].header.a_name == mainAtom)
- {
- slang_function *fun = &funs->functions[i];
- slang_export_code_entry *e;
- slang_assemble_ctx A;
-
- e = slang_export_code_table_add (tbl);
- if (e == NULL)
- return GL_FALSE;
+ slang_atom mainAtom;
+ GLuint i;
+
+ mainAtom = slang_atom_pool_atom(tbl->atoms, "main");
+ if (mainAtom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < funs->num_functions; i++) {
+ if (funs->functions[i].header.a_name == mainAtom) {
+ slang_function *fun = &funs->functions[i];
+ slang_export_code_entry *e;
+ slang_assemble_ctx A;
+
+ e = slang_export_code_table_add(tbl);
+ if (e == NULL)
+ return GL_FALSE;
e->address = unit->object->assembly.count;
- e->name = slang_atom_pool_atom (tbl->atoms, "@main");
- if (e->name == SLANG_ATOM_NULL)
- return GL_FALSE;
+ e->name = slang_atom_pool_atom(tbl->atoms, "@main");
+ if (e->name == SLANG_ATOM_NULL)
+ return GL_FALSE;
A.file = &unit->object->assembly;
A.mach = &unit->object->machine;
@@ -177,12 +222,13 @@ _slang_build_export_code_table (slang_export_code_table *tbl, slang_function_sco
A.space.funcs = &unit->funs;
A.space.structs = &unit->structs;
A.space.vars = &unit->vars;
- slang_assembly_file_push_label (&unit->object->assembly, slang_asm_local_alloc, 20);
- slang_assembly_file_push_label (&unit->object->assembly, slang_asm_enter, 20);
- _slang_assemble_function_call (&A, fun, NULL, 0, GL_FALSE);
- slang_assembly_file_push (&unit->object->assembly, slang_asm_exit);
- }
- }
- return GL_TRUE;
+ slang_assembly_file_push_label(&unit->object->assembly,
+ slang_asm_local_alloc, 20);
+ slang_assembly_file_push_label(&unit->object->assembly,
+ slang_asm_enter, 20);
+ _slang_assemble_function_call(&A, fun, NULL, 0, GL_FALSE);
+ slang_assembly_file_push(&unit->object->assembly, slang_asm_exit);
+ }
+ }
+ return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h
index 24bc0d6ffd1..c05c6f4d850 100644
--- a/src/mesa/shader/slang/slang_compile_function.h
+++ b/src/mesa/shader/slang/slang_compile_function.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_COMPILE_FUNCTION_H
+#ifndef SLANG_COMPILE_FUNCTION_H
#define SLANG_COMPILE_FUNCTION_H
#if defined __cplusplus
@@ -31,57 +31,81 @@ extern "C" {
struct slang_code_unit_;
+/**
+ * Types of functions.
+ */
typedef enum slang_function_kind_
{
- slang_func_ordinary,
- slang_func_constructor,
- slang_func_operator
+ slang_func_ordinary,
+ slang_func_constructor,
+ slang_func_operator
} slang_function_kind;
+
+/**
+ * When we need to fill in addresses which we won't know until the future,
+ * we keep track of them with a fix-up table.
+ */
typedef struct slang_fixup_table_
{
- GLuint *table;
- GLuint count;
+ GLuint *table; /**< array[count] of addresses */
+ GLuint count;
} slang_fixup_table;
-void slang_fixup_table_init (slang_fixup_table *);
-void slang_fixup_table_free (slang_fixup_table *);
+extern void slang_fixup_table_init(slang_fixup_table *);
+extern void slang_fixup_table_free(slang_fixup_table *);
+extern GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address);
+
+/**
+ * Description of a compiled shader function.
+ */
typedef struct slang_function_
{
- slang_function_kind kind;
- slang_variable header;
- slang_variable_scope *parameters;
- unsigned int param_count;
- slang_operation *body;
- unsigned int address;
- slang_fixup_table fixups;
+ slang_function_kind kind;
+ slang_variable header; /**< The function's name and return type */
+ slang_variable_scope *parameters; /**< formal parameters AND local vars */
+ unsigned int param_count; /**< number of formal params (no locals) */
+ slang_operation *body; /**< The instruction tree */
+ unsigned int address; /**< Address of this func in memory */
+ slang_fixup_table fixups; /**< Mem locations which need func's address */
} slang_function;
-int slang_function_construct (slang_function *);
-void slang_function_destruct (slang_function *);
+extern int slang_function_construct(slang_function *);
+extern void slang_function_destruct(slang_function *);
+
+/**
+ * Basically, a list of compiled functions.
+ */
typedef struct slang_function_scope_
{
- slang_function *functions;
+ slang_function *functions;
GLuint num_functions;
- struct slang_function_scope_ *outer_scope;
+ struct slang_function_scope_ *outer_scope;
} slang_function_scope;
+
extern GLvoid
-_slang_function_scope_ctr (slang_function_scope *);
+_slang_function_scope_ctr(slang_function_scope *);
+
+extern void
+slang_function_scope_destruct(slang_function_scope *);
+
+extern int
+slang_function_scope_find_by_name(slang_function_scope *, slang_atom, int);
-void slang_function_scope_destruct (slang_function_scope *);
-int slang_function_scope_find_by_name (slang_function_scope *, slang_atom, int);
-slang_function *slang_function_scope_find (slang_function_scope *, slang_function *, int);
+extern slang_function *
+slang_function_scope_find(slang_function_scope *, slang_function *, int);
extern GLboolean
-_slang_build_export_code_table (slang_export_code_table *, slang_function_scope *,
- struct slang_code_unit_ *);
+_slang_build_export_code_table(slang_export_code_table *,
+ slang_function_scope *,
+ struct slang_code_unit_ *);
+
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_COMPILE_FUNCTION_H */
diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c
index 7e920135597..73f57bfb123 100644
--- a/src/mesa/shader/slang/slang_compile_operation.c
+++ b/src/mesa/shader/slang/slang_compile_operation.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -31,68 +31,85 @@
#include "imports.h"
#include "slang_compile.h"
-/* slang_operation */
-int slang_operation_construct (slang_operation *oper)
+/**
+ * Init a slang_operation object
+ */
+GLboolean
+slang_operation_construct(slang_operation * oper)
{
- oper->type = slang_oper_none;
- oper->children = NULL;
- oper->num_children = 0;
- oper->literal = (float) 0;
- oper->a_id = SLANG_ATOM_NULL;
- oper->locals = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
- if (oper->locals == NULL)
- return 0;
- _slang_variable_scope_ctr (oper->locals);
- return 1;
+ oper->type = slang_oper_none;
+ oper->children = NULL;
+ oper->num_children = 0;
+ oper->literal = (float) 0;
+ oper->a_id = SLANG_ATOM_NULL;
+ oper->locals =
+ (slang_variable_scope *)
+ slang_alloc_malloc(sizeof(slang_variable_scope));
+ if (oper->locals == NULL)
+ return GL_FALSE;
+ _slang_variable_scope_ctr(oper->locals);
+ return GL_TRUE;
}
-void slang_operation_destruct (slang_operation *oper)
+void
+slang_operation_destruct(slang_operation * oper)
{
- unsigned int i;
+ GLuint i;
- for (i = 0; i < oper->num_children; i++)
- slang_operation_destruct (oper->children + i);
- slang_alloc_free (oper->children);
- slang_variable_scope_destruct (oper->locals);
- slang_alloc_free (oper->locals);
+ for (i = 0; i < oper->num_children; i++)
+ slang_operation_destruct(oper->children + i);
+ slang_alloc_free(oper->children);
+ slang_variable_scope_destruct(oper->locals);
+ slang_alloc_free(oper->locals);
}
-int slang_operation_copy (slang_operation *x, const slang_operation *y)
+/**
+ * Recursively copy a slang_operation node.
+ * \return GL_TRUE for success, GL_FALSE if failure
+ */
+GLboolean
+slang_operation_copy(slang_operation * x, const slang_operation * y)
{
- slang_operation z;
- unsigned int i;
+ slang_operation z;
+ GLuint i;
- if (!slang_operation_construct (&z))
- return 0;
- z.type = y->type;
- z.children = (slang_operation *) slang_alloc_malloc (y->num_children * sizeof (slang_operation));
- if (z.children == NULL)
- {
- slang_operation_destruct (&z);
- return 0;
- }
- for (z.num_children = 0; z.num_children < y->num_children; z.num_children++)
- if (!slang_operation_construct (&z.children[z.num_children]))
- {
- slang_operation_destruct (&z);
- return 0;
- }
- for (i = 0; i < z.num_children; i++)
- if (!slang_operation_copy (&z.children[i], &y->children[i]))
- {
- slang_operation_destruct (&z);
- return 0;
- }
- z.literal = y->literal;
- z.a_id = y->a_id;
- if (!slang_variable_scope_copy (z.locals, y->locals))
- {
- slang_operation_destruct (&z);
- return 0;
- }
- slang_operation_destruct (x);
- *x = z;
- return 1;
+ if (!slang_operation_construct(&z))
+ return GL_FALSE;
+ z.type = y->type;
+ z.children = (slang_operation *)
+ slang_alloc_malloc(y->num_children * sizeof(slang_operation));
+ if (z.children == NULL) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ for (z.num_children = 0; z.num_children < y->num_children;
+ z.num_children++) {
+ if (!slang_operation_construct(&z.children[z.num_children])) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ }
+ for (i = 0; i < z.num_children; i++) {
+ if (!slang_operation_copy(&z.children[i], &y->children[i])) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ }
+ z.literal = y->literal;
+ z.a_id = y->a_id;
+ if (!slang_variable_scope_copy(z.locals, y->locals)) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ slang_operation_destruct(x);
+ *x = z;
+ return GL_TRUE;
}
+
+slang_operation *
+slang_operation_new(GLuint count)
+{
+ return (slang_operation *) _mesa_calloc(count * sizeof(slang_operation));
+}
diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h
index d9bce36b9bd..a9376ec945f 100644
--- a/src/mesa/shader/slang/slang_compile_operation.h
+++ b/src/mesa/shader/slang/slang_compile_operation.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,96 +22,119 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_COMPILE_OPERATION_H
+#ifndef SLANG_COMPILE_OPERATION_H
#define SLANG_COMPILE_OPERATION_H
#if defined __cplusplus
extern "C" {
#endif
+
+/**
+ * Types of slang operations.
+ * These are the types of the AST (abstract syntax tree) nodes.
+ * [foo] indicates a sub-tree or reference to another type of node
+ */
typedef enum slang_operation_type_
{
- slang_oper_none,
- slang_oper_block_no_new_scope,
- slang_oper_block_new_scope,
- slang_oper_variable_decl,
- slang_oper_asm,
- slang_oper_break,
- slang_oper_continue,
- slang_oper_discard,
- slang_oper_return,
- slang_oper_expression,
- slang_oper_if,
- slang_oper_while,
- slang_oper_do,
- slang_oper_for,
- slang_oper_void,
- slang_oper_literal_bool,
- slang_oper_literal_int,
- slang_oper_literal_float,
- slang_oper_identifier,
- slang_oper_sequence,
- slang_oper_assign,
- slang_oper_addassign,
- slang_oper_subassign,
- slang_oper_mulassign,
- slang_oper_divassign,
- /*slang_oper_modassign,*/
- /*slang_oper_lshassign,*/
- /*slang_oper_rshassign,*/
- /*slang_oper_orassign,*/
- /*slang_oper_xorassign,*/
- /*slang_oper_andassign,*/
- slang_oper_select,
- slang_oper_logicalor,
- slang_oper_logicalxor,
- slang_oper_logicaland,
- /*slang_oper_bitor,*/
- /*slang_oper_bitxor,*/
- /*slang_oper_bitand,*/
- slang_oper_equal,
- slang_oper_notequal,
- slang_oper_less,
- slang_oper_greater,
- slang_oper_lessequal,
- slang_oper_greaterequal,
- /*slang_oper_lshift,*/
- /*slang_oper_rshift,*/
- slang_oper_add,
- slang_oper_subtract,
- slang_oper_multiply,
- slang_oper_divide,
- /*slang_oper_modulus,*/
- slang_oper_preincrement,
- slang_oper_predecrement,
- slang_oper_plus,
- slang_oper_minus,
- /*slang_oper_complement,*/
- slang_oper_not,
- slang_oper_subscript,
- slang_oper_call,
- slang_oper_field,
- slang_oper_postincrement,
- slang_oper_postdecrement
+ slang_oper_none,
+ slang_oper_block_no_new_scope, /* "{" sequence "}" */
+ slang_oper_block_new_scope, /* "{" sequence "}" */
+ slang_oper_variable_decl, /* [type] [var] or [var] = [expr] */
+ slang_oper_asm,
+ slang_oper_break, /* "break" statement */
+ slang_oper_continue, /* "continue" statement */
+ slang_oper_discard, /* "discard" (kill fragment) statement */
+ slang_oper_return, /* "return" [expr] */
+ slang_oper_expression, /* [expr] */
+ slang_oper_if, /* "if" [0] then [1] else [2] */
+ slang_oper_while, /* "while" [cond] [body] */
+ slang_oper_do, /* "do" [body] "while" [cond] */
+ slang_oper_for, /* "for" [init] [while] [incr] [body] */
+ slang_oper_void, /* nop */
+ slang_oper_literal_bool, /* "true" or "false" */
+ slang_oper_literal_int, /* integer literal */
+ slang_oper_literal_float, /* float literal */
+ slang_oper_identifier, /* var name, func name, etc */
+ slang_oper_sequence, /* [expr] "," [expr] "," etc */
+ slang_oper_assign, /* [var] "=" [expr] */
+ slang_oper_addassign, /* [var] "+=" [expr] */
+ slang_oper_subassign, /* [var] "-=" [expr] */
+ slang_oper_mulassign, /* [var] "*=" [expr] */
+ slang_oper_divassign, /* [var] "/=" [expr] */
+ /*slang_oper_modassign, */
+ /*slang_oper_lshassign, */
+ /*slang_oper_rshassign, */
+ /*slang_oper_orassign, */
+ /*slang_oper_xorassign, */
+ /*slang_oper_andassign, */
+ slang_oper_select, /* [expr] "?" [expr] ":" [expr] */
+ slang_oper_logicalor, /* [expr] "||" [expr] */
+ slang_oper_logicalxor, /* [expr] "^^" [expr] */
+ slang_oper_logicaland, /* [expr] "&&" [expr] */
+ /*slang_oper_bitor, */
+ /*slang_oper_bitxor, */
+ /*slang_oper_bitand, */
+ slang_oper_equal, /* [expr] "==" [expr] */
+ slang_oper_notequal, /* [expr] "!=" [expr] */
+ slang_oper_less, /* [expr] "<" [expr] */
+ slang_oper_greater, /* [expr] ">" [expr] */
+ slang_oper_lessequal, /* [expr] "<=" [expr] */
+ slang_oper_greaterequal, /* [expr] ">=" [expr] */
+ /*slang_oper_lshift, */
+ /*slang_oper_rshift, */
+ slang_oper_add, /* [expr] "+" [expr] */
+ slang_oper_subtract, /* [expr] "-" [expr] */
+ slang_oper_multiply, /* [expr] "*" [expr] */
+ slang_oper_divide, /* [expr] "/" [expr] */
+ /*slang_oper_modulus, */
+ slang_oper_preincrement, /* "++" [var] */
+ slang_oper_predecrement, /* "--" [var] */
+ slang_oper_plus, /* "-" [expr] */
+ slang_oper_minus, /* "+" [expr] */
+ /*slang_oper_complement, */
+ slang_oper_not, /* "!" [expr] */
+ slang_oper_subscript, /* [expr] "[" [expr] "]" */
+ slang_oper_call, /* [func name] [param] [param] [...] */
+ slang_oper_field, /* i.e.: ".next" or ".xzy" or ".xxx" etc */
+ slang_oper_postincrement, /* [var] "++" */
+ slang_oper_postdecrement /* [var] "--" */
} slang_operation_type;
+
+/**
+ * A slang_operation is basically a compiled instruction (such as assignment,
+ * a while-loop, a conditional, a multiply, a function call, etc).
+ * The AST (abstract syntax tree) is built from these nodes.
+ * NOTE: This structure could have been implemented as a union of simpler
+ * structs which would correspond to the operation types above.
+ */
typedef struct slang_operation_
{
- slang_operation_type type;
- struct slang_operation_ *children;
- unsigned int num_children;
- float literal; /* type: bool, literal_int, literal_float */
- slang_atom a_id; /* type: asm, identifier, call, field */
- slang_variable_scope *locals;
+ slang_operation_type type;
+ struct slang_operation_ *children;
+ GLuint num_children;
+ GLfloat literal; /**< Used for float, int and bool values */
+ slang_atom a_id; /**< type: asm, identifier, call, field */
+ slang_variable_scope *locals; /**< local vars for scope */
} slang_operation;
-int slang_operation_construct (slang_operation *);
-void slang_operation_destruct (slang_operation *);
-int slang_operation_copy (slang_operation *, const slang_operation *);
+
+extern GLboolean
+slang_operation_construct(slang_operation *);
+
+extern void
+slang_operation_destruct(slang_operation *);
+
+extern GLboolean
+slang_operation_copy(slang_operation *, const slang_operation *);
+
+extern slang_operation *
+slang_operation_new(GLuint count);
+
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_COMPILE_OPERATION_H */
diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c
index b62743addb0..a8a2d6aa6a0 100644
--- a/src/mesa/shader/slang/slang_compile_variable.c
+++ b/src/mesa/shader/slang/slang_compile_variable.c
@@ -35,89 +35,92 @@
typedef struct
{
- const char *name;
- slang_type_specifier_type type;
+ const char *name;
+ slang_type_specifier_type type;
} type_specifier_type_name;
-static type_specifier_type_name type_specifier_type_names[] = {
- { "void", slang_spec_void },
- { "bool", slang_spec_bool },
- { "bvec2", slang_spec_bvec2 },
- { "bvec3", slang_spec_bvec3 },
- { "bvec4", slang_spec_bvec4 },
- { "int", slang_spec_int },
- { "ivec2", slang_spec_ivec2 },
- { "ivec3", slang_spec_ivec3 },
- { "ivec4", slang_spec_ivec4 },
- { "float", slang_spec_float },
- { "vec2", slang_spec_vec2 },
- { "vec3", slang_spec_vec3 },
- { "vec4", slang_spec_vec4 },
- { "mat2", slang_spec_mat2 },
- { "mat3", slang_spec_mat3 },
- { "mat4", slang_spec_mat4 },
- { "sampler1D", slang_spec_sampler1D },
- { "sampler2D", slang_spec_sampler2D },
- { "sampler3D", slang_spec_sampler3D },
- { "samplerCube", slang_spec_samplerCube },
- { "sampler1DShadow", slang_spec_sampler1DShadow },
- { "sampler2DShadow", slang_spec_sampler2DShadow },
- { NULL, slang_spec_void }
+static const type_specifier_type_name type_specifier_type_names[] = {
+ {"void", slang_spec_void},
+ {"bool", slang_spec_bool},
+ {"bvec2", slang_spec_bvec2},
+ {"bvec3", slang_spec_bvec3},
+ {"bvec4", slang_spec_bvec4},
+ {"int", slang_spec_int},
+ {"ivec2", slang_spec_ivec2},
+ {"ivec3", slang_spec_ivec3},
+ {"ivec4", slang_spec_ivec4},
+ {"float", slang_spec_float},
+ {"vec2", slang_spec_vec2},
+ {"vec3", slang_spec_vec3},
+ {"vec4", slang_spec_vec4},
+ {"mat2", slang_spec_mat2},
+ {"mat3", slang_spec_mat3},
+ {"mat4", slang_spec_mat4},
+ {"sampler1D", slang_spec_sampler1D},
+ {"sampler2D", slang_spec_sampler2D},
+ {"sampler3D", slang_spec_sampler3D},
+ {"samplerCube", slang_spec_samplerCube},
+ {"sampler1DShadow", slang_spec_sampler1DShadow},
+ {"sampler2DShadow", slang_spec_sampler2DShadow},
+ {NULL, slang_spec_void}
};
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *name)
+slang_type_specifier_type
+slang_type_specifier_type_from_string(const char *name)
{
- type_specifier_type_name *p = type_specifier_type_names;
- while (p->name != NULL)
- {
- if (slang_string_compare (p->name, name) == 0)
- break;
- p++;
- }
- return p->type;
+ const type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL) {
+ if (slang_string_compare(p->name, name) == 0)
+ break;
+ p++;
+ }
+ return p->type;
}
-const char *slang_type_specifier_type_to_string (slang_type_specifier_type type)
+const char *
+slang_type_specifier_type_to_string(slang_type_specifier_type type)
{
- type_specifier_type_name *p = type_specifier_type_names;
- while (p->name != NULL)
- {
- if (p->type == type)
- break;
- p++;
- }
- return p->name;
+ const type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL) {
+ if (p->type == type)
+ break;
+ p++;
+ }
+ return p->name;
}
/* slang_fully_specified_type */
-int slang_fully_specified_type_construct (slang_fully_specified_type *type)
+int
+slang_fully_specified_type_construct(slang_fully_specified_type * type)
{
- type->qualifier = slang_qual_none;
- slang_type_specifier_ctr (&type->specifier);
- return 1;
+ type->qualifier = slang_qual_none;
+ slang_type_specifier_ctr(&type->specifier);
+ return 1;
}
-void slang_fully_specified_type_destruct (slang_fully_specified_type *type)
+void
+slang_fully_specified_type_destruct(slang_fully_specified_type * type)
{
- slang_type_specifier_dtr (&type->specifier);
+ slang_type_specifier_dtr(&type->specifier);
}
-int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_fully_specified_type *y)
+int
+slang_fully_specified_type_copy(slang_fully_specified_type * x,
+ const slang_fully_specified_type * y)
{
- slang_fully_specified_type z;
-
- if (!slang_fully_specified_type_construct (&z))
- return 0;
- z.qualifier = y->qualifier;
- if (!slang_type_specifier_copy (&z.specifier, &y->specifier))
- {
- slang_fully_specified_type_destruct (&z);
- return 0;
- }
- slang_fully_specified_type_destruct (x);
- *x = z;
- return 1;
+ slang_fully_specified_type z;
+
+ if (!slang_fully_specified_type_construct(&z))
+ return 0;
+ z.qualifier = y->qualifier;
+ if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) {
+ slang_fully_specified_type_destruct(&z);
+ return 0;
+ }
+ slang_fully_specified_type_destruct(x);
+ *x = z;
+ return 1;
}
/*
@@ -125,246 +128,281 @@ int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_
*/
GLvoid
-_slang_variable_scope_ctr (slang_variable_scope *self)
+_slang_variable_scope_ctr(slang_variable_scope * self)
{
self->variables = NULL;
self->num_variables = 0;
self->outer_scope = NULL;
}
-void slang_variable_scope_destruct (slang_variable_scope *scope)
+void
+slang_variable_scope_destruct(slang_variable_scope * scope)
{
- unsigned int i;
+ unsigned int i;
+
+ if (!scope)
+ return;
+ for (i = 0; i < scope->num_variables; i++)
+ slang_variable_destruct(scope->variables + i);
+ slang_alloc_free(scope->variables);
+ /* do not free scope->outer_scope */
+}
- for (i = 0; i < scope->num_variables; i++)
- slang_variable_destruct (scope->variables + i);
- slang_alloc_free (scope->variables);
- /* do not free scope->outer_scope */
+int
+slang_variable_scope_copy(slang_variable_scope * x,
+ const slang_variable_scope * y)
+{
+ slang_variable_scope z;
+ unsigned int i;
+
+ _slang_variable_scope_ctr(&z);
+ z.variables = (slang_variable *)
+ slang_alloc_malloc(y->num_variables * sizeof(slang_variable));
+ if (z.variables == NULL) {
+ slang_variable_scope_destruct(&z);
+ return 0;
+ }
+ for (z.num_variables = 0; z.num_variables < y->num_variables;
+ z.num_variables++) {
+ if (!slang_variable_construct(&z.variables[z.num_variables])) {
+ slang_variable_scope_destruct(&z);
+ return 0;
+ }
+ }
+ for (i = 0; i < z.num_variables; i++) {
+ if (!slang_variable_copy(&z.variables[i], &y->variables[i])) {
+ slang_variable_scope_destruct(&z);
+ return 0;
+ }
+ }
+ z.outer_scope = y->outer_scope;
+ slang_variable_scope_destruct(x);
+ *x = z;
+ return 1;
}
-int slang_variable_scope_copy (slang_variable_scope *x, const slang_variable_scope *y)
+
+/**
+ * Grow the variable list by one.
+ * \return pointer to space for the new variable (will be initialized)
+ */
+slang_variable *
+slang_variable_scope_grow(slang_variable_scope *scope)
{
- slang_variable_scope z;
- unsigned int i;
-
- _slang_variable_scope_ctr (&z);
- z.variables = (slang_variable *) slang_alloc_malloc (y->num_variables * sizeof (slang_variable));
- if (z.variables == NULL)
- {
- slang_variable_scope_destruct (&z);
- return 0;
- }
- for (z.num_variables = 0; z.num_variables < y->num_variables; z.num_variables++)
- if (!slang_variable_construct (&z.variables[z.num_variables]))
- {
- slang_variable_scope_destruct (&z);
- return 0;
- }
- for (i = 0; i < z.num_variables; i++)
- if (!slang_variable_copy (&z.variables[i], &y->variables[i]))
- {
- slang_variable_scope_destruct (&z);
- return 0;
- }
- z.outer_scope = y->outer_scope;
- slang_variable_scope_destruct (x);
- *x = z;
- return 1;
+ const int n = scope->num_variables;
+ scope->variables = (slang_variable *)
+ slang_alloc_realloc(scope->variables,
+ n * sizeof(slang_variable),
+ (n + 1) * sizeof(slang_variable));
+ if (!scope->variables)
+ return NULL;
+
+ scope->num_variables++;
+
+ if (!slang_variable_construct(scope->variables + n))
+ return NULL;
+
+ return scope->variables + n;
}
+
+
/* slang_variable */
-int slang_variable_construct (slang_variable *var)
+int
+slang_variable_construct(slang_variable * var)
{
- if (!slang_fully_specified_type_construct (&var->type))
- return 0;
- var->a_name = SLANG_ATOM_NULL;
- var->array_len = 0;
- var->initializer = NULL;
- var->address = ~0;
- var->size = 0;
- var->global = 0;
- return 1;
+ if (!slang_fully_specified_type_construct(&var->type))
+ return 0;
+ var->a_name = SLANG_ATOM_NULL;
+ var->array_len = 0;
+ var->initializer = NULL;
+ var->address = ~0;
+ var->address2 = 0;
+ var->size = 0;
+ var->global = GL_FALSE;
+ return 1;
}
-void slang_variable_destruct (slang_variable *var)
+void
+slang_variable_destruct(slang_variable * var)
{
- slang_fully_specified_type_destruct (&var->type);
- if (var->initializer != NULL)
- {
- slang_operation_destruct (var->initializer);
- slang_alloc_free (var->initializer);
- }
+ slang_fully_specified_type_destruct(&var->type);
+ if (var->initializer != NULL) {
+ slang_operation_destruct(var->initializer);
+ slang_alloc_free(var->initializer);
+ }
}
-int slang_variable_copy (slang_variable *x, const slang_variable *y)
+int
+slang_variable_copy(slang_variable * x, const slang_variable * y)
{
- slang_variable z;
-
- if (!slang_variable_construct (&z))
- return 0;
- if (!slang_fully_specified_type_copy (&z.type, &y->type))
- {
- slang_variable_destruct (&z);
- return 0;
- }
- z.a_name = y->a_name;
- z.array_len = y->array_len;
- if (y->initializer != NULL)
- {
- z.initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (z.initializer == NULL)
- {
- slang_variable_destruct (&z);
- return 0;
- }
- if (!slang_operation_construct (z.initializer))
- {
- slang_alloc_free (z.initializer);
- slang_variable_destruct (&z);
- return 0;
- }
- if (!slang_operation_copy (z.initializer, y->initializer))
- {
- slang_variable_destruct (&z);
- return 0;
- }
- }
- z.address = y->address;
- z.size = y->size;
- z.global = y->global;
- slang_variable_destruct (x);
- *x = z;
- return 1;
+ slang_variable z;
+
+ if (!slang_variable_construct(&z))
+ return 0;
+ if (!slang_fully_specified_type_copy(&z.type, &y->type)) {
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ z.a_name = y->a_name;
+ z.array_len = y->array_len;
+ if (y->initializer != NULL) {
+ z.initializer =
+ (slang_operation *) slang_alloc_malloc(sizeof(slang_operation));
+ if (z.initializer == NULL) {
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ if (!slang_operation_construct(z.initializer)) {
+ slang_alloc_free(z.initializer);
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ if (!slang_operation_copy(z.initializer, y->initializer)) {
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ }
+ z.address = y->address;
+ z.size = y->size;
+ z.global = y->global;
+ slang_variable_destruct(x);
+ *x = z;
+ return 1;
}
-slang_variable *_slang_locate_variable (slang_variable_scope *scope, slang_atom a_name, GLboolean all)
+slang_variable *
+_slang_locate_variable(const slang_variable_scope * scope,
+ const slang_atom a_name, GLboolean all)
{
- GLuint i;
-
- for (i = 0; i < scope->num_variables; i++)
- if (a_name == scope->variables[i].a_name)
- return &scope->variables[i];
- if (all && scope->outer_scope != NULL)
- return _slang_locate_variable (scope->outer_scope, a_name, 1);
- return NULL;
+ GLuint i;
+
+ for (i = 0; i < scope->num_variables; i++)
+ if (a_name == scope->variables[i].a_name)
+ return &scope->variables[i];
+ if (all && scope->outer_scope != NULL)
+ return _slang_locate_variable(scope->outer_scope, a_name, 1);
+ return NULL;
}
/*
* _slang_build_export_data_table()
*/
-static GLenum gl_type_from_specifier (const slang_type_specifier *type)
+static GLenum
+gl_type_from_specifier(const slang_type_specifier * type)
{
- switch (type->type)
- {
- case slang_spec_bool:
- return GL_BOOL_ARB;
- case slang_spec_bvec2:
- return GL_BOOL_VEC2_ARB;
- case slang_spec_bvec3:
- return GL_BOOL_VEC3_ARB;
- case slang_spec_bvec4:
- return GL_BOOL_VEC4_ARB;
- case slang_spec_int:
- return GL_INT;
- case slang_spec_ivec2:
- return GL_INT_VEC2_ARB;
- case slang_spec_ivec3:
- return GL_INT_VEC3_ARB;
- case slang_spec_ivec4:
- return GL_INT_VEC4_ARB;
- case slang_spec_float:
- return GL_FLOAT;
- case slang_spec_vec2:
- return GL_FLOAT_VEC2_ARB;
- case slang_spec_vec3:
- return GL_FLOAT_VEC3_ARB;
- case slang_spec_vec4:
- return GL_FLOAT_VEC4_ARB;
- case slang_spec_mat2:
- return GL_FLOAT_MAT2_ARB;
- case slang_spec_mat3:
- return GL_FLOAT_MAT3_ARB;
- case slang_spec_mat4:
- return GL_FLOAT_MAT4_ARB;
- case slang_spec_sampler1D:
- return GL_SAMPLER_1D_ARB;
- case slang_spec_sampler2D:
- return GL_SAMPLER_2D_ARB;
- case slang_spec_sampler3D:
- return GL_SAMPLER_3D_ARB;
- case slang_spec_samplerCube:
- return GL_SAMPLER_CUBE_ARB;
- case slang_spec_sampler1DShadow:
- return GL_SAMPLER_1D_SHADOW_ARB;
- case slang_spec_sampler2DShadow:
- return GL_SAMPLER_2D_SHADOW_ARB;
- case slang_spec_array:
- return gl_type_from_specifier (type->_array);
- default:
- return GL_FLOAT;
- }
+ switch (type->type) {
+ case slang_spec_bool:
+ return GL_BOOL_ARB;
+ case slang_spec_bvec2:
+ return GL_BOOL_VEC2_ARB;
+ case slang_spec_bvec3:
+ return GL_BOOL_VEC3_ARB;
+ case slang_spec_bvec4:
+ return GL_BOOL_VEC4_ARB;
+ case slang_spec_int:
+ return GL_INT;
+ case slang_spec_ivec2:
+ return GL_INT_VEC2_ARB;
+ case slang_spec_ivec3:
+ return GL_INT_VEC3_ARB;
+ case slang_spec_ivec4:
+ return GL_INT_VEC4_ARB;
+ case slang_spec_float:
+ return GL_FLOAT;
+ case slang_spec_vec2:
+ return GL_FLOAT_VEC2_ARB;
+ case slang_spec_vec3:
+ return GL_FLOAT_VEC3_ARB;
+ case slang_spec_vec4:
+ return GL_FLOAT_VEC4_ARB;
+ case slang_spec_mat2:
+ return GL_FLOAT_MAT2_ARB;
+ case slang_spec_mat3:
+ return GL_FLOAT_MAT3_ARB;
+ case slang_spec_mat4:
+ return GL_FLOAT_MAT4_ARB;
+ case slang_spec_sampler1D:
+ return GL_SAMPLER_1D_ARB;
+ case slang_spec_sampler2D:
+ return GL_SAMPLER_2D_ARB;
+ case slang_spec_sampler3D:
+ return GL_SAMPLER_3D_ARB;
+ case slang_spec_samplerCube:
+ return GL_SAMPLER_CUBE_ARB;
+ case slang_spec_sampler1DShadow:
+ return GL_SAMPLER_1D_SHADOW_ARB;
+ case slang_spec_sampler2DShadow:
+ return GL_SAMPLER_2D_SHADOW_ARB;
+ case slang_spec_array:
+ return gl_type_from_specifier(type->_array);
+ default:
+ return GL_FLOAT;
+ }
}
-static GLboolean build_quant (slang_export_data_quant *q, slang_variable *var)
+static GLboolean
+build_quant(slang_export_data_quant * q, const slang_variable * var)
{
- slang_type_specifier *spec = &var->type.specifier;
-
- q->name = var->a_name;
- q->size = var->size;
- if (spec->type == slang_spec_array)
- {
- q->array_len = var->array_len;
- q->size /= var->array_len;
- spec = spec->_array;
- }
- if (spec->type == slang_spec_struct)
- {
- GLuint i;
-
- q->u.field_count = spec->_struct->fields->num_variables;
- q->structure = (slang_export_data_quant *) slang_alloc_malloc (
- q->u.field_count * sizeof (slang_export_data_quant));
- if (q->structure == NULL)
- return GL_FALSE;
-
- for (i = 0; i < q->u.field_count; i++)
- slang_export_data_quant_ctr (&q->structure[i]);
- for (i = 0; i < q->u.field_count; i++)
- if (!build_quant (&q->structure[i], &spec->_struct->fields->variables[i]))
- return GL_FALSE;
- }
- else
- q->u.basic_type = gl_type_from_specifier (spec);
- return GL_TRUE;
+ const slang_type_specifier *spec = &var->type.specifier;
+
+ q->name = var->a_name;
+ q->size = var->size;
+ if (spec->type == slang_spec_array) {
+ q->array_len = var->array_len;
+ q->size /= var->array_len;
+ spec = spec->_array;
+ }
+ if (spec->type == slang_spec_struct) {
+ GLuint i;
+
+ q->u.field_count = spec->_struct->fields->num_variables;
+ q->structure = (slang_export_data_quant *)
+ slang_alloc_malloc(q->u.field_count
+ * sizeof(slang_export_data_quant));
+ if (q->structure == NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < q->u.field_count; i++)
+ slang_export_data_quant_ctr(&q->structure[i]);
+ for (i = 0; i < q->u.field_count; i++) {
+ if (!build_quant(&q->structure[i],
+ &spec->_struct->fields->variables[i]))
+ return GL_FALSE;
+ }
+ }
+ else
+ q->u.basic_type = gl_type_from_specifier(spec);
+ return GL_TRUE;
}
-GLboolean _slang_build_export_data_table (slang_export_data_table *tbl, slang_variable_scope *vars)
+GLboolean
+_slang_build_export_data_table(slang_export_data_table * tbl,
+ slang_variable_scope * vars)
{
- GLuint i;
-
- for (i = 0; i < vars->num_variables; i++)
- {
- slang_variable *var = &vars->variables[i];
- slang_export_data_entry *e;
-
- e = slang_export_data_table_add (tbl);
- if (e == NULL)
- return GL_FALSE;
- if (!build_quant (&e->quant, var))
- return GL_FALSE;
- if (var->type.qualifier == slang_qual_uniform)
- e->access = slang_exp_uniform;
- else if (var->type.qualifier == slang_qual_attribute)
- e->access = slang_exp_attribute;
- else
- e->access = slang_exp_varying;
- e->address = var->address;
- }
-
- if (vars->outer_scope != NULL)
- return _slang_build_export_data_table (tbl, vars->outer_scope);
- return GL_TRUE;
+ GLuint i;
+
+ for (i = 0; i < vars->num_variables; i++) {
+ const slang_variable *var = &vars->variables[i];
+ slang_export_data_entry *e;
+
+ e = slang_export_data_table_add(tbl);
+ if (e == NULL)
+ return GL_FALSE;
+ if (!build_quant(&e->quant, var))
+ return GL_FALSE;
+ if (var->type.qualifier == slang_qual_uniform)
+ e->access = slang_exp_uniform;
+ else if (var->type.qualifier == slang_qual_attribute)
+ e->access = slang_exp_attribute;
+ else
+ e->access = slang_exp_varying;
+ e->address = var->address;
+ }
+
+ if (vars->outer_scope != NULL)
+ return _slang_build_export_data_table(tbl, vars->outer_scope);
+ return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h
index 6b9679a3b75..b0910e855ea 100644
--- a/src/mesa/shader/slang/slang_compile_variable.h
+++ b/src/mesa/shader/slang/slang_compile_variable.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,74 +22,113 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_COMPILE_VARIABLE_H
+#ifndef SLANG_COMPILE_VARIABLE_H
#define SLANG_COMPILE_VARIABLE_H
#if defined __cplusplus
extern "C" {
#endif
+
typedef enum slang_type_qualifier_
{
- slang_qual_none,
- slang_qual_const,
- slang_qual_attribute,
- slang_qual_varying,
- slang_qual_uniform,
- slang_qual_out,
- slang_qual_inout,
- slang_qual_fixedoutput, /* internal */
- slang_qual_fixedinput /* internal */
+ slang_qual_none,
+ slang_qual_const,
+ slang_qual_attribute,
+ slang_qual_varying,
+ slang_qual_uniform,
+ slang_qual_out,
+ slang_qual_inout,
+ slang_qual_fixedoutput, /* internal */
+ slang_qual_fixedinput /* internal */
} slang_type_qualifier;
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *);
-const char *slang_type_specifier_type_to_string (slang_type_specifier_type);
+extern slang_type_specifier_type
+slang_type_specifier_type_from_string(const char *);
+
+extern const char *
+slang_type_specifier_type_to_string(slang_type_specifier_type);
+
+
typedef struct slang_fully_specified_type_
{
- slang_type_qualifier qualifier;
- slang_type_specifier specifier;
+ slang_type_qualifier qualifier;
+ slang_type_specifier specifier;
} slang_fully_specified_type;
-int slang_fully_specified_type_construct (slang_fully_specified_type *);
-void slang_fully_specified_type_destruct (slang_fully_specified_type *);
-int slang_fully_specified_type_copy (slang_fully_specified_type *, const slang_fully_specified_type *);
+extern int
+slang_fully_specified_type_construct(slang_fully_specified_type *);
+
+extern void
+slang_fully_specified_type_destruct(slang_fully_specified_type *);
+
+extern int
+slang_fully_specified_type_copy(slang_fully_specified_type *,
+ const slang_fully_specified_type *);
+
+
+/**
+ * A shading language program variable.
+ */
+typedef struct slang_variable_
+{
+ slang_fully_specified_type type; /**< Variable's data type */
+ slang_atom a_name; /**< The variable's name (char *) */
+ GLuint array_len; /**< only if type == slang_spec_array */
+ struct slang_operation_ *initializer; /**< Optional initializer code */
+ GLuint address; /**< Storage location */
+ GLuint address2; /**< Storage location */
+ GLuint size; /**< Variable's size in bytes */
+ GLboolean global; /**< A global var? */
+ void *aux; /**< Used during code gen */
+} slang_variable;
+
+/**
+ * Basically a list of variables, with a pointer to the parent scope.
+ */
typedef struct slang_variable_scope_
{
- struct slang_variable_ *variables;
+ slang_variable *variables; /**< Array [num_variables] */
GLuint num_variables;
- struct slang_variable_scope_ *outer_scope;
+ struct slang_variable_scope_ *outer_scope;
} slang_variable_scope;
extern GLvoid
-_slang_variable_scope_ctr (slang_variable_scope *);
+_slang_variable_scope_ctr(slang_variable_scope *);
-void slang_variable_scope_destruct (slang_variable_scope *);
-int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *);
+extern void
+slang_variable_scope_destruct(slang_variable_scope *);
-typedef struct slang_variable_
-{
- slang_fully_specified_type type;
- slang_atom a_name;
- GLuint array_len; /* type: spec_array */
- struct slang_operation_ *initializer;
- unsigned int address;
- unsigned int size;
- int global;
-} slang_variable;
+extern int
+slang_variable_scope_copy(slang_variable_scope *,
+ const slang_variable_scope *);
+
+slang_variable *
+slang_variable_scope_grow(slang_variable_scope *);
-int slang_variable_construct (slang_variable *);
-void slang_variable_destruct (slang_variable *);
-int slang_variable_copy (slang_variable *, const slang_variable *);
+extern int
+slang_variable_construct(slang_variable *);
+
+extern void
+slang_variable_destruct(slang_variable *);
+
+extern int
+slang_variable_copy(slang_variable *, const slang_variable *);
+
+extern slang_variable *
+_slang_locate_variable(const slang_variable_scope *, const slang_atom a_name,
+ GLboolean all);
+
+extern GLboolean
+_slang_build_export_data_table(slang_export_data_table *,
+ slang_variable_scope *);
-slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all);
-GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *);
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_COMPILE_VARIABLE_H */
diff --git a/src/mesa/shader/slang/slang_execute.c b/src/mesa/shader/slang/slang_execute.c
index 98bfd896c4e..e469de02075 100644
--- a/src/mesa/shader/slang/slang_execute.c
+++ b/src/mesa/shader/slang/slang_execute.c
@@ -36,571 +36,625 @@
#define DEBUG_SLANG 0
-GLvoid slang_machine_ctr (slang_machine *self)
+GLvoid
+slang_machine_ctr(slang_machine * self)
{
- slang_machine_init (self);
+ slang_machine_init(self);
self->infolog = NULL;
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- self->x86.compiled_func = NULL;
+ self->x86.compiled_func = NULL;
#endif
}
-GLvoid slang_machine_dtr (slang_machine *self)
+GLvoid
+slang_machine_dtr(slang_machine * self)
{
if (self->infolog != NULL) {
- slang_info_log_destruct (self->infolog);
- slang_alloc_free (self->infolog);
+ slang_info_log_destruct(self->infolog);
+ slang_alloc_free(self->infolog);
}
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- if (self->x86.compiled_func != NULL)
- _mesa_exec_free (self->x86.compiled_func);
+ if (self->x86.compiled_func != NULL)
+ _mesa_exec_free(self->x86.compiled_func);
#endif
}
-void slang_machine_init (slang_machine *mach)
+
+/**
+ * Initialize the shader virtual machine.
+ * NOTE: stack grows downward in memory.
+ */
+void
+slang_machine_init(slang_machine * mach)
{
- mach->ip = 0;
- mach->sp = SLANG_MACHINE_STACK_SIZE;
- mach->bp = 0;
- mach->kill = 0;
- mach->exit = 0;
+ mach->ip = 0;
+ mach->sp = SLANG_MACHINE_STACK_SIZE;
+ mach->bp = 0;
+ mach->kill = GL_FALSE;
+ mach->exit = GL_FALSE;
}
#if DEBUG_SLANG
-static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
+static void
+dump_instruction(FILE * f, slang_assembly * a, unsigned int i)
{
- fprintf (f, "%.5u:\t", i);
-
- switch (a->type)
- {
- /* core */
- case slang_asm_none:
- fprintf (f, "none");
- break;
- case slang_asm_float_copy:
- fprintf (f, "float_copy\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_float_move:
- fprintf (f, "float_move\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_float_push:
- fprintf (f, "float_push\t%f", a->literal);
- break;
- case slang_asm_float_deref:
- fprintf (f, "float_deref");
- break;
- case slang_asm_float_add:
- fprintf (f, "float_add");
- break;
- case slang_asm_float_multiply:
- fprintf (f, "float_multiply");
- break;
- case slang_asm_float_divide:
- fprintf (f, "float_divide");
- break;
- case slang_asm_float_negate:
- fprintf (f, "float_negate");
- break;
- case slang_asm_float_less:
- fprintf (f, "float_less");
- break;
- case slang_asm_float_equal_exp:
- fprintf (f, "float_equal");
- break;
- case slang_asm_float_equal_int:
- fprintf (f, "float_equal\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_float_to_int:
- fprintf (f, "float_to_int");
- break;
- case slang_asm_float_sine:
- fprintf (f, "float_sine");
- break;
- case slang_asm_float_arcsine:
- fprintf (f, "float_arcsine");
- break;
- case slang_asm_float_arctan:
- fprintf (f, "float_arctan");
- break;
- case slang_asm_float_power:
- fprintf (f, "float_power");
- break;
- case slang_asm_float_log2:
- fprintf (f, "float_log2");
- break;
- case slang_asm_float_floor:
- fprintf (f, "float_floor");
- break;
- case slang_asm_float_ceil:
- fprintf (f, "float_ceil");
- break;
- case slang_asm_float_noise1:
- fprintf (f, "float_noise1");
- break;
- case slang_asm_float_noise2:
- fprintf (f, "float_noise2");
- break;
- case slang_asm_float_noise3:
- fprintf (f, "float_noise3");
- break;
- case slang_asm_float_noise4:
- fprintf (f, "float_noise4");
- break;
- case slang_asm_int_copy:
- fprintf (f, "int_copy\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_int_move:
- fprintf (f, "int_move\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_int_push:
- fprintf (f, "int_push\t%d", (GLint) a->literal);
- break;
- case slang_asm_int_deref:
- fprintf (f, "int_deref");
- break;
- case slang_asm_int_to_float:
- fprintf (f, "int_to_float");
- break;
- case slang_asm_int_to_addr:
- fprintf (f, "int_to_addr");
- break;
- case slang_asm_bool_copy:
- fprintf (f, "bool_copy\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_bool_move:
- fprintf (f, "bool_move\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_bool_push:
- fprintf (f, "bool_push\t%d", a->literal != 0.0f);
- break;
- case slang_asm_bool_deref:
- fprintf (f, "bool_deref");
- break;
- case slang_asm_addr_copy:
- fprintf (f, "addr_copy");
- break;
- case slang_asm_addr_push:
- fprintf (f, "addr_push\t%u", a->param[0]);
- break;
- case slang_asm_addr_deref:
- fprintf (f, "addr_deref");
- break;
- case slang_asm_addr_add:
- fprintf (f, "addr_add");
- break;
- case slang_asm_addr_multiply:
- fprintf (f, "addr_multiply");
- break;
- case slang_asm_vec4_tex1d:
- fprintf (f, "vec4_tex1d");
- break;
- case slang_asm_vec4_tex2d:
- fprintf (f, "vec4_tex2d");
- break;
- case slang_asm_vec4_tex3d:
- fprintf (f, "vec4_tex3d");
- break;
- case slang_asm_vec4_texcube:
- fprintf (f, "vec4_texcube");
- break;
- case slang_asm_vec4_shad1d:
- fprintf (f, "vec4_shad1d");
- break;
- case slang_asm_vec4_shad2d:
- fprintf (f, "vec4_shad2d");
- break;
- case slang_asm_jump:
- fprintf (f, "jump\t%u", a->param[0]);
- break;
- case slang_asm_jump_if_zero:
- fprintf (f, "jump_if_zero\t%u", a->param[0]);
- break;
- case slang_asm_enter:
- fprintf (f, "enter\t%u", a->param[0]);
- break;
- case slang_asm_leave:
- fprintf (f, "leave");
- break;
- case slang_asm_local_alloc:
- fprintf (f, "local_alloc\t%u", a->param[0]);
- break;
- case slang_asm_local_free:
- fprintf (f, "local_free\t%u", a->param[0]);
- break;
- case slang_asm_local_addr:
- fprintf (f, "local_addr\t%u, %u", a->param[0], a->param[1]);
- break;
- case slang_asm_global_addr:
- fprintf (f, "global_addr\t%u", a->param[0]);
- break;
- case slang_asm_call:
- fprintf (f, "call\t%u", a->param[0]);
- break;
- case slang_asm_return:
- fprintf (f, "return");
- break;
- case slang_asm_discard:
- fprintf (f, "discard");
- break;
- case slang_asm_exit:
- fprintf (f, "exit");
- break;
- /* GL_MESA_shader_debug */
- case slang_asm_float_print:
- fprintf (f, "float_print");
- break;
- case slang_asm_int_print:
- fprintf (f, "int_print");
- break;
- case slang_asm_bool_print:
- fprintf (f, "bool_print");
- break;
- /* vec4 */
+ fprintf(f, "%.5u:\t", i);
+
+ switch (a->type) {
+ /* core */
+ case slang_asm_none:
+ fprintf(f, "none");
+ break;
+ case slang_asm_float_copy:
+ fprintf(f, "float_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_move:
+ fprintf(f, "float_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_push:
+ fprintf(f, "float_push\t%f", a->literal);
+ break;
+ case slang_asm_float_deref:
+ fprintf(f, "float_deref");
+ break;
+ case slang_asm_float_add:
+ fprintf(f, "float_add");
+ break;
+ case slang_asm_float_multiply:
+ fprintf(f, "float_multiply");
+ break;
+ case slang_asm_float_divide:
+ fprintf(f, "float_divide");
+ break;
+ case slang_asm_float_negate:
+ fprintf(f, "float_negate");
+ break;
+ case slang_asm_float_less:
+ fprintf(f, "float_less");
+ break;
+ case slang_asm_float_equal_exp:
+ fprintf(f, "float_equal");
+ break;
+ case slang_asm_float_equal_int:
+ fprintf(f, "float_equal\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_to_int:
+ fprintf(f, "float_to_int");
+ break;
+ case slang_asm_float_sine:
+ fprintf(f, "float_sine");
+ break;
+ case slang_asm_float_arcsine:
+ fprintf(f, "float_arcsine");
+ break;
+ case slang_asm_float_arctan:
+ fprintf(f, "float_arctan");
+ break;
+ case slang_asm_float_power:
+ fprintf(f, "float_power");
+ break;
+ case slang_asm_float_log2:
+ fprintf(f, "float_log2");
+ break;
+ case slang_asm_float_floor:
+ fprintf(f, "float_floor");
+ break;
+ case slang_asm_float_ceil:
+ fprintf(f, "float_ceil");
+ break;
+ case slang_asm_float_noise1:
+ fprintf(f, "float_noise1");
+ break;
+ case slang_asm_float_noise2:
+ fprintf(f, "float_noise2");
+ break;
+ case slang_asm_float_noise3:
+ fprintf(f, "float_noise3");
+ break;
+ case slang_asm_float_noise4:
+ fprintf(f, "float_noise4");
+ break;
+ case slang_asm_int_copy:
+ fprintf(f, "int_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_int_move:
+ fprintf(f, "int_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_int_push:
+ fprintf(f, "int_push\t%d", (GLint) a->literal);
+ break;
+ case slang_asm_int_deref:
+ fprintf(f, "int_deref");
+ break;
+ case slang_asm_int_to_float:
+ fprintf(f, "int_to_float");
+ break;
+ case slang_asm_int_to_addr:
+ fprintf(f, "int_to_addr");
+ break;
+ case slang_asm_bool_copy:
+ fprintf(f, "bool_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_bool_move:
+ fprintf(f, "bool_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_bool_push:
+ fprintf(f, "bool_push\t%d", a->literal != 0.0f);
+ break;
+ case slang_asm_bool_deref:
+ fprintf(f, "bool_deref");
+ break;
+ case slang_asm_addr_copy:
+ fprintf(f, "addr_copy");
+ break;
+ case slang_asm_addr_push:
+ fprintf(f, "addr_push\t%u", a->param[0]);
+ break;
+ case slang_asm_addr_deref:
+ fprintf(f, "addr_deref");
+ break;
+ case slang_asm_addr_add:
+ fprintf(f, "addr_add");
+ break;
+ case slang_asm_addr_multiply:
+ fprintf(f, "addr_multiply");
+ break;
+ case slang_asm_vec4_tex1d:
+ fprintf(f, "vec4_tex1d");
+ break;
+ case slang_asm_vec4_tex2d:
+ fprintf(f, "vec4_tex2d");
+ break;
+ case slang_asm_vec4_tex3d:
+ fprintf(f, "vec4_tex3d");
+ break;
+ case slang_asm_vec4_texcube:
+ fprintf(f, "vec4_texcube");
+ break;
+ case slang_asm_vec4_shad1d:
+ fprintf(f, "vec4_shad1d");
+ break;
+ case slang_asm_vec4_shad2d:
+ fprintf(f, "vec4_shad2d");
+ break;
+ case slang_asm_jump:
+ fprintf(f, "jump\t%u", a->param[0]);
+ break;
+ case slang_asm_jump_if_zero:
+ fprintf(f, "jump_if_zero\t%u", a->param[0]);
+ break;
+ case slang_asm_enter:
+ fprintf(f, "enter\t%u", a->param[0]);
+ break;
+ case slang_asm_leave:
+ fprintf(f, "leave");
+ break;
+ case slang_asm_local_alloc:
+ fprintf(f, "local_alloc\t%u", a->param[0]);
+ break;
+ case slang_asm_local_free:
+ fprintf(f, "local_free\t%u", a->param[0]);
+ break;
+ case slang_asm_local_addr:
+ fprintf(f, "local_addr\t%u, %u", a->param[0], a->param[1]);
+ break;
+ case slang_asm_global_addr:
+ fprintf(f, "global_addr\t%u", a->param[0]);
+ break;
+ case slang_asm_call:
+ fprintf(f, "call\t%u", a->param[0]);
+ break;
+ case slang_asm_return:
+ fprintf(f, "return");
+ break;
+ case slang_asm_discard:
+ fprintf(f, "discard");
+ break;
+ case slang_asm_exit:
+ fprintf(f, "exit");
+ break;
+ /* GL_MESA_shader_debug */
+ case slang_asm_float_print:
+ fprintf(f, "float_print");
+ break;
+ case slang_asm_int_print:
+ fprintf(f, "int_print");
+ break;
+ case slang_asm_bool_print:
+ fprintf(f, "bool_print");
+ break;
+ /* vec4 */
case slang_asm_float_to_vec4:
- fprintf (f, "float_to_vec4");
+ fprintf(f, "float_to_vec4");
break;
case slang_asm_vec4_add:
- fprintf (f, "vec4_add");
+ fprintf(f, "vec4_add");
break;
case slang_asm_vec4_subtract:
- fprintf (f, "vec4_subtract");
+ fprintf(f, "vec4_subtract");
break;
case slang_asm_vec4_multiply:
- fprintf (f, "vec4_multiply");
+ fprintf(f, "vec4_multiply");
break;
case slang_asm_vec4_divide:
- fprintf (f, "vec4_divide");
+ fprintf(f, "vec4_divide");
break;
case slang_asm_vec4_negate:
- fprintf (f, "vec4_negate");
+ fprintf(f, "vec4_negate");
break;
case slang_asm_vec4_dot:
- fprintf (f, "vec4_dot");
+ fprintf(f, "vec4_dot");
break;
case slang_asm_vec4_copy:
- fprintf (f, "vec4_copy");
+ fprintf(f, "vec4_copy");
break;
case slang_asm_vec4_deref:
- fprintf (f, "vec4_deref");
+ fprintf(f, "vec4_deref");
break;
case slang_asm_vec4_equal_int:
- fprintf (f, "vec4_equal");
+ fprintf(f, "vec4_equal");
break;
default:
- break;
- }
+ break;
+ }
- fprintf (f, "\n");
+ fprintf(f, "\n");
}
-static void dump (const slang_assembly_file *file)
+static void
+dump(const slang_assembly_file * file)
{
- unsigned int i;
- static unsigned int counter = 0;
- FILE *f;
- char filename[256];
+ unsigned int i;
+ static unsigned int counter = 0;
+ FILE *f;
+ char filename[256];
- counter++;
- _mesa_sprintf (filename, "~mesa-slang-assembly-dump-(%u).txt", counter);
- f = fopen (filename, "w");
- if (f == NULL)
- return;
+ counter++;
+ _mesa_sprintf(filename, "~mesa-slang-assembly-dump-(%u).txt", counter);
+ f = fopen(filename, "w");
+ if (f == NULL)
+ return;
- for (i = 0; i < file->count; i++)
- dump_instruction (f, file->code + i, i);
+ for (i = 0; i < file->count; i++)
+ dump_instruction(f, file->code + i, i);
- fclose (f);
+ fclose(f);
}
#endif
static GLvoid
-ensure_infolog_created (slang_info_log **infolog)
+ensure_infolog_created(slang_info_log ** infolog)
{
if (*infolog == NULL) {
- *infolog = slang_alloc_malloc (sizeof (slang_info_log));
+ *infolog = slang_alloc_malloc(sizeof(slang_info_log));
if (*infolog == NULL)
return;
- slang_info_log_construct (*infolog);
+ slang_info_log_construct(*infolog);
}
}
GLboolean
-_slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
+_slang_execute2(const slang_assembly_file * file, slang_machine * mach)
{
- slang_machine_slot *stack;
+ slang_machine_slot *stack;
#if DEBUG_SLANG
- static unsigned int counter = 0;
- char filename[256];
- FILE *f;
+ static unsigned int counter = 0;
+ char filename[256];
+ FILE *f;
#endif
- /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */
- static_assert(sizeof (GLfloat) == 4);
- static_assert(sizeof (GLuint) == 4);
+ /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */
+ static_assert(sizeof(GLfloat) == 4);
+ static_assert(sizeof(GLuint) == 4);
#if DEBUG_SLANG
- dump (file);
- counter++;
- _mesa_sprintf (filename, "~mesa-slang-assembly-exec-(%u).txt", counter);
- f = fopen (filename, "w");
+ dump(file);
+ counter++;
+ _mesa_sprintf(filename, "~mesa-slang-assembly-exec-(%u).txt", counter);
+ f = fopen(filename, "w");
#endif
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- if (mach->x86.compiled_func != NULL)
- {
- mach->x86.compiled_func (mach);
- return GL_TRUE;
- }
+ if (mach->x86.compiled_func != NULL) {
+ mach->x86.compiled_func(mach);
+ return GL_TRUE;
+ }
#endif
- stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE;
+ stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE;
- while (!mach->exit)
- {
- slang_assembly *a = &file->code[mach->ip];
+ while (!mach->exit) {
+ const slang_assembly *a = &file->code[mach->ip];
#if DEBUG_SLANG
- if (f != NULL && a->type != slang_asm_none)
- {
- unsigned int i;
+ if (f != NULL && a->type != slang_asm_none) {
+ unsigned int i;
- dump_instruction (f, file->code + mach->ip, mach->ip);
- fprintf (f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp);
- for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++)
- fprintf (f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float, stack[i]._addr);
- fflush (f);
- }
+ dump_instruction(f, file->code + mach->ip, mach->ip);
+ fprintf(f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp);
+ for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++)
+ fprintf(f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float,
+ stack[i]._addr);
+ fflush(f);
+ }
#endif
- mach->ip++;
+ mach->ip++;
- switch (a->type)
- {
- /* core */
- case slang_asm_none:
- break;
- case slang_asm_float_copy:
- case slang_asm_int_copy:
- case slang_asm_bool_copy:
- mach->mem[(stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4]._float =
- stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_move:
- case slang_asm_int_move:
- case slang_asm_bool_move:
- stack[mach->sp + a->param[0] / 4]._float =
- stack[mach->sp + (stack[mach->sp]._addr + a->param[1]) / 4]._float;
- break;
- case slang_asm_float_push:
- case slang_asm_int_push:
- case slang_asm_bool_push:
- mach->sp--;
- stack[mach->sp]._float = a->literal;
- break;
- case slang_asm_float_deref:
- case slang_asm_int_deref:
- case slang_asm_bool_deref:
- stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float;
- break;
- case slang_asm_float_add:
- stack[mach->sp + 1]._float += stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_multiply:
- stack[mach->sp + 1]._float *= stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_divide:
- stack[mach->sp + 1]._float /= stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_negate:
- stack[mach->sp]._float = -stack[mach->sp]._float;
- break;
- case slang_asm_float_less:
- stack[mach->sp + 1]._float =
- stack[mach->sp + 1]._float < stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
- mach->sp++;
- break;
- case slang_asm_float_equal_exp:
- stack[mach->sp + 1]._float =
- stack[mach->sp + 1]._float == stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
- mach->sp++;
- break;
- case slang_asm_float_equal_int:
- mach->sp--;
- stack[mach->sp]._float = stack[mach->sp + 1 + a->param[0] / 4]._float ==
- stack[mach->sp + 1 + a->param[1] / 4]._float ? (GLfloat) 1 : (GLfloat) 0;
- break;
- case slang_asm_float_to_int:
- stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float;
- break;
- case slang_asm_float_sine:
- stack[mach->sp]._float = (GLfloat) _mesa_sin (stack[mach->sp]._float);
- break;
- case slang_asm_float_arcsine:
- stack[mach->sp]._float = _mesa_asinf (stack[mach->sp]._float);
- break;
- case slang_asm_float_arctan:
- stack[mach->sp]._float = _mesa_atanf (stack[mach->sp]._float);
- break;
- case slang_asm_float_power:
- stack[mach->sp + 1]._float =
- (GLfloat) _mesa_pow (stack[mach->sp + 1]._float, stack[mach->sp]._float);
- mach->sp++;
- break;
- case slang_asm_float_log2:
- stack[mach->sp]._float = LOG2 (stack[mach->sp]._float);
- break;
- case slang_asm_float_floor:
- stack[mach->sp]._float = FLOORF (stack[mach->sp]._float);
- break;
- case slang_asm_float_ceil:
- stack[mach->sp]._float = CEILF (stack[mach->sp]._float);
- break;
- case slang_asm_float_noise1:
- stack[mach->sp]._float = _slang_library_noise1 (stack[mach->sp]._float);
- break;
- case slang_asm_float_noise2:
- stack[mach->sp + 1]._float = _slang_library_noise2 (stack[mach->sp]._float,
- stack[mach->sp + 1]._float);
- mach->sp++;
- break;
- case slang_asm_float_noise3:
- stack[mach->sp + 2]._float = _slang_library_noise3 (stack[mach->sp]._float,
- stack[mach->sp + 1]._float, stack[mach->sp + 2]._float);
- mach->sp += 2;
- break;
- case slang_asm_float_noise4:
- stack[mach->sp + 3]._float = _slang_library_noise4 (stack[mach->sp]._float,
- stack[mach->sp + 1]._float, stack[mach->sp + 2]._float, stack[mach->sp + 3]._float);
- mach->sp += 3;
- break;
- case slang_asm_int_to_float:
- break;
- case slang_asm_int_to_addr:
- stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float;
- break;
- case slang_asm_addr_copy:
- mach->mem[stack[mach->sp + 1]._addr / 4]._addr = stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_addr_push:
- case slang_asm_global_addr:
- mach->sp--;
- stack[mach->sp]._addr = a->param[0];
- break;
- case slang_asm_addr_deref:
- stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr;
- break;
- case slang_asm_addr_add:
- stack[mach->sp + 1]._addr += stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_addr_multiply:
- stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_vec4_tex1d:
- _slang_library_tex1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, &mach->mem[stack[mach->sp + 3]._addr / 4]._float);
- mach->sp += 3;
- break;
- case slang_asm_vec4_tex2d:
- _slang_library_tex2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float,
- &mach->mem[stack[mach->sp + 4]._addr / 4]._float);
- mach->sp += 4;
- break;
- case slang_asm_vec4_tex3d:
- _slang_library_tex3d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_vec4_texcube:
- _slang_library_texcube (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_vec4_shad1d:
- _slang_library_shad1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_vec4_shad2d:
- _slang_library_shad2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_jump:
- mach->ip = a->param[0];
- break;
- case slang_asm_jump_if_zero:
- if (stack[mach->sp]._float == 0.0f)
- mach->ip = a->param[0];
- mach->sp++;
- break;
- case slang_asm_enter:
- mach->sp--;
- stack[mach->sp]._addr = mach->bp;
- mach->bp = mach->sp + a->param[0] / 4;
- break;
- case slang_asm_leave:
- mach->bp = stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_local_alloc:
- mach->sp -= a->param[0] / 4;
- break;
- case slang_asm_local_free:
- mach->sp += a->param[0] / 4;
- break;
- case slang_asm_local_addr:
- mach->sp--;
- stack[mach->sp]._addr = SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 -
- (a->param[0] + a->param[1]) + 4;
- break;
- case slang_asm_call:
- mach->sp--;
- stack[mach->sp]._addr = mach->ip;
- mach->ip = a->param[0];
- break;
- case slang_asm_return:
- mach->ip = stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_discard:
- mach->kill = 1;
- break;
- case slang_asm_exit:
- mach->exit = 1;
- break;
- /* GL_MESA_shader_debug */
- case slang_asm_float_print:
- _mesa_printf ("slang print: %f\n", stack[mach->sp]._float);
- ensure_infolog_created (&mach->infolog);
- slang_info_log_print (mach->infolog, "%f", stack[mach->sp]._float);
- break;
- case slang_asm_int_print:
- _mesa_printf ("slang print: %d\n", (GLint) stack[mach->sp]._float);
- ensure_infolog_created (&mach->infolog);
- slang_info_log_print (mach->infolog, "%d", (GLint) (stack[mach->sp]._float));
- break;
- case slang_asm_bool_print:
- _mesa_printf ("slang print: %s\n", (GLint) stack[mach->sp]._float ? "true" : "false");
- ensure_infolog_created (&mach->infolog);
- slang_info_log_print (mach->infolog, "%s",
- (GLint) (stack[mach->sp]._float) ? "true" : "false");
- break;
- /* vec4 */
+ switch (a->type) {
+ /* core */
+ case slang_asm_none:
+ break;
+ case slang_asm_float_copy:
+ case slang_asm_int_copy:
+ case slang_asm_bool_copy:
+ /* store top value on stack to memory */
+ {
+ GLuint address
+ = (stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4;
+ GLfloat value = stack[mach->sp]._float;
+ mach->mem[address]._float = value;
+ }
+ mach->sp++;
+ break;
+ case slang_asm_float_move:
+ case slang_asm_int_move:
+ case slang_asm_bool_move:
+ stack[mach->sp + a->param[0] / 4]._float =
+ stack[mach->sp +
+ (stack[mach->sp]._addr + a->param[1]) / 4]._float;
+ break;
+ case slang_asm_float_push:
+ case slang_asm_int_push:
+ case slang_asm_bool_push:
+ /* push float/int/bool literal onto stop of stack */
+ mach->sp--;
+ stack[mach->sp]._float = a->literal;
+ break;
+ case slang_asm_float_deref:
+ case slang_asm_int_deref:
+ case slang_asm_bool_deref:
+ /* load value from memory, replace stop of stack with it */
+ stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float;
+ break;
+ case slang_asm_float_add:
+ /* pop two top floats, push sum */
+ stack[mach->sp + 1]._float += stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_multiply:
+ stack[mach->sp + 1]._float *= stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_divide:
+ stack[mach->sp + 1]._float /= stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_negate:
+ stack[mach->sp]._float = -stack[mach->sp]._float;
+ break;
+ case slang_asm_float_less:
+ stack[mach->sp + 1]._float =
+ (stack[mach->sp + 1]._float < stack[mach->sp]._float)
+ ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
+ break;
+ case slang_asm_float_equal_exp:
+ stack[mach->sp + 1]._float =
+ (stack[mach->sp + 1]._float == stack[mach->sp]._float)
+ ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
+ break;
+ case slang_asm_float_equal_int:
+ /* pop top two values, compare, push 0 or 1 */
+ mach->sp--;
+ stack[mach->sp]._float =
+ (stack[mach->sp + 1 + a->param[0] / 4]._float ==
+ stack[mach->sp + 1 + a->param[1] / 4]._float)
+ ? (GLfloat) 1 : (GLfloat) 0;
+ break;
+ case slang_asm_float_to_int:
+ stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float;
+ break;
+ case slang_asm_float_sine:
+ stack[mach->sp]._float = (GLfloat) _mesa_sin(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arcsine:
+ stack[mach->sp]._float = _mesa_asinf(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arctan:
+ stack[mach->sp]._float = _mesa_atanf(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_power:
+ stack[mach->sp + 1]._float = (GLfloat)
+ _mesa_pow(stack[mach->sp + 1]._float, stack[mach->sp]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_log2:
+ stack[mach->sp]._float = LOG2(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_floor:
+ stack[mach->sp]._float = FLOORF(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_ceil:
+ stack[mach->sp]._float = CEILF(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise1:
+ stack[mach->sp]._float =
+ _slang_library_noise1(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise2:
+ stack[mach->sp + 1]._float =
+ _slang_library_noise2(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_noise3:
+ stack[mach->sp + 2]._float =
+ _slang_library_noise3(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float);
+ mach->sp += 2;
+ break;
+ case slang_asm_float_noise4:
+ stack[mach->sp + 3]._float =
+ _slang_library_noise4(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float);
+ mach->sp += 3;
+ break;
+ case slang_asm_int_to_float:
+ break;
+ case slang_asm_int_to_addr:
+ stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float;
+ break;
+ case slang_asm_addr_copy:
+ mach->mem[stack[mach->sp + 1]._addr / 4]._addr =
+ stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_addr_push:
+ case slang_asm_global_addr:
+ mach->sp--;
+ stack[mach->sp]._addr = a->param[0];
+ break;
+ case slang_asm_addr_deref:
+ stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr;
+ break;
+ case slang_asm_addr_add:
+ stack[mach->sp + 1]._addr += stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_addr_multiply:
+ stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_vec4_tex1d:
+ _slang_library_tex1d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ &mach->mem[stack[mach->sp + 3]._addr /
+ 4]._float);
+ mach->sp += 3;
+ break;
+ case slang_asm_vec4_tex2d:
+ _slang_library_tex2d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ &mach->mem[stack[mach->sp + 4]._addr /
+ 4]._float);
+ mach->sp += 4;
+ break;
+ case slang_asm_vec4_tex3d:
+ _slang_library_tex3d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_texcube:
+ _slang_library_texcube(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad1d:
+ _slang_library_shad1d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad2d:
+ _slang_library_shad2d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_jump:
+ mach->ip = a->param[0];
+ break;
+ case slang_asm_jump_if_zero:
+ if (stack[mach->sp]._float == 0.0f)
+ mach->ip = a->param[0];
+ mach->sp++;
+ break;
+ case slang_asm_enter:
+ mach->sp--;
+ stack[mach->sp]._addr = mach->bp;
+ mach->bp = mach->sp + a->param[0] / 4;
+ break;
+ case slang_asm_leave:
+ mach->bp = stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_local_alloc:
+ mach->sp -= a->param[0] / 4;
+ break;
+ case slang_asm_local_free:
+ mach->sp += a->param[0] / 4;
+ break;
+ case slang_asm_local_addr:
+ mach->sp--;
+ stack[mach->sp]._addr =
+ SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 - (a->param[0] +
+ a->param[1]) + 4;
+ break;
+ case slang_asm_call:
+ mach->sp--;
+ stack[mach->sp]._addr = mach->ip;
+ mach->ip = a->param[0];
+ break;
+ case slang_asm_return:
+ mach->ip = stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_discard:
+ mach->kill = GL_TRUE;
+ break;
+ case slang_asm_exit:
+ mach->exit = GL_TRUE;
+ break;
+ /* GL_MESA_shader_debug */
+ case slang_asm_float_print:
+ _mesa_printf("slang print: %f\n", stack[mach->sp]._float);
+ ensure_infolog_created(&mach->infolog);
+ slang_info_log_print(mach->infolog, "%f", stack[mach->sp]._float);
+ break;
+ case slang_asm_int_print:
+ _mesa_printf("slang print: %d\n", (GLint) stack[mach->sp]._float);
+ ensure_infolog_created(&mach->infolog);
+ slang_info_log_print(mach->infolog, "%d",
+ (GLint) (stack[mach->sp]._float));
+ break;
+ case slang_asm_bool_print:
+ _mesa_printf("slang print: %s\n",
+ (GLint) stack[mach->sp]._float ? "true" : "false");
+ ensure_infolog_created(&mach->infolog);
+ slang_info_log_print(mach->infolog, "%s",
+ (GLint) (stack[mach->sp].
+ _float) ? "true" : "false");
+ break;
+ /* vec4 */
case slang_asm_float_to_vec4:
/* [vec4] | float > [vec4] */
{
@@ -660,7 +714,8 @@ _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
mach->mem[da / 4]._float = -mach->mem[da / 4]._float;
mach->mem[(da + 4) / 4]._float = -mach->mem[(da + 4) / 4]._float;
mach->mem[(da + 8) / 4]._float = -mach->mem[(da + 8) / 4]._float;
- mach->mem[(da + 12) / 4]._float = -mach->mem[(da + 12) / 4]._float;
+ mach->mem[(da + 12) / 4]._float =
+ -mach->mem[(da + 12) / 4]._float;
}
break;
case slang_asm_vec4_dot:
@@ -721,9 +776,8 @@ _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
#if DEBUG_SLANG
if (f != NULL)
- fclose (f);
+ fclose(f);
#endif
return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_execute.h b/src/mesa/shader/slang/slang_execute.h
index cb152c71420..138f1393081 100644
--- a/src/mesa/shader/slang/slang_execute.h
+++ b/src/mesa/shader/slang/slang_execute.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_EXECUTE_H
+#ifndef SLANG_EXECUTE_H
#define SLANG_EXECUTE_H
#include "slang_assemble.h"
@@ -31,55 +31,75 @@
extern "C" {
#endif
+
+/**
+ * A memory location
+ */
typedef union slang_machine_slot_
{
- GLfloat _float;
- GLuint _addr;
+ GLfloat _float;
+ GLuint _addr;
} slang_machine_slot;
#define SLANG_MACHINE_GLOBAL_SIZE 3072
#define SLANG_MACHINE_STACK_SIZE 1024
#define SLANG_MACHINE_MEMORY_SIZE (SLANG_MACHINE_GLOBAL_SIZE + SLANG_MACHINE_STACK_SIZE)
+
#if defined(USE_X86_ASM) || defined(SLANG_X86)
+/**
+ * Extra machine state for x86 execution.
+ */
typedef struct
{
- GLvoid (* compiled_func) (struct slang_machine_ *);
- GLuint esp_restore;
- GLshort fpucntl_rnd_neg;
- GLshort fpucntl_restore;
+ GLvoid(*compiled_func) (struct slang_machine_ *);
+ GLuint esp_restore;
+ GLshort fpucntl_rnd_neg;
+ GLshort fpucntl_restore;
} slang_machine_x86;
#endif
+
+/**
+ * Runtime shader machine state.
+ */
typedef struct slang_machine_
{
- GLuint ip; /* instruction pointer, for flow control */
- GLuint sp; /* stack pointer, for stack access */
- GLuint bp; /* base pointer, for local variable access */
- GLuint kill; /* discard the fragment */
- GLuint exit; /* terminate the shader */
- slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
- struct slang_info_log_ *infolog; /* printMESA() support */
+ GLuint ip; /**< instruction pointer, for flow control */
+ GLuint sp; /**< stack pointer, for stack access */
+ GLuint bp; /**< base pointer, for local variable access */
+ GLboolean kill; /**< discard the fragment? */
+ GLboolean exit; /**< terminate the shader */
+ /** Machine memory */
+ slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
+ struct slang_info_log_ *infolog; /**< printMESA() support */
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- slang_machine_x86 x86;
+ slang_machine_x86 x86;
#endif
} slang_machine;
-GLvoid slang_machine_ctr (slang_machine *);
-GLvoid slang_machine_dtr (slang_machine *);
-void slang_machine_init (slang_machine *);
+extern GLvoid
+slang_machine_ctr(slang_machine *);
+
+extern GLvoid
+slang_machine_dtr(slang_machine *);
+
+extern void
+slang_machine_init(slang_machine *);
+
+extern GLboolean
+_slang_execute2(const slang_assembly_file *, slang_machine *);
-GLboolean
-_slang_execute2 (const slang_assembly_file *, slang_machine *);
#if defined(USE_X86_ASM) || defined(SLANG_X86)
-GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint);
+extern GLboolean
+_slang_x86_codegen(slang_machine *, slang_assembly_file *, GLuint);
#endif
+
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/src/mesa/shader/slang/slang_execute_x86.c b/src/mesa/shader/slang/slang_execute_x86.c
index 3e21edff6a3..958086ff07c 100644
--- a/src/mesa/shader/slang/slang_execute_x86.c
+++ b/src/mesa/shader/slang/slang_execute_x86.c
@@ -40,40 +40,42 @@
typedef struct
{
- GLuint index;
- GLubyte *csr;
+ GLuint index;
+ GLubyte *csr;
} fixup;
typedef struct
{
- struct x86_function f;
- struct x86_reg r_eax;
- struct x86_reg r_ecx;
- struct x86_reg r_edx;
+ struct x86_function f;
+ struct x86_reg r_eax;
+ struct x86_reg r_ecx;
+ struct x86_reg r_edx;
struct x86_reg r_ebx;
- struct x86_reg r_esp;
- struct x86_reg r_ebp;
- struct x86_reg r_st0;
- struct x86_reg r_st1;
- struct x86_reg r_st2;
- struct x86_reg r_st3;
+ struct x86_reg r_esp;
+ struct x86_reg r_ebp;
+ struct x86_reg r_st0;
+ struct x86_reg r_st1;
+ struct x86_reg r_st2;
+ struct x86_reg r_st3;
struct x86_reg r_st4;
- fixup *fixups;
- GLuint fixup_count;
- GLubyte **labels;
- slang_machine *mach;
- GLubyte *l_discard;
- GLubyte *l_exit;
- GLshort fpucntl;
+ fixup *fixups;
+ GLuint fixup_count;
+ GLubyte **labels;
+ slang_machine *mach;
+ GLubyte *l_discard;
+ GLubyte *l_exit;
+ GLshort fpucntl;
} codegen_ctx;
-static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr)
+static GLvoid
+add_fixup(codegen_ctx * G, GLuint index, GLubyte * csr)
{
- G->fixups = (fixup *) slang_alloc_realloc (G->fixups, G->fixup_count * sizeof (fixup),
- (G->fixup_count + 1) * sizeof (fixup));
- G->fixups[G->fixup_count].index = index;
- G->fixups[G->fixup_count].csr = csr;
- G->fixup_count++;
+ G->fixups =
+ (fixup *) slang_alloc_realloc(G->fixups, G->fixup_count * sizeof(fixup),
+ (G->fixup_count + 1) * sizeof(fixup));
+ G->fixups[G->fixup_count].index = index;
+ G->fixups[G->fixup_count].csr = csr;
+ G->fixup_count++;
}
#ifdef NO_FAST_MATH
@@ -88,661 +90,665 @@ static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr)
/*
* XXX
- * These should produce a valid code that computes powers. Unfortunately, it does not.
+ * These should produce a valid code that computes powers.
+ * Unfortunately, it does not.
*/
-static void set_fpu_round_neg_inf (codegen_ctx *G)
+static void
+set_fpu_round_neg_inf(codegen_ctx * G)
{
- if (G->fpucntl != RND_NEG_FPU)
- {
- G->fpucntl = RND_NEG_FPU;
- x87_fnclex (&G->f);
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->x86.fpucntl_rnd_neg);
- x87_fldcw (&G->f, x86_deref (G->r_eax));
- }
+ if (G->fpucntl != RND_NEG_FPU) {
+ G->fpucntl = RND_NEG_FPU;
+ x87_fnclex(&G->f);
+ x86_mov_reg_imm(&G->f, G->r_eax,
+ (GLint) & G->mach->x86.fpucntl_rnd_neg);
+ x87_fldcw(&G->f, x86_deref(G->r_eax));
+ }
}
-static void emit_x87_ex2 (codegen_ctx *G)
+static void
+emit_x87_ex2(codegen_ctx * G)
{
- set_fpu_round_neg_inf (G);
-
- x87_fld (&G->f, G->r_st0); /* a a */
- x87_fprndint (&G->f); /* int(a) a */
- x87_fld (&G->f, G->r_st0); /* int(a) int(a) a */
- x87_fstp (&G->f, G->r_st3); /* int(a) a int(a)*/
- x87_fsubp (&G->f, G->r_st1);/* frac(a) int(a) */
- x87_f2xm1 (&G->f); /* (2^frac(a))-1 int(a)*/
- x87_fld1 (&G->f); /* 1 (2^frac(a))-1 int(a)*/
- x87_faddp (&G->f, G->r_st1);/* 2^frac(a) int(a) */
- x87_fscale (&G->f); /* 2^a */
+ set_fpu_round_neg_inf(G);
+
+ x87_fld(&G->f, G->r_st0); /* a a */
+ x87_fprndint(&G->f); /* int(a) a */
+ x87_fld(&G->f, G->r_st0); /* int(a) int(a) a */
+ x87_fstp(&G->f, G->r_st3); /* int(a) a int(a) */
+ x87_fsubp(&G->f, G->r_st1); /* frac(a) int(a) */
+ x87_f2xm1(&G->f); /* (2^frac(a))-1 int(a) */
+ x87_fld1(&G->f); /* 1 (2^frac(a))-1 int(a) */
+ x87_faddp(&G->f, G->r_st1); /* 2^frac(a) int(a) */
+ x87_fscale(&G->f); /* 2^a */
}
-static void emit_pow (codegen_ctx *G)
+static void
+emit_pow(codegen_ctx * G)
{
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fyl2x (&G->f);
- emit_x87_ex2 (G);
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fyl2x(&G->f);
+ emit_x87_ex2(G);
}
#endif
-static GLfloat do_ceilf (GLfloat x)
+static GLfloat
+do_ceilf(GLfloat x)
{
- return CEILF (x);
+ return CEILF(x);
}
-static GLfloat do_floorf (GLfloat x)
+static GLfloat
+do_floorf(GLfloat x)
{
- return FLOORF (x);
+ return FLOORF(x);
}
static GLfloat
-do_ftoi (GLfloat x)
+do_ftoi(GLfloat x)
{
return (GLfloat) ((GLint) (x));
}
-static GLfloat do_powf (GLfloat y, GLfloat x)
+static GLfloat
+do_powf(GLfloat y, GLfloat x)
{
- return (GLfloat) _mesa_pow ((GLdouble) x, (GLdouble) y);
+ return (GLfloat) _mesa_pow((GLdouble) x, (GLdouble) y);
}
static GLvoid
-ensure_infolog_created (slang_info_log **infolog)
+ensure_infolog_created(slang_info_log ** infolog)
{
if (*infolog == NULL) {
- *infolog = slang_alloc_malloc (sizeof (slang_info_log));
+ *infolog = slang_alloc_malloc(sizeof(slang_info_log));
if (*infolog == NULL)
return;
- slang_info_log_construct (*infolog);
+ slang_info_log_construct(*infolog);
}
}
-static GLvoid do_print_float (slang_info_log **infolog, GLfloat x)
+static GLvoid
+do_print_float(slang_info_log ** infolog, GLfloat x)
{
- _mesa_printf ("slang print: %f\n", x);
- ensure_infolog_created (infolog);
- slang_info_log_print (*infolog, "%f", x);
+ _mesa_printf("slang print: %f\n", x);
+ ensure_infolog_created(infolog);
+ slang_info_log_print(*infolog, "%f", x);
}
-static GLvoid do_print_int (slang_info_log **infolog, GLfloat x)
+static GLvoid
+do_print_int(slang_info_log ** infolog, GLfloat x)
{
- _mesa_printf ("slang print: %d\n", (GLint) (x));
- ensure_infolog_created (infolog);
- slang_info_log_print (*infolog, "%d", (GLint) (x));
+ _mesa_printf("slang print: %d\n", (GLint) (x));
+ ensure_infolog_created(infolog);
+ slang_info_log_print(*infolog, "%d", (GLint) (x));
}
-static GLvoid do_print_bool (slang_info_log **infolog, GLfloat x)
+static GLvoid
+do_print_bool(slang_info_log ** infolog, GLfloat x)
{
- _mesa_printf ("slang print: %s\n", (GLint) (x) ? "true" : "false");
- ensure_infolog_created (infolog);
- slang_info_log_print (*infolog, "%s", (GLint) (x) ? "true" : "false");
+ _mesa_printf("slang print: %s\n", (GLint) (x) ? "true" : "false");
+ ensure_infolog_created(infolog);
+ slang_info_log_print(*infolog, "%s", (GLint) (x) ? "true" : "false");
}
#define FLOAT_ONE 0x3f800000
#define FLOAT_ZERO 0
-static GLvoid codegen_assem (codegen_ctx *G, slang_assembly *a, slang_info_log **infolog)
+static GLvoid
+codegen_assem(codegen_ctx * G, slang_assembly * a, slang_info_log ** infolog)
{
- GLint disp, i;
-
- switch (a->type)
- {
- case slang_asm_none:
- break;
- case slang_asm_float_copy:
- case slang_asm_int_copy:
- case slang_asm_bool_copy:
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0]));
- x86_pop (&G->f, G->r_ecx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx);
- break;
- case slang_asm_float_move:
- case slang_asm_int_move:
- case slang_asm_bool_move:
- x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[1]));
- x86_add (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
- x86_mov (&G->f, x86_make_disp (G->r_esp, a->param[0]), G->r_eax);
- break;
- case slang_asm_float_push:
- case slang_asm_int_push:
- case slang_asm_bool_push:
- /* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, *((GLint *) &a->literal));
- x86_push (&G->f, G->r_eax);
- break;
- case slang_asm_float_deref:
- case slang_asm_int_deref:
- case slang_asm_bool_deref:
- case slang_asm_addr_deref:
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
- break;
- case slang_asm_float_add:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_faddp (&G->f, G->r_st1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_multiply:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fmulp (&G->f, G->r_st1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_divide:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fdivp (&G->f, G->r_st1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_negate:
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fchs (&G->f);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_less:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fcomp (&G->f, x86_deref (G->r_esp));
- x87_fnstsw (&G->f, G->r_eax);
- /* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x100);
- x86_test (&G->f, G->r_eax, G->r_ecx);
- {
- GLubyte *lab0, *lab1;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
- /* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- }
- break;
- case slang_asm_float_equal_exp:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fcomp (&G->f, x86_deref (G->r_esp));
- x87_fnstsw (&G->f, G->r_eax);
- /* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
- x86_test (&G->f, G->r_eax, G->r_ecx);
- {
- GLubyte *lab0, *lab1;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
- /* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- }
- break;
- case slang_asm_float_equal_int:
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4));
- x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4));
- x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4));
- x87_fnstsw (&G->f, G->r_eax);
- /* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
- x86_test (&G->f, G->r_eax, G->r_ecx);
- {
- GLubyte *lab0, *lab1;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
- /* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- }
- break;
- case slang_asm_float_to_int:
+ GLint disp, i;
+
+ switch (a->type) {
+ case slang_asm_none:
+ break;
+ case slang_asm_float_copy:
+ case slang_asm_int_copy:
+ case slang_asm_bool_copy:
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[0]));
+ x86_pop(&G->f, G->r_ecx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1]), G->r_ecx);
+ break;
+ case slang_asm_float_move:
+ case slang_asm_int_move:
+ case slang_asm_bool_move:
+ x86_lea(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[1]));
+ x86_add(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_eax));
+ x86_mov(&G->f, x86_make_disp(G->r_esp, a->param[0]), G->r_eax);
+ break;
+ case slang_asm_float_push:
+ case slang_asm_int_push:
+ case slang_asm_bool_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm(&G->f, G->r_eax, *((GLint *) & a->literal));
+ x86_push(&G->f, G->r_eax);
+ break;
+ case slang_asm_float_deref:
+ case slang_asm_int_deref:
+ case slang_asm_bool_deref:
+ case slang_asm_addr_deref:
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_eax));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_eax);
+ break;
+ case slang_asm_float_add:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_faddp(&G->f, G->r_st1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_multiply:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fmulp(&G->f, G->r_st1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_divide:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fdivp(&G->f, G->r_st1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_negate:
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fchs(&G->f);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_less:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fcomp(&G->f, x86_deref(G->r_esp));
+ x87_fnstsw(&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x100);
+ x86_test(&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_exp:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fcomp(&G->f, x86_deref(G->r_esp));
+ x87_fnstsw(&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000);
+ x86_test(&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_int:
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -4));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, a->param[0] + 4));
+ x87_fcomp(&G->f, x86_make_disp(G->r_esp, a->param[1] + 4));
+ x87_fnstsw(&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000);
+ x86_test(&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_to_int:
/* TODO: use fistp without rounding */
- x86_call (&G->f, (GLubyte *) (do_ftoi));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_sine:
- /* TODO: use fsin */
- x86_call (&G->f, (GLubyte *) _mesa_sinf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_arcsine:
- /* TODO: use fpatan (?) */
- x86_call (&G->f, (GLubyte *) _mesa_asinf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_arctan:
- /* TODO: use fpatan */
- x86_call (&G->f, (GLubyte *) _mesa_atanf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_power:
- /* TODO: use emit_pow() */
- x86_call (&G->f, (GLubyte *) do_powf);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_log2:
- x87_fld1 (&G->f);
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fyl2x (&G->f);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_floor:
- x86_call (&G->f, (GLubyte *) do_floorf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_ceil:
- x86_call (&G->f, (GLubyte *) do_ceilf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise1:
- x86_call (&G->f, (GLubyte *) _slang_library_noise1);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise2:
- x86_call (&G->f, (GLubyte *) _slang_library_noise2);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise3:
- x86_call (&G->f, (GLubyte *) _slang_library_noise4);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 8));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise4:
- x86_call (&G->f, (GLubyte *) _slang_library_noise4);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_int_to_float:
- break;
- case slang_asm_int_to_addr:
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fistp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_addr_copy:
- x86_pop (&G->f, G->r_eax);
- x86_mov (&G->f, G->r_ecx, x86_deref (G->r_esp));
- x86_mov (&G->f, x86_deref (G->r_ecx), G->r_eax);
- break;
- case slang_asm_addr_push:
- /* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) a->param[0]);
- x86_push (&G->f, G->r_eax);
- break;
- case slang_asm_addr_add:
- x86_pop (&G->f, G->r_eax);
- x86_add (&G->f, x86_deref (G->r_esp), G->r_eax);
- break;
- case slang_asm_addr_multiply:
- x86_pop (&G->f, G->r_ecx);
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mul (&G->f, G->r_ecx);
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
- break;
- case slang_asm_vec4_tex1d:
- x86_call (&G->f, (GLubyte *) _slang_library_tex1d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
- break;
- case slang_asm_vec4_tex2d:
- x86_call (&G->f, (GLubyte *) _slang_library_tex2d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
- break;
- case slang_asm_vec4_tex3d:
- x86_call (&G->f, (GLubyte *) _slang_library_tex3d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_vec4_texcube:
- x86_call (&G->f, (GLubyte *) _slang_library_texcube);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_vec4_shad1d:
- x86_call (&G->f, (GLubyte *) _slang_library_shad1d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_vec4_shad2d:
- x86_call (&G->f, (GLubyte *) _slang_library_shad2d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_jump:
- add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
- break;
- case slang_asm_jump_if_zero:
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_xor (&G->f, G->r_eax, G->r_eax);
- x86_cmp (&G->f, G->r_eax, x86_make_disp (G->r_esp, -4));
- {
- GLubyte *lab0;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_NE);
- add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
- x86_fixup_fwd_jump (&G->f, lab0);
- }
- break;
- case slang_asm_enter:
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
- assert (a->param[0] != 0);
- x86_push (&G->f, G->r_ebp);
- x86_lea (&G->f, G->r_ebp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
- break;
- case slang_asm_leave:
- x86_pop (&G->f, G->r_ebp);
- break;
- case slang_asm_local_alloc:
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
- assert (a->param[0] != 0);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -(GLint) a->param[0]));
- break;
- case slang_asm_local_free:
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
- assert (a->param[0] != 0);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
- break;
- case slang_asm_local_addr:
- disp = -(GLint) (a->param[0] + a->param[1]) + 4;
- if (disp != 0)
- {
- x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_ebp, disp));
- x86_push (&G->f, G->r_eax);
- }
- else
- x86_push (&G->f, G->r_ebp);
- break;
- case slang_asm_global_addr:
- /* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->mem + a->param[0]);
- x86_push (&G->f, G->r_eax);
- break;
- case slang_asm_call:
- add_fixup (G, a->param[0], x86_call_forward (&G->f));
- break;
- case slang_asm_return:
- x86_ret (&G->f);
- break;
- case slang_asm_discard:
- x86_jmp (&G->f, G->l_discard);
- break;
- case slang_asm_exit:
- x86_jmp (&G->f, G->l_exit);
- break;
- /* GL_MESA_shader_debug */
+ x86_call(&G->f, (GLubyte *) (do_ftoi));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_sine:
+ /* TODO: use fsin */
+ x86_call(&G->f, (GLubyte *) _mesa_sinf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_arcsine:
+ /* TODO: use fpatan (?) */
+ x86_call(&G->f, (GLubyte *) _mesa_asinf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_arctan:
+ /* TODO: use fpatan */
+ x86_call(&G->f, (GLubyte *) _mesa_atanf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_power:
+ /* TODO: use emit_pow() */
+ x86_call(&G->f, (GLubyte *) do_powf);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_log2:
+ x87_fld1(&G->f);
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fyl2x(&G->f);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_floor:
+ x86_call(&G->f, (GLubyte *) do_floorf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_ceil:
+ x86_call(&G->f, (GLubyte *) do_ceilf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise1:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise1);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise2:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise2);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise3:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 8));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise4:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 12));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_int_to_float:
+ break;
+ case slang_asm_int_to_addr:
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fistp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_addr_copy:
+ x86_pop(&G->f, G->r_eax);
+ x86_mov(&G->f, G->r_ecx, x86_deref(G->r_esp));
+ x86_mov(&G->f, x86_deref(G->r_ecx), G->r_eax);
+ break;
+ case slang_asm_addr_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) a->param[0]);
+ x86_push(&G->f, G->r_eax);
+ break;
+ case slang_asm_addr_add:
+ x86_pop(&G->f, G->r_eax);
+ x86_add(&G->f, x86_deref(G->r_esp), G->r_eax);
+ break;
+ case slang_asm_addr_multiply:
+ x86_pop(&G->f, G->r_ecx);
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mul(&G->f, G->r_ecx);
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_eax);
+ break;
+ case slang_asm_vec4_tex1d:
+ x86_call(&G->f, (GLubyte *) _slang_library_tex1d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 12));
+ break;
+ case slang_asm_vec4_tex2d:
+ x86_call(&G->f, (GLubyte *) _slang_library_tex2d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
+ break;
+ case slang_asm_vec4_tex3d:
+ x86_call(&G->f, (GLubyte *) _slang_library_tex3d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_vec4_texcube:
+ x86_call(&G->f, (GLubyte *) _slang_library_texcube);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad1d:
+ x86_call(&G->f, (GLubyte *) _slang_library_shad1d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad2d:
+ x86_call(&G->f, (GLubyte *) _slang_library_shad2d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_jump:
+ add_fixup(G, a->param[0], x86_jmp_forward(&G->f));
+ break;
+ case slang_asm_jump_if_zero:
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_xor(&G->f, G->r_eax, G->r_eax);
+ x86_cmp(&G->f, G->r_eax, x86_make_disp(G->r_esp, -4));
+ {
+ GLubyte *lab0;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_NE);
+ add_fixup(G, a->param[0], x86_jmp_forward(&G->f));
+ x86_fixup_fwd_jump(&G->f, lab0);
+ }
+ break;
+ case slang_asm_enter:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert(a->param[0] != 0);
+ x86_push(&G->f, G->r_ebp);
+ x86_lea(&G->f, G->r_ebp, x86_make_disp(G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_leave:
+ x86_pop(&G->f, G->r_ebp);
+ break;
+ case slang_asm_local_alloc:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert(a->param[0] != 0);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -(GLint) a->param[0]));
+ break;
+ case slang_asm_local_free:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert(a->param[0] != 0);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_local_addr:
+ disp = -(GLint) (a->param[0] + a->param[1]) + 4;
+ if (disp != 0) {
+ x86_lea(&G->f, G->r_eax, x86_make_disp(G->r_ebp, disp));
+ x86_push(&G->f, G->r_eax);
+ }
+ else
+ x86_push(&G->f, G->r_ebp);
+ break;
+ case slang_asm_global_addr:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) & G->mach->mem + a->param[0]);
+ x86_push(&G->f, G->r_eax);
+ break;
+ case slang_asm_call:
+ add_fixup(G, a->param[0], x86_call_forward(&G->f));
+ break;
+ case slang_asm_return:
+ x86_ret(&G->f);
+ break;
+ case slang_asm_discard:
+ x86_jmp(&G->f, G->l_discard);
+ break;
+ case slang_asm_exit:
+ x86_jmp(&G->f, G->l_exit);
+ break;
+ /* GL_MESA_shader_debug */
case slang_asm_float_print:
/* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog));
- x86_push (&G->f, G->r_eax);
- x86_call (&G->f, (GLubyte *) (do_print_float));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog));
+ x86_push(&G->f, G->r_eax);
+ x86_call(&G->f, (GLubyte *) (do_print_float));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
break;
- case slang_asm_int_print:
+ case slang_asm_int_print:
/* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog));
- x86_push (&G->f, G->r_eax);
- x86_call (&G->f, (GLubyte *) do_print_int);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- break;
- case slang_asm_bool_print:
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog));
+ x86_push(&G->f, G->r_eax);
+ x86_call(&G->f, (GLubyte *) do_print_int);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ break;
+ case slang_asm_bool_print:
/* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog));
- x86_push (&G->f, G->r_eax);
- x86_call (&G->f, (GLubyte *) do_print_bool);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- break;
- /* vec4 */
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog));
+ x86_push(&G->f, G->r_eax);
+ x86_call(&G->f, (GLubyte *) do_print_bool);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ break;
+ /* vec4 */
case slang_asm_float_to_vec4:
/* [vec4] | float > [vec4] */
- x87_fld (&G->f, x86_deref (G->r_esp));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x87_fst (&G->f, x86_make_disp (G->r_eax, 12));
- x87_fst (&G->f, x86_make_disp (G->r_eax, 8));
- x87_fst (&G->f, x86_make_disp (G->r_eax, 4));
- x87_fstp (&G->f, x86_deref (G->r_eax));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x87_fst(&G->f, x86_make_disp(G->r_eax, 12));
+ x87_fst(&G->f, x86_make_disp(G->r_eax, 8));
+ x87_fst(&G->f, x86_make_disp(G->r_eax, 4));
+ x87_fstp(&G->f, x86_deref(G->r_eax));
break;
case slang_asm_vec4_add:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_faddp (&G->f, G->r_st4);
+ x87_faddp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_subtract:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fsubp (&G->f, G->r_st4);
+ x87_fsubp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_multiply:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fmulp (&G->f, G->r_st4);
+ x87_fmulp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_divide:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fdivp (&G->f, G->r_st4);
+ x87_fdivp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_negate:
/* [vec4] > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++) {
- x87_fchs (&G->f);
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fchs(&G->f);
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
}
break;
case slang_asm_vec4_dot:
/* [vec4] | vec4 > [float] */
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fmulp (&G->f, G->r_st4);
+ x87_fmulp(&G->f, G->r_st4);
for (i = 0; i < 3; i++)
- x87_faddp (&G->f, G->r_st1);
- x87_fstp (&G->f, x86_deref (G->r_eax));
+ x87_faddp(&G->f, G->r_st1);
+ x87_fstp(&G->f, x86_deref(G->r_eax));
break;
case slang_asm_vec4_copy:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0]));
- x86_pop (&G->f, G->r_ecx);
- x86_pop (&G->f, G->r_edx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx);
- x86_pop (&G->f, G->r_ebx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 4), G->r_edx);
- x86_pop (&G->f, G->r_ecx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 8), G->r_ebx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 12), G->r_ecx);
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[0]));
+ x86_pop(&G->f, G->r_ecx);
+ x86_pop(&G->f, G->r_edx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1]), G->r_ecx);
+ x86_pop(&G->f, G->r_ebx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 4), G->r_edx);
+ x86_pop(&G->f, G->r_ecx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 8), G->r_ebx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 12), G->r_ecx);
break;
case slang_asm_vec4_deref:
/* [vec4] > vec4 */
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mov (&G->f, G->r_ecx, x86_make_disp (G->r_eax, 12));
- x86_mov (&G->f, G->r_edx, x86_make_disp (G->r_eax, 8));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- x86_mov (&G->f, G->r_ebx, x86_make_disp (G->r_eax, 4));
- x86_push (&G->f, G->r_edx);
- x86_mov (&G->f, G->r_ecx, x86_deref (G->r_eax));
- x86_push (&G->f, G->r_ebx);
- x86_push (&G->f, G->r_ecx);
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mov(&G->f, G->r_ecx, x86_make_disp(G->r_eax, 12));
+ x86_mov(&G->f, G->r_edx, x86_make_disp(G->r_eax, 8));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ x86_mov(&G->f, G->r_ebx, x86_make_disp(G->r_eax, 4));
+ x86_push(&G->f, G->r_edx);
+ x86_mov(&G->f, G->r_ecx, x86_deref(G->r_eax));
+ x86_push(&G->f, G->r_ebx);
+ x86_push(&G->f, G->r_ecx);
break;
case slang_asm_vec4_equal_int:
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4));
- x86_mov_reg_imm (&G->f, G->r_edx, 0x4000);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -4));
+ x86_mov_reg_imm(&G->f, G->r_edx, 0x4000);
for (i = 0; i < 4; i++) {
- x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4 + i * 4));
- x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4 + i * 4));
- x87_fnstsw (&G->f, G->r_eax);
- x86_and (&G->f, G->r_edx, G->r_eax);
+ x87_fld(&G->f, x86_make_disp(G->r_esp, a->param[0] + 4 + i * 4));
+ x87_fcomp(&G->f, x86_make_disp(G->r_esp, a->param[1] + 4 + i * 4));
+ x87_fnstsw(&G->f, G->r_eax);
+ x86_and(&G->f, G->r_edx, G->r_eax);
}
/* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
- x86_test (&G->f, G->r_edx, G->r_ecx);
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000);
+ x86_test(&G->f, G->r_edx, G->r_ecx);
{
GLubyte *lab0, *lab1;
/* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
/* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
}
break;
default:
- assert (0);
+ _mesa_problem(NULL, "Unexpected switch case in codegen_assem");
}
}
-GLboolean _slang_x86_codegen (slang_machine *mach, slang_assembly_file *file, GLuint start)
+GLboolean
+_slang_x86_codegen(slang_machine * mach, slang_assembly_file * file,
+ GLuint start)
{
- codegen_ctx G;
- GLubyte *j_body, *j_exit;
- GLuint i;
+ codegen_ctx G;
+ GLubyte *j_body, *j_exit;
+ GLuint i;
/* Free the old code - if any.
*/
if (mach->x86.compiled_func != NULL) {
- _mesa_exec_free (mach->x86.compiled_func);
+ _mesa_exec_free(mach->x86.compiled_func);
mach->x86.compiled_func = NULL;
}
- /*
- * We need as much as 1M because *all* assembly, including built-in library, is
- * being translated to x86.
- * The built-in library occupies 450K, so we can be safe for now.
- * It is going to change in the future, when we get assembly analysis running.
- */
- x86_init_func_size (&G.f, 1048576);
- G.r_eax = x86_make_reg (file_REG32, reg_AX);
- G.r_ecx = x86_make_reg (file_REG32, reg_CX);
- G.r_edx = x86_make_reg (file_REG32, reg_DX);
- G.r_ebx = x86_make_reg (file_REG32, reg_BX);
- G.r_esp = x86_make_reg (file_REG32, reg_SP);
- G.r_ebp = x86_make_reg (file_REG32, reg_BP);
- G.r_st0 = x86_make_reg (file_x87, 0);
- G.r_st1 = x86_make_reg (file_x87, 1);
- G.r_st2 = x86_make_reg (file_x87, 2);
- G.r_st3 = x86_make_reg (file_x87, 3);
- G.r_st4 = x86_make_reg (file_x87, 4);
- G.fixups = NULL;
- G.fixup_count = 0;
- G.labels = (GLubyte **) slang_alloc_malloc (file->count * sizeof (GLubyte *));
- G.mach = mach;
- G.fpucntl = RESTORE_FPU;
-
- mach->x86.fpucntl_rnd_neg = RND_NEG_FPU;
- mach->x86.fpucntl_restore = RESTORE_FPU;
-
- /* prepare stack and jump to start */
- x86_push (&G.f, G.r_ebp);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
- x86_push (&G.f, G.r_esp);
- x86_pop (&G.f, G.r_ecx);
- x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
- j_body = x86_jmp_forward (&G.f);
-
- /* "discard" instructions jump to this label */
- G.l_discard = x86_get_label (&G.f);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->kill);
- x86_mov_reg_imm (&G.f, G.r_ecx, 1);
- x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
- G.l_exit = x86_get_label (&G.f);
- j_exit = x86_jmp_forward (&G.f);
-
- for (i = 0; i < file->count; i++)
- {
- G.labels[i] = x86_get_label (&G.f);
- if (i == start)
- x86_fixup_fwd_jump (&G.f, j_body);
- codegen_assem (&G, &file->code[i], &mach->infolog);
- }
-
- /*
- * Restore stack and return.
- * This must be handled this way, because "discard" can be invoked from any
- * place in the code.
- */
- x86_fixup_fwd_jump (&G.f, j_exit);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
- x86_mov (&G.f, G.r_esp, x86_deref (G.r_eax));
- x86_pop (&G.f, G.r_ebp);
- if (G.fpucntl != RESTORE_FPU)
- {
- x87_fnclex (&G.f);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->x86.fpucntl_restore);
- x87_fldcw (&G.f, x86_deref (G.r_eax));
- }
- x86_ret (&G.f);
-
- /* fixup forward labels */
- for (i = 0; i < G.fixup_count; i++)
- {
- G.f.csr = G.labels[G.fixups[i].index];
- x86_fixup_fwd_jump (&G.f, G.fixups[i].csr);
- }
-
- slang_alloc_free (G.fixups);
- slang_alloc_free (G.labels);
-
- /* install new code */
- mach->x86.compiled_func = (GLvoid (*) (slang_machine *)) x86_get_func (&G.f);
-
- return GL_TRUE;
+ /*
+ * We need as much as 1M because *all* assembly, including built-in library, is
+ * being translated to x86.
+ * The built-in library occupies 450K, so we can be safe for now.
+ * It is going to change in the future, when we get assembly analysis running.
+ */
+ x86_init_func_size(&G.f, 1048576);
+ G.r_eax = x86_make_reg(file_REG32, reg_AX);
+ G.r_ecx = x86_make_reg(file_REG32, reg_CX);
+ G.r_edx = x86_make_reg(file_REG32, reg_DX);
+ G.r_ebx = x86_make_reg(file_REG32, reg_BX);
+ G.r_esp = x86_make_reg(file_REG32, reg_SP);
+ G.r_ebp = x86_make_reg(file_REG32, reg_BP);
+ G.r_st0 = x86_make_reg(file_x87, 0);
+ G.r_st1 = x86_make_reg(file_x87, 1);
+ G.r_st2 = x86_make_reg(file_x87, 2);
+ G.r_st3 = x86_make_reg(file_x87, 3);
+ G.r_st4 = x86_make_reg(file_x87, 4);
+ G.fixups = NULL;
+ G.fixup_count = 0;
+ G.labels =
+ (GLubyte **) slang_alloc_malloc(file->count * sizeof(GLubyte *));
+ G.mach = mach;
+ G.fpucntl = RESTORE_FPU;
+
+ mach->x86.fpucntl_rnd_neg = RND_NEG_FPU;
+ mach->x86.fpucntl_restore = RESTORE_FPU;
+
+ /* prepare stack and jump to start */
+ x86_push(&G.f, G.r_ebp);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & mach->x86.esp_restore);
+ x86_push(&G.f, G.r_esp);
+ x86_pop(&G.f, G.r_ecx);
+ x86_mov(&G.f, x86_deref(G.r_eax), G.r_ecx);
+ j_body = x86_jmp_forward(&G.f);
+
+ /* "discard" instructions jump to this label */
+ G.l_discard = x86_get_label(&G.f);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & G.mach->kill);
+ x86_mov_reg_imm(&G.f, G.r_ecx, 1);
+ x86_mov(&G.f, x86_deref(G.r_eax), G.r_ecx);
+ G.l_exit = x86_get_label(&G.f);
+ j_exit = x86_jmp_forward(&G.f);
+
+ for (i = 0; i < file->count; i++) {
+ G.labels[i] = x86_get_label(&G.f);
+ if (i == start)
+ x86_fixup_fwd_jump(&G.f, j_body);
+ codegen_assem(&G, &file->code[i], &mach->infolog);
+ }
+
+ /*
+ * Restore stack and return.
+ * This must be handled this way, because "discard" can be invoked from any
+ * place in the code.
+ */
+ x86_fixup_fwd_jump(&G.f, j_exit);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & mach->x86.esp_restore);
+ x86_mov(&G.f, G.r_esp, x86_deref(G.r_eax));
+ x86_pop(&G.f, G.r_ebp);
+ if (G.fpucntl != RESTORE_FPU) {
+ x87_fnclex(&G.f);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & G.mach->x86.fpucntl_restore);
+ x87_fldcw(&G.f, x86_deref(G.r_eax));
+ }
+ x86_ret(&G.f);
+
+ /* fixup forward labels */
+ for (i = 0; i < G.fixup_count; i++) {
+ G.f.csr = G.labels[G.fixups[i].index];
+ x86_fixup_fwd_jump(&G.f, G.fixups[i].csr);
+ }
+
+ slang_alloc_free(G.fixups);
+ slang_alloc_free(G.labels);
+
+ /* install new code */
+ mach->x86.compiled_func = (GLvoid(*)(slang_machine *)) x86_get_func(&G.f);
+
+ return GL_TRUE;
}
#endif
-
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 66202edf8d0..6114b7c2520 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2006 Brian Paul All Rights Reserved.
*
@@ -32,774 +32,842 @@
#include "slang_link.h"
#include "slang_analyse.h"
-static GLboolean entry_has_gl_prefix (slang_atom name, slang_atom_pool *atoms)
+#define TABLE_GROW(PTR,TYPE,N) \
+ (PTR = (TYPE *) (slang_alloc_realloc (PTR, N * sizeof (TYPE), (N + 1) * sizeof (TYPE))))
+
+/*
+ * Check if a given name starts with "gl_". Globals with this prefix are
+ * treated differently, as they are built-in variables.
+ */
+static GLboolean
+entry_has_gl_prefix (slang_atom name, slang_atom_pool *atoms)
{
- const char *str = slang_atom_pool_id (atoms, name);
- return str[0] == 'g' && str[1] == 'l' && str[2] == '_';
+ const GLchar *str;
+
+ str = slang_atom_pool_id (atoms, name);
+ return str[0] == 'g' && str[1] == 'l' && str[2] == '_';
}
/*
* slang_active_variables
*/
-static GLvoid slang_active_variables_ctr (slang_active_variables *self)
+static GLvoid
+slang_active_variables_ctr (slang_active_variables *self)
{
- self->table = NULL;
- self->count = 0;
+ self->table = NULL;
+ self->count = 0;
}
-static GLvoid slang_active_variables_dtr (slang_active_variables *self)
+static GLvoid
+slang_active_variables_dtr (slang_active_variables *self)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < self->count; i++)
- slang_alloc_free (self->table[i].name);
- slang_alloc_free (self->table);
+ for (i = 0; i < self->count; i++)
+ slang_alloc_free (self->table[i].name);
+ slang_alloc_free (self->table);
}
-static GLboolean add_simple_variable (slang_active_variables *self, slang_export_data_quant *q,
- const char *name)
+/*
+ * Active variable queried by the application cannot be a structure. Queriable globals
+ * (uniforms and attributes) are decomposited into "simple" variables if they are
+ * "complex".
+ */
+
+static GLboolean
+add_simple_variable (slang_active_variables *self, slang_export_data_quant *q, const GLchar *name)
{
- const GLuint n = self->count;
+ GLuint n;
+ slang_active_variable *var;
- self->table = (slang_active_variable *) slang_alloc_realloc (self->table,
- n * sizeof (slang_active_variable), (n + 1) * sizeof (slang_active_variable));
- if (self->table == NULL)
- return GL_FALSE;
+ n = self->count;
+ if (!TABLE_GROW(self->table, slang_active_variable, n))
+ return GL_FALSE;
- self->table[n].quant = q;
- self->table[n].name = slang_string_duplicate (name);
- if (self->table[n].name == NULL)
- return GL_FALSE;
- self->count++;
+ /* Initialize the new element. Increment table size only when it is fully initilized. */
+ var = &self->table[n];
+ var->quant = q;
+ var->name = slang_string_duplicate (name);
+ if (var->name == NULL)
+ return GL_FALSE;
+ self->count++;
- return GL_TRUE;
+ return GL_TRUE;
}
-static GLboolean add_complex_variable (slang_active_variables *self, slang_export_data_quant *q,
- char *name, slang_atom_pool *atoms)
+static GLboolean
+add_complex_variable (slang_active_variables *self, slang_export_data_quant *q, GLchar *name,
+ slang_atom_pool *atoms)
{
- slang_string_concat (name, slang_atom_pool_id (atoms, q->name));
- if (slang_export_data_quant_array (q))
- slang_string_concat (name, "[0]");
+ slang_string_concat (name, slang_atom_pool_id (atoms, q->name));
- if (slang_export_data_quant_struct (q))
- {
- GLuint dot_pos, i;
- const GLuint fields = slang_export_data_quant_fields (q);
+ /* If array, add only first element. */
+ if (slang_export_data_quant_array (q))
+ slang_string_concat (name, "[0]");
- slang_string_concat (name, ".");
- dot_pos = slang_string_length (name);
+ if (slang_export_data_quant_struct (q)) {
+ GLuint field_pos, fields, i;
- for (i = 0; i < fields; i++)
- {
- if (!add_complex_variable (self, &q->structure[i], name, atoms))
- return GL_FALSE;
+ slang_string_concat (name, ".");
+ field_pos = slang_string_length (name);
- name[dot_pos] = '\0';
- }
+ /* Break it down into individual fields. */
+ fields = slang_export_data_quant_fields (q);
+ for (i = 0; i < fields; i++) {
+ if (!add_complex_variable (self, &q->structure[i], name, atoms))
+ return GL_FALSE;
+ name[field_pos] = '\0';
+ }
- return GL_TRUE;
- }
+ return GL_TRUE;
+ }
- return add_simple_variable (self, q, name);
+ return add_simple_variable (self, q, name);
}
-static GLboolean gather_active_variables (slang_active_variables *self,
- slang_export_data_table *tbl, slang_export_data_access access)
+/*
+ * Search a list of global variables with a given access (either attribute or uniform)
+ * and add it to the list of active variables.
+ */
+static GLboolean
+gather_active_variables (slang_active_variables *self, slang_export_data_table *tbl,
+ slang_export_data_access access)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < tbl->count; i++)
- if (tbl->entries[i].access == access)
- {
- char name[1024] = "";
+ for (i = 0; i < tbl->count; i++) {
+ if (tbl->entries[i].access == access) {
+ GLchar name[1024] = "";
- if (!add_complex_variable (self, &tbl->entries[i].quant, name, tbl->atoms))
- return GL_FALSE;
- }
+ if (!add_complex_variable (self, &tbl->entries[i].quant, name, tbl->atoms))
+ return GL_FALSE;
+ }
+ }
- return GL_TRUE;
+ return GL_TRUE;
}
/*
* slang_attrib_overrides
*/
-static GLvoid slang_attrib_overrides_ctr (slang_attrib_overrides *self)
+static GLvoid
+slang_attrib_overrides_ctr (slang_attrib_overrides *self)
{
- self->table = NULL;
- self->count = 0;
+ self->table = NULL;
+ self->count = 0;
}
-static GLvoid slang_attrib_overrides_dtr (slang_attrib_overrides *self)
+static GLvoid
+slang_attrib_overrides_dtr (slang_attrib_overrides *self)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < self->count; i++)
- slang_alloc_free (self->table[i].name);
- slang_alloc_free (self->table);
+ for (i = 0; i < self->count; i++)
+ slang_alloc_free (self->table[i].name);
+ slang_alloc_free (self->table);
}
-GLboolean slang_attrib_overrides_add (slang_attrib_overrides *self, GLuint index, const GLchar *name)
+static slang_attrib_override *
+lookup_attrib_override (slang_attrib_overrides *self, const GLchar *name)
{
- const GLuint n = self->count;
- GLuint i;
+ GLuint n, i;
- for (i = 0; i < n; i++)
- if (slang_string_compare (name, self->table[i].name) == 0)
- {
- self->table[i].index = index;
- return GL_TRUE;
- }
+ n = self->count;
+ for (i = 0; i < n; i++) {
+ if (slang_string_compare (name, self->table[i].name) == 0)
+ return &self->table[i];
+ }
+ return NULL;
+}
- self->table = (slang_attrib_override *) slang_alloc_realloc (self->table,
- n * sizeof (slang_attrib_override), (n + 1) * sizeof (slang_attrib_override));
- if (self->table == NULL)
- return GL_FALSE;
+GLboolean
+_slang_attrib_overrides_add (slang_attrib_overrides *self, GLuint index, const GLchar *name)
+{
+ slang_attrib_override *ovr;
+ GLuint n;
- self->table[n].index = index;
- self->table[n].name = slang_string_duplicate (name);
- if (self->table[n].name == NULL)
- return GL_FALSE;
- self->count++;
+ /* Attribs can be overriden multiple times. Look-up the table and replace
+ * its index if it is found. */
+ ovr = lookup_attrib_override (self, name);
+ if (ovr != NULL) {
+ ovr->index = index;
+ return GL_TRUE;
+ }
- return GL_TRUE;
-}
+ n = self->count;
+ if (!TABLE_GROW(self->table, slang_attrib_override, n))
+ return GL_FALSE;
-static GLuint lookup_attrib_override (slang_attrib_overrides *self, const GLchar *name)
-{
- GLuint i;
+ /* Initialize the new element. Increment table size only when it is fully initilized. */
+ ovr = &self->table[n];
+ ovr->index = index;
+ ovr->name = slang_string_duplicate (name);
+ if (ovr->name == NULL)
+ return GL_FALSE;
+ self->count++;
- for (i = 0; i < self->count; i++)
- if (slang_string_compare (name, self->table[i].name) == 0)
- return self->table[i].index;
- return MAX_VERTEX_ATTRIBS;
+ return GL_TRUE;
}
/*
* slang_uniform_bindings
*/
-static GLvoid slang_uniform_bindings_ctr (slang_uniform_bindings *self)
+static GLvoid
+slang_uniform_bindings_ctr (slang_uniform_bindings *self)
{
- self->table = NULL;
- self->count = 0;
+ self->table = NULL;
+ self->count = 0;
}
-static GLvoid slang_uniform_bindings_dtr (slang_uniform_bindings *self)
+static GLvoid
+slang_uniform_bindings_dtr (slang_uniform_bindings *self)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < self->count; i++)
- slang_alloc_free (self->table[i].name);
- slang_alloc_free (self->table);
+ for (i = 0; i < self->count; i++)
+ slang_alloc_free (self->table[i].name);
+ slang_alloc_free (self->table);
}
-static GLboolean add_simple_uniform_binding (slang_uniform_bindings *self,
- slang_export_data_quant *q, const char *name, GLuint index, GLuint addr)
-{
- const GLuint n = self->count;
- GLuint i;
-
- for (i = 0; i < n; i++)
- if (slang_string_compare (self->table[i].name, name) == 0)
- {
- self->table[i].address[index] = addr;
- return GL_TRUE;
- }
+static GLboolean
+add_simple_uniform_binding (slang_uniform_bindings *self, slang_export_data_quant *q,
+ const GLchar *name, GLuint index, GLuint addr)
+{
+ GLuint n, i;
+ slang_uniform_binding *bind;
+
+ /* Uniform binding table is shared between vertex and fragment shaders. If the same uniform
+ * is declared both in a vertex and fragment shader, only one uniform entry is maintained.
+ * When add a uniform binding there can be an entry already allocated for it by the other
+ * shader. */
+ n = self->count;
+ for (i = 0; i < n; i++) {
+ if (slang_string_compare (self->table[i].name, name) == 0) {
+ self->table[i].address[index] = addr;
+ return GL_TRUE;
+ }
+ }
- self->table = (slang_uniform_binding *) slang_alloc_realloc (self->table,
- n * sizeof (slang_uniform_binding), (n + 1) * sizeof (slang_uniform_binding));
- if (self->table == NULL)
- return GL_FALSE;
+ if (!TABLE_GROW(self->table, slang_uniform_binding, n))
+ return GL_FALSE;
- self->table[n].quant = q;
- self->table[n].name = slang_string_duplicate (name);
- if (self->table[n].name == NULL)
- return GL_FALSE;
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- self->table[n].address[i] = ~0;
- self->table[n].address[index] = addr;
- self->count++;
+ /* Initialize the new element. Increment table size only when it is fully initilized. */
+ bind = &self->table[n];
+ bind->quant = q;
+ bind->name = slang_string_duplicate (name);
+ if (bind->name == NULL)
+ return GL_FALSE;
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ bind->address[i] = ~0;
+ bind->address[index] = addr;
+ self->count++;
- return GL_TRUE;
+ return GL_TRUE;
}
-static GLboolean add_complex_uniform_binding (slang_uniform_bindings *self,
- slang_export_data_quant *q, char *name, slang_atom_pool *atoms, GLuint index, GLuint addr)
+static GLboolean
+add_complex_uniform_binding (slang_uniform_bindings *self, slang_export_data_quant *q,
+ GLchar *name, slang_atom_pool *atoms, GLuint index, GLuint addr)
{
- GLuint count, i;
+ GLuint count, i;
+
+ slang_string_concat (name, slang_atom_pool_id (atoms, q->name));
+ count = slang_export_data_quant_elements (q);
- slang_string_concat (name, slang_atom_pool_id (atoms, q->name));
- count = slang_export_data_quant_elements (q);
- for (i = 0; i < count; i++)
- {
- GLuint bracket_pos;
+ /* If array, add binding for every array element. */
+ for (i = 0; i < count; i++) {
+ GLuint bracket_pos;
- bracket_pos = slang_string_length (name);
- if (slang_export_data_quant_array (q))
- _mesa_sprintf (name + slang_string_length (name), "[%d]", i);
+ bracket_pos = slang_string_length (name);
+ if (slang_export_data_quant_array (q))
+ _mesa_sprintf (&name[slang_string_length (name)], "[%d]", i);
- if (slang_export_data_quant_struct (q))
- {
- GLuint dot_pos, i;
- const GLuint fields = slang_export_data_quant_fields (q);
+ if (slang_export_data_quant_struct (q)) {
+ GLuint field_pos, fields, i;
- slang_string_concat (name, ".");
- dot_pos = slang_string_length (name);
+ slang_string_concat (name, ".");
+ field_pos = slang_string_length (name);
- for (i = 0; i < fields; i++)
- {
- if (!add_complex_uniform_binding (self, &q->structure[i], name, atoms, index, addr))
- return GL_FALSE;
+ /* Break it down into individual fields. */
+ fields = slang_export_data_quant_fields (q);
+ for (i = 0; i < fields; i++) {
+ if (!add_complex_uniform_binding (self, &q->structure[i], name, atoms, index, addr))
+ return GL_FALSE;
- name[dot_pos] = '\0';
- addr += slang_export_data_quant_size (&q->structure[i]);
- }
- }
- else
- {
- if (!add_simple_uniform_binding (self, q, name, index, addr))
- return GL_FALSE;
+ name[field_pos] = '\0';
+ addr += slang_export_data_quant_size (&q->structure[i]);
+ }
+ }
+ else {
+ if (!add_simple_uniform_binding (self, q, name, index, addr))
+ return GL_FALSE;
- addr += slang_export_data_quant_size (q);
- }
+ addr += slang_export_data_quant_size (q);
+ }
- name[bracket_pos] = '\0';
- }
+ name[bracket_pos] = '\0';
+ }
- return GL_TRUE;
+ return GL_TRUE;
}
-static GLboolean gather_uniform_bindings (slang_uniform_bindings *self,
- slang_export_data_table *tbl, GLuint index)
+static GLboolean
+gather_uniform_bindings (slang_uniform_bindings *self, slang_export_data_table *tbl, GLuint index)
{
- GLuint i;
+ GLuint n, i;
- for (i = 0; i < tbl->count; i++)
- if (tbl->entries[i].access == slang_exp_uniform)
- {
- char name[1024] = "";
+ n = tbl->count;
+ for (i = 0; i < n; i++) {
+ if (tbl->entries[i].access == slang_exp_uniform) {
+ GLchar name[1024] = "";
- if (!add_complex_uniform_binding (self, &tbl->entries[i].quant, name, tbl->atoms, index,
- tbl->entries[i].address))
- return GL_FALSE;
- }
+ if (!add_complex_uniform_binding (self, &tbl->entries[i].quant, name, tbl->atoms, index,
+ tbl->entries[i].address))
+ return GL_FALSE;
+ }
+ }
- return GL_TRUE;
+ return GL_TRUE;
}
/*
* slang_attrib_bindings
*/
-static GLvoid slang_attrib_bindings_ctr (slang_attrib_bindings *self)
+static GLvoid
+slang_attrib_bindings_ctr (slang_attrib_bindings *self)
{
- GLuint i;
+ GLuint i;
- self->binding_count = 0;
- for (i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- self->slots[i].addr = ~0;
+ self->binding_count = 0;
+ for (i = 0; i < MAX_VERTEX_ATTRIBS; i++)
+ self->slots[i].addr = ~0;
}
-static GLvoid slang_attrib_bindings_dtr (slang_attrib_bindings *self)
+static GLvoid
+slang_attrib_bindings_dtr (slang_attrib_bindings *self)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < self->binding_count; i++)
- slang_alloc_free (self->bindings[i].name);
+ for (i = 0; i < self->binding_count; i++)
+ slang_alloc_free (self->bindings[i].name);
}
/*
* NOTE: If conventional vertex attribute gl_Vertex is used, application cannot use
* vertex attrib index 0 for binding override. Currently this is not checked.
- * Although attrib index 0 is not used when not explicitly asked.
+ * Anyways, attrib index 0 is not used when not explicitly asked.
*/
-static GLuint can_allocate_attrib_slots (slang_attrib_bindings *self, GLuint index, GLuint count)
+static GLuint
+can_allocate_attrib_slots (slang_attrib_bindings *self, GLuint index, GLuint count)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < count; i++)
- if (self->slots[index + i].addr != ~0)
- break;
- return i;
+ for (i = 0; i < count; i++) {
+ if (self->slots[index + i].addr != ~0)
+ break;
+ }
+ return i;
}
-static GLuint allocate_attrib_slots (slang_attrib_bindings *self, GLuint count)
+static GLuint
+allocate_attrib_slots (slang_attrib_bindings *self, GLuint count)
{
- GLuint i;
+ GLuint i;
+
+ /* Start with attrib index 1. Index 0 will be used when explicitly
+ * asked by application binding. */
+ for (i = 1; i <= MAX_VERTEX_ATTRIBS - count; i++) {
+ GLuint size;
- for (i = 1; i <= MAX_VERTEX_ATTRIBS - count; i++)
- {
- GLuint size;
-
- size = can_allocate_attrib_slots (self, i, count);
- if (size == count)
- return i;
+ size = can_allocate_attrib_slots (self, i, count);
+ if (size == count)
+ return i;
- /* speed-up the search a bit */
+ /* Speed-up the search a bit. */
i += size;
- }
- return MAX_VERTEX_ATTRIBS;
+ }
+
+ return MAX_VERTEX_ATTRIBS;
}
static GLboolean
-add_attrib_binding (slang_attrib_bindings *self, slang_export_data_quant *q, const char *name,
+add_attrib_binding (slang_attrib_bindings *self, slang_export_data_quant *q, const GLchar *name,
GLuint addr, GLuint index_override)
{
- const GLuint n = self->binding_count;
- GLuint slot_span, slot_fill, slot_index;
- GLuint i;
+ GLuint slot_span, slot_fill, slot_index, i;
+ slang_attrib_binding *bind;
- assert (slang_export_data_quant_simple (q));
+ assert (slang_export_data_quant_simple (q));
- switch (slang_export_data_quant_type (q))
- {
- case GL_FLOAT:
+ switch (slang_export_data_quant_type (q)) {
+ case GL_FLOAT:
slot_span = 1;
slot_fill = 1;
break;
- case GL_FLOAT_VEC2:
+ case GL_FLOAT_VEC2:
slot_span = 1;
slot_fill = 2;
break;
- case GL_FLOAT_VEC3:
+ case GL_FLOAT_VEC3:
slot_span = 1;
slot_fill = 3;
break;
- case GL_FLOAT_VEC4:
- slot_span = 1;
+ case GL_FLOAT_VEC4:
+ slot_span = 1;
slot_fill = 4;
- break;
- case GL_FLOAT_MAT2:
- slot_span = 2;
+ break;
+ case GL_FLOAT_MAT2:
+ slot_span = 2;
slot_fill = 2;
- break;
- case GL_FLOAT_MAT3:
- slot_span = 3;
+ break;
+ case GL_FLOAT_MAT3:
+ slot_span = 3;
slot_fill = 3;
- break;
- case GL_FLOAT_MAT4:
- slot_span = 4;
+ break;
+ case GL_FLOAT_MAT4:
+ slot_span = 4;
slot_fill = 4;
- break;
- default:
- assert (0);
- }
-
- if (index_override == MAX_VERTEX_ATTRIBS)
- slot_index = allocate_attrib_slots (self, slot_span);
- else if (can_allocate_attrib_slots (self, index_override, slot_span) == slot_span)
- slot_index = index_override;
- else
- slot_index = MAX_VERTEX_ATTRIBS;
-
- if (slot_index == MAX_VERTEX_ATTRIBS)
- {
- /* TODO: info log: error: MAX_VERTEX_ATTRIBS exceeded */
- return GL_FALSE;
- }
-
- self->bindings[n].quant = q;
- self->bindings[n].name = slang_string_duplicate (name);
- if (self->bindings[n].name == NULL)
- return GL_FALSE;
- self->bindings[n].first_slot_index = slot_index;
- self->binding_count++;
+ break;
+ default:
+ assert (0);
+ }
+
+ if (index_override == MAX_VERTEX_ATTRIBS)
+ slot_index = allocate_attrib_slots (self, slot_span);
+ else if (can_allocate_attrib_slots (self, index_override, slot_span) == slot_span)
+ slot_index = index_override;
+ else
+ slot_index = MAX_VERTEX_ATTRIBS;
+
+ if (slot_index == MAX_VERTEX_ATTRIBS) {
+ /* TODO: info log: error: MAX_VERTEX_ATTRIBS exceeded */
+ return GL_FALSE;
+ }
+
+ /* Initialize the new element. Increment table size only when it is fully initilized. */
+ bind = &self->bindings[self->binding_count];
+ bind->quant = q;
+ bind->name = slang_string_duplicate (name);
+ if (bind->name == NULL)
+ return GL_FALSE;
+ bind->first_slot_index = slot_index;
+ self->binding_count++;
for (i = 0; i < slot_span; i++) {
- slang_attrib_slot *slot = &self->slots[self->bindings[n].first_slot_index + i];
+ slang_attrib_slot *slot;
+
+ slot = &self->slots[bind->first_slot_index + i];
slot->addr = addr + i * slot_fill * 4;
slot->fill = slot_fill;
}
- return GL_TRUE;
+ return GL_TRUE;
}
-static GLboolean gather_attrib_bindings (slang_attrib_bindings *self, slang_export_data_table *tbl,
- slang_attrib_overrides *ovr)
-{
- GLuint i;
-
- /* First pass. Gather attribs that have overriden index slots. */
- for (i = 0; i < tbl->count; i++)
- if (tbl->entries[i].access == slang_exp_attribute &&
- !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms))
- {
- slang_export_data_quant *quant = &tbl->entries[i].quant;
- const GLchar *id = slang_atom_pool_id (tbl->atoms, quant->name);
- GLuint index = lookup_attrib_override (ovr, id);
-
- if (index != MAX_VERTEX_ATTRIBS)
- {
- if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, index))
- return GL_FALSE;
- }
- }
-
- /* Second pass. Gather attribs that have *NOT* overriden index slots. */
- for (i = 0; i < tbl->count; i++)
- if (tbl->entries[i].access == slang_exp_attribute &&
- !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms))
- {
- slang_export_data_quant *quant = &tbl->entries[i].quant;
- const GLchar *id = slang_atom_pool_id (tbl->atoms, quant->name);
- GLuint index = lookup_attrib_override (ovr, id);
+static GLboolean
+gather_attrib_bindings (slang_attrib_bindings *self, slang_export_data_table *tbl,
+ slang_attrib_overrides *ovr)
+{
+ GLuint i;
+
+ /* First pass. Gather attribs that have overriden index slots. */
+ for (i = 0; i < tbl->count; i++) {
+ if (tbl->entries[i].access == slang_exp_attribute &&
+ !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) {
+ slang_export_data_quant *quant;
+ const GLchar *id;
+ slang_attrib_override *ao;
+
+ quant = &tbl->entries[i].quant;
+ id = slang_atom_pool_id (tbl->atoms, quant->name);
+ ao = lookup_attrib_override (ovr, id);
+ if (ao != NULL) {
+ if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, ao->index))
+ return GL_FALSE;
+ }
+ }
+ }
- if (index == MAX_VERTEX_ATTRIBS)
- {
- if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, index))
- return GL_FALSE;
- }
- }
+ /* Second pass. Gather attribs that have not overriden index slots. */
+ for (i = 0; i < tbl->count; i++) {
+ if (tbl->entries[i].access == slang_exp_attribute &&
+ !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) {
+ slang_export_data_quant *quant;
+ const GLchar *id;
+ slang_attrib_override *ao;
+
+ quant = &tbl->entries[i].quant;
+ id = slang_atom_pool_id (tbl->atoms, quant->name);
+ ao = lookup_attrib_override (ovr, id);
+ if (ao == NULL) {
+ if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, ao->index))
+ return GL_FALSE;
+ }
+ }
+ }
- return GL_TRUE;
+ return GL_TRUE;
}
/*
* slang_varying_bindings
*/
-static GLvoid slang_varying_bindings_ctr (slang_varying_bindings *self)
+static GLvoid
+slang_varying_bindings_ctr (slang_varying_bindings *self)
{
- self->binding_count = 0;
- self->slot_count = 0;
+ self->binding_count = 0;
+ self->slot_count = 0;
}
-static GLvoid slang_varying_bindings_dtr (slang_varying_bindings *self)
+static GLvoid
+slang_varying_bindings_dtr (slang_varying_bindings *self)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < self->binding_count; i++)
- slang_alloc_free (self->bindings[i].name);
+ for (i = 0; i < self->binding_count; i++)
+ slang_alloc_free (self->bindings[i].name);
}
-static GLvoid update_varying_slots (slang_varying_slot *slots, GLuint count, GLboolean is_vert,
- GLuint addr, GLuint do_offset)
+static GLvoid
+update_varying_slots (slang_varying_slot *slots, GLuint count, GLboolean is_vert, GLuint addr,
+ GLuint do_offset)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < count; i++)
- *(is_vert ? &slots[i].vert_addr : &slots[i].frag_addr) = addr + i * 4 * do_offset;
+ for (i = 0; i < count; i++) {
+ if (is_vert)
+ slots[i].vert_addr = addr + i * 4 * do_offset;
+ else
+ slots[i].frag_addr = addr + i * 4 * do_offset;
+ }
}
-static GLboolean add_varying_binding (slang_varying_bindings *self,
- slang_export_data_quant *q, const char *name, GLboolean is_vert, GLuint addr)
-{
- const GLuint n = self->binding_count;
- const GLuint slot_span =
- slang_export_data_quant_components (q) * slang_export_data_quant_elements (q);
- GLuint i;
-
- for (i = 0; i < n; i++)
- if (slang_string_compare (self->bindings[i].name, name) == 0)
- {
- /* TODO: data quantities must match, or else link fails */
- update_varying_slots (&self->slots[self->bindings[i].first_slot_index], slot_span,
- is_vert, addr, 1);
- return GL_TRUE;
- }
+static GLboolean
+add_varying_binding (slang_varying_bindings *self, slang_export_data_quant *q, const GLchar *name,
+ GLboolean is_vert, GLuint addr)
+{
+ GLuint n, slot_span, i;
+ slang_varying_binding *bind;
+
+ n = self->binding_count;
+ slot_span = slang_export_data_quant_components (q) * slang_export_data_quant_elements (q);
+ for (i = 0; i < n; i++) {
+ if (slang_string_compare (self->bindings[i].name, name) == 0) {
+ /* TODO: data quantities must match, or else link fails */
+ update_varying_slots (&self->slots[self->bindings[i].first_slot_index], slot_span,
+ is_vert, addr, 1);
+ return GL_TRUE;
+ }
+ }
- if (self->slot_count + slot_span > MAX_VARYING_FLOATS)
- {
- /* TODO: info log: error: MAX_VARYING_FLOATS exceeded */
- return GL_FALSE;
- }
+ if (self->slot_count + slot_span > MAX_VARYING_FLOATS) {
+ /* TODO: info log: error: MAX_VARYING_FLOATS exceeded */
+ return GL_FALSE;
+ }
- self->bindings[n].quant = q;
- self->bindings[n].name = slang_string_duplicate (name);
- if (self->bindings[n].name == NULL)
- return GL_FALSE;
- self->bindings[n].first_slot_index = self->slot_count;
- self->binding_count++;
+ /* Initialize the new element. Increment table size only when it is fully initilized. */
+ bind = &self->bindings[n];
+ bind->quant = q;
+ bind->name = slang_string_duplicate (name);
+ if (bind->name == NULL)
+ return GL_FALSE;
+ bind->first_slot_index = self->slot_count;
+ self->binding_count++;
- update_varying_slots (&self->slots[self->bindings[n].first_slot_index], slot_span, is_vert,
- addr, 1);
- update_varying_slots (&self->slots[self->bindings[n].first_slot_index], slot_span, !is_vert,
- ~0, 0);
- self->slot_count += slot_span;
+ update_varying_slots (&self->slots[bind->first_slot_index], slot_span, is_vert, addr, 1);
+ update_varying_slots (&self->slots[bind->first_slot_index], slot_span, !is_vert, ~0, 0);
+ self->slot_count += slot_span;
- return GL_TRUE;
+ return GL_TRUE;
}
-static GLboolean gather_varying_bindings (slang_varying_bindings *self,
- slang_export_data_table *tbl, GLboolean is_vert)
-{
- GLuint i;
-
- for (i = 0; i < tbl->count; i++)
- if (tbl->entries[i].access == slang_exp_varying &&
- !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms))
- {
- if (!add_varying_binding (self, &tbl->entries[i].quant, slang_atom_pool_id (tbl->atoms,
- tbl->entries[i].quant.name), is_vert, tbl->entries[i].address))
- return GL_FALSE;
- }
+static GLboolean
+gather_varying_bindings (slang_varying_bindings *self, slang_export_data_table *tbl,
+ GLboolean is_vert)
+{
+ GLuint i;
+
+ for (i = 0; i < tbl->count; i++) {
+ if (tbl->entries[i].access == slang_exp_varying &&
+ !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) {
+ if (!add_varying_binding (self, &tbl->entries[i].quant,
+ slang_atom_pool_id (tbl->atoms, tbl->entries[i].quant.name),
+ is_vert, tbl->entries[i].address))
+ return GL_FALSE;
+ }
+ }
- return GL_TRUE;
+ return GL_TRUE;
}
/*
* slang_texture_bindings
*/
-GLvoid slang_texture_usages_ctr (slang_texture_usages *self)
+GLvoid
+_slang_texture_usages_ctr (slang_texture_usages *self)
{
- self->table = NULL;
- self->count = 0;
+ self->table = NULL;
+ self->count = 0;
}
-GLvoid slang_texture_usages_dtr (slang_texture_usages *self)
+GLvoid
+_slang_texture_usages_dtr (slang_texture_usages *self)
{
- slang_alloc_free (self->table);
+ slang_alloc_free (self->table);
}
/*
* slang_program
*/
-GLvoid slang_program_ctr (slang_program *self)
-{
- GLuint i;
-
- slang_active_variables_ctr (&self->active_uniforms);
- slang_active_variables_ctr (&self->active_attribs);
- slang_attrib_overrides_ctr (&self->attrib_overrides);
- slang_uniform_bindings_ctr (&self->uniforms);
- slang_attrib_bindings_ctr (&self->attribs);
- slang_varying_bindings_ctr (&self->varyings);
- slang_texture_usages_ctr (&self->texture_usage);
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- {
- GLuint j;
-
- for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++)
- self->common_fixed_entries[i][j] = ~0;
- for (j = 0; j < SLANG_COMMON_CODE_MAX; j++)
- self->code[i][j] = ~0;
- self->machines[i] = NULL;
- self->assemblies[i] = NULL;
- }
- for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++)
- self->vertex_fixed_entries[i] = ~0;
- for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++)
- self->fragment_fixed_entries[i] = ~0;
-}
-
-GLvoid slang_program_dtr (slang_program *self)
-{
- slang_active_variables_dtr (&self->active_uniforms);
- slang_active_variables_dtr (&self->active_attribs);
- slang_attrib_overrides_dtr (&self->attrib_overrides);
- slang_uniform_bindings_dtr (&self->uniforms);
- slang_attrib_bindings_dtr (&self->attribs);
- slang_varying_bindings_dtr (&self->varyings);
- slang_texture_usages_dtr (&self->texture_usage);
-}
-
-GLvoid slang_program_rst (slang_program *self)
-{
- GLuint i;
-
- slang_active_variables_dtr (&self->active_uniforms);
- slang_active_variables_dtr (&self->active_attribs);
- slang_uniform_bindings_dtr (&self->uniforms);
- slang_attrib_bindings_dtr (&self->attribs);
- slang_varying_bindings_dtr (&self->varyings);
- slang_texture_usages_dtr (&self->texture_usage);
-
- slang_active_variables_ctr (&self->active_uniforms);
- slang_active_variables_ctr (&self->active_attribs);
- slang_uniform_bindings_ctr (&self->uniforms);
- slang_attrib_bindings_ctr (&self->attribs);
- slang_varying_bindings_ctr (&self->varyings);
- slang_texture_usages_ctr (&self->texture_usage);
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- {
- GLuint j;
-
- for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++)
- self->common_fixed_entries[i][j] = ~0;
- for (j = 0; j < SLANG_COMMON_CODE_MAX; j++)
- self->code[i][j] = ~0;
- }
- for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++)
- self->vertex_fixed_entries[i] = ~0;
- for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++)
- self->fragment_fixed_entries[i] = ~0;
+GLvoid
+_slang_program_ctr (slang_program *self)
+{
+ GLuint i;
+
+ slang_active_variables_ctr (&self->active_uniforms);
+ slang_active_variables_ctr (&self->active_attribs);
+ slang_attrib_overrides_ctr (&self->attrib_overrides);
+ slang_uniform_bindings_ctr (&self->uniforms);
+ slang_attrib_bindings_ctr (&self->attribs);
+ slang_varying_bindings_ctr (&self->varyings);
+ _slang_texture_usages_ctr (&self->texture_usage);
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ GLuint j;
+
+ for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++)
+ self->common_fixed_entries[i][j] = ~0;
+ for (j = 0; j < SLANG_COMMON_CODE_MAX; j++)
+ self->code[i][j] = ~0;
+ self->machines[i] = NULL;
+ self->assemblies[i] = NULL;
+ }
+ for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++)
+ self->vertex_fixed_entries[i] = ~0;
+ for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++)
+ self->fragment_fixed_entries[i] = ~0;
+}
+
+GLvoid
+_slang_program_dtr (slang_program *self)
+{
+ slang_active_variables_dtr (&self->active_uniforms);
+ slang_active_variables_dtr (&self->active_attribs);
+ slang_attrib_overrides_dtr (&self->attrib_overrides);
+ slang_uniform_bindings_dtr (&self->uniforms);
+ slang_attrib_bindings_dtr (&self->attribs);
+ slang_varying_bindings_dtr (&self->varyings);
+ _slang_texture_usages_dtr (&self->texture_usage);
+}
+
+GLvoid
+_slang_program_rst (slang_program *self)
+{
+ GLuint i;
+
+ slang_active_variables_dtr (&self->active_uniforms);
+ slang_active_variables_dtr (&self->active_attribs);
+ slang_uniform_bindings_dtr (&self->uniforms);
+ slang_attrib_bindings_dtr (&self->attribs);
+ slang_varying_bindings_dtr (&self->varyings);
+ _slang_texture_usages_dtr (&self->texture_usage);
+
+ slang_active_variables_ctr (&self->active_uniforms);
+ slang_active_variables_ctr (&self->active_attribs);
+ slang_uniform_bindings_ctr (&self->uniforms);
+ slang_attrib_bindings_ctr (&self->attribs);
+ slang_varying_bindings_ctr (&self->varyings);
+ _slang_texture_usages_ctr (&self->texture_usage);
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ GLuint j;
+
+ for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++)
+ self->common_fixed_entries[i][j] = ~0;
+ for (j = 0; j < SLANG_COMMON_CODE_MAX; j++)
+ self->code[i][j] = ~0;
+ }
+ for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++)
+ self->vertex_fixed_entries[i] = ~0;
+ for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++)
+ self->fragment_fixed_entries[i] = ~0;
}
/*
* _slang_link()
*/
-static GLuint gd (slang_export_data_table *tbl, const char *name)
-{
- slang_atom atom;
- GLuint i;
-
- atom = slang_atom_pool_atom (tbl->atoms, name);
- if (atom == SLANG_ATOM_NULL)
- return ~0;
-
- for (i = 0; i < tbl->count; i++)
- if (atom == tbl->entries[i].quant.name)
- return tbl->entries[i].address;
- return ~0;
-}
-
-static GLvoid resolve_common_fixed (GLuint e[], slang_export_data_table *tbl)
-{
- e[SLANG_COMMON_FIXED_MODELVIEWMATRIX] = gd (tbl, "gl_ModelViewMatrix");
- e[SLANG_COMMON_FIXED_PROJECTIONMATRIX] = gd (tbl, "gl_ProjectionMatrix");
- e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX] = gd (tbl, "gl_ModelViewProjectionMatrix");
- e[SLANG_COMMON_FIXED_TEXTUREMATRIX] = gd (tbl, "gl_TextureMatrix");
- e[SLANG_COMMON_FIXED_NORMALMATRIX] = gd (tbl, "gl_NormalMatrix");
- e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE] = gd (tbl, "gl_ModelViewMatrixInverse");
- e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE] = gd (tbl, "gl_ProjectionMatrixInverse");
- e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE] =
- gd (tbl, "gl_ModelViewProjectionMatrixInverse");
- e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE] = gd (tbl, "gl_TextureMatrixInverse");
- e[SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE] = gd (tbl, "gl_ModelViewMatrixTranspose");
- e[SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE] = gd (tbl, "gl_ProjectionMatrixTranspose");
- e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE] =
- gd (tbl, "gl_ModelViewProjectionMatrixTranspose");
- e[SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE] = gd (tbl, "gl_TextureMatrixTranspose");
- e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE] =
- gd (tbl, "gl_ModelViewMatrixInverseTranspose");
- e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE] =
- gd (tbl, "gl_ProjectionMatrixInverseTranspose");
- e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE] =
- gd (tbl, "gl_ModelViewProjectionMatrixInverseTranspose");
- e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE] =
- gd (tbl, "gl_TextureMatrixInverseTranspose");
- e[SLANG_COMMON_FIXED_NORMALSCALE] = gd (tbl, "gl_NormalScale");
- e[SLANG_COMMON_FIXED_DEPTHRANGE] = gd (tbl, "gl_DepthRange");
- e[SLANG_COMMON_FIXED_CLIPPLANE] = gd (tbl, "gl_ClipPlane");
- e[SLANG_COMMON_FIXED_POINT] = gd (tbl, "gl_Point");
- e[SLANG_COMMON_FIXED_FRONTMATERIAL] = gd (tbl, "gl_FrontMaterial");
- e[SLANG_COMMON_FIXED_BACKMATERIAL] = gd (tbl, "gl_BackMaterial");
- e[SLANG_COMMON_FIXED_LIGHTSOURCE] = gd (tbl, "gl_LightSource");
- e[SLANG_COMMON_FIXED_LIGHTMODEL] = gd (tbl, "gl_LightModel");
- e[SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT] = gd (tbl, "gl_FrontLightModelProduct");
- e[SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT] = gd (tbl, "gl_BackLightModelProduct");
- e[SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT] = gd (tbl, "gl_FrontLightProduct");
- e[SLANG_COMMON_FIXED_BACKLIGHTPRODUCT] = gd (tbl, "gl_BackLightProduct");
- e[SLANG_COMMON_FIXED_TEXTUREENVCOLOR] = gd (tbl, "gl_TextureEnvColor");
- e[SLANG_COMMON_FIXED_EYEPLANES] = gd (tbl, "gl_EyePlaneS");
- e[SLANG_COMMON_FIXED_EYEPLANET] = gd (tbl, "gl_EyePlaneT");
- e[SLANG_COMMON_FIXED_EYEPLANER] = gd (tbl, "gl_EyePlaneR");
- e[SLANG_COMMON_FIXED_EYEPLANEQ] = gd (tbl, "gl_EyePlaneQ");
- e[SLANG_COMMON_FIXED_OBJECTPLANES] = gd (tbl, "gl_ObjectPlaneS");
- e[SLANG_COMMON_FIXED_OBJECTPLANET] = gd (tbl, "gl_ObjectPlaneT");
- e[SLANG_COMMON_FIXED_OBJECTPLANER] = gd (tbl, "gl_ObjectPlaneR");
- e[SLANG_COMMON_FIXED_OBJECTPLANEQ] = gd (tbl, "gl_ObjectPlaneQ");
- e[SLANG_COMMON_FIXED_FOG] = gd (tbl, "gl_Fog");
-}
-
-static GLvoid resolve_vertex_fixed (GLuint e[], slang_export_data_table *tbl)
-{
- e[SLANG_VERTEX_FIXED_POSITION] = gd (tbl, "gl_Position");
- e[SLANG_VERTEX_FIXED_POINTSIZE] = gd (tbl, "gl_PointSize");
- e[SLANG_VERTEX_FIXED_CLIPVERTEX] = gd (tbl, "gl_ClipVertex");
- e[SLANG_VERTEX_FIXED_COLOR] = gd (tbl, "gl_Color");
- e[SLANG_VERTEX_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor");
- e[SLANG_VERTEX_FIXED_NORMAL] = gd (tbl, "gl_Normal");
- e[SLANG_VERTEX_FIXED_VERTEX] = gd (tbl, "gl_Vertex");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD0] = gd (tbl, "gl_MultiTexCoord0");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD1] = gd (tbl, "gl_MultiTexCoord1");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD2] = gd (tbl, "gl_MultiTexCoord2");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD3] = gd (tbl, "gl_MultiTexCoord3");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD4] = gd (tbl, "gl_MultiTexCoord4");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD5] = gd (tbl, "gl_MultiTexCoord5");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD6] = gd (tbl, "gl_MultiTexCoord6");
- e[SLANG_VERTEX_FIXED_MULTITEXCOORD7] = gd (tbl, "gl_MultiTexCoord7");
- e[SLANG_VERTEX_FIXED_FOGCOORD] = gd (tbl, "gl_FogCoord");
- e[SLANG_VERTEX_FIXED_FRONTCOLOR] = gd (tbl, "gl_FrontColor");
- e[SLANG_VERTEX_FIXED_BACKCOLOR] = gd (tbl, "gl_BackColor");
- e[SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR] = gd (tbl, "gl_FrontSecondaryColor");
- e[SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR] = gd (tbl, "gl_BackSecondaryColor");
- e[SLANG_VERTEX_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord");
- e[SLANG_VERTEX_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord");
-}
-
-static GLvoid resolve_fragment_fixed (GLuint e[], slang_export_data_table *tbl)
-{
- e[SLANG_FRAGMENT_FIXED_FRAGCOORD] = gd (tbl, "gl_FragCoord");
- e[SLANG_FRAGMENT_FIXED_FRONTFACING] = gd (tbl, "gl_FrontFacing");
- e[SLANG_FRAGMENT_FIXED_FRAGCOLOR] = gd (tbl, "gl_FragColor");
- e[SLANG_FRAGMENT_FIXED_FRAGDATA] = gd (tbl, "gl_FragData");
- e[SLANG_FRAGMENT_FIXED_FRAGDEPTH] = gd (tbl, "gl_FragDepth");
- e[SLANG_FRAGMENT_FIXED_COLOR] = gd (tbl, "gl_Color");
- e[SLANG_FRAGMENT_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor");
- e[SLANG_FRAGMENT_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord");
- e[SLANG_FRAGMENT_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord");
-}
-
-static GLuint gc (slang_export_code_table *tbl, const char *name)
-{
- slang_atom atom;
- GLuint i;
-
- atom = slang_atom_pool_atom (tbl->atoms, name);
- if (atom == SLANG_ATOM_NULL)
- return ~0;
-
- for (i = 0; i < tbl->count; i++)
- if (atom == tbl->entries[i].name)
- return tbl->entries[i].address;
- return ~0;
-}
-
-static GLvoid resolve_common_code (GLuint code[], slang_export_code_table *tbl)
-{
- code[SLANG_COMMON_CODE_MAIN] = gc (tbl, "@main");
+static GLuint
+gd (slang_export_data_table *tbl, const GLchar *name)
+{
+ slang_atom atom;
+ GLuint i;
+
+ atom = slang_atom_pool_atom (tbl->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return ~0;
+
+ for (i = 0; i < tbl->count; i++) {
+ if (atom == tbl->entries[i].quant.name)
+ return tbl->entries[i].address;
+ }
+ return ~0;
+}
+
+static GLvoid
+resolve_common_fixed (GLuint e[], slang_export_data_table *tbl)
+{
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIX] = gd (tbl, "gl_ModelViewMatrix");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIX] = gd (tbl, "gl_ProjectionMatrix");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX] = gd (tbl, "gl_ModelViewProjectionMatrix");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIX] = gd (tbl, "gl_TextureMatrix");
+ e[SLANG_COMMON_FIXED_NORMALMATRIX] = gd (tbl, "gl_NormalMatrix");
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE] = gd (tbl, "gl_ModelViewMatrixInverse");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE] = gd (tbl, "gl_ProjectionMatrixInverse");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE] = gd (tbl, "gl_ModelViewProjectionMatrixInverse");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE] = gd (tbl, "gl_TextureMatrixInverse");
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE] = gd (tbl, "gl_ModelViewMatrixTranspose");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE] = gd (tbl, "gl_ProjectionMatrixTranspose");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE] = gd (tbl, "gl_ModelViewProjectionMatrixTranspose");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE] = gd (tbl, "gl_TextureMatrixTranspose");
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_ModelViewMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_ProjectionMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_ModelViewProjectionMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_TextureMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_NORMALSCALE] = gd (tbl, "gl_NormalScale");
+ e[SLANG_COMMON_FIXED_DEPTHRANGE] = gd (tbl, "gl_DepthRange");
+ e[SLANG_COMMON_FIXED_CLIPPLANE] = gd (tbl, "gl_ClipPlane");
+ e[SLANG_COMMON_FIXED_POINT] = gd (tbl, "gl_Point");
+ e[SLANG_COMMON_FIXED_FRONTMATERIAL] = gd (tbl, "gl_FrontMaterial");
+ e[SLANG_COMMON_FIXED_BACKMATERIAL] = gd (tbl, "gl_BackMaterial");
+ e[SLANG_COMMON_FIXED_LIGHTSOURCE] = gd (tbl, "gl_LightSource");
+ e[SLANG_COMMON_FIXED_LIGHTMODEL] = gd (tbl, "gl_LightModel");
+ e[SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT] = gd (tbl, "gl_FrontLightModelProduct");
+ e[SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT] = gd (tbl, "gl_BackLightModelProduct");
+ e[SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT] = gd (tbl, "gl_FrontLightProduct");
+ e[SLANG_COMMON_FIXED_BACKLIGHTPRODUCT] = gd (tbl, "gl_BackLightProduct");
+ e[SLANG_COMMON_FIXED_TEXTUREENVCOLOR] = gd (tbl, "gl_TextureEnvColor");
+ e[SLANG_COMMON_FIXED_EYEPLANES] = gd (tbl, "gl_EyePlaneS");
+ e[SLANG_COMMON_FIXED_EYEPLANET] = gd (tbl, "gl_EyePlaneT");
+ e[SLANG_COMMON_FIXED_EYEPLANER] = gd (tbl, "gl_EyePlaneR");
+ e[SLANG_COMMON_FIXED_EYEPLANEQ] = gd (tbl, "gl_EyePlaneQ");
+ e[SLANG_COMMON_FIXED_OBJECTPLANES] = gd (tbl, "gl_ObjectPlaneS");
+ e[SLANG_COMMON_FIXED_OBJECTPLANET] = gd (tbl, "gl_ObjectPlaneT");
+ e[SLANG_COMMON_FIXED_OBJECTPLANER] = gd (tbl, "gl_ObjectPlaneR");
+ e[SLANG_COMMON_FIXED_OBJECTPLANEQ] = gd (tbl, "gl_ObjectPlaneQ");
+ e[SLANG_COMMON_FIXED_FOG] = gd (tbl, "gl_Fog");
+}
+
+static GLvoid
+resolve_vertex_fixed (GLuint e[], slang_export_data_table *tbl)
+{
+ e[SLANG_VERTEX_FIXED_POSITION] = gd (tbl, "gl_Position");
+ e[SLANG_VERTEX_FIXED_POINTSIZE] = gd (tbl, "gl_PointSize");
+ e[SLANG_VERTEX_FIXED_CLIPVERTEX] = gd (tbl, "gl_ClipVertex");
+ e[SLANG_VERTEX_FIXED_COLOR] = gd (tbl, "gl_Color");
+ e[SLANG_VERTEX_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor");
+ e[SLANG_VERTEX_FIXED_NORMAL] = gd (tbl, "gl_Normal");
+ e[SLANG_VERTEX_FIXED_VERTEX] = gd (tbl, "gl_Vertex");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD0] = gd (tbl, "gl_MultiTexCoord0");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD1] = gd (tbl, "gl_MultiTexCoord1");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD2] = gd (tbl, "gl_MultiTexCoord2");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD3] = gd (tbl, "gl_MultiTexCoord3");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD4] = gd (tbl, "gl_MultiTexCoord4");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD5] = gd (tbl, "gl_MultiTexCoord5");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD6] = gd (tbl, "gl_MultiTexCoord6");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD7] = gd (tbl, "gl_MultiTexCoord7");
+ e[SLANG_VERTEX_FIXED_FOGCOORD] = gd (tbl, "gl_FogCoord");
+ e[SLANG_VERTEX_FIXED_FRONTCOLOR] = gd (tbl, "gl_FrontColor");
+ e[SLANG_VERTEX_FIXED_BACKCOLOR] = gd (tbl, "gl_BackColor");
+ e[SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR] = gd (tbl, "gl_FrontSecondaryColor");
+ e[SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR] = gd (tbl, "gl_BackSecondaryColor");
+ e[SLANG_VERTEX_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord");
+ e[SLANG_VERTEX_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord");
+}
+
+static GLvoid
+resolve_fragment_fixed (GLuint e[], slang_export_data_table *tbl)
+{
+ e[SLANG_FRAGMENT_FIXED_FRAGCOORD] = gd (tbl, "gl_FragCoord");
+ e[SLANG_FRAGMENT_FIXED_FRONTFACING] = gd (tbl, "gl_FrontFacing");
+ e[SLANG_FRAGMENT_FIXED_FRAGCOLOR] = gd (tbl, "gl_FragColor");
+ e[SLANG_FRAGMENT_FIXED_FRAGDATA] = gd (tbl, "gl_FragData");
+ e[SLANG_FRAGMENT_FIXED_FRAGDEPTH] = gd (tbl, "gl_FragDepth");
+ e[SLANG_FRAGMENT_FIXED_COLOR] = gd (tbl, "gl_Color");
+ e[SLANG_FRAGMENT_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor");
+ e[SLANG_FRAGMENT_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord");
+ e[SLANG_FRAGMENT_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord");
+}
+
+static GLuint
+gc (slang_export_code_table *tbl, const GLchar *name)
+{
+ slang_atom atom;
+ GLuint i;
+
+ atom = slang_atom_pool_atom (tbl->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return ~0;
+
+ for (i = 0; i < tbl->count; i++) {
+ if (atom == tbl->entries[i].name)
+ return tbl->entries[i].address;
+ }
+ return ~0;
+}
+
+static GLvoid
+resolve_common_code (GLuint code[], slang_export_code_table *tbl)
+{
+ code[SLANG_COMMON_CODE_MAIN] = gc (tbl, "@main");
}
GLboolean
_slang_link (slang_program *prog, slang_code_object **objects, GLuint count)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < count; i++)
- {
- GLuint index;
+ for (i = 0; i < count; i++) {
+ GLuint index;
if (objects[i]->unit.type == slang_unit_fragment_shader) {
- index = SLANG_SHADER_FRAGMENT;
+ index = SLANG_SHADER_FRAGMENT;
resolve_fragment_fixed (prog->fragment_fixed_entries, &objects[i]->expdata);
- }
- else
- {
- index = SLANG_SHADER_VERTEX;
+ }
+ else {
+ index = SLANG_SHADER_VERTEX;
resolve_vertex_fixed (prog->vertex_fixed_entries, &objects[i]->expdata);
if (!gather_attrib_bindings (&prog->attribs, &objects[i]->expdata,
&prog->attrib_overrides))
- return GL_FALSE;
- }
+ return GL_FALSE;
+ }
if (!gather_active_variables (&prog->active_uniforms, &objects[i]->expdata, slang_exp_uniform))
- return GL_FALSE;
+ return GL_FALSE;
if (!gather_active_variables (&prog->active_attribs, &objects[i]->expdata, slang_exp_attribute))
- return GL_FALSE;
+ return GL_FALSE;
if (!gather_uniform_bindings (&prog->uniforms, &objects[i]->expdata, index))
- return GL_FALSE;
+ return GL_FALSE;
if (!gather_varying_bindings (&prog->varyings, &objects[i]->expdata,
index == SLANG_SHADER_VERTEX))
- return GL_FALSE;
+ return GL_FALSE;
resolve_common_fixed (prog->common_fixed_entries[index], &objects[i]->expdata);
resolve_common_code (prog->code[index], &objects[i]->expcode);
prog->machines[index] = &objects[i]->machine;
prog->assemblies[index] = &objects[i]->assembly;
- }
+ }
- /* TODO: all varyings read by fragment shader must be written by vertex shader */
+ /* TODO: all varyings read by fragment shader must be written by vertex shader */
- if (!_slang_analyse_texture_usage (prog))
- return GL_FALSE;
+ if (!_slang_analyse_texture_usage (prog))
+ return GL_FALSE;
- return GL_TRUE;
+ return GL_TRUE;
}
diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h
index a7898530318..433964223a5 100644
--- a/src/mesa/shader/slang/slang_link.h
+++ b/src/mesa/shader/slang/slang_link.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2006 Brian Paul All Rights Reserved.
*
@@ -33,277 +33,314 @@ extern "C" {
enum
{
- SLANG_SHADER_VERTEX,
- SLANG_SHADER_FRAGMENT,
- SLANG_SHADER_MAX
+ SLANG_SHADER_VERTEX,
+ SLANG_SHADER_FRAGMENT,
+ SLANG_SHADER_MAX
};
-/* Active variables.
+
+/**
+ * Active variables.
*
- * Active uniforms or attribs can be queried by the application to get a list of uniforms
- * or attribs actually used by shaders (uniforms) or vertex shader (attribs).
+ * Active uniforms/attribs can be queried by the application to get a
+ * list of uniforms/attribs actually used by shaders (uniforms) or
+ * vertex shader only (attribs).
*/
-
+/*@{*/
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
+ slang_export_data_quant *quant;
+ GLchar *name;
} slang_active_variable;
typedef struct
{
- slang_active_variable *table;
- GLuint count;
+ slang_active_variable *table;
+ GLuint count;
} slang_active_variables;
+/*@}*/
-/*
+
+/**
* Attrib binding override.
*
- * The application can override GL attrib binding by specifying its preferred index assignment
- * for a given attrib name. Those overrides are taken into account while linking the program.
+ * The application can override GL attrib binding by specifying its
+ * preferred index assignment for a given attrib name. Those overrides
+ * are taken into account while linking the program.
*/
-
+/*@{*/
typedef struct
{
- GLuint index;
- GLchar *name;
+ GLuint index;
+ GLchar *name;
} slang_attrib_override;
typedef struct
{
- slang_attrib_override *table;
- GLuint count;
+ slang_attrib_override *table;
+ GLuint count;
} slang_attrib_overrides;
+/*@}*/
-GLboolean slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GLchar *);
-/*
+extern GLboolean
+_slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GLchar *);
+
+
+/**
* Uniform bindings.
*
- * Each slang_uniform_binding holds an array of addresses to actual memory locations in those
- * shader types that use that uniform. Uniform bindings are held in an array and accessed
- * by array index which is seen to the application as a uniform location.
+ * Each slang_uniform_binding holds an array of addresses to actual
+ * memory locations in those shader types that use that
+ * uniform. Uniform bindings are held in an array and accessed by
+ * array index which is seen to the application as a uniform location.
*
- * When the application writes to a particular uniform, it specifies its location.
- * This location is treated as an array index to slang_uniform_bindings::table and tested
- * against slang_uniform_bindings::count limit. The result is a pointer to slang_uniform_binding.
- * The type of data being written to uniform is tested against slang_uniform_binding::quant.
- * If the types are compatible, the array slang_uniform_binding::address is iterated for
- * each shader type and if the address is valid (i.e. the uniform is used by this shader type),
- * the new uniform value is written at that address.
+ * When the application writes to a particular uniform, it specifies
+ * its location. This location is treated as an array index to
+ * slang_uniform_bindings::table and tested against
+ * slang_uniform_bindings::count limit. The result is a pointer to
+ * slang_uniform_binding. The type of data being written to uniform
+ * is tested against slang_uniform_binding::quant. If the types are
+ * compatible, the array slang_uniform_binding::address is iterated
+ * for each shader type and if the address is valid (i.e. the uniform
+ * is used by this shader type), the new uniform value is written at
+ * that address.
*/
-
+/*@{*/
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
- GLuint address[SLANG_SHADER_MAX];
+ slang_export_data_quant *quant;
+ GLchar *name;
+ GLuint address[SLANG_SHADER_MAX];
} slang_uniform_binding;
typedef struct
{
- slang_uniform_binding *table;
- GLuint count;
+ slang_uniform_binding *table;
+ GLuint count;
} slang_uniform_bindings;
+/*@}*/
-/*
+
+/**
* Attrib bindings.
*
- * There is a fixed number of vertex attrib vectors (attrib slots). The slang_attrib_slot::addr
- * maps vertex attrib index to the actual memory location of the attrib in vertex shader.
- * One vertex attrib can span over many attrib slots (this is the case for matrices). The
- * slang_attrib_binding::first_slot_index holds the first slot index that the attrib is bound to.
+ * There is a fixed number of vertex attrib vectors (attrib
+ * slots). The slang_attrib_slot::addr maps vertex attrib index to the
+ * actual memory location of the attrib in vertex shader. One vertex
+ * attrib can span over many attrib slots (this is the case for
+ * matrices). The slang_attrib_binding::first_slot_index holds the
+ * first slot index that the attrib is bound to.
*/
-
+/*@{*/
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
- GLuint first_slot_index;
+ slang_export_data_quant *quant;
+ GLchar *name;
+ GLuint first_slot_index;
} slang_attrib_binding;
typedef struct
{
- GLuint addr; /* memory location */
- GLuint fill; /* 1..4, number of components used */
+ GLuint addr; /**< memory location */
+ GLuint fill; /**< 1..4, number of components used */
} slang_attrib_slot;
typedef struct
{
- slang_attrib_binding bindings[MAX_VERTEX_ATTRIBS];
- GLuint binding_count;
- slang_attrib_slot slots[MAX_VERTEX_ATTRIBS];
+ slang_attrib_binding bindings[MAX_VERTEX_ATTRIBS];
+ GLuint binding_count;
+ slang_attrib_slot slots[MAX_VERTEX_ATTRIBS];
} slang_attrib_bindings;
+/*@}*/
-/*
+
+
+/**
* Varying bindings.
*
- * There is a fixed number of varying floats (varying slots). The slang_varying_slot::vert_addr
- * maps varying float index to the actual memory location of the output variable in vertex shader.
- * The slang_varying_slot::frag_addr maps varying float index to the actual memory location of
- * the input variable in fragment shader.
+ * There is a fixed number of varying floats (varying slots). The
+ * slang_varying_slot::vert_addr maps varying float index to the
+ * actual memory location of the output variable in vertex shader.
+ * The slang_varying_slot::frag_addr maps varying float index to the
+ * actual memory location of the input variable in fragment shader.
*/
-
+/*@{*/
typedef struct
{
- GLuint vert_addr;
- GLuint frag_addr;
+ GLuint vert_addr;
+ GLuint frag_addr;
} slang_varying_slot;
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
- GLuint first_slot_index;
+ slang_export_data_quant *quant;
+ GLchar *name;
+ GLuint first_slot_index;
} slang_varying_binding;
typedef struct
{
- slang_varying_binding bindings[MAX_VARYING_FLOATS];
- GLuint binding_count;
- slang_varying_slot slots[MAX_VARYING_FLOATS];
- GLuint slot_count;
+ slang_varying_binding bindings[MAX_VARYING_FLOATS];
+ GLuint binding_count;
+ slang_varying_slot slots[MAX_VARYING_FLOATS];
+ GLuint slot_count;
} slang_varying_bindings;
+/*@}*/
-/*
+
+/**
* Texture usage.
*
- * A slang_texture_usage struct holds indirect information about texture image unit usage. The
- * slang_texture_usages::table is derived from active uniform table by extracting only uniforms
- * that are samplers.
+ * A slang_texture_usage struct holds indirect information about
+ * texture image unit usage. The slang_texture_usages::table is
+ * derived from active uniform table by extracting only uniforms that
+ * are samplers.
*
- * To collect current texture usage one must iterate the slang_texture_usages::table and read
- * uniform at address slang_texture_usage::frag_address to get texture unit index. This
- * index, coupled with texture access type (target) taken from slang_texture_usage::quant
- * forms texture usage for that texture unit.
+ * To collect current texture usage one must iterate the
+ * slang_texture_usages::table and read uniform at address
+ * slang_texture_usage::frag_address to get texture unit index. This
+ * index, coupled with texture access type (target) taken from
+ * slang_texture_usage::quant forms texture usage for that texture
+ * unit.
*/
-
+/*@{*/
typedef struct
{
- slang_export_data_quant *quant;
- GLuint frag_address;
+ slang_export_data_quant *quant;
+ GLuint frag_address;
} slang_texture_usage;
typedef struct
{
- slang_texture_usage *table;
- GLuint count;
+ slang_texture_usage *table;
+ GLuint count;
} slang_texture_usages;
+/*@}*/
+
-GLvoid slang_texture_usages_ctr (slang_texture_usages *);
-GLvoid slang_texture_usages_dtr (slang_texture_usages *);
+extern GLvoid
+_slang_texture_usages_ctr (slang_texture_usages *);
+
+extern GLvoid
+_slang_texture_usages_dtr (slang_texture_usages *);
enum
{
- SLANG_COMMON_FIXED_MODELVIEWMATRIX,
- SLANG_COMMON_FIXED_PROJECTIONMATRIX,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
- SLANG_COMMON_FIXED_TEXTUREMATRIX,
- SLANG_COMMON_FIXED_NORMALMATRIX,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
- SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE,
- SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE,
- SLANG_COMMON_FIXED_NORMALSCALE,
- SLANG_COMMON_FIXED_DEPTHRANGE,
- SLANG_COMMON_FIXED_CLIPPLANE,
- SLANG_COMMON_FIXED_POINT,
- SLANG_COMMON_FIXED_FRONTMATERIAL,
- SLANG_COMMON_FIXED_BACKMATERIAL,
- SLANG_COMMON_FIXED_LIGHTSOURCE,
- SLANG_COMMON_FIXED_LIGHTMODEL,
- SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
- SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
- SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
- SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
- SLANG_COMMON_FIXED_TEXTUREENVCOLOR,
- SLANG_COMMON_FIXED_EYEPLANES,
- SLANG_COMMON_FIXED_EYEPLANET,
- SLANG_COMMON_FIXED_EYEPLANER,
- SLANG_COMMON_FIXED_EYEPLANEQ,
- SLANG_COMMON_FIXED_OBJECTPLANES,
- SLANG_COMMON_FIXED_OBJECTPLANET,
- SLANG_COMMON_FIXED_OBJECTPLANER,
- SLANG_COMMON_FIXED_OBJECTPLANEQ,
- SLANG_COMMON_FIXED_FOG,
- SLANG_COMMON_FIXED_MAX
+ SLANG_COMMON_FIXED_MODELVIEWMATRIX,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_TEXTUREMATRIX,
+ SLANG_COMMON_FIXED_NORMALMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_NORMALSCALE,
+ SLANG_COMMON_FIXED_DEPTHRANGE,
+ SLANG_COMMON_FIXED_CLIPPLANE,
+ SLANG_COMMON_FIXED_POINT,
+ SLANG_COMMON_FIXED_FRONTMATERIAL,
+ SLANG_COMMON_FIXED_BACKMATERIAL,
+ SLANG_COMMON_FIXED_LIGHTSOURCE,
+ SLANG_COMMON_FIXED_LIGHTMODEL,
+ SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
+ SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
+ SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
+ SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
+ SLANG_COMMON_FIXED_TEXTUREENVCOLOR,
+ SLANG_COMMON_FIXED_EYEPLANES,
+ SLANG_COMMON_FIXED_EYEPLANET,
+ SLANG_COMMON_FIXED_EYEPLANER,
+ SLANG_COMMON_FIXED_EYEPLANEQ,
+ SLANG_COMMON_FIXED_OBJECTPLANES,
+ SLANG_COMMON_FIXED_OBJECTPLANET,
+ SLANG_COMMON_FIXED_OBJECTPLANER,
+ SLANG_COMMON_FIXED_OBJECTPLANEQ,
+ SLANG_COMMON_FIXED_FOG,
+ SLANG_COMMON_FIXED_MAX
};
enum
{
- SLANG_VERTEX_FIXED_POSITION,
- SLANG_VERTEX_FIXED_POINTSIZE,
- SLANG_VERTEX_FIXED_CLIPVERTEX,
- SLANG_VERTEX_FIXED_COLOR,
- SLANG_VERTEX_FIXED_SECONDARYCOLOR,
- SLANG_VERTEX_FIXED_NORMAL,
- SLANG_VERTEX_FIXED_VERTEX,
- SLANG_VERTEX_FIXED_MULTITEXCOORD0,
- SLANG_VERTEX_FIXED_MULTITEXCOORD1,
- SLANG_VERTEX_FIXED_MULTITEXCOORD2,
- SLANG_VERTEX_FIXED_MULTITEXCOORD3,
- SLANG_VERTEX_FIXED_MULTITEXCOORD4,
- SLANG_VERTEX_FIXED_MULTITEXCOORD5,
- SLANG_VERTEX_FIXED_MULTITEXCOORD6,
- SLANG_VERTEX_FIXED_MULTITEXCOORD7,
- SLANG_VERTEX_FIXED_FOGCOORD,
- SLANG_VERTEX_FIXED_FRONTCOLOR,
- SLANG_VERTEX_FIXED_BACKCOLOR,
- SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR,
- SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR,
- SLANG_VERTEX_FIXED_TEXCOORD,
- SLANG_VERTEX_FIXED_FOGFRAGCOORD,
- SLANG_VERTEX_FIXED_MAX
+ SLANG_VERTEX_FIXED_POSITION,
+ SLANG_VERTEX_FIXED_POINTSIZE,
+ SLANG_VERTEX_FIXED_CLIPVERTEX,
+ SLANG_VERTEX_FIXED_COLOR,
+ SLANG_VERTEX_FIXED_SECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_NORMAL,
+ SLANG_VERTEX_FIXED_VERTEX,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD0,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD1,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD2,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD3,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD4,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD5,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD6,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD7,
+ SLANG_VERTEX_FIXED_FOGCOORD,
+ SLANG_VERTEX_FIXED_FRONTCOLOR,
+ SLANG_VERTEX_FIXED_BACKCOLOR,
+ SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_TEXCOORD,
+ SLANG_VERTEX_FIXED_FOGFRAGCOORD,
+ SLANG_VERTEX_FIXED_MAX
};
enum
{
- SLANG_FRAGMENT_FIXED_FRAGCOORD,
- SLANG_FRAGMENT_FIXED_FRONTFACING,
- SLANG_FRAGMENT_FIXED_FRAGCOLOR,
- SLANG_FRAGMENT_FIXED_FRAGDATA,
- SLANG_FRAGMENT_FIXED_FRAGDEPTH,
- SLANG_FRAGMENT_FIXED_COLOR,
- SLANG_FRAGMENT_FIXED_SECONDARYCOLOR,
- SLANG_FRAGMENT_FIXED_TEXCOORD,
- SLANG_FRAGMENT_FIXED_FOGFRAGCOORD,
- SLANG_FRAGMENT_FIXED_MAX
+ SLANG_FRAGMENT_FIXED_FRAGCOORD,
+ SLANG_FRAGMENT_FIXED_FRONTFACING,
+ SLANG_FRAGMENT_FIXED_FRAGCOLOR,
+ SLANG_FRAGMENT_FIXED_FRAGDATA,
+ SLANG_FRAGMENT_FIXED_FRAGDEPTH,
+ SLANG_FRAGMENT_FIXED_COLOR,
+ SLANG_FRAGMENT_FIXED_SECONDARYCOLOR,
+ SLANG_FRAGMENT_FIXED_TEXCOORD,
+ SLANG_FRAGMENT_FIXED_FOGFRAGCOORD,
+ SLANG_FRAGMENT_FIXED_MAX
};
enum
{
- SLANG_COMMON_CODE_MAIN,
- SLANG_COMMON_CODE_MAX
+ SLANG_COMMON_CODE_MAIN,
+ SLANG_COMMON_CODE_MAX
};
typedef struct
{
- slang_active_variables active_uniforms;
- slang_active_variables active_attribs;
- slang_attrib_overrides attrib_overrides;
- slang_uniform_bindings uniforms;
- slang_attrib_bindings attribs;
- slang_varying_bindings varyings;
- slang_texture_usages texture_usage;
- GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX];
- GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];
- GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];
- GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX];
- slang_machine *machines[SLANG_SHADER_MAX];
- slang_assembly_file *assemblies[SLANG_SHADER_MAX];
+ slang_active_variables active_uniforms;
+ slang_active_variables active_attribs;
+ slang_attrib_overrides attrib_overrides;
+ slang_uniform_bindings uniforms;
+ slang_attrib_bindings attribs;
+ slang_varying_bindings varyings;
+ slang_texture_usages texture_usage;
+ GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX];
+ GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];
+ GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];
+ GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX];
+ slang_machine *machines[SLANG_SHADER_MAX];
+ slang_assembly_file *assemblies[SLANG_SHADER_MAX];
} slang_program;
-GLvoid slang_program_ctr (slang_program *);
-GLvoid slang_program_dtr (slang_program *);
-GLvoid slang_program_rst (slang_program *);
+extern GLvoid
+_slang_program_ctr (slang_program *);
+
+extern GLvoid
+_slang_program_dtr (slang_program *);
+
+extern GLvoid
+_slang_program_rst (slang_program *);
extern GLboolean
_slang_link (slang_program *, slang_code_object **, GLuint);
diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c
index bd9ff9002e9..66a6a983927 100644
--- a/src/mesa/shader/slang/slang_preprocess.c
+++ b/src/mesa/shader/slang/slang_preprocess.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -32,7 +32,15 @@
#include "grammar_mesa.h"
#include "slang_preprocess.h"
-static const char *slang_pp_version_syn =
+LONGSTRING static const char *slang_pp_directives_syn =
+#include "library/slang_pp_directives_syn.h"
+;
+
+LONGSTRING static const char *slang_pp_expression_syn =
+#include "library/slang_pp_expression_syn.h"
+;
+
+LONGSTRING static const char *slang_pp_version_syn =
#include "library/slang_pp_version_syn.h"
;
@@ -40,7 +48,7 @@ static GLvoid
grammar_error_to_log (slang_info_log *log)
{
char buf[1024];
- int pos;
+ GLint pos;
grammar_get_last_error ((byte *) (buf), sizeof (buf), &pos);
slang_info_log_error (log, buf);
@@ -75,3 +83,1089 @@ _slang_preprocess_version (const char *text, GLuint *version, GLuint *eaten, sla
return GL_TRUE;
}
+/*
+ * The preprocessor does the following work.
+ * 1. Remove comments. Each comment block is replaced with a single space and if the
+ * block contains new-lines, they are preserved. This ensures that line numbers
+ * stay the same and if a comment block delimits two tokens, the are delitmited
+ * by the space after comment removal.
+ * 2. Remove preprocessor directives from the source string, checking their syntax and
+ * executing them if appropriate. Again, new-lines are preserved.
+ * 3. Expand macros.
+ * 4. Tokenize the source string by ensuring there is at least one space between every
+ * two adjacent tokens.
+ */
+
+#define PP_ANNOTATE 0
+
+static GLvoid
+pp_annotate (slang_string *output, const char *fmt, ...)
+{
+#if PP_ANNOTATE
+ va_list va;
+ char buffer[1024];
+
+ va_start (va, fmt);
+ _mesa_vsprintf (buffer, fmt, va);
+ va_end (va);
+ slang_string_pushs (output, buffer, _mesa_strlen (buffer));
+#else
+ (GLvoid) (output);
+ (GLvoid) (fmt);
+#endif
+}
+
+ /*
+ * The expression is executed on a fixed-sized stack. The PUSH macro makes a runtime
+ * check if the stack is not overflown by too complex expressions. In that situation the
+ * GLSL preprocessor should report internal compiler error.
+ * The BINARYDIV makes a runtime check if the divider is not 0. If it is, it reports
+ * compilation error.
+ */
+
+#define EXECUTION_STACK_SIZE 1024
+
+#define PUSH(x)\
+ do {\
+ if (sp == 0) {\
+ slang_info_log_error (elog, "internal compiler error: preprocessor execution stack overflow.");\
+ return GL_FALSE;\
+ }\
+ stack[--sp] = x;\
+ } while (GL_FALSE)
+
+#define POP(x)\
+ do {\
+ assert (sp < EXECUTION_STACK_SIZE);\
+ x = stack[sp++];\
+ } while (GL_FALSE)
+
+#define BINARY(op)\
+ do {\
+ GLint a, b;\
+ POP(b);\
+ POP(a);\
+ PUSH(a op b);\
+ } while (GL_FALSE)
+
+#define BINARYDIV(op)\
+ do {\
+ GLint a, b;\
+ POP(b);\
+ POP(a);\
+ if (b == 0) {\
+ slang_info_log_error (elog, "division by zero in preprocessor expression.");\
+ return GL_FALSE;\
+ }\
+ PUSH(a op b);\
+ } while (GL_FALSE)
+
+#define UNARY(op)\
+ do {\
+ GLint a;\
+ POP(a);\
+ PUSH(op a);\
+ } while (GL_FALSE)
+
+#define OP_END 0
+#define OP_PUSHINT 1
+#define OP_LOGICALOR 2
+#define OP_LOGICALAND 3
+#define OP_OR 4
+#define OP_XOR 5
+#define OP_AND 6
+#define OP_EQUAL 7
+#define OP_NOTEQUAL 8
+#define OP_LESSEQUAL 9
+#define OP_GREATEREQUAL 10
+#define OP_LESS 11
+#define OP_GREATER 12
+#define OP_LEFTSHIFT 13
+#define OP_RIGHTSHIFT 14
+#define OP_ADD 15
+#define OP_SUBTRACT 16
+#define OP_MULTIPLY 17
+#define OP_DIVIDE 18
+#define OP_MODULUS 19
+#define OP_PLUS 20
+#define OP_MINUS 21
+#define OP_NEGATE 22
+#define OP_COMPLEMENT 23
+
+static GLboolean
+execute_expression (slang_string *output, const byte *code, GLuint *pi, GLint *result,
+ slang_info_log *elog)
+{
+ GLuint i = *pi;
+ GLint stack[EXECUTION_STACK_SIZE];
+ GLuint sp = EXECUTION_STACK_SIZE;
+
+ while (code[i] != OP_END) {
+ switch (code[i++]) {
+ case OP_PUSHINT:
+ i++;
+ PUSH(_mesa_atoi ((const char *) (&code[i])));
+ i += _mesa_strlen ((const char *) (&code[i])) + 1;
+ break;
+ case OP_LOGICALOR:
+ BINARY(||);
+ break;
+ case OP_LOGICALAND:
+ BINARY(&&);
+ break;
+ case OP_OR:
+ BINARY(|);
+ break;
+ case OP_XOR:
+ BINARY(^);
+ break;
+ case OP_AND:
+ BINARY(&);
+ break;
+ case OP_EQUAL:
+ BINARY(==);
+ break;
+ case OP_NOTEQUAL:
+ BINARY(!=);
+ break;
+ case OP_LESSEQUAL:
+ BINARY(<=);
+ break;
+ case OP_GREATEREQUAL:
+ BINARY(>=);
+ break;
+ case OP_LESS:
+ BINARY(<);
+ break;
+ case OP_GREATER:
+ BINARY(>);
+ break;
+ case OP_LEFTSHIFT:
+ BINARY(<<);
+ break;
+ case OP_RIGHTSHIFT:
+ BINARY(>>);
+ break;
+ case OP_ADD:
+ BINARY(+);
+ break;
+ case OP_SUBTRACT:
+ BINARY(-);
+ break;
+ case OP_MULTIPLY:
+ BINARY(*);
+ break;
+ case OP_DIVIDE:
+ BINARYDIV(/);
+ break;
+ case OP_MODULUS:
+ BINARYDIV(%);
+ break;
+ case OP_PLUS:
+ UNARY(+);
+ break;
+ case OP_MINUS:
+ UNARY(-);
+ break;
+ case OP_NEGATE:
+ UNARY(!);
+ break;
+ case OP_COMPLEMENT:
+ UNARY(~);
+ break;
+ default:
+ assert (0);
+ }
+ }
+
+ /* Write-back the index skipping the OP_END. */
+ *pi = i + 1;
+
+ /* There should be exactly one value left on the stack. This is our result. */
+ POP(*result);
+ pp_annotate (output, "%d ", *result);
+ assert (sp == EXECUTION_STACK_SIZE);
+ return GL_TRUE;
+}
+
+/*
+ * Function execute_expressions() executes up to 2 expressions. The second expression is there
+ * for the #line directive which takes 1 or 2 expressions that indicate line and file numbers.
+ * If it fails, it returns 0. If it succeeds, it returns the number of executed expressions.
+ */
+
+#define EXP_END 0
+#define EXP_EXPRESSION 1
+
+static GLuint
+execute_expressions (slang_string *output, grammar eid, const byte *expr, GLint results[2],
+ slang_info_log *elog)
+{
+ GLint success;
+ byte *code;
+ GLuint size, count = 0;
+
+ success = grammar_fast_check (eid, expr, &code, &size, 64);
+ if (success) {
+ GLuint i = 0;
+
+ while (code[i++] == EXP_EXPRESSION) {
+ assert (count < 2);
+
+ if (!execute_expression (output, code, &i, &results[count], elog)) {
+ count = 0;
+ break;
+ }
+ count++;
+ }
+ grammar_alloc_free (code);
+ }
+ else {
+ slang_info_log_error (elog, "syntax error in preprocessor expression.");\
+ }
+ return count;
+}
+
+/*
+ * The pp_symbol structure is used to hold macro definitions and macro formal parameters. The
+ * pp_symbols strcture is a collection of pp_symbol. It is used both for storing macro formal
+ * parameters and all global macro definitions. Making this unification wastes some memory,
+ * becuse macro formal parameters don't need further lists of symbols. We lose 8 bytes per
+ * formal parameter here, but making this we can use the same code to substitute macro parameters
+ * as well as macros in the source string.
+ */
+
+typedef struct
+{
+ struct pp_symbol_ *symbols;
+ GLuint count;
+} pp_symbols;
+
+static GLvoid
+pp_symbols_init (pp_symbols *self)
+{
+ self->symbols = NULL;
+ self->count = 0;
+}
+
+static GLvoid
+pp_symbols_free (pp_symbols *);
+
+typedef struct pp_symbol_
+{
+ slang_string name;
+ slang_string replacement;
+ pp_symbols parameters;
+} pp_symbol;
+
+static GLvoid
+pp_symbol_init (pp_symbol *self)
+{
+ slang_string_init (&self->name);
+ slang_string_init (&self->replacement);
+ pp_symbols_init (&self->parameters);
+}
+
+static GLvoid
+pp_symbol_free (pp_symbol *self)
+{
+ slang_string_free (&self->name);
+ slang_string_free (&self->replacement);
+ pp_symbols_free (&self->parameters);
+}
+
+static GLvoid
+pp_symbol_reset (pp_symbol *self)
+{
+ /* Leave symbol name intact. */
+ slang_string_reset (&self->replacement);
+ pp_symbols_free (&self->parameters);
+ pp_symbols_init (&self->parameters);
+}
+
+static GLvoid
+pp_symbols_free (pp_symbols *self)
+{
+ GLuint i;
+
+ for (i = 0; i < self->count; i++)
+ pp_symbol_free (&self->symbols[i]);
+ _mesa_free (self->symbols);
+}
+
+static pp_symbol *
+pp_symbols_push (pp_symbols *self)
+{
+ self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, self->count * sizeof (pp_symbol),
+ (self->count + 1) * sizeof (pp_symbol)));
+ if (self->symbols == NULL)
+ return NULL;
+ pp_symbol_init (&self->symbols[self->count]);
+ return &self->symbols[self->count++];
+}
+
+static GLboolean
+pp_symbols_erase (pp_symbols *self, pp_symbol *symbol)
+{
+ assert (symbol >= self->symbols && symbol < self->symbols + self->count);
+
+ self->count--;
+ pp_symbol_free (symbol);
+ if (symbol < self->symbols + self->count)
+ _mesa_memcpy (symbol, symbol + 1, sizeof (pp_symbol) * (self->symbols + self->count - symbol));
+ self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, (self->count + 1) * sizeof (pp_symbol),
+ self->count * sizeof (pp_symbol)));
+ return self->symbols != NULL;
+}
+
+static pp_symbol *
+pp_symbols_find (pp_symbols *self, const char *name)
+{
+ GLuint i;
+
+ for (i = 0; i < self->count; i++)
+ if (_mesa_strcmp (name, slang_string_cstr (&self->symbols[i].name)) == 0)
+ return &self->symbols[i];
+ return NULL;
+}
+
+/*
+ * The condition context of a single #if/#else/#endif level. Those can be nested, so there
+ * is a stack of condition contexts.
+ * There is a special global context on the bottom of the stack. It is there to simplify
+ * context handling.
+ */
+
+typedef struct
+{
+ GLboolean current; /* The condition value of this level. */
+ GLboolean effective; /* The effective product of current condition, outer level conditions
+ * and position within #if-#else-#endif sections. */
+ GLboolean else_allowed; /* TRUE if in #if-#else section, FALSE if in #else-#endif section
+ * and for global context. */
+ GLboolean endif_required; /* FALSE for global context only. */
+} pp_cond_ctx;
+
+/* Should be enuff. */
+#define CONDITION_STACK_SIZE 64
+
+typedef struct
+{
+ pp_cond_ctx stack[CONDITION_STACK_SIZE];
+ pp_cond_ctx *top;
+} pp_cond_stack;
+
+static GLboolean
+pp_cond_stack_push (pp_cond_stack *self, slang_info_log *elog)
+{
+ if (self->top == self->stack) {
+ slang_info_log_error (elog, "internal compiler error: preprocessor condition stack overflow.");
+ return GL_FALSE;
+ }
+ self->top--;
+ return GL_TRUE;
+}
+
+static GLvoid
+pp_cond_stack_reevaluate (pp_cond_stack *self)
+{
+ /* There must be at least 2 conditions on the stack - one global and one being evaluated. */
+ assert (self->top <= &self->stack[CONDITION_STACK_SIZE - 2]);
+
+ self->top->effective = self->top->current && self->top[1].effective;
+}
+
+/*
+ * Extension enables through #extension directive.
+ * NOTE: Currently, only enable/disable state is stored.
+ */
+
+typedef struct
+{
+ GLboolean MESA_shader_debug; /* GL_MESA_shader_debug enable */
+} pp_ext;
+
+/*
+ * Disable all extensions. Called at startup and on #extension all: disable.
+ */
+static GLvoid
+pp_ext_disable_all (pp_ext *self)
+{
+ self->MESA_shader_debug = GL_FALSE;
+}
+
+static GLvoid
+pp_ext_init (pp_ext *self)
+{
+ pp_ext_disable_all (self);
+ /* Other initialization code goes here. */
+}
+
+static GLboolean
+pp_ext_set (pp_ext *self, const char *name, GLboolean enable)
+{
+ if (_mesa_strcmp (name, "MESA_shader_debug") == 0)
+ self->MESA_shader_debug = enable;
+ /* Next extension name tests go here. */
+ else
+ return GL_FALSE;
+ return GL_TRUE;
+}
+
+/*
+ * The state of preprocessor: current line, file and version number, list of all defined macros
+ * and the #if/#endif context.
+ */
+
+typedef struct
+{
+ GLint line;
+ GLint file;
+ GLint version;
+ pp_symbols symbols;
+ pp_ext ext;
+ slang_info_log *elog;
+ pp_cond_stack cond;
+} pp_state;
+
+static GLvoid
+pp_state_init (pp_state *self, slang_info_log *elog)
+{
+ self->line = 0;
+ self->file = 1;
+ self->version = 110;
+ pp_symbols_init (&self->symbols);
+ pp_ext_init (&self->ext);
+ self->elog = elog;
+
+ /* Initialize condition stack and create the global context. */
+ self->cond.top = &self->cond.stack[CONDITION_STACK_SIZE - 1];
+ self->cond.top->current = GL_TRUE;
+ self->cond.top->effective = GL_TRUE;
+ self->cond.top->else_allowed = GL_FALSE;
+ self->cond.top->endif_required = GL_FALSE;
+}
+
+static GLvoid
+pp_state_free (pp_state *self)
+{
+ pp_symbols_free (&self->symbols);
+}
+
+#define IS_FIRST_ID_CHAR(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') || (x) == '_')
+#define IS_NEXT_ID_CHAR(x) (IS_FIRST_ID_CHAR(x) || ((x) >= '0' && (x) <= '9'))
+#define IS_WHITE(x) ((x) == ' ' || (x) == '\n')
+#define IS_NULL(x) ((x) == '\0')
+
+#define SKIP_WHITE(x) do { while (IS_WHITE(*(x))) (x)++; } while (GL_FALSE)
+
+typedef struct
+{
+ slang_string *output;
+ const char *input;
+ pp_state *state;
+} expand_state;
+
+static GLboolean
+expand_defined (expand_state *e, slang_string *buffer)
+{
+ GLboolean in_paren = GL_FALSE;
+ const char *id;
+
+ /* Parse the optional opening parenthesis. */
+ SKIP_WHITE(e->input);
+ if (*e->input == '(') {
+ e->input++;
+ in_paren = GL_TRUE;
+ SKIP_WHITE(e->input);
+ }
+
+ /* Parse operand. */
+ if (!IS_FIRST_ID_CHAR(*e->input)) {
+ slang_info_log_error (e->state->elog,
+ "preprocess error: identifier expected after operator 'defined'.");
+ return GL_FALSE;
+ }
+ slang_string_reset (buffer);
+ slang_string_pushc (buffer, *e->input++);
+ while (IS_NEXT_ID_CHAR(*e->input))
+ slang_string_pushc (buffer, *e->input++);
+ id = slang_string_cstr (buffer);
+
+ /* Check if the operand is defined. Output 1 if it is defined, output 0 if not. */
+ if (pp_symbols_find (&e->state->symbols, id) == NULL)
+ slang_string_pushs (e->output, " 0 ", 3);
+ else
+ slang_string_pushs (e->output, " 1 ", 3);
+
+ /* Parse the closing parentehesis if the opening one was there. */
+ if (in_paren) {
+ SKIP_WHITE(e->input);
+ if (*e->input != ')') {
+ slang_info_log_error (e->state->elog, "preprocess error: ')' expected.");
+ return GL_FALSE;
+ }
+ e->input++;
+ SKIP_WHITE(e->input);
+ }
+ return GL_TRUE;
+}
+
+static GLboolean
+expand (expand_state *, pp_symbols *);
+
+static GLboolean
+expand_symbol (expand_state *e, pp_symbol *symbol)
+{
+ expand_state es;
+
+ /* If the macro has some parameters, we need to parse them. */
+ if (symbol->parameters.count != 0) {
+ GLuint i;
+
+ /* Parse the opening parenthesis. */
+ SKIP_WHITE(e->input);
+ if (*e->input != '(') {
+ slang_info_log_error (e->state->elog, "preprocess error: '(' expected.");
+ return GL_FALSE;
+ }
+ e->input++;
+ SKIP_WHITE(e->input);
+
+ /* Parse macro actual parameters. This can be anything, separated by a colon.
+ * TODO: What about nested/grouped parameters by parenthesis? */
+ for (i = 0; i < symbol->parameters.count; i++) {
+ if (*e->input == ')') {
+ slang_info_log_error (e->state->elog, "preprocess error: unexpected ')'.");
+ return GL_FALSE;
+ }
+
+ /* Eat all characters up to the comma or closing parentheses. */
+ pp_symbol_reset (&symbol->parameters.symbols[i]);
+ while (!IS_NULL(*e->input) && *e->input != ',' && *e->input != ')')
+ slang_string_pushc (&symbol->parameters.symbols[i].replacement, *e->input++);
+
+ /* If it was not the last paremeter, skip the comma. Otherwise, skip the
+ * closing parentheses. */
+ if (i + 1 == symbol->parameters.count) {
+ /* This is the last paremeter - skip the closing parentheses. */
+ if (*e->input != ')') {
+ slang_info_log_error (e->state->elog, "preprocess error: ')' expected.");
+ return GL_FALSE;
+ }
+ e->input++;
+ SKIP_WHITE(e->input);
+ }
+ else {
+ /* Skip the separating comma. */
+ if (*e->input != ',') {
+ slang_info_log_error (e->state->elog, "preprocess error: ',' expected.");
+ return GL_FALSE;
+ }
+ e->input++;
+ SKIP_WHITE(e->input);
+ }
+ }
+ }
+
+ /* Expand the macro. Use its parameters as a priority symbol list to expand
+ * macro parameters correctly. */
+ es.output = e->output;
+ es.input = slang_string_cstr (&symbol->replacement);
+ es.state = e->state;
+ slang_string_pushc (e->output, ' ');
+ if (!expand (&es, &symbol->parameters))
+ return GL_FALSE;
+ slang_string_pushc (e->output, ' ');
+ return GL_TRUE;
+}
+
+/*
+ * Function expand() expands source text from <input> to <output>. The expansion is made using
+ * the list passed in <symbols> parameter. It allows us to expand macro formal parameters with
+ * actual parameters. The global list of symbols from pp state is used when doing a recursive
+ * call of expand().
+ */
+
+static GLboolean
+expand (expand_state *e, pp_symbols *symbols)
+{
+ while (!IS_NULL(*e->input)) {
+ if (IS_FIRST_ID_CHAR(*e->input)) {
+ slang_string buffer;
+ const char *id;
+
+ /* Parse the identifier. */
+ slang_string_init (&buffer);
+ slang_string_pushc (&buffer, *e->input++);
+ while (IS_NEXT_ID_CHAR(*e->input))
+ slang_string_pushc (&buffer, *e->input++);
+ id = slang_string_cstr (&buffer);
+
+ /* Now check if the identifier is special in some way. The "defined" identifier is
+ * actually an operator that we must handle here and expand it either to " 0 " or " 1 ".
+ * The other identifiers start with "__" and we expand it to appropriate values
+ * taken from the preprocessor state. */
+ if (_mesa_strcmp (id, "defined") == 0) {
+ if (!expand_defined (e, &buffer))
+ return GL_FALSE;
+ }
+ else if (_mesa_strcmp (id, "__LINE__") == 0) {
+ slang_string_pushc (e->output, ' ');
+ slang_string_pushi (e->output, e->state->line);
+ slang_string_pushc (e->output, ' ');
+ }
+ else if (_mesa_strcmp (id, "__FILE__") == 0) {
+ slang_string_pushc (e->output, ' ');
+ slang_string_pushi (e->output, e->state->file);
+ slang_string_pushc (e->output, ' ');
+ }
+ else if (_mesa_strcmp (id, "__VERSION__") == 0) {
+ slang_string_pushc (e->output, ' ');
+ slang_string_pushi (e->output, e->state->version);
+ slang_string_pushc (e->output, ' ');
+ }
+ else {
+ pp_symbol *symbol;
+
+ /* The list of symbols from <symbols> take precedence over the list from <state>.
+ * Note that in some cases this is the same list so avoid double look-up. */
+ symbol = pp_symbols_find (symbols, id);
+ if (symbol == NULL && symbols != &e->state->symbols)
+ symbol = pp_symbols_find (&e->state->symbols, id);
+
+ /* If the symbol was found, recursively expand its definition. */
+ if (symbol != NULL) {
+ if (!expand_symbol (e, symbol)) {
+ slang_string_free (&buffer);
+ return GL_FALSE;
+ }
+ }
+ else {
+ slang_string_push (e->output, &buffer);
+ }
+ }
+ slang_string_free (&buffer);
+ }
+ else if (IS_WHITE(*e->input)) {
+ slang_string_pushc (e->output, *e->input++);
+ }
+ else {
+ while (!IS_WHITE(*e->input) && !IS_NULL(*e->input) && !IS_FIRST_ID_CHAR(*e->input))
+ slang_string_pushc (e->output, *e->input++);
+ }
+ }
+ return GL_TRUE;
+}
+
+static GLboolean
+parse_if (slang_string *output, const byte *prod, GLuint *pi, GLint *result, pp_state *state,
+ grammar eid)
+{
+ const char *text;
+ GLuint len;
+
+ text = (const char *) (&prod[*pi]);
+ len = _mesa_strlen (text);
+
+ if (state->cond.top->effective) {
+ slang_string expr;
+ GLuint count;
+ GLint results[2];
+ expand_state es;
+
+ /* Expand the expression. */
+ slang_string_init (&expr);
+ es.output = &expr;
+ es.input = text;
+ es.state = state;
+ if (!expand (&es, &state->symbols))
+ return GL_FALSE;
+
+ /* Execute the expression. */
+ count = execute_expressions (output, eid, (const byte *) (slang_string_cstr (&expr)),
+ results, state->elog);
+ slang_string_free (&expr);
+ if (count != 1)
+ return GL_FALSE;
+ *result = results[0];
+ }
+ else {
+ /* The directive is dead. */
+ *result = 0;
+ }
+
+ *pi += len + 1;
+ return GL_TRUE;
+}
+
+#define ESCAPE_TOKEN 0
+
+#define TOKEN_END 0
+#define TOKEN_DEFINE 1
+#define TOKEN_UNDEF 2
+#define TOKEN_IF 3
+#define TOKEN_ELSE 4
+#define TOKEN_ELIF 5
+#define TOKEN_ENDIF 6
+#define TOKEN_ERROR 7
+#define TOKEN_PRAGMA 8
+#define TOKEN_EXTENSION 9
+#define TOKEN_LINE 10
+
+#define PARAM_END 0
+#define PARAM_PARAMETER 1
+
+#define BEHAVIOR_REQUIRE 1
+#define BEHAVIOR_ENABLE 2
+#define BEHAVIOR_WARN 3
+#define BEHAVIOR_DISABLE 4
+
+static GLboolean
+preprocess_source (slang_string *output, const char *source, grammar pid, grammar eid,
+ slang_info_log *elog)
+{
+ byte *prod;
+ GLuint size, i;
+ pp_state state;
+
+ if (!grammar_fast_check (pid, (const byte *) (source), &prod, &size, 65536)) {
+ grammar_error_to_log (elog);
+ return GL_FALSE;
+ }
+
+ pp_state_init (&state, elog);
+
+ i = 0;
+ while (i < size) {
+ if (prod[i] != ESCAPE_TOKEN) {
+ if (state.cond.top->effective) {
+ slang_string input;
+ expand_state es;
+
+ /* Eat only one line of source code to expand it.
+ * FIXME: This approach has one drawback. If a macro with parameters spans across
+ * multiple lines, the preprocessor will raise an error. */
+ slang_string_init (&input);
+ while (prod[i] != '\0' && prod[i] != '\n')
+ slang_string_pushc (&input, prod[i++]);
+ if (prod[i] != '\0')
+ slang_string_pushc (&input, prod[i++]);
+
+ /* Increment line number. */
+ state.line++;
+
+ es.output = output;
+ es.input = slang_string_cstr (&input);
+ es.state = &state;
+ if (!expand (&es, &state.symbols))
+ goto error;
+
+ slang_string_free (&input);
+ }
+ else {
+ /* Condition stack is disabled - keep track on line numbers and output only newlines. */
+ if (prod[i] == '\n') {
+ state.line++;
+ /*pp_annotate (output, "%c", prod[i]);*/
+ }
+ else {
+ /*pp_annotate (output, "%c", prod[i]);*/
+ }
+ i++;
+ }
+ }
+ else {
+ const char *id;
+ GLuint idlen;
+
+ i++;
+ switch (prod[i++]) {
+
+ case TOKEN_END:
+ /* End of source string.
+ * Check if all #ifs have been terminated by matching #endifs.
+ * On condition stack there should be only the global condition context. */
+ if (state.cond.top->endif_required) {
+ slang_info_log_error (elog, "end of source without matching #endif.");
+ return GL_FALSE;
+ }
+ break;
+
+ case TOKEN_DEFINE:
+ {
+ pp_symbol *symbol = NULL;
+
+ /* Parse macro name. */
+ id = (const char *) (&prod[i]);
+ idlen = _mesa_strlen (id);
+ if (state.cond.top->effective) {
+ pp_annotate (output, "// #define %s(", id);
+
+ /* If the symbol is already defined, override it. */
+ symbol = pp_symbols_find (&state.symbols, id);
+ if (symbol == NULL) {
+ symbol = pp_symbols_push (&state.symbols);
+ if (symbol == NULL)
+ goto error;
+ slang_string_pushs (&symbol->name, id, idlen);
+ }
+ else {
+ pp_symbol_reset (symbol);
+ }
+ }
+ i += idlen + 1;
+
+ /* Parse optional macro parameters. */
+ while (prod[i++] != PARAM_END) {
+ if (state.cond.top->effective) {
+ pp_symbol *param;
+
+ id = (const char *) (&prod[i]);
+ idlen = _mesa_strlen (id);
+ pp_annotate (output, "%s, ", id);
+ param = pp_symbols_push (&symbol->parameters);
+ if (param == NULL)
+ goto error;
+ slang_string_pushs (&param->name, id, idlen);
+ }
+ i += idlen + 1;
+ }
+
+ /* Parse macro replacement. */
+ id = (const char *) (&prod[i]);
+ idlen = _mesa_strlen (id);
+ if (state.cond.top->effective) {
+ pp_annotate (output, ") %s", id);
+ slang_string_pushs (&symbol->replacement, id, idlen);
+ }
+ i += idlen + 1;
+ }
+ break;
+
+ case TOKEN_UNDEF:
+ id = (const char *) (&prod[i]);
+ i += _mesa_strlen (id) + 1;
+ if (state.cond.top->effective) {
+ pp_symbol *symbol;
+
+ pp_annotate (output, "// #undef %s", id);
+ /* Try to find symbol with given name and remove it. */
+ symbol = pp_symbols_find (&state.symbols, id);
+ if (symbol != NULL)
+ if (!pp_symbols_erase (&state.symbols, symbol))
+ goto error;
+ }
+ break;
+
+ case TOKEN_IF:
+ {
+ GLint result;
+
+ /* Parse #if expression end execute it. */
+ pp_annotate (output, "// #if ");
+ if (!parse_if (output, prod, &i, &result, &state, eid))
+ goto error;
+
+ /* Push new condition on the stack. */
+ if (!pp_cond_stack_push (&state.cond, state.elog))
+ goto error;
+ state.cond.top->current = result ? GL_TRUE : GL_FALSE;
+ state.cond.top->else_allowed = GL_TRUE;
+ state.cond.top->endif_required = GL_TRUE;
+ pp_cond_stack_reevaluate (&state.cond);
+ }
+ break;
+
+ case TOKEN_ELSE:
+ /* Check if #else is alloved here. */
+ if (!state.cond.top->else_allowed) {
+ slang_info_log_error (elog, "#else without matching #if.");
+ goto error;
+ }
+
+ /* Negate current condition and reevaluate it. */
+ state.cond.top->current = !state.cond.top->current;
+ state.cond.top->else_allowed = GL_FALSE;
+ pp_cond_stack_reevaluate (&state.cond);
+ if (state.cond.top->effective)
+ pp_annotate (output, "// #else");
+ break;
+
+ case TOKEN_ELIF:
+ /* Check if #elif is alloved here. */
+ if (!state.cond.top->else_allowed) {
+ slang_info_log_error (elog, "#elif without matching #if.");
+ goto error;
+ }
+
+ /* Negate current condition and reevaluate it. */
+ state.cond.top->current = !state.cond.top->current;
+ pp_cond_stack_reevaluate (&state.cond);
+
+ if (state.cond.top->effective)
+ pp_annotate (output, "// #elif ");
+
+ {
+ GLint result;
+
+ /* Parse #elif expression end execute it. */
+ if (!parse_if (output, prod, &i, &result, &state, eid))
+ goto error;
+
+ /* Update current condition and reevaluate it. */
+ state.cond.top->current = result ? GL_TRUE : GL_FALSE;
+ pp_cond_stack_reevaluate (&state.cond);
+ }
+ break;
+
+ case TOKEN_ENDIF:
+ /* Check if #endif is alloved here. */
+ if (!state.cond.top->endif_required) {
+ slang_info_log_error (elog, "#endif without matching #if.");
+ goto error;
+ }
+
+ /* Pop the condition off the stack. */
+ state.cond.top++;
+ if (state.cond.top->effective)
+ pp_annotate (output, "// #endif");
+ break;
+
+ case TOKEN_EXTENSION:
+ /* Parse the extension name. */
+ id = (const char *) (&prod[i]);
+ i += _mesa_strlen (id) + 1;
+ if (state.cond.top->effective)
+ pp_annotate (output, "// #extension %s: ", id);
+
+ /* Parse and apply extension behavior. */
+ if (state.cond.top->effective) {
+ switch (prod[i++]) {
+
+ case BEHAVIOR_REQUIRE:
+ pp_annotate (output, "require");
+ if (!pp_ext_set (&state.ext, id, GL_TRUE)) {
+ if (_mesa_strcmp (id, "all") == 0) {
+ slang_info_log_error (elog, "require: bad behavior for #extension all.");
+ goto error;
+ }
+ else {
+ slang_info_log_error (elog, "%s: required extension is not supported.", id);
+ goto error;
+ }
+ }
+ break;
+
+ case BEHAVIOR_ENABLE:
+ pp_annotate (output, "enable");
+ if (!pp_ext_set (&state.ext, id, GL_TRUE)) {
+ if (_mesa_strcmp (id, "all") == 0) {
+ slang_info_log_error (elog, "enable: bad behavior for #extension all.");
+ goto error;
+ }
+ else {
+ slang_info_log_warning (elog, "%s: enabled extension is not supported.", id);
+ }
+ }
+ break;
+
+ case BEHAVIOR_WARN:
+ pp_annotate (output, "warn");
+ if (!pp_ext_set (&state.ext, id, GL_TRUE)) {
+ if (_mesa_strcmp (id, "all") != 0) {
+ slang_info_log_warning (elog, "%s: enabled extension is not supported.", id);
+ }
+ }
+ break;
+
+ case BEHAVIOR_DISABLE:
+ pp_annotate (output, "disable");
+ if (!pp_ext_set (&state.ext, id, GL_FALSE)) {
+ if (_mesa_strcmp (id, "all") == 0) {
+ pp_ext_disable_all (&state.ext);
+ }
+ else {
+ slang_info_log_warning (elog, "%s: disabled extension is not supported.", id);
+ }
+ }
+ break;
+
+ default:
+ assert (0);
+ }
+ }
+ break;
+
+ case TOKEN_LINE:
+ id = (const char *) (&prod[i]);
+ i += _mesa_strlen (id) + 1;
+
+ if (state.cond.top->effective) {
+ slang_string buffer;
+ GLuint count;
+ GLint results[2];
+ expand_state es;
+
+ slang_string_init (&buffer);
+ state.line++;
+ es.output = &buffer;
+ es.input = id;
+ es.state = &state;
+ if (!expand (&es, &state.symbols))
+ goto error;
+
+ pp_annotate (output, "// #line ");
+ count = execute_expressions (output, eid,
+ (const byte *) (slang_string_cstr (&buffer)),
+ results, state.elog);
+ slang_string_free (&buffer);
+ if (count == 0)
+ goto error;
+
+ state.line = results[0] - 1;
+ if (count == 2)
+ state.file = results[1];
+ }
+ break;
+ }
+ }
+ }
+
+ /* Check for missing #endifs. */
+ if (state.cond.top->endif_required) {
+ slang_info_log_error (elog, "#endif expected but end of source found.");
+ goto error;
+ }
+
+ pp_state_free (&state);
+ return GL_TRUE;
+
+error:
+ pp_state_free (&state);
+ return GL_FALSE;
+}
+
+GLboolean
+_slang_preprocess_directives (slang_string *output, const char *input, slang_info_log *elog)
+{
+ grammar pid, eid;
+ GLboolean success;
+
+ pid = grammar_load_from_text ((const byte *) (slang_pp_directives_syn));
+ if (pid == 0) {
+ grammar_error_to_log (elog);
+ return GL_FALSE;
+ }
+ eid = grammar_load_from_text ((const byte *) (slang_pp_expression_syn));
+ if (eid == 0) {
+ grammar_error_to_log (elog);
+ grammar_destroy (pid);
+ return GL_FALSE;
+ }
+ success = preprocess_source (output, input, pid, eid, elog);
+ grammar_destroy (eid);
+ grammar_destroy (pid);
+ return success;
+}
+
diff --git a/src/mesa/shader/slang/slang_preprocess.h b/src/mesa/shader/slang/slang_preprocess.h
index b55852dc4c0..f83e6e6e3fc 100644
--- a/src/mesa/shader/slang/slang_preprocess.h
+++ b/src/mesa/shader/slang/slang_preprocess.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -34,6 +34,9 @@ extern "C" {
GLboolean
_slang_preprocess_version (const char *, GLuint *, GLuint *, slang_info_log *);
+GLboolean
+_slang_preprocess_directives (slang_string *output, const char *input, slang_info_log *);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c
index 20ea6abae59..256d52455db 100644
--- a/src/mesa/shader/slang/slang_utility.c
+++ b/src/mesa/shader/slang/slang_utility.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -36,77 +36,187 @@ char *slang_string_concat (char *dst, const char *src)
return _mesa_strcpy (dst + _mesa_strlen (dst), src);
}
+/* slang_string */
+
+GLvoid
+slang_string_init (slang_string *self)
+{
+ self->data = NULL;
+ self->capacity = 0;
+ self->length = 0;
+ self->fail = GL_FALSE;
+}
+
+GLvoid
+slang_string_free (slang_string *self)
+{
+ if (self->data != NULL)
+ _mesa_free (self->data);
+}
+
+GLvoid
+slang_string_reset (slang_string *self)
+{
+ self->length = 0;
+ self->fail = GL_FALSE;
+}
+
+static GLboolean
+grow (slang_string *self, GLuint size)
+{
+ if (self->fail)
+ return GL_FALSE;
+ if (size > self->capacity) {
+ /* do not overflow 32-bit range */
+ assert (size < 0x80000000);
+
+ self->data = (char *) (_mesa_realloc (self->data, self->capacity, size * 2));
+ self->capacity = size * 2;
+ if (self->data == NULL) {
+ self->capacity = 0;
+ self->fail = GL_TRUE;
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+GLvoid
+slang_string_push (slang_string *self, const slang_string *str)
+{
+ if (str->fail) {
+ self->fail = GL_TRUE;
+ return;
+ }
+ if (grow (self, self->length + str->length)) {
+ _mesa_memcpy (&self->data[self->length], str->data, str->length);
+ self->length += str->length;
+ }
+}
+
+GLvoid
+slang_string_pushc (slang_string *self, const char c)
+{
+ if (grow (self, self->length + 1)) {
+ self->data[self->length] = c;
+ self->length++;
+ }
+}
+
+GLvoid
+slang_string_pushs (slang_string *self, const char *cstr, GLuint len)
+{
+ if (grow (self, self->length + len)) {
+ _mesa_memcpy (&self->data[self->length], cstr, len);
+ self->length += len;
+ }
+}
+
+GLvoid
+slang_string_pushi (slang_string *self, GLint i)
+{
+ char buffer[12];
+
+ _mesa_sprintf (buffer, "%d", i);
+ slang_string_pushs (self, buffer, strlen (buffer));
+}
+
+const char *
+slang_string_cstr (slang_string *self)
+{
+ if (grow (self, self->length + 1))
+ self->data[self->length] = '\0';
+ return self->data;
+}
+
/* slang_atom_pool */
-void slang_atom_pool_construct (slang_atom_pool *pool)
+void
+slang_atom_pool_construct(slang_atom_pool * pool)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
- pool->entries[i] = NULL;
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
+ pool->entries[i] = NULL;
}
-void slang_atom_pool_destruct (slang_atom_pool *pool)
+void
+slang_atom_pool_destruct (slang_atom_pool * pool)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
- {
- slang_atom_entry *entry;
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) {
+ slang_atom_entry * entry;
- entry = pool->entries[i];
- while (entry != NULL)
- {
- slang_atom_entry *next;
-
- next = entry->next;
- slang_alloc_free (entry->id);
- slang_alloc_free (entry);
- entry = next;
+ entry = pool->entries[i];
+ while (entry != NULL) {
+ slang_atom_entry *next;
+
+ next = entry->next;
+ slang_alloc_free(entry->id);
+ slang_alloc_free(entry);
+ entry = next;
}
}
}
-slang_atom slang_atom_pool_atom (slang_atom_pool *pool, const char *id)
+/*
+ * Search the atom pool for an atom with a given name.
+ * If atom is not found, create and add it to the pool.
+ * Returns ATOM_NULL if the atom was not found and the function failed to create a new atom.
+ */
+slang_atom
+slang_atom_pool_atom(slang_atom_pool * pool, const char * id)
{
- GLuint hash;
- const char *p = id;
- slang_atom_entry **entry;
-
- hash = 0;
- while (*p != '\0')
- {
- GLuint g;
-
- hash = (hash << 4) + (GLuint) *p++;
- g = hash & 0xf0000000;
- if (g != 0)
- hash ^= g >> 24;
- hash &= ~g;
- }
- hash %= SLANG_ATOM_POOL_SIZE;
-
- entry = &pool->entries[hash];
- while (*entry != NULL)
- {
- if (slang_string_compare ((**entry).id, id) == 0)
- return (slang_atom) (**entry).id;
- entry = &(**entry).next;
- }
-
- *entry = (slang_atom_entry *) slang_alloc_malloc (sizeof (slang_atom_entry));
- if (*entry == NULL)
- return SLANG_ATOM_NULL;
-
- (**entry).next = NULL;
- (**entry).id = slang_string_duplicate (id);
- if ((**entry).id == NULL)
- return SLANG_ATOM_NULL;
- return (slang_atom) (**entry).id;
+ GLuint hash;
+ const char * p = id;
+ slang_atom_entry ** entry;
+
+ /* Hash a given string to a number in the range [0, ATOM_POOL_SIZE). */
+ hash = 0;
+ while (*p != '\0') {
+ GLuint g;
+
+ hash = (hash << 4) + (GLuint) (*p++);
+ g = hash & 0xf0000000;
+ if (g != 0)
+ hash ^= g >> 24;
+ hash &= ~g;
+ }
+ hash %= SLANG_ATOM_POOL_SIZE;
+
+ /* Now the hash points to a linked list of atoms with names that have the same hash value.
+ * Search the linked list for a given name. */
+ entry = &pool->entries[hash];
+ while (*entry != NULL) {
+ /* If the same, return the associated atom. */
+ if (slang_string_compare((**entry).id, id) == 0)
+ return (slang_atom) (**entry).id;
+ /* Grab the next atom in the linked list. */
+ entry = &(**entry).next;
+ }
+
+ /* Okay, we have not found an atom. Create a new entry for it.
+ * Note that the <entry> points to the last entry's <next> field. */
+ *entry = (slang_atom_entry *) (slang_alloc_malloc(sizeof(slang_atom_entry)));
+ if (*entry == NULL)
+ return SLANG_ATOM_NULL;
+
+ /* Initialize a new entry. Because we'll need the actual name of the atom, we use the pointer
+ * to this string as an actual atom's value. */
+ (**entry).next = NULL;
+ (**entry).id = slang_string_duplicate(id);
+ if ((**entry).id == NULL)
+ return SLANG_ATOM_NULL;
+ return (slang_atom) (**entry).id;
}
-const char *slang_atom_pool_id (slang_atom_pool *pool, slang_atom atom)
+/*
+ * Return the name of a given atom.
+ */
+const char *
+slang_atom_pool_id(slang_atom_pool * pool, slang_atom atom)
{
- return (const char *) atom;
+ return (const char *) (atom);
}
diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h
index 7a1997e5597..565de4e4b02 100644
--- a/src/mesa/shader/slang/slang_utility.h
+++ b/src/mesa/shader/slang/slang_utility.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -44,6 +44,42 @@ extern "C" {
char *slang_string_concat (char *, const char *);
+/* slang_string */
+
+typedef struct
+{
+ char *data;
+ GLuint length;
+ GLuint capacity;
+ GLboolean fail;
+} slang_string;
+
+GLvoid
+slang_string_init (slang_string *);
+
+GLvoid
+slang_string_free (slang_string *);
+
+GLvoid
+slang_string_reset (slang_string *);
+
+GLvoid
+slang_string_push (slang_string *, const slang_string *);
+
+GLvoid
+slang_string_pushc (slang_string *, const char);
+
+GLvoid
+slang_string_pushs (slang_string *, const char *, GLuint);
+
+GLvoid
+slang_string_pushi (slang_string *, GLint);
+
+const char *
+slang_string_cstr (slang_string *);
+
+/* slang_atom */
+
typedef GLvoid *slang_atom;
#define SLANG_ATOM_NULL ((slang_atom) 0)
diff --git a/src/mesa/shader/slang/sources b/src/mesa/shader/slang/sources
new file mode 100644
index 00000000000..00d617fa8af
--- /dev/null
+++ b/src/mesa/shader/slang/sources
@@ -0,0 +1,44 @@
+MESA_SHADER_SLANG_SOURCES = \
+slang_analyse.c \
+slang_assemble_assignment.c \
+slang_assemble.c \
+slang_assemble_conditional.c \
+slang_assemble_constructor.c \
+slang_assemble_typeinfo.c \
+slang_compile.c \
+slang_compile_function.c \
+slang_compile_operation.c \
+slang_compile_struct.c \
+slang_compile_variable.c \
+slang_execute.c \
+slang_execute_x86.c \
+slang_export.c \
+slang_library_texsample.c \
+slang_library_noise.c \
+slang_link.c \
+slang_preprocess.c \
+slang_storage.c \
+slang_utility.c
+
+MESA_SHADER_SLANG_HEADERS = \
+slang_analyse.h \
+slang_assemble.h \
+slang_assemble_assignment.h \
+slang_assemble_conditional.h \
+slang_assemble_constructor.h \
+slang_assemble_typeinfo.h \
+slang_compile.h \
+slang_compile_function.h \
+slang_compile_operation.h \
+slang_compile_struct.h \
+slang_compile_variable.h \
+slang_execute.h \
+slang_export.h \
+slang_library_noise.h \
+slang_library_texsample.h \
+slang_link.h \
+slang_mesa.h \
+slang_preprocess.h \
+slang_storage.h \
+slang_utility.h \
+traverse_wrap.h
diff --git a/src/mesa/shader/sources b/src/mesa/shader/sources
new file mode 100644
index 00000000000..27871872766
--- /dev/null
+++ b/src/mesa/shader/sources
@@ -0,0 +1,28 @@
+# List of source files in this directory used for X.org xserver build
+MESA_SHADER_SOURCES = \
+arbprogparse.c \
+arbprogram.c \
+atifragshader.c \
+nvfragparse.c \
+nvprogram.c \
+nvvertexec.c \
+nvvertparse.c \
+program.c \
+programopt.c \
+shaderobjects.c \
+shaderobjects_3dlabs.c
+
+MESA_SHADER_HEADERS = \
+arbprogparse.h \
+arbprogram.h \
+arbprogram_syn.h \
+atifragshader.h \
+nvfragparse.h \
+nvprogram.h \
+nvvertexec.h \
+nvvertparse.h \
+programopt.h \
+program.h \
+program_instruction.h \
+shaderobjects.h \
+shaderobjects_3dlabs.h
diff --git a/src/mesa/sources b/src/mesa/sources
index 8a13010c27b..09692c6f155 100644
--- a/src/mesa/sources
+++ b/src/mesa/sources
@@ -39,6 +39,7 @@ MAIN_SOURCES = \
main/light.c \
main/lines.c \
main/matrix.c \
+ main/mipmap.c \
main/mm.c \
main/occlude.c \
main/pixel.c \
@@ -307,7 +308,7 @@ FBDEV_DRIVER_SOURCES = \
ALL_SOURCES = \
$(GLAPI_SOURCES) \
$(SOLO_SOURCES) \
- $(X86_SOURCES) \
+ $(ASM_SOURCES) \
$(COMMON_DRIVER_SOURCES)\
$(X11_DRIVER_SOURCES) \
$(FBDEV_DRIVER_SOURCES) \
diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S
index bf2bc839082..c2a8ca6154d 100644
--- a/src/mesa/sparc/glapi_sparc.S
+++ b/src/mesa/sparc/glapi_sparc.S
@@ -473,9 +473,28 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glMultiTexCoord4ivARB ; .type glMultiTexCoord4ivARB,#function
.globl glMultiTexCoord4sARB ; .type glMultiTexCoord4sARB,#function
.globl glMultiTexCoord4svARB ; .type glMultiTexCoord4svARB,#function
+ .globl glAttachShader ; .type glAttachShader,#function
+ .globl glCreateProgram ; .type glCreateProgram,#function
+ .globl glCreateShader ; .type glCreateShader,#function
+ .globl glDeleteProgram ; .type glDeleteProgram,#function
+ .globl glDeleteShader ; .type glDeleteShader,#function
+ .globl glDetachShader ; .type glDetachShader,#function
+ .globl glGetAttachedShaders ; .type glGetAttachedShaders,#function
+ .globl glGetProgramInfoLog ; .type glGetProgramInfoLog,#function
+ .globl glGetProgramiv ; .type glGetProgramiv,#function
+ .globl glGetShaderInfoLog ; .type glGetShaderInfoLog,#function
+ .globl glGetShaderiv ; .type glGetShaderiv,#function
+ .globl glIsProgram ; .type glIsProgram,#function
+ .globl glIsShader ; .type glIsShader,#function
.globl glStencilFuncSeparate ; .type glStencilFuncSeparate,#function
.globl glStencilMaskSeparate ; .type glStencilMaskSeparate,#function
.globl glStencilOpSeparate ; .type glStencilOpSeparate,#function
+ .globl glUniformMatrix2x3fv ; .type glUniformMatrix2x3fv,#function
+ .globl glUniformMatrix2x4fv ; .type glUniformMatrix2x4fv,#function
+ .globl glUniformMatrix3x2fv ; .type glUniformMatrix3x2fv,#function
+ .globl glUniformMatrix3x4fv ; .type glUniformMatrix3x4fv,#function
+ .globl glUniformMatrix4x2fv ; .type glUniformMatrix4x2fv,#function
+ .globl glUniformMatrix4x3fv ; .type glUniformMatrix4x3fv,#function
.globl glLoadTransposeMatrixdARB ; .type glLoadTransposeMatrixdARB,#function
.globl glLoadTransposeMatrixfARB ; .type glLoadTransposeMatrixfARB,#function
.globl glMultTransposeMatrixdARB ; .type glMultTransposeMatrixdARB,#function
@@ -608,30 +627,14 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function
.globl glDrawBuffersARB ; .type glDrawBuffersARB,#function
.globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function
- .globl gl_dispatch_stub_543 ; .type gl_dispatch_stub_543,#function
- .globl gl_dispatch_stub_544 ; .type gl_dispatch_stub_544,#function
- .globl gl_dispatch_stub_545 ; .type gl_dispatch_stub_545,#function
- .globl gl_dispatch_stub_546 ; .type gl_dispatch_stub_546,#function
- .globl gl_dispatch_stub_547 ; .type gl_dispatch_stub_547,#function
- .globl gl_dispatch_stub_548 ; .type gl_dispatch_stub_548,#function
- .globl gl_dispatch_stub_549 ; .type gl_dispatch_stub_549,#function
- .globl gl_dispatch_stub_550 ; .type gl_dispatch_stub_550,#function
- .globl gl_dispatch_stub_551 ; .type gl_dispatch_stub_551,#function
- .globl gl_dispatch_stub_552 ; .type gl_dispatch_stub_552,#function
- .globl gl_dispatch_stub_553 ; .type gl_dispatch_stub_553,#function
- .globl gl_dispatch_stub_554 ; .type gl_dispatch_stub_554,#function
- .globl gl_dispatch_stub_555 ; .type gl_dispatch_stub_555,#function
- .globl gl_dispatch_stub_556 ; .type gl_dispatch_stub_556,#function
- .globl gl_dispatch_stub_557 ; .type gl_dispatch_stub_557,#function
- .globl gl_dispatch_stub_558 ; .type gl_dispatch_stub_558,#function
- .globl gl_dispatch_stub_559 ; .type gl_dispatch_stub_559,#function
- .globl gl_dispatch_stub_560 ; .type gl_dispatch_stub_560,#function
- .globl gl_dispatch_stub_561 ; .type gl_dispatch_stub_561,#function
- .globl glAreTexturesResidentEXT ; .type glAreTexturesResidentEXT,#function
- .globl glGenTexturesEXT ; .type glGenTexturesEXT,#function
- .globl glIsTextureEXT ; .type glIsTextureEXT,#function
+ .globl gl_dispatch_stub_562 ; .type gl_dispatch_stub_562,#function
+ .globl gl_dispatch_stub_563 ; .type gl_dispatch_stub_563,#function
+ .globl gl_dispatch_stub_564 ; .type gl_dispatch_stub_564,#function
.globl gl_dispatch_stub_565 ; .type gl_dispatch_stub_565,#function
.globl gl_dispatch_stub_566 ; .type gl_dispatch_stub_566,#function
+ .globl gl_dispatch_stub_567 ; .type gl_dispatch_stub_567,#function
+ .globl gl_dispatch_stub_568 ; .type gl_dispatch_stub_568,#function
+ .globl gl_dispatch_stub_569 ; .type gl_dispatch_stub_569,#function
.globl glColorPointerEXT ; .type glColorPointerEXT,#function
.globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function
.globl glIndexPointerEXT ; .type glIndexPointerEXT,#function
@@ -642,8 +645,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function
.globl glLockArraysEXT ; .type glLockArraysEXT,#function
.globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function
- .globl gl_dispatch_stub_577 ; .type gl_dispatch_stub_577,#function
- .globl gl_dispatch_stub_578 ; .type gl_dispatch_stub_578,#function
+ .globl gl_dispatch_stub_580 ; .type gl_dispatch_stub_580,#function
+ .globl gl_dispatch_stub_581 ; .type gl_dispatch_stub_581,#function
.globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function
.globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function
.globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function
@@ -668,7 +671,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function
.globl glFogCoordfEXT ; .type glFogCoordfEXT,#function
.globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function
- .globl gl_dispatch_stub_603 ; .type gl_dispatch_stub_603,#function
+ .globl gl_dispatch_stub_606 ; .type gl_dispatch_stub_606,#function
.globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function
.globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function
.globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function
@@ -710,15 +713,15 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function
.globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function
.globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function
- .globl gl_dispatch_stub_645 ; .type gl_dispatch_stub_645,#function
- .globl gl_dispatch_stub_646 ; .type gl_dispatch_stub_646,#function
- .globl gl_dispatch_stub_647 ; .type gl_dispatch_stub_647,#function
.globl gl_dispatch_stub_648 ; .type gl_dispatch_stub_648,#function
.globl gl_dispatch_stub_649 ; .type gl_dispatch_stub_649,#function
.globl gl_dispatch_stub_650 ; .type gl_dispatch_stub_650,#function
.globl gl_dispatch_stub_651 ; .type gl_dispatch_stub_651,#function
.globl gl_dispatch_stub_652 ; .type gl_dispatch_stub_652,#function
.globl gl_dispatch_stub_653 ; .type gl_dispatch_stub_653,#function
+ .globl gl_dispatch_stub_654 ; .type gl_dispatch_stub_654,#function
+ .globl gl_dispatch_stub_655 ; .type gl_dispatch_stub_655,#function
+ .globl gl_dispatch_stub_656 ; .type gl_dispatch_stub_656,#function
.globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function
.globl glBindProgramNV ; .type glBindProgramNV,#function
.globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function
@@ -799,19 +802,19 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function
.globl glPointParameteriNV ; .type glPointParameteriNV,#function
.globl glPointParameterivNV ; .type glPointParameterivNV,#function
- .globl gl_dispatch_stub_734 ; .type gl_dispatch_stub_734,#function
- .globl gl_dispatch_stub_735 ; .type gl_dispatch_stub_735,#function
- .globl gl_dispatch_stub_736 ; .type gl_dispatch_stub_736,#function
.globl gl_dispatch_stub_737 ; .type gl_dispatch_stub_737,#function
.globl gl_dispatch_stub_738 ; .type gl_dispatch_stub_738,#function
+ .globl gl_dispatch_stub_739 ; .type gl_dispatch_stub_739,#function
+ .globl gl_dispatch_stub_740 ; .type gl_dispatch_stub_740,#function
+ .globl gl_dispatch_stub_741 ; .type gl_dispatch_stub_741,#function
.globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function
.globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function
.globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function
.globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function
.globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function
.globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function
- .globl gl_dispatch_stub_745 ; .type gl_dispatch_stub_745,#function
- .globl gl_dispatch_stub_746 ; .type gl_dispatch_stub_746,#function
+ .globl gl_dispatch_stub_748 ; .type gl_dispatch_stub_748,#function
+ .globl gl_dispatch_stub_749 ; .type gl_dispatch_stub_749,#function
.globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function
.globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function
.globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function
@@ -825,15 +828,15 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glGenRenderbuffersEXT ; .type glGenRenderbuffersEXT,#function
.globl glGenerateMipmapEXT ; .type glGenerateMipmapEXT,#function
.globl glGetFramebufferAttachmentParameterivEXT ; .type glGetFramebufferAttachmentParameterivEXT,#function
- .globl gl_dispatch_stub_760 ; .type gl_dispatch_stub_760,#function
- .globl gl_dispatch_stub_761 ; .type gl_dispatch_stub_761,#function
.globl glGetRenderbufferParameterivEXT ; .type glGetRenderbufferParameterivEXT,#function
.globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function
.globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function
.globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function
- .globl gl_dispatch_stub_766 ; .type gl_dispatch_stub_766,#function
.globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function
.globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function
+ .globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function
+ .globl gl_dispatch_stub_770 ; .type gl_dispatch_stub_770,#function
+ .globl gl_dispatch_stub_771 ; .type gl_dispatch_stub_771,#function
.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function
_mesa_sparc_glapi_begin:
@@ -1245,9 +1248,28 @@ _mesa_sparc_glapi_begin:
GL_STUB(glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB)
GL_STUB(glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB)
GL_STUB(glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB)
+ GL_STUB(glAttachShader, _gloffset_AttachShader)
+ GL_STUB(glCreateProgram, _gloffset_CreateProgram)
+ GL_STUB(glCreateShader, _gloffset_CreateShader)
+ GL_STUB(glDeleteProgram, _gloffset_DeleteProgram)
+ GL_STUB(glDeleteShader, _gloffset_DeleteShader)
+ GL_STUB(glDetachShader, _gloffset_DetachShader)
+ GL_STUB(glGetAttachedShaders, _gloffset_GetAttachedShaders)
+ GL_STUB(glGetProgramInfoLog, _gloffset_GetProgramInfoLog)
+ GL_STUB(glGetProgramiv, _gloffset_GetProgramiv)
+ GL_STUB(glGetShaderInfoLog, _gloffset_GetShaderInfoLog)
+ GL_STUB(glGetShaderiv, _gloffset_GetShaderiv)
+ GL_STUB(glIsProgram, _gloffset_IsProgram)
+ GL_STUB(glIsShader, _gloffset_IsShader)
GL_STUB(glStencilFuncSeparate, _gloffset_StencilFuncSeparate)
GL_STUB(glStencilMaskSeparate, _gloffset_StencilMaskSeparate)
GL_STUB(glStencilOpSeparate, _gloffset_StencilOpSeparate)
+ GL_STUB(glUniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv)
+ GL_STUB(glUniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv)
+ GL_STUB(glUniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv)
+ GL_STUB(glUniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv)
+ GL_STUB(glUniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv)
+ GL_STUB(glUniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv)
GL_STUB(glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB)
GL_STUB(glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB)
GL_STUB(glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB)
@@ -1380,30 +1402,14 @@ _mesa_sparc_glapi_begin:
GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB)
GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB)
GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT)
- GL_STUB(gl_dispatch_stub_543, _gloffset__dispatch_stub_543)
- GL_STUB(gl_dispatch_stub_544, _gloffset__dispatch_stub_544)
- GL_STUB(gl_dispatch_stub_545, _gloffset__dispatch_stub_545)
- GL_STUB(gl_dispatch_stub_546, _gloffset__dispatch_stub_546)
- GL_STUB(gl_dispatch_stub_547, _gloffset__dispatch_stub_547)
- GL_STUB(gl_dispatch_stub_548, _gloffset__dispatch_stub_548)
- GL_STUB(gl_dispatch_stub_549, _gloffset__dispatch_stub_549)
- GL_STUB(gl_dispatch_stub_550, _gloffset__dispatch_stub_550)
- GL_STUB(gl_dispatch_stub_551, _gloffset__dispatch_stub_551)
- GL_STUB(gl_dispatch_stub_552, _gloffset__dispatch_stub_552)
- GL_STUB(gl_dispatch_stub_553, _gloffset__dispatch_stub_553)
- GL_STUB(gl_dispatch_stub_554, _gloffset__dispatch_stub_554)
- GL_STUB(gl_dispatch_stub_555, _gloffset__dispatch_stub_555)
- GL_STUB(gl_dispatch_stub_556, _gloffset__dispatch_stub_556)
- GL_STUB(gl_dispatch_stub_557, _gloffset__dispatch_stub_557)
- GL_STUB(gl_dispatch_stub_558, _gloffset__dispatch_stub_558)
- GL_STUB(gl_dispatch_stub_559, _gloffset__dispatch_stub_559)
- GL_STUB(gl_dispatch_stub_560, _gloffset__dispatch_stub_560)
- GL_STUB(gl_dispatch_stub_561, _gloffset__dispatch_stub_561)
- GL_STUB(glAreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT)
- GL_STUB(glGenTexturesEXT, _gloffset_GenTexturesEXT)
- GL_STUB(glIsTextureEXT, _gloffset_IsTextureEXT)
+ GL_STUB(gl_dispatch_stub_562, _gloffset__dispatch_stub_562)
+ GL_STUB(gl_dispatch_stub_563, _gloffset__dispatch_stub_563)
+ GL_STUB(gl_dispatch_stub_564, _gloffset__dispatch_stub_564)
GL_STUB(gl_dispatch_stub_565, _gloffset__dispatch_stub_565)
GL_STUB(gl_dispatch_stub_566, _gloffset__dispatch_stub_566)
+ GL_STUB(gl_dispatch_stub_567, _gloffset__dispatch_stub_567)
+ GL_STUB(gl_dispatch_stub_568, _gloffset__dispatch_stub_568)
+ GL_STUB(gl_dispatch_stub_569, _gloffset__dispatch_stub_569)
GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT)
GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT)
GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT)
@@ -1414,8 +1420,8 @@ _mesa_sparc_glapi_begin:
GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT)
GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT)
GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT)
- GL_STUB(gl_dispatch_stub_577, _gloffset__dispatch_stub_577)
- GL_STUB(gl_dispatch_stub_578, _gloffset__dispatch_stub_578)
+ GL_STUB(gl_dispatch_stub_580, _gloffset__dispatch_stub_580)
+ GL_STUB(gl_dispatch_stub_581, _gloffset__dispatch_stub_581)
GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT)
GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT)
GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT)
@@ -1440,7 +1446,7 @@ _mesa_sparc_glapi_begin:
GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT)
GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT)
GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT)
- GL_STUB(gl_dispatch_stub_603, _gloffset__dispatch_stub_603)
+ GL_STUB(gl_dispatch_stub_606, _gloffset__dispatch_stub_606)
GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT)
GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV)
GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV)
@@ -1482,15 +1488,15 @@ _mesa_sparc_glapi_begin:
GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA)
GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA)
GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA)
- GL_STUB(gl_dispatch_stub_645, _gloffset__dispatch_stub_645)
- GL_STUB(gl_dispatch_stub_646, _gloffset__dispatch_stub_646)
- GL_STUB(gl_dispatch_stub_647, _gloffset__dispatch_stub_647)
GL_STUB(gl_dispatch_stub_648, _gloffset__dispatch_stub_648)
GL_STUB(gl_dispatch_stub_649, _gloffset__dispatch_stub_649)
GL_STUB(gl_dispatch_stub_650, _gloffset__dispatch_stub_650)
GL_STUB(gl_dispatch_stub_651, _gloffset__dispatch_stub_651)
GL_STUB(gl_dispatch_stub_652, _gloffset__dispatch_stub_652)
GL_STUB(gl_dispatch_stub_653, _gloffset__dispatch_stub_653)
+ GL_STUB(gl_dispatch_stub_654, _gloffset__dispatch_stub_654)
+ GL_STUB(gl_dispatch_stub_655, _gloffset__dispatch_stub_655)
+ GL_STUB(gl_dispatch_stub_656, _gloffset__dispatch_stub_656)
GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV)
GL_STUB(glBindProgramNV, _gloffset_BindProgramNV)
GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV)
@@ -1571,19 +1577,19 @@ _mesa_sparc_glapi_begin:
GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI)
GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV)
GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV)
- GL_STUB(gl_dispatch_stub_734, _gloffset__dispatch_stub_734)
- GL_STUB(gl_dispatch_stub_735, _gloffset__dispatch_stub_735)
- GL_STUB(gl_dispatch_stub_736, _gloffset__dispatch_stub_736)
GL_STUB(gl_dispatch_stub_737, _gloffset__dispatch_stub_737)
GL_STUB(gl_dispatch_stub_738, _gloffset__dispatch_stub_738)
+ GL_STUB(gl_dispatch_stub_739, _gloffset__dispatch_stub_739)
+ GL_STUB(gl_dispatch_stub_740, _gloffset__dispatch_stub_740)
+ GL_STUB(gl_dispatch_stub_741, _gloffset__dispatch_stub_741)
GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV)
GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV)
GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV)
GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV)
GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV)
GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV)
- GL_STUB(gl_dispatch_stub_745, _gloffset__dispatch_stub_745)
- GL_STUB(gl_dispatch_stub_746, _gloffset__dispatch_stub_746)
+ GL_STUB(gl_dispatch_stub_748, _gloffset__dispatch_stub_748)
+ GL_STUB(gl_dispatch_stub_749, _gloffset__dispatch_stub_749)
GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT)
GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT)
GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT)
@@ -1597,15 +1603,15 @@ _mesa_sparc_glapi_begin:
GL_STUB(glGenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT)
GL_STUB(glGenerateMipmapEXT, _gloffset_GenerateMipmapEXT)
GL_STUB(glGetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT)
- GL_STUB(gl_dispatch_stub_760, _gloffset__dispatch_stub_760)
- GL_STUB(gl_dispatch_stub_761, _gloffset__dispatch_stub_761)
GL_STUB(glGetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT)
GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT)
GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT)
GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT)
- GL_STUB(gl_dispatch_stub_766, _gloffset__dispatch_stub_766)
GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767)
GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768)
+ GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769)
+ GL_STUB(gl_dispatch_stub_770, _gloffset__dispatch_stub_770)
+ GL_STUB(gl_dispatch_stub_771, _gloffset__dispatch_stub_771)
.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function
_mesa_sparc_glapi_end:
@@ -1613,12 +1619,23 @@ _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
+#ifndef GLX_INDIRECT_RENDERING
+ .globl glAreTexturesResidentEXT ; .type glAreTexturesResidentEXT,#function ; glAreTexturesResidentEXT = glAreTexturesResident
+#endif
.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
+#ifndef GLX_INDIRECT_RENDERING
.globl glDeleteTexturesEXT ; .type glDeleteTexturesEXT,#function ; glDeleteTexturesEXT = glDeleteTextures
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl glGenTexturesEXT ; .type glGenTexturesEXT,#function ; glGenTexturesEXT = glGenTextures
+#endif
.globl glGetPointervEXT ; .type glGetPointervEXT,#function ; glGetPointervEXT = glGetPointerv
+#ifndef GLX_INDIRECT_RENDERING
+ .globl glIsTextureEXT ; .type glIsTextureEXT,#function ; glIsTextureEXT = glIsTexture
+#endif
.globl glPrioritizeTexturesEXT ; .type glPrioritizeTexturesEXT,#function ; glPrioritizeTexturesEXT = glPrioritizeTextures
.globl glTexSubImage1DEXT ; .type glTexSubImage1DEXT,#function ; glTexSubImage1DEXT = glTexSubImage1D
.globl glTexSubImage2DEXT ; .type glTexSubImage2DEXT,#function ; glTexSubImage2DEXT = glTexSubImage2D
@@ -1626,6 +1643,15 @@ _mesa_sparc_glapi_end:
.globl glBlendEquationEXT ; .type glBlendEquationEXT,#function ; glBlendEquationEXT = glBlendEquation
.globl glDrawRangeElementsEXT ; .type glDrawRangeElementsEXT,#function ; glDrawRangeElementsEXT = glDrawRangeElements
.globl glColorTableEXT ; .type glColorTableEXT,#function ; glColorTableEXT = glColorTable
+#ifndef GLX_INDIRECT_RENDERING
+ .globl glGetColorTableEXT ; .type glGetColorTableEXT,#function ; glGetColorTableEXT = glGetColorTable
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl glGetColorTableParameterfvEXT ; .type glGetColorTableParameterfvEXT,#function ; glGetColorTableParameterfvEXT = glGetColorTableParameterfv
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl glGetColorTableParameterivEXT ; .type glGetColorTableParameterivEXT,#function ; glGetColorTableParameterivEXT = glGetColorTableParameteriv
+#endif
.globl glTexImage3DEXT ; .type glTexImage3DEXT,#function ; glTexImage3DEXT = glTexImage3D
.globl glTexSubImage3DEXT ; .type glTexSubImage3DEXT,#function ; glTexSubImage3DEXT = glTexSubImage3D
.globl glCopyTexSubImage3DEXT ; .type glCopyTexSubImage3DEXT,#function ; glCopyTexSubImage3DEXT = glCopyTexSubImage3D
@@ -1675,6 +1701,43 @@ _mesa_sparc_glapi_end:
.globl glCompressedTexSubImage2D ; .type glCompressedTexSubImage2D,#function ; glCompressedTexSubImage2D = glCompressedTexSubImage2DARB
.globl glCompressedTexSubImage3D ; .type glCompressedTexSubImage3D,#function ; glCompressedTexSubImage3D = glCompressedTexSubImage3DARB
.globl glGetCompressedTexImage ; .type glGetCompressedTexImage,#function ; glGetCompressedTexImage = glGetCompressedTexImageARB
+ .globl glDisableVertexAttribArray ; .type glDisableVertexAttribArray,#function ; glDisableVertexAttribArray = glDisableVertexAttribArrayARB
+ .globl glEnableVertexAttribArray ; .type glEnableVertexAttribArray,#function ; glEnableVertexAttribArray = glEnableVertexAttribArrayARB
+ .globl glGetVertexAttribdv ; .type glGetVertexAttribdv,#function ; glGetVertexAttribdv = glGetVertexAttribdvARB
+ .globl glGetVertexAttribfv ; .type glGetVertexAttribfv,#function ; glGetVertexAttribfv = glGetVertexAttribfvARB
+ .globl glGetVertexAttribiv ; .type glGetVertexAttribiv,#function ; glGetVertexAttribiv = glGetVertexAttribivARB
+ .globl glVertexAttrib1d ; .type glVertexAttrib1d,#function ; glVertexAttrib1d = glVertexAttrib1dARB
+ .globl glVertexAttrib1dv ; .type glVertexAttrib1dv,#function ; glVertexAttrib1dv = glVertexAttrib1dvARB
+ .globl glVertexAttrib1f ; .type glVertexAttrib1f,#function ; glVertexAttrib1f = glVertexAttrib1fARB
+ .globl glVertexAttrib1fv ; .type glVertexAttrib1fv,#function ; glVertexAttrib1fv = glVertexAttrib1fvARB
+ .globl glVertexAttrib1s ; .type glVertexAttrib1s,#function ; glVertexAttrib1s = glVertexAttrib1sARB
+ .globl glVertexAttrib1sv ; .type glVertexAttrib1sv,#function ; glVertexAttrib1sv = glVertexAttrib1svARB
+ .globl glVertexAttrib2d ; .type glVertexAttrib2d,#function ; glVertexAttrib2d = glVertexAttrib2dARB
+ .globl glVertexAttrib2dv ; .type glVertexAttrib2dv,#function ; glVertexAttrib2dv = glVertexAttrib2dvARB
+ .globl glVertexAttrib2f ; .type glVertexAttrib2f,#function ; glVertexAttrib2f = glVertexAttrib2fARB
+ .globl glVertexAttrib2fv ; .type glVertexAttrib2fv,#function ; glVertexAttrib2fv = glVertexAttrib2fvARB
+ .globl glVertexAttrib2s ; .type glVertexAttrib2s,#function ; glVertexAttrib2s = glVertexAttrib2sARB
+ .globl glVertexAttrib2sv ; .type glVertexAttrib2sv,#function ; glVertexAttrib2sv = glVertexAttrib2svARB
+ .globl glVertexAttrib3d ; .type glVertexAttrib3d,#function ; glVertexAttrib3d = glVertexAttrib3dARB
+ .globl glVertexAttrib3dv ; .type glVertexAttrib3dv,#function ; glVertexAttrib3dv = glVertexAttrib3dvARB
+ .globl glVertexAttrib3f ; .type glVertexAttrib3f,#function ; glVertexAttrib3f = glVertexAttrib3fARB
+ .globl glVertexAttrib3fv ; .type glVertexAttrib3fv,#function ; glVertexAttrib3fv = glVertexAttrib3fvARB
+ .globl glVertexAttrib3s ; .type glVertexAttrib3s,#function ; glVertexAttrib3s = glVertexAttrib3sARB
+ .globl glVertexAttrib3sv ; .type glVertexAttrib3sv,#function ; glVertexAttrib3sv = glVertexAttrib3svARB
+ .globl glVertexAttrib4Nbv ; .type glVertexAttrib4Nbv,#function ; glVertexAttrib4Nbv = glVertexAttrib4NbvARB
+ .globl glVertexAttrib4Niv ; .type glVertexAttrib4Niv,#function ; glVertexAttrib4Niv = glVertexAttrib4NivARB
+ .globl glVertexAttrib4Nsv ; .type glVertexAttrib4Nsv,#function ; glVertexAttrib4Nsv = glVertexAttrib4NsvARB
+ .globl glVertexAttrib4Nub ; .type glVertexAttrib4Nub,#function ; glVertexAttrib4Nub = glVertexAttrib4NubARB
+ .globl glVertexAttrib4Nubv ; .type glVertexAttrib4Nubv,#function ; glVertexAttrib4Nubv = glVertexAttrib4NubvARB
+ .globl glVertexAttrib4Nuiv ; .type glVertexAttrib4Nuiv,#function ; glVertexAttrib4Nuiv = glVertexAttrib4NuivARB
+ .globl glVertexAttrib4Nusv ; .type glVertexAttrib4Nusv,#function ; glVertexAttrib4Nusv = glVertexAttrib4NusvARB
+ .globl glVertexAttrib4d ; .type glVertexAttrib4d,#function ; glVertexAttrib4d = glVertexAttrib4dARB
+ .globl glVertexAttrib4dv ; .type glVertexAttrib4dv,#function ; glVertexAttrib4dv = glVertexAttrib4dvARB
+ .globl glVertexAttrib4f ; .type glVertexAttrib4f,#function ; glVertexAttrib4f = glVertexAttrib4fARB
+ .globl glVertexAttrib4fv ; .type glVertexAttrib4fv,#function ; glVertexAttrib4fv = glVertexAttrib4fvARB
+ .globl glVertexAttrib4s ; .type glVertexAttrib4s,#function ; glVertexAttrib4s = glVertexAttrib4sARB
+ .globl glVertexAttrib4sv ; .type glVertexAttrib4sv,#function ; glVertexAttrib4sv = glVertexAttrib4svARB
+ .globl glVertexAttribPointer ; .type glVertexAttribPointer,#function ; glVertexAttribPointer = glVertexAttribPointerARB
.globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB
.globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB
.globl glBufferSubData ; .type glBufferSubData,#function ; glBufferSubData = glBufferSubDataARB
@@ -1694,11 +1757,40 @@ _mesa_sparc_glapi_end:
.globl glGetQueryObjectuiv ; .type glGetQueryObjectuiv,#function ; glGetQueryObjectuiv = glGetQueryObjectuivARB
.globl glGetQueryiv ; .type glGetQueryiv,#function ; glGetQueryiv = glGetQueryivARB
.globl glIsQuery ; .type glIsQuery,#function ; glIsQuery = glIsQueryARB
+ .globl glCompileShader ; .type glCompileShader,#function ; glCompileShader = glCompileShaderARB
+ .globl glGetActiveUniform ; .type glGetActiveUniform,#function ; glGetActiveUniform = glGetActiveUniformARB
+ .globl glGetShaderSource ; .type glGetShaderSource,#function ; glGetShaderSource = glGetShaderSourceARB
+ .globl glGetUniformLocation ; .type glGetUniformLocation,#function ; glGetUniformLocation = glGetUniformLocationARB
+ .globl glGetUniformfv ; .type glGetUniformfv,#function ; glGetUniformfv = glGetUniformfvARB
+ .globl glGetUniformiv ; .type glGetUniformiv,#function ; glGetUniformiv = glGetUniformivARB
+ .globl glLinkProgram ; .type glLinkProgram,#function ; glLinkProgram = glLinkProgramARB
+ .globl glShaderSource ; .type glShaderSource,#function ; glShaderSource = glShaderSourceARB
+ .globl glUniform1f ; .type glUniform1f,#function ; glUniform1f = glUniform1fARB
+ .globl glUniform1fv ; .type glUniform1fv,#function ; glUniform1fv = glUniform1fvARB
+ .globl glUniform1i ; .type glUniform1i,#function ; glUniform1i = glUniform1iARB
+ .globl glUniform1iv ; .type glUniform1iv,#function ; glUniform1iv = glUniform1ivARB
+ .globl glUniform2f ; .type glUniform2f,#function ; glUniform2f = glUniform2fARB
+ .globl glUniform2fv ; .type glUniform2fv,#function ; glUniform2fv = glUniform2fvARB
+ .globl glUniform2i ; .type glUniform2i,#function ; glUniform2i = glUniform2iARB
+ .globl glUniform2iv ; .type glUniform2iv,#function ; glUniform2iv = glUniform2ivARB
+ .globl glUniform3f ; .type glUniform3f,#function ; glUniform3f = glUniform3fARB
+ .globl glUniform3fv ; .type glUniform3fv,#function ; glUniform3fv = glUniform3fvARB
+ .globl glUniform3i ; .type glUniform3i,#function ; glUniform3i = glUniform3iARB
+ .globl glUniform3iv ; .type glUniform3iv,#function ; glUniform3iv = glUniform3ivARB
+ .globl glUniform4f ; .type glUniform4f,#function ; glUniform4f = glUniform4fARB
+ .globl glUniform4fv ; .type glUniform4fv,#function ; glUniform4fv = glUniform4fvARB
+ .globl glUniform4i ; .type glUniform4i,#function ; glUniform4i = glUniform4iARB
+ .globl glUniform4iv ; .type glUniform4iv,#function ; glUniform4iv = glUniform4ivARB
+ .globl glUniformMatrix2fv ; .type glUniformMatrix2fv,#function ; glUniformMatrix2fv = glUniformMatrix2fvARB
+ .globl glUniformMatrix3fv ; .type glUniformMatrix3fv,#function ; glUniformMatrix3fv = glUniformMatrix3fvARB
+ .globl glUniformMatrix4fv ; .type glUniformMatrix4fv,#function ; glUniformMatrix4fv = glUniformMatrix4fvARB
+ .globl glUseProgram ; .type glUseProgram,#function ; glUseProgram = glUseProgramObjectARB
+ .globl glValidateProgram ; .type glValidateProgram,#function ; glValidateProgram = glValidateProgramARB
+ .globl glBindAttribLocation ; .type glBindAttribLocation,#function ; glBindAttribLocation = glBindAttribLocationARB
+ .globl glGetActiveAttrib ; .type glGetActiveAttrib,#function ; glGetActiveAttrib = glGetActiveAttribARB
+ .globl glGetAttribLocation ; .type glGetAttribLocation,#function ; glGetAttribLocation = glGetAttribLocationARB
.globl glDrawBuffers ; .type glDrawBuffers,#function ; glDrawBuffers = glDrawBuffersARB
.globl glDrawBuffersATI ; .type glDrawBuffersATI,#function ; glDrawBuffersATI = glDrawBuffersARB
- .globl glGetColorTableParameterfvEXT ; .type glGetColorTableParameterfvEXT,#function ; glGetColorTableParameterfvEXT = glGetColorTableParameterfvSGI
- .globl glGetColorTableParameterivEXT ; .type glGetColorTableParameterivEXT,#function ; glGetColorTableParameterivEXT = glGetColorTableParameterivSGI
- .globl glGetColorTableEXT ; .type glGetColorTableEXT,#function ; glGetColorTableEXT = glGetColorTableSGI
.globl glPointParameterf ; .type glPointParameterf,#function ; glPointParameterf = glPointParameterfEXT
.globl glPointParameterfARB ; .type glPointParameterfARB,#function ; glPointParameterfARB = glPointParameterfEXT
.globl glPointParameterfv ; .type glPointParameterfv,#function ; glPointParameterfv = glPointParameterfvEXT
diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c
index b7fe360d2c6..1b77b0bb7ba 100644
--- a/src/mesa/sparc/sparc.c
+++ b/src/mesa/sparc/sparc.c
@@ -133,7 +133,7 @@ void _mesa_init_all_sparc_transform_asm(void)
_mesa_sparc_rescale_normals;
#endif
-#ifdef DEBUG
+#ifdef DEBUG_MATH
_math_test_all_transform_functions("sparc");
_math_test_all_cliptest_functions("sparc");
_math_test_all_normal_transform_functions("sparc");
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index b8c214f6890..b3a209923fd 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -76,7 +76,7 @@ struct LineInfo
GLfloat texWidth[MAX_TEXTURE_COORD_UNITS];
GLfloat texHeight[MAX_TEXTURE_COORD_UNITS];
- struct sw_span span;
+ SWspan span;
};
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 23c262f8369..b5470a02980 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -51,7 +51,7 @@
GLboolean ltor;
GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */
- struct sw_span span;
+ SWspan span;
#ifdef DO_Z
GLfloat zPlane[4];
@@ -279,7 +279,7 @@
while (coverage > 0.0F) {
/* (cx,cy) = center of fragment */
const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
- struct span_arrays *array = span.array;
+ SWspanarrays *array = span.array;
#ifdef DO_INDEX
array->coverage[count] = (GLfloat) compute_coveragei(pMin, pMid, pMax, ix, iy);
#else
@@ -383,7 +383,7 @@
while (coverage > 0.0F) {
/* (cx,cy) = center of fragment */
const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
- struct span_arrays *array = span.array;
+ SWspanarrays *array = span.array;
#ifdef DO_INDEX
array->coverage[ix] = (GLfloat) compute_coveragei(pMin, pMax, pMid, ix, iy);
#else
@@ -452,7 +452,7 @@
/* shift all values to the left */
/* XXX this is temporary */
{
- struct span_arrays *array = span.array;
+ SWspanarrays *array = span.array;
GLint j;
for (j = 0; j < (GLint) n; j++) {
#ifdef DO_RGBA
@@ -482,7 +482,7 @@
#ifdef DO_MULTITEX
/* shift texcoords */
{
- struct span_arrays *array = span.array;
+ SWspanarrays *array = span.array;
GLuint unit;
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index a159e804976..69e9404c55c 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -307,7 +307,7 @@ accum_accum(GLcontext *ctx, GLfloat value,
/* read colors from color buffer */
_swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
- xpos, ypos + i, rgba);
+ xpos, ypos + i, CHAN_TYPE, rgba);
/* do accumulation */
if (swrast->_IntegerAccumMode) {
@@ -391,7 +391,7 @@ accum_load(GLcontext *ctx, GLfloat value,
/* read colors from color buffer */
_swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
- xpos, ypos + i, rgba);
+ xpos, ypos + i, CHAN_TYPE, rgba);
/* do load */
if (swrast->_IntegerAccumMode) {
@@ -467,9 +467,14 @@ accum_return(GLcontext *ctx, GLfloat value,
/* XXX maybe transpose the 'i' and 'buffer' loops??? */
for (i = 0; i < height; i++) {
- GLchan rgba[MAX_WIDTH][4];
GLshort accumRow[4 * MAX_WIDTH];
GLshort *acc;
+ SWspan span;
+
+ /* init color span */
+ INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ span.x = xpos;
+ span.y = ypos + i;
if (directAccess) {
acc = (GLshort *) accumRb->GetPointer(ctx, accumRb, xpos, ypos +i);
@@ -487,10 +492,10 @@ accum_return(GLcontext *ctx, GLfloat value,
ASSERT(acc[j * 4 + 1] < max);
ASSERT(acc[j * 4 + 2] < max);
ASSERT(acc[j * 4 + 3] < max);
- rgba[j][RCOMP] = multTable[acc[j * 4 + 0]];
- rgba[j][GCOMP] = multTable[acc[j * 4 + 1]];
- rgba[j][BCOMP] = multTable[acc[j * 4 + 2]];
- rgba[j][ACOMP] = multTable[acc[j * 4 + 3]];
+ span.array->rgba[j][RCOMP] = multTable[acc[j * 4 + 0]];
+ span.array->rgba[j][GCOMP] = multTable[acc[j * 4 + 1]];
+ span.array->rgba[j][BCOMP] = multTable[acc[j * 4 + 2]];
+ span.array->rgba[j][ACOMP] = multTable[acc[j * 4 + 3]];
}
}
else {
@@ -508,10 +513,10 @@ accum_return(GLcontext *ctx, GLfloat value,
GLint b = IROUND( (GLfloat) (acc[j * 4 + 2]) * scale );
GLint a = IROUND( (GLfloat) (acc[j * 4 + 3]) * scale );
#endif
- rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX );
- rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX );
- rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX );
- rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX );
+ span.array->rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX );
+ span.array->rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX );
+ span.array->rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX );
+ span.array->rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX );
}
}
@@ -519,9 +524,9 @@ accum_return(GLcontext *ctx, GLfloat value,
for (buffer = 0; buffer < fb->_NumColorDrawBuffers[0]; buffer++) {
struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[0][buffer];
if (masking) {
- _swrast_mask_rgba_array(ctx, rb, width, xpos, ypos + i, rgba);
+ _swrast_mask_rgba_span(ctx, rb, &span);
}
- rb->PutRow(ctx, rb, width, xpos, ypos + i, rgba, NULL);
+ rb->PutRow(ctx, rb, width, xpos, ypos + i, span.array->rgba, NULL);
}
}
}
@@ -536,12 +541,10 @@ accum_return(GLcontext *ctx, GLfloat value,
* Software fallback for glAccum.
*/
void
-_swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
- GLint xpos, GLint ypos,
- GLint width, GLint height )
-
+_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLint xpos, ypos, width, height;
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
@@ -553,6 +556,14 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
RENDER_START(swrast, ctx);
+ /* Compute region after calling RENDER_START so that we know the
+ * drawbuffer's size/bounds are up to date.
+ */
+ xpos = ctx->DrawBuffer->_Xmin;
+ ypos = ctx->DrawBuffer->_Ymin;
+ width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+
switch (op) {
case GL_ADD:
if (value != 0.0F) {
diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c
index 55c1e6a58f8..87a016512cd 100644
--- a/src/mesa/swrast/s_alpha.c
+++ b/src/mesa/swrast/s_alpha.c
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -37,188 +36,125 @@
#include "s_context.h"
+#define ALPHA_TEST(ALPHA, LOOP_CODE) \
+do { \
+ switch (ctx->Color.AlphaFunc) { \
+ case GL_LESS: \
+ for (i = 0; i < n; i++) { \
+ mask[i] &= (ALPHA < ref); \
+ LOOP_CODE; \
+ } \
+ break; \
+ case GL_LEQUAL: \
+ for (i = 0; i < n; i++) { \
+ mask[i] &= (ALPHA <= ref); \
+ LOOP_CODE; \
+ } \
+ break; \
+ case GL_GEQUAL: \
+ for (i = 0; i < n; i++) { \
+ mask[i] &= (ALPHA >= ref); \
+ LOOP_CODE; \
+ } \
+ break; \
+ case GL_GREATER: \
+ for (i = 0; i < n; i++) { \
+ mask[i] &= (ALPHA > ref); \
+ LOOP_CODE; \
+ } \
+ break; \
+ case GL_NOTEQUAL: \
+ for (i = 0; i < n; i++) { \
+ mask[i] &= (ALPHA != ref); \
+ LOOP_CODE; \
+ } \
+ break; \
+ case GL_EQUAL: \
+ for (i = 0; i < n; i++) { \
+ mask[i] &= (ALPHA == ref); \
+ LOOP_CODE; \
+ } \
+ break; \
+ default: \
+ _mesa_problem(ctx, "Invalid alpha test in _swrast_alpha_test" ); \
+ return 0; \
+ } \
+} while (0)
+
+
+
/**
- * \fn GLint _swrast_alpha_test( const GLcontext *ctx, struct sw_span *span )
- * \brief Apply the alpha test to a span of pixels.
- * \return
- * - "0" = all pixels in the span failed the alpha test.
- * - "1" = one or more pixels passed the alpha test.
+ * Perform the alpha test for an array of pixels.
+ * For pixels that fail the test, mask[i] will be set to 0.
+ * \return 0 if all pixels in the span failed the alpha test,
+ * 1 if one or more pixels passed the alpha test.
*/
GLint
-_swrast_alpha_test( const GLcontext *ctx, struct sw_span *span )
+_swrast_alpha_test(const GLcontext *ctx, SWspan *span)
{
- const GLchan (*rgba)[4] = (const GLchan (*)[4]) span->array->rgba;
- GLchan ref;
const GLuint n = span->end;
GLubyte *mask = span->array->mask;
GLuint i;
- CLAMPED_FLOAT_TO_CHAN(ref, ctx->Color.AlphaRef);
+ if (ctx->Color.AlphaFunc == GL_ALWAYS) {
+ /* do nothing */
+ return 1;
+ }
+ else if (ctx->Color.AlphaFunc == GL_NEVER) {
+ /* All pixels failed - caller should check for this return value and
+ * act accordingly.
+ */
+ span->writeAll = GL_FALSE;
+ return 0;
+ }
if (span->arrayMask & SPAN_RGBA) {
- /* Use the array values */
- switch (ctx->Color.AlphaFunc) {
- case GL_LESS:
- for (i = 0; i < n; i++)
- mask[i] &= (rgba[i][ACOMP] < ref);
- break;
- case GL_LEQUAL:
- for (i = 0; i < n; i++)
- mask[i] &= (rgba[i][ACOMP] <= ref);
- break;
- case GL_GEQUAL:
- for (i = 0; i < n; i++)
- mask[i] &= (rgba[i][ACOMP] >= ref);
- break;
- case GL_GREATER:
- for (i = 0; i < n; i++)
- mask[i] &= (rgba[i][ACOMP] > ref);
- break;
- case GL_NOTEQUAL:
- for (i = 0; i < n; i++)
- mask[i] &= (rgba[i][ACOMP] != ref);
- break;
- case GL_EQUAL:
- for (i = 0; i < n; i++)
- mask[i] &= (rgba[i][ACOMP] == ref);
- break;
- case GL_ALWAYS:
- /* do nothing */
- return 1;
- case GL_NEVER:
- /* caller should check for zero! */
- span->writeAll = GL_FALSE;
- return 0;
- default:
- _mesa_problem( ctx, "Invalid alpha test in _swrast_alpha_test" );
- return 0;
+ /* Use array's alpha values */
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ GLubyte ref;
+ CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef);
+ ALPHA_TEST(rgba[i][ACOMP], ;);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ GLushort ref;
+ CLAMPED_FLOAT_TO_USHORT(ref, ctx->Color.AlphaRef);
+ ALPHA_TEST(rgba[i][ACOMP], ;);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ const GLfloat ref = ctx->Color.AlphaRef;
+ ALPHA_TEST(rgba[i][ACOMP], ;);
}
}
else {
- /* Use the interpolation values */
-#if CHAN_TYPE == GL_FLOAT
- const GLfloat alphaStep = span->alphaStep;
- GLfloat alpha = span->alpha;
+ /* Interpolate alpha values */
ASSERT(span->interpMask & SPAN_RGBA);
- switch (ctx->Color.AlphaFunc) {
- case GL_LESS:
- for (i = 0; i < n; i++) {
- mask[i] &= (alpha < ref);
- alpha += alphaStep;
- }
- break;
- case GL_LEQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (alpha <= ref);
- alpha += alphaStep;
- }
- break;
- case GL_GEQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (alpha >= ref);
- alpha += alphaStep;
- }
- break;
- case GL_GREATER:
- for (i = 0; i < n; i++) {
- mask[i] &= (alpha > ref);
- alpha += alphaStep;
- }
- break;
- case GL_NOTEQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (alpha != ref);
- alpha += alphaStep;
- }
- break;
- case GL_EQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (alpha == ref);
- alpha += alphaStep;
- }
- break;
- case GL_ALWAYS:
- /* do nothing */
- return 1;
- case GL_NEVER:
- /* caller should check for zero! */
- span->writeAll = GL_FALSE;
- return 0;
- default:
- _mesa_problem( ctx, "Invalid alpha test in gl_alpha_test" );
- return 0;
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ const GLfixed alphaStep = span->alphaStep;
+ GLfixed alpha = span->alpha;
+ GLubyte ref;
+ CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef);
+ ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep);
}
-#else
- /* 8 or 16-bit channel interpolation */
- const GLfixed alphaStep = span->alphaStep;
- GLfixed alpha = span->alpha;
- ASSERT(span->interpMask & SPAN_RGBA);
- switch (ctx->Color.AlphaFunc) {
- case GL_LESS:
- for (i = 0; i < n; i++) {
- mask[i] &= (FixedToChan(alpha) < ref);
- alpha += alphaStep;
- }
- break;
- case GL_LEQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (FixedToChan(alpha) <= ref);
- alpha += alphaStep;
- }
- break;
- case GL_GEQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (FixedToChan(alpha) >= ref);
- alpha += alphaStep;
- }
- break;
- case GL_GREATER:
- for (i = 0; i < n; i++) {
- mask[i] &= (FixedToChan(alpha) > ref);
- alpha += alphaStep;
- }
- break;
- case GL_NOTEQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (FixedToChan(alpha) != ref);
- alpha += alphaStep;
- }
- break;
- case GL_EQUAL:
- for (i = 0; i < n; i++) {
- mask[i] &= (FixedToChan(alpha) == ref);
- alpha += alphaStep;
- }
- break;
- case GL_ALWAYS:
- /* do nothing */
- return 1;
- case GL_NEVER:
- /* caller should check for zero! */
- span->writeAll = GL_FALSE;
- return 0;
- default:
- _mesa_problem( ctx, "Invalid alpha test in gl_alpha_test" );
- return 0;
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ const GLfixed alphaStep = span->alphaStep;
+ GLfixed alpha = span->alpha;
+ GLushort ref;
+ CLAMPED_FLOAT_TO_USHORT(ref, ctx->Color.AlphaRef);
+ ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep);
+ }
+ else {
+ const GLfloat alphaStep = span->alphaStep;
+ GLfloat alpha = span->alpha;
+ const GLfloat ref = ctx->Color.AlphaRef;
+ ALPHA_TEST(alpha, alpha += alphaStep);
}
-#endif /* CHAN_TYPE */
}
-#if 0
- /* XXXX This causes conformance failures!!!! */
- while ((span->start <= span->end) &&
- (mask[span->start] == 0))
- span->start ++;
-
- while ((span->end >= span->start) &&
- (mask[span->end] == 0))
- span->end --;
-#endif
-
span->writeAll = GL_FALSE;
- if (span->start >= span->end)
- return 0;
- else
- return 1;
+ /* XXX examine mask[] values? */
+ return 1;
}
diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h
index add0f74c453..a85ef8a83ad 100644
--- a/src/mesa/swrast/s_alpha.h
+++ b/src/mesa/swrast/s_alpha.h
@@ -33,7 +33,7 @@
extern GLint
-_swrast_alpha_test( const GLcontext *ctx, struct sw_span *span );
+_swrast_alpha_test( const GLcontext *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_arbshader.c b/src/mesa/swrast/s_arbshader.c
index c3f85ee1574..ee971a36ecc 100644
--- a/src/mesa/swrast/s_arbshader.c
+++ b/src/mesa/swrast/s_arbshader.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2006 Brian Paul All Rights Reserved.
*
@@ -38,11 +38,13 @@
#if FEATURE_ARB_fragment_shader
void
-_swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span)
+_swrast_exec_arbshader(GLcontext *ctx, SWspan *span)
{
struct gl2_program_intf **pro;
GLuint i;
+ ASSERT(span->array->ChanType == GL_FLOAT);
+
if (!ctx->ShaderObjects._FragmentShaderPresent)
return;
@@ -57,6 +59,9 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span)
GLuint j;
GLboolean discard;
+ /*
+ * Load input attributes
+ */
vec[0] = (GLfloat) span->x + i;
vec[1] = (GLfloat) span->y;
vec[2] = (GLfloat) span->array->z[i] / ctx->DrawBuffer->_DepthMaxF;
@@ -64,32 +69,22 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span)
(**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGCOORD, vec,
0, 4 * sizeof(GLfloat), GL_TRUE);
- vec[0] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]);
- vec[1] = CHAN_TO_FLOAT(span->array->rgba[i][GCOMP]);
- vec[2] = CHAN_TO_FLOAT(span->array->rgba[i][BCOMP]);
- vec[3] = CHAN_TO_FLOAT(span->array->rgba[i][ACOMP]);
- (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_COLOR, vec, 0,
- 4 * sizeof(GLfloat), GL_TRUE);
-
- vec[0] = CHAN_TO_FLOAT(span->array->spec[i][RCOMP]);
- vec[1] = CHAN_TO_FLOAT(span->array->spec[i][GCOMP]);
- vec[2] = CHAN_TO_FLOAT(span->array->spec[i][BCOMP]);
- vec[3] = CHAN_TO_FLOAT(span->array->spec[i][ACOMP]);
+ (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_COLOR,
+ span->array->color.sz4.rgba[i],
+ 0, 4 * sizeof(GLfloat), GL_TRUE);
+
(**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_SECONDARYCOLOR,
- vec, 0, 4 * sizeof(GLfloat), GL_TRUE);
+ span->array->color.sz4.spec[i],
+ 0, 4 * sizeof(GLfloat), GL_TRUE);
for (j = 0; j < ctx->Const.MaxTextureCoordUnits; j++) {
- vec[0] = span->array->texcoords[j][i][0];
- vec[1] = span->array->texcoords[j][i][1];
- vec[2] = span->array->texcoords[j][i][2];
- vec[3] = span->array->texcoords[j][i][3];
(**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_TEXCOORD,
- vec, j, 4 * sizeof(GLfloat), GL_TRUE);
+ span->array->texcoords[j][i],
+ j, 4 * sizeof(GLfloat), GL_TRUE);
}
for (j = 0; j < MAX_VARYING_VECTORS; j++) {
GLuint k;
-
for (k = 0; k < VARYINGS_PER_VECTOR; k++) {
(**pro).UpdateVarying(pro, j * VARYINGS_PER_VECTOR + k,
&span->array->varying[i][j][k],
@@ -99,6 +94,9 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span)
_slang_exec_fragment_shader(pro);
+ /*
+ * Store results
+ */
_slang_fetch_discard(pro, &discard);
if (discard) {
span->array->mask[i] = GL_FALSE;
@@ -107,10 +105,16 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span)
else {
(**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGCOLOR,
vec, 0, 4 * sizeof(GLfloat), GL_FALSE);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][RCOMP], vec[0]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][GCOMP], vec[1]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], vec[2]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], vec[3]);
+ COPY_4V(span->array->color.sz4.rgba[i], vec);
+
+ (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGDEPTH, vec, 0,
+ sizeof (GLfloat), GL_FALSE);
+ if (vec[0] <= 0.0f)
+ span->array->z[i] = 0;
+ else if (vec[0] >= 1.0f)
+ span->array->z[i] = ctx->DrawBuffer->_DepthMax;
+ else
+ span->array->z[i] = IROUND(vec[0] * ctx->DrawBuffer->_DepthMaxF);
}
}
}
diff --git a/src/mesa/swrast/s_arbshader.h b/src/mesa/swrast/s_arbshader.h
index 805cd4da38f..5df80c870b0 100644
--- a/src/mesa/swrast/s_arbshader.h
+++ b/src/mesa/swrast/s_arbshader.h
@@ -30,7 +30,7 @@
#if FEATURE_ARB_fragment_shader
-extern void _swrast_exec_arbshader (GLcontext *ctx, struct sw_span *span);
+extern void _swrast_exec_arbshader (GLcontext *ctx, SWspan *span);
#endif /* FEATURE_ARB_fragment_shader */
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 08640e146b5..75df50b0baa 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -31,6 +31,18 @@
/**
+ * State for executing ATI fragment shader.
+ */
+struct atifs_machine
+{
+ GLfloat Registers[6][4]; /** six temporary registers */
+ GLfloat PrevPassRegisters[6][4];
+ GLfloat Inputs[2][4]; /** Primary, secondary input colors */
+};
+
+
+
+/**
* Fetch a texel.
*/
static void
@@ -230,17 +242,6 @@ finish_pass(struct atifs_machine *machine)
}
}
-/**
- * Execute the given fragment shader
- * NOTE: we do everything in single-precision floating point; we don't
- * currently observe the single/half/fixed-precision qualifiers.
- * \param ctx - rendering context
- * \param program - the fragment program to execute
- * \param machine - machine state (register file)
- * \param maxInst - max number of instructions to execute
- * \return GL_TRUE if program completed or GL_FALSE if program executed KIL.
- */
-
struct ati_fs_opcode_st ati_fs_opcodes[] = {
{GL_ADD_ATI, 2},
{GL_SUB_ATI, 2},
@@ -259,7 +260,7 @@ struct ati_fs_opcode_st ati_fs_opcodes[] = {
static void
handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst,
- const struct sw_span *span, GLuint column, GLuint idx)
+ const SWspan *span, GLuint column, GLuint idx)
{
GLuint swizzle = texinst->swizzle;
GLuint pass_tex = texinst->src;
@@ -279,7 +280,7 @@ handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst,
static void
handle_sample_op(GLcontext * ctx, struct atifs_machine *machine,
- struct atifs_setupinst *texinst, const struct sw_span *span,
+ struct atifs_setupinst *texinst, const SWspan *span,
GLuint column, GLuint idx)
{
/* sample from unit idx using texinst->src as coords */
@@ -304,11 +305,21 @@ do { \
COPY_4V(src[optype][i], x); \
} while (0)
-static GLboolean
-execute_shader(GLcontext * ctx,
- const struct ati_fragment_shader *shader, GLuint maxInst,
- struct atifs_machine *machine, const struct sw_span *span,
- GLuint column)
+
+
+/**
+ * Execute the given fragment shader.
+ * NOTE: we do everything in single-precision floating point
+ * \param ctx - rendering context
+ * \param shader - the shader to execute
+ * \param machine - virtual machine state
+ * \param span - the SWspan we're operating on
+ * \param column - which pixel [i] we're operating on in the span
+ */
+static void
+execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
+ struct atifs_machine *machine, const SWspan *span,
+ GLuint column)
{
GLuint pc;
struct atifs_instruction *inst;
@@ -542,73 +553,58 @@ execute_shader(GLcontext * ctx,
}
}
}
- return GL_TRUE;
}
+
+/**
+ * Init fragment shader virtual machine state.
+ */
static void
init_machine(GLcontext * ctx, struct atifs_machine *machine,
const struct ati_fragment_shader *shader,
- const struct sw_span *span, GLuint col)
+ const SWspan *span, GLuint col)
{
+ GLfloat (*inputs)[4] = machine->Inputs;
GLint i, j;
for (i = 0; i < 6; i++) {
for (j = 0; j < 4; j++)
- ctx->ATIFragmentShader.Machine.Registers[i][j] = 0.0;
+ machine->Registers[i][j] = 0.0;
}
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][0] =
- CHAN_TO_FLOAT(span->array->rgba[col][0]);
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][1] =
- CHAN_TO_FLOAT(span->array->rgba[col][1]);
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][2] =
- CHAN_TO_FLOAT(span->array->rgba[col][2]);
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][3] =
- CHAN_TO_FLOAT(span->array->rgba[col][3]);
-
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][0] =
- CHAN_TO_FLOAT(span->array->spec[col][0]);
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][1] =
- CHAN_TO_FLOAT(span->array->spec[col][1]);
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][2] =
- CHAN_TO_FLOAT(span->array->spec[col][2]);
- ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][3] =
- CHAN_TO_FLOAT(span->array->spec[col][3]);
+ COPY_4V(inputs[ATI_FS_INPUT_PRIMARY], span->array->color.sz4.rgba[col]);
+ COPY_4V(inputs[ATI_FS_INPUT_SECONDARY], span->array->color.sz4.spec[col]);
}
/**
- * Execute the current fragment program, operating on the given span.
+ * Execute the current ATI shader program, operating on the given span.
*/
void
-_swrast_exec_fragment_shader(GLcontext * ctx, struct sw_span *span)
+_swrast_exec_fragment_shader(GLcontext * ctx, SWspan *span)
{
const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current;
+ struct atifs_machine machine;
GLuint i;
+ /* incoming colors should be floats */
+ ASSERT(span->array->ChanType == GL_FLOAT);
+
ctx->_CurrentProgram = GL_FRAGMENT_SHADER_ATI;
for (i = 0; i < span->end; i++) {
if (span->array->mask[i]) {
- init_machine(ctx, &ctx->ATIFragmentShader.Machine,
- ctx->ATIFragmentShader.Current, span, i);
- /* can't really happen... */
- if (!execute_shader(ctx, shader, ~0,
- &ctx->ATIFragmentShader.Machine, span, i)) {
- span->array->mask[i] = GL_FALSE;
- span->writeAll = GL_FALSE;
- }
+ init_machine(ctx, &machine, shader, span, i);
+
+ execute_shader(ctx, shader, &machine, span, i);
+ /* store result color */
{
- const GLfloat *colOut =
- ctx->ATIFragmentShader.Machine.Registers[0];
-
- /*fprintf(stderr,"outputs %f %f %f %f\n", colOut[0], colOut[1], colOut[2], colOut[3]); */
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][RCOMP], colOut[0]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][GCOMP], colOut[1]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], colOut[2]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], colOut[3]);
+ const GLfloat *colOut = machine.Registers[0];
+ /*fprintf(stderr,"outputs %f %f %f %f\n",
+ colOut[0], colOut[1], colOut[2], colOut[3]); */
+ COPY_4V(span->array->color.sz4.rgba[i], colOut);
}
}
}
diff --git a/src/mesa/swrast/s_atifragshader.h b/src/mesa/swrast/s_atifragshader.h
index 269be1f2e47..871a0c04559 100644
--- a/src/mesa/swrast/s_atifragshader.h
+++ b/src/mesa/swrast/s_atifragshader.h
@@ -31,7 +31,7 @@
extern void
-_swrast_exec_fragment_shader( GLcontext *ctx, struct sw_span *span );
+_swrast_exec_fragment_shader( GLcontext *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index dd5008cf6b9..25a1ef89d04 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -39,8 +39,10 @@
-/*
+/**
* Render a bitmap.
+ * Called via ctx->Driver.Bitmap()
+ * All parameter error checking will have been done before this is called.
*/
void
_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
@@ -51,7 +53,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLint row, col;
GLuint count = 0;
- struct sw_span span;
+ SWspan span;
ASSERT(ctx->RenderMode == GL_RENDER);
@@ -82,20 +84,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY);
- if (ctx->Visual.rgbMode) {
- span.interpMask |= SPAN_RGBA;
- span.red = FloatToFixed(ctx->Current.RasterColor[0] * CHAN_MAXF);
- span.green = FloatToFixed(ctx->Current.RasterColor[1] * CHAN_MAXF);
- span.blue = FloatToFixed(ctx->Current.RasterColor[2] * CHAN_MAXF);
- span.alpha = FloatToFixed(ctx->Current.RasterColor[3] * CHAN_MAXF);
- span.redStep = span.greenStep = span.blueStep = span.alphaStep = 0;
- }
- else {
- span.interpMask |= SPAN_INDEX;
- span.index = FloatToFixed(ctx->Current.RasterIndex);
- span.indexStep = 0;
- }
-
+ _swrast_span_default_color(ctx, &span);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
@@ -177,7 +166,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
#if 0
/*
* XXX this is another way to implement Bitmap. Use horizontal runs of
- * fragments, initializing the mask array to indicate which fragmens to
+ * fragments, initializing the mask array to indicate which fragments to
* draw or skip.
*/
void
@@ -188,7 +177,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLint row, col;
- struct sw_span span;
+ SWspan span;
ASSERT(ctx->RenderMode == GL_RENDER);
ASSERT(bitmap);
@@ -204,20 +193,8 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
span.x = px;
span.y = py;
/*span.end = width;*/
- if (ctx->Visual.rgbMode) {
- span.interpMask |= SPAN_RGBA;
- span.red = FloatToFixed(ctx->Current.RasterColor[0] * CHAN_MAXF);
- span.green = FloatToFixed(ctx->Current.RasterColor[1] * CHAN_MAXF);
- span.blue = FloatToFixed(ctx->Current.RasterColor[2] * CHAN_MAXF);
- span.alpha = FloatToFixed(ctx->Current.RasterColor[3] * CHAN_MAXF);
- span.redStep = span.greenStep = span.blueStep = span.alphaStep = 0;
- }
- else {
- span.interpMask |= SPAN_INDEX;
- span.index = FloatToFixed(ctx->Current.RasterIndex);
- span.indexStep = 0;
- }
+ _swrast_span_default_color(ctx, &span);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index d94ff3923cf..82c5e84294a 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -22,16 +22,19 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/*
- * Regarding GL_NV_blend_square:
+
+/**
+ * \file swrast/s_blend.c
+ * \brief software blending.
+ * \author Brian Paul
*
- * Portions of this software may use or implement intellectual
- * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims
- * any and all warranties with respect to such intellectual property,
- * including any use thereof or modifications thereto.
+ * Only a few blend modes have been optimized (min, max, transparency, add)
+ * more optimized cases can easily be added if needed.
+ * Celestia uses glBlendFunc(GL_SRC_ALPHA, GL_ONE), for example.
*/
+
#include "glheader.h"
#include "context.h"
#include "colormac.h"
@@ -51,329 +54,450 @@
#endif
-/*
- * Special case for glBlendFunc(GL_ZERO, GL_ONE)
+/**
+ * Integer divide by 255
+ * Declare "int divtemp" before using.
+ * This satisfies Glean and should be reasonably fast.
+ * Contributed by Nathan Hand.
+ */
+#define DIV255(X) (divtemp = (X), ((divtemp << 8) + divtemp + 256) >> 16)
+
+
+
+/**
+ * Special case for glBlendFunc(GL_ZERO, GL_ONE).
+ * No-op means the framebuffer values remain unchanged.
+ * Any chanType ok.
*/
static void _BLENDAPI
-blend_noop( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_noop(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
- GLuint i;
- ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendSrcRGB==GL_ZERO);
- ASSERT(ctx->Color.BlendDstRGB==GL_ONE);
+ GLint bytes;
+
+ ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendSrcRGB == GL_ZERO);
+ ASSERT(ctx->Color.BlendDstRGB == GL_ONE);
(void) ctx;
- for (i = 0; i < n; i++) {
- if (mask[i]) {
- COPY_CHAN4( rgba[i], dest[i] );
- }
- }
+ /* just memcpy */
+ if (chanType == GL_UNSIGNED_BYTE)
+ bytes = 4 * n * sizeof(GLubyte);
+ else if (chanType == GL_UNSIGNED_SHORT)
+ bytes = 4 * n * sizeof(GLushort);
+ else
+ bytes = 4 * n * sizeof(GLfloat);
+
+ _mesa_memcpy(src, dst, bytes);
}
-/*
+/**
* Special case for glBlendFunc(GL_ONE, GL_ZERO)
+ * Any chanType ok.
*/
static void _BLENDAPI
-blend_replace( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_replace(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
- ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendSrcRGB==GL_ONE);
- ASSERT(ctx->Color.BlendDstRGB==GL_ZERO);
+ ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendSrcRGB == GL_ONE);
+ ASSERT(ctx->Color.BlendDstRGB == GL_ZERO);
(void) ctx;
(void) n;
(void) mask;
- (void) rgba;
- (void) dest;
+ (void) src;
+ (void) dst;
}
-/*
- * Common transparency blending mode.
+/**
+ * Common transparency blending mode:
+ * glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).
*/
static void _BLENDAPI
-blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_transparency_ubyte(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
+ const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
GLuint i;
- ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendSrcRGB==GL_SRC_ALPHA);
- ASSERT(ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA);
+
+ ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA);
+ ASSERT(chanType == GL_UNSIGNED_BYTE);
+
(void) ctx;
- for (i=0;i<n;i++) {
+ for (i = 0; i < n; i++) {
if (mask[i]) {
- const GLchan t = rgba[i][ACOMP]; /* t in [0, CHAN_MAX] */
+ const GLint t = rgba[i][ACOMP]; /* t is in [0, 255] */
if (t == 0) {
/* 0% alpha */
- rgba[i][RCOMP] = dest[i][RCOMP];
- rgba[i][GCOMP] = dest[i][GCOMP];
- rgba[i][BCOMP] = dest[i][BCOMP];
- rgba[i][ACOMP] = dest[i][ACOMP];
- }
- else if (t == CHAN_MAX) {
- /* 100% alpha, no-op */
+ COPY_4UBV(rgba[i], dest[i]);
}
- else {
-#if 0
- /* This is pretty close, but Glean complains */
- const GLint s = CHAN_MAX - t;
- const GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s + 1) >> 8;
- const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s + 1) >> 8;
- const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s + 1) >> 8;
- const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s + 1) >> 8;
-#elif 0
- /* This is slower but satisfies Glean */
- const GLint s = CHAN_MAX - t;
- const GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s) / 255;
- const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s) / 255;
- const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s) / 255;
- const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s) / 255;
-#else
-#if CHAN_BITS == 8
- /* This satisfies Glean and should be reasonably fast */
- /* Contributed by Nathan Hand */
-#if 0
-#define DIV255(X) (((X) << 8) + (X) + 256) >> 16
-#else
- GLint temp;
-#define DIV255(X) (temp = (X), ((temp << 8) + temp + 256) >> 16)
-#endif
+ else if (t != 255) {
+ GLint divtemp;
const GLint r = DIV255((rgba[i][RCOMP] - dest[i][RCOMP]) * t) + dest[i][RCOMP];
const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP];
const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP];
const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP];
-
-#undef DIV255
-#elif CHAN_BITS == 16
- const GLfloat tt = (GLfloat) t / CHAN_MAXF;
- const GLint r = (GLint) ((rgba[i][RCOMP] - dest[i][RCOMP]) * tt + dest[i][RCOMP]);
- const GLint g = (GLint) ((rgba[i][GCOMP] - dest[i][GCOMP]) * tt + dest[i][GCOMP]);
- const GLint b = (GLint) ((rgba[i][BCOMP] - dest[i][BCOMP]) * tt + dest[i][BCOMP]);
- const GLint a = (GLint) ((rgba[i][ACOMP] - dest[i][ACOMP]) * tt + dest[i][ACOMP]);
-#else /* CHAN_BITS == 32 */
- const GLfloat tt = (GLfloat) t / CHAN_MAXF;
- const GLfloat r = (rgba[i][RCOMP] - dest[i][RCOMP]) * tt + dest[i][RCOMP];
- const GLfloat g = (rgba[i][GCOMP] - dest[i][GCOMP]) * tt + dest[i][GCOMP];
- const GLfloat b = (rgba[i][BCOMP] - dest[i][BCOMP]) * tt + dest[i][BCOMP];
- const GLfloat a = CLAMP( rgba[i][ACOMP], 0.0F, CHAN_MAXF ) * t +
- CLAMP( dest[i][ACOMP], 0.0F, CHAN_MAXF ) * (1.0F - t);
-#endif
-#endif
- ASSERT(r <= CHAN_MAX);
- ASSERT(g <= CHAN_MAX);
- ASSERT(b <= CHAN_MAX);
- ASSERT(a <= CHAN_MAX);
- rgba[i][RCOMP] = (GLchan) r;
- rgba[i][GCOMP] = (GLchan) g;
- rgba[i][BCOMP] = (GLchan) b;
- rgba[i][ACOMP] = (GLchan) a;
+ ASSERT(r <= 255);
+ ASSERT(g <= 255);
+ ASSERT(b <= 255);
+ ASSERT(a <= 255);
+ rgba[i][RCOMP] = (GLubyte) r;
+ rgba[i][GCOMP] = (GLubyte) g;
+ rgba[i][BCOMP] = (GLubyte) b;
+ rgba[i][ACOMP] = (GLubyte) a;
}
}
}
}
+static void _BLENDAPI
+blend_transparency_ushort(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
+{
+ GLushort (*rgba)[4] = (GLushort (*)[4]) src;
+ const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
+ GLuint i;
+
+ ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA);
+ ASSERT(chanType == GL_UNSIGNED_SHORT);
+
+ (void) ctx;
+
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ const GLint t = rgba[i][ACOMP];
+ if (t == 0) {
+ /* 0% alpha */
+ COPY_4V(rgba[i], dest[i]);
+ }
+ else if (t != 65535) {
+ const GLfloat tt = (GLfloat) t / 65535.0F;
+ GLushort r = (GLushort) ((rgba[i][RCOMP] - dest[i][RCOMP]) * tt + dest[i][RCOMP]);
+ GLushort g = (GLushort) ((rgba[i][GCOMP] - dest[i][GCOMP]) * tt + dest[i][GCOMP]);
+ GLushort b = (GLushort) ((rgba[i][BCOMP] - dest[i][BCOMP]) * tt + dest[i][BCOMP]);
+ GLushort a = (GLushort) ((rgba[i][ACOMP] - dest[i][ACOMP]) * tt + dest[i][ACOMP]);
+ ASSIGN_4V(rgba[i], r, g, b, a);
+ }
+ }
+ }
+}
+
-/*
- * Add src and dest.
- */
static void _BLENDAPI
-blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_transparency_float(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
+ const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
GLuint i;
- ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD);
- ASSERT(ctx->Color.BlendSrcRGB==GL_ONE);
- ASSERT(ctx->Color.BlendDstRGB==GL_ONE);
+
+ ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA);
+ ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA);
+ ASSERT(chanType == GL_FLOAT);
+
(void) ctx;
- for (i=0;i<n;i++) {
+ for (i = 0; i < n; i++) {
if (mask[i]) {
-#if CHAN_TYPE == GL_FLOAT
- /* don't RGB clamp to max */
- GLfloat a = CLAMP(rgba[i][ACOMP], 0.0F, CHAN_MAXF) + dest[i][ACOMP];
- rgba[i][RCOMP] += dest[i][RCOMP];
- rgba[i][GCOMP] += dest[i][GCOMP];
- rgba[i][BCOMP] += dest[i][BCOMP];
- rgba[i][ACOMP] = (GLchan) MIN2( a, CHAN_MAXF );
-#else
- GLint r = rgba[i][RCOMP] + dest[i][RCOMP];
- GLint g = rgba[i][GCOMP] + dest[i][GCOMP];
- GLint b = rgba[i][BCOMP] + dest[i][BCOMP];
- GLint a = rgba[i][ACOMP] + dest[i][ACOMP];
- rgba[i][RCOMP] = (GLchan) MIN2( r, CHAN_MAX );
- rgba[i][GCOMP] = (GLchan) MIN2( g, CHAN_MAX );
- rgba[i][BCOMP] = (GLchan) MIN2( b, CHAN_MAX );
- rgba[i][ACOMP] = (GLchan) MIN2( a, CHAN_MAX );
-#endif
+ const GLfloat t = rgba[i][ACOMP]; /* t in [0, 1] */
+ if (t == 0.0F) {
+ /* 0% alpha */
+ COPY_4V(rgba[i], dest[i]);
+ }
+ else if (t != 1.0F) {
+ GLfloat r = (rgba[i][RCOMP] - dest[i][RCOMP]) * t + dest[i][RCOMP];
+ GLfloat g = (rgba[i][GCOMP] - dest[i][GCOMP]) * t + dest[i][GCOMP];
+ GLfloat b = (rgba[i][BCOMP] - dest[i][BCOMP]) * t + dest[i][BCOMP];
+ GLfloat a = (rgba[i][ACOMP] - dest[i][ACOMP]) * t + dest[i][ACOMP];
+ ASSIGN_4V(rgba[i], r, g, b, a);
+ }
}
}
}
-/*
- * Blend min function (for GL_EXT_blend_minmax)
+/**
+ * Add src and dest: glBlendFunc(GL_ONE, GL_ONE).
+ * Any chanType ok.
*/
static void _BLENDAPI
-blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_add(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
- ASSERT(ctx->Color.BlendEquationRGB==GL_MIN);
- ASSERT(ctx->Color.BlendEquationA==GL_MIN);
+
+ ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD);
+ ASSERT(ctx->Color.BlendSrcRGB == GL_ONE);
+ ASSERT(ctx->Color.BlendDstRGB == GL_ONE);
(void) ctx;
- for (i=0;i<n;i++) {
- if (mask[i]) {
- rgba[i][RCOMP] = (GLchan) MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
- rgba[i][GCOMP] = (GLchan) MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
- rgba[i][BCOMP] = (GLchan) MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
-#if CHAN_TYPE == GL_FLOAT
- rgba[i][ACOMP] = (GLchan) MIN2(CLAMP(rgba[i][ACOMP], 0.0F, CHAN_MAXF),
- dest[i][ACOMP]);
-#else
- rgba[i][ACOMP] = (GLchan) MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
-#endif
+ if (chanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
+ const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLint r = rgba[i][RCOMP] + dest[i][RCOMP];
+ GLint g = rgba[i][GCOMP] + dest[i][GCOMP];
+ GLint b = rgba[i][BCOMP] + dest[i][BCOMP];
+ GLint a = rgba[i][ACOMP] + dest[i][ACOMP];
+ rgba[i][RCOMP] = (GLubyte) MIN2( r, 255 );
+ rgba[i][GCOMP] = (GLubyte) MIN2( g, 255 );
+ rgba[i][BCOMP] = (GLubyte) MIN2( b, 255 );
+ rgba[i][ACOMP] = (GLubyte) MIN2( a, 255 );
+ }
+ }
+ }
+ else if (chanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = (GLushort (*)[4]) src;
+ const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLint r = rgba[i][RCOMP] + dest[i][RCOMP];
+ GLint g = rgba[i][GCOMP] + dest[i][GCOMP];
+ GLint b = rgba[i][BCOMP] + dest[i][BCOMP];
+ GLint a = rgba[i][ACOMP] + dest[i][ACOMP];
+ rgba[i][RCOMP] = (GLshort) MIN2( r, 255 );
+ rgba[i][GCOMP] = (GLshort) MIN2( g, 255 );
+ rgba[i][BCOMP] = (GLshort) MIN2( b, 255 );
+ rgba[i][ACOMP] = (GLshort) MIN2( a, 255 );
+ }
+ }
+ }
+ else {
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
+ const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
+ ASSERT(chanType == GL_FLOAT);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ /* don't RGB clamp to max */
+ rgba[i][RCOMP] += dest[i][RCOMP];
+ rgba[i][GCOMP] += dest[i][GCOMP];
+ rgba[i][BCOMP] += dest[i][BCOMP];
+ rgba[i][ACOMP] += dest[i][ACOMP];
+ }
}
}
}
-/*
- * Blend max function (for GL_EXT_blend_minmax)
+/**
+ * Blend min function.
+ * Any chanType ok.
*/
static void _BLENDAPI
-blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_min(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
- ASSERT(ctx->Color.BlendEquationRGB==GL_MAX);
- ASSERT(ctx->Color.BlendEquationA==GL_MAX);
+ ASSERT(ctx->Color.BlendEquationRGB == GL_MIN);
+ ASSERT(ctx->Color.BlendEquationA == GL_MIN);
(void) ctx;
- for (i=0;i<n;i++) {
- if (mask[i]) {
- rgba[i][RCOMP] = (GLchan) MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
- rgba[i][GCOMP] = (GLchan) MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
- rgba[i][BCOMP] = (GLchan) MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
-#if CHAN_TYPE == GL_FLOAT
- rgba[i][ACOMP] = (GLchan) MAX2(CLAMP(rgba[i][ACOMP], 0.0F, CHAN_MAXF),
- dest[i][ACOMP]);
-#else
- rgba[i][ACOMP] = (GLchan) MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
-#endif
+ if (chanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
+ const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
+ }
+ }
+ else if (chanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = (GLushort (*)[4]) src;
+ const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
+ }
+ }
+ else {
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
+ const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
+ ASSERT(chanType == GL_FLOAT);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
}
}
}
-
-/*
- * Modulate: result = src * dest
+/**
+ * Blend max function.
+ * Any chanType ok.
*/
static void _BLENDAPI
-blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_max(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
+ ASSERT(ctx->Color.BlendEquationRGB == GL_MAX);
+ ASSERT(ctx->Color.BlendEquationA == GL_MAX);
(void) ctx;
- for (i=0;i<n;i++) {
- if (mask[i]) {
-#if CHAN_TYPE == GL_FLOAT
- rgba[i][RCOMP] = rgba[i][RCOMP] * dest[i][RCOMP];
- rgba[i][GCOMP] = rgba[i][GCOMP] * dest[i][GCOMP];
- rgba[i][BCOMP] = rgba[i][BCOMP] * dest[i][BCOMP];
- rgba[i][ACOMP] = rgba[i][ACOMP] * dest[i][ACOMP];
-#elif CHAN_TYPE == GL_UNSIGNED_SHORT
- GLint r = (rgba[i][RCOMP] * dest[i][RCOMP] + 65535) >> 16;
- GLint g = (rgba[i][GCOMP] * dest[i][GCOMP] + 65535) >> 16;
- GLint b = (rgba[i][BCOMP] * dest[i][BCOMP] + 65535) >> 16;
- GLint a = (rgba[i][ACOMP] * dest[i][ACOMP] + 65535) >> 16;
- rgba[i][RCOMP] = (GLchan) r;
- rgba[i][GCOMP] = (GLchan) g;
- rgba[i][BCOMP] = (GLchan) b;
- rgba[i][ACOMP] = (GLchan) a;
-#else
- GLint r = (rgba[i][RCOMP] * dest[i][RCOMP] + 255) >> 8;
- GLint g = (rgba[i][GCOMP] * dest[i][GCOMP] + 255) >> 8;
- GLint b = (rgba[i][BCOMP] * dest[i][BCOMP] + 255) >> 8;
- GLint a = (rgba[i][ACOMP] * dest[i][ACOMP] + 255) >> 8;
- rgba[i][RCOMP] = (GLchan) r;
- rgba[i][GCOMP] = (GLchan) g;
- rgba[i][BCOMP] = (GLchan) b;
- rgba[i][ACOMP] = (GLchan) a;
-#endif
+ if (chanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
+ const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
+ }
+ }
+ else if (chanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = (GLushort (*)[4]) src;
+ const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
+ }
+ }
+ else {
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
+ const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
+ ASSERT(chanType == GL_FLOAT);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
}
}
}
-/*
- * General case blend pixels.
- * Input: n - number of pixels
- * mask - the usual write mask
- * In/Out: rgba - the incoming and modified pixels
- * Input: dest - the pixels from the dest color buffer
+/**
+ * Modulate: result = src * dest
+ * Any chanType ok.
*/
static void _BLENDAPI
-blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan rgba[][4], CONST GLchan dest[][4] )
+blend_modulate(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst, GLenum chanType)
{
- const GLfloat rscale = 1.0F / CHAN_MAXF;
- const GLfloat gscale = 1.0F / CHAN_MAXF;
- const GLfloat bscale = 1.0F / CHAN_MAXF;
- const GLfloat ascale = 1.0F / CHAN_MAXF;
GLuint i;
+ (void) ctx;
- for (i=0;i<n;i++) {
- if (mask[i]) {
-#if CHAN_TYPE == GL_FLOAT
- GLfloat Rs, Gs, Bs, As; /* Source colors */
- GLfloat Rd, Gd, Bd, Ad; /* Dest colors */
-#else
- GLint Rs, Gs, Bs, As; /* Source colors */
- GLint Rd, Gd, Bd, Ad; /* Dest colors */
-#endif
- GLfloat sR, sG, sB, sA; /* Source scaling */
- GLfloat dR, dG, dB, dA; /* Dest scaling */
- GLfloat r, g, b, a; /* result color */
+ if (chanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
+ const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ GLint divtemp;
+ rgba[i][RCOMP] = DIV255(rgba[i][RCOMP] * dest[i][RCOMP]);
+ rgba[i][GCOMP] = DIV255(rgba[i][GCOMP] * dest[i][GCOMP]);
+ rgba[i][BCOMP] = DIV255(rgba[i][BCOMP] * dest[i][BCOMP]);
+ rgba[i][ACOMP] = DIV255(rgba[i][ACOMP] * dest[i][ACOMP]);
+ }
+ }
+ }
+ else if (chanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = (GLushort (*)[4]) src;
+ const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = (rgba[i][RCOMP] * dest[i][RCOMP] + 65535) >> 16;
+ rgba[i][GCOMP] = (rgba[i][GCOMP] * dest[i][GCOMP] + 65535) >> 16;
+ rgba[i][BCOMP] = (rgba[i][BCOMP] * dest[i][BCOMP] + 65535) >> 16;
+ rgba[i][ACOMP] = (rgba[i][ACOMP] * dest[i][ACOMP] + 65535) >> 16;
+ }
+ }
+ }
+ else {
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
+ const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
+ ASSERT(chanType == GL_FLOAT);
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ rgba[i][RCOMP] = rgba[i][RCOMP] * dest[i][RCOMP];
+ rgba[i][GCOMP] = rgba[i][GCOMP] * dest[i][GCOMP];
+ rgba[i][BCOMP] = rgba[i][BCOMP] * dest[i][BCOMP];
+ rgba[i][ACOMP] = rgba[i][ACOMP] * dest[i][ACOMP];
+ }
+ }
+ }
+}
+
+
+/**
+ * Do any blending operation, using floating point.
+ * \param n number of pixels
+ * \param mask fragment writemask array
+ * \param rgba array of incoming (and modified) pixels
+ * \param dest array of pixels from the dest color buffer
+ */
+static void
+blend_general_float(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLfloat rgba[][4], GLfloat dest[][4],
+ GLenum chanType)
+{
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
/* Incoming/source Color */
- Rs = rgba[i][RCOMP];
- Gs = rgba[i][GCOMP];
- Bs = rgba[i][BCOMP];
- As = rgba[i][ACOMP];
-#if CHAN_TYPE == GL_FLOAT
- /* clamp */
- Rs = MIN2(Rs, CHAN_MAXF);
- Gs = MIN2(Gs, CHAN_MAXF);
- Bs = MIN2(Bs, CHAN_MAXF);
- As = MIN2(As, CHAN_MAXF);
-#endif
+ const GLfloat Rs = rgba[i][RCOMP];
+ const GLfloat Gs = rgba[i][GCOMP];
+ const GLfloat Bs = rgba[i][BCOMP];
+ const GLfloat As = rgba[i][ACOMP];
/* Frame buffer/dest color */
- Rd = dest[i][RCOMP];
- Gd = dest[i][GCOMP];
- Bd = dest[i][BCOMP];
- Ad = dest[i][ACOMP];
-#if CHAN_TYPE == GL_FLOAT
- /* clamp */
- Rd = MIN2(Rd, CHAN_MAXF);
- Gd = MIN2(Gd, CHAN_MAXF);
- Bd = MIN2(Bd, CHAN_MAXF);
- Ad = MIN2(Ad, CHAN_MAXF);
-#endif
+ const GLfloat Rd = dest[i][RCOMP];
+ const GLfloat Gd = dest[i][GCOMP];
+ const GLfloat Bd = dest[i][BCOMP];
+ const GLfloat Ad = dest[i][ACOMP];
+
+ GLfloat sR, sG, sB, sA; /* Source factor */
+ GLfloat dR, dG, dB, dA; /* Dest factor */
+ GLfloat r, g, b, a; /* result color */
+
+ /* XXX for the case of constant blend terms we could init
+ * the sX and dX variables just once before the loop.
+ */
/* Source RGB factor */
switch (ctx->Color.BlendSrcRGB) {
@@ -384,33 +508,33 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
sR = sG = sB = 1.0F;
break;
case GL_DST_COLOR:
- sR = (GLfloat) Rd * rscale;
- sG = (GLfloat) Gd * gscale;
- sB = (GLfloat) Bd * bscale;
+ sR = Rd;
+ sG = Gd;
+ sB = Bd;
break;
case GL_ONE_MINUS_DST_COLOR:
- sR = 1.0F - (GLfloat) Rd * rscale;
- sG = 1.0F - (GLfloat) Gd * gscale;
- sB = 1.0F - (GLfloat) Bd * bscale;
+ sR = 1.0F - Rd;
+ sG = 1.0F - Gd;
+ sB = 1.0F - Bd;
break;
case GL_SRC_ALPHA:
- sR = sG = sB = (GLfloat) As * ascale;
+ sR = sG = sB = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- sR = sG = sB = 1.0F - (GLfloat) As * ascale;
+ sR = sG = sB = 1.0F - As;
break;
case GL_DST_ALPHA:
- sR = sG = sB = (GLfloat) Ad * ascale;
+ sR = sG = sB = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
- sR = sG = sB = 1.0F - (GLfloat) Ad * ascale;
+ sR = sG = sB = 1.0F - Ad;
break;
case GL_SRC_ALPHA_SATURATE:
- if (As < CHAN_MAX - Ad) {
- sR = sG = sB = (GLfloat) As * ascale;
+ if (As < 1.0F - Ad) {
+ sR = sG = sB = As;
}
else {
- sR = sG = sB = 1.0F - (GLfloat) Ad * ascale;
+ sR = sG = sB = 1.0F - Ad;
}
break;
case GL_CONSTANT_COLOR:
@@ -429,19 +553,19 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
case GL_ONE_MINUS_CONSTANT_ALPHA:
sR = sG = sB = 1.0F - ctx->Color.BlendColor[3];
break;
- case GL_SRC_COLOR: /* GL_NV_blend_square */
- sR = (GLfloat) Rs * rscale;
- sG = (GLfloat) Gs * gscale;
- sB = (GLfloat) Bs * bscale;
+ case GL_SRC_COLOR:
+ sR = Rs;
+ sG = Gs;
+ sB = Bs;
break;
- case GL_ONE_MINUS_SRC_COLOR: /* GL_NV_blend_square */
- sR = 1.0F - (GLfloat) Rs * rscale;
- sG = 1.0F - (GLfloat) Gs * gscale;
- sB = 1.0F - (GLfloat) Bs * bscale;
+ case GL_ONE_MINUS_SRC_COLOR:
+ sR = 1.0F - Rs;
+ sG = 1.0F - Gs;
+ sB = 1.0F - Bs;
break;
default:
/* this should never happen */
- _mesa_problem(ctx, "Bad blend source RGB factor in do_blend");
+ _mesa_problem(ctx, "Bad blend source RGB factor in blend_general_float");
return;
}
@@ -454,22 +578,22 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
sA = 1.0F;
break;
case GL_DST_COLOR:
- sA = (GLfloat) Ad * ascale;
+ sA = Ad;
break;
case GL_ONE_MINUS_DST_COLOR:
- sA = 1.0F - (GLfloat) Ad * ascale;
+ sA = 1.0F - Ad;
break;
case GL_SRC_ALPHA:
- sA = (GLfloat) As * ascale;
+ sA = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- sA = 1.0F - (GLfloat) As * ascale;
+ sA = 1.0F - As;
break;
case GL_DST_ALPHA:
- sA =(GLfloat) Ad * ascale;
+ sA = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
- sA = 1.0F - (GLfloat) Ad * ascale;
+ sA = 1.0F - Ad;
break;
case GL_SRC_ALPHA_SATURATE:
sA = 1.0;
@@ -486,16 +610,17 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
case GL_ONE_MINUS_CONSTANT_ALPHA:
sA = 1.0F - ctx->Color.BlendColor[3];
break;
- case GL_SRC_COLOR: /* GL_NV_blend_square */
- sA = (GLfloat) As * ascale;
+ case GL_SRC_COLOR:
+ sA = As;
break;
- case GL_ONE_MINUS_SRC_COLOR: /* GL_NV_blend_square */
- sA = 1.0F - (GLfloat) As * ascale;
+ case GL_ONE_MINUS_SRC_COLOR:
+ sA = 1.0F - As;
break;
default:
/* this should never happen */
sA = 0.0F;
- _mesa_problem(ctx, "Bad blend source A factor in do_blend");
+ _mesa_problem(ctx, "Bad blend source A factor in blend_general_float");
+ return;
}
/* Dest RGB factor */
@@ -507,26 +632,26 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
dR = dG = dB = 1.0F;
break;
case GL_SRC_COLOR:
- dR = (GLfloat) Rs * rscale;
- dG = (GLfloat) Gs * gscale;
- dB = (GLfloat) Bs * bscale;
+ dR = Rs;
+ dG = Gs;
+ dB = Bs;
break;
case GL_ONE_MINUS_SRC_COLOR:
- dR = 1.0F - (GLfloat) Rs * rscale;
- dG = 1.0F - (GLfloat) Gs * gscale;
- dB = 1.0F - (GLfloat) Bs * bscale;
+ dR = 1.0F - Rs;
+ dG = 1.0F - Gs;
+ dB = 1.0F - Bs;
break;
case GL_SRC_ALPHA:
- dR = dG = dB = (GLfloat) As * ascale;
+ dR = dG = dB = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- dR = dG = dB = 1.0F - (GLfloat) As * ascale;
+ dR = dG = dB = 1.0F - As;
break;
case GL_DST_ALPHA:
- dR = dG = dB = (GLfloat) Ad * ascale;
+ dR = dG = dB = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
- dR = dG = dB = 1.0F - (GLfloat) Ad * ascale;
+ dR = dG = dB = 1.0F - Ad;
break;
case GL_CONSTANT_COLOR:
dR = ctx->Color.BlendColor[0];
@@ -544,20 +669,21 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
case GL_ONE_MINUS_CONSTANT_ALPHA:
dR = dG = dB = 1.0F - ctx->Color.BlendColor[3];
break;
- case GL_DST_COLOR: /* GL_NV_blend_square */
- dR = (GLfloat) Rd * rscale;
- dG = (GLfloat) Gd * gscale;
- dB = (GLfloat) Bd * bscale;
+ case GL_DST_COLOR:
+ dR = Rd;
+ dG = Gd;
+ dB = Bd;
break;
- case GL_ONE_MINUS_DST_COLOR: /* GL_NV_blend_square */
- dR = 1.0F - (GLfloat) Rd * rscale;
- dG = 1.0F - (GLfloat) Gd * gscale;
- dB = 1.0F - (GLfloat) Bd * bscale;
+ case GL_ONE_MINUS_DST_COLOR:
+ dR = 1.0F - Rd;
+ dG = 1.0F - Gd;
+ dB = 1.0F - Bd;
break;
default:
/* this should never happen */
dR = dG = dB = 0.0F;
- _mesa_problem(ctx, "Bad blend dest RGB factor in do_blend");
+ _mesa_problem(ctx, "Bad blend dest RGB factor in blend_general_float");
+ return;
}
/* Dest Alpha factor */
@@ -569,22 +695,22 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
dA = 1.0F;
break;
case GL_SRC_COLOR:
- dA = (GLfloat) As * ascale;
+ dA = As;
break;
case GL_ONE_MINUS_SRC_COLOR:
- dA = 1.0F - (GLfloat) As * ascale;
+ dA = 1.0F - As;
break;
case GL_SRC_ALPHA:
- dA = (GLfloat) As * ascale;
+ dA = As;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- dA = 1.0F - (GLfloat) As * ascale;
+ dA = 1.0F - As;
break;
case GL_DST_ALPHA:
- dA = (GLfloat) Ad * ascale;
+ dA = Ad;
break;
case GL_ONE_MINUS_DST_ALPHA:
- dA = 1.0F - (GLfloat) Ad * ascale;
+ dA = 1.0F - Ad;
break;
case GL_CONSTANT_COLOR:
dA = ctx->Color.BlendColor[3];
@@ -598,171 +724,176 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
case GL_ONE_MINUS_CONSTANT_ALPHA:
dA = 1.0F - ctx->Color.BlendColor[3];
break;
- case GL_DST_COLOR: /* GL_NV_blend_square */
- dA = (GLfloat) Ad * ascale;
+ case GL_DST_COLOR:
+ dA = Ad;
break;
- case GL_ONE_MINUS_DST_COLOR: /* GL_NV_blend_square */
- dA = 1.0F - (GLfloat) Ad * ascale;
+ case GL_ONE_MINUS_DST_COLOR:
+ dA = 1.0F - Ad;
break;
default:
/* this should never happen */
dA = 0.0F;
- _mesa_problem(ctx, "Bad blend dest A factor in do_blend");
+ _mesa_problem(ctx, "Bad blend dest A factor in blend_general_float");
return;
}
- /* Due to round-off problems we have to clamp against zero. */
- /* Optimization: we don't have to do this for all src & dst factors */
- if (dA < 0.0F) dA = 0.0F;
- if (dR < 0.0F) dR = 0.0F;
- if (dG < 0.0F) dG = 0.0F;
- if (dB < 0.0F) dB = 0.0F;
- if (sA < 0.0F) sA = 0.0F;
- if (sR < 0.0F) sR = 0.0F;
- if (sG < 0.0F) sG = 0.0F;
- if (sB < 0.0F) sB = 0.0F;
-
- ASSERT( sR <= 1.0 );
- ASSERT( sG <= 1.0 );
- ASSERT( sB <= 1.0 );
- ASSERT( sA <= 1.0 );
- ASSERT( dR <= 1.0 );
- ASSERT( dG <= 1.0 );
- ASSERT( dB <= 1.0 );
- ASSERT( dA <= 1.0 );
-
- /* compute blended color */
-#if CHAN_TYPE == GL_FLOAT
- if (ctx->Color.BlendEquationRGB==GL_FUNC_ADD) {
+ /* compute the blended RGB */
+ switch (ctx->Color.BlendEquationRGB) {
+ case GL_FUNC_ADD:
r = Rs * sR + Rd * dR;
g = Gs * sG + Gd * dG;
b = Bs * sB + Bd * dB;
a = As * sA + Ad * dA;
- }
- else if (ctx->Color.BlendEquationRGB==GL_FUNC_SUBTRACT) {
+ break;
+ case GL_FUNC_SUBTRACT:
r = Rs * sR - Rd * dR;
g = Gs * sG - Gd * dG;
b = Bs * sB - Bd * dB;
a = As * sA - Ad * dA;
- }
- else if (ctx->Color.BlendEquationRGB==GL_FUNC_REVERSE_SUBTRACT) {
+ break;
+ case GL_FUNC_REVERSE_SUBTRACT:
r = Rd * dR - Rs * sR;
g = Gd * dG - Gs * sG;
b = Bd * dB - Bs * sB;
a = Ad * dA - As * sA;
- }
- else if (ctx->Color.BlendEquationRGB==GL_MIN) {
+ break;
+ case GL_MIN:
r = MIN2( Rd, Rs );
g = MIN2( Gd, Gs );
b = MIN2( Bd, Bs );
- }
- else if (ctx->Color.BlendEquationRGB==GL_MAX) {
+ break;
+ case GL_MAX:
r = MAX2( Rd, Rs );
g = MAX2( Gd, Gs );
b = MAX2( Bd, Bs );
- }
- else {
+ break;
+ default:
/* should never get here */
r = g = b = 0.0F; /* silence uninitialized var warning */
_mesa_problem(ctx, "unexpected BlendEquation in blend_general()");
+ return;
}
- if (ctx->Color.BlendEquationA==GL_FUNC_ADD) {
+ /* compute the blended alpha */
+ switch (ctx->Color.BlendEquationA) {
+ case GL_FUNC_ADD:
a = As * sA + Ad * dA;
- }
- else if (ctx->Color.BlendEquationA==GL_FUNC_SUBTRACT) {
+ break;
+ case GL_FUNC_SUBTRACT:
a = As * sA - Ad * dA;
- }
- else if (ctx->Color.BlendEquationA==GL_FUNC_REVERSE_SUBTRACT) {
+ break;
+ case GL_FUNC_REVERSE_SUBTRACT:
a = Ad * dA - As * sA;
- }
- else if (ctx->Color.BlendEquationA==GL_MIN) {
+ break;
+ case GL_MIN:
a = MIN2( Ad, As );
- }
- else if (ctx->Color.BlendEquationA==GL_MAX) {
+ break;
+ case GL_MAX:
a = MAX2( Ad, As );
- }
- else {
+ break;
+ default:
/* should never get here */
a = 0.0F; /* silence uninitialized var warning */
_mesa_problem(ctx, "unexpected BlendEquation in blend_general()");
+ return;
}
/* final clamping */
+#if 0
rgba[i][RCOMP] = MAX2( r, 0.0F );
rgba[i][GCOMP] = MAX2( g, 0.0F );
rgba[i][BCOMP] = MAX2( b, 0.0F );
- rgba[i][ACOMP] = CLAMP( a, 0.0F, CHAN_MAXF );
+ rgba[i][ACOMP] = CLAMP( a, 0.0F, 1.0F );
#else
- if (ctx->Color.BlendEquationRGB==GL_FUNC_ADD) {
- r = Rs * sR + Rd * dR + 0.5F;
- g = Gs * sG + Gd * dG + 0.5F;
- b = Bs * sB + Bd * dB + 0.5F;
- }
- else if (ctx->Color.BlendEquationRGB==GL_FUNC_SUBTRACT) {
- r = Rs * sR - Rd * dR + 0.5F;
- g = Gs * sG - Gd * dG + 0.5F;
- b = Bs * sB - Bd * dB + 0.5F;
- }
- else if (ctx->Color.BlendEquationRGB==GL_FUNC_REVERSE_SUBTRACT) {
- r = Rd * dR - Rs * sR + 0.5F;
- g = Gd * dG - Gs * sG + 0.5F;
- b = Bd * dB - Bs * sB + 0.5F;
- }
- else if (ctx->Color.BlendEquationRGB==GL_MIN) {
- r = MIN2( Rd, Rs );
- g = MIN2( Gd, Gs );
- b = MIN2( Bd, Bs );
- }
- else if (ctx->Color.BlendEquationRGB==GL_MAX) {
- r = MAX2( Rd, Rs );
- g = MAX2( Gd, Gs );
- b = MAX2( Bd, Bs );
- }
- else {
- /* should never get here */
- r = g = b = 0.0F; /* silence uninitialized var warning */
- _mesa_problem(ctx, "unexpected BlendEquation in blend_general()");
- }
+ ASSIGN_4V(rgba[i], r, g, b, a);
+#endif
+ }
+ }
+}
- if (ctx->Color.BlendEquationA==GL_FUNC_ADD) {
- a = As * sA + Ad * dA + 0.5F;
+
+/**
+ * Do any blending operation, any chanType.
+ */
+static void
+blend_general(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ void *src, const void *dst, GLenum chanType)
+{
+ GLfloat rgbaF[MAX_WIDTH][4], destF[MAX_WIDTH][4];
+
+ if (chanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
+ const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
+ GLuint i;
+ /* convert ubytes to floats */
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ rgbaF[i][RCOMP] = UBYTE_TO_FLOAT(rgba[i][RCOMP]);
+ rgbaF[i][GCOMP] = UBYTE_TO_FLOAT(rgba[i][GCOMP]);
+ rgbaF[i][BCOMP] = UBYTE_TO_FLOAT(rgba[i][BCOMP]);
+ rgbaF[i][ACOMP] = UBYTE_TO_FLOAT(rgba[i][ACOMP]);
+ destF[i][RCOMP] = UBYTE_TO_FLOAT(dest[i][RCOMP]);
+ destF[i][GCOMP] = UBYTE_TO_FLOAT(dest[i][GCOMP]);
+ destF[i][BCOMP] = UBYTE_TO_FLOAT(dest[i][BCOMP]);
+ destF[i][ACOMP] = UBYTE_TO_FLOAT(dest[i][ACOMP]);
}
- else if (ctx->Color.BlendEquationA==GL_FUNC_SUBTRACT) {
- a = As * sA - Ad * dA + 0.5F;
+ }
+ /* do blend */
+ blend_general_float(ctx, n, mask, rgbaF, destF, chanType);
+ /* convert back to ubytes */
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][RCOMP], rgbaF[i][RCOMP]);
+ UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][GCOMP], rgbaF[i][GCOMP]);
+ UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][BCOMP], rgbaF[i][BCOMP]);
+ UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][ACOMP], rgbaF[i][ACOMP]);
}
- else if (ctx->Color.BlendEquationA==GL_FUNC_REVERSE_SUBTRACT) {
- a = Ad * dA - As * sA + 0.5F;
+ }
+ }
+ else if (chanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = (GLushort (*)[4]) src;
+ const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
+ GLuint i;
+ /* convert ushorts to floats */
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ rgbaF[i][RCOMP] = USHORT_TO_FLOAT(rgba[i][RCOMP]);
+ rgbaF[i][GCOMP] = USHORT_TO_FLOAT(rgba[i][GCOMP]);
+ rgbaF[i][BCOMP] = USHORT_TO_FLOAT(rgba[i][BCOMP]);
+ rgbaF[i][ACOMP] = USHORT_TO_FLOAT(rgba[i][ACOMP]);
+ destF[i][RCOMP] = USHORT_TO_FLOAT(dest[i][RCOMP]);
+ destF[i][GCOMP] = USHORT_TO_FLOAT(dest[i][GCOMP]);
+ destF[i][BCOMP] = USHORT_TO_FLOAT(dest[i][BCOMP]);
+ destF[i][ACOMP] = USHORT_TO_FLOAT(dest[i][ACOMP]);
}
- else if (ctx->Color.BlendEquationA==GL_MIN) {
- a = MIN2( Ad, As );
- }
- else if (ctx->Color.BlendEquationA==GL_MAX) {
- a = MAX2( Ad, As );
- }
- else {
- /* should never get here */
- a = 0.0F; /* silence uninitialized var warning */
- _mesa_problem(ctx, "unexpected BlendEquation in blend_general()");
+ }
+ /* do blend */
+ blend_general_float(ctx, n, mask, rgbaF, destF, chanType);
+ /* convert back to ushorts */
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ UNCLAMPED_FLOAT_TO_USHORT(rgba[i][RCOMP], rgbaF[i][RCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(rgba[i][GCOMP], rgbaF[i][GCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(rgba[i][BCOMP], rgbaF[i][BCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(rgba[i][ACOMP], rgbaF[i][ACOMP]);
}
-
- /* final clamping */
- rgba[i][RCOMP] = (GLchan) (GLint) CLAMP( r, 0.0F, CHAN_MAXF );
- rgba[i][GCOMP] = (GLchan) (GLint) CLAMP( g, 0.0F, CHAN_MAXF );
- rgba[i][BCOMP] = (GLchan) (GLint) CLAMP( b, 0.0F, CHAN_MAXF );
- rgba[i][ACOMP] = (GLchan) (GLint) CLAMP( a, 0.0F, CHAN_MAXF );
-#endif
}
}
+ else {
+ blend_general_float(ctx, n, mask, rgbaF, destF, chanType);
+ }
}
-/*
+
+/**
* Analyze current blending parameters to pick fastest blending function.
* Result: the ctx->Color.BlendFunc pointer is updated.
*/
-void _swrast_choose_blend_func( GLcontext *ctx )
+void
+_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType)
{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLenum eq = ctx->Color.BlendEquationRGB;
const GLenum srcRGB = ctx->Color.BlendSrcRGB;
const GLenum dstRGB = ctx->Color.BlendDstRGB;
@@ -770,103 +901,101 @@ void _swrast_choose_blend_func( GLcontext *ctx )
const GLenum dstA = ctx->Color.BlendDstA;
if (ctx->Color.BlendEquationRGB != ctx->Color.BlendEquationA) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_general;
+ swrast->BlendFunc = blend_general;
}
- else if (eq==GL_MIN) {
+ else if (eq == GL_MIN) {
/* Note: GL_MIN ignores the blending weight factors */
#if defined(USE_MMX_ASM)
- if ( cpu_has_mmx ) {
- SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_min;
+ if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
+ swrast->BlendFunc = _mesa_mmx_blend_min;
}
else
#endif
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_min;
+ swrast->BlendFunc = blend_min;
}
- else if (eq==GL_MAX) {
+ else if (eq == GL_MAX) {
/* Note: GL_MAX ignores the blending weight factors */
#if defined(USE_MMX_ASM)
- if ( cpu_has_mmx ) {
- SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_max;
+ if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
+ swrast->BlendFunc = _mesa_mmx_blend_max;
}
else
#endif
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_max;
+ swrast->BlendFunc = blend_max;
}
else if (srcRGB != srcA || dstRGB != dstA) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_general;
+ swrast->BlendFunc = blend_general;
}
- else if (eq==GL_FUNC_ADD && srcRGB==GL_SRC_ALPHA
- && dstRGB==GL_ONE_MINUS_SRC_ALPHA) {
+ else if (eq == GL_FUNC_ADD && srcRGB == GL_SRC_ALPHA
+ && dstRGB == GL_ONE_MINUS_SRC_ALPHA) {
#if defined(USE_MMX_ASM)
- if ( cpu_has_mmx ) {
- SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_transparency;
+ if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
+ swrast->BlendFunc = _mesa_mmx_blend_transparency;
}
else
#endif
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_transparency;
+ {
+ if (chanType == GL_UNSIGNED_BYTE)
+ swrast->BlendFunc = blend_transparency_ubyte;
+ else if (chanType == GL_UNSIGNED_SHORT)
+ swrast->BlendFunc = blend_transparency_ushort;
+ else
+ swrast->BlendFunc = blend_transparency_float;
+ }
}
- else if (eq==GL_FUNC_ADD && srcRGB==GL_ONE && dstRGB==GL_ONE) {
+ else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ONE) {
#if defined(USE_MMX_ASM)
- if ( cpu_has_mmx ) {
- SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_add;
+ if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
+ swrast->BlendFunc = _mesa_mmx_blend_add;
}
else
#endif
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_add;
+ swrast->BlendFunc = blend_add;
}
- else if (((eq==GL_FUNC_ADD || eq==GL_FUNC_REVERSE_SUBTRACT)
- && (srcRGB==GL_ZERO && dstRGB==GL_SRC_COLOR))
+ else if (((eq == GL_FUNC_ADD || eq == GL_FUNC_REVERSE_SUBTRACT)
+ && (srcRGB == GL_ZERO && dstRGB == GL_SRC_COLOR))
||
- ((eq==GL_FUNC_ADD || eq==GL_FUNC_SUBTRACT)
- && (srcRGB==GL_DST_COLOR && dstRGB==GL_ZERO))) {
+ ((eq == GL_FUNC_ADD || eq == GL_FUNC_SUBTRACT)
+ && (srcRGB == GL_DST_COLOR && dstRGB == GL_ZERO))) {
#if defined(USE_MMX_ASM)
- if ( cpu_has_mmx ) {
- SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_modulate;
+ if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) {
+ swrast->BlendFunc = _mesa_mmx_blend_modulate;
}
else
#endif
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_modulate;
+ swrast->BlendFunc = blend_modulate;
}
- else if (eq==GL_FUNC_ADD && srcRGB == GL_ZERO && dstRGB == GL_ONE) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_noop;
+ else if (eq == GL_FUNC_ADD && srcRGB == GL_ZERO && dstRGB == GL_ONE) {
+ swrast->BlendFunc = blend_noop;
}
- else if (eq==GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ZERO) {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_replace;
+ else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ZERO) {
+ swrast->BlendFunc = blend_replace;
}
else {
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_general;
+ swrast->BlendFunc = blend_general;
}
}
-/*
+/**
* Apply the blending operator to a span of pixels.
* We can handle horizontal runs of pixels (spans) or arrays of x/y
* pixel coordinates.
*/
void
-_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLchan rgba[][4])
+_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span)
{
- GLchan framebuffer[MAX_WIDTH][4];
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ void *rbPixels;
ASSERT(span->end <= MAX_WIDTH);
ASSERT(span->arrayMask & SPAN_RGBA);
+ ASSERT(rb->DataType == span->array->ChanType);
ASSERT(!ctx->Color._LogicOpEnabled);
- /* Read span of current frame buffer pixels */
- if (span->arrayMask & SPAN_XY) {
- /* array of x/y pixel coords */
- _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y,
- framebuffer, 4 * sizeof(GLchan));
- }
- else {
- /* horizontal run of pixels */
- _swrast_read_rgba_span(ctx, rb, span->end, span->x, span->y,
- framebuffer);
- }
+ rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
- SWRAST_CONTEXT(ctx)->BlendFunc( ctx, span->end, span->array->mask, rgba,
- (const GLchan (*)[4]) framebuffer );
+ swrast->BlendFunc(ctx, span->end, span->array->mask,
+ span->array->rgba, rbPixels, span->array->ChanType);
}
diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h
index c9519321521..0b8cbed1a01 100644
--- a/src/mesa/swrast/s_blend.h
+++ b/src/mesa/swrast/s_blend.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -32,12 +32,11 @@
extern void
-_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLchan rgba[][4]);
+_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span);
extern void
-_swrast_choose_blend_func(GLcontext *ctx);
+_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType);
#endif
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index 57f23ee829b..284ea2b5178 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -47,25 +47,53 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
const GLint y = ctx->DrawBuffer->_Ymin;
const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- GLchan clearColor[4];
+ SWspan span;
GLint i;
ASSERT(ctx->Visual.rgbMode);
ASSERT(rb->PutRow);
- CLAMPED_FLOAT_TO_CHAN(clearColor[RCOMP], ctx->Color.ClearColor[0]);
- CLAMPED_FLOAT_TO_CHAN(clearColor[GCOMP], ctx->Color.ClearColor[1]);
- CLAMPED_FLOAT_TO_CHAN(clearColor[BCOMP], ctx->Color.ClearColor[2]);
- CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]);
+ /* Initialize color span with clear color */
+ /* XXX optimize for clearcolor == black/zero (bzero) */
+ INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ span.array->ChanType = rb->DataType;
+ if (span.array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte clearColor[4];
+ UNCLAMPED_FLOAT_TO_UBYTE(clearColor[RCOMP], ctx->Color.ClearColor[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(clearColor[GCOMP], ctx->Color.ClearColor[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(clearColor[BCOMP], ctx->Color.ClearColor[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(clearColor[ACOMP], ctx->Color.ClearColor[3]);
+ for (i = 0; i < width; i++) {
+ COPY_4UBV(span.array->rgba[i], clearColor);
+ }
+ }
+ else if (span.array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort clearColor[4];
+ UNCLAMPED_FLOAT_TO_USHORT(clearColor[RCOMP], ctx->Color.ClearColor[0]);
+ UNCLAMPED_FLOAT_TO_USHORT(clearColor[GCOMP], ctx->Color.ClearColor[1]);
+ UNCLAMPED_FLOAT_TO_USHORT(clearColor[BCOMP], ctx->Color.ClearColor[2]);
+ UNCLAMPED_FLOAT_TO_USHORT(clearColor[ACOMP], ctx->Color.ClearColor[3]);
+ for (i = 0; i < width; i++) {
+ COPY_4V(span.array->rgba[i], clearColor);
+ }
+ }
+ else {
+ ASSERT(span.array->ChanType == GL_FLOAT);
+ for (i = 0; i < width; i++) {
+ COPY_4V(span.array->rgba[i], ctx->Color.ClearColor);
+ }
+ }
+ /* Note that masking will change the color values, but only the
+ * channels for which the write mask is GL_FALSE. The channels
+ * which which are write-enabled won't get modified.
+ */
for (i = 0; i < height; i++) {
- GLchan rgba[MAX_WIDTH][4];
- GLint j;
- for (j = 0; j < width; j++) {
- COPY_CHAN4(rgba[j], clearColor);
- }
- _swrast_mask_rgba_array( ctx, rb, width, x, y + i, rgba );
- rb->PutRow(ctx, rb, width, x, y + i, rgba, NULL);
+ span.x = x;
+ span.y = y + i;
+ _swrast_mask_rgba_span(ctx, rb, &span);
+ /* write masked row */
+ rb->PutRow(ctx, rb, width, x, y + i, span.array->rgba, NULL);
}
}
@@ -80,20 +108,29 @@ clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
const GLint y = ctx->DrawBuffer->_Ymin;
const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ SWspan span;
GLint i;
ASSERT(!ctx->Visual.rgbMode);
ASSERT(rb->PutRow);
ASSERT(rb->DataType == GL_UNSIGNED_INT);
+ /* Initialize index span with clear index */
+ INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ for (i = 0; i < width;i++) {
+ span.array->index[i] = ctx->Color.ClearIndex;
+ }
+
+ /* Note that masking will change the color indexes, but only the
+ * bits for which the write mask is GL_FALSE. The bits
+ * which are write-enabled won't get modified.
+ */
for (i = 0; i < height;i++) {
- GLuint span[MAX_WIDTH];
- GLint j;
- for (j = 0; j < width;j++) {
- span[j] = ctx->Color.ClearIndex;
- }
- _swrast_mask_ci_array(ctx, rb, width, x, y + i, span);
- rb->PutRow(ctx, rb, width, x, y + i, span, NULL);
+ span.x = x;
+ span.y = y + i;
+ _swrast_mask_ci_span(ctx, rb, &span);
+ /* write masked row */
+ rb->PutRow(ctx, rb, width, x, y + i, span.array->index, NULL);
}
}
@@ -256,18 +293,15 @@ clear_color_buffers(GLcontext *ctx)
/**
* Called via the device driver's ctx->Driver.Clear() function if the
* device driver can't clear one or more of the buffers itself.
- * \param mask bitfield of BUFER_BIT_* values indicating which renderbuffers
- * are to be cleared.
+ * \param buffers bitfield of BUFFER_BIT_* values indicating which
+ * renderbuffers are to be cleared.
* \param all if GL_TRUE, clear whole buffer, else clear specified region.
*/
void
-_swrast_Clear(GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y, GLint width, GLint height)
+_swrast_Clear(GLcontext *ctx, GLbitfield buffers)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- (void) all; (void) x; (void) y; (void) width; (void) height;
-
#ifdef DEBUG_FOO
{
const GLbitfield legalBits =
@@ -282,25 +316,25 @@ _swrast_Clear(GLcontext *ctx, GLbitfield mask,
BUFFER_BIT_AUX1 |
BUFFER_BIT_AUX2 |
BUFFER_BIT_AUX3;
- assert((mask & (~legalBits)) == 0);
+ assert((buffers & (~legalBits)) == 0);
}
#endif
RENDER_START(swrast,ctx);
/* do software clearing here */
- if (mask) {
- if (mask & ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
+ if (buffers) {
+ if (buffers & ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
clear_color_buffers(ctx);
}
- if (mask & BUFFER_BIT_DEPTH) {
+ if (buffers & BUFFER_BIT_DEPTH) {
_swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer);
}
- if (mask & BUFFER_BIT_ACCUM) {
+ if (buffers & BUFFER_BIT_ACCUM) {
_swrast_clear_accum_buffer(ctx,
ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
}
- if (mask & BUFFER_BIT_STENCIL) {
+ if (buffers & BUFFER_BIT_STENCIL) {
_swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer);
}
}
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index a265d9e6cef..52d560ffdb6 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -98,7 +98,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
rasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */
}
- if (ctx->FragmentProgram._Active) {
+ if (ctx->FragmentProgram._Enabled) {
rasterMask |= FRAGPROG_BIT;
}
@@ -199,14 +199,9 @@ _swrast_update_fog_state( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- /* convert fog color to GLchan values */
- CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[RCOMP], ctx->Fog.Color[RCOMP]);
- CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[GCOMP], ctx->Fog.Color[GCOMP]);
- CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[BCOMP], ctx->Fog.Color[BCOMP]);
-
/* determine if fog is needed, and if so, which fog mode */
swrast->_FogEnabled = GL_FALSE;
- if (ctx->FragmentProgram._Active) {
+ if (ctx->FragmentProgram._Enabled) {
if (ctx->FragmentProgram._Current->Base.Target==GL_FRAGMENT_PROGRAM_ARB) {
const struct gl_fragment_program *fp
= ctx->FragmentProgram._Current;
@@ -228,11 +223,17 @@ _swrast_update_fog_state( GLcontext *ctx )
* program parameters with current state values.
*/
static void
-_swrast_update_fragment_program( GLcontext *ctx )
+_swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState)
{
- if (ctx->FragmentProgram._Active) {
+ if (ctx->FragmentProgram._Enabled) {
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
- _mesa_load_state_parameters(ctx, fp->Base.Parameters);
+#if 0
+ /* XXX Need a way to trigger the initial loading of parameters
+ * even when there's no recent state changes.
+ */
+ if (fp->Base.Parameters->StateFlags & newState)
+#endif
+ _mesa_load_state_parameters(ctx, fp->Base.Parameters);
}
}
@@ -296,10 +297,11 @@ _swrast_validate_triangle( GLcontext *ctx,
_swrast_validate_derived( ctx );
swrast->choose_triangle( ctx );
+ ASSERT(swrast->Triangle);
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram._Active) {
+ && !ctx->FragmentProgram._Enabled) {
/* separate specular color, but no texture */
swrast->SpecTriangle = swrast->Triangle;
swrast->Triangle = _swrast_add_spec_terms_triangle;
@@ -319,10 +321,11 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
_swrast_validate_derived( ctx );
swrast->choose_line( ctx );
+ ASSERT(swrast->Line);
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram._Active) {
+ && !ctx->FragmentProgram._Enabled) {
swrast->SpecLine = swrast->Line;
swrast->Line = _swrast_add_spec_terms_line;
}
@@ -345,7 +348,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram._Active) {
+ && !ctx->FragmentProgram._Enabled) {
swrast->SpecPoint = swrast->Point;
swrast->Point = _swrast_add_spec_terms_point;
}
@@ -359,17 +362,16 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
* function, then call it.
*/
static void _ASMAPI
-_swrast_validate_blend_func( GLcontext *ctx, GLuint n,
- const GLubyte mask[],
- GLchan src[][4],
- CONST GLchan dst[][4] )
+_swrast_validate_blend_func(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst,
+ GLenum chanType )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- _swrast_validate_derived( ctx );
- _swrast_choose_blend_func( ctx );
+ _swrast_validate_derived( ctx ); /* why is this needed? */
+ _swrast_choose_blend_func( ctx, chanType );
- swrast->BlendFunc( ctx, n, mask, src, dst );
+ swrast->BlendFunc( ctx, n, mask, src, dst, chanType );
}
@@ -525,8 +527,18 @@ _swrast_validate_derived( GLcontext *ctx )
if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM))
_swrast_update_fog_state( ctx );
- if (swrast->NewState & _NEW_PROGRAM)
- _swrast_update_fragment_program( ctx );
+ if (swrast->NewState & (_NEW_MODELVIEW |
+ _NEW_PROJECTION |
+ _NEW_TEXTURE_MATRIX |
+ _NEW_FOG |
+ _NEW_LIGHT |
+ _NEW_LINE |
+ _NEW_TEXTURE |
+ _NEW_TRANSFORM |
+ _NEW_POINT |
+ _NEW_VIEWPORT |
+ _NEW_PROGRAM))
+ _swrast_update_fragment_program( ctx, swrast->NewState );
if (swrast->NewState & _NEW_TEXTURE)
_swrast_update_texture_samplers( ctx );
@@ -675,11 +687,22 @@ _swrast_CreateContext( GLcontext *ctx )
for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
swrast->TextureSample[i] = NULL;
- swrast->SpanArrays = MALLOC_STRUCT(span_arrays);
+ swrast->SpanArrays = MALLOC_STRUCT(sw_span_arrays);
if (!swrast->SpanArrays) {
FREE(swrast);
return GL_FALSE;
}
+ swrast->SpanArrays->ChanType = CHAN_TYPE;
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz1.rgba;
+ swrast->SpanArrays->spec = swrast->SpanArrays->color.sz1.spec;
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz2.rgba;
+ swrast->SpanArrays->spec = swrast->SpanArrays->color.sz2.spec;
+#else
+ swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz4.rgba;
+ swrast->SpanArrays->spec = swrast->SpanArrays->color.sz4.spec;
+#endif
/* init point span buffer */
swrast->PointSpan.primitive = GL_POINT;
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index 3c5a4c32228..37d7081d4d6 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -49,7 +49,7 @@
/**
* \defgroup SpanFlags SPAN_XXX-flags
- * Bitmasks to indicate which span_arrays need to be computed
+ * Bitmasks to indicate which sw_span_arrays need to be computed
* (sw_span::interpMask) or have already been filled in (sw_span::arrayMask)
*/
/*@{*/
@@ -69,21 +69,52 @@
#define SPAN_VARYING 0x2000
/*@}*/
+#if 0
+/* alternate arrangement for code below */
+struct arrays2 {
+ union {
+ GLubyte sz1[MAX_WIDTH][4]; /* primary color */
+ GLushort sz2[MAX_WIDTH][4];
+ GLfloat sz4[MAX_WIDTH][4];
+ } rgba;
+ union {
+ GLubyte sz1[MAX_WIDTH][4]; /* specular color and temp storage */
+ GLushort sz2[MAX_WIDTH][4];
+ GLfloat sz4[MAX_WIDTH][4];
+ } spec;
+};
+#endif
+
/**
- * \struct span_arrays
+ * \sw_span_arrays
* \brief Arrays of fragment values.
*
* These will either be computed from the x/xStep values above or
* filled in by glDraw/CopyPixels, etc.
* These arrays are separated out of sw_span to conserve memory.
*/
-struct span_arrays {
- /* XXX the next three fields could go into a union */
- GLchan rgb[MAX_WIDTH][3];
- GLchan rgba[MAX_WIDTH][4];
+typedef struct sw_span_arrays {
+ GLenum ChanType; /**< Color channel type, GL_UNSIGNED_BYTE, GL_FLOAT */
+ union {
+ struct {
+ GLubyte rgba[MAX_WIDTH][4]; /**< primary color */
+ GLubyte spec[MAX_WIDTH][4]; /**< specular color and temp storage */
+ } sz1;
+ struct {
+ GLushort rgba[MAX_WIDTH][4];
+ GLushort spec[MAX_WIDTH][4];
+ } sz2;
+ struct {
+ GLfloat rgba[MAX_WIDTH][4];
+ GLfloat spec[MAX_WIDTH][4];
+ } sz4;
+ } color;
+ /** XXX these are temporary fields, pointing into above color arrays */
+ GLchan (*rgba)[4];
+ GLchan (*spec)[4];
+
GLuint index[MAX_WIDTH];
- GLchan spec[MAX_WIDTH][4]; /* specular color */
GLint x[MAX_WIDTH]; /**< X/Y used for point/line rendering only */
GLint y[MAX_WIDTH]; /**< X/Y used for point/line rendering only */
GLuint z[MAX_WIDTH];
@@ -95,11 +126,11 @@ struct span_arrays {
/** This mask indicates which fragments are alive or culled */
GLubyte mask[MAX_WIDTH];
-};
+} SWspanarrays;
/**
- * \struct sw_span
+ * \SWspan
* \brief Contains data for either a horizontal line or a set of
* pixels that are passed through a pipeline of functions before being
* drawn.
@@ -120,7 +151,7 @@ struct span_arrays {
* stream of these structures which would be consumed by one or more
* span-processing threads which could run in parallel.
*/
-struct sw_span {
+typedef struct sw_span {
GLint x, y;
/** Only need to process pixels between start <= i < end */
@@ -197,8 +228,9 @@ struct sw_span {
* a lot of memory. The span_arrays struct is about 400KB while the
* sw_span struct is only about 512 bytes.
*/
- struct span_arrays *array;
-};
+ SWspanarrays *array;
+} SWspan;
+
#define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \
@@ -220,7 +252,8 @@ typedef void (*texture_sample_func)(GLcontext *ctx,
typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n,
const GLubyte mask[],
- GLchan src[][4], CONST GLchan dst[][4] );
+ GLvoid *src, const GLvoid *dst,
+ GLenum chanType);
typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *);
@@ -272,7 +305,7 @@ typedef void (*validate_texture_image_func)(GLcontext *ctx,
/**
* \struct SWcontext
- * \brief SWContext?
+ * \brief Per-context state that's private to the software rasterizer module.
*/
typedef struct
{
@@ -293,7 +326,6 @@ typedef struct
GLfloat _BackfaceSign;
GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */
GLboolean _AnyTextureCombine;
- GLchan _FogColor[3];
GLboolean _FogEnabled;
GLenum _FogMode; /* either GL_FOG_MODE or fragment program's fog mode */
@@ -356,12 +388,12 @@ typedef struct
* this object is big and causes problems when allocated on the stack
* on some systems.
*/
- struct span_arrays *SpanArrays;
+ SWspanarrays *SpanArrays;
/**
* Used to buffer N GL_POINTS, instead of rendering one by one.
*/
- struct sw_span PointSpan;
+ SWspan PointSpan;
/** Internal hooks, kept up to date by the same mechanism as above.
*/
@@ -400,6 +432,16 @@ _swrast_validate_derived( GLcontext *ctx );
+/**
+ * Size of an RGBA pixel, in bytes, for given datatype.
+ */
+#define RGBA_PIXEL_SIZE(TYPE) \
+ ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \
+ ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \
+ : 4 * sizeof(GLfloat)))
+
+
+
/*
* XXX these macros are just bandages for now in order to make
* CHAN_BITS==32 compile cleanly.
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 88fd445132b..761ab724e91 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -41,11 +41,12 @@
-/*
+/**
* Determine if there's overlap in an image copy.
* This test also compensates for the fact that copies are done from
* bottom to top and overlaps can sometimes be handled correctly
* without making a temporary image copy.
+ * \return GL_TRUE if the regions overlap, GL_FALSE otherwise.
*/
static GLboolean
regions_overlap(GLint srcx, GLint srcy,
@@ -87,41 +88,6 @@ regions_overlap(GLint srcx, GLint srcy,
/**
- * Convert GLfloat[n][4] colors to GLchan[n][4].
- * XXX maybe move into image.c
- */
-static void
-float_span_to_chan(GLuint n, CONST GLfloat in[][4], GLchan out[][4])
-{
- GLuint i;
- for (i = 0; i < n; i++) {
- UNCLAMPED_FLOAT_TO_CHAN(out[i][RCOMP], in[i][RCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(out[i][GCOMP], in[i][GCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(out[i][BCOMP], in[i][BCOMP]);
- UNCLAMPED_FLOAT_TO_CHAN(out[i][ACOMP], in[i][ACOMP]);
- }
-}
-
-
-/**
- * Convert GLchan[n][4] colors to GLfloat[n][4].
- * XXX maybe move into image.c
- */
-static void
-chan_span_to_float(GLuint n, CONST GLchan in[][4], GLfloat out[][4])
-{
- GLuint i;
- for (i = 0; i < n; i++) {
- out[i][RCOMP] = CHAN_TO_FLOAT(in[i][RCOMP]);
- out[i][GCOMP] = CHAN_TO_FLOAT(in[i][GCOMP]);
- out[i][BCOMP] = CHAN_TO_FLOAT(in[i][BCOMP]);
- out[i][ACOMP] = CHAN_TO_FLOAT(in[i][ACOMP]);
- }
-}
-
-
-
-/*
* RGBA copypixels with convolution.
*/
static void
@@ -129,13 +95,13 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint width, GLint height, GLint destx, GLint desty)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_renderbuffer *drawRb = NULL;
- GLboolean quick_draw;
GLint row;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
- const GLuint transferOps = ctx->_ImageTransferState;
+ const GLbitfield transferOps = ctx->_ImageTransferState;
+ const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink)
+ || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink);
GLfloat *dest, *tmpImage, *convImage;
- struct sw_span span;
+ SWspan span;
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
@@ -145,17 +111,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
_swrast_span_default_fog(ctx, &span);
- if (SWRAST_CONTEXT(ctx)->_RasterMask == 0
- && !zoom
- && destx >= 0
- && destx + width <= (GLint) ctx->DrawBuffer->Width) {
- quick_draw = GL_TRUE;
- drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
- }
- else {
- quick_draw = GL_FALSE;
- }
-
/* allocate space for GLfloat image */
tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
if (!tmpImage) {
@@ -169,15 +124,11 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
return;
}
- /* read source image */
+ /* read source image as float/RGBA */
dest = tmpImage;
for (row = 0; row < height; row++) {
- GLchan rgba[MAX_WIDTH][4];
- /* Read GLchan and convert to GLfloat */
_swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, srcx, srcy + row, rgba);
- chan_span_to_float(width, (CONST GLchan (*)[4]) rgba,
- (GLfloat (*)[4]) dest);
+ width, srcx, srcy + row, GL_FLOAT, dest);
dest += 4 * width;
}
@@ -207,38 +158,36 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
width, rgba);
}
- /* write the new image */
- for (row = 0; row < height; row++) {
- const GLfloat *src = convImage + row * width * 4;
- GLint dy;
+ if (!sink) {
+ /* write the new image */
+ for (row = 0; row < height; row++) {
+ const GLfloat *src = convImage + row * width * 4;
+ GLvoid *rgba = span.array->color.sz1.rgba; /* row storage */
- /* convert floats back to chan */
- float_span_to_chan(width, (const GLfloat (*)[4]) src, span.array->rgba);
+ /* copy convolved colors into span array */
+ _mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat));
- /* write row to framebuffer */
- dy = desty + row;
- if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) {
- drawRb->PutRow(ctx, drawRb, width, destx, dy, span.array->rgba, NULL);
- }
- else {
+ /* write span */
span.x = destx;
- span.y = dy;
+ span.y = desty + row;
span.end = width;
+ span.array->ChanType = GL_FLOAT;
if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span,
- (CONST GLchan (*)[4])span.array->rgba);
+ _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba);
}
else {
_swrast_write_rgba_span(ctx, &span);
}
}
+ /* restore this */
+ span.array->ChanType = CHAN_TYPE;
}
_mesa_free(convImage);
}
-/*
+/**
* RGBA copypixels
*/
static void
@@ -246,22 +195,18 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint width, GLint height, GLint destx, GLint desty)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_renderbuffer *drawRb;
- GLchan *tmpImage,*p;
- GLboolean quick_draw;
- GLint sy, dy, stepy, j;
+ GLfloat *tmpImage, *p;
+ GLint sy, dy, stepy, row;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
const GLuint transferOps = ctx->_ImageTransferState;
- struct sw_span span;
+ SWspan span;
if (!ctx->ReadBuffer->_ColorReadBuffer) {
/* no readbuffer - OK */
return;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
-
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty);
return;
@@ -289,35 +234,23 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
overlapping = GL_FALSE;
}
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
_swrast_span_default_fog(ctx, &span);
- if (SWRAST_CONTEXT(ctx)->_RasterMask == 0
- && !zoom
- && destx >= 0
- && destx + width <= (GLint) ctx->DrawBuffer->Width) {
- quick_draw = GL_TRUE;
- drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
- }
- else {
- quick_draw = GL_FALSE;
- drawRb = NULL;
- }
-
if (overlapping) {
- GLint ssy = sy;
- tmpImage = (GLchan *) _mesa_malloc(width * height * sizeof(GLchan) * 4);
+ tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4);
if (!tmpImage) {
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
return;
}
- /* read the source image */
+ /* read the source image as RGBA/float */
p = tmpImage;
- for (j = 0; j < height; j++, ssy += stepy) {
+ for (row = 0; row < height; row++) {
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, srcx, ssy, (GLchan (*)[4]) p );
+ width, srcx, sy + row, GL_FLOAT, p );
p += width * 4;
}
p = tmpImage;
@@ -327,49 +260,43 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
p = NULL;
}
- for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
- /* Get source pixels */
+ ASSERT(width < MAX_WIDTH);
+
+ for (row = 0; row < height; row++, sy += stepy, dy += stepy) {
+ GLvoid *rgba = span.array->color.sz4.rgba;
+
+ /* Get row/span of source pixels */
if (overlapping) {
/* get from buffered image */
- ASSERT(width < MAX_WIDTH);
- _mesa_memcpy(span.array->rgba, p, width * sizeof(GLchan) * 4);
+ _mesa_memcpy(rgba, p, width * sizeof(GLfloat) * 4);
p += width * 4;
}
else {
/* get from framebuffer */
- ASSERT(width < MAX_WIDTH);
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, srcx, sy, span.array->rgba );
+ width, srcx, sy, GL_FLOAT, rgba );
}
if (transferOps) {
- GLfloat rgbaFloat[MAX_WIDTH][4];
- /* convert to float, transfer, convert back to chan */
- chan_span_to_float(width, (CONST GLchan (*)[4]) span.array->rgba,
- rgbaFloat);
- _mesa_apply_rgba_transfer_ops(ctx, transferOps, width, rgbaFloat);
- float_span_to_chan(width, (CONST GLfloat (*)[4]) rgbaFloat,
- span.array->rgba);
+ _mesa_apply_rgba_transfer_ops(ctx, transferOps, width,
+ (GLfloat (*)[4]) rgba);
}
/* Write color span */
- if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) {
- drawRb->PutRow(ctx, drawRb, width, destx, dy, span.array->rgba, NULL);
+ span.x = destx;
+ span.y = dy;
+ span.end = width;
+ span.array->ChanType = GL_FLOAT;
+ if (zoom) {
+ _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba);
}
else {
- span.x = destx;
- span.y = dy;
- span.end = width;
- if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span,
- (CONST GLchan (*)[4]) span.array->rgba);
- }
- else {
- _swrast_write_rgba_span(ctx, &span);
- }
+ _swrast_write_rgba_span(ctx, &span);
}
}
+ span.array->ChanType = CHAN_TYPE; /* restore */
+
if (overlapping)
_mesa_free(tmpImage);
}
@@ -385,9 +312,8 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
GLint sy, dy, stepy;
GLint j;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
- const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
GLint overlapping;
- struct sw_span span;
+ SWspan span;
if (!ctx->ReadBuffer->_ColorReadBuffer) {
/* no readbuffer - OK */
@@ -455,13 +381,9 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
width, srcx, sy, span.array->index );
}
- /* Apply shift, offset, look-up table */
- if (shift_or_offset) {
- _mesa_shift_and_offset_ci( ctx, width, span.array->index );
- }
- if (ctx->Pixel.MapColorFlag) {
- _mesa_map_ci( ctx, width, span.array->index );
- }
+ if (ctx->_ImageTransferState)
+ _mesa_apply_ci_transfer_ops(ctx, ctx->_ImageTransferState,
+ width, span.array->index);
/* write color indexes */
span.x = destx;
@@ -530,7 +452,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
GLint j;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
- struct sw_span span;
+ SWspan span;
if (!readRb) {
/* no readbuffer - OK */
@@ -605,7 +527,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
if (fb->Visual.rgbMode) {
if (zoom)
_swrast_write_zoomed_rgba_span(ctx, destx, desty, &span,
- (const GLchan (*)[4]) span.array->rgba);
+ span.array->rgba);
else
_swrast_write_rgba_span(ctx, &span);
}
@@ -634,7 +556,6 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
GLint j;
GLstencil *p, *tmpImage;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
- const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
GLint overlapping;
if (!rb) {
@@ -695,13 +616,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
_swrast_read_stencil_span( ctx, rb, width, srcx, sy, stencil );
}
- /* Apply shift, offset, look-up table */
- if (shift_or_offset) {
- _mesa_shift_and_offset_stencil( ctx, width, stencil );
- }
- if (ctx->Pixel.MapStencilFlag) {
- _mesa_map_stencil( ctx, width, stencil );
- }
+ _mesa_apply_stencil_transfer_ops(ctx, width, stencil);
/* Write stencil values */
if (zoom) {
@@ -737,8 +652,6 @@ copy_depth_stencil_pixels(GLcontext *ctx,
const GLfloat depthScale = ctx->DrawBuffer->_DepthMaxF;
const GLuint stencilMask = ctx->Stencil.WriteMask[0];
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
- const GLboolean shiftOrOffset
- = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
const GLboolean scaleOrBias
= ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
GLint overlapping;
@@ -828,13 +741,7 @@ copy_depth_stencil_pixels(GLcontext *ctx,
width, srcX, sy, stencil);
}
- /* Apply shift, offset, look-up table */
- if (shiftOrOffset) {
- _mesa_shift_and_offset_stencil(ctx, width, stencil);
- }
- if (ctx->Pixel.MapStencilFlag) {
- _mesa_map_stencil(ctx, width, stencil);
- }
+ _mesa_apply_stencil_transfer_ops(ctx, width, stencil);
/* Write values */
if (zoom) {
@@ -902,6 +809,88 @@ copy_depth_stencil_pixels(GLcontext *ctx,
}
+
+/**
+ * Try to do a fast copy pixels.
+ */
+static GLboolean
+fast_copy_pixels(GLcontext *ctx,
+ GLint srcX, GLint srcY, GLsizei width, GLsizei height,
+ GLint dstX, GLint dstY, GLenum type)
+{
+ struct gl_framebuffer *srcFb = ctx->ReadBuffer;
+ struct gl_framebuffer *dstFb = ctx->DrawBuffer;
+ struct gl_renderbuffer *srcRb, *dstRb;
+ GLint row, yStep;
+
+ if (SWRAST_CONTEXT(ctx)->_RasterMask != 0x0 ||
+ ctx->Pixel.ZoomX != 1.0F ||
+ ctx->Pixel.ZoomY != 1.0F ||
+ ctx->_ImageTransferState) {
+ /* can't handle these */
+ return GL_FALSE;
+ }
+
+ if (type == GL_COLOR) {
+ if (dstFb->_NumColorDrawBuffers[0] != 1)
+ return GL_FALSE;
+ srcRb = srcFb->_ColorReadBuffer;
+ dstRb = dstFb->_ColorDrawBuffers[0][0];
+ }
+ else if (type == GL_STENCIL) {
+ srcRb = srcFb->_StencilBuffer;
+ dstRb = dstFb->_StencilBuffer;
+ }
+ else if (type == GL_DEPTH) {
+ srcRb = srcFb->_DepthBuffer;
+ dstRb = dstFb->_DepthBuffer;
+ }
+ else {
+ ASSERT(type == GL_DEPTH_STENCIL_EXT);
+ /* XXX correct? */
+ srcRb = srcFb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ dstRb = dstFb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ }
+
+ /* src and dst renderbuffers must be same format and type */
+ if (!srcRb || !dstRb ||
+ srcRb->DataType != dstRb->DataType ||
+ srcRb->_BaseFormat != dstRb->_BaseFormat) {
+ return GL_FALSE;
+ }
+
+ /* clipping not supported */
+ if (srcX < 0 || srcX + width > srcFb->Width ||
+ srcY < 0 || srcY + height > srcFb->Height ||
+ dstX < dstFb->_Xmin || dstX + width > dstFb->_Xmax ||
+ dstY < dstFb->_Ymin || dstY + height > dstFb->_Ymax) {
+ return GL_FALSE;
+ }
+
+ /* overlapping src/dst doesn't matter, just determine Y direction */
+ if (srcY < dstY) {
+ /* top-down max-to-min */
+ srcY = srcY + height - 1;
+ dstY = dstY + height - 1;
+ yStep = -1;
+ }
+ else {
+ /* bottom-up min-to-max */
+ yStep = 1;
+ }
+
+ for (row = 0; row < height; row++) {
+ GLuint temp[MAX_WIDTH][4];
+ srcRb->GetRow(ctx, srcRb, width, srcX, srcY, temp);
+ dstRb->PutRow(ctx, dstRb, width, dstX, dstY, temp, NULL);
+ srcY += yStep;
+ dstY += yStep;
+ }
+
+ return GL_TRUE;
+}
+
+
/**
* Do software-based glCopyPixels.
* By time we get here, all parameters will have been error-checked.
@@ -917,26 +906,28 @@ _swrast_CopyPixels( GLcontext *ctx,
if (swrast->NewState)
_swrast_validate_derived( ctx );
- switch (type) {
- case GL_COLOR:
- if (ctx->Visual.rgbMode) {
- copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty );
+ if (!fast_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, type)) {
+ switch (type) {
+ case GL_COLOR:
+ if (ctx->Visual.rgbMode) {
+ copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty );
+ }
+ else {
+ copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty );
+ }
+ break;
+ case GL_DEPTH:
+ copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty );
+ break;
+ case GL_STENCIL:
+ copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty );
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ copy_depth_stencil_pixels(ctx, srcx, srcy, width, height, destx, desty);
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected type in _swrast_CopyPixels");
}
- else {
- copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty );
- }
- break;
- case GL_DEPTH:
- copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty );
- break;
- case GL_STENCIL:
- copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty );
- break;
- case GL_DEPTH_STENCIL_EXT:
- copy_depth_stencil_pixels(ctx, srcx, srcy, width, height, destx, desty);
- break;
- default:
- _mesa_problem(ctx, "unexpected type in _swrast_CopyPixels");
}
RENDER_FINISH(swrast,ctx);
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 1001cea3524..cb584b5de8f 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -503,7 +503,7 @@ depth_test_span32( GLcontext *ctx, GLuint n,
* Apply depth test to span of fragments.
*/
static GLuint
-depth_test_span( GLcontext *ctx, struct sw_span *span)
+depth_test_span( GLcontext *ctx, SWspan *span)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_DepthBuffer;
@@ -1051,7 +1051,7 @@ direct_depth_test_pixels32(GLcontext *ctx, GLuint *zStart, GLuint stride,
static GLuint
-depth_test_pixels( GLcontext *ctx, struct sw_span *span )
+depth_test_pixels( GLcontext *ctx, SWspan *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_DepthBuffer;
@@ -1101,7 +1101,7 @@ depth_test_pixels( GLcontext *ctx, struct sw_span *span )
* \return approx number of pixels that passed (only zero is reliable)
*/
GLuint
-_swrast_depth_test_span( GLcontext *ctx, struct sw_span *span)
+_swrast_depth_test_span( GLcontext *ctx, SWspan *span)
{
if (span->arrayMask & SPAN_XY)
return depth_test_pixels(ctx, span);
@@ -1118,7 +1118,7 @@ _swrast_depth_test_span( GLcontext *ctx, struct sw_span *span)
* \return GL_TRUE if any fragments pass, GL_FALSE if no fragments pass
*/
GLboolean
-_swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span )
+_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_DepthBuffer;
diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h
index f93d95fa3d2..d1ed050efd6 100644
--- a/src/mesa/swrast/s_depth.h
+++ b/src/mesa/swrast/s_depth.h
@@ -32,11 +32,11 @@
extern GLuint
-_swrast_depth_test_span( GLcontext *ctx, struct sw_span *span);
+_swrast_depth_test_span( GLcontext *ctx, SWspan *span);
extern GLboolean
-_swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span );
+_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span );
extern void
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index cfe516733f1..bdb25583515 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -40,32 +40,37 @@
#include "s_zoom.h"
-/*
+
+/**
* Try to do a fast and simple RGB(a) glDrawPixels.
* Return: GL_TRUE if success, GL_FALSE if slow path must be used instead
*/
static GLboolean
-fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
+fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *userUnpack,
+ const GLvoid *pixels)
{
const GLint imgX = x, imgY = y;
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ const GLenum rbType = rb->DataType;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct sw_span span;
-
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
-
- if (swrast->_RasterMask & MULTI_DRAW_BIT)
- return GL_FALSE;
-
- if (ctx->_ImageTransferState) {
- /* don't handle any pixel transfer options here */
+ SWspan span;
+ GLboolean simpleZoom;
+ GLint yStep; /* +1 or -1 */
+ struct gl_pixelstore_attrib unpack;
+ GLint destX, destY, drawWidth, drawHeight; /* post clipping */
+
+ if ((swrast->_RasterMask & ~CLIP_BIT) ||
+ ctx->Texture._EnabledCoordUnits ||
+ userUnpack->SwapBytes ||
+ ctx->_ImageTransferState) {
+ /* can't handle any of those conditions */
return GL_FALSE;
}
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
@@ -73,372 +78,243 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
if (ctx->Texture._EnabledCoordUnits)
_swrast_span_default_texcoords(ctx, &span);
- if ((swrast->_RasterMask & ~CLIP_BIT) == 0
- && ctx->Texture._EnabledCoordUnits == 0
- && unpack->Alignment == 1 /* XXX may not really need this */
- && !unpack->SwapBytes
- && !unpack->LsbFirst) {
-
- /* XXX there's a lot of clipping code here that should be replaced
- * by a call to _mesa_clip_drawpixels().
- */
- GLint destX = x;
- GLint destY = y;
- GLint drawWidth = width; /* actual width drawn */
- GLint drawHeight = height; /* actual height drawn */
- GLint skipPixels = unpack->SkipPixels;
- GLint skipRows = unpack->SkipRows;
- GLint rowLength;
-
- if (unpack->RowLength > 0)
- rowLength = unpack->RowLength;
- else
- rowLength = width;
+ /* copy input params since clipping may change them */
+ unpack = *userUnpack;
+ destX = x;
+ destY = y;
+ drawWidth = width;
+ drawHeight = height;
+
+ /* check for simple zooming and clipping */
+ if (ctx->Pixel.ZoomX == 1.0F &&
+ (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F)) {
+ if (!_mesa_clip_drawpixels(ctx, &destX, &destY,
+ &drawWidth, &drawHeight, &unpack)) {
+ /* image was completely clipped: no-op, all done */
+ return GL_TRUE;
+ }
+ simpleZoom = GL_TRUE;
+ yStep = (GLint) ctx->Pixel.ZoomY;
+ ASSERT(yStep == 1 || yStep == -1);
+ }
+ else {
+ /* non-simple zooming */
+ simpleZoom = GL_FALSE;
+ yStep = 1;
+ if (unpack.RowLength == 0)
+ unpack.RowLength = width;
+ }
- /* If we're not using pixel zoom then do all clipping calculations
- * now. Otherwise, we'll let the _swrast_write_zoomed_*_span() functions
- * handle the clipping.
- */
- if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
- /* horizontal clipping */
- if (destX < ctx->DrawBuffer->_Xmin) {
- skipPixels += (ctx->DrawBuffer->_Xmin - destX);
- drawWidth -= (ctx->DrawBuffer->_Xmin - destX);
- destX = ctx->DrawBuffer->_Xmin;
- }
- if (destX + drawWidth > ctx->DrawBuffer->_Xmax)
- drawWidth -= (destX + drawWidth - ctx->DrawBuffer->_Xmax);
- if (drawWidth <= 0)
- return GL_TRUE;
+ /*
+ * Ready to draw!
+ */
- /* vertical clipping */
- if (destY < ctx->DrawBuffer->_Ymin) {
- skipRows += (ctx->DrawBuffer->_Ymin - destY);
- drawHeight -= (ctx->DrawBuffer->_Ymin - destY);
- destY = ctx->DrawBuffer->_Ymin;
+ if (format == GL_RGBA && type == rbType) {
+ const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
+ const GLint srcStride = _mesa_image_row_stride(&unpack, width,
+ format, type);
+ if (simpleZoom) {
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL);
+ src += srcStride;
+ destY += yStep;
}
- if (destY + drawHeight > ctx->DrawBuffer->_Ymax)
- drawHeight -= (destY + drawHeight - ctx->DrawBuffer->_Ymax);
- if (drawHeight <= 0)
- return GL_TRUE;
}
- else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) {
- /* upside-down image */
- /* horizontal clipping */
- if (destX < ctx->DrawBuffer->_Xmin) {
- skipPixels += (ctx->DrawBuffer->_Xmin - destX);
- drawWidth -= (ctx->DrawBuffer->_Xmin - destX);
- destX = ctx->DrawBuffer->_Xmin;
+ else {
+ /* with zooming */
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ span.x = destX;
+ span.y = destY + row;
+ span.end = drawWidth;
+ span.array->ChanType = rbType;
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, src);
+ src += srcStride;
}
- if (destX + drawWidth > ctx->DrawBuffer->_Xmax)
- drawWidth -= (destX + drawWidth - ctx->DrawBuffer->_Xmax);
- if (drawWidth <= 0)
- return GL_TRUE;
+ span.array->ChanType = CHAN_TYPE;
+ }
+ return GL_TRUE;
+ }
- /* vertical clipping */
- if (destY > ctx->DrawBuffer->_Ymax) {
- skipRows += (destY - ctx->DrawBuffer->_Ymax);
- drawHeight -= (destY - ctx->DrawBuffer->_Ymax);
- destY = ctx->DrawBuffer->_Ymax;
+ if (format == GL_RGB && type == rbType) {
+ const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
+ const GLint srcStride = _mesa_image_row_stride(&unpack, width,
+ format, type);
+ if (simpleZoom) {
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL);
+ src += srcStride;
+ destY += yStep;
}
- if (destY - drawHeight < ctx->DrawBuffer->_Ymin)
- drawHeight -= (ctx->DrawBuffer->_Ymin - (destY - drawHeight));
- if (drawHeight <= 0)
- return GL_TRUE;
}
else {
- if (drawWidth > MAX_WIDTH)
- return GL_FALSE; /* fall back to general case path */
+ /* with zooming */
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ span.array->ChanType = rbType;
+ _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, src);
+ src += srcStride;
+ destY++;
+ }
+ span.array->ChanType = CHAN_TYPE;
}
+ return GL_TRUE;
+ }
+ /* Remaining cases haven't been tested with alignment != 1 */
+ if (userUnpack->Alignment != 1)
+ return GL_FALSE;
- /*
- * Ready to draw!
- * The window region at (destX, destY) of size (drawWidth, drawHeight)
- * will be written to.
- * We'll take pixel data from buffer pointed to by "pixels" but we'll
- * skip "skipRows" rows and skip "skipPixels" pixels/row.
- */
-
- if (format == GL_RGBA && type == CHAN_TYPE) {
- if (ctx->Visual.rgbMode) {
- const GLchan *src = (const GLchan *) pixels
- + (skipRows * rowLength + skipPixels) * 4;
- if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
- /* no zooming */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL);
- src += rowLength * 4;
- destY++;
- }
- }
- else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) {
- /* upside-down */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- destY--;
- rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL);
- src += rowLength * 4;
- }
- }
- else {
- /* with zooming */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- span.x = destX;
- span.y = destY + row;
- span.end = drawWidth;
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
- (CONST GLchan (*)[4]) src);
- src += rowLength * 4;
- }
+ if (format == GL_LUMINANCE && type == CHAN_TYPE && rbType == CHAN_TYPE) {
+ const GLchan *src = (const GLchan *) pixels
+ + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels);
+ if (simpleZoom) {
+ /* no zooming */
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ GLchan rgb[MAX_WIDTH][3];
+ GLint i;
+ for (i = 0;i<drawWidth;i++) {
+ rgb[i][0] = src[i];
+ rgb[i][1] = src[i];
+ rgb[i][2] = src[i];
}
+ rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, rgb, NULL);
+ src += unpack.RowLength;
+ destY += yStep;
}
- return GL_TRUE;
}
- else if (format == GL_RGB && type == CHAN_TYPE) {
- if (ctx->Visual.rgbMode) {
- const GLchan *src = (const GLchan *) pixels
- + (skipRows * rowLength + skipPixels) * 3;
- if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
- GLint row;
- for (row=0; row<drawHeight; row++) {
- rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL);
- src += rowLength * 3;
- destY++;
- }
- }
- else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) {
- /* upside-down */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- destY--;
- rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL);
- src += rowLength * 3;
- }
- }
- else {
- /* with zooming */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span,
- (CONST GLchan (*)[3]) src);
- src += rowLength * 3;
- destY++;
- }
+ else {
+ /* with zooming */
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ GLchan rgb[MAX_WIDTH][3];
+ GLint i;
+ for (i = 0;i<drawWidth;i++) {
+ rgb[i][0] = src[i];
+ rgb[i][1] = src[i];
+ rgb[i][2] = src[i];
}
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, rgb);
+ src += unpack.RowLength;
+ destY++;
}
- return GL_TRUE;
}
- else if (format == GL_LUMINANCE && type == CHAN_TYPE) {
- if (ctx->Visual.rgbMode) {
- const GLchan *src = (const GLchan *) pixels
- + (skipRows * rowLength + skipPixels);
- if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
- /* no zooming */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row=0; row<drawHeight; row++) {
- GLint i;
- for (i=0;i<drawWidth;i++) {
- span.array->rgb[i][0] = src[i];
- span.array->rgb[i][1] = src[i];
- span.array->rgb[i][2] = src[i];
- }
- rb->PutRowRGB(ctx, rb, drawWidth, destX, destY,
- span.array->rgb, NULL);
- src += rowLength;
- destY++;
- }
- }
- else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) {
- /* upside-down */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row=0; row<drawHeight; row++) {
- GLint i;
- for (i=0;i<drawWidth;i++) {
- span.array->rgb[i][0] = src[i];
- span.array->rgb[i][1] = src[i];
- span.array->rgb[i][2] = src[i];
- }
- destY--;
- rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->rgb, NULL);
- src += rowLength;
- }
- }
- else {
- /* with zooming */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row=0; row<drawHeight; row++) {
- GLint i;
- for (i=0;i<drawWidth;i++) {
- span.array->rgb[i][0] = src[i];
- span.array->rgb[i][1] = src[i];
- span.array->rgb[i][2] = src[i];
- }
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span,
- (CONST GLchan (*)[3]) span.array->rgb);
- src += rowLength;
- destY++;
- }
+ return GL_TRUE;
+ }
+
+ if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE && rbType == CHAN_TYPE) {
+ const GLchan *src = (const GLchan *) pixels
+ + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels)*2;
+ if (simpleZoom) {
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ GLint i;
+ const GLchan *ptr = src;
+ for (i = 0;i<drawWidth;i++) {
+ span.array->rgba[i][0] = *ptr;
+ span.array->rgba[i][1] = *ptr;
+ span.array->rgba[i][2] = *ptr++;
+ span.array->rgba[i][3] = *ptr++;
}
+ rb->PutRow(ctx, rb, drawWidth, destX, destY,
+ span.array->rgba, NULL);
+ src += unpack.RowLength*2;
+ destY += yStep;
}
- return GL_TRUE;
}
- else if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE) {
- if (ctx->Visual.rgbMode) {
- const GLchan *src = (const GLchan *) pixels
- + (skipRows * rowLength + skipPixels)*2;
- if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
- /* no zooming */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row=0; row<drawHeight; row++) {
- GLint i;
- const GLchan *ptr = src;
- for (i=0;i<drawWidth;i++) {
- span.array->rgba[i][0] = *ptr;
- span.array->rgba[i][1] = *ptr;
- span.array->rgba[i][2] = *ptr++;
- span.array->rgba[i][3] = *ptr++;
- }
- rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->rgba, NULL);
- src += rowLength*2;
- destY++;
- }
- }
- else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) {
- /* upside-down */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row=0; row<drawHeight; row++) {
- GLint i;
- const GLchan *ptr = src;
- for (i=0;i<drawWidth;i++) {
- span.array->rgba[i][0] = *ptr;
- span.array->rgba[i][1] = *ptr;
- span.array->rgba[i][2] = *ptr++;
- span.array->rgba[i][3] = *ptr++;
- }
- destY--;
- rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->rgba, NULL);
- src += rowLength*2;
- }
- }
- else {
- /* with zooming */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row=0; row<drawHeight; row++) {
- const GLchan *ptr = src;
- GLint i;
- for (i=0;i<drawWidth;i++) {
- span.array->rgba[i][0] = *ptr;
- span.array->rgba[i][1] = *ptr;
- span.array->rgba[i][2] = *ptr++;
- span.array->rgba[i][3] = *ptr++;
- }
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
- (CONST GLchan (*)[4]) span.array->rgba);
- src += rowLength*2;
- destY++;
- }
+ else {
+ /* with zooming */
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ const GLchan *ptr = src;
+ GLint i;
+ for (i = 0;i<drawWidth;i++) {
+ span.array->rgba[i][0] = *ptr;
+ span.array->rgba[i][1] = *ptr;
+ span.array->rgba[i][2] = *ptr++;
+ span.array->rgba[i][3] = *ptr++;
}
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
+ span.array->rgba);
+ src += unpack.RowLength*2;
+ destY++;
}
- return GL_TRUE;
}
- else if (format==GL_COLOR_INDEX && type==GL_UNSIGNED_BYTE) {
- const GLubyte *src =
- (const GLubyte *) pixels + skipRows * rowLength + skipPixels;
- if (ctx->Visual.rgbMode) {
- /* convert CI data to RGBA */
- if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
- /* no zooming */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- ASSERT(drawWidth <= MAX_WIDTH);
- _mesa_map_ci8_to_rgba(ctx, drawWidth, src, span.array->rgba);
- rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->rgba, NULL);
- src += rowLength;
- destY++;
- }
- return GL_TRUE;
- }
- else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) {
- /* upside-down */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- ASSERT(drawWidth <= MAX_WIDTH);
- _mesa_map_ci8_to_rgba(ctx, drawWidth, src, span.array->rgba);
- destY--;
- rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->rgba, NULL);
- src += rowLength;
- }
- return GL_TRUE;
- }
- else {
- /* with zooming */
- GLint row;
- for (row=0; row<drawHeight; row++) {
- ASSERT(drawWidth <= MAX_WIDTH);
- _mesa_map_ci8_to_rgba(ctx, drawWidth, src, span.array->rgba);
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
- (CONST GLchan (*)[4]) span.array->rgba);
- src += rowLength;
- destY++;
- }
- return GL_TRUE;
+ return GL_TRUE;
+ }
+
+ if (format == GL_COLOR_INDEX && type == GL_UNSIGNED_BYTE) {
+ const GLubyte *src = (const GLubyte *) pixels
+ + unpack.SkipRows * unpack.RowLength + unpack.SkipPixels;
+ if (ctx->Visual.rgbMode && rbType == GL_UNSIGNED_BYTE) {
+ /* convert ubyte/CI data to ubyte/RGBA */
+ if (simpleZoom) {
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ ASSERT(drawWidth <= MAX_WIDTH);
+ _mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
+ span.array->color.sz1.rgba);
+ rb->PutRow(ctx, rb, drawWidth, destX, destY,
+ span.array->color.sz1.rgba, NULL);
+ src += unpack.RowLength;
+ destY += yStep;
}
}
else {
- /* write CI data to CI frame buffer */
+ /* ubyte/CI to ubyte/RGBA with zooming */
GLint row;
- if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
- /* no zooming */
- for (row=0; row<drawHeight; row++) {
- GLuint index32[MAX_WIDTH];
- GLint col;
- for (col = 0; col < drawWidth; col++)
- index32[col] = src[col];
- rb->PutRow(ctx, rb, drawWidth, destX, destY, index32, NULL);
- src += rowLength;
- destY++;
- }
- return GL_TRUE;
- }
- else {
- /* with zooming */
- return GL_FALSE;
+ for (row = 0; row < drawHeight; row++) {
+ ASSERT(drawWidth <= MAX_WIDTH);
+ _mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
+ span.array->color.sz1.rgba);
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
+ span.array->color.sz1.rgba);
+ src += unpack.RowLength;
+ destY++;
}
}
+ return GL_TRUE;
}
- else {
- /* can't handle this pixel format and/or data type here */
- return GL_FALSE;
+ else if (!ctx->Visual.rgbMode && rbType == GL_UNSIGNED_INT) {
+ /* write CI data to CI frame buffer */
+ GLint row;
+ if (simpleZoom) {
+ for (row = 0; row < drawHeight; row++) {
+ GLuint index32[MAX_WIDTH];
+ GLint col;
+ for (col = 0; col < drawWidth; col++)
+ index32[col] = src[col];
+ rb->PutRow(ctx, rb, drawWidth, destX, destY, index32, NULL);
+ src += unpack.RowLength;
+ destY += yStep;
+ }
+ return GL_TRUE;
+ }
}
}
- /* can't do a simple draw, have to use slow path */
+ /* can't handle this pixel format and/or data type */
return GL_FALSE;
}
@@ -458,7 +334,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
const GLint imgX = x, imgY = y;
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
GLint row, skipPixels;
- struct sw_span span;
+ SWspan span;
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX);
@@ -530,13 +406,7 @@ draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
_mesa_unpack_index_span(ctx, spanWidth, destType, values,
type, source, unpack,
ctx->_ImageTransferState);
- if (ctx->_ImageTransferState & IMAGE_SHIFT_OFFSET_BIT) {
- _mesa_shift_and_offset_stencil(ctx, spanWidth, values);
- }
- if (ctx->Pixel.MapStencilFlag) {
- _mesa_map_stencil(ctx, spanWidth, values);
- }
-
+ _mesa_apply_stencil_transfer_ops(ctx, spanWidth, values);
if (zoom) {
_swrast_write_zoomed_stencil_span(ctx, x, y, spanWidth,
spanX, spanY, values);
@@ -564,7 +434,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
const GLboolean scaleOrBias
= ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
- struct sw_span span;
+ SWspan span;
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
@@ -665,7 +535,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
-/*
+/**
* Draw RGBA image.
*/
static void
@@ -677,19 +547,17 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLint imgX = x, imgY = y;
- struct gl_renderbuffer *rb = NULL; /* only used for quickDraw path */
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
- GLboolean quickDraw;
GLfloat *convImage = NULL;
- GLuint transferOps = ctx->_ImageTransferState;
- struct sw_span span;
-
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
+ GLbitfield transferOps = ctx->_ImageTransferState;
+ SWspan span;
/* Try an optimized glDrawPixels first */
- if (fast_draw_pixels(ctx, x, y, width, height, format, type, unpack, pixels))
+ if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type,
+ unpack, pixels))
return;
+ INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
@@ -697,18 +565,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
if (ctx->Texture._EnabledCoordUnits)
_swrast_span_default_texcoords(ctx, &span);
- if (swrast->_RasterMask == 0 && !zoom && x >= 0 && y >= 0
- && x + width <= (GLint) ctx->DrawBuffer->Width
- && y + height <= (GLint) ctx->DrawBuffer->Height
- && ctx->DrawBuffer->_NumColorDrawBuffers[0] == 1) {
- quickDraw = GL_TRUE;
- rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
- }
- else {
- quickDraw = GL_FALSE;
- rb = NULL;
- }
-
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
/* Convolution has to be handled specially. We'll create an
* intermediate image, applying all pixel transfer operations
@@ -760,59 +616,66 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
transferOps &= IMAGE_POST_CONVOLUTION_BITS;
}
+ if (ctx->DrawBuffer->_NumColorDrawBuffers[0] > 0 &&
+ ctx->DrawBuffer->_ColorDrawBuffers[0][0]->DataType != GL_FLOAT &&
+ ctx->Color.ClampFragmentColor != GL_FALSE) {
+ /* need to clamp colors before applying fragment ops */
+ transferOps |= IMAGE_CLAMP_BIT;
+ }
+
/*
* General solution
*/
{
+ const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink)
+ || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink);
const GLbitfield interpMask = span.interpMask;
const GLbitfield arrayMask = span.arrayMask;
+ const GLint srcStride
+ = _mesa_image_row_stride(unpack, width, format, type);
GLint skipPixels = 0;
+ /* use span array for temp color storage */
+ GLfloat *rgba = (GLfloat *) span.array->color.sz4.rgba;
/* if the span is wider than MAX_WIDTH we have to do it in chunks */
while (skipPixels < width) {
const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
+ const GLubyte *source = _mesa_image_address2d(unpack, pixels,
+ width, height, format, type, 0, skipPixels);
GLint row;
- ASSERT(span.end <= MAX_WIDTH);
-
for (row = 0; row < height; row++) {
- const GLvoid *source = _mesa_image_address2d(unpack,
- pixels, width, height, format, type, row, skipPixels);
-
- /* Set these for each row since the _swrast_write_* function may
- * change them while clipping.
- */
- span.x = x + skipPixels;
- span.y = y + row;
- span.end = spanWidth;
- span.arrayMask = arrayMask;
- span.interpMask = interpMask;
-
- _mesa_unpack_color_span_chan(ctx, spanWidth, GL_RGBA,
- (GLchan *) span.array->rgba,
- format, type, source, unpack,
- transferOps);
-
- if ((ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) ||
- (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink))
- continue;
-
+ /* get image row as float/RGBA */
+ _mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba,
+ format, type, source, unpack,
+ transferOps);
/* draw the span */
- if (quickDraw) {
- rb->PutRow(ctx, rb, span.end, span.x, span.y,
- span.array->rgba, NULL);
- }
- else if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
- (CONST GLchan (*)[4]) span.array->rgba);
- }
- else {
- _swrast_write_rgba_span(ctx, &span);
+ if (!sink) {
+ /* Set these for each row since the _swrast_write_* functions
+ * may change them while clipping/rendering.
+ */
+ span.array->ChanType = GL_FLOAT;
+ span.x = x + skipPixels;
+ span.y = y + row;
+ span.end = spanWidth;
+ span.arrayMask = arrayMask;
+ span.interpMask = interpMask;
+ if (zoom) {
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba);
+ }
+ else {
+ _swrast_write_rgba_span(ctx, &span);
+ }
}
- }
+
+ source += srcStride;
+ } /* for row */
skipPixels += spanWidth;
- }
+ } /* while skipPixels < width */
+
+ /* XXX this is ugly/temporary, to undo above change */
+ span.array->ChanType = CHAN_TYPE;
}
if (convImage) {
diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c
index e3d6274b3fe..f4c3fe4f2dc 100644
--- a/src/mesa/swrast/s_fog.c
+++ b/src/mesa/swrast/s_fog.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -30,7 +30,6 @@
#include "s_context.h"
#include "s_fog.h"
-#include "s_span.h"
/**
@@ -67,6 +66,33 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z)
/**
+ * Template code for computing fog blend factor and applying it to colors.
+ * \param TYPE either GLubyte, GLushort or GLfloat.
+ * \param COMPUTE_F code to compute the fog blend factor, f.
+ */
+#define FOG_LOOP(TYPE, COMPUTE_F) \
+do { \
+ const GLfloat fogStep = span->fogStep; \
+ GLfloat fogCoord = span->fog; \
+ const GLfloat wStep = haveW ? span->dwdx : 0.0F; \
+ GLfloat w = haveW ? span->w : 1.0F; \
+ GLuint i; \
+ for (i = 0; i < span->end; i++) { \
+ GLfloat f, oneMinusF; \
+ COMPUTE_F; \
+ f = CLAMP(f, 0.0F, 1.0F); \
+ oneMinusF = 1.0F - f; \
+ rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \
+ rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \
+ rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \
+ fogCoord += fogStep; \
+ w += wStep; \
+ } \
+} while (0)
+
+
+
+/**
* Apply fog to a span of RGBA pixels.
* The fog value are either in the span->array->fog array or interpolated from
* the fog/fogStep values.
@@ -74,19 +100,33 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z)
* _PreferPixelFog should be in sync with that state!
*/
void
-_swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span )
+_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span )
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLchan rFog = swrast->_FogColor[RCOMP];
- const GLchan gFog = swrast->_FogColor[GCOMP];
- const GLchan bFog = swrast->_FogColor[BCOMP];
+ GLfloat rFog, gFog, bFog;
const GLuint haveW = (span->interpMask & SPAN_W);
- GLchan (*rgba)[4] = (GLchan (*)[4]) span->array->rgba;
ASSERT(swrast->_FogEnabled);
ASSERT((span->interpMask | span->arrayMask) & SPAN_FOG);
ASSERT(span->arrayMask & SPAN_RGBA);
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ rFog = ctx->Fog.Color[RCOMP] * 255.0;
+ gFog = ctx->Fog.Color[GCOMP] * 255.0;
+ bFog = ctx->Fog.Color[BCOMP] * 255.0;
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ rFog = ctx->Fog.Color[RCOMP] * 65535.0;
+ gFog = ctx->Fog.Color[GCOMP] * 65535.0;
+ bFog = ctx->Fog.Color[BCOMP] * 65535.0;
+ }
+ else {
+ rFog = ctx->Fog.Color[RCOMP];
+ gFog = ctx->Fog.Color[GCOMP];
+ bFog = ctx->Fog.Color[BCOMP];
+ }
+
+
/* NOTE: if haveW is true, that means the fog start/step values are
* perspective-corrected and we have to divide each fog coord by W.
*/
@@ -96,79 +136,71 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span )
/* The span's fog values are fog coordinates, now compute blend factors
* and blend the fragment colors with the fog color.
*/
+ const GLfloat fogEnd = ctx->Fog.End;
+ const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End)
+ ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ const GLfloat density = -ctx->Fog.Density;
+ const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density;
+
switch (swrast->_FogMode) {
case GL_LINEAR:
- {
- const GLfloat fogEnd = ctx->Fog.End;
- const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End)
- ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
- const GLfloat fogStep = span->fogStep;
- GLfloat fogCoord = span->fog;
- const GLfloat wStep = haveW ? span->dwdx : 0.0F;
- GLfloat w = haveW ? span->w : 1.0F;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- GLfloat f, oneMinusF;
- f = (fogEnd - FABSF(fogCoord) / w) * fogScale;
- f = CLAMP(f, 0.0F, 1.0F);
- oneMinusF = 1.0F - f;
- rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog);
- rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog);
- rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog);
- fogCoord += fogStep;
- w += wStep;
- }
+#define COMPUTE_F f = (fogEnd - FABSF(fogCoord) / w) * fogScale;
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ FOG_LOOP(GLubyte, COMPUTE_F);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ FOG_LOOP(GLushort, COMPUTE_F);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, COMPUTE_F);
}
+#undef COMPUTE_F
break;
+
case GL_EXP:
- {
- const GLfloat density = -ctx->Fog.Density;
- const GLfloat fogStep = span->fogStep;
- GLfloat fogCoord = span->fog;
- const GLfloat wStep = haveW ? span->dwdx : 0.0F;
- GLfloat w = haveW ? span->w : 1.0F;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- GLfloat f, oneMinusF;
- f = EXPF(density * FABSF(fogCoord) / w);
- f = CLAMP(f, 0.0F, 1.0F);
- oneMinusF = 1.0F - f;
- rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog);
- rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog);
- rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog);
- fogCoord += fogStep;
- w += wStep;
- }
+#define COMPUTE_F f = EXPF(density * FABSF(fogCoord) / w);
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ FOG_LOOP(GLubyte, COMPUTE_F);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ FOG_LOOP(GLushort, COMPUTE_F);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, COMPUTE_F);
}
+#undef COMPUTE_F
break;
+
case GL_EXP2:
- {
- const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density;
- const GLfloat fogStep = span->fogStep;
- GLfloat fogCoord = span->fog;
- const GLfloat wStep = haveW ? span->dwdx : 0.0F;
- GLfloat w = haveW ? span->w : 1.0F;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- const GLfloat coord = fogCoord / w;
- GLfloat tmp = negDensitySquared * coord * coord;
- GLfloat f, oneMinusF;
-#if defined(__alpha__) || defined(__alpha)
- /* XXX this underflow check may be needed for other systems*/
- if (tmp < FLT_MIN_10_EXP)
- tmp = FLT_MIN_10_EXP;
-#endif
- f = EXPF(tmp);
- f = CLAMP(f, 0.0F, 1.0F);
- oneMinusF = 1.0F - f;
- rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog);
- rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog);
- rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog);
- fogCoord += fogStep;
- w += wStep;
- }
+#define COMPUTE_F const GLfloat coord = fogCoord / w; \
+ GLfloat tmp = negDensitySquared * coord * coord; \
+ if (tmp < FLT_MIN_10_EXP) \
+ tmp = FLT_MIN_10_EXP; \
+ f = EXPF(tmp);
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ FOG_LOOP(GLubyte, COMPUTE_F);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ FOG_LOOP(GLushort, COMPUTE_F);
}
+ else {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, COMPUTE_F);
+ }
+#undef COMPUTE_F
break;
+
default:
_mesa_problem(ctx, "Bad fog mode in _swrast_fog_rgba_span");
return;
@@ -179,33 +211,58 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span )
* They were previously computed per-vertex.
*/
GLuint i;
- for (i = 0; i < span->end; i++) {
- const GLfloat f = span->array->fog[i];
- const GLfloat oneMinusF = 1.0F - f;
- rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog);
- rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog);
- rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog);
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ for (i = 0; i < span->end; i++) {
+ const GLfloat f = span->array->fog[i];
+ const GLfloat oneMinusF = 1.0F - f;
+ rgba[i][RCOMP] = (GLubyte) (f * rgba[i][RCOMP] + oneMinusF * rFog);
+ rgba[i][GCOMP] = (GLubyte) (f * rgba[i][GCOMP] + oneMinusF * gFog);
+ rgba[i][BCOMP] = (GLubyte) (f * rgba[i][BCOMP] + oneMinusF * bFog);
+ }
}
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ for (i = 0; i < span->end; i++) {
+ const GLfloat f = span->array->fog[i];
+ const GLfloat oneMinusF = 1.0F - f;
+ rgba[i][RCOMP] = (GLushort) (f * rgba[i][RCOMP] + oneMinusF * rFog);
+ rgba[i][GCOMP] = (GLushort) (f * rgba[i][GCOMP] + oneMinusF * gFog);
+ rgba[i][BCOMP] = (GLushort) (f * rgba[i][BCOMP] + oneMinusF * bFog);
+ }
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ for (i = 0; i < span->end; i++) {
+ const GLfloat f = span->array->fog[i];
+ const GLfloat oneMinusF = 1.0F - f;
+ rgba[i][RCOMP] = f * rgba[i][RCOMP] + oneMinusF * rFog;
+ rgba[i][GCOMP] = f * rgba[i][GCOMP] + oneMinusF * gFog;
+ rgba[i][BCOMP] = f * rgba[i][BCOMP] + oneMinusF * bFog;
+ }
+ }
+
}
else {
/* The span's fog start/step values are blend factors.
* They were previously computed per-vertex.
*/
- const GLfloat fogStep = span->fogStep;
- GLfloat fog = span->fog;
- const GLfloat wStep = haveW ? span->dwdx : 0.0F;
- GLfloat w = haveW ? span->w : 1.0F;
- GLuint i;
- ASSERT(span->interpMask & SPAN_FOG);
- for (i = 0; i < span->end; i++) {
- const GLfloat fact = fog / w;
- const GLfloat oneMinusF = 1.0F - fact;
- rgba[i][RCOMP] = (GLchan) (fact * rgba[i][RCOMP] + oneMinusF * rFog);
- rgba[i][GCOMP] = (GLchan) (fact * rgba[i][GCOMP] + oneMinusF * gFog);
- rgba[i][BCOMP] = (GLchan) (fact * rgba[i][BCOMP] + oneMinusF * bFog);
- fog += fogStep;
- w += wStep;
+#define COMPUTE_F f = fogCoord / w;
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ FOG_LOOP(GLubyte, COMPUTE_F);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ FOG_LOOP(GLushort, COMPUTE_F);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, COMPUTE_F);
}
+#undef COMPUTE_F
}
}
@@ -214,7 +271,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span )
* As above, but color index mode.
*/
void
-_swrast_fog_ci_span( const GLcontext *ctx, struct sw_span *span )
+_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span )
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLuint haveW = (span->interpMask & SPAN_W);
diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h
index f5744b1d952..9639bee2cc3 100644
--- a/src/mesa/swrast/s_fog.h
+++ b/src/mesa/swrast/s_fog.h
@@ -36,10 +36,10 @@ extern GLfloat
_swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z);
extern void
-_swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span );
+_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span );
extern void
-_swrast_fog_ci_span( const GLcontext *ctx, struct sw_span *span );
+_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c
index ac69d270b88..73aaba1ec9f 100644
--- a/src/mesa/swrast/s_imaging.c
+++ b/src/mesa/swrast/s_imaging.c
@@ -54,7 +54,7 @@ _swrast_CopyColorTable( GLcontext *ctx,
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y, data );
+ width, x, y, CHAN_TYPE, data );
RENDER_FINISH(swrast,ctx);
@@ -89,7 +89,7 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y, data );
+ width, x, y, CHAN_TYPE, data );
RENDER_FINISH(swrast,ctx);
@@ -122,7 +122,7 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y, (GLchan (*)[4]) rgba );
+ width, x, y, CHAN_TYPE, rgba );
RENDER_FINISH( swrast, ctx );
@@ -160,7 +160,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
/* read pixels from framebuffer */
for (i = 0; i < height; i++) {
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y + i, (GLchan (*)[4]) rgba[i] );
+ width, x, y + i, CHAN_TYPE, rgba[i] );
}
RENDER_FINISH(swrast,ctx);
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index 1abe85c541b..ff507249b08 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -61,7 +61,7 @@ compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] )
* To draw a wide line we can simply redraw the span N times, side by side.
*/
static void
-draw_wide_line( GLcontext *ctx, struct sw_span *span, GLboolean xMajor )
+draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
{
GLint width, start;
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index f7c5ab49237..f5b2d95653f 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -70,7 +70,7 @@
static void
NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
{
- struct sw_span span;
+ SWspan span;
GLuint interpFlags = 0;
GLint x0 = (GLint) vert0->win[0];
GLint x1 = (GLint) vert1->win[0];
diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c
index 60458c2b804..719b17962d4 100644
--- a/src/mesa/swrast/s_logic.c
+++ b/src/mesa/swrast/s_logic.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -33,20 +33,25 @@
#include "s_span.h"
-#define LOGIC_OP_LOOP(MODE) \
+/**
+ * We do all logic ops on 4-byte GLuints.
+ * Depending on bytes per pixel, the mask array elements correspond to
+ * 1, 2 or 4 GLuints.
+ */
+#define LOGIC_OP_LOOP(MODE, MASKSTRIDE) \
do { \
GLuint i; \
switch (MODE) { \
case GL_CLEAR: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = 0; \
} \
} \
break; \
case GL_SET: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~0; \
} \
} \
@@ -56,91 +61,91 @@ do { \
break; \
case GL_COPY_INVERTED: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~src[i]; \
} \
} \
break; \
case GL_NOOP: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = dest[i]; \
} \
} \
break; \
case GL_INVERT: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~dest[i]; \
} \
} \
break; \
case GL_AND: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] &= dest[i]; \
} \
} \
break; \
case GL_NAND: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~(src[i] & dest[i]); \
} \
} \
break; \
case GL_OR: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] |= dest[i]; \
} \
} \
break; \
case GL_NOR: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~(src[i] | dest[i]); \
} \
} \
break; \
case GL_XOR: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] ^= dest[i]; \
} \
} \
break; \
case GL_EQUIV: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~(src[i] ^ dest[i]); \
} \
} \
break; \
case GL_AND_REVERSE: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = src[i] & ~dest[i]; \
} \
} \
break; \
case GL_AND_INVERTED: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~src[i] & dest[i]; \
} \
} \
break; \
case GL_OR_REVERSE: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = src[i] | ~dest[i]; \
} \
} \
break; \
case GL_OR_INVERTED: \
for (i = 0; i < n; i++) { \
- if (mask[i]) { \
+ if (mask[i / MASKSTRIDE]) { \
src[i] = ~src[i] | dest[i]; \
} \
} \
@@ -152,27 +157,27 @@ do { \
-static void
-logicop_ubyte(GLcontext *ctx, GLuint n, GLubyte src[], const GLubyte dest[],
+static INLINE void
+logicop_uint1(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
const GLubyte mask[])
{
- LOGIC_OP_LOOP(ctx->Color.LogicOp);
+ LOGIC_OP_LOOP(ctx->Color.LogicOp, 1);
}
-static void
-logicop_ushort(GLcontext *ctx, GLuint n, GLushort src[], const GLushort dest[],
- const GLubyte mask[])
+static INLINE void
+logicop_uint2(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
+ const GLubyte mask[])
{
- LOGIC_OP_LOOP(ctx->Color.LogicOp);
+ LOGIC_OP_LOOP(ctx->Color.LogicOp, 2);
}
-static void
-logicop_uint(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
- const GLubyte mask[])
+static INLINE void
+logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
+ const GLubyte mask[])
{
- LOGIC_OP_LOOP(ctx->Color.LogicOp);
+ LOGIC_OP_LOOP(ctx->Color.LogicOp, 4);
}
@@ -183,9 +188,10 @@ logicop_uint(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
*/
void
_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLuint index[])
+ SWspan *span)
{
GLuint dest[MAX_WIDTH];
+ GLuint *index = span->array->index;
ASSERT(span->end < MAX_WIDTH);
ASSERT(rb->DataType == GL_UNSIGNED_INT);
@@ -199,7 +205,7 @@ _swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->GetRow(ctx, rb, span->end, span->x, span->y, dest);
}
- logicop_uint(ctx, span->end, index, dest, span->array->mask);
+ logicop_uint1(ctx, span->end, index, dest, span->array->mask);
}
@@ -210,35 +216,31 @@ _swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb,
*/
void
_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLchan rgba[][4])
+ SWspan *span)
{
- GLchan dest[MAX_WIDTH][4];
+ void *rbPixels;
ASSERT(span->end < MAX_WIDTH);
ASSERT(span->arrayMask & SPAN_RGBA);
- ASSERT(rb->DataType == CHAN_TYPE);
+ ASSERT(rb->DataType == span->array->ChanType);
- if (span->arrayMask & SPAN_XY) {
- _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y,
- dest, 4 * sizeof(GLchan));
+ rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
+
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ /* treat 4*GLubyte as GLuint */
+ logicop_uint1(ctx, span->end,
+ (GLuint *) span->array->color.sz1.rgba,
+ (const GLuint *) rbPixels, span->array->mask);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ /* treat 2*GLushort as GLuint */
+ logicop_uint2(ctx, 2 * span->end,
+ (GLuint *) span->array->color.sz2.rgba,
+ (const GLuint *) rbPixels, span->array->mask);
}
else {
- _swrast_read_rgba_span(ctx, rb, span->end, span->x, span->y, dest);
+ logicop_uint4(ctx, 4 * span->end,
+ (GLuint *) span->array->color.sz4.rgba,
+ (const GLuint *) rbPixels, span->array->mask);
}
-
- /* XXX make this a runtime test */
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- /* treat 4*GLubyte as GLuint */
- logicop_uint(ctx, span->end, (GLuint *) rgba,
- (const GLuint *) dest, span->array->mask);
-#elif CHAN_TYPE == GL_UNSIGNED_SHORT
- logicop_ushort(ctx, 4 * span->end, (GLushort *) rgba,
- (const GLushort *) dest, span->array->mask);
-#elif CHAN_TYPE == GL_FLOAT
- logicop_uint(ctx, 4 * span->end, (GLuint *) rgba,
- (const GLuint *) dest, span->array->mask);
-#endif
- (void) logicop_ubyte;
- (void) logicop_ushort;
- (void) logicop_uint;
}
diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h
index ce5f183ff65..0bc2c3f8a82 100644
--- a/src/mesa/swrast/s_logic.h
+++ b/src/mesa/swrast/s_logic.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -33,12 +33,12 @@
extern void
_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLuint index[]);
+ SWspan *span);
extern void
_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLchan rgba[][4]);
+ SWspan *span);
#endif
diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c
index 65c4e7d01cc..65c984dd3e3 100644
--- a/src/mesa/swrast/s_masking.c
+++ b/src/mesa/swrast/s_masking.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,7 +29,6 @@
#include "glheader.h"
-#include "enums.h"
#include "macros.h"
#include "s_context.h"
@@ -37,100 +36,83 @@
#include "s_span.h"
-
+/**
+ * Apply the color mask to a span of rgba values.
+ */
void
_swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLchan rgba[][4])
+ SWspan *span)
{
- GLchan dest[MAX_WIDTH][4];
-#if CHAN_BITS == 8
- GLuint srcMask = *((GLuint*)ctx->Color.ColorMask);
- GLuint dstMask = ~srcMask;
- GLuint *rgba32 = (GLuint *) rgba;
- GLuint *dest32 = (GLuint *) dest;
-#else
- const GLboolean rMask = ctx->Color.ColorMask[RCOMP];
- const GLboolean gMask = ctx->Color.ColorMask[GCOMP];
- const GLboolean bMask = ctx->Color.ColorMask[BCOMP];
- const GLboolean aMask = ctx->Color.ColorMask[ACOMP];
-#endif
const GLuint n = span->end;
- GLuint i;
+ void *rbPixels;
ASSERT(n < MAX_WIDTH);
ASSERT(span->arrayMask & SPAN_RGBA);
-
- if (span->arrayMask & SPAN_XY) {
- _swrast_get_values(ctx, rb, n, span->array->x, span->array->y,
- dest, 4 * sizeof(GLchan));
+ ASSERT(rb->DataType == span->array->ChanType);
+
+ rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
+
+ /*
+ * Do component masking.
+ * Note that we're not using span->array->mask[] here. We could...
+ */
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ /* treat 4xGLubyte as 1xGLuint */
+ const GLuint srcMask = *((GLuint *) ctx->Color.ColorMask);
+ const GLuint dstMask = ~srcMask;
+ const GLuint *dst = (const GLuint *) rbPixels;
+ GLuint *src = (GLuint *) span->array->color.sz1.rgba;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ src[i] = (src[i] & srcMask) | (dst[i] & dstMask);
+ }
}
- else {
- _swrast_read_rgba_span(ctx, rb, n, span->x, span->y, dest);
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ /* 2-byte components */
+ /* XXX try to use 64-bit arithmetic someday */
+ const GLushort rMask = ctx->Color.ColorMask[RCOMP] ? 0xffff : 0x0;
+ const GLushort gMask = ctx->Color.ColorMask[GCOMP] ? 0xffff : 0x0;
+ const GLushort bMask = ctx->Color.ColorMask[BCOMP] ? 0xffff : 0x0;
+ const GLushort aMask = ctx->Color.ColorMask[ACOMP] ? 0xffff : 0x0;
+ const GLushort (*dst)[4] = (const GLushort (*)[4]) rbPixels;
+ GLushort (*src)[4] = span->array->color.sz2.rgba;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask);
+ src[i][GCOMP] = (src[i][GCOMP] & gMask) | (dst[i][GCOMP] & ~gMask);
+ src[i][BCOMP] = (src[i][BCOMP] & bMask) | (dst[i][BCOMP] & ~bMask);
+ src[i][ACOMP] = (src[i][ACOMP] & aMask) | (dst[i][ACOMP] & ~aMask);
+ }
}
-
-#if CHAN_BITS == 8
- for (i = 0; i < n; i++) {
- rgba32[i] = (rgba32[i] & srcMask) | (dest32[i] & dstMask);
- }
-#else
- for (i = 0; i < n; i++) {
- if (!rMask) rgba[i][RCOMP] = dest[i][RCOMP];
- if (!gMask) rgba[i][GCOMP] = dest[i][GCOMP];
- if (!bMask) rgba[i][BCOMP] = dest[i][BCOMP];
- if (!aMask) rgba[i][ACOMP] = dest[i][ACOMP];
+ else {
+ /* 4-byte components */
+ const GLuint rMask = ctx->Color.ColorMask[RCOMP] ? ~0x0 : 0x0;
+ const GLuint gMask = ctx->Color.ColorMask[GCOMP] ? ~0x0 : 0x0;
+ const GLuint bMask = ctx->Color.ColorMask[BCOMP] ? ~0x0 : 0x0;
+ const GLuint aMask = ctx->Color.ColorMask[ACOMP] ? ~0x0 : 0x0;
+ const GLuint (*dst)[4] = (const GLuint (*)[4]) rbPixels;
+ GLuint (*src)[4] = (GLuint (*)[4]) span->array->color.sz4.rgba;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask);
+ src[i][GCOMP] = (src[i][GCOMP] & gMask) | (dst[i][GCOMP] & ~gMask);
+ src[i][BCOMP] = (src[i][BCOMP] & bMask) | (dst[i][BCOMP] & ~bMask);
+ src[i][ACOMP] = (src[i][ACOMP] & aMask) | (dst[i][ACOMP] & ~aMask);
+ }
}
-#endif
}
-/*
- * Apply glColorMask to a span of RGBA pixels.
+/**
+ * Apply the index mask to a span of color index values.
*/
void
-_swrast_mask_rgba_array(GLcontext *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLchan rgba[][4])
-{
- GLchan dest[MAX_WIDTH][4];
- GLuint i;
-
-#if CHAN_BITS == 8
-
- GLuint srcMask = *((GLuint*)ctx->Color.ColorMask);
- GLuint dstMask = ~srcMask;
- GLuint *rgba32 = (GLuint *) rgba;
- GLuint *dest32 = (GLuint *) dest;
-
- _swrast_read_rgba_span( ctx, rb, n, x, y, dest );
- for (i = 0; i < n; i++) {
- rgba32[i] = (rgba32[i] & srcMask) | (dest32[i] & dstMask);
- }
-
-#else
-
- const GLint rMask = ctx->Color.ColorMask[RCOMP];
- const GLint gMask = ctx->Color.ColorMask[GCOMP];
- const GLint bMask = ctx->Color.ColorMask[BCOMP];
- const GLint aMask = ctx->Color.ColorMask[ACOMP];
-
- _swrast_read_rgba_span( ctx, rb, n, x, y, dest );
- for (i = 0; i < n; i++) {
- if (!rMask) rgba[i][RCOMP] = dest[i][RCOMP];
- if (!gMask) rgba[i][GCOMP] = dest[i][GCOMP];
- if (!bMask) rgba[i][BCOMP] = dest[i][BCOMP];
- if (!aMask) rgba[i][ACOMP] = dest[i][ACOMP];
- }
-
-#endif
-}
-
-
-
-void
_swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLuint index[])
+ SWspan *span)
{
const GLuint srcMask = ctx->Color.IndexMask;
const GLuint dstMask = ~srcMask;
+ GLuint *index = span->array->index;
GLuint dest[MAX_WIDTH];
GLuint i;
@@ -150,23 +132,3 @@ _swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb,
index[i] = (index[i] & srcMask) | (dest[i] & dstMask);
}
}
-
-
-/*
- * Apply glIndexMask to an array of CI pixels.
- */
-void
-_swrast_mask_ci_array(GLcontext *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLuint index[])
-{
- const GLuint srcMask = ctx->Color.IndexMask;
- const GLuint dstMask = ~srcMask;
- GLuint dest[MAX_WIDTH];
- GLuint i;
-
- _swrast_read_index_span(ctx, rb, n, x, y, dest);
-
- for (i=0;i<n;i++) {
- index[i] = (index[i] & srcMask) | (dest[i] & dstMask);
- }
-}
diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h
index e2265448f88..0596cb3f458 100644
--- a/src/mesa/swrast/s_masking.h
+++ b/src/mesa/swrast/s_masking.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -31,28 +31,13 @@
#include "swrast.h"
-/*
- * Implement glColorMask for a span of RGBA pixels.
- */
extern void
_swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLchan rgba[][4]);
+ SWspan *span);
extern void
-_swrast_mask_rgba_array(GLcontext *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLchan rgba[][4]);
-
-
-/*
- * Implement glIndexMask for a span of CI pixels.
- */
-extern void
_swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb,
- const struct sw_span *span, GLuint index[]);
-
-extern void
-_swrast_mask_ci_array(GLcontext *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLuint index[]);
+ SWspan *span);
#endif
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c
index 97dbed04a89..028ddc0090d 100644
--- a/src/mesa/swrast/s_nvfragprog.c
+++ b/src/mesa/swrast/s_nvfragprog.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -41,9 +41,60 @@
#include "s_span.h"
-/* if 1, print some debugging info */
+/* See comments below for info about this */
+#define LAMBDA_ZERO 1
+
+/* debug predicate */
#define DEBUG_FRAG 0
+
+/**
+ * Virtual machine state used during execution of a fragment programs.
+ */
+struct fp_machine
+{
+ GLfloat Temporaries[MAX_NV_FRAGMENT_PROGRAM_TEMPS][4];
+ GLfloat Inputs[MAX_NV_FRAGMENT_PROGRAM_INPUTS][4];
+ GLfloat Outputs[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS][4];
+ GLuint CondCodes[4]; /**< COND_* value for x/y/z/w */
+
+ GLuint CallStack[MAX_PROGRAM_CALL_DEPTH]; /**< For CAL/RET instructions */
+ GLuint StackDepth; /**< Index/ptr to top of CallStack[] */
+};
+
+
+#if FEATURE_MESA_program_debug
+static struct fp_machine *CurrentMachine = NULL;
+
+/**
+ * For GL_MESA_program_debug.
+ * Return current value (4*GLfloat) of a fragment program register.
+ * Called via ctx->Driver.GetFragmentProgramRegister().
+ */
+void
+_swrast_get_program_register(GLcontext *ctx, enum register_file file,
+ GLuint index, GLfloat val[4])
+{
+ if (CurrentMachine) {
+ switch (file) {
+ case PROGRAM_INPUT:
+ COPY_4V(val, CurrentMachine->Inputs[index]);
+ break;
+ case PROGRAM_OUTPUT:
+ COPY_4V(val, CurrentMachine->Outputs[index]);
+ break;
+ case PROGRAM_TEMPORARY:
+ COPY_4V(val, CurrentMachine->Temporaries[index]);
+ break;
+ default:
+ _mesa_problem(NULL,
+ "bad register file in _swrast_get_program_register");
+ }
+ }
+}
+#endif /* FEATURE_MESA_program_debug */
+
+
/**
* Fetch a texel.
*/
@@ -108,40 +159,35 @@ get_register_pointer( GLcontext *ctx,
const struct fp_machine *machine,
const struct gl_fragment_program *program )
{
- const GLfloat *src;
switch (source->File) {
- case PROGRAM_TEMPORARY:
- ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_TEMPS);
- src = machine->Temporaries[source->Index];
- break;
- case PROGRAM_INPUT:
- ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_INPUTS);
- src = machine->Inputs[source->Index];
- break;
- case PROGRAM_OUTPUT:
- /* This is only for PRINT */
- ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS);
- src = machine->Outputs[source->Index];
- break;
- case PROGRAM_LOCAL_PARAM:
- ASSERT(source->Index < MAX_PROGRAM_LOCAL_PARAMS);
- src = program->Base.LocalParams[source->Index];
- break;
- case PROGRAM_ENV_PARAM:
- ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_PARAMS);
- src = ctx->FragmentProgram.Parameters[source->Index];
- break;
- case PROGRAM_STATE_VAR:
- /* Fallthrough */
- case PROGRAM_NAMED_PARAM:
- ASSERT(source->Index < (GLint) program->Base.Parameters->NumParameters);
- src = program->Base.Parameters->ParameterValues[source->Index];
- break;
- default:
- _mesa_problem(ctx, "Invalid input register file %d in fetch_vector4", source->File);
- src = NULL;
+ case PROGRAM_TEMPORARY:
+ ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_TEMPS);
+ return machine->Temporaries[source->Index];
+ case PROGRAM_INPUT:
+ ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_INPUTS);
+ return machine->Inputs[source->Index];
+ case PROGRAM_OUTPUT:
+ /* This is only for PRINT */
+ ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS);
+ return machine->Outputs[source->Index];
+ case PROGRAM_LOCAL_PARAM:
+ ASSERT(source->Index < MAX_PROGRAM_LOCAL_PARAMS);
+ return program->Base.LocalParams[source->Index];
+ case PROGRAM_ENV_PARAM:
+ ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_PARAMS);
+ return ctx->FragmentProgram.Parameters[source->Index];
+ case PROGRAM_STATE_VAR:
+ /* Fallthrough */
+ case PROGRAM_CONSTANT:
+ /* Fallthrough */
+ case PROGRAM_NAMED_PARAM:
+ ASSERT(source->Index < (GLint) program->Base.Parameters->NumParameters);
+ return program->Base.Parameters->ParameterValues[source->Index];
+ default:
+ _mesa_problem(ctx, "Invalid input register file %d in fp "
+ "get_register_pointer", source->File);
+ return NULL;
}
- return src;
}
@@ -159,10 +205,17 @@ fetch_vector4( GLcontext *ctx,
const GLfloat *src = get_register_pointer(ctx, source, machine, program);
ASSERT(src);
- result[0] = src[GET_SWZ(source->Swizzle, 0)];
- result[1] = src[GET_SWZ(source->Swizzle, 1)];
- result[2] = src[GET_SWZ(source->Swizzle, 2)];
- result[3] = src[GET_SWZ(source->Swizzle, 3)];
+ if (source->Swizzle == MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y,
+ SWIZZLE_Z, SWIZZLE_W)) {
+ /* no swizzling */
+ COPY_4V(result, src);
+ }
+ else {
+ result[0] = src[GET_SWZ(source->Swizzle, 0)];
+ result[1] = src[GET_SWZ(source->Swizzle, 1)];
+ result[2] = src[GET_SWZ(source->Swizzle, 2)];
+ result[3] = src[GET_SWZ(source->Swizzle, 3)];
+ }
if (source->NegateBase) {
result[0] = -result[0];
@@ -193,7 +246,7 @@ fetch_vector4( GLcontext *ctx,
static GLboolean
fetch_vector4_deriv( GLcontext *ctx,
const struct prog_src_register *source,
- const struct sw_span *span,
+ const SWspan *span,
char xOrY, GLint column, GLfloat result[4] )
{
GLfloat src[4];
@@ -361,7 +414,7 @@ generate_cc( float value )
/**
* Test if the ccMaskRule is satisfied by the given condition code.
- * Used to mask destination writes according to the current condition codee.
+ * Used to mask destination writes according to the current condition code.
*/
static INLINE GLboolean
test_cc(GLuint condCode, GLuint ccMaskRule)
@@ -391,11 +444,9 @@ store_vector4( const struct prog_instruction *inst,
{
const struct prog_dst_register *dest = &(inst->DstReg);
const GLboolean clamp = inst->SaturateMode == SATURATE_ZERO_ONE;
- const GLboolean updateCC = inst->CondUpdate;
GLfloat *dstReg;
GLfloat dummyReg[4];
GLfloat clampedValue[4];
- GLboolean condWriteMask[4];
GLuint writeMask = dest->WriteMask;
switch (dest->File) {
@@ -413,7 +464,7 @@ store_vector4( const struct prog_instruction *inst,
return;
}
-#if DEBUG_FRAG
+#if 0
if (value[0] > 1.0e10 ||
IS_INF_OR_NAN(value[0]) ||
IS_INF_OR_NAN(value[1]) ||
@@ -431,39 +482,46 @@ store_vector4( const struct prog_instruction *inst,
}
if (dest->CondMask != COND_TR) {
- condWriteMask[0] = GET_BIT(writeMask, 0)
- && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 0)], dest->CondMask);
- condWriteMask[1] = GET_BIT(writeMask, 1)
- && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 1)], dest->CondMask);
- condWriteMask[2] = GET_BIT(writeMask, 2)
- && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 2)], dest->CondMask);
- condWriteMask[3] = GET_BIT(writeMask, 3)
- && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 3)], dest->CondMask);
-
- writeMask = ((condWriteMask[0] << 0) |
- (condWriteMask[1] << 1) |
- (condWriteMask[2] << 2) |
- (condWriteMask[3] << 3));
+ /* condition codes may turn off some writes */
+ if (writeMask & WRITEMASK_X) {
+ if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 0)],
+ dest->CondMask))
+ writeMask &= ~WRITEMASK_X;
+ }
+ if (writeMask & WRITEMASK_Y) {
+ if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 1)],
+ dest->CondMask))
+ writeMask &= ~WRITEMASK_Y;
+ }
+ if (writeMask & WRITEMASK_Z) {
+ if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 2)],
+ dest->CondMask))
+ writeMask &= ~WRITEMASK_Z;
+ }
+ if (writeMask & WRITEMASK_W) {
+ if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 3)],
+ dest->CondMask))
+ writeMask &= ~WRITEMASK_W;
+ }
}
- if (GET_BIT(writeMask, 0)) {
+ if (writeMask & WRITEMASK_X)
dstReg[0] = value[0];
- if (updateCC)
- machine->CondCodes[0] = generate_cc(value[0]);
- }
- if (GET_BIT(writeMask, 1)) {
+ if (writeMask & WRITEMASK_Y)
dstReg[1] = value[1];
- if (updateCC)
- machine->CondCodes[1] = generate_cc(value[1]);
- }
- if (GET_BIT(writeMask, 2)) {
+ if (writeMask & WRITEMASK_Z)
dstReg[2] = value[2];
- if (updateCC)
- machine->CondCodes[2] = generate_cc(value[2]);
- }
- if (GET_BIT(writeMask, 3)) {
+ if (writeMask & WRITEMASK_W)
dstReg[3] = value[3];
- if (updateCC)
+
+ if (inst->CondUpdate) {
+ if (writeMask & WRITEMASK_X)
+ machine->CondCodes[0] = generate_cc(value[0]);
+ if (writeMask & WRITEMASK_Y)
+ machine->CondCodes[1] = generate_cc(value[1]);
+ if (writeMask & WRITEMASK_Z)
+ machine->CondCodes[2] = generate_cc(value[2]);
+ if (writeMask & WRITEMASK_W)
machine->CondCodes[3] = generate_cc(value[3]);
}
}
@@ -478,7 +536,7 @@ static void
init_machine_deriv( GLcontext *ctx,
const struct fp_machine *machine,
const struct gl_fragment_program *program,
- const struct sw_span *span, char xOrY,
+ const SWspan *span, char xOrY,
struct fp_machine *dMachine )
{
GLuint u;
@@ -589,14 +647,14 @@ init_machine_deriv( GLcontext *ctx,
static GLboolean
execute_program( GLcontext *ctx,
const struct gl_fragment_program *program, GLuint maxInst,
- struct fp_machine *machine, const struct sw_span *span,
+ struct fp_machine *machine, const SWspan *span,
GLuint column )
{
GLuint pc;
-#if DEBUG_FRAG
- printf("execute fragment program --------------------\n");
-#endif
+ if (DEBUG_FRAG) {
+ printf("execute fragment program --------------------\n");
+ }
for (pc = 0; pc < maxInst; pc++) {
const struct prog_instruction *inst = program->Base.Instructions + pc;
@@ -608,6 +666,10 @@ execute_program( GLcontext *ctx,
ctx->FragmentProgram.CallbackData);
}
+ if (DEBUG_FRAG) {
+ _mesa_print_instruction(inst);
+ }
+
switch (inst->Opcode) {
case OPCODE_ABS:
{
@@ -630,6 +692,43 @@ execute_program( GLcontext *ctx,
result[2] = a[2] + b[2];
result[3] = a[3] + b[3];
store_vector4( inst, machine, result );
+ if (DEBUG_FRAG) {
+ printf("ADD (%g %g %g %g) = (%g %g %g %g) + (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3],
+ a[0], a[1], a[2], a[3],
+ b[0], b[1], b[2], b[3]);
+ }
+ }
+ break;
+ case OPCODE_BRA: /* conditional branch */
+ {
+ /* NOTE: The return is conditional! */
+ const GLuint swizzle = inst->DstReg.CondSwizzle;
+ const GLuint condMask = inst->DstReg.CondMask;
+ if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) {
+ /* take branch */
+ pc = inst->BranchTarget;
+ }
+ }
+ break;
+ case OPCODE_CAL: /* Call subroutine */
+ {
+ /* NOTE: The call is conditional! */
+ const GLuint swizzle = inst->DstReg.CondSwizzle;
+ const GLuint condMask = inst->DstReg.CondMask;
+ if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) {
+ if (machine->StackDepth >= MAX_PROGRAM_CALL_DEPTH) {
+ return GL_TRUE; /* Per GL_NV_vertex_program2 spec */
+ }
+ machine->CallStack[machine->StackDepth++] = pc + 1;
+ pc = inst->BranchTarget;
+ }
}
break;
case OPCODE_CMP:
@@ -649,7 +748,8 @@ execute_program( GLcontext *ctx,
{
GLfloat a[4], result[4];
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
- result[0] = result[1] = result[2] = result[3] = (GLfloat)_mesa_cos(a[0]);
+ result[0] = result[1] = result[2] = result[3]
+ = (GLfloat) _mesa_cos(a[0]);
store_vector4( inst, machine, result );
}
break;
@@ -703,13 +803,12 @@ execute_program( GLcontext *ctx,
GLfloat a[4], b[4], result[4];
fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a );
fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b );
- result[0] = result[1] = result[2] = result[3] =
- a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
+ result[0] = result[1] = result[2] = result[3] = DOT3(a, b);
store_vector4( inst, machine, result );
-#if DEBUG_FRAG
- printf("DP3 %g = (%g %g %g) . (%g %g %g)\n",
- result[0], a[0], a[1], a[2], b[0], b[1], b[2]);
-#endif
+ if (DEBUG_FRAG) {
+ printf("DP3 %g = (%g %g %g) . (%g %g %g)\n",
+ result[0], a[0], a[1], a[2], b[0], b[1], b[2]);
+ }
}
break;
case OPCODE_DP4:
@@ -717,13 +816,13 @@ execute_program( GLcontext *ctx,
GLfloat a[4], b[4], result[4];
fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a );
fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b );
- result[0] = result[1] = result[2] = result[3] =
- a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
+ result[0] = result[1] = result[2] = result[3] = DOT4(a,b);
store_vector4( inst, machine, result );
-#if DEBUG_FRAG
- printf("DP4 %g = (%g, %g %g %g) . (%g, %g %g %g)\n",
- result[0], a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]);
-#endif
+ if (DEBUG_FRAG) {
+ printf("DP4 %g = (%g, %g %g %g) . (%g, %g %g %g)\n",
+ result[0], a[0], a[1], a[2], a[3],
+ b[0], b[1], b[2], b[3]);
+ }
}
break;
case OPCODE_DPH:
@@ -804,8 +903,7 @@ execute_program( GLcontext *ctx,
{
GLfloat a[4], result[4];
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
- result[0] = result[1] = result[2] = result[3]
- = LOG2(a[0]);
+ result[0] = result[1] = result[2] = result[3] = LOG2(a[0]);
store_vector4( inst, machine, result );
}
break;
@@ -832,6 +930,11 @@ execute_program( GLcontext *ctx,
}
result[3] = 1.0F;
store_vector4( inst, machine, result );
+ if (DEBUG_FRAG) {
+ printf("LIT (%g %g %g %g) : (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3],
+ a[0], a[1], a[2], a[3]);
+ }
}
break;
case OPCODE_LRP:
@@ -845,6 +948,14 @@ execute_program( GLcontext *ctx,
result[2] = a[2] * b[2] + (1.0F - a[2]) * c[2];
result[3] = a[3] * b[3] + (1.0F - a[3]) * c[3];
store_vector4( inst, machine, result );
+ if (DEBUG_FRAG) {
+ printf("LRP (%g %g %g %g) = (%g %g %g %g), "
+ "(%g %g %g %g), (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3],
+ a[0], a[1], a[2], a[3],
+ b[0], b[1], b[2], b[3],
+ c[0], c[1], c[2], c[3]);
+ }
}
break;
case OPCODE_MAD:
@@ -858,6 +969,14 @@ execute_program( GLcontext *ctx,
result[2] = a[2] * b[2] + c[2];
result[3] = a[3] * b[3] + c[3];
store_vector4( inst, machine, result );
+ if (DEBUG_FRAG) {
+ printf("MAD (%g %g %g %g) = (%g %g %g %g) * "
+ "(%g %g %g %g) + (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3],
+ a[0], a[1], a[2], a[3],
+ b[0], b[1], b[2], b[3],
+ c[0], c[1], c[2], c[3]);
+ }
}
break;
case OPCODE_MAX:
@@ -870,12 +989,12 @@ execute_program( GLcontext *ctx,
result[2] = MAX2(a[2], b[2]);
result[3] = MAX2(a[3], b[3]);
store_vector4( inst, machine, result );
-#if DEBUG_FRAG
- printf("MAX (%g %g %g %g) = (%g %g %g %g), (%g %g %g %g)\n",
- result[0], result[1], result[2], result[3],
- a[0], a[1], a[2], a[3],
- b[0], b[1], b[2], b[3]);
-#endif
+ if (DEBUG_FRAG) {
+ printf("MAX (%g %g %g %g) = (%g %g %g %g), (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3],
+ a[0], a[1], a[2], a[3],
+ b[0], b[1], b[2], b[3]);
+ }
}
break;
case OPCODE_MIN:
@@ -895,10 +1014,10 @@ execute_program( GLcontext *ctx,
GLfloat result[4];
fetch_vector4( ctx, &inst->SrcReg[0], machine, program, result );
store_vector4( inst, machine, result );
-#if DEBUG_FRAG
- printf("MOV (%g %g %g %g)\n",
- result[0], result[1], result[2], result[3]);
-#endif
+ if (DEBUG_FRAG) {
+ printf("MOV (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3]);
+ }
}
break;
case OPCODE_MUL:
@@ -911,12 +1030,12 @@ execute_program( GLcontext *ctx,
result[2] = a[2] * b[2];
result[3] = a[3] * b[3];
store_vector4( inst, machine, result );
-#if DEBUG_FRAG
- printf("MUL (%g %g %g %g) = (%g %g %g %g) * (%g %g %g %g)\n",
- result[0], result[1], result[2], result[3],
- a[0], a[1], a[2], a[3],
- b[0], b[1], b[2], b[3]);
-#endif
+ if (DEBUG_FRAG) {
+ printf("MUL (%g %g %g %g) = (%g %g %g %g) * (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3],
+ a[0], a[1], a[2], a[3],
+ b[0], b[1], b[2], b[3]);
+ }
}
break;
case OPCODE_PK2H: /* pack two 16-bit floats in one 32-bit float */
@@ -998,31 +1117,42 @@ execute_program( GLcontext *ctx,
{
GLfloat a[4], result[4];
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
-#if DEBUG_FRAG
- if (a[0] == 0)
- printf("RCP(0)\n");
- else if (IS_INF_OR_NAN(a[0]))
- printf("RCP(inf)\n");
-#endif
- result[0] = result[1] = result[2] = result[3]
- = 1.0F / a[0];
+ if (DEBUG_FRAG) {
+ if (a[0] == 0)
+ printf("RCP(0)\n");
+ else if (IS_INF_OR_NAN(a[0]))
+ printf("RCP(inf)\n");
+ }
+ result[0] = result[1] = result[2] = result[3] = 1.0F / a[0];
store_vector4( inst, machine, result );
}
break;
- case OPCODE_RFL:
+ case OPCODE_RET: /* return from subroutine */
{
- GLfloat axis[4], dir[4], result[4], tmp[4];
+ /* NOTE: The return is conditional! */
+ const GLuint swizzle = inst->DstReg.CondSwizzle;
+ const GLuint condMask = inst->DstReg.CondMask;
+ if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) {
+ if (machine->StackDepth == 0) {
+ return GL_TRUE; /* Per GL_NV_vertex_program2 spec */
+ }
+ pc = machine->CallStack[--machine->StackDepth];
+ }
+ }
+ break;
+ case OPCODE_RFL: /* reflection vector */
+ {
+ GLfloat axis[4], dir[4], result[4], tmpX, tmpW;
fetch_vector4( ctx, &inst->SrcReg[0], machine, program, axis );
fetch_vector4( ctx, &inst->SrcReg[1], machine, program, dir );
- tmp[3] = axis[0] * axis[0]
- + axis[1] * axis[1]
- + axis[2] * axis[2];
- tmp[0] = (2.0F * (axis[0] * dir[0] +
- axis[1] * dir[1] +
- axis[2] * dir[2])) / tmp[3];
- result[0] = tmp[0] * axis[0] - dir[0];
- result[1] = tmp[0] * axis[1] - dir[1];
- result[2] = tmp[0] * axis[2] - dir[2];
+ tmpW = DOT3(axis, axis);
+ tmpX = (2.0F * DOT3(axis, dir)) / tmpW;
+ result[0] = tmpX * axis[0] - dir[0];
+ result[1] = tmpX * axis[1] - dir[1];
+ result[2] = tmpX * axis[2] - dir[2];
/* result[3] is never written! XXX enforce in parser! */
store_vector4( inst, machine, result );
}
@@ -1034,9 +1164,9 @@ execute_program( GLcontext *ctx,
a[0] = FABSF(a[0]);
result[0] = result[1] = result[2] = result[3] = INV_SQRTF(a[0]);
store_vector4( inst, machine, result );
-#if DEBUG_FRAG
- printf("RSQ %g = 1/sqrt(|%g|)\n", result[0], a[0]);
-#endif
+ if (DEBUG_FRAG) {
+ printf("RSQ %g = 1/sqrt(|%g|)\n", result[0], a[0]);
+ }
}
break;
case OPCODE_SCS: /* sine and cos */
@@ -1096,8 +1226,8 @@ execute_program( GLcontext *ctx,
{
GLfloat a[4], result[4];
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
- result[0] = result[1] = result[2] =
- result[3] = (GLfloat)_mesa_sin(a[0]);
+ result[0] = result[1] = result[2] = result[3]
+ = (GLfloat) _mesa_sin(a[0]);
store_vector4( inst, machine, result );
}
break;
@@ -1153,25 +1283,31 @@ execute_program( GLcontext *ctx,
result[2] = a[2] - b[2];
result[3] = a[3] - b[3];
store_vector4( inst, machine, result );
+ if (DEBUG_FRAG) {
+ printf("SUB (%g %g %g %g) = (%g %g %g %g) - (%g %g %g %g)\n",
+ result[0], result[1], result[2], result[3],
+ a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]);
+ }
}
break;
- case OPCODE_SWZ:
+ case OPCODE_SWZ: /* extended swizzle */
{
const struct prog_src_register *source = &inst->SrcReg[0];
const GLfloat *src = get_register_pointer(ctx, source,
machine, program);
GLfloat result[4];
GLuint i;
-
- /* do extended swizzling here */
for (i = 0; i < 4; i++) {
- if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ZERO)
+ const GLuint swz = GET_SWZ(source->Swizzle, i);
+ if (swz == SWIZZLE_ZERO)
result[i] = 0.0;
- else if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ONE)
+ else if (swz == SWIZZLE_ONE)
result[i] = 1.0;
- else
- result[i] = src[GET_SWZ(source->Swizzle, i)];
-
+ else {
+ ASSERT(swz >= 0);
+ ASSERT(swz <= 3);
+ result[i] = src[swz];
+ }
if (source->NegateBase & (1 << i))
result[i] = -result[i];
}
@@ -1181,44 +1317,47 @@ execute_program( GLcontext *ctx,
case OPCODE_TEX: /* Both ARB and NV frag prog */
/* Texel lookup */
{
- GLfloat texcoord[4], color[4];
- fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord );
- /* Note: we pass 0 for LOD. The ARB extension requires it
- * while the NV extension says it's implementation dependant.
+ /* Note: only use the precomputed lambda value when we're
+ * sampling texture unit [K] with texcoord[K].
+ * Otherwise, the lambda value may have no relation to the
+ * instruction's texcoord or texture image. Using the wrong
+ * lambda is usually bad news.
+ * The rest of the time, just use zero (until we get a more
+ * sophisticated way of computing lambda).
*/
- /* KW: Previously lambda was passed as zero, but I
- * believe this is incorrect, the spec seems to
- * indicate rather that lambda should not be
- * changed/biased, unlike TXB where texcoord[3] is
- * added to the lambda calculations. The lambda should
- * still be calculated normally for TEX & TXP though,
- * not set to zero. Otherwise it's very difficult to
- * implement normal GL semantics through the fragment
- * shader.
- */
- fetch_texel( ctx, texcoord,
- span->array->lambda[inst->TexSrcUnit][column],
- inst->TexSrcUnit, color );
-#if DEBUG_FRAG
- if (color[3])
- printf("color[3] = %f\n", color[3]);
-#endif
+ GLfloat coord[4], color[4], lambda;
+ if (inst->SrcReg[0].File == PROGRAM_INPUT &&
+ inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit)
+ lambda = span->array->lambda[inst->TexSrcUnit][column];
+ else
+ lambda = 0.0;
+ fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord);
+ fetch_texel( ctx, coord, lambda, inst->TexSrcUnit, color );
+ if (DEBUG_FRAG) {
+ printf("TEX (%g, %g, %g, %g) = texture[%d][%g, %g, %g, %g], "
+ "lod %f\n",
+ color[0], color[1], color[2], color[3],
+ inst->TexSrcUnit,
+ coord[0], coord[1], coord[2], coord[3], lambda);
+ }
store_vector4( inst, machine, color );
}
break;
case OPCODE_TXB: /* GL_ARB_fragment_program only */
/* Texel lookup with LOD bias */
{
- GLfloat texcoord[4], color[4], bias, lambda;
-
- fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord );
- /* texcoord[3] is the bias to add to lambda */
+ GLfloat coord[4], color[4], lambda, bias;
+ if (inst->SrcReg[0].File == PROGRAM_INPUT &&
+ inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit)
+ lambda = span->array->lambda[inst->TexSrcUnit][column];
+ else
+ lambda = 0.0;
+ fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord);
+ /* coord[3] is the bias to add to lambda */
bias = ctx->Texture.Unit[inst->TexSrcUnit].LodBias
+ ctx->Texture.Unit[inst->TexSrcUnit]._Current->LodBias
- + texcoord[3];
- lambda = span->array->lambda[inst->TexSrcUnit][column] + bias;
- fetch_texel( ctx, texcoord, lambda,
- inst->TexSrcUnit, color );
+ + coord[3];
+ fetch_texel(ctx, coord, lambda + bias, inst->TexSrcUnit, color);
store_vector4( inst, machine, color );
}
break;
@@ -1237,8 +1376,13 @@ execute_program( GLcontext *ctx,
case OPCODE_TXP: /* GL_ARB_fragment_program only */
/* Texture lookup w/ projective divide */
{
- GLfloat texcoord[4], color[4];
- fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord );
+ GLfloat texcoord[4], color[4], lambda;
+ if (inst->SrcReg[0].File == PROGRAM_INPUT &&
+ inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit)
+ lambda = span->array->lambda[inst->TexSrcUnit][column];
+ else
+ lambda = 0.0;
+ fetch_vector4(ctx, &inst->SrcReg[0], machine, program,texcoord);
/* Not so sure about this test - if texcoord[3] is
* zero, we'd probably be fine except for an ASSERT in
* IROUND_POS() which gets triggered by the inf values created.
@@ -1248,34 +1392,27 @@ execute_program( GLcontext *ctx,
texcoord[1] /= texcoord[3];
texcoord[2] /= texcoord[3];
}
- /* KW: Previously lambda was passed as zero, but I
- * believe this is incorrect, the spec seems to
- * indicate rather that lambda should not be
- * changed/biased, unlike TXB where texcoord[3] is
- * added to the lambda calculations. The lambda should
- * still be calculated normally for TEX & TXP though,
- * not set to zero.
- */
- fetch_texel( ctx, texcoord,
- span->array->lambda[inst->TexSrcUnit][column],
- inst->TexSrcUnit, color );
+ fetch_texel( ctx, texcoord, lambda, inst->TexSrcUnit, color );
store_vector4( inst, machine, color );
}
break;
case OPCODE_TXP_NV: /* GL_NV_fragment_program only */
/* Texture lookup w/ projective divide */
{
- GLfloat texcoord[4], color[4];
- fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord );
+ GLfloat texcoord[4], color[4], lambda;
+ if (inst->SrcReg[0].File == PROGRAM_INPUT &&
+ inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit)
+ lambda = span->array->lambda[inst->TexSrcUnit][column];
+ else
+ lambda = 0.0;
+ fetch_vector4(ctx, &inst->SrcReg[0], machine, program,texcoord);
if (inst->TexSrcTarget != TEXTURE_CUBE_INDEX &&
texcoord[3] != 0.0) {
texcoord[0] /= texcoord[3];
texcoord[1] /= texcoord[3];
texcoord[2] /= texcoord[3];
}
- fetch_texel( ctx, texcoord,
- span->array->lambda[inst->TexSrcUnit][column],
- inst->TexSrcUnit, color );
+ fetch_texel( ctx, texcoord, lambda, inst->TexSrcUnit, color );
store_vector4( inst, machine, color );
}
break;
@@ -1379,10 +1516,19 @@ execute_program( GLcontext *ctx,
}
+/**
+ * Initialize the virtual fragment program machine state prior to running
+ * fragment program on a fragment. This involves initializing the input
+ * registers, condition codes, etc.
+ * \param machine the virtual machine state to init
+ * \param program the fragment program we're about to run
+ * \param span the span of pixels we'll operate on
+ * \param col which element (column) of the span we'll operate on
+ */
static void
init_machine( GLcontext *ctx, struct fp_machine *machine,
const struct gl_fragment_program *program,
- const struct sw_span *span, GLuint col )
+ const SWspan *span, GLuint col )
{
GLuint inputsRead = program->Base.InputsRead;
GLuint u;
@@ -1412,19 +1558,14 @@ init_machine( GLcontext *ctx, struct fp_machine *machine,
wpos[3] = span->w + col * span->dwdx;
}
if (inputsRead & (1 << FRAG_ATTRIB_COL0)) {
- GLfloat *col0 = machine->Inputs[FRAG_ATTRIB_COL0];
ASSERT(span->arrayMask & SPAN_RGBA);
- col0[0] = CHAN_TO_FLOAT(span->array->rgba[col][RCOMP]);
- col0[1] = CHAN_TO_FLOAT(span->array->rgba[col][GCOMP]);
- col0[2] = CHAN_TO_FLOAT(span->array->rgba[col][BCOMP]);
- col0[3] = CHAN_TO_FLOAT(span->array->rgba[col][ACOMP]);
+ COPY_4V(machine->Inputs[FRAG_ATTRIB_COL0],
+ span->array->color.sz4.rgba[col]);
}
if (inputsRead & (1 << FRAG_ATTRIB_COL1)) {
- GLfloat *col1 = machine->Inputs[FRAG_ATTRIB_COL1];
- col1[0] = CHAN_TO_FLOAT(span->array->spec[col][RCOMP]);
- col1[1] = CHAN_TO_FLOAT(span->array->spec[col][GCOMP]);
- col1[2] = CHAN_TO_FLOAT(span->array->spec[col][BCOMP]);
- col1[3] = CHAN_TO_FLOAT(span->array->spec[col][ACOMP]);
+ ASSERT(span->arrayMask & SPAN_SPEC);
+ COPY_4V(machine->Inputs[FRAG_ATTRIB_COL1],
+ span->array->color.sz4.spec[col]);
}
if (inputsRead & (1 << FRAG_ATTRIB_FOGC)) {
GLfloat *fogc = machine->Inputs[FRAG_ATTRIB_FOGC];
@@ -1448,59 +1589,72 @@ init_machine( GLcontext *ctx, struct fp_machine *machine,
machine->CondCodes[1] = COND_EQ;
machine->CondCodes[2] = COND_EQ;
machine->CondCodes[3] = COND_EQ;
-}
+ /* init call stack */
+ machine->StackDepth = 0;
+}
/**
- * Execute the current fragment program, operating on the given span.
+ * Run fragment program on the pixels in span from 'start' to 'end' - 1.
*/
-void
-_swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span )
+static void
+run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
{
const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
+ struct fp_machine machine;
GLuint i;
- ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */
-
- if (program->Base.Parameters) {
- _mesa_load_state_parameters(ctx, program->Base.Parameters);
- }
+ CurrentMachine = &machine;
- for (i = 0; i < span->end; i++) {
+ for (i = start; i < end; i++) {
if (span->array->mask[i]) {
- init_machine(ctx, &ctx->FragmentProgram.Machine,
- ctx->FragmentProgram._Current, span, i);
-
- if (!execute_program(ctx, program, ~0,
- &ctx->FragmentProgram.Machine, span, i)) {
- span->array->mask[i] = GL_FALSE; /* killed fragment */
- span->writeAll = GL_FALSE;
- }
-
- /* Store output registers */
- {
- const GLfloat *colOut
- = ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_COLR];
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][RCOMP], colOut[0]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][GCOMP], colOut[1]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], colOut[2]);
- UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], colOut[3]);
+ init_machine(ctx, &machine, program, span, i);
+
+ if (execute_program(ctx, program, ~0, &machine, span, i)) {
+ /* Store result color */
+ COPY_4V(span->array->color.sz4.rgba[i],
+ machine.Outputs[FRAG_RESULT_COLR]);
+
+ /* Store result depth/z */
+ if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) {
+ const GLfloat depth = machine.Outputs[FRAG_RESULT_DEPR][2];
+ if (depth <= 0.0)
+ span->array->z[i] = 0;
+ else if (depth >= 1.0)
+ span->array->z[i] = ctx->DrawBuffer->_DepthMax;
+ else
+ span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF);
+ }
}
- /* depth value */
- if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) {
- const GLfloat depth
- = ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_DEPR][2];
- if (depth <= 0.0)
- span->array->z[i] = 0;
- else if (depth >= 1.0)
- span->array->z[i] = ctx->DrawBuffer->_DepthMax;
- else
- span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF);
+ else {
+ /* killed fragment */
+ span->array->mask[i] = GL_FALSE;
+ span->writeAll = GL_FALSE;
}
}
}
+ CurrentMachine = NULL;
+}
+
+
+/**
+ * Execute the current fragment program for all the fragments
+ * in the given span.
+ */
+void
+_swrast_exec_fragment_program( GLcontext *ctx, SWspan *span )
+{
+ const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
+
+ /* incoming colors should be floats */
+ ASSERT(span->array->ChanType == GL_FLOAT);
+
+ ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */
+
+ run_program(ctx, span, 0, span->end);
+
if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) {
span->interpMask &= ~SPAN_Z;
span->arrayMask |= SPAN_Z;
diff --git a/src/mesa/swrast/s_nvfragprog.h b/src/mesa/swrast/s_nvfragprog.h
index ac5a15fe9bc..188bacc3d89 100644
--- a/src/mesa/swrast/s_nvfragprog.h
+++ b/src/mesa/swrast/s_nvfragprog.h
@@ -31,7 +31,7 @@
extern void
-_swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span );
+_swrast_exec_fragment_program( GLcontext *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index 4ce261009c0..6316833a686 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -92,7 +92,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
GLuint u;
#endif
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct sw_span *span = &(swrast->PointSpan);
+ SWspan *span = &(swrast->PointSpan);
/* Cull primitives with malformed coordinates.
*/
@@ -119,7 +119,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
span->arrayMask |= SPAN_INDEX;
#endif
#if FLAGS & TEXTURE
- span->arrayMask |= SPAN_TEXTURE;
+ span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
if (ctx->FragmentProgram._Active) {
/* Don't divide texture s,t,r by q (use TXP to do that) */
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
@@ -150,7 +150,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
span->arrayMask |= SPAN_COVERAGE;
#endif
#if FLAGS & SPRITE
- span->arrayMask |= SPAN_TEXTURE;
+ span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
#endif
/* Compute point size if not known to be one */
@@ -232,12 +232,14 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
/* check if we need to flush */
if (span->end + (xmax-xmin+1) * (ymax-ymin+1) >= MAX_WIDTH ||
(swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
+ if (span->end > 0) {
#if FLAGS & RGBA
- _swrast_write_rgba_span(ctx, span);
+ _swrast_write_rgba_span(ctx, span);
#else
- _swrast_write_index_span(ctx, span);
+ _swrast_write_index_span(ctx, span);
#endif
- span->end = 0;
+ span->end = 0;
+ }
}
/*
@@ -279,6 +281,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture._EnabledCoordUnits & (1 << u)) {
COPY_4V(span->array->texcoords[u][count], texcoord[u]);
+ span->array->lambda[u][count] = 0.0;
}
}
#endif
@@ -343,6 +346,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
span->array->texcoords[u][count][1] = t;
span->array->texcoords[u][count][2] = r;
span->array->texcoords[u][count][3] = 1.0F;
+ span->array->lambda[u][count] = 0.0; /* XXX fix? */
}
else {
COPY_4V(span->array->texcoords[u][count], vert->texcoord[u]);
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 4c3be5a83f4..128ce0afb33 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -193,79 +193,107 @@ read_stencil_pixels( GLcontext *ctx,
/**
- * Optimized glReadPixels for particular pixel formats:
- * GL_UNSIGNED_BYTE, GL_RGBA
- * when pixel scaling, biasing and mapping are disabled.
+ * Optimized glReadPixels for particular pixel formats when pixel
+ * scaling, biasing, mapping, etc. are disabled.
*/
static GLboolean
-read_fast_rgba_pixels( GLcontext *ctx,
+fast_read_rgba_pixels( GLcontext *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
+ const struct gl_pixelstore_attrib *packing,
+ GLbitfield transferOps)
{
struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
- /* can't do scale, bias, mapping, etc */
- if (ctx->_ImageTransferState)
- return GL_FALSE;
+ ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB);
- /* can't do fancy pixel packing */
- if (packing->Alignment != 1 || packing->SwapBytes || packing->LsbFirst)
+ /* clipping should have already been done */
+ ASSERT(x + width <= rb->Width);
+ ASSERT(y + height <= rb->Height);
+
+ /* check for things we can't handle here */
+ if (transferOps ||
+ packing->SwapBytes ||
+ packing->LsbFirst) {
return GL_FALSE;
+ }
- {
- GLint srcX = x;
- GLint srcY = y;
- GLint readWidth = width; /* actual width read */
- GLint readHeight = height; /* actual height read */
- GLint skipPixels = packing->SkipPixels;
- GLint skipRows = packing->SkipRows;
- GLint rowLength;
-
- if (packing->RowLength > 0)
- rowLength = packing->RowLength;
- else
- rowLength = width;
-
- /*
- * Ready to read!
- * The window region at (destX, destY) of size (readWidth, readHeight)
- * will be read back.
- * We'll write pixel data to buffer pointed to by "pixels" but we'll
- * skip "skipRows" rows and skip "skipPixels" pixels/row.
- */
-#if CHAN_BITS == 8
- if (format == GL_RGBA && type == GL_UNSIGNED_BYTE)
-#elif CHAN_BITS == 16
- if (format == GL_RGBA && type == GL_UNSIGNED_SHORT)
-#else
- if (0)
-#endif
- {
- GLchan *dest = (GLchan *) pixels
- + (skipRows * rowLength + skipPixels) * 4;
- GLint row;
-
- if (packing->Invert) {
- /* start at top and go down */
- dest += (readHeight - 1) * rowLength * 4;
- rowLength = -rowLength;
- }
+ if (format == GL_RGBA && rb->DataType == type) {
+ const GLint dstStride = _mesa_image_row_stride(packing, width,
+ format, type);
+ GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
+ GLint row;
+ ASSERT(rb->GetRow);
+ for (row = 0; row < height; row++) {
+ rb->GetRow(ctx, rb, width, x, y + row, dest);
+ dest += dstStride;
+ }
+ return GL_TRUE;
+ }
- ASSERT(rb->GetRow);
- for (row=0; row<readHeight; row++) {
- rb->GetRow(ctx, rb, readWidth, srcX, srcY, dest);
- dest += rowLength * 4;
- srcY++;
+ if (format == GL_RGB &&
+ rb->DataType == GL_UNSIGNED_BYTE &&
+ type == GL_UNSIGNED_BYTE) {
+ const GLint dstStride = _mesa_image_row_stride(packing, width,
+ format, type);
+ GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
+ GLint row;
+ ASSERT(rb->GetRow);
+ for (row = 0; row < height; row++) {
+ GLubyte tempRow[MAX_WIDTH][4];
+ GLint col;
+ rb->GetRow(ctx, rb, width, x, y + row, tempRow);
+ /* convert RGBA to RGB */
+ for (col = 0; col < width; col++) {
+ dest[col * 3 + 0] = tempRow[col][0];
+ dest[col * 3 + 1] = tempRow[col][1];
+ dest[col * 3 + 2] = tempRow[col][2];
}
- return GL_TRUE;
- }
- else {
- /* can't do this format/type combination */
- return GL_FALSE;
+ dest += dstStride;
}
+ return GL_TRUE;
+ }
+
+ /* not handled */
+ return GL_FALSE;
+}
+
+
+/**
+ * When we're using a low-precision color buffer (like 16-bit 5/6/5)
+ * we have to adjust our color values a bit to pass conformance.
+ * The problem is when a 5 or 6-bit color value is convert to an 8-bit
+ * value and then a floating point value, the floating point values don't
+ * increment uniformly as the 5 or 6-bit value is incremented.
+ *
+ * This function adjusts floating point values to compensate.
+ */
+static void
+adjust_colors(GLcontext *ctx, GLuint n, GLfloat rgba[][4])
+{
+ const GLuint rShift = 8 - ctx->Visual.redBits;
+ const GLuint gShift = 8 - ctx->Visual.greenBits;
+ const GLuint bShift = 8 - ctx->Visual.blueBits;
+ const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1);
+ const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1);
+ const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ GLint r, g, b;
+ /* convert float back to ubyte */
+ CLAMPED_FLOAT_TO_UBYTE(r, rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(g, rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(b, rgba[i][BCOMP]);
+ /* using only the N most significant bits of the ubyte value, convert to
+ * float in [0,1].
+ */
+ rgba[i][RCOMP] = (GLfloat) (r >> rShift) * rScale;
+ rgba[i][GCOMP] = (GLfloat) (g >> gShift) * gScale;
+ rgba[i][BCOMP] = (GLfloat) (b >> bShift) * bScale;
}
}
@@ -281,14 +309,21 @@ read_rgba_pixels( GLcontext *ctx,
GLenum format, GLenum type, GLvoid *pixels,
const struct gl_pixelstore_attrib *packing )
{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLbitfield transferOps = ctx->_ImageTransferState;
struct gl_framebuffer *fb = ctx->ReadBuffer;
struct gl_renderbuffer *rb = fb->_ColorReadBuffer;
ASSERT(rb);
+ if (type == GL_FLOAT && ((ctx->Color.ClampReadColor == GL_TRUE) ||
+ (ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB &&
+ rb->DataType != GL_FLOAT)))
+ transferOps |= IMAGE_CLAMP_BIT;
+
/* Try optimized path first */
- if (read_fast_rgba_pixels( ctx, x, y, width, height,
- format, type, pixels, packing )) {
+ if (fast_read_rgba_pixels(ctx, x, y, width, height,
+ format, type, pixels, packing, transferOps)) {
return; /* done! */
}
@@ -296,7 +331,6 @@ read_rgba_pixels( GLcontext *ctx,
ASSERT(width <= MAX_WIDTH);
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
- const GLuint transferOps = ctx->_ImageTransferState;
GLfloat *dest, *src, *tmpImage, *convImage;
GLint row;
@@ -315,22 +349,21 @@ read_rgba_pixels( GLcontext *ctx,
/* read full RGBA, FLOAT image */
dest = tmpImage;
for (row = 0; row < height; row++, y++) {
- GLchan rgba[MAX_WIDTH][4];
if (fb->Visual.rgbMode) {
- _swrast_read_rgba_span(ctx, rb, width, x, y, rgba);
+ _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest);
}
else {
GLuint index[MAX_WIDTH];
ASSERT(rb->DataType == GL_UNSIGNED_INT);
rb->GetRow(ctx, rb, width, x, y, index);
- if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset !=0 ) {
- _mesa_map_ci(ctx, width, index);
- }
- _mesa_map_ci_to_rgba_chan(ctx, width, index, rgba);
+ _mesa_apply_ci_transfer_ops(ctx,
+ transferOps & IMAGE_SHIFT_OFFSET_BIT,
+ width, index);
+ _mesa_map_ci_to_rgba(ctx, width, index, (GLfloat (*)[4]) dest);
}
- _mesa_pack_rgba_span_chan(ctx, width, (const GLchan (*)[4]) rgba,
- GL_RGBA, GL_FLOAT, dest, &ctx->DefaultPacking,
- transferOps & IMAGE_PRE_CONVOLUTION_BITS);
+ _mesa_apply_rgba_transfer_ops(ctx,
+ transferOps & IMAGE_PRE_CONVOLUTION_BITS,
+ width, (GLfloat (*)[4]) dest);
dest += width * 4;
}
@@ -350,8 +383,7 @@ read_rgba_pixels( GLcontext *ctx,
GLvoid *dest;
dest = _mesa_image_address2d(packing, pixels, width, height,
format, type, row, 0);
- _mesa_pack_rgba_span_float(ctx, width,
- (const GLfloat (*)[4]) src,
+ _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src,
format, type, dest, packing,
transferOps & IMAGE_POST_CONVOLUTION_BITS);
src += width * 4;
@@ -360,45 +392,42 @@ read_rgba_pixels( GLcontext *ctx,
}
else {
/* no convolution */
+ const GLint dstStride
+ = _mesa_image_row_stride(packing, width, format, type);
+ GLfloat (*rgba)[4] = swrast->SpanArrays->color.sz4.rgba;
GLint row;
+ GLubyte *dst = _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
+
for (row = 0; row < height; row++, y++) {
- GLchan rgba[MAX_WIDTH][4];
- GLvoid *dst;
+
+ /* Get float rgba pixels */
if (fb->Visual.rgbMode) {
- _swrast_read_rgba_span(ctx, rb, width, x, y, rgba);
+ _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba);
}
else {
+ /* read CI and convert to RGBA */
GLuint index[MAX_WIDTH];
ASSERT(rb->DataType == GL_UNSIGNED_INT);
rb->GetRow(ctx, rb, width, x, y, index);
- if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) {
- _mesa_map_ci(ctx, width, index);
- }
- _mesa_map_ci_to_rgba_chan(ctx, width, index, rgba);
+ _mesa_apply_ci_transfer_ops(ctx,
+ transferOps & IMAGE_SHIFT_OFFSET_BIT,
+ width, index);
+ _mesa_map_ci_to_rgba(ctx, width, index, rgba);
}
- dst = _mesa_image_address2d(packing, pixels, width, height,
- format, type, row, 0);
- if (fb->Visual.redBits < CHAN_BITS ||
- fb->Visual.greenBits < CHAN_BITS ||
- fb->Visual.blueBits < CHAN_BITS) {
- /* Requantize the color values into floating point and go from
- * there. This fixes conformance failures with 5/6/5 color
- * buffers, for example.
- */
- GLfloat rgbaf[MAX_WIDTH][4];
- _mesa_chan_to_float_span(ctx, width,
- (CONST GLchan (*)[4]) rgba, rgbaf);
- _mesa_pack_rgba_span_float(ctx, width,
- (CONST GLfloat (*)[4]) rgbaf,
- format, type, dst, packing,
- ctx->_ImageTransferState);
- }
- else {
- /* GLubytes are fine */
- _mesa_pack_rgba_span_chan(ctx, width, (CONST GLchan (*)[4]) rgba,
- format, type, dst, packing,
- ctx->_ImageTransferState);
+
+ /* apply fudge factor for shallow color buffers */
+ if (fb->Visual.redBits < 8 ||
+ fb->Visual.greenBits < 8 ||
+ fb->Visual.blueBits < 8) {
+ adjust_colors(ctx, width, rgba);
}
+
+ /* pack the row of RGBA pixels into user's buffer */
+ _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst,
+ packing, transferOps);
+
+ dst += dstStride;
}
}
}
@@ -525,7 +554,7 @@ _swrast_ReadPixels( GLcontext *ctx,
/* Do all needed clipping here, so that we can forget about it later */
if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
/* The ReadPixels region is totally outside the window bounds */
- return;
+ goto end;
}
if (clippedPacking.BufferObj->Name) {
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index d1431054162..c74b98facfb 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -35,6 +35,7 @@
#include "context.h"
#include "macros.h"
#include "imports.h"
+#include "image.h"
#include "s_atifragshader.h"
#include "s_alpha.h"
@@ -56,7 +57,7 @@
* Used during setup for glDraw/CopyPixels.
*/
void
-_swrast_span_default_z( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_z( GLcontext *ctx, SWspan *span )
{
const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
if (ctx->DrawBuffer->Visual.depthBits <= 16)
@@ -73,7 +74,7 @@ _swrast_span_default_z( GLcontext *ctx, struct sw_span *span )
* Used during setup for glDraw/CopyPixels.
*/
void
-_swrast_span_default_fog( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_fog( GLcontext *ctx, SWspan *span )
{
span->fog = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
span->fogStep = span->dfogdx = span->dfogdy = 0.0F;
@@ -86,7 +87,7 @@ _swrast_span_default_fog( GLcontext *ctx, struct sw_span *span )
* Used during setup for glDraw/CopyPixels.
*/
void
-_swrast_span_default_color( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_color( GLcontext *ctx, SWspan *span )
{
if (ctx->Visual.rgbMode) {
GLchan r, g, b, a;
@@ -124,12 +125,12 @@ _swrast_span_default_color( GLcontext *ctx, struct sw_span *span )
* Used during setup for glDraw/CopyPixels.
*/
void
-_swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_texcoords( GLcontext *ctx, SWspan *span )
{
GLuint i;
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
const GLfloat *tc = ctx->Current.RasterTexCoords[i];
- if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled) {
+ if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled) {
COPY_4V(span->tex[i], tc);
}
else if (tc[3] > 0.0F) {
@@ -149,68 +150,254 @@ _swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span )
}
-/* Fill in the span.color.rgba array from the interpolation values */
-static void
-interpolate_colors(GLcontext *ctx, struct sw_span *span)
+/**
+ * Interpolate primary colors to fill in the span->array->color array.
+ */
+static INLINE void
+interpolate_colors(SWspan *span)
{
const GLuint n = span->end;
- GLchan (*rgba)[4] = span->array->rgba;
GLuint i;
- (void) ctx;
ASSERT((span->interpMask & SPAN_RGBA) &&
- !(span->arrayMask & SPAN_RGBA));
-
- if (span->interpMask & SPAN_FLAT) {
- /* constant color */
- GLchan color[4];
- color[RCOMP] = FixedToChan(span->red);
- color[GCOMP] = FixedToChan(span->green);
- color[BCOMP] = FixedToChan(span->blue);
- color[ACOMP] = FixedToChan(span->alpha);
- for (i = 0; i < n; i++) {
- COPY_CHAN4(span->array->rgba[i], color);
+ !(span->arrayMask & SPAN_RGBA));
+
+ switch (span->array->ChanType) {
+#if CHAN_BITS != 32
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ if (span->interpMask & SPAN_FLAT) {
+ GLubyte color[4];
+ color[RCOMP] = FixedToInt(span->red);
+ color[GCOMP] = FixedToInt(span->green);
+ color[BCOMP] = FixedToInt(span->blue);
+ color[ACOMP] = FixedToInt(span->alpha);
+ for (i = 0; i < n; i++) {
+ COPY_4UBV(rgba[i], color);
+ }
+ }
+ else {
+ GLfixed r = span->red;
+ GLfixed g = span->green;
+ GLfixed b = span->blue;
+ GLfixed a = span->alpha;
+ GLint dr = span->redStep;
+ GLint dg = span->greenStep;
+ GLint db = span->blueStep;
+ GLint da = span->alphaStep;
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = FixedToChan(r);
+ rgba[i][GCOMP] = FixedToChan(g);
+ rgba[i][BCOMP] = FixedToChan(b);
+ rgba[i][ACOMP] = FixedToChan(a);
+ r += dr;
+ g += dg;
+ b += db;
+ a += da;
+ }
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ if (span->interpMask & SPAN_FLAT) {
+ GLushort color[4];
+ color[RCOMP] = FixedToInt(span->red);
+ color[GCOMP] = FixedToInt(span->green);
+ color[BCOMP] = FixedToInt(span->blue);
+ color[ACOMP] = FixedToInt(span->alpha);
+ for (i = 0; i < n; i++) {
+ COPY_4V(rgba[i], color);
+ }
+ }
+ else {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ GLfixed r, g, b, a;
+ GLint dr, dg, db, da;
+ r = span->red;
+ g = span->green;
+ b = span->blue;
+ a = span->alpha;
+ dr = span->redStep;
+ dg = span->greenStep;
+ db = span->blueStep;
+ da = span->alphaStep;
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = FixedToChan(r);
+ rgba[i][GCOMP] = FixedToChan(g);
+ rgba[i][BCOMP] = FixedToChan(b);
+ rgba[i][ACOMP] = FixedToChan(a);
+ r += dr;
+ g += dg;
+ b += db;
+ a += da;
+ }
+ }
+ }
+ break;
+#endif
+ case GL_FLOAT:
+ {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ GLfloat r, g, b, a, dr, dg, db, da;
+ r = span->red;
+ g = span->green;
+ b = span->blue;
+ a = span->alpha;
+ if (span->interpMask & SPAN_FLAT) {
+ dr = dg = db = da = 0.0;
+ }
+ else {
+ dr = span->redStep;
+ dg = span->greenStep;
+ db = span->blueStep;
+ da = span->alphaStep;
+ }
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = r;
+ rgba[i][GCOMP] = g;
+ rgba[i][BCOMP] = b;
+ rgba[i][ACOMP] = a;
+ r += dr;
+ g += dg;
+ b += db;
+ a += da;
+ }
}
+ break;
+ default:
+ _mesa_problem(NULL, "bad datatype in interpolate_colors");
}
- else {
- /* interpolate */
-#if CHAN_TYPE == GL_FLOAT
- GLfloat r = span->red;
- GLfloat g = span->green;
- GLfloat b = span->blue;
- GLfloat a = span->alpha;
- const GLfloat dr = span->redStep;
- const GLfloat dg = span->greenStep;
- const GLfloat db = span->blueStep;
- const GLfloat da = span->alphaStep;
+ span->arrayMask |= SPAN_RGBA;
+}
+
+
+/**
+ * Interpolate specular/secondary colors.
+ */
+static INLINE void
+interpolate_specular(SWspan *span)
+{
+ const GLuint n = span->end;
+ GLuint i;
+
+ switch (span->array->ChanType) {
+#if CHAN_BITS != 32
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte (*spec)[4] = span->array->color.sz1.spec;
+ if (span->interpMask & SPAN_FLAT) {
+ GLubyte color[4];
+ color[RCOMP] = FixedToInt(span->specRed);
+ color[GCOMP] = FixedToInt(span->specGreen);
+ color[BCOMP] = FixedToInt(span->specBlue);
+ color[ACOMP] = 0;
+ for (i = 0; i < n; i++) {
+ COPY_4UBV(spec[i], color);
+ }
+ }
+ else {
+ GLfixed r = span->specRed;
+ GLfixed g = span->specGreen;
+ GLfixed b = span->specBlue;
+ GLint dr = span->specRedStep;
+ GLint dg = span->specGreenStep;
+ GLint db = span->specBlueStep;
+ for (i = 0; i < n; i++) {
+ spec[i][RCOMP] = CLAMP(FixedToChan(r), 0, 255);
+ spec[i][GCOMP] = CLAMP(FixedToChan(g), 0, 255);
+ spec[i][BCOMP] = CLAMP(FixedToChan(b), 0, 255);
+ spec[i][ACOMP] = 0;
+ r += dr;
+ g += dg;
+ b += db;
+ }
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLushort (*spec)[4] = span->array->color.sz2.spec;
+ if (span->interpMask & SPAN_FLAT) {
+ GLushort color[4];
+ color[RCOMP] = FixedToInt(span->specRed);
+ color[GCOMP] = FixedToInt(span->specGreen);
+ color[BCOMP] = FixedToInt(span->specBlue);
+ color[ACOMP] = 0;
+ for (i = 0; i < n; i++) {
+ COPY_4V(spec[i], color);
+ }
+ }
+ else {
+ GLfixed r = FloatToFixed(span->specRed);
+ GLfixed g = FloatToFixed(span->specGreen);
+ GLfixed b = FloatToFixed(span->specBlue);
+ GLint dr = FloatToFixed(span->specRedStep);
+ GLint dg = FloatToFixed(span->specGreenStep);
+ GLint db = FloatToFixed(span->specBlueStep);
+ for (i = 0; i < n; i++) {
+ spec[i][RCOMP] = FixedToInt(r);
+ spec[i][GCOMP] = FixedToInt(g);
+ spec[i][BCOMP] = FixedToInt(b);
+ spec[i][ACOMP] = 0;
+ r += dr;
+ g += dg;
+ b += db;
+ }
+ }
+ }
+ break;
+#endif
+ case GL_FLOAT:
+ {
+ GLfloat (*spec)[4] = span->array->color.sz4.spec;
+#if CHAN_BITS <= 16
+ GLfloat r = CHAN_TO_FLOAT(FixedToChan(span->specRed));
+ GLfloat g = CHAN_TO_FLOAT(FixedToChan(span->specGreen));
+ GLfloat b = CHAN_TO_FLOAT(FixedToChan(span->specBlue));
#else
- GLfixed r = span->red;
- GLfixed g = span->green;
- GLfixed b = span->blue;
- GLfixed a = span->alpha;
- const GLint dr = span->redStep;
- const GLint dg = span->greenStep;
- const GLint db = span->blueStep;
- const GLint da = span->alphaStep;
+ GLfloat r = span->specRed;
+ GLfloat g = span->specGreen;
+ GLfloat b = span->specBlue;
#endif
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = FixedToChan(r);
- rgba[i][GCOMP] = FixedToChan(g);
- rgba[i][BCOMP] = FixedToChan(b);
- rgba[i][ACOMP] = FixedToChan(a);
- r += dr;
- g += dg;
- b += db;
- a += da;
+ GLfloat dr, dg, db;
+ if (span->interpMask & SPAN_FLAT) {
+ dr = dg = db = 0.0;
+ }
+ else {
+#if CHAN_BITS <= 16
+ dr = CHAN_TO_FLOAT(FixedToChan(span->specRedStep));
+ dg = CHAN_TO_FLOAT(FixedToChan(span->specGreenStep));
+ db = CHAN_TO_FLOAT(FixedToChan(span->specBlueStep));
+#else
+ dr = span->specRedStep;
+ dg = span->specGreenStep;
+ db = span->specBlueStep;
+#endif
+ }
+ for (i = 0; i < n; i++) {
+ spec[i][RCOMP] = r;
+ spec[i][GCOMP] = g;
+ spec[i][BCOMP] = b;
+ spec[i][ACOMP] = 0.0F;
+ r += dr;
+ g += dg;
+ b += db;
+ }
}
+ break;
+ default:
+ _mesa_problem(NULL, "bad datatype in interpolate_specular");
}
- span->arrayMask |= SPAN_RGBA;
+ span->arrayMask |= SPAN_SPEC;
}
/* Fill in the span.color.index array from the interpolation values */
-static void
-interpolate_indexes(GLcontext *ctx, struct sw_span *span)
+static INLINE void
+interpolate_indexes(GLcontext *ctx, SWspan *span)
{
GLfixed index = span->index;
const GLint indexStep = span->indexStep;
@@ -240,51 +427,9 @@ interpolate_indexes(GLcontext *ctx, struct sw_span *span)
}
-/* Fill in the span.->array->spec array from the interpolation values */
-static void
-interpolate_specular(GLcontext *ctx, struct sw_span *span)
-{
- (void) ctx;
- if (span->interpMask & SPAN_FLAT) {
- /* constant color */
- const GLchan r = FixedToChan(span->specRed);
- const GLchan g = FixedToChan(span->specGreen);
- const GLchan b = FixedToChan(span->specBlue);
- GLuint i;
- for (i = 0; i < span->end; i++) {
- span->array->spec[i][RCOMP] = r;
- span->array->spec[i][GCOMP] = g;
- span->array->spec[i][BCOMP] = b;
- }
- }
- else {
- /* interpolate */
-#if CHAN_TYPE == GL_FLOAT
- GLfloat r = span->specRed;
- GLfloat g = span->specGreen;
- GLfloat b = span->specBlue;
-#else
- GLfixed r = span->specRed;
- GLfixed g = span->specGreen;
- GLfixed b = span->specBlue;
-#endif
- GLuint i;
- for (i = 0; i < span->end; i++) {
- span->array->spec[i][RCOMP] = FixedToChan(r);
- span->array->spec[i][GCOMP] = FixedToChan(g);
- span->array->spec[i][BCOMP] = FixedToChan(b);
- r += span->specRedStep;
- g += span->specGreenStep;
- b += span->specBlueStep;
- }
- }
- span->arrayMask |= SPAN_SPEC;
-}
-
-
/* Fill in the span.array.fog values from the interpolation values */
-static void
-interpolate_fog(const GLcontext *ctx, struct sw_span *span)
+static INLINE void
+interpolate_fog(const GLcontext *ctx, SWspan *span)
{
GLfloat *fog = span->array->fog;
const GLfloat fogStep = span->fogStep;
@@ -304,7 +449,7 @@ interpolate_fog(const GLcontext *ctx, struct sw_span *span)
/* Fill in the span.zArray array from the interpolation values */
void
-_swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span )
+_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span )
{
const GLuint n = span->end;
GLuint i;
@@ -392,7 +537,7 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
* or user-written code.
*/
static void
-interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
+interpolate_texcoords(GLcontext *ctx, SWspan *span)
{
ASSERT(span->interpMask & SPAN_TEXTURE);
ASSERT(!(span->arrayMask & SPAN_TEXTURE));
@@ -410,7 +555,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
- || ctx->FragmentProgram._Active;
+ || ctx->FragmentProgram._Enabled;
texW = img->WidthScale;
texH = img->HeightScale;
}
@@ -435,7 +580,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
GLfloat r = span->tex[u][2];
GLfloat q = span->tex[u][3];
GLuint i;
- if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+ if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
ctx->ShaderObjects._FragmentShaderPresent) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
@@ -487,7 +632,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
GLfloat r = span->tex[u][2];
GLfloat q = span->tex[u][3];
GLuint i;
- if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+ if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
ctx->ShaderObjects._FragmentShaderPresent) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
@@ -546,7 +691,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
- || ctx->FragmentProgram._Active;
+ || ctx->FragmentProgram._Enabled;
texW = (GLfloat) img->WidthScale;
texH = (GLfloat) img->HeightScale;
}
@@ -571,7 +716,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
GLfloat r = span->tex[0][2];
GLfloat q = span->tex[0][3];
GLuint i;
- if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+ if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
ctx->ShaderObjects._FragmentShaderPresent) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
@@ -623,7 +768,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
GLfloat r = span->tex[0][2];
GLfloat q = span->tex[0][3];
GLuint i;
- if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+ if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
ctx->ShaderObjects._FragmentShaderPresent) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
@@ -675,8 +820,8 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
/**
* Fill in the span.varying array from the interpolation values.
*/
-static void
-interpolate_varying(GLcontext *ctx, struct sw_span *span)
+static INLINE void
+interpolate_varying(GLcontext *ctx, SWspan *span)
{
GLuint i, j;
@@ -707,8 +852,8 @@ interpolate_varying(GLcontext *ctx, struct sw_span *span)
/**
* Apply the current polygon stipple pattern to a span of pixels.
*/
-static void
-stipple_polygon_span( GLcontext *ctx, struct sw_span *span )
+static INLINE void
+stipple_polygon_span( GLcontext *ctx, SWspan *span )
{
const GLuint highbit = 0x80000000;
const GLuint stipple = ctx->PolygonStipple[span->y % 32];
@@ -740,8 +885,8 @@ stipple_polygon_span( GLcontext *ctx, struct sw_span *span )
* Return: GL_TRUE some pixels still visible
* GL_FALSE nothing visible
*/
-static GLuint
-clip_span( GLcontext *ctx, struct sw_span *span )
+static INLINE GLuint
+clip_span( GLcontext *ctx, SWspan *span )
{
const GLint xmin = ctx->DrawBuffer->_Xmin;
const GLint xmax = ctx->DrawBuffer->_Xmax;
@@ -809,14 +954,11 @@ clip_span( GLcontext *ctx, struct sw_span *span )
* to their original values before returning.
*/
void
-_swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
+_swrast_write_index_span( GLcontext *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const struct gl_framebuffer *fb = ctx->DrawBuffer;
- const GLuint output = 0;
const GLbitfield origInterpMask = span->interpMask;
const GLbitfield origArrayMask = span->arrayMask;
- GLuint buf;
ASSERT(span->end <= MAX_WIDTH);
ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE ||
@@ -931,95 +1073,106 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
}
}
- /* Loop over drawing buffers */
- for (buf = 0; buf < fb->_NumColorDrawBuffers[output]; buf++) {
- struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][buf];
- GLuint indexTemp[MAX_WIDTH], *index32;
+ /*
+ * Write to renderbuffers
+ */
+ {
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ const GLuint output = 0; /* only frag progs can write to other outputs */
+ const GLuint numDrawBuffers = fb->_NumColorDrawBuffers[output];
+ GLuint indexSave[MAX_WIDTH];
+ GLuint buf;
- ASSERT(rb->_BaseFormat == GL_COLOR_INDEX);
+ if (numDrawBuffers > 1) {
+ /* save indexes for second, third renderbuffer writes */
+ _mesa_memcpy(indexSave, span->array->index,
+ span->end * sizeof(indexSave[0]));
+ }
- if (ctx->Color.IndexLogicOpEnabled ||
- ctx->Color.IndexMask != 0xffffffff) {
- /* make copy of incoming indexes */
- MEMCPY(indexTemp, span->array->index, span->end * sizeof(GLuint));
+ for (buf = 0; buf < fb->_NumColorDrawBuffers[output]; buf++) {
+ struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][buf];
+ ASSERT(rb->_BaseFormat == GL_COLOR_INDEX);
if (ctx->Color.IndexLogicOpEnabled) {
- _swrast_logicop_ci_span(ctx, rb, span, indexTemp);
+ _swrast_logicop_ci_span(ctx, rb, span);
}
if (ctx->Color.IndexMask != 0xffffffff) {
- _swrast_mask_ci_span(ctx, rb, span, indexTemp);
+ _swrast_mask_ci_span(ctx, rb, span);
}
- index32 = indexTemp;
- }
- else {
- index32 = span->array->index;
- }
- if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) {
- /* all fragments have same color index */
- GLubyte index8;
- GLushort index16;
- GLuint index32;
- void *value;
-
- if (rb->DataType == GL_UNSIGNED_BYTE) {
- index8 = FixedToInt(span->index);
- value = &index8;
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- index16 = FixedToInt(span->index);
- value = &index16;
- }
- else {
- ASSERT(rb->DataType == GL_UNSIGNED_INT);
- index32 = FixedToInt(span->index);
- value = &index32;
- }
+ if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) {
+ /* all fragments have same color index */
+ GLubyte index8;
+ GLushort index16;
+ GLuint index32;
+ void *value;
- if (span->arrayMask & SPAN_XY) {
- rb->PutMonoValues(ctx, rb, span->end, span->array->x,
- span->array->y, value, span->array->mask);
- }
- else {
- rb->PutMonoRow(ctx, rb, span->end, span->x, span->y,
- value, span->array->mask);
- }
- }
- else {
- /* each fragment is a different color */
- GLubyte index8[MAX_WIDTH];
- GLushort index16[MAX_WIDTH];
- void *values;
+ if (rb->DataType == GL_UNSIGNED_BYTE) {
+ index8 = FixedToInt(span->index);
+ value = &index8;
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ index16 = FixedToInt(span->index);
+ value = &index16;
+ }
+ else {
+ ASSERT(rb->DataType == GL_UNSIGNED_INT);
+ index32 = FixedToInt(span->index);
+ value = &index32;
+ }
- if (rb->DataType == GL_UNSIGNED_BYTE) {
- GLuint k;
- for (k = 0; k < span->end; k++) {
- index8[k] = (GLubyte) index32[k];
+ if (span->arrayMask & SPAN_XY) {
+ rb->PutMonoValues(ctx, rb, span->end, span->array->x,
+ span->array->y, value, span->array->mask);
}
- values = index8;
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- GLuint k;
- for (k = 0; k < span->end; k++) {
- index16[k] = (GLushort) index32[k];
+ else {
+ rb->PutMonoRow(ctx, rb, span->end, span->x, span->y,
+ value, span->array->mask);
}
- values = index16;
}
else {
- ASSERT(rb->DataType == GL_UNSIGNED_INT);
- values = index32;
- }
+ /* each fragment is a different color */
+ GLubyte index8[MAX_WIDTH];
+ GLushort index16[MAX_WIDTH];
+ void *values;
+
+ if (rb->DataType == GL_UNSIGNED_BYTE) {
+ GLuint k;
+ for (k = 0; k < span->end; k++) {
+ index8[k] = (GLubyte) span->array->index[k];
+ }
+ values = index8;
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ GLuint k;
+ for (k = 0; k < span->end; k++) {
+ index16[k] = (GLushort) span->array->index[k];
+ }
+ values = index16;
+ }
+ else {
+ ASSERT(rb->DataType == GL_UNSIGNED_INT);
+ values = span->array->index;
+ }
- if (span->arrayMask & SPAN_XY) {
- rb->PutValues(ctx, rb, span->end, span->array->x, span->array->y,
+ if (span->arrayMask & SPAN_XY) {
+ rb->PutValues(ctx, rb, span->end,
+ span->array->x, span->array->y,
+ values, span->array->mask);
+ }
+ else {
+ rb->PutRow(ctx, rb, span->end, span->x, span->y,
values, span->array->mask);
+ }
}
- else {
- rb->PutRow(ctx, rb, span->end, span->x, span->y,
- values, span->array->mask);
+
+ if (buf + 1 < numDrawBuffers) {
+ /* restore original span values */
+ _mesa_memcpy(span->array->index, indexSave,
+ span->end * sizeof(indexSave[0]));
}
- }
+ } /* for buf */
}
span->interpMask = origInterpMask;
@@ -1031,80 +1184,210 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
* Add specular color to base color. This is used only when
* GL_LIGHT_MODEL_COLOR_CONTROL = GL_SEPARATE_SPECULAR_COLOR.
*/
-static void
-add_colors(GLuint n, GLchan rgba[][4], GLchan specular[][4] )
+static INLINE void
+add_specular(GLcontext *ctx, SWspan *span)
+{
+ switch (span->array->ChanType) {
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ GLubyte (*spec)[4] = span->array->color.sz1.spec;
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ GLint r = rgba[i][RCOMP] + spec[i][RCOMP];
+ GLint g = rgba[i][GCOMP] + spec[i][GCOMP];
+ GLint b = rgba[i][BCOMP] + spec[i][BCOMP];
+ GLint a = rgba[i][ACOMP] + spec[i][ACOMP];
+ rgba[i][RCOMP] = MIN2(r, 255);
+ rgba[i][GCOMP] = MIN2(g, 255);
+ rgba[i][BCOMP] = MIN2(b, 255);
+ rgba[i][ACOMP] = MIN2(a, 255);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ GLushort (*spec)[4] = span->array->color.sz2.spec;
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ GLint r = rgba[i][RCOMP] + spec[i][RCOMP];
+ GLint g = rgba[i][GCOMP] + spec[i][GCOMP];
+ GLint b = rgba[i][BCOMP] + spec[i][BCOMP];
+ GLint a = rgba[i][ACOMP] + spec[i][ACOMP];
+ rgba[i][RCOMP] = MIN2(r, 65535);
+ rgba[i][GCOMP] = MIN2(g, 65535);
+ rgba[i][BCOMP] = MIN2(b, 65535);
+ rgba[i][ACOMP] = MIN2(a, 65535);
+ }
+ }
+ break;
+ case GL_FLOAT:
+ {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ GLfloat (*spec)[4] = span->array->color.sz4.spec;
+ GLuint i;
+ for (i = 0; i < span->end; i++) {
+ rgba[i][RCOMP] += spec[i][RCOMP];
+ rgba[i][GCOMP] += spec[i][GCOMP];
+ rgba[i][BCOMP] += spec[i][BCOMP];
+ rgba[i][ACOMP] += spec[i][ACOMP];
+ }
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Invalid datatype in add_specular");
+ }
+}
+
+
+/**
+ * Apply antialiasing coverage value to alpha values.
+ */
+static INLINE void
+apply_aa_coverage(SWspan *span)
{
+ const GLfloat *coverage = span->array->coverage;
GLuint i;
- for (i = 0; i < n; i++) {
-#if CHAN_TYPE == GL_FLOAT
- /* no clamping */
- rgba[i][RCOMP] += specular[i][RCOMP];
- rgba[i][GCOMP] += specular[i][GCOMP];
- rgba[i][BCOMP] += specular[i][BCOMP];
-#else
- GLint r = rgba[i][RCOMP] + specular[i][RCOMP];
- GLint g = rgba[i][GCOMP] + specular[i][GCOMP];
- GLint b = rgba[i][BCOMP] + specular[i][BCOMP];
- rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX);
- rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX);
- rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX);
-#endif
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->color.sz1.rgba;
+ for (i = 0; i < span->end; i++) {
+ const GLfloat a = rgba[i][ACOMP] * coverage[i];
+ rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0, 255.0);
+ ASSERT(coverage[i] >= 0.0);
+ ASSERT(coverage[i] <= 1.0);
+ }
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->color.sz2.rgba;
+ for (i = 0; i < span->end; i++) {
+ const GLfloat a = rgba[i][ACOMP] * coverage[i];
+ rgba[i][ACOMP] = (GLushort) CLAMP(a, 0.0, 65535.0);
+ }
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
+ for (i = 0; i < span->end; i++) {
+ rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i];
+ }
}
}
/**
- * XXX merge this code into the _swrast_write_rgba_span() routine!
- *
- * Draw to more than one RGBA color buffer (or none).
- * All fragment operations, up to (but not) blending/logicop should
- * have been done first.
+ * Clamp span's float colors to [0,1]
*/
-static void
-multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
+static INLINE void
+clamp_colors(SWspan *span)
{
- const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- const GLuint output = 0;
+ GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
GLuint i;
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ for (i = 0; i < span->end; i++) {
+ rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F);
+ rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F);
+ rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F);
+ rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F);
+ }
+}
+
+
+/**
+ * Convert the span's color arrays to the given type.
+ */
+static INLINE void
+convert_color_type(GLcontext *ctx, SWspan *span, GLenum newType)
+{
+ GLvoid *src, *dst;
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ src = span->array->color.sz1.rgba;
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ src = span->array->color.sz2.rgba;
+ }
+ else {
+ src = span->array->color.sz4.rgba;
+ }
+ if (newType == GL_UNSIGNED_BYTE) {
+ dst = span->array->color.sz1.rgba;
+ }
+ else if (newType == GL_UNSIGNED_BYTE) {
+ dst = span->array->color.sz2.rgba;
+ }
+ else {
+ dst = span->array->color.sz4.rgba;
+ }
- ASSERT(span->end < MAX_WIDTH);
- ASSERT(colorMask != 0x0);
+ _mesa_convert_colors(span->array->ChanType, src,
+ newType, dst,
+ span->end, span->array->mask);
- for (i = 0; i < fb->_NumColorDrawBuffers[output]; i++) {
- struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][i];
- GLchan rgbaTmp[MAX_WIDTH][4];
+ span->array->ChanType = newType;
+}
- /* make copy of incoming colors */
- MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) );
- if (ctx->Color._LogicOpEnabled) {
- _swrast_logicop_rgba_span(ctx, rb, span, rgbaTmp);
- }
- else if (ctx->Color.BlendEnabled) {
- _swrast_blend_span(ctx, rb, span, rgbaTmp);
- }
- if (colorMask != 0xffffffff) {
- _swrast_mask_rgba_span(ctx, rb, span, rgbaTmp);
+/**
+ * Apply fragment shader, fragment program or normal texturing to span.
+ */
+static INLINE void
+shade_texture_span(GLcontext *ctx, SWspan *span)
+{
+ /* Now we need the rgba array, fill it in if needed */
+ if (span->interpMask & SPAN_RGBA)
+ interpolate_colors(span);
+
+ if (ctx->Texture._EnabledCoordUnits && (span->interpMask & SPAN_TEXTURE))
+ interpolate_texcoords(ctx, span);
+
+ if (ctx->ShaderObjects._FragmentShaderPresent ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->ATIFragmentShader._Enabled) {
+
+ /* use float colors if running a fragment program or shader */
+ const GLenum oldType = span->array->ChanType;
+ const GLenum newType = GL_FLOAT;
+ if (oldType != newType) {
+ GLvoid *src = (oldType == GL_UNSIGNED_BYTE)
+ ? (GLvoid *) span->array->color.sz1.rgba
+ : (GLvoid *) span->array->color.sz2.rgba;
+ _mesa_convert_colors(oldType, src,
+ newType, span->array->color.sz4.rgba,
+ span->end, span->array->mask);
+ span->array->ChanType = newType;
}
- if (span->arrayMask & SPAN_XY) {
- /* array of pixel coords */
- ASSERT(rb->PutValues);
- rb->PutValues(ctx, rb, span->end, span->array->x,
- span->array->y, rgbaTmp, span->array->mask);
+ /* fragment programs/shaders may need specular, fog and Z coords */
+ if (span->interpMask & SPAN_SPEC)
+ interpolate_specular(span);
+
+ if (span->interpMask & SPAN_FOG)
+ interpolate_fog(ctx, span);
+
+ if (span->interpMask & SPAN_Z)
+ _swrast_span_interpolate_z (ctx, span);
+
+ /* Run fragment program/shader now */
+ if (ctx->ShaderObjects._FragmentShaderPresent) {
+ interpolate_varying(ctx, span);
+ _swrast_exec_arbshader(ctx, span);
+ }
+ else if (ctx->FragmentProgram._Enabled) {
+ _swrast_exec_fragment_program(ctx, span);
}
else {
- /* horizontal run of pixels */
- ASSERT(rb->PutRow);
- rb->PutRow(ctx, rb, span->end, span->x, span->y, rgbaTmp,
- span->array->mask);
+ ASSERT(ctx->ATIFragmentShader._Enabled);
+ _swrast_exec_fragment_shader(ctx, span);
}
}
+ else if (ctx->Texture._EnabledUnits && (span->arrayMask & SPAN_TEXTURE)) {
+ /* conventional texturing */
+ _swrast_texture_span(ctx, span);
+ }
}
+
/**
* Apply all the per-fragment operations to a span.
* This now includes texturing (_swrast_write_texture_span() is history).
@@ -1113,26 +1396,64 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
* to their original values before returning.
*/
void
-_swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
+_swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
{
+ const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLbitfield origInterpMask = span->interpMask;
const GLbitfield origArrayMask = span->arrayMask;
- const GLboolean deferredTexture = !(ctx->Color.AlphaEnabled ||
- ctx->FragmentProgram._Active ||
- ctx->ShaderObjects._FragmentShaderPresent);
-
- ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE ||
- span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);
- ASSERT(span->end <= MAX_WIDTH);
- ASSERT((span->interpMask & span->arrayMask) == 0);
+ const GLenum chanType = span->array->ChanType;
+ const GLboolean shader
+ = ctx->FragmentProgram._Enabled
+ || ctx->ShaderObjects._FragmentShaderPresent
+ || ctx->ATIFragmentShader._Enabled;
+ const GLboolean shaderOrTexture = shader || ctx->Texture._EnabledUnits;
+ GLboolean deferredTexture;
/*
printf("%s() interp 0x%x array 0x%x\n", __FUNCTION__,
span->interpMask, span->arrayMask);
*/
+ ASSERT(span->primitive == GL_POINT ||
+ span->primitive == GL_LINE ||
+ span->primitive == GL_POLYGON ||
+ span->primitive == GL_BITMAP);
+ ASSERT(span->end <= MAX_WIDTH);
+ ASSERT((span->interpMask & span->arrayMask) == 0);
+ ASSERT((span->interpMask & SPAN_RGBA) ^ (span->arrayMask & SPAN_RGBA));
+
+ /* check for conditions that prevent deferred shading */
+ if (ctx->Color.AlphaEnabled) {
+ /* alpha test depends on post-texture/shader colors */
+ deferredTexture = GL_FALSE;
+ }
+ else if (shaderOrTexture) {
+ if (ctx->FragmentProgram._Enabled) {
+ if (ctx->FragmentProgram.Current->Base.OutputsWritten
+ & (1 << FRAG_RESULT_DEPR)) {
+ /* Z comes from fragment program */
+ deferredTexture = GL_FALSE;
+ }
+ else {
+ deferredTexture = GL_TRUE;
+ }
+ }
+ else if (ctx->ShaderObjects._FragmentShaderPresent) {
+ /* XXX how do we test if Z is written by shader? */
+ deferredTexture = GL_FALSE; /* never defer to be safe */
+ }
+ else {
+ /* ATI frag shader or conventional texturing */
+ deferredTexture = GL_TRUE;
+ }
+ }
+ else {
+ /* no texturing or shadering */
+ deferredTexture = GL_FALSE;
+ }
+
+ /* Fragment write masks */
if (span->arrayMask & SPAN_MASK) {
/* mask was initialized by caller, probably glBitmap */
span->writeAll = GL_FALSE;
@@ -1169,59 +1490,19 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
stipple_polygon_span(ctx, span);
}
- /* Interpolate texcoords? */
- if (ctx->Texture._EnabledCoordUnits
- && (span->interpMask & SPAN_TEXTURE)
- && (span->arrayMask & SPAN_TEXTURE) == 0) {
- interpolate_texcoords(ctx, span);
- }
-
- if (ctx->ShaderObjects._FragmentShaderPresent) {
- interpolate_varying(ctx, span);
- }
-
/* This is the normal place to compute the resulting fragment color/Z.
* As an optimization, we try to defer this until after Z/stencil
* testing in order to try to avoid computing colors that we won't
* actually need.
*/
- if (!deferredTexture) {
- /* Now we need the rgba array, fill it in if needed */
- if ((span->interpMask & SPAN_RGBA) && (span->arrayMask & SPAN_RGBA) == 0)
- interpolate_colors(ctx, span);
-
- if (span->interpMask & SPAN_SPEC)
- interpolate_specular(ctx, span);
-
- if (span->interpMask & SPAN_FOG)
- interpolate_fog(ctx, span);
+ if (shaderOrTexture && !deferredTexture) {
+ shade_texture_span(ctx, span);
+ }
- /* Compute fragment colors with fragment program or texture lookups */
-#if FEATURE_ARB_fragment_shader
- if (ctx->ShaderObjects._FragmentShaderPresent) {
- if (span->interpMask & SPAN_Z)
- _swrast_span_interpolate_z (ctx, span);
- _swrast_exec_arbshader (ctx, span);
- }
- else
-#endif
- if (ctx->FragmentProgram._Active) {
- /* frag prog may need Z values */
- if (span->interpMask & SPAN_Z)
- _swrast_span_interpolate_z(ctx, span);
- _swrast_exec_fragment_program( ctx, span );
- }
- else if (ctx->ATIFragmentShader._Enabled)
- _swrast_exec_fragment_shader( ctx, span );
- else if (ctx->Texture._EnabledUnits && (span->arrayMask & SPAN_TEXTURE))
- _swrast_texture_span( ctx, span );
-
- /* Do the alpha test */
- if (ctx->Color.AlphaEnabled) {
- if (!_swrast_alpha_test(ctx, span)) {
- span->arrayMask = origArrayMask;
- return;
- }
+ /* Do the alpha test */
+ if (ctx->Color.AlphaEnabled) {
+ if (!_swrast_alpha_test(ctx, span)) {
+ goto end;
}
}
@@ -1233,9 +1514,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) {
/* Combined Z/stencil tests */
if (!_swrast_stencil_and_ztest_span(ctx, span)) {
- span->interpMask = origInterpMask;
- span->arrayMask = origArrayMask;
- return;
+ goto end;
}
}
else if (ctx->DrawBuffer->Visual.depthBits > 0) {
@@ -1243,9 +1522,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
ASSERT(ctx->Depth.Test);
ASSERT(span->arrayMask & SPAN_Z);
if (!_swrast_depth_test_span(ctx, span)) {
- span->interpMask = origInterpMask;
- span->arrayMask = origArrayMask;
- return;
+ goto end;
}
}
}
@@ -1264,9 +1541,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
* the occlusion test.
*/
if (colorMask == 0x0) {
- span->interpMask = origInterpMask;
- span->arrayMask = origArrayMask;
- return;
+ goto end;
}
/* If we were able to defer fragment color computation to now, there's
@@ -1274,44 +1549,26 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
* Z/stencil testing.
*/
if (deferredTexture) {
- /* Now we need the rgba array, fill it in if needed */
- if ((span->interpMask & SPAN_RGBA) && (span->arrayMask & SPAN_RGBA) == 0)
- interpolate_colors(ctx, span);
-
- if (span->interpMask & SPAN_SPEC)
- interpolate_specular(ctx, span);
-
- if (span->interpMask & SPAN_FOG)
- interpolate_fog(ctx, span);
+ ASSERT(shaderOrTexture);
+ shade_texture_span(ctx, span);
+ }
-#if FEATURE_ARB_fragment_shader
- if (ctx->ShaderObjects._FragmentShaderPresent) {
- if (span->interpMask & SPAN_Z)
- _swrast_span_interpolate_z (ctx, span);
- _swrast_exec_arbshader (ctx, span);
- }
- else
-#endif
- if (ctx->FragmentProgram._Active)
- _swrast_exec_fragment_program( ctx, span );
- else if (ctx->ATIFragmentShader._Enabled)
- _swrast_exec_fragment_shader( ctx, span );
- else if (ctx->Texture._EnabledUnits && (span->arrayMask & SPAN_TEXTURE))
- _swrast_texture_span( ctx, span );
+ if ((span->arrayMask & SPAN_RGBA) == 0) {
+ interpolate_colors(span);
}
ASSERT(span->arrayMask & SPAN_RGBA);
- if (!ctx->FragmentProgram._Enabled) {
+ if (!shader) {
/* Add base and specular colors */
if (ctx->Fog.ColorSumEnabled ||
(ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
if (span->interpMask & SPAN_SPEC) {
- interpolate_specular(ctx, span);
+ interpolate_specular(span);
}
if (span->arrayMask & SPAN_SPEC) {
- add_colors( span->end, span->array->rgba, span->array->spec );
+ add_specular(ctx, span);
}
else {
/* We probably added the base/specular colors during the
@@ -1328,80 +1585,95 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
/* Antialias coverage application */
if (span->arrayMask & SPAN_COVERAGE) {
- GLchan (*rgba)[4] = span->array->rgba;
- GLfloat *coverage = span->array->coverage;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- rgba[i][ACOMP] = (GLchan) (rgba[i][ACOMP] * coverage[i]);
- }
+ apply_aa_coverage(span);
}
/* Clamp color/alpha values over the range [0.0, 1.0] before storage */
-#if CHAN_TYPE == GL_FLOAT
- if (ctx->Color.ClampFragmentColor) {
- GLchan (*rgba)[4] = span->array->rgba;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0, CHAN_MAXF);
- rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0, CHAN_MAXF);
- rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0, CHAN_MAXF);
- rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0, CHAN_MAXF);
- }
+ if (ctx->Color.ClampFragmentColor == GL_TRUE &&
+ span->array->ChanType == GL_FLOAT) {
+ clamp_colors(span);
}
-#endif
- if (swrast->_RasterMask & MULTI_DRAW_BIT) {
- /* need to do blend/logicop separately for each color buffer */
- multi_write_rgba_span(ctx, span);
- }
- else {
- /* normal: write to exactly one buffer */
- struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
-
- if (ctx->Color._LogicOpEnabled) {
- _swrast_logicop_rgba_span(ctx, rb, span, span->array->rgba);
- }
- else if (ctx->Color.BlendEnabled) {
- _swrast_blend_span(ctx, rb, span, span->array->rgba);
+ /*
+ * Write to renderbuffers
+ */
+ {
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ const GLuint output = 0; /* only frag progs can write to other outputs */
+ const GLuint numDrawBuffers = fb->_NumColorDrawBuffers[output];
+ GLchan rgbaSave[MAX_WIDTH][4];
+ GLuint buf;
+
+ if (numDrawBuffers > 0) {
+ if (fb->_ColorDrawBuffers[output][0]->DataType
+ != span->array->ChanType) {
+ convert_color_type(ctx, span,
+ fb->_ColorDrawBuffers[output][0]->DataType);
+ }
}
- /* Color component masking */
- if (colorMask != 0xffffffff) {
- _swrast_mask_rgba_span(ctx, rb, span, span->array->rgba);
+ if (numDrawBuffers > 1) {
+ /* save colors for second, third renderbuffer writes */
+ _mesa_memcpy(rgbaSave, span->array->rgba,
+ 4 * span->end * sizeof(GLchan));
}
- /* Finally, write the pixels to a color buffer */
- if (span->arrayMask & SPAN_XY) {
- /* array of pixel coords */
- ASSERT(rb->PutValues);
- ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA);
- /* XXX check datatype */
- rb->PutValues(ctx, rb, span->end, span->array->x, span->array->y,
- span->array->rgba, span->array->mask);
- }
- else {
- /* horizontal run of pixels */
- ASSERT(rb->PutRow);
- ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA);
- /* XXX check datatype */
- rb->PutRow(ctx, rb, span->end, span->x, span->y, span->array->rgba,
- span->writeAll ? NULL : span->array->mask);
- }
+ for (buf = 0; buf < numDrawBuffers; buf++) {
+ struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][buf];
+ ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB);
+
+ if (ctx->Color._LogicOpEnabled) {
+ _swrast_logicop_rgba_span(ctx, rb, span);
+ }
+ else if (ctx->Color.BlendEnabled) {
+ _swrast_blend_span(ctx, rb, span);
+ }
+
+ if (colorMask != 0xffffffff) {
+ _swrast_mask_rgba_span(ctx, rb, span);
+ }
+
+ if (span->arrayMask & SPAN_XY) {
+ /* array of pixel coords */
+ ASSERT(rb->PutValues);
+ rb->PutValues(ctx, rb, span->end,
+ span->array->x, span->array->y,
+ span->array->rgba, span->array->mask);
+ }
+ else {
+ /* horizontal run of pixels */
+ ASSERT(rb->PutRow);
+ rb->PutRow(ctx, rb, span->end, span->x, span->y, span->array->rgba,
+ span->writeAll ? NULL: span->array->mask);
+ }
+
+ if (buf + 1 < numDrawBuffers) {
+ /* restore original span values */
+ _mesa_memcpy(span->array->rgba, rgbaSave,
+ 4 * span->end * sizeof(GLchan));
+ }
+ } /* for buf */
+
}
+end:
+ /* restore these values before returning */
span->interpMask = origInterpMask;
span->arrayMask = origArrayMask;
+ span->array->ChanType = chanType;
}
-
/**
* Read RGBA pixels from frame buffer. Clipping will be done to prevent
* reading ouside the buffer's boundaries.
+ * \param type datatype for returned colors
+ * \param rgba the returned colors
*/
void
_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLchan rgba[][4] )
+ GLuint n, GLint x, GLint y, GLenum dstType,
+ GLvoid *rgba)
{
const GLint bufWidth = (GLint) rb->Width;
const GLint bufHeight = (GLint) rb->Height;
@@ -1443,8 +1715,18 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
ASSERT(rb);
ASSERT(rb->GetRow);
ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA);
- ASSERT(rb->DataType == CHAN_TYPE);
- rb->GetRow(ctx, rb, length, x + skip, y, rgba + skip);
+
+ if (rb->DataType == dstType) {
+ rb->GetRow(ctx, rb, length, x + skip, y,
+ (GLubyte *) rgba + skip * RGBA_PIXEL_SIZE(rb->DataType));
+ }
+ else {
+ GLuint temp[MAX_WIDTH * 4];
+ rb->GetRow(ctx, rb, length, x + skip, y, temp);
+ _mesa_convert_colors(rb->DataType, temp,
+ dstType, (GLubyte *) rgba + skip * RGBA_PIXEL_SIZE(dstType),
+ length, NULL);
+ }
}
}
@@ -1521,7 +1803,7 @@ _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb,
* Wrapper for gl_renderbuffer::GetValues() which does clipping to avoid
* reading values outside the buffer bounds.
* We can use this for reading any format/type of renderbuffer.
- * \param valueSize is the size in bytes of each value put into the
+ * \param valueSize is the size in bytes of each value (pixel) put into the
* values array.
*/
void
@@ -1557,6 +1839,7 @@ _swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb,
/**
* Wrapper for gl_renderbuffer::PutRow() which does clipping.
+ * \param valueSize size of each value (pixel) in bytes
*/
void
_swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb,
@@ -1591,6 +1874,7 @@ _swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb,
/**
* Wrapper for gl_renderbuffer::GetRow() which does clipping.
+ * \param valueSize size of each value (pixel) in bytes
*/
void
_swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
@@ -1620,3 +1904,45 @@ _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->GetRow(ctx, rb, count, x, y, (GLubyte *) values + skip * valueSize);
}
+
+
+/**
+ * Get RGBA pixels from the given renderbuffer. Put the pixel colors into
+ * the span's specular color arrays. The specular color arrays should no
+ * longer be needed by time this function is called.
+ * Used by blending, logicop and masking functions.
+ * \return pointer to the colors we read.
+ */
+void *
+_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
+ SWspan *span)
+{
+ const GLuint pixelSize = RGBA_PIXEL_SIZE(span->array->ChanType);
+ void *rbPixels;
+
+ /*
+ * Determine pixel size (in bytes).
+ * Point rbPixels to a temporary space (use specular color arrays).
+ */
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ rbPixels = span->array->color.sz1.spec;
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ rbPixels = span->array->color.sz2.spec;
+ }
+ else {
+ rbPixels = span->array->color.sz4.spec;
+ }
+
+ /* Get destination values from renderbuffer */
+ if (span->arrayMask & SPAN_XY) {
+ _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y,
+ rbPixels, pixelSize);
+ }
+ else {
+ _swrast_get_row(ctx, rb, span->end, span->x, span->y,
+ rbPixels, pixelSize);
+ }
+
+ return rbPixels;
+}
diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h
index 40a57e1ae53..c441106abae 100644
--- a/src/mesa/swrast/s_span.h
+++ b/src/mesa/swrast/s_span.h
@@ -32,19 +32,19 @@
extern void
-_swrast_span_default_z( GLcontext *ctx, struct sw_span *span );
+_swrast_span_default_z( GLcontext *ctx, SWspan *span );
extern void
-_swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span );
+_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span );
extern void
-_swrast_span_default_fog( GLcontext *ctx, struct sw_span *span );
+_swrast_span_default_fog( GLcontext *ctx, SWspan *span );
extern void
-_swrast_span_default_color( GLcontext *ctx, struct sw_span *span );
+_swrast_span_default_color( GLcontext *ctx, SWspan *span );
extern void
-_swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span );
+_swrast_span_default_texcoords( GLcontext *ctx, SWspan *span );
extern GLfloat
_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
@@ -52,16 +52,16 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
GLfloat s, GLfloat t, GLfloat q, GLfloat invQ);
extern void
-_swrast_write_index_span( GLcontext *ctx, struct sw_span *span);
+_swrast_write_index_span( GLcontext *ctx, SWspan *span);
extern void
-_swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span);
+_swrast_write_rgba_span( GLcontext *ctx, SWspan *span);
extern void
-_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLchan rgba[][4] );
+_swrast_read_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba);
extern void
_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb,
@@ -82,4 +82,9 @@ _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
GLvoid *values, GLuint valueSize);
+
+extern void *
+_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
+ SWspan *span);
+
#endif
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 1c78f848e13..dbab6b3c20b 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -406,7 +406,7 @@ do_stencil_test( GLcontext *ctx, GLuint face, GLuint n, GLstencil stencil[],
*
*/
static GLboolean
-stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face)
+stencil_and_ztest_span(GLcontext *ctx, SWspan *span, GLuint face)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_StencilBuffer;
@@ -900,7 +900,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n,
* GL_TRUE - one or more fragments passed the testing
*/
static GLboolean
-stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face )
+stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_StencilBuffer;
@@ -1007,7 +1007,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face )
* GL_FALSE = all fragments failed.
*/
GLboolean
-_swrast_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span)
+_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span)
{
/* span->facing can only be non-zero if using two-sided stencil */
ASSERT(ctx->Stencil._TestTwoSide || span->facing == 0);
diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h
index fabc25250da..1fcb538fecf 100644
--- a/src/mesa/swrast/s_stencil.h
+++ b/src/mesa/swrast/s_stencil.h
@@ -33,7 +33,7 @@
extern GLboolean
-_swrast_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span);
+_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span);
extern void
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index ac26c9cebb2..2a3455f35e2 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -1073,7 +1073,7 @@ texture_apply( const GLcontext *ctx,
* Apply texture mapping to a span of fragments.
*/
void
-_swrast_texture_span( GLcontext *ctx, struct sw_span *span )
+_swrast_texture_span( GLcontext *ctx, SWspan *span )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan primary_rgba[MAX_WIDTH][4];
@@ -1132,7 +1132,13 @@ _swrast_texture_span( GLcontext *ctx, struct sw_span *span )
/* GL_SGI_texture_color_table */
if (texUnit->ColorTableEnabled) {
- _mesa_lookup_rgba_chan(&texUnit->ColorTable, span->end, texels);
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels);
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels);
+#else
+ _mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels);
+#endif
}
}
}
diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h
index eca967c5404..3bf70e0b86e 100644
--- a/src/mesa/swrast/s_texcombine.h
+++ b/src/mesa/swrast/s_texcombine.h
@@ -31,6 +31,6 @@
#include "swrast.h"
extern void
-_swrast_texture_span( GLcontext *ctx, struct sw_span *span );
+_swrast_texture_span( GLcontext *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 629b4ec1369..f55e23422d4 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -590,13 +590,13 @@ compute_min_mag_ranges(const struct gl_texture_object *tObj,
}
#endif /* DEBUG */
- if (lambda[0] <= minMagThresh && lambda[n-1] <= minMagThresh) {
+ if (lambda[0] <= minMagThresh && (n <= 1 || lambda[n-1] <= minMagThresh)) {
/* magnification for whole span */
*magStart = 0;
*magEnd = n;
*minStart = *minEnd = 0;
}
- else if (lambda[0] > minMagThresh && lambda[n-1] > minMagThresh) {
+ else if (lambda[0] > minMagThresh && (n <=1 || lambda[n-1] > minMagThresh)) {
/* minification for whole span */
*minStart = 0;
*minEnd = n;
diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c
index e9f4faeed00..3f49b40d9c1 100644
--- a/src/mesa/swrast/s_texstore.c
+++ b/src/mesa/swrast/s_texstore.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -43,6 +43,7 @@
#include "convolve.h"
#include "image.h"
#include "macros.h"
+#include "mipmap.h"
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
@@ -51,33 +52,37 @@
#include "s_depth.h"
#include "s_span.h"
-/*
+
+/**
* Read an RGBA image from the frame buffer.
* This is used by glCopyTex[Sub]Image[12]D().
- * Input: ctx - the context
- * x, y - lower left corner
- * width, height - size of region to read
- * Return: pointer to block of GL_RGBA, GLchan data.
+ * \param x window source x
+ * \param y window source y
+ * \param width image width
+ * \param height image height
+ * \param type datatype for returned GL_RGBA image
+ * \return pointer to image
*/
-static GLchan *
-read_color_image( GLcontext *ctx, GLint x, GLint y,
+static GLvoid *
+read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type,
GLsizei width, GLsizei height )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLint stride = 4 * width;
- GLint i;
- GLchan *image, *dst;
+ struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
+ const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type);
+ const GLint stride = width * pixelSize;
+ GLint row;
+ GLubyte *image, *dst;
- image = (GLchan *) _mesa_malloc(width * height * 4 * sizeof(GLchan));
+ image = (GLubyte *) _mesa_malloc(width * height * pixelSize);
if (!image)
return NULL;
RENDER_START(swrast, ctx);
dst = image;
- for (i = 0; i < height; i++) {
- _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, x, y + i, (GLchan (*)[4]) dst);
+ for (row = 0; row < height; row++) {
+ _swrast_read_rgba_span(ctx, rb, width, x, y + row, type, dst);
dst += stride;
}
@@ -249,7 +254,7 @@ _swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
ASSERT(texImage);
ASSERT(ctx->Driver.TexImage1D);
@@ -284,15 +289,16 @@ _swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level,
}
else {
/* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, 1);
+ const GLenum format = GL_RGBA;
+ const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType;
+ GLvoid *image = read_color_image(ctx, x, y, type, width, 1);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D");
return;
}
/* call glTexImage1D to redefine the texture */
ctx->Driver.TexImage1D(ctx, target, level, internalFormat,
- width, border,
- GL_RGBA, CHAN_TYPE, image,
+ width, border, format, type, image,
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
@@ -325,7 +331,7 @@ _swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
ASSERT(texImage);
ASSERT(ctx->Driver.TexImage2D);
@@ -359,15 +365,16 @@ _swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level,
}
else {
/* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
+ const GLenum format = GL_RGBA;
+ const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType;
+ GLvoid *image = read_color_image(ctx, x, y, type, width, height);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D");
return;
}
/* call glTexImage2D to redefine the texture */
ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
- width, height, border,
- GL_RGBA, CHAN_TYPE, image,
+ width, height, border, format, type, image,
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
@@ -393,7 +400,7 @@ _swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
ASSERT(texImage);
ASSERT(ctx->Driver.TexImage1D);
@@ -427,14 +434,16 @@ _swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level,
}
else {
/* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, 1);
+ const GLenum format = GL_RGBA;
+ const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType;
+ GLvoid *image = read_color_image(ctx, x, y, type, width, 1);
if (!image) {
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" );
return;
}
/* now call glTexSubImage1D to do the real work */
ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width,
- GL_RGBA, CHAN_TYPE, image,
+ format, type, image,
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
@@ -465,7 +474,7 @@ _swrast_copy_texsubimage2d( GLcontext *ctx,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
ASSERT(texImage);
ASSERT(ctx->Driver.TexImage2D);
@@ -500,7 +509,9 @@ _swrast_copy_texsubimage2d( GLcontext *ctx,
}
else {
/* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
+ const GLenum format = GL_RGBA;
+ const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType;
+ GLvoid *image = read_color_image(ctx, x, y, type, width, height);
if (!image) {
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" );
return;
@@ -508,7 +519,7 @@ _swrast_copy_texsubimage2d( GLcontext *ctx,
/* now call glTexSubImage2D to do the real work */
ctx->Driver.TexSubImage2D(ctx, target, level,
xoffset, yoffset, width, height,
- GL_RGBA, CHAN_TYPE, image,
+ format, type, image,
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
@@ -536,7 +547,7 @@ _swrast_copy_texsubimage3d( GLcontext *ctx,
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
ASSERT(texImage);
ASSERT(ctx->Driver.TexImage3D);
@@ -571,7 +582,9 @@ _swrast_copy_texsubimage3d( GLcontext *ctx,
}
else {
/* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
+ const GLenum format = GL_RGBA;
+ const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType;
+ GLvoid *image = read_color_image(ctx, x, y, type, width, height);
if (!image) {
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" );
return;
@@ -579,7 +592,7 @@ _swrast_copy_texsubimage3d( GLcontext *ctx,
/* now call glTexSubImage3D to do the real work */
ctx->Driver.TexSubImage3D(ctx, target, level,
xoffset, yoffset, zoffset, width, height, 1,
- GL_RGBA, CHAN_TYPE, image,
+ format, type, image,
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index a1cbd881a73..b17c4354605 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -163,6 +163,7 @@ _swrast_culltriangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
+ GLchan rgb[MAX_WIDTH][3]; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
span.intTex[1] -= FIXED_HALF; \
for (i = 0; i < span.end; i++) { \
@@ -170,13 +171,13 @@ _swrast_culltriangle( GLcontext *ctx,
GLint t = FixedToInt(span.intTex[1]) & tmask; \
GLint pos = (t << twidth_log2) + s; \
pos = pos + pos + pos; /* multiply by 3 */ \
- span.array->rgb[i][RCOMP] = texture[pos]; \
- span.array->rgb[i][GCOMP] = texture[pos+1]; \
- span.array->rgb[i][BCOMP] = texture[pos+2]; \
+ rgb[i][RCOMP] = texture[pos]; \
+ rgb[i][GCOMP] = texture[pos+1]; \
+ rgb[i][BCOMP] = texture[pos+2]; \
span.intTex[0] += span.intTexStep[0]; \
span.intTex[1] += span.intTexStep[1]; \
} \
- rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, span.array->rgb, NULL);
+ rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, NULL);
#include "s_tritemp.h"
@@ -214,6 +215,7 @@ _swrast_culltriangle( GLcontext *ctx,
#define RENDER_SPAN( span ) \
GLuint i; \
+ GLchan rgb[MAX_WIDTH][3]; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
span.intTex[1] -= FIXED_HALF; \
for (i = 0; i < span.end; i++) { \
@@ -223,9 +225,9 @@ _swrast_culltriangle( GLcontext *ctx,
GLint t = FixedToInt(span.intTex[1]) & tmask; \
GLint pos = (t << twidth_log2) + s; \
pos = pos + pos + pos; /* multiply by 3 */ \
- span.array->rgb[i][RCOMP] = texture[pos]; \
- span.array->rgb[i][GCOMP] = texture[pos+1]; \
- span.array->rgb[i][BCOMP] = texture[pos+2]; \
+ rgb[i][RCOMP] = texture[pos]; \
+ rgb[i][GCOMP] = texture[pos+1]; \
+ rgb[i][BCOMP] = texture[pos+2]; \
zRow[i] = z; \
span.array->mask[i] = 1; \
} \
@@ -236,8 +238,7 @@ _swrast_culltriangle( GLcontext *ctx,
span.intTex[1] += span.intTexStep[1]; \
span.z += span.zStep; \
} \
- rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, \
- span.array->rgb, span.array->mask);
+ rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, span.array->mask);
#include "s_tritemp.h"
@@ -278,7 +279,7 @@ ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11)
* texture env modes.
*/
static INLINE void
-affine_span(GLcontext *ctx, struct sw_span *span,
+affine_span(GLcontext *ctx, SWspan *span,
struct affine_info *info)
{
GLchan sample[4]; /* the filtered texture sample */
@@ -601,7 +602,7 @@ struct persp_info
static INLINE void
-fast_persp_span(GLcontext *ctx, struct sw_span *span,
+fast_persp_span(GLcontext *ctx, SWspan *span,
struct persp_info *info)
{
GLchan sample[4]; /* the filtered texture sample */
@@ -1072,7 +1073,7 @@ _swrast_choose_triangle( GLcontext *ctx )
}
}
- if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Active ||
+ if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Enabled ||
ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) {
/* Ugh, we do a _lot_ of tests to pick the best textured tri func */
const struct gl_texture_object *texObj2D;
@@ -1088,7 +1089,7 @@ _swrast_choose_triangle( GLcontext *ctx )
/* First see if we can use an optimized 2-D texture function */
if (ctx->Texture._EnabledCoordUnits == 0x1
- && !ctx->FragmentProgram._Active
+ && !ctx->FragmentProgram._Enabled
&& !ctx->ATIFragmentShader._Enabled
&& !ctx->ShaderObjects._FragmentShaderPresent
&& ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 29a7a94da15..9e0a8a3d32a 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -216,7 +216,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#endif
GLinterp vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy;
- struct sw_span span;
+ SWspan span;
INIT_SPAN(span, GL_POLYGON, 0, 0, 0);
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index 3fd914083f9..29b8df41b7e 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -119,11 +119,11 @@ unzoom_x(GLfloat zoomX, GLint imageX, GLint zx)
* index/depth_span().
*/
static void
-zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span,
+zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
const GLvoid *src, GLenum format )
{
- struct sw_span zoomed;
- struct span_arrays zoomed_arrays; /* this is big! */
+ SWspan zoomed;
+ SWspanarrays zoomed_arrays; /* this is big! */
GLint x0, x1, y0, y1;
GLint zoomedWidth;
@@ -144,6 +144,19 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span,
zoomed.x = x0;
zoomed.end = zoomedWidth;
zoomed.array = &zoomed_arrays;
+ zoomed_arrays.ChanType = span->array->ChanType;
+ /* XXX temporary */
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ zoomed_arrays.rgba = zoomed_arrays.color.sz1.rgba;
+ zoomed_arrays.spec = zoomed_arrays.color.sz1.spec;
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ zoomed_arrays.rgba = zoomed_arrays.color.sz2.rgba;
+ zoomed_arrays.spec = zoomed_arrays.color.sz2.spec;
+#else
+ zoomed_arrays.rgba = zoomed_arrays.color.sz4.rgba;
+ zoomed_arrays.spec = zoomed_arrays.color.sz4.spec;
+#endif
+
/* copy fog interp info */
zoomed.fog = span->fog;
@@ -190,26 +203,76 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span,
/* zoom the span horizontally */
if (format == GL_RGBA) {
- const GLchan (*rgba)[4] = (const GLchan (*)[4]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < span->end);
- COPY_CHAN4(zoomed.array->rgba[i], rgba[j]);
+ if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) {
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ COPY_4UBV(zoomed.array->color.sz1.rgba[i], rgba[j]);
+ }
+ }
+ else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
+ const GLushort (*rgba)[4] = (const GLushort (*)[4]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ COPY_4V(zoomed.array->color.sz2.rgba[i], rgba[j]);
+ }
+ }
+ else {
+ const GLfloat (*rgba)[4] = (const GLfloat (*)[4]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ COPY_4V(zoomed.array->color.sz4.rgba[i], rgba[j]);
+ }
}
}
else if (format == GL_RGB) {
- const GLchan (*rgb)[3] = (const GLchan (*)[3]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < span->end);
- zoomed.array->rgba[i][0] = rgb[j][0];
- zoomed.array->rgba[i][1] = rgb[j][1];
- zoomed.array->rgba[i][2] = rgb[j][2];
- zoomed.array->rgba[i][3] = CHAN_MAX;
+ if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) {
+ const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ zoomed.array->color.sz1.rgba[i][0] = rgb[j][0];
+ zoomed.array->color.sz1.rgba[i][1] = rgb[j][1];
+ zoomed.array->color.sz1.rgba[i][2] = rgb[j][2];
+ zoomed.array->color.sz1.rgba[i][3] = 0xff;
+ }
+ }
+ else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
+ const GLushort (*rgb)[3] = (const GLushort (*)[3]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ zoomed.array->color.sz2.rgba[i][0] = rgb[j][0];
+ zoomed.array->color.sz2.rgba[i][1] = rgb[j][1];
+ zoomed.array->color.sz2.rgba[i][2] = rgb[j][2];
+ zoomed.array->color.sz2.rgba[i][3] = 0xffff;
+ }
+ }
+ else {
+ const GLfloat (*rgb)[3] = (const GLfloat (*)[3]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ zoomed.array->color.sz4.rgba[i][0] = rgb[j][0];
+ zoomed.array->color.sz4.rgba[i][1] = rgb[j][1];
+ zoomed.array->color.sz4.rgba[i][2] = rgb[j][2];
+ zoomed.array->color.sz4.rgba[i][3] = 1.0F;
+ }
}
}
else if (format == GL_COLOR_INDEX) {
@@ -241,22 +304,28 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span,
* going to call _swrast_write_zoomed_span() more than once.
* Also, clipping may change the span end value, so store it as well.
*/
- GLchan rgbaSave[MAX_WIDTH][4];
const GLint end = zoomed.end; /* save */
+ /* use specular color array for temp storage */
+ void *rgbaSave = zoomed.array->spec;
+ const GLint pixelSize =
+ (zoomed.array->ChanType == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) :
+ ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort)
+ : 4 * sizeof(GLfloat));
if (y1 - y0 > 1) {
- MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * 4 * sizeof(GLchan));
+ MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize);
}
for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) {
_swrast_write_rgba_span(ctx, &zoomed);
zoomed.end = end; /* restore */
if (y1 - y0 > 1) {
/* restore the colors */
- MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end*4 * sizeof(GLchan));
+ MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize);
}
}
}
else if (format == GL_COLOR_INDEX) {
- GLuint indexSave[MAX_WIDTH];
+ /* use specular color array for temp storage */
+ GLuint *indexSave = (GLuint *) zoomed.array->spec;
const GLint end = zoomed.end; /* save */
if (y1 - y0 > 1) {
MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint));
@@ -274,26 +343,24 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span,
void
-_swrast_write_zoomed_rgba_span( GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span,
- CONST GLchan rgba[][4])
+_swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY,
+ const SWspan *span, const GLvoid *rgba)
{
- zoom_span(ctx, imgX, imgY, span, (const GLvoid *) rgba, GL_RGBA);
+ zoom_span(ctx, imgX, imgY, span, rgba, GL_RGBA);
}
void
_swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span,
- CONST GLchan rgb[][3])
+ const SWspan *span, const GLvoid *rgb)
{
- zoom_span(ctx, imgX, imgY, span, (const GLvoid *) rgb, GL_RGB);
+ zoom_span(ctx, imgX, imgY, span, rgb, GL_RGB);
}
void
_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span)
+ const SWspan *span)
{
zoom_span(ctx, imgX, imgY, span,
(const GLvoid *) span->array->index, GL_COLOR_INDEX);
@@ -302,7 +369,7 @@ _swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY,
void
_swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span)
+ const SWspan *span)
{
zoom_span(ctx, imgX, imgY, span,
(const GLvoid *) span->array->z, GL_DEPTH_COMPONENT);
diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h
index d10c270245d..6ca11ac2111 100644
--- a/src/mesa/swrast/s_zoom.h
+++ b/src/mesa/swrast/s_zoom.h
@@ -31,21 +31,19 @@
extern void
_swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span,
- CONST GLchan rgb[][4]);
+ const SWspan *span, const GLvoid *rgba);
extern void
_swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span,
- CONST GLchan rgb[][3]);
+ const SWspan *span, const GLvoid *rgb);
extern void
_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span);
+ const SWspan *span);
extern void
_swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY,
- const struct sw_span *span);
+ const SWspan *span);
extern void
diff --git a/src/mesa/swrast/sources b/src/mesa/swrast/sources
new file mode 100644
index 00000000000..9ffd4cca722
--- /dev/null
+++ b/src/mesa/swrast/sources
@@ -0,0 +1,65 @@
+# List of source files in this directory used for X.org xserver build
+MESA_SWRAST_SOURCES = \
+s_aaline.c \
+s_aatriangle.c \
+s_accum.c \
+s_alpha.c \
+s_arbshader.c \
+s_atifragshader.c \
+s_bitmap.c \
+s_blend.c \
+s_blit.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_points.c \
+s_readpix.c \
+s_span.c \
+s_stencil.c \
+s_texcombine.c \
+s_texfilter.c \
+s_texstore.c \
+s_triangle.c \
+s_zoom.c
+
+MESA_SWRAST_HEADERS = \
+s_aaline.h \
+s_aalinetemp.h \
+s_aatriangle.h \
+s_aatritemp.h \
+s_accum.h \
+s_alpha.h \
+s_arbshader.h \
+s_atifragshader.h \
+s_blend.h \
+s_context.h \
+s_depth.h \
+s_drawpix.h \
+s_feedback.h \
+s_fog.h \
+s_lines.h \
+s_linetemp.h \
+s_logic.h \
+s_masking.h \
+s_nvfragprog.h \
+s_points.h \
+s_pointtemp.h \
+s_span.h \
+s_spantemp.h \
+s_stencil.h \
+s_texcombine.h \
+s_texfilter.h \
+s_triangle.h \
+s_trispan.h \
+s_tritemp.h \
+s_zoom.h \
+swrast.h
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index 2a212342539..09686c8380a 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -130,13 +130,10 @@ _swrast_BlitFramebuffer(GLcontext *ctx,
GLbitfield mask, GLenum filter);
extern void
-_swrast_Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
+_swrast_Clear(GLcontext *ctx, GLbitfield buffers);
extern void
-_swrast_Accum( GLcontext *ctx, GLenum op,
- GLfloat value, GLint xpos, GLint ypos,
- GLint width, GLint height );
+_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value);
@@ -255,6 +252,13 @@ extern void
_swrast_eject_texture_images(GLcontext *ctx);
+#if FEATURE_MESA_program_debug
+extern void
+_swrast_get_program_register(GLcontext *, enum register_file file,
+ GLuint index, GLfloat val[4]);
+#endif /* FEATURE_MESA_program_debug */
+
+
/**
* The driver interface for the software rasterizer.
* XXX this may go away.
diff --git a/src/mesa/swrast_setup/sources b/src/mesa/swrast_setup/sources
new file mode 100644
index 00000000000..dee14b6774e
--- /dev/null
+++ b/src/mesa/swrast_setup/sources
@@ -0,0 +1,10 @@
+MESA_SWRAST_SETUP_SOURCES = \
+ss_context.c \
+ss_triangle.c
+
+MESA_SWRAST_SETUP_HEADERS = \
+ss_context.h \
+ss_triangle.h \
+ss_tritmp.h \
+ss_vb.h \
+swrast_setup.h
diff --git a/src/mesa/tnl/sources b/src/mesa/tnl/sources
new file mode 100644
index 00000000000..e01f55dbafb
--- /dev/null
+++ b/src/mesa/tnl/sources
@@ -0,0 +1,46 @@
+# List of source files in this directory used for X.org xserver build
+MESA_TNL_SOURCES = \
+t_array_api.c \
+t_array_import.c \
+t_context.c \
+t_pipeline.c \
+t_save_api.c \
+t_save_loopback.c \
+t_save_playback.c \
+t_vb_arbprogram.c \
+t_vb_arbprogram_sse.c \
+t_vb_arbshader.c \
+t_vb_cull.c \
+t_vb_fog.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_vertex.c \
+t_vertex_generic.c \
+t_vertex_sse.c \
+t_vp_build.c \
+t_vtx_api.c \
+t_vtx_eval.c \
+t_vtx_exec.c \
+t_vtx_generic.c \
+t_vtx_x86.c
+
+MESA_TNL_HEADERS = \
+t_array_api.h \
+t_array_import.h \
+t_context.h \
+t_pipeline.h \
+t_save_api.h \
+t_vb_arbprogram.h \
+t_vb_cliptmp.h \
+t_vb_lighttmp.h \
+t_vb_rendertmp.h \
+t_vertex.h \
+t_vp_build.h \
+t_vtx_api.h \
+tnl.h
diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c
index 36ea54296ce..6826cf7e24c 100644
--- a/src/mesa/tnl/t_array_api.c
+++ b/src/mesa/tnl/t_array_api.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -115,6 +115,12 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
+ /* It's tempting to get rid of this threshold value because we take
+ * very different paths if 'count' is less than or greater than 'thresh'.
+ * I've found/fixed at least one bug which only occured for particular
+ * array sizes. Also, several conformance tests use very short arrays
+ * which means the long-array path doesn't get tested. -Brian
+ */
GLuint thresh = (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) ? 30 : 10;
if (MESA_VERBOSE & VERBOSE_API)
@@ -289,6 +295,18 @@ _tnl_DrawRangeElements(GLenum mode,
ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT,
count, type, indices );
+#ifdef DEBUG
+ /* check that array indices really fall inside [start, end] range */
+ {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (ui_indices[i] < start || ui_indices[i] > end) {
+ _mesa_warning(ctx, "Invalid array index in "
+ "glDrawRangeElements(index=%u)", ui_indices[i]);
+ }
+ }
+ }
+#endif
assert(!ctx->CompileFlag);
diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c
index 0677a1fd3b2..13c5689ceb9 100644
--- a/src/mesa/tnl/t_array_import.c
+++ b/src/mesa/tnl/t_array_import.c
@@ -327,9 +327,10 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end)
}
else if (index >= VERT_ATTRIB_GENERIC1 &&
index <= VERT_ATTRIB_GENERIC15) {
- if (program && !program->IsNVProgram) {
+ const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0;
+ if (program && !program->IsNVProgram &&
+ ctx->Array.ArrayObj->VertexAttrib[arrayIndex].Enabled) {
/* GL_ARB_vertex_program: bind a generic attribute array */
- const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0;
_tnl_import_attrib(ctx, arrayIndex, GL_FALSE, GL_TRUE);
VB->AttribPtr[index] = &tmp->Attribs[arrayIndex];
}
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index b6f5152c741..154780cc975 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -184,7 +184,8 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
if (ctx->Fog.Enabled ||
(ctx->FragmentProgram._Active &&
- ctx->FragmentProgram._Current->FogOption != GL_NONE))
+ (ctx->FragmentProgram._Current->FogOption != GL_NONE ||
+ ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)))
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
if (ctx->Polygon.FrontMode != GL_FILL ||
@@ -245,10 +246,7 @@ void
_tnl_need_projected_coords( GLcontext *ctx, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- if (tnl->NeedNdcCoords != mode) {
- tnl->NeedNdcCoords = mode;
- _tnl_InvalidateState( ctx, _NEW_PROJECTION );
- }
+ tnl->NeedNdcCoords = mode;
}
void
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index 97ad79c58fd..d5414bd730d 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -248,6 +248,7 @@ struct _tnl_dynfn_generators {
struct tnl_vtx {
GLfloat buffer[VERT_BUFFER_SIZE];
GLubyte attrsz[_TNL_ATTRIB_MAX];
+ GLubyte active_sz[_TNL_ATTRIB_MAX];
GLuint vertex_size;
struct tnl_prim prim[TNL_MAX_PRIM];
GLuint prim_count;
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
index 11d21301d94..dbbd095fe47 100644
--- a/src/mesa/tnl/t_save_api.c
+++ b/src/mesa/tnl/t_save_api.c
@@ -1413,10 +1413,14 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co
if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
return;
+ _ae_map_vbos( ctx );
+
_save_NotifyBegin( ctx, mode | PRIM_WEAK );
for (i = 0; i < count; i++)
CALL_ArrayElement(GET_DISPATCH(), (start + i));
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
@@ -1429,6 +1433,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
return;
+ _ae_map_vbos( ctx );
+
_save_NotifyBegin( ctx, mode | PRIM_WEAK );
switch (type) {
@@ -1450,6 +1456,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
}
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
diff --git a/src/mesa/tnl/t_save_playback.c b/src/mesa/tnl/t_save_playback.c
index 9504f0fe680..426e94372ec 100644
--- a/src/mesa/tnl/t_save_playback.c
+++ b/src/mesa/tnl/t_save_playback.c
@@ -150,6 +150,7 @@ static void _playback_copy_to_current( GLcontext *ctx,
if (node->have_materials) {
tnl->Driver.NotifyMaterialChange( ctx );
+ ctx->NewState |= _NEW_LIGHT;
}
/* CurrentExecPrimitive
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 0ff26df713a..bf4c1d52237 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -1182,7 +1182,8 @@ do_ndc_cliptest(GLcontext *ctx, struct arb_vp_machine *m)
/* Test userclip planes. This contributes to VB->ClipMask.
*/
- if (ctx->Transform.ClipPlanesEnabled && !ctx->VertexProgram._Enabled) {
+ if (ctx->Transform.ClipPlanesEnabled && (!ctx->VertexProgram._Enabled ||
+ ctx->VertexProgram.Current->IsPositionInvariant)) {
userclip( ctx,
VB->ClipPtr,
m->clipmask,
@@ -1528,7 +1529,7 @@ const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage =
void
_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program)
{
- if (program->Target == GL_VERTEX_PROGRAM_ARB) {
+ if (target == GL_VERTEX_PROGRAM_ARB) {
/* free any existing tnl data hanging off the program */
struct gl_vertex_program *vprog = (struct gl_vertex_program *) program;
if (vprog->TnlData) {
diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h
index f3776e7eeb6..788fe329ed8 100644
--- a/src/mesa/tnl/t_vb_cliptmp.h
+++ b/src/mesa/tnl/t_vb_cliptmp.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -125,6 +125,7 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask )
GLfloat t0 = 0;
GLfloat t1 = 0;
GLuint p;
+ const GLuint v0_orig = v0;
if (mask & 0x3f) {
LINE_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 );
@@ -153,12 +154,17 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask )
v0 = newvert;
newvert++;
}
- else
+ else {
ASSERT(t0 == 0.0);
+ }
+ /* Note: we need to use vertex v0_orig when computing the new
+ * interpolated/clipped vertex position, not the current v0 which
+ * may have got set when we clipped the other end of the line!
+ */
if (VB->ClipMask[v1]) {
- INTERP_4F( t1, coord[newvert], coord[v1], coord[v0] );
- interp( ctx, t1, newvert, v1, v0, GL_FALSE );
+ INTERP_4F( t1, coord[newvert], coord[v1], coord[v0_orig] );
+ interp( ctx, t1, newvert, v1, v0_orig, GL_FALSE );
if (ctx->Light.ShadeModel == GL_FLAT)
tnl->Driver.Render.CopyPV( ctx, newvert, v1 );
@@ -167,8 +173,9 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask )
newvert++;
}
- else
+ else {
ASSERT(t1 == 0.0);
+ }
tnl->Driver.Render.ClippedLine( ctx, v0, v1 );
}
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index 36ee4b2f46a..f11ac616f16 100644
--- a/src/mesa/tnl/t_vb_program.c
+++ b/src/mesa/tnl/t_vb_program.c
@@ -76,6 +76,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
struct vp_stage_data *store = VP_STAGE_DATA(stage);
struct vertex_buffer *VB = &tnl->vb;
struct gl_vertex_program *program = ctx->VertexProgram.Current;
+ struct vp_machine machine;
GLuint i;
if (ctx->ShaderObjects._VertexShaderPresent)
@@ -91,7 +92,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
for (i = 0; i < VB->Count; i++) {
GLuint attr;
- _mesa_init_vp_per_vertex_registers(ctx);
+ _mesa_init_vp_per_vertex_registers(ctx, &machine);
#if 0
printf("Input %d: %f, %f, %f, %f\n", i,
@@ -118,30 +119,29 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
const GLuint size = VB->AttribPtr[attr]->size;
const GLuint stride = VB->AttribPtr[attr]->stride;
const GLfloat *data = (GLfloat *) (ptr + stride * i);
- COPY_CLEAN_4V(ctx->VertexProgram.Inputs[attr], size, data);
+ COPY_CLEAN_4V(machine.Inputs[attr], size, data);
}
}
/* execute the program */
ASSERT(program);
- _mesa_exec_vertex_program(ctx, program);
+ _mesa_exec_vertex_program(ctx, &machine, program);
/* Fixup fog an point size results if needed */
if (ctx->Fog.Enabled &&
(program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) {
- ctx->VertexProgram.Outputs[VERT_RESULT_FOGC][0] = 1.0;
+ machine.Outputs[VERT_RESULT_FOGC][0] = 1.0;
}
if (ctx->VertexProgram.PointSizeEnabled &&
(program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) {
- ctx->VertexProgram.Outputs[VERT_RESULT_PSIZ][0] = ctx->Point.Size;
+ machine.Outputs[VERT_RESULT_PSIZ][0] = ctx->Point.Size;
}
/* copy the output registers into the VB->attribs arrays */
/* XXX (optimize) could use a conditional and smaller loop limit here */
for (attr = 0; attr < 15; attr++) {
- COPY_4V(store->attribs[attr].data[i],
- ctx->VertexProgram.Outputs[attr]);
+ COPY_4V(store->attribs[attr].data[i], machine.Outputs[attr]);
}
}
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index 894a13b7046..805d05ae728 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -33,7 +33,7 @@
#include "glheader.h"
#include "macros.h"
#include "enums.h"
-#include "t_context.h"
+#include "t_context.h" /* NOTE: very light dependency on this */
#include "t_vp_build.h"
#include "shader/program.h"
@@ -386,7 +386,7 @@ static struct ureg register_const4f( struct tnl_program *p,
values[1] = s1;
values[2] = s2;
values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values );
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
return make_ureg(PROGRAM_STATE_VAR, idx);
}
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index 9379d91780c..77eec8b3b44 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -171,6 +171,7 @@ static void _tnl_copy_to_current( GLcontext *ctx )
if (tnl->vtx.have_materials) {
tnl->Driver.NotifyMaterialChange( ctx );
+ ctx->NewState |= _NEW_LIGHT;
}
ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
@@ -321,13 +322,17 @@ static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz )
static const GLfloat id[4] = { 0, 0, 0, 1 };
int i;
+ if (0)
+ _mesa_printf("%s attr %d sz %d -> %d\n",
+ __FUNCTION__, attr, tnl->vtx.attrsz[attr], sz);
+
if (tnl->vtx.attrsz[attr] < sz) {
/* New size is larger. Need to flush existing vertices and get
* an enlarged vertex format.
*/
_tnl_wrap_upgrade_vertex( ctx, attr, sz );
}
- else if (tnl->vtx.attrsz[attr] > sz) {
+ else if (sz < tnl->vtx.active_sz[attr]) {
/* New size is smaller - just need to fill in some
* zeros. Don't need to flush or wrap.
*/
@@ -335,6 +340,8 @@ static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz )
tnl->vtx.attrptr[attr][i-1] = id[i-1];
}
+ tnl->vtx.active_sz[attr] = sz;
+
/* Does setting NeedFlush belong here? Necessitates resetting
* vtxfmt on each flush (otherwise flags won't get reset
* afterwards).
@@ -398,7 +405,7 @@ static tnl_attrfv_func do_choose( GLuint attr, GLuint sz )
{
GET_CURRENT_CONTEXT( ctx );
TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldsz = tnl->vtx.attrsz[attr];
+ GLuint oldsz = tnl->vtx.active_sz[attr];
assert(attr < _TNL_MAX_ATTR_CODEGEN);
@@ -519,6 +526,7 @@ reset_attrfv(TNLcontext *tnl)
if (tnl->vtx.attrsz[i]) {
GLint j = tnl->vtx.attrsz[i] - 1;
tnl->vtx.attrsz[i] = 0;
+ tnl->vtx.active_sz[i] = 0;
if (i < _TNL_MAX_ATTR_CODEGEN) {
while (j >= 0) {
@@ -550,7 +558,7 @@ reset_attrfv(TNLcontext *tnl)
*/
#define OTHER_ATTR( A, N, params ) \
do { \
- if (tnl->vtx.attrsz[A] != N) { \
+ if (tnl->vtx.active_sz[A] != N) { \
_tnl_fixup_vertex( ctx, A, N ); \
} \
\
@@ -650,7 +658,7 @@ static void GLAPIENTRY _tnl_EvalCoord1f( GLfloat u )
for (i = 0; i < _TNL_NUM_EVAL; i++) {
if (tnl->vtx.eval.map1[i].map)
- if (tnl->vtx.attrsz[i] != tnl->vtx.eval.map1[i].sz)
+ if (tnl->vtx.active_sz[i] != tnl->vtx.eval.map1[i].sz)
_tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map1[i].sz );
}
}
@@ -678,12 +686,12 @@ static void GLAPIENTRY _tnl_EvalCoord2f( GLfloat u, GLfloat v )
for (i = 0; i < _TNL_NUM_EVAL; i++) {
if (tnl->vtx.eval.map2[i].map)
- if (tnl->vtx.attrsz[i] != tnl->vtx.eval.map2[i].sz)
+ if (tnl->vtx.active_sz[i] != tnl->vtx.eval.map2[i].sz)
_tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map2[i].sz );
}
if (ctx->Eval.AutoNormal)
- if (tnl->vtx.attrsz[_TNL_ATTRIB_NORMAL] != 3)
+ if (tnl->vtx.active_sz[_TNL_ATTRIB_NORMAL] != 3)
_tnl_fixup_vertex( ctx, _TNL_ATTRIB_NORMAL, 3 );
}
@@ -1005,8 +1013,10 @@ void _tnl_vtx_init( GLcontext *ctx )
_mesa_memcpy( tnl->vtx.tabfv, choose, sizeof(choose) );
- for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
+ for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) {
tnl->vtx.attrsz[i] = 0;
+ tnl->vtx.active_sz[i] = 0;
+ }
tnl->vtx.vertex_size = 0;
tnl->vtx.have_materials = 0;
diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c
index 57d842f05fe..900c4ab6cc1 100644
--- a/src/mesa/tnl/t_vtx_exec.c
+++ b/src/mesa/tnl/t_vtx_exec.c
@@ -239,6 +239,11 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx )
return 2;
}
case GL_TRIANGLE_STRIP:
+ /* no parity issue, but need to make sure the tri is not drawn twice */
+ if (nr & 1) {
+ tnl->vtx.prim[tnl->vtx.prim_count-1].count--;
+ }
+ /* fallthrough */
case GL_QUAD_STRIP:
switch (nr) {
case 0: ovf = 0; break;
diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S
index 6ce188cb97c..d8ef5eae095 100644
--- a/src/mesa/x86-64/glapi_x86-64.S
+++ b/src/mesa/x86-64/glapi_x86-64.S
@@ -40,6 +40,7 @@
# if defined(USE_MGL_NAMESPACE)
# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))
+# define _glapi_Dispatch _mglapi_Dispatch
# else
# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))
# endif
@@ -15146,12 +15147,469 @@ GL_PREFIX(MultiTexCoord4svARB):
.size GL_PREFIX(MultiTexCoord4svARB), .-GL_PREFIX(MultiTexCoord4svARB)
.p2align 4,,15
+ .globl GL_PREFIX(AttachShader)
+ .type GL_PREFIX(AttachShader), @function
+GL_PREFIX(AttachShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AttachShader), .-GL_PREFIX(AttachShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateProgram)
+ .type GL_PREFIX(CreateProgram), @function
+GL_PREFIX(CreateProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 3272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 3272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateProgram), .-GL_PREFIX(CreateProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateShader)
+ .type GL_PREFIX(CreateShader), @function
+GL_PREFIX(CreateShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateShader), .-GL_PREFIX(CreateShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteProgram)
+ .type GL_PREFIX(DeleteProgram), @function
+GL_PREFIX(DeleteProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteProgram), .-GL_PREFIX(DeleteProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteShader)
+ .type GL_PREFIX(DeleteShader), @function
+GL_PREFIX(DeleteShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteShader), .-GL_PREFIX(DeleteShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DetachShader)
+ .type GL_PREFIX(DetachShader), @function
+GL_PREFIX(DetachShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DetachShader), .-GL_PREFIX(DetachShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetAttachedShaders)
+ .type GL_PREFIX(GetAttachedShaders), @function
+GL_PREFIX(GetAttachedShaders):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetAttachedShaders), .-GL_PREFIX(GetAttachedShaders)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramInfoLog)
+ .type GL_PREFIX(GetProgramInfoLog), @function
+GL_PREFIX(GetProgramInfoLog):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramInfoLog), .-GL_PREFIX(GetProgramInfoLog)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramiv)
+ .type GL_PREFIX(GetProgramiv), @function
+GL_PREFIX(GetProgramiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramiv), .-GL_PREFIX(GetProgramiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderInfoLog)
+ .type GL_PREFIX(GetShaderInfoLog), @function
+GL_PREFIX(GetShaderInfoLog):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderInfoLog), .-GL_PREFIX(GetShaderInfoLog)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderiv)
+ .type GL_PREFIX(GetShaderiv), @function
+GL_PREFIX(GetShaderiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderiv), .-GL_PREFIX(GetShaderiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsProgram)
+ .type GL_PREFIX(IsProgram), @function
+GL_PREFIX(IsProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3352(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsProgram), .-GL_PREFIX(IsProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsShader)
+ .type GL_PREFIX(IsShader), @function
+GL_PREFIX(IsShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsShader), .-GL_PREFIX(IsShader)
+
+ .p2align 4,,15
.globl GL_PREFIX(StencilFuncSeparate)
.type GL_PREFIX(StencilFuncSeparate), @function
GL_PREFIX(StencilFuncSeparate):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15165,13 +15623,13 @@ GL_PREFIX(StencilFuncSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15185,7 +15643,7 @@ GL_PREFIX(StencilFuncSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate)
@@ -15196,7 +15654,7 @@ GL_PREFIX(StencilFuncSeparate):
GL_PREFIX(StencilMaskSeparate):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15206,13 +15664,13 @@ GL_PREFIX(StencilMaskSeparate):
popq %rbp
popq %rsi
popq %rdi
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15222,7 +15680,7 @@ GL_PREFIX(StencilMaskSeparate):
popq %rbp
popq %rsi
popq %rdi
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate)
@@ -15233,7 +15691,7 @@ GL_PREFIX(StencilMaskSeparate):
GL_PREFIX(StencilOpSeparate):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15247,13 +15705,13 @@ GL_PREFIX(StencilOpSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15267,36 +15725,306 @@ GL_PREFIX(StencilOpSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate)
.p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix2x3fv)
+ .type GL_PREFIX(UniformMatrix2x3fv), @function
+GL_PREFIX(UniformMatrix2x3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix2x3fv), .-GL_PREFIX(UniformMatrix2x3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix2x4fv)
+ .type GL_PREFIX(UniformMatrix2x4fv), @function
+GL_PREFIX(UniformMatrix2x4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix2x4fv), .-GL_PREFIX(UniformMatrix2x4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix3x2fv)
+ .type GL_PREFIX(UniformMatrix3x2fv), @function
+GL_PREFIX(UniformMatrix3x2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix3x2fv), .-GL_PREFIX(UniformMatrix3x2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix3x4fv)
+ .type GL_PREFIX(UniformMatrix3x4fv), @function
+GL_PREFIX(UniformMatrix3x4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix3x4fv), .-GL_PREFIX(UniformMatrix3x4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix4x2fv)
+ .type GL_PREFIX(UniformMatrix4x2fv), @function
+GL_PREFIX(UniformMatrix4x2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3424(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix4x2fv), .-GL_PREFIX(UniformMatrix4x2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix4x3fv)
+ .type GL_PREFIX(UniformMatrix4x3fv), @function
+GL_PREFIX(UniformMatrix4x3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3432(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix4x3fv), .-GL_PREFIX(UniformMatrix4x3fv)
+
+ .p2align 4,,15
.globl GL_PREFIX(LoadTransposeMatrixdARB)
.type GL_PREFIX(LoadTransposeMatrixdARB), @function
GL_PREFIX(LoadTransposeMatrixdARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB)
@@ -15307,25 +16035,25 @@ GL_PREFIX(LoadTransposeMatrixdARB):
GL_PREFIX(LoadTransposeMatrixfARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB)
@@ -15336,25 +16064,25 @@ GL_PREFIX(LoadTransposeMatrixfARB):
GL_PREFIX(MultTransposeMatrixdARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB)
@@ -15365,25 +16093,25 @@ GL_PREFIX(MultTransposeMatrixdARB):
GL_PREFIX(MultTransposeMatrixfARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB)
@@ -15394,7 +16122,7 @@ GL_PREFIX(MultTransposeMatrixfARB):
GL_PREFIX(SampleCoverageARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15404,13 +16132,13 @@ GL_PREFIX(SampleCoverageARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15420,7 +16148,7 @@ GL_PREFIX(SampleCoverageARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB)
@@ -15431,7 +16159,7 @@ GL_PREFIX(SampleCoverageARB):
GL_PREFIX(CompressedTexImage1DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15449,13 +16177,13 @@ GL_PREFIX(CompressedTexImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15473,7 +16201,7 @@ GL_PREFIX(CompressedTexImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB)
@@ -15484,7 +16212,7 @@ GL_PREFIX(CompressedTexImage1DARB):
GL_PREFIX(CompressedTexImage2DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15502,13 +16230,13 @@ GL_PREFIX(CompressedTexImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15526,7 +16254,7 @@ GL_PREFIX(CompressedTexImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB)
@@ -15537,7 +16265,7 @@ GL_PREFIX(CompressedTexImage2DARB):
GL_PREFIX(CompressedTexImage3DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15555,13 +16283,13 @@ GL_PREFIX(CompressedTexImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15579,7 +16307,7 @@ GL_PREFIX(CompressedTexImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB)
@@ -15590,7 +16318,7 @@ GL_PREFIX(CompressedTexImage3DARB):
GL_PREFIX(CompressedTexSubImage1DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15608,13 +16336,13 @@ GL_PREFIX(CompressedTexSubImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15632,7 +16360,7 @@ GL_PREFIX(CompressedTexSubImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB)
@@ -15643,7 +16371,7 @@ GL_PREFIX(CompressedTexSubImage1DARB):
GL_PREFIX(CompressedTexSubImage2DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15661,13 +16389,13 @@ GL_PREFIX(CompressedTexSubImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15685,7 +16413,7 @@ GL_PREFIX(CompressedTexSubImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB)
@@ -15696,7 +16424,7 @@ GL_PREFIX(CompressedTexSubImage2DARB):
GL_PREFIX(CompressedTexSubImage3DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15714,13 +16442,13 @@ GL_PREFIX(CompressedTexSubImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15738,7 +16466,7 @@ GL_PREFIX(CompressedTexSubImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB)
@@ -15749,7 +16477,7 @@ GL_PREFIX(CompressedTexSubImage3DARB):
GL_PREFIX(GetCompressedTexImageARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15759,13 +16487,13 @@ GL_PREFIX(GetCompressedTexImageARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15775,7 +16503,7 @@ GL_PREFIX(GetCompressedTexImageARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB)
@@ -15786,25 +16514,25 @@ GL_PREFIX(GetCompressedTexImageARB):
GL_PREFIX(DisableVertexAttribArrayARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB)
@@ -15815,25 +16543,25 @@ GL_PREFIX(DisableVertexAttribArrayARB):
GL_PREFIX(EnableVertexAttribArrayARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB)
@@ -15844,7 +16572,7 @@ GL_PREFIX(EnableVertexAttribArrayARB):
GL_PREFIX(GetProgramEnvParameterdvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15854,13 +16582,13 @@ GL_PREFIX(GetProgramEnvParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15870,7 +16598,7 @@ GL_PREFIX(GetProgramEnvParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB)
@@ -15881,7 +16609,7 @@ GL_PREFIX(GetProgramEnvParameterdvARB):
GL_PREFIX(GetProgramEnvParameterfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15891,13 +16619,13 @@ GL_PREFIX(GetProgramEnvParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15907,7 +16635,7 @@ GL_PREFIX(GetProgramEnvParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB)
@@ -15918,7 +16646,7 @@ GL_PREFIX(GetProgramEnvParameterfvARB):
GL_PREFIX(GetProgramLocalParameterdvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15928,13 +16656,13 @@ GL_PREFIX(GetProgramLocalParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15944,7 +16672,7 @@ GL_PREFIX(GetProgramLocalParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB)
@@ -15955,7 +16683,7 @@ GL_PREFIX(GetProgramLocalParameterdvARB):
GL_PREFIX(GetProgramLocalParameterfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15965,13 +16693,13 @@ GL_PREFIX(GetProgramLocalParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15981,7 +16709,7 @@ GL_PREFIX(GetProgramLocalParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB)
@@ -15992,7 +16720,7 @@ GL_PREFIX(GetProgramLocalParameterfvARB):
GL_PREFIX(GetProgramStringARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16002,13 +16730,13 @@ GL_PREFIX(GetProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16018,7 +16746,7 @@ GL_PREFIX(GetProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB)
@@ -16029,7 +16757,7 @@ GL_PREFIX(GetProgramStringARB):
GL_PREFIX(GetProgramivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16039,13 +16767,13 @@ GL_PREFIX(GetProgramivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16055,7 +16783,7 @@ GL_PREFIX(GetProgramivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB)
@@ -16066,7 +16794,7 @@ GL_PREFIX(GetProgramivARB):
GL_PREFIX(GetVertexAttribdvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16076,13 +16804,13 @@ GL_PREFIX(GetVertexAttribdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16092,7 +16820,7 @@ GL_PREFIX(GetVertexAttribdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB)
@@ -16103,7 +16831,7 @@ GL_PREFIX(GetVertexAttribdvARB):
GL_PREFIX(GetVertexAttribfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16113,13 +16841,13 @@ GL_PREFIX(GetVertexAttribfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16129,7 +16857,7 @@ GL_PREFIX(GetVertexAttribfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB)
@@ -16140,7 +16868,7 @@ GL_PREFIX(GetVertexAttribfvARB):
GL_PREFIX(GetVertexAttribivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16150,13 +16878,13 @@ GL_PREFIX(GetVertexAttribivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16166,7 +16894,7 @@ GL_PREFIX(GetVertexAttribivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB)
@@ -16177,7 +16905,7 @@ GL_PREFIX(GetVertexAttribivARB):
GL_PREFIX(ProgramEnvParameter4dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16195,13 +16923,13 @@ GL_PREFIX(ProgramEnvParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16219,7 +16947,7 @@ GL_PREFIX(ProgramEnvParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB)
@@ -16230,7 +16958,7 @@ GL_PREFIX(ProgramEnvParameter4dARB):
GL_PREFIX(ProgramEnvParameter4dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16240,13 +16968,13 @@ GL_PREFIX(ProgramEnvParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16256,7 +16984,7 @@ GL_PREFIX(ProgramEnvParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB)
@@ -16267,7 +16995,7 @@ GL_PREFIX(ProgramEnvParameter4dvARB):
GL_PREFIX(ProgramEnvParameter4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16285,13 +17013,13 @@ GL_PREFIX(ProgramEnvParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16309,7 +17037,7 @@ GL_PREFIX(ProgramEnvParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB)
@@ -16320,7 +17048,7 @@ GL_PREFIX(ProgramEnvParameter4fARB):
GL_PREFIX(ProgramEnvParameter4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16330,13 +17058,13 @@ GL_PREFIX(ProgramEnvParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16346,7 +17074,7 @@ GL_PREFIX(ProgramEnvParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB)
@@ -16357,7 +17085,7 @@ GL_PREFIX(ProgramEnvParameter4fvARB):
GL_PREFIX(ProgramLocalParameter4dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16375,13 +17103,13 @@ GL_PREFIX(ProgramLocalParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16399,7 +17127,7 @@ GL_PREFIX(ProgramLocalParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB)
@@ -16410,7 +17138,7 @@ GL_PREFIX(ProgramLocalParameter4dARB):
GL_PREFIX(ProgramLocalParameter4dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16420,13 +17148,13 @@ GL_PREFIX(ProgramLocalParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16436,7 +17164,7 @@ GL_PREFIX(ProgramLocalParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB)
@@ -16447,7 +17175,7 @@ GL_PREFIX(ProgramLocalParameter4dvARB):
GL_PREFIX(ProgramLocalParameter4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16465,13 +17193,13 @@ GL_PREFIX(ProgramLocalParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16489,7 +17217,7 @@ GL_PREFIX(ProgramLocalParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB)
@@ -16500,7 +17228,7 @@ GL_PREFIX(ProgramLocalParameter4fARB):
GL_PREFIX(ProgramLocalParameter4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16510,13 +17238,13 @@ GL_PREFIX(ProgramLocalParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16526,7 +17254,7 @@ GL_PREFIX(ProgramLocalParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB)
@@ -16537,7 +17265,7 @@ GL_PREFIX(ProgramLocalParameter4fvARB):
GL_PREFIX(ProgramStringARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16551,13 +17279,13 @@ GL_PREFIX(ProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16571,7 +17299,7 @@ GL_PREFIX(ProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB)
@@ -16582,7 +17310,7 @@ GL_PREFIX(ProgramStringARB):
GL_PREFIX(VertexAttrib1dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16592,13 +17320,13 @@ GL_PREFIX(VertexAttrib1dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16608,7 +17336,7 @@ GL_PREFIX(VertexAttrib1dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB)
@@ -16619,7 +17347,7 @@ GL_PREFIX(VertexAttrib1dARB):
GL_PREFIX(VertexAttrib1dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16629,13 +17357,13 @@ GL_PREFIX(VertexAttrib1dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16645,7 +17373,7 @@ GL_PREFIX(VertexAttrib1dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB)
@@ -16656,7 +17384,7 @@ GL_PREFIX(VertexAttrib1dvARB):
GL_PREFIX(VertexAttrib1fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16666,13 +17394,13 @@ GL_PREFIX(VertexAttrib1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16682,7 +17410,7 @@ GL_PREFIX(VertexAttrib1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB)
@@ -16693,7 +17421,7 @@ GL_PREFIX(VertexAttrib1fARB):
GL_PREFIX(VertexAttrib1fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16703,13 +17431,13 @@ GL_PREFIX(VertexAttrib1fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16719,7 +17447,7 @@ GL_PREFIX(VertexAttrib1fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB)
@@ -16730,7 +17458,7 @@ GL_PREFIX(VertexAttrib1fvARB):
GL_PREFIX(VertexAttrib1sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16740,13 +17468,13 @@ GL_PREFIX(VertexAttrib1sARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16756,7 +17484,7 @@ GL_PREFIX(VertexAttrib1sARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB)
@@ -16767,7 +17495,7 @@ GL_PREFIX(VertexAttrib1sARB):
GL_PREFIX(VertexAttrib1svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16777,13 +17505,13 @@ GL_PREFIX(VertexAttrib1svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16793,7 +17521,7 @@ GL_PREFIX(VertexAttrib1svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB)
@@ -16804,7 +17532,7 @@ GL_PREFIX(VertexAttrib1svARB):
GL_PREFIX(VertexAttrib2dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16816,13 +17544,13 @@ GL_PREFIX(VertexAttrib2dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16834,7 +17562,7 @@ GL_PREFIX(VertexAttrib2dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB)
@@ -16845,7 +17573,7 @@ GL_PREFIX(VertexAttrib2dARB):
GL_PREFIX(VertexAttrib2dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16855,13 +17583,13 @@ GL_PREFIX(VertexAttrib2dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16871,7 +17599,7 @@ GL_PREFIX(VertexAttrib2dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB)
@@ -16882,7 +17610,7 @@ GL_PREFIX(VertexAttrib2dvARB):
GL_PREFIX(VertexAttrib2fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16894,13 +17622,13 @@ GL_PREFIX(VertexAttrib2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16912,7 +17640,7 @@ GL_PREFIX(VertexAttrib2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB)
@@ -16923,7 +17651,7 @@ GL_PREFIX(VertexAttrib2fARB):
GL_PREFIX(VertexAttrib2fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16933,13 +17661,13 @@ GL_PREFIX(VertexAttrib2fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16949,7 +17677,7 @@ GL_PREFIX(VertexAttrib2fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB)
@@ -16960,7 +17688,7 @@ GL_PREFIX(VertexAttrib2fvARB):
GL_PREFIX(VertexAttrib2sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16970,13 +17698,13 @@ GL_PREFIX(VertexAttrib2sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16986,7 +17714,7 @@ GL_PREFIX(VertexAttrib2sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB)
@@ -16997,7 +17725,7 @@ GL_PREFIX(VertexAttrib2sARB):
GL_PREFIX(VertexAttrib2svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17007,13 +17735,13 @@ GL_PREFIX(VertexAttrib2svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17023,7 +17751,7 @@ GL_PREFIX(VertexAttrib2svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB)
@@ -17034,7 +17762,7 @@ GL_PREFIX(VertexAttrib2svARB):
GL_PREFIX(VertexAttrib3dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17048,13 +17776,13 @@ GL_PREFIX(VertexAttrib3dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17068,7 +17796,7 @@ GL_PREFIX(VertexAttrib3dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB)
@@ -17079,7 +17807,7 @@ GL_PREFIX(VertexAttrib3dARB):
GL_PREFIX(VertexAttrib3dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17089,13 +17817,13 @@ GL_PREFIX(VertexAttrib3dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17105,7 +17833,7 @@ GL_PREFIX(VertexAttrib3dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB)
@@ -17116,7 +17844,7 @@ GL_PREFIX(VertexAttrib3dvARB):
GL_PREFIX(VertexAttrib3fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17130,13 +17858,13 @@ GL_PREFIX(VertexAttrib3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17150,7 +17878,7 @@ GL_PREFIX(VertexAttrib3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB)
@@ -17161,7 +17889,7 @@ GL_PREFIX(VertexAttrib3fARB):
GL_PREFIX(VertexAttrib3fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17171,13 +17899,13 @@ GL_PREFIX(VertexAttrib3fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17187,7 +17915,7 @@ GL_PREFIX(VertexAttrib3fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB)
@@ -17198,7 +17926,7 @@ GL_PREFIX(VertexAttrib3fvARB):
GL_PREFIX(VertexAttrib3sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17212,13 +17940,13 @@ GL_PREFIX(VertexAttrib3sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17232,7 +17960,7 @@ GL_PREFIX(VertexAttrib3sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB)
@@ -17243,7 +17971,7 @@ GL_PREFIX(VertexAttrib3sARB):
GL_PREFIX(VertexAttrib3svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17253,13 +17981,13 @@ GL_PREFIX(VertexAttrib3svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17269,7 +17997,7 @@ GL_PREFIX(VertexAttrib3svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB)
@@ -17280,7 +18008,7 @@ GL_PREFIX(VertexAttrib3svARB):
GL_PREFIX(VertexAttrib4NbvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17290,13 +18018,13 @@ GL_PREFIX(VertexAttrib4NbvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17306,7 +18034,7 @@ GL_PREFIX(VertexAttrib4NbvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB)
@@ -17317,7 +18045,7 @@ GL_PREFIX(VertexAttrib4NbvARB):
GL_PREFIX(VertexAttrib4NivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17327,13 +18055,13 @@ GL_PREFIX(VertexAttrib4NivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17343,7 +18071,7 @@ GL_PREFIX(VertexAttrib4NivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB)
@@ -17354,7 +18082,7 @@ GL_PREFIX(VertexAttrib4NivARB):
GL_PREFIX(VertexAttrib4NsvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17364,13 +18092,13 @@ GL_PREFIX(VertexAttrib4NsvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17380,7 +18108,7 @@ GL_PREFIX(VertexAttrib4NsvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB)
@@ -17391,7 +18119,7 @@ GL_PREFIX(VertexAttrib4NsvARB):
GL_PREFIX(VertexAttrib4NubARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17405,13 +18133,13 @@ GL_PREFIX(VertexAttrib4NubARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17425,7 +18153,7 @@ GL_PREFIX(VertexAttrib4NubARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB)
@@ -17436,7 +18164,7 @@ GL_PREFIX(VertexAttrib4NubARB):
GL_PREFIX(VertexAttrib4NubvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17446,13 +18174,13 @@ GL_PREFIX(VertexAttrib4NubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17462,7 +18190,7 @@ GL_PREFIX(VertexAttrib4NubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB)
@@ -17473,7 +18201,7 @@ GL_PREFIX(VertexAttrib4NubvARB):
GL_PREFIX(VertexAttrib4NuivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17483,13 +18211,13 @@ GL_PREFIX(VertexAttrib4NuivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17499,7 +18227,7 @@ GL_PREFIX(VertexAttrib4NuivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB)
@@ -17510,7 +18238,7 @@ GL_PREFIX(VertexAttrib4NuivARB):
GL_PREFIX(VertexAttrib4NusvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17520,13 +18248,13 @@ GL_PREFIX(VertexAttrib4NusvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17536,7 +18264,7 @@ GL_PREFIX(VertexAttrib4NusvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB)
@@ -17547,7 +18275,7 @@ GL_PREFIX(VertexAttrib4NusvARB):
GL_PREFIX(VertexAttrib4bvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17557,13 +18285,13 @@ GL_PREFIX(VertexAttrib4bvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17573,7 +18301,7 @@ GL_PREFIX(VertexAttrib4bvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB)
@@ -17584,7 +18312,7 @@ GL_PREFIX(VertexAttrib4bvARB):
GL_PREFIX(VertexAttrib4dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17600,13 +18328,13 @@ GL_PREFIX(VertexAttrib4dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17622,7 +18350,7 @@ GL_PREFIX(VertexAttrib4dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB)
@@ -17633,7 +18361,7 @@ GL_PREFIX(VertexAttrib4dARB):
GL_PREFIX(VertexAttrib4dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17643,13 +18371,13 @@ GL_PREFIX(VertexAttrib4dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17659,7 +18387,7 @@ GL_PREFIX(VertexAttrib4dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB)
@@ -17670,7 +18398,7 @@ GL_PREFIX(VertexAttrib4dvARB):
GL_PREFIX(VertexAttrib4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17686,13 +18414,13 @@ GL_PREFIX(VertexAttrib4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17708,7 +18436,7 @@ GL_PREFIX(VertexAttrib4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB)
@@ -17719,7 +18447,7 @@ GL_PREFIX(VertexAttrib4fARB):
GL_PREFIX(VertexAttrib4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17729,13 +18457,13 @@ GL_PREFIX(VertexAttrib4fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17745,7 +18473,7 @@ GL_PREFIX(VertexAttrib4fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB)
@@ -17756,7 +18484,7 @@ GL_PREFIX(VertexAttrib4fvARB):
GL_PREFIX(VertexAttrib4ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17766,13 +18494,13 @@ GL_PREFIX(VertexAttrib4ivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17782,7 +18510,7 @@ GL_PREFIX(VertexAttrib4ivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB)
@@ -17793,7 +18521,7 @@ GL_PREFIX(VertexAttrib4ivARB):
GL_PREFIX(VertexAttrib4sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17807,13 +18535,13 @@ GL_PREFIX(VertexAttrib4sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17827,7 +18555,7 @@ GL_PREFIX(VertexAttrib4sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB)
@@ -17838,7 +18566,7 @@ GL_PREFIX(VertexAttrib4sARB):
GL_PREFIX(VertexAttrib4svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17848,13 +18576,13 @@ GL_PREFIX(VertexAttrib4svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17864,7 +18592,7 @@ GL_PREFIX(VertexAttrib4svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB)
@@ -17875,7 +18603,7 @@ GL_PREFIX(VertexAttrib4svARB):
GL_PREFIX(VertexAttrib4ubvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17885,13 +18613,13 @@ GL_PREFIX(VertexAttrib4ubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17901,7 +18629,7 @@ GL_PREFIX(VertexAttrib4ubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB)
@@ -17912,7 +18640,7 @@ GL_PREFIX(VertexAttrib4ubvARB):
GL_PREFIX(VertexAttrib4uivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17922,13 +18650,13 @@ GL_PREFIX(VertexAttrib4uivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17938,7 +18666,7 @@ GL_PREFIX(VertexAttrib4uivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB)
@@ -17949,7 +18677,7 @@ GL_PREFIX(VertexAttrib4uivARB):
GL_PREFIX(VertexAttrib4usvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17959,13 +18687,13 @@ GL_PREFIX(VertexAttrib4usvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17975,7 +18703,7 @@ GL_PREFIX(VertexAttrib4usvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB)
@@ -17986,7 +18714,7 @@ GL_PREFIX(VertexAttrib4usvARB):
GL_PREFIX(VertexAttribPointerARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18004,13 +18732,13 @@ GL_PREFIX(VertexAttribPointerARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18028,7 +18756,7 @@ GL_PREFIX(VertexAttribPointerARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB)
@@ -18039,7 +18767,7 @@ GL_PREFIX(VertexAttribPointerARB):
GL_PREFIX(BindBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18049,13 +18777,13 @@ GL_PREFIX(BindBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18065,7 +18793,7 @@ GL_PREFIX(BindBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB)
@@ -18076,7 +18804,7 @@ GL_PREFIX(BindBufferARB):
GL_PREFIX(BufferDataARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18090,13 +18818,13 @@ GL_PREFIX(BufferDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18110,7 +18838,7 @@ GL_PREFIX(BufferDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB)
@@ -18121,7 +18849,7 @@ GL_PREFIX(BufferDataARB):
GL_PREFIX(BufferSubDataARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18135,13 +18863,13 @@ GL_PREFIX(BufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18155,7 +18883,7 @@ GL_PREFIX(BufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB)
@@ -18166,7 +18894,7 @@ GL_PREFIX(BufferSubDataARB):
GL_PREFIX(DeleteBuffersARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18176,13 +18904,13 @@ GL_PREFIX(DeleteBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18192,7 +18920,7 @@ GL_PREFIX(DeleteBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB)
@@ -18203,7 +18931,7 @@ GL_PREFIX(DeleteBuffersARB):
GL_PREFIX(GenBuffersARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18213,13 +18941,13 @@ GL_PREFIX(GenBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18229,7 +18957,7 @@ GL_PREFIX(GenBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB)
@@ -18240,7 +18968,7 @@ GL_PREFIX(GenBuffersARB):
GL_PREFIX(GetBufferParameterivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18250,13 +18978,13 @@ GL_PREFIX(GetBufferParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18266,7 +18994,7 @@ GL_PREFIX(GetBufferParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB)
@@ -18277,7 +19005,7 @@ GL_PREFIX(GetBufferParameterivARB):
GL_PREFIX(GetBufferPointervARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18287,13 +19015,13 @@ GL_PREFIX(GetBufferPointervARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18303,7 +19031,7 @@ GL_PREFIX(GetBufferPointervARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB)
@@ -18314,7 +19042,7 @@ GL_PREFIX(GetBufferPointervARB):
GL_PREFIX(GetBufferSubDataARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18328,13 +19056,13 @@ GL_PREFIX(GetBufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18348,7 +19076,7 @@ GL_PREFIX(GetBufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB)
@@ -18359,25 +19087,25 @@ GL_PREFIX(GetBufferSubDataARB):
GL_PREFIX(IsBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB)
@@ -18388,7 +19116,7 @@ GL_PREFIX(IsBufferARB):
GL_PREFIX(MapBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18398,13 +19126,13 @@ GL_PREFIX(MapBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18414,7 +19142,7 @@ GL_PREFIX(MapBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB)
@@ -18425,25 +19153,25 @@ GL_PREFIX(MapBufferARB):
GL_PREFIX(UnmapBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB)
@@ -18454,7 +19182,7 @@ GL_PREFIX(UnmapBufferARB):
GL_PREFIX(BeginQueryARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18464,13 +19192,13 @@ GL_PREFIX(BeginQueryARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18480,7 +19208,7 @@ GL_PREFIX(BeginQueryARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB)
@@ -18491,7 +19219,7 @@ GL_PREFIX(BeginQueryARB):
GL_PREFIX(DeleteQueriesARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18501,13 +19229,13 @@ GL_PREFIX(DeleteQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18517,7 +19245,7 @@ GL_PREFIX(DeleteQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB)
@@ -18528,25 +19256,25 @@ GL_PREFIX(DeleteQueriesARB):
GL_PREFIX(EndQueryARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB)
@@ -18557,7 +19285,7 @@ GL_PREFIX(EndQueryARB):
GL_PREFIX(GenQueriesARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18567,13 +19295,13 @@ GL_PREFIX(GenQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18583,7 +19311,7 @@ GL_PREFIX(GenQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB)
@@ -18594,7 +19322,7 @@ GL_PREFIX(GenQueriesARB):
GL_PREFIX(GetQueryObjectivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18604,13 +19332,13 @@ GL_PREFIX(GetQueryObjectivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18620,7 +19348,7 @@ GL_PREFIX(GetQueryObjectivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB)
@@ -18631,7 +19359,7 @@ GL_PREFIX(GetQueryObjectivARB):
GL_PREFIX(GetQueryObjectuivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18641,13 +19369,13 @@ GL_PREFIX(GetQueryObjectuivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18657,7 +19385,7 @@ GL_PREFIX(GetQueryObjectuivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB)
@@ -18668,7 +19396,7 @@ GL_PREFIX(GetQueryObjectuivARB):
GL_PREFIX(GetQueryivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18678,13 +19406,13 @@ GL_PREFIX(GetQueryivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18694,7 +19422,7 @@ GL_PREFIX(GetQueryivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB)
@@ -18705,25 +19433,25 @@ GL_PREFIX(GetQueryivARB):
GL_PREFIX(IsQueryARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB)
@@ -18734,7 +19462,7 @@ GL_PREFIX(IsQueryARB):
GL_PREFIX(AttachObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18744,13 +19472,13 @@ GL_PREFIX(AttachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18760,7 +19488,7 @@ GL_PREFIX(AttachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB)
@@ -18771,25 +19499,25 @@ GL_PREFIX(AttachObjectARB):
GL_PREFIX(CompileShaderARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB)
@@ -18800,25 +19528,25 @@ GL_PREFIX(CompileShaderARB):
GL_PREFIX(CreateProgramObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB)
@@ -18829,25 +19557,25 @@ GL_PREFIX(CreateProgramObjectARB):
GL_PREFIX(CreateShaderObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB)
@@ -18858,25 +19586,25 @@ GL_PREFIX(CreateShaderObjectARB):
GL_PREFIX(DeleteObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB)
@@ -18887,7 +19615,7 @@ GL_PREFIX(DeleteObjectARB):
GL_PREFIX(DetachObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18897,13 +19625,13 @@ GL_PREFIX(DetachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18913,7 +19641,7 @@ GL_PREFIX(DetachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB)
@@ -18924,7 +19652,7 @@ GL_PREFIX(DetachObjectARB):
GL_PREFIX(GetActiveUniformARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18942,13 +19670,13 @@ GL_PREFIX(GetActiveUniformARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18966,7 +19694,7 @@ GL_PREFIX(GetActiveUniformARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB)
@@ -18977,7 +19705,7 @@ GL_PREFIX(GetActiveUniformARB):
GL_PREFIX(GetAttachedObjectsARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18991,13 +19719,13 @@ GL_PREFIX(GetAttachedObjectsARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19011,7 +19739,7 @@ GL_PREFIX(GetAttachedObjectsARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB)
@@ -19022,25 +19750,25 @@ GL_PREFIX(GetAttachedObjectsARB):
GL_PREFIX(GetHandleARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB)
@@ -19051,7 +19779,7 @@ GL_PREFIX(GetHandleARB):
GL_PREFIX(GetInfoLogARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19065,13 +19793,13 @@ GL_PREFIX(GetInfoLogARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19085,7 +19813,7 @@ GL_PREFIX(GetInfoLogARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB)
@@ -19096,7 +19824,7 @@ GL_PREFIX(GetInfoLogARB):
GL_PREFIX(GetObjectParameterfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19106,13 +19834,13 @@ GL_PREFIX(GetObjectParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19122,7 +19850,7 @@ GL_PREFIX(GetObjectParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB)
@@ -19133,7 +19861,7 @@ GL_PREFIX(GetObjectParameterfvARB):
GL_PREFIX(GetObjectParameterivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19143,13 +19871,13 @@ GL_PREFIX(GetObjectParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19159,7 +19887,7 @@ GL_PREFIX(GetObjectParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB)
@@ -19170,7 +19898,7 @@ GL_PREFIX(GetObjectParameterivARB):
GL_PREFIX(GetShaderSourceARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19184,13 +19912,13 @@ GL_PREFIX(GetShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19204,7 +19932,7 @@ GL_PREFIX(GetShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB)
@@ -19215,7 +19943,7 @@ GL_PREFIX(GetShaderSourceARB):
GL_PREFIX(GetUniformLocationARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19225,13 +19953,13 @@ GL_PREFIX(GetUniformLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19241,7 +19969,7 @@ GL_PREFIX(GetUniformLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB)
@@ -19252,7 +19980,7 @@ GL_PREFIX(GetUniformLocationARB):
GL_PREFIX(GetUniformfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19262,13 +19990,13 @@ GL_PREFIX(GetUniformfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19278,7 +20006,7 @@ GL_PREFIX(GetUniformfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB)
@@ -19289,7 +20017,7 @@ GL_PREFIX(GetUniformfvARB):
GL_PREFIX(GetUniformivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19299,13 +20027,13 @@ GL_PREFIX(GetUniformivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19315,7 +20043,7 @@ GL_PREFIX(GetUniformivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB)
@@ -19326,25 +20054,25 @@ GL_PREFIX(GetUniformivARB):
GL_PREFIX(LinkProgramARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB)
@@ -19355,7 +20083,7 @@ GL_PREFIX(LinkProgramARB):
GL_PREFIX(ShaderSourceARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19369,13 +20097,13 @@ GL_PREFIX(ShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19389,7 +20117,7 @@ GL_PREFIX(ShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB)
@@ -19400,7 +20128,7 @@ GL_PREFIX(ShaderSourceARB):
GL_PREFIX(Uniform1fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -19410,13 +20138,13 @@ GL_PREFIX(Uniform1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -19426,7 +20154,7 @@ GL_PREFIX(Uniform1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB)
@@ -19437,7 +20165,7 @@ GL_PREFIX(Uniform1fARB):
GL_PREFIX(Uniform1fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19447,13 +20175,13 @@ GL_PREFIX(Uniform1fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19463,7 +20191,7 @@ GL_PREFIX(Uniform1fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB)
@@ -19474,7 +20202,7 @@ GL_PREFIX(Uniform1fvARB):
GL_PREFIX(Uniform1iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19484,13 +20212,13 @@ GL_PREFIX(Uniform1iARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19500,7 +20228,7 @@ GL_PREFIX(Uniform1iARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB)
@@ -19511,7 +20239,7 @@ GL_PREFIX(Uniform1iARB):
GL_PREFIX(Uniform1ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19521,13 +20249,13 @@ GL_PREFIX(Uniform1ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19537,7 +20265,7 @@ GL_PREFIX(Uniform1ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB)
@@ -19548,7 +20276,7 @@ GL_PREFIX(Uniform1ivARB):
GL_PREFIX(Uniform2fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -19560,13 +20288,13 @@ GL_PREFIX(Uniform2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -19578,7 +20306,7 @@ GL_PREFIX(Uniform2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB)
@@ -19589,7 +20317,7 @@ GL_PREFIX(Uniform2fARB):
GL_PREFIX(Uniform2fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19599,13 +20327,13 @@ GL_PREFIX(Uniform2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19615,7 +20343,7 @@ GL_PREFIX(Uniform2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB)
@@ -19626,7 +20354,7 @@ GL_PREFIX(Uniform2fvARB):
GL_PREFIX(Uniform2iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19636,13 +20364,13 @@ GL_PREFIX(Uniform2iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19652,7 +20380,7 @@ GL_PREFIX(Uniform2iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB)
@@ -19663,7 +20391,7 @@ GL_PREFIX(Uniform2iARB):
GL_PREFIX(Uniform2ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19673,13 +20401,13 @@ GL_PREFIX(Uniform2ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19689,7 +20417,7 @@ GL_PREFIX(Uniform2ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB)
@@ -19700,7 +20428,7 @@ GL_PREFIX(Uniform2ivARB):
GL_PREFIX(Uniform3fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -19714,13 +20442,13 @@ GL_PREFIX(Uniform3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -19734,7 +20462,7 @@ GL_PREFIX(Uniform3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB)
@@ -19745,7 +20473,7 @@ GL_PREFIX(Uniform3fARB):
GL_PREFIX(Uniform3fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19755,13 +20483,13 @@ GL_PREFIX(Uniform3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19771,7 +20499,7 @@ GL_PREFIX(Uniform3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB)
@@ -19782,7 +20510,7 @@ GL_PREFIX(Uniform3fvARB):
GL_PREFIX(Uniform3iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19796,13 +20524,13 @@ GL_PREFIX(Uniform3iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19816,7 +20544,7 @@ GL_PREFIX(Uniform3iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB)
@@ -19827,7 +20555,7 @@ GL_PREFIX(Uniform3iARB):
GL_PREFIX(Uniform3ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19837,13 +20565,13 @@ GL_PREFIX(Uniform3ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19853,7 +20581,7 @@ GL_PREFIX(Uniform3ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB)
@@ -19864,7 +20592,7 @@ GL_PREFIX(Uniform3ivARB):
GL_PREFIX(Uniform4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -19880,13 +20608,13 @@ GL_PREFIX(Uniform4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -19902,7 +20630,7 @@ GL_PREFIX(Uniform4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB)
@@ -19913,7 +20641,7 @@ GL_PREFIX(Uniform4fARB):
GL_PREFIX(Uniform4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19923,13 +20651,13 @@ GL_PREFIX(Uniform4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19939,7 +20667,7 @@ GL_PREFIX(Uniform4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB)
@@ -19950,7 +20678,7 @@ GL_PREFIX(Uniform4fvARB):
GL_PREFIX(Uniform4iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19964,13 +20692,13 @@ GL_PREFIX(Uniform4iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19984,7 +20712,7 @@ GL_PREFIX(Uniform4iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB)
@@ -19995,7 +20723,7 @@ GL_PREFIX(Uniform4iARB):
GL_PREFIX(Uniform4ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20005,13 +20733,13 @@ GL_PREFIX(Uniform4ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20021,7 +20749,7 @@ GL_PREFIX(Uniform4ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB)
@@ -20032,7 +20760,7 @@ GL_PREFIX(Uniform4ivARB):
GL_PREFIX(UniformMatrix2fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20046,13 +20774,13 @@ GL_PREFIX(UniformMatrix2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20066,7 +20794,7 @@ GL_PREFIX(UniformMatrix2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB)
@@ -20077,7 +20805,7 @@ GL_PREFIX(UniformMatrix2fvARB):
GL_PREFIX(UniformMatrix3fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20091,13 +20819,13 @@ GL_PREFIX(UniformMatrix3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20111,7 +20839,7 @@ GL_PREFIX(UniformMatrix3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB)
@@ -20122,7 +20850,7 @@ GL_PREFIX(UniformMatrix3fvARB):
GL_PREFIX(UniformMatrix4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20136,13 +20864,13 @@ GL_PREFIX(UniformMatrix4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20156,7 +20884,7 @@ GL_PREFIX(UniformMatrix4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB)
@@ -20167,25 +20895,25 @@ GL_PREFIX(UniformMatrix4fvARB):
GL_PREFIX(UseProgramObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB)
@@ -20196,25 +20924,25 @@ GL_PREFIX(UseProgramObjectARB):
GL_PREFIX(ValidateProgramARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB)
@@ -20225,7 +20953,7 @@ GL_PREFIX(ValidateProgramARB):
GL_PREFIX(BindAttribLocationARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20235,13 +20963,13 @@ GL_PREFIX(BindAttribLocationARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20251,7 +20979,7 @@ GL_PREFIX(BindAttribLocationARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB)
@@ -20262,7 +20990,7 @@ GL_PREFIX(BindAttribLocationARB):
GL_PREFIX(GetActiveAttribARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20280,13 +21008,13 @@ GL_PREFIX(GetActiveAttribARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20304,7 +21032,7 @@ GL_PREFIX(GetActiveAttribARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB)
@@ -20315,7 +21043,7 @@ GL_PREFIX(GetActiveAttribARB):
GL_PREFIX(GetAttribLocationARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20325,13 +21053,13 @@ GL_PREFIX(GetAttribLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20341,7 +21069,7 @@ GL_PREFIX(GetAttribLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB)
@@ -20352,7 +21080,7 @@ GL_PREFIX(GetAttribLocationARB):
GL_PREFIX(DrawBuffersARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20362,13 +21090,13 @@ GL_PREFIX(DrawBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20378,7 +21106,7 @@ GL_PREFIX(DrawBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB)
@@ -20389,7 +21117,7 @@ GL_PREFIX(DrawBuffersARB):
GL_PREFIX(PolygonOffsetEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -20399,13 +21127,13 @@ GL_PREFIX(PolygonOffsetEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -20415,561 +21143,19 @@ GL_PREFIX(PolygonOffsetEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_543)
- .type GL_PREFIX(_dispatch_stub_543), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_543))
-GL_PREFIX(_dispatch_stub_543):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_543), .-GL_PREFIX(_dispatch_stub_543)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_544)
- .type GL_PREFIX(_dispatch_stub_544), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_544))
-GL_PREFIX(_dispatch_stub_544):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_544), .-GL_PREFIX(_dispatch_stub_544)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_545)
- .type GL_PREFIX(_dispatch_stub_545), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_545))
-GL_PREFIX(_dispatch_stub_545):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_545), .-GL_PREFIX(_dispatch_stub_545)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_546)
- .type GL_PREFIX(_dispatch_stub_546), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_546))
-GL_PREFIX(_dispatch_stub_546):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_546), .-GL_PREFIX(_dispatch_stub_546)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_547)
- .type GL_PREFIX(_dispatch_stub_547), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_547))
-GL_PREFIX(_dispatch_stub_547):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_547), .-GL_PREFIX(_dispatch_stub_547)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_548)
- .type GL_PREFIX(_dispatch_stub_548), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_548))
-GL_PREFIX(_dispatch_stub_548):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_548), .-GL_PREFIX(_dispatch_stub_548)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_549)
- .type GL_PREFIX(_dispatch_stub_549), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_549))
-GL_PREFIX(_dispatch_stub_549):
-#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
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- 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
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_549), .-GL_PREFIX(_dispatch_stub_549)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_550)
- .type GL_PREFIX(_dispatch_stub_550), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_550))
-GL_PREFIX(_dispatch_stub_550):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_550), .-GL_PREFIX(_dispatch_stub_550)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_551)
- .type GL_PREFIX(_dispatch_stub_551), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_551))
-GL_PREFIX(_dispatch_stub_551):
-#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(_dispatch_stub_551), .-GL_PREFIX(_dispatch_stub_551)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_552)
- .type GL_PREFIX(_dispatch_stub_552), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_552))
-GL_PREFIX(_dispatch_stub_552):
-#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
- 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 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
- 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 4416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_552), .-GL_PREFIX(_dispatch_stub_552)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_553)
- .type GL_PREFIX(_dispatch_stub_553), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_553))
-GL_PREFIX(_dispatch_stub_553):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_553), .-GL_PREFIX(_dispatch_stub_553)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_554)
- .type GL_PREFIX(_dispatch_stub_554), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_554))
-GL_PREFIX(_dispatch_stub_554):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_554), .-GL_PREFIX(_dispatch_stub_554)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_555)
- .type GL_PREFIX(_dispatch_stub_555), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_555))
-GL_PREFIX(_dispatch_stub_555):
-#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 %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- 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 %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_555), .-GL_PREFIX(_dispatch_stub_555)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_556)
- .type GL_PREFIX(_dispatch_stub_556), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_556))
-GL_PREFIX(_dispatch_stub_556):
+ .globl GL_PREFIX(_dispatch_stub_562)
+ .type GL_PREFIX(_dispatch_stub_562), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_562))
+GL_PREFIX(_dispatch_stub_562):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4448(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20979,13 +21165,13 @@ GL_PREFIX(_dispatch_stub_556):
popq %rbp
popq %rsi
popq %rdi
- movq 4448(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4448(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20995,19 +21181,19 @@ GL_PREFIX(_dispatch_stub_556):
popq %rbp
popq %rsi
popq %rdi
- movq 4448(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_556), .-GL_PREFIX(_dispatch_stub_556)
+ .size GL_PREFIX(_dispatch_stub_562), .-GL_PREFIX(_dispatch_stub_562)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_557)
- .type GL_PREFIX(_dispatch_stub_557), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_557))
-GL_PREFIX(_dispatch_stub_557):
+ .globl GL_PREFIX(_dispatch_stub_563)
+ .type GL_PREFIX(_dispatch_stub_563), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_563))
+GL_PREFIX(_dispatch_stub_563):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4456(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21017,13 +21203,13 @@ GL_PREFIX(_dispatch_stub_557):
popq %rbp
popq %rsi
popq %rdi
- movq 4456(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4456(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21033,19 +21219,19 @@ GL_PREFIX(_dispatch_stub_557):
popq %rbp
popq %rsi
popq %rdi
- movq 4456(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_557), .-GL_PREFIX(_dispatch_stub_557)
+ .size GL_PREFIX(_dispatch_stub_563), .-GL_PREFIX(_dispatch_stub_563)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_558)
- .type GL_PREFIX(_dispatch_stub_558), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_558))
-GL_PREFIX(_dispatch_stub_558):
+ .globl GL_PREFIX(_dispatch_stub_564)
+ .type GL_PREFIX(_dispatch_stub_564), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_564))
+GL_PREFIX(_dispatch_stub_564):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4464(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -21055,13 +21241,13 @@ GL_PREFIX(_dispatch_stub_558):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4464(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4464(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -21071,57 +21257,19 @@ GL_PREFIX(_dispatch_stub_558):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_558), .-GL_PREFIX(_dispatch_stub_558)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_559)
- .type GL_PREFIX(_dispatch_stub_559), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_559))
-GL_PREFIX(_dispatch_stub_559):
-#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 %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- 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 %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4472(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_559), .-GL_PREFIX(_dispatch_stub_559)
+ .size GL_PREFIX(_dispatch_stub_564), .-GL_PREFIX(_dispatch_stub_564)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_560)
- .type GL_PREFIX(_dispatch_stub_560), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_560))
-GL_PREFIX(_dispatch_stub_560):
+ .globl GL_PREFIX(_dispatch_stub_565)
+ .type GL_PREFIX(_dispatch_stub_565), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_565))
+GL_PREFIX(_dispatch_stub_565):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4480(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21131,13 +21279,13 @@ GL_PREFIX(_dispatch_stub_560):
popq %rbp
popq %rsi
popq %rdi
- movq 4480(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4480(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21147,19 +21295,19 @@ GL_PREFIX(_dispatch_stub_560):
popq %rbp
popq %rsi
popq %rdi
- movq 4480(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_560), .-GL_PREFIX(_dispatch_stub_560)
+ .size GL_PREFIX(_dispatch_stub_565), .-GL_PREFIX(_dispatch_stub_565)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_561)
- .type GL_PREFIX(_dispatch_stub_561), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_561))
-GL_PREFIX(_dispatch_stub_561):
+ .globl GL_PREFIX(_dispatch_stub_566)
+ .type GL_PREFIX(_dispatch_stub_566), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_566))
+GL_PREFIX(_dispatch_stub_566):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4488(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21169,13 +21317,13 @@ GL_PREFIX(_dispatch_stub_561):
popq %rbp
popq %rsi
popq %rdi
- movq 4488(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4488(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21185,55 +21333,19 @@ GL_PREFIX(_dispatch_stub_561):
popq %rbp
popq %rsi
popq %rdi
- movq 4488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_561), .-GL_PREFIX(_dispatch_stub_561)
-
- .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 4496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4496(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AreTexturesResidentEXT), .-GL_PREFIX(AreTexturesResidentEXT)
+ .size GL_PREFIX(_dispatch_stub_566), .-GL_PREFIX(_dispatch_stub_566)
.p2align 4,,15
- .globl GL_PREFIX(GenTexturesEXT)
- .type GL_PREFIX(GenTexturesEXT), @function
-GL_PREFIX(GenTexturesEXT):
+ .globl GL_PREFIX(_dispatch_stub_567)
+ .type GL_PREFIX(_dispatch_stub_567), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_567))
+GL_PREFIX(_dispatch_stub_567):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4504(%rax), %r11
+ movq 4536(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21243,13 +21355,13 @@ GL_PREFIX(GenTexturesEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4504(%rax), %r11
+ movq 4536(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4504(%rax), %r11
+ movq 4536(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21259,48 +21371,19 @@ GL_PREFIX(GenTexturesEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4504(%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 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
+ movq 4536(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsTextureEXT), .-GL_PREFIX(IsTextureEXT)
+ .size GL_PREFIX(_dispatch_stub_567), .-GL_PREFIX(_dispatch_stub_567)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_565)
- .type GL_PREFIX(_dispatch_stub_565), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_565))
-GL_PREFIX(_dispatch_stub_565):
+ .globl GL_PREFIX(_dispatch_stub_568)
+ .type GL_PREFIX(_dispatch_stub_568), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_568))
+GL_PREFIX(_dispatch_stub_568):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4520(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21310,13 +21393,13 @@ GL_PREFIX(_dispatch_stub_565):
popq %rbp
popq %rsi
popq %rdi
- movq 4520(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4520(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21326,40 +21409,40 @@ GL_PREFIX(_dispatch_stub_565):
popq %rbp
popq %rsi
popq %rdi
- movq 4520(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_565), .-GL_PREFIX(_dispatch_stub_565)
+ .size GL_PREFIX(_dispatch_stub_568), .-GL_PREFIX(_dispatch_stub_568)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_566)
- .type GL_PREFIX(_dispatch_stub_566), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_566))
-GL_PREFIX(_dispatch_stub_566):
+ .globl GL_PREFIX(_dispatch_stub_569)
+ .type GL_PREFIX(_dispatch_stub_569), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_569))
+GL_PREFIX(_dispatch_stub_569):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4528(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4528(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4528(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4528(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_566), .-GL_PREFIX(_dispatch_stub_566)
+ .size GL_PREFIX(_dispatch_stub_569), .-GL_PREFIX(_dispatch_stub_569)
.p2align 4,,15
.globl GL_PREFIX(ColorPointerEXT)
@@ -21367,7 +21450,7 @@ GL_PREFIX(_dispatch_stub_566):
GL_PREFIX(ColorPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4536(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21381,13 +21464,13 @@ GL_PREFIX(ColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4536(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4536(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21401,7 +21484,7 @@ GL_PREFIX(ColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4536(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT)
@@ -21412,7 +21495,7 @@ GL_PREFIX(ColorPointerEXT):
GL_PREFIX(EdgeFlagPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4544(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21422,13 +21505,13 @@ GL_PREFIX(EdgeFlagPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4544(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4544(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21438,7 +21521,7 @@ GL_PREFIX(EdgeFlagPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4544(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT)
@@ -21449,7 +21532,7 @@ GL_PREFIX(EdgeFlagPointerEXT):
GL_PREFIX(IndexPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4552(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21463,13 +21546,13 @@ GL_PREFIX(IndexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4552(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4552(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21483,7 +21566,7 @@ GL_PREFIX(IndexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4552(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT)
@@ -21494,7 +21577,7 @@ GL_PREFIX(IndexPointerEXT):
GL_PREFIX(NormalPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4560(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21508,13 +21591,13 @@ GL_PREFIX(NormalPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4560(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4560(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21528,7 +21611,7 @@ GL_PREFIX(NormalPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4560(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT)
@@ -21539,7 +21622,7 @@ GL_PREFIX(NormalPointerEXT):
GL_PREFIX(TexCoordPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4568(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21553,13 +21636,13 @@ GL_PREFIX(TexCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4568(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4568(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21573,7 +21656,7 @@ GL_PREFIX(TexCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4568(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT)
@@ -21584,7 +21667,7 @@ GL_PREFIX(TexCoordPointerEXT):
GL_PREFIX(VertexPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4576(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21598,13 +21681,13 @@ GL_PREFIX(VertexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4576(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4576(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21618,7 +21701,7 @@ GL_PREFIX(VertexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4576(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT)
@@ -21629,7 +21712,7 @@ GL_PREFIX(VertexPointerEXT):
GL_PREFIX(PointParameterfEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4584(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -21639,13 +21722,13 @@ GL_PREFIX(PointParameterfEXT):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4584(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4584(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -21655,7 +21738,7 @@ GL_PREFIX(PointParameterfEXT):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4584(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT)
@@ -21666,7 +21749,7 @@ GL_PREFIX(PointParameterfEXT):
GL_PREFIX(PointParameterfvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4592(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21676,13 +21759,13 @@ GL_PREFIX(PointParameterfvEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4592(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4592(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21692,7 +21775,7 @@ GL_PREFIX(PointParameterfvEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4592(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT)
@@ -21703,7 +21786,7 @@ GL_PREFIX(PointParameterfvEXT):
GL_PREFIX(LockArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4600(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21713,13 +21796,13 @@ GL_PREFIX(LockArraysEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4600(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4600(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21729,7 +21812,7 @@ GL_PREFIX(LockArraysEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4600(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT)
@@ -21740,37 +21823,37 @@ GL_PREFIX(LockArraysEXT):
GL_PREFIX(UnlockArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4608(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4608(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4608(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4608(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_577)
- .type GL_PREFIX(_dispatch_stub_577), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_577))
-GL_PREFIX(_dispatch_stub_577):
+ .globl GL_PREFIX(_dispatch_stub_580)
+ .type GL_PREFIX(_dispatch_stub_580), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_580))
+GL_PREFIX(_dispatch_stub_580):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4616(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21780,13 +21863,13 @@ GL_PREFIX(_dispatch_stub_577):
popq %rbp
popq %rsi
popq %rdi
- movq 4616(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4616(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21796,19 +21879,19 @@ GL_PREFIX(_dispatch_stub_577):
popq %rbp
popq %rsi
popq %rdi
- movq 4616(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_577), .-GL_PREFIX(_dispatch_stub_577)
+ .size GL_PREFIX(_dispatch_stub_580), .-GL_PREFIX(_dispatch_stub_580)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_578)
- .type GL_PREFIX(_dispatch_stub_578), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_578))
-GL_PREFIX(_dispatch_stub_578):
+ .globl GL_PREFIX(_dispatch_stub_581)
+ .type GL_PREFIX(_dispatch_stub_581), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_581))
+GL_PREFIX(_dispatch_stub_581):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4624(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21818,13 +21901,13 @@ GL_PREFIX(_dispatch_stub_578):
popq %rbp
popq %rsi
popq %rdi
- movq 4624(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4624(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21834,10 +21917,10 @@ GL_PREFIX(_dispatch_stub_578):
popq %rbp
popq %rsi
popq %rdi
- movq 4624(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_578), .-GL_PREFIX(_dispatch_stub_578)
+ .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581)
.p2align 4,,15
.globl GL_PREFIX(SecondaryColor3bEXT)
@@ -21845,7 +21928,7 @@ GL_PREFIX(_dispatch_stub_578):
GL_PREFIX(SecondaryColor3bEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4632(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21855,13 +21938,13 @@ GL_PREFIX(SecondaryColor3bEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4632(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4632(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21871,7 +21954,7 @@ GL_PREFIX(SecondaryColor3bEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4632(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT)
@@ -21882,25 +21965,25 @@ GL_PREFIX(SecondaryColor3bEXT):
GL_PREFIX(SecondaryColor3bvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4640(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4640(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4640(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4640(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT)
@@ -21911,7 +21994,7 @@ GL_PREFIX(SecondaryColor3bvEXT):
GL_PREFIX(SecondaryColor3dEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4648(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -21923,13 +22006,13 @@ GL_PREFIX(SecondaryColor3dEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4648(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4648(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -21941,7 +22024,7 @@ GL_PREFIX(SecondaryColor3dEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4648(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT)
@@ -21952,25 +22035,25 @@ GL_PREFIX(SecondaryColor3dEXT):
GL_PREFIX(SecondaryColor3dvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4656(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4656(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4656(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4656(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT)
@@ -21981,7 +22064,7 @@ GL_PREFIX(SecondaryColor3dvEXT):
GL_PREFIX(SecondaryColor3fEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4664(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -21993,13 +22076,13 @@ GL_PREFIX(SecondaryColor3fEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4664(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4664(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -22011,7 +22094,7 @@ GL_PREFIX(SecondaryColor3fEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4664(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT)
@@ -22022,25 +22105,25 @@ GL_PREFIX(SecondaryColor3fEXT):
GL_PREFIX(SecondaryColor3fvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4672(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4672(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4672(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4672(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT)
@@ -22051,7 +22134,7 @@ GL_PREFIX(SecondaryColor3fvEXT):
GL_PREFIX(SecondaryColor3iEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4680(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22061,13 +22144,13 @@ GL_PREFIX(SecondaryColor3iEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4680(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4680(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22077,7 +22160,7 @@ GL_PREFIX(SecondaryColor3iEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4680(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT)
@@ -22088,25 +22171,25 @@ GL_PREFIX(SecondaryColor3iEXT):
GL_PREFIX(SecondaryColor3ivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4688(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4688(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4688(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4688(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT)
@@ -22117,7 +22200,7 @@ GL_PREFIX(SecondaryColor3ivEXT):
GL_PREFIX(SecondaryColor3sEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4696(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22127,13 +22210,13 @@ GL_PREFIX(SecondaryColor3sEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4696(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4696(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22143,7 +22226,7 @@ GL_PREFIX(SecondaryColor3sEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4696(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT)
@@ -22154,25 +22237,25 @@ GL_PREFIX(SecondaryColor3sEXT):
GL_PREFIX(SecondaryColor3svEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4704(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4704(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4704(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4704(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT)
@@ -22183,7 +22266,7 @@ GL_PREFIX(SecondaryColor3svEXT):
GL_PREFIX(SecondaryColor3ubEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4712(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22193,13 +22276,13 @@ GL_PREFIX(SecondaryColor3ubEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4712(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4712(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22209,7 +22292,7 @@ GL_PREFIX(SecondaryColor3ubEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4712(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT)
@@ -22220,25 +22303,25 @@ GL_PREFIX(SecondaryColor3ubEXT):
GL_PREFIX(SecondaryColor3ubvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4720(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4720(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4720(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4720(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT)
@@ -22249,7 +22332,7 @@ GL_PREFIX(SecondaryColor3ubvEXT):
GL_PREFIX(SecondaryColor3uiEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4728(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22259,13 +22342,13 @@ GL_PREFIX(SecondaryColor3uiEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4728(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4728(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22275,7 +22358,7 @@ GL_PREFIX(SecondaryColor3uiEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4728(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT)
@@ -22286,25 +22369,25 @@ GL_PREFIX(SecondaryColor3uiEXT):
GL_PREFIX(SecondaryColor3uivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4736(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4736(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4736(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4736(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT)
@@ -22315,7 +22398,7 @@ GL_PREFIX(SecondaryColor3uivEXT):
GL_PREFIX(SecondaryColor3usEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4744(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22325,13 +22408,13 @@ GL_PREFIX(SecondaryColor3usEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4744(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4744(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22341,7 +22424,7 @@ GL_PREFIX(SecondaryColor3usEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4744(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT)
@@ -22352,25 +22435,25 @@ GL_PREFIX(SecondaryColor3usEXT):
GL_PREFIX(SecondaryColor3usvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4752(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4752(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4752(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4752(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT)
@@ -22381,7 +22464,7 @@ GL_PREFIX(SecondaryColor3usvEXT):
GL_PREFIX(SecondaryColorPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4760(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22395,13 +22478,13 @@ GL_PREFIX(SecondaryColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4760(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4760(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22415,7 +22498,7 @@ GL_PREFIX(SecondaryColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4760(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT)
@@ -22426,7 +22509,7 @@ GL_PREFIX(SecondaryColorPointerEXT):
GL_PREFIX(MultiDrawArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4768(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22440,13 +22523,13 @@ GL_PREFIX(MultiDrawArraysEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4768(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4768(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22460,7 +22543,7 @@ GL_PREFIX(MultiDrawArraysEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4768(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT)
@@ -22471,7 +22554,7 @@ GL_PREFIX(MultiDrawArraysEXT):
GL_PREFIX(MultiDrawElementsEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4776(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22485,13 +22568,13 @@ GL_PREFIX(MultiDrawElementsEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4776(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4776(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22505,7 +22588,7 @@ GL_PREFIX(MultiDrawElementsEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4776(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT)
@@ -22516,7 +22599,7 @@ GL_PREFIX(MultiDrawElementsEXT):
GL_PREFIX(FogCoordPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4784(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22526,13 +22609,13 @@ GL_PREFIX(FogCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4784(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4784(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22542,7 +22625,7 @@ GL_PREFIX(FogCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4784(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT)
@@ -22553,7 +22636,7 @@ GL_PREFIX(FogCoordPointerEXT):
GL_PREFIX(FogCoorddEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4792(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $8, %rsp
@@ -22561,13 +22644,13 @@ GL_PREFIX(FogCoorddEXT):
call _x86_64_get_dispatch@PLT
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4792(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4792(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
1:
subq $8, %rsp
@@ -22575,7 +22658,7 @@ GL_PREFIX(FogCoorddEXT):
call _glapi_get_dispatch
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4792(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT)
@@ -22586,25 +22669,25 @@ GL_PREFIX(FogCoorddEXT):
GL_PREFIX(FogCoorddvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4800(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4800(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4800(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4800(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT)
@@ -22615,7 +22698,7 @@ GL_PREFIX(FogCoorddvEXT):
GL_PREFIX(FogCoordfEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4808(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $8, %rsp
@@ -22623,13 +22706,13 @@ GL_PREFIX(FogCoordfEXT):
call _x86_64_get_dispatch@PLT
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4808(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4808(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
1:
subq $8, %rsp
@@ -22637,7 +22720,7 @@ GL_PREFIX(FogCoordfEXT):
call _glapi_get_dispatch
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4808(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT)
@@ -22648,58 +22731,58 @@ GL_PREFIX(FogCoordfEXT):
GL_PREFIX(FogCoordfvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4816(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4816(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4816(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4816(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_603)
- .type GL_PREFIX(_dispatch_stub_603), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_603))
-GL_PREFIX(_dispatch_stub_603):
+ .globl GL_PREFIX(_dispatch_stub_606)
+ .type GL_PREFIX(_dispatch_stub_606), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_606))
+GL_PREFIX(_dispatch_stub_606):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4824(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4824(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4824(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4824(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_603), .-GL_PREFIX(_dispatch_stub_603)
+ .size GL_PREFIX(_dispatch_stub_606), .-GL_PREFIX(_dispatch_stub_606)
.p2align 4,,15
.globl GL_PREFIX(BlendFuncSeparateEXT)
@@ -22707,7 +22790,7 @@ GL_PREFIX(_dispatch_stub_603):
GL_PREFIX(BlendFuncSeparateEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4832(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22721,13 +22804,13 @@ GL_PREFIX(BlendFuncSeparateEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4832(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4832(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22741,7 +22824,7 @@ GL_PREFIX(BlendFuncSeparateEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4832(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT)
@@ -22752,25 +22835,25 @@ GL_PREFIX(BlendFuncSeparateEXT):
GL_PREFIX(FlushVertexArrayRangeNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4840(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4840(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4840(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4840(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV)
@@ -22781,7 +22864,7 @@ GL_PREFIX(FlushVertexArrayRangeNV):
GL_PREFIX(VertexArrayRangeNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4848(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22791,13 +22874,13 @@ GL_PREFIX(VertexArrayRangeNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4848(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4848(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22807,7 +22890,7 @@ GL_PREFIX(VertexArrayRangeNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4848(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV)
@@ -22818,7 +22901,7 @@ GL_PREFIX(VertexArrayRangeNV):
GL_PREFIX(CombinerInputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4856(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22836,13 +22919,13 @@ GL_PREFIX(CombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4856(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4856(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22860,7 +22943,7 @@ GL_PREFIX(CombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4856(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV)
@@ -22871,7 +22954,7 @@ GL_PREFIX(CombinerInputNV):
GL_PREFIX(CombinerOutputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4864(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22889,13 +22972,13 @@ GL_PREFIX(CombinerOutputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4864(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4864(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22913,7 +22996,7 @@ GL_PREFIX(CombinerOutputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4864(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV)
@@ -22924,7 +23007,7 @@ GL_PREFIX(CombinerOutputNV):
GL_PREFIX(CombinerParameterfNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4872(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -22934,13 +23017,13 @@ GL_PREFIX(CombinerParameterfNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4872(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4872(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -22950,7 +23033,7 @@ GL_PREFIX(CombinerParameterfNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4872(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV)
@@ -22961,7 +23044,7 @@ GL_PREFIX(CombinerParameterfNV):
GL_PREFIX(CombinerParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4880(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22971,13 +23054,13 @@ GL_PREFIX(CombinerParameterfvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4880(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4880(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22987,7 +23070,7 @@ GL_PREFIX(CombinerParameterfvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4880(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV)
@@ -22998,7 +23081,7 @@ GL_PREFIX(CombinerParameterfvNV):
GL_PREFIX(CombinerParameteriNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4888(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23008,13 +23091,13 @@ GL_PREFIX(CombinerParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4888(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4888(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23024,7 +23107,7 @@ GL_PREFIX(CombinerParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4888(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV)
@@ -23035,7 +23118,7 @@ GL_PREFIX(CombinerParameteriNV):
GL_PREFIX(CombinerParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4896(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23045,13 +23128,13 @@ GL_PREFIX(CombinerParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4896(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4896(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23061,7 +23144,7 @@ GL_PREFIX(CombinerParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4896(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV)
@@ -23072,7 +23155,7 @@ GL_PREFIX(CombinerParameterivNV):
GL_PREFIX(FinalCombinerInputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4904(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23086,13 +23169,13 @@ GL_PREFIX(FinalCombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4904(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4904(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23106,7 +23189,7 @@ GL_PREFIX(FinalCombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4904(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV)
@@ -23117,7 +23200,7 @@ GL_PREFIX(FinalCombinerInputNV):
GL_PREFIX(GetCombinerInputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4912(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23131,13 +23214,13 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4912(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4912(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23151,7 +23234,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4912(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV)
@@ -23162,7 +23245,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
GL_PREFIX(GetCombinerInputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4920(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23176,13 +23259,13 @@ GL_PREFIX(GetCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4920(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4920(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23196,7 +23279,7 @@ GL_PREFIX(GetCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4920(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV)
@@ -23207,7 +23290,7 @@ GL_PREFIX(GetCombinerInputParameterivNV):
GL_PREFIX(GetCombinerOutputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4928(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23221,13 +23304,13 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4928(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4928(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23241,7 +23324,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4928(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV)
@@ -23252,7 +23335,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
GL_PREFIX(GetCombinerOutputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4936(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23266,13 +23349,13 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4936(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4936(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23286,7 +23369,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4936(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV)
@@ -23297,7 +23380,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
GL_PREFIX(GetFinalCombinerInputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4944(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23307,13 +23390,13 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4944(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4944(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23323,7 +23406,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4944(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV)
@@ -23334,7 +23417,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
GL_PREFIX(GetFinalCombinerInputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4952(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23344,13 +23427,13 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4952(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4952(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23360,7 +23443,7 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4952(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV)
@@ -23371,25 +23454,25 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
GL_PREFIX(ResizeBuffersMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4960(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4960(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4960(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4960(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA)
@@ -23400,7 +23483,7 @@ GL_PREFIX(ResizeBuffersMESA):
GL_PREFIX(WindowPos2dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4968(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23410,13 +23493,13 @@ GL_PREFIX(WindowPos2dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4968(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4968(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23426,7 +23509,7 @@ GL_PREFIX(WindowPos2dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4968(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA)
@@ -23437,25 +23520,25 @@ GL_PREFIX(WindowPos2dMESA):
GL_PREFIX(WindowPos2dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4976(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4976(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4976(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4976(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA)
@@ -23466,7 +23549,7 @@ GL_PREFIX(WindowPos2dvMESA):
GL_PREFIX(WindowPos2fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4984(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23476,13 +23559,13 @@ GL_PREFIX(WindowPos2fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4984(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4984(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23492,7 +23575,7 @@ GL_PREFIX(WindowPos2fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4984(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA)
@@ -23503,25 +23586,25 @@ GL_PREFIX(WindowPos2fMESA):
GL_PREFIX(WindowPos2fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4992(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4992(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4992(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4992(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA)
@@ -23532,7 +23615,7 @@ GL_PREFIX(WindowPos2fvMESA):
GL_PREFIX(WindowPos2iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5000(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23542,13 +23625,13 @@ GL_PREFIX(WindowPos2iMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5000(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5000(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23558,7 +23641,7 @@ GL_PREFIX(WindowPos2iMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5000(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA)
@@ -23569,25 +23652,25 @@ GL_PREFIX(WindowPos2iMESA):
GL_PREFIX(WindowPos2ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5008(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5008(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5008(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5008(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA)
@@ -23598,7 +23681,7 @@ GL_PREFIX(WindowPos2ivMESA):
GL_PREFIX(WindowPos2sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5016(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23608,13 +23691,13 @@ GL_PREFIX(WindowPos2sMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5016(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5016(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23624,7 +23707,7 @@ GL_PREFIX(WindowPos2sMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5016(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA)
@@ -23635,25 +23718,25 @@ GL_PREFIX(WindowPos2sMESA):
GL_PREFIX(WindowPos2svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5024(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5024(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5024(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5024(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA)
@@ -23664,7 +23747,7 @@ GL_PREFIX(WindowPos2svMESA):
GL_PREFIX(WindowPos3dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5032(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23676,13 +23759,13 @@ GL_PREFIX(WindowPos3dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5032(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5032(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23694,7 +23777,7 @@ GL_PREFIX(WindowPos3dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5032(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA)
@@ -23705,25 +23788,25 @@ GL_PREFIX(WindowPos3dMESA):
GL_PREFIX(WindowPos3dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5040(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5040(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5040(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5040(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA)
@@ -23734,7 +23817,7 @@ GL_PREFIX(WindowPos3dvMESA):
GL_PREFIX(WindowPos3fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5048(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23746,13 +23829,13 @@ GL_PREFIX(WindowPos3fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5048(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5048(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23764,7 +23847,7 @@ GL_PREFIX(WindowPos3fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5048(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA)
@@ -23775,25 +23858,25 @@ GL_PREFIX(WindowPos3fMESA):
GL_PREFIX(WindowPos3fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5056(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5056(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5056(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5056(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA)
@@ -23804,7 +23887,7 @@ GL_PREFIX(WindowPos3fvMESA):
GL_PREFIX(WindowPos3iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5064(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23814,13 +23897,13 @@ GL_PREFIX(WindowPos3iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5064(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5064(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23830,7 +23913,7 @@ GL_PREFIX(WindowPos3iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5064(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA)
@@ -23841,25 +23924,25 @@ GL_PREFIX(WindowPos3iMESA):
GL_PREFIX(WindowPos3ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5072(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5072(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5072(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5072(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA)
@@ -23870,7 +23953,7 @@ GL_PREFIX(WindowPos3ivMESA):
GL_PREFIX(WindowPos3sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5080(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23880,13 +23963,13 @@ GL_PREFIX(WindowPos3sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5080(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5080(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23896,7 +23979,7 @@ GL_PREFIX(WindowPos3sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5080(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA)
@@ -23907,25 +23990,25 @@ GL_PREFIX(WindowPos3sMESA):
GL_PREFIX(WindowPos3svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5088(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5088(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5088(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5088(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA)
@@ -23936,7 +24019,7 @@ GL_PREFIX(WindowPos3svMESA):
GL_PREFIX(WindowPos4dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5096(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -23950,13 +24033,13 @@ GL_PREFIX(WindowPos4dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5096(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5096(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -23970,7 +24053,7 @@ GL_PREFIX(WindowPos4dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5096(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA)
@@ -23981,25 +24064,25 @@ GL_PREFIX(WindowPos4dMESA):
GL_PREFIX(WindowPos4dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5104(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5104(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5104(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5104(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA)
@@ -24010,7 +24093,7 @@ GL_PREFIX(WindowPos4dvMESA):
GL_PREFIX(WindowPos4fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5112(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -24024,13 +24107,13 @@ GL_PREFIX(WindowPos4fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5112(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5112(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -24044,7 +24127,7 @@ GL_PREFIX(WindowPos4fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5112(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA)
@@ -24055,25 +24138,25 @@ GL_PREFIX(WindowPos4fMESA):
GL_PREFIX(WindowPos4fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5120(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5120(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5120(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5120(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA)
@@ -24084,7 +24167,7 @@ GL_PREFIX(WindowPos4fvMESA):
GL_PREFIX(WindowPos4iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5128(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24098,13 +24181,13 @@ GL_PREFIX(WindowPos4iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5128(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5128(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24118,7 +24201,7 @@ GL_PREFIX(WindowPos4iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5128(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA)
@@ -24129,25 +24212,25 @@ GL_PREFIX(WindowPos4iMESA):
GL_PREFIX(WindowPos4ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5136(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5136(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5136(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5136(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA)
@@ -24158,7 +24241,7 @@ GL_PREFIX(WindowPos4ivMESA):
GL_PREFIX(WindowPos4sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5144(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24172,13 +24255,13 @@ GL_PREFIX(WindowPos4sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5144(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5144(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24192,7 +24275,7 @@ GL_PREFIX(WindowPos4sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5144(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA)
@@ -24203,37 +24286,37 @@ GL_PREFIX(WindowPos4sMESA):
GL_PREFIX(WindowPos4svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5152(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5152(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5152(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5152(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_645)
- .type GL_PREFIX(_dispatch_stub_645), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_645))
-GL_PREFIX(_dispatch_stub_645):
+ .globl GL_PREFIX(_dispatch_stub_648)
+ .type GL_PREFIX(_dispatch_stub_648), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_648))
+GL_PREFIX(_dispatch_stub_648):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5160(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24247,13 +24330,13 @@ GL_PREFIX(_dispatch_stub_645):
popq %rdx
popq %rsi
popq %rdi
- movq 5160(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5160(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24267,19 +24350,19 @@ GL_PREFIX(_dispatch_stub_645):
popq %rdx
popq %rsi
popq %rdi
- movq 5160(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_645), .-GL_PREFIX(_dispatch_stub_645)
+ .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_646)
- .type GL_PREFIX(_dispatch_stub_646), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_646))
-GL_PREFIX(_dispatch_stub_646):
+ .globl GL_PREFIX(_dispatch_stub_649)
+ .type GL_PREFIX(_dispatch_stub_649), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_649))
+GL_PREFIX(_dispatch_stub_649):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5168(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24297,13 +24380,13 @@ GL_PREFIX(_dispatch_stub_646):
popq %rdx
popq %rsi
popq %rdi
- movq 5168(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5168(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24321,19 +24404,19 @@ GL_PREFIX(_dispatch_stub_646):
popq %rdx
popq %rsi
popq %rdi
- movq 5168(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_646), .-GL_PREFIX(_dispatch_stub_646)
+ .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_647)
- .type GL_PREFIX(_dispatch_stub_647), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_647))
-GL_PREFIX(_dispatch_stub_647):
+ .globl GL_PREFIX(_dispatch_stub_650)
+ .type GL_PREFIX(_dispatch_stub_650), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_650))
+GL_PREFIX(_dispatch_stub_650):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5176(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24343,13 +24426,13 @@ GL_PREFIX(_dispatch_stub_647):
popq %rbp
popq %rsi
popq %rdi
- movq 5176(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5176(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24359,49 +24442,49 @@ GL_PREFIX(_dispatch_stub_647):
popq %rbp
popq %rsi
popq %rdi
- movq 5176(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_647), .-GL_PREFIX(_dispatch_stub_647)
+ .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_648)
- .type GL_PREFIX(_dispatch_stub_648), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_648))
-GL_PREFIX(_dispatch_stub_648):
+ .globl GL_PREFIX(_dispatch_stub_651)
+ .type GL_PREFIX(_dispatch_stub_651), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_651))
+GL_PREFIX(_dispatch_stub_651):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5184(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5184(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5184(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5184(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648)
+ .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_649)
- .type GL_PREFIX(_dispatch_stub_649), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_649))
-GL_PREFIX(_dispatch_stub_649):
+ .globl GL_PREFIX(_dispatch_stub_652)
+ .type GL_PREFIX(_dispatch_stub_652), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_652))
+GL_PREFIX(_dispatch_stub_652):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5192(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24411,13 +24494,13 @@ GL_PREFIX(_dispatch_stub_649):
popq %rbp
popq %rsi
popq %rdi
- movq 5192(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5192(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24427,19 +24510,19 @@ GL_PREFIX(_dispatch_stub_649):
popq %rbp
popq %rsi
popq %rdi
- movq 5192(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649)
+ .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_650)
- .type GL_PREFIX(_dispatch_stub_650), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_650))
-GL_PREFIX(_dispatch_stub_650):
+ .globl GL_PREFIX(_dispatch_stub_653)
+ .type GL_PREFIX(_dispatch_stub_653), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_653))
+GL_PREFIX(_dispatch_stub_653):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5200(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24449,13 +24532,13 @@ GL_PREFIX(_dispatch_stub_650):
popq %rdx
popq %rsi
popq %rdi
- movq 5200(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5200(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24465,49 +24548,49 @@ GL_PREFIX(_dispatch_stub_650):
popq %rdx
popq %rsi
popq %rdi
- movq 5200(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650)
+ .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_651)
- .type GL_PREFIX(_dispatch_stub_651), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_651))
-GL_PREFIX(_dispatch_stub_651):
+ .globl GL_PREFIX(_dispatch_stub_654)
+ .type GL_PREFIX(_dispatch_stub_654), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_654))
+GL_PREFIX(_dispatch_stub_654):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5208(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5208(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5208(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5208(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651)
+ .size GL_PREFIX(_dispatch_stub_654), .-GL_PREFIX(_dispatch_stub_654)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_652)
- .type GL_PREFIX(_dispatch_stub_652), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_652))
-GL_PREFIX(_dispatch_stub_652):
+ .globl GL_PREFIX(_dispatch_stub_655)
+ .type GL_PREFIX(_dispatch_stub_655), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_655))
+GL_PREFIX(_dispatch_stub_655):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5216(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24517,13 +24600,13 @@ GL_PREFIX(_dispatch_stub_652):
popq %rbp
popq %rsi
popq %rdi
- movq 5216(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5216(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24533,40 +24616,40 @@ GL_PREFIX(_dispatch_stub_652):
popq %rbp
popq %rsi
popq %rdi
- movq 5216(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652)
+ .size GL_PREFIX(_dispatch_stub_655), .-GL_PREFIX(_dispatch_stub_655)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_653)
- .type GL_PREFIX(_dispatch_stub_653), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_653))
-GL_PREFIX(_dispatch_stub_653):
+ .globl GL_PREFIX(_dispatch_stub_656)
+ .type GL_PREFIX(_dispatch_stub_656), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_656))
+GL_PREFIX(_dispatch_stub_656):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5224(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5224(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5224(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5224(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653)
+ .size GL_PREFIX(_dispatch_stub_656), .-GL_PREFIX(_dispatch_stub_656)
.p2align 4,,15
.globl GL_PREFIX(AreProgramsResidentNV)
@@ -24574,7 +24657,7 @@ GL_PREFIX(_dispatch_stub_653):
GL_PREFIX(AreProgramsResidentNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5232(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24584,13 +24667,13 @@ GL_PREFIX(AreProgramsResidentNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5232(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5232(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24600,7 +24683,7 @@ GL_PREFIX(AreProgramsResidentNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5232(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV)
@@ -24611,7 +24694,7 @@ GL_PREFIX(AreProgramsResidentNV):
GL_PREFIX(BindProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5240(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24621,13 +24704,13 @@ GL_PREFIX(BindProgramNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5240(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5240(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24637,7 +24720,7 @@ GL_PREFIX(BindProgramNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5240(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV)
@@ -24648,7 +24731,7 @@ GL_PREFIX(BindProgramNV):
GL_PREFIX(DeleteProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5248(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24658,13 +24741,13 @@ GL_PREFIX(DeleteProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5248(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5248(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24674,7 +24757,7 @@ GL_PREFIX(DeleteProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5248(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV)
@@ -24685,7 +24768,7 @@ GL_PREFIX(DeleteProgramsNV):
GL_PREFIX(ExecuteProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5256(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24695,13 +24778,13 @@ GL_PREFIX(ExecuteProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5256(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5256(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24711,7 +24794,7 @@ GL_PREFIX(ExecuteProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5256(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV)
@@ -24722,7 +24805,7 @@ GL_PREFIX(ExecuteProgramNV):
GL_PREFIX(GenProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5264(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24732,13 +24815,13 @@ GL_PREFIX(GenProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5264(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5264(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24748,7 +24831,7 @@ GL_PREFIX(GenProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5264(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV)
@@ -24759,7 +24842,7 @@ GL_PREFIX(GenProgramsNV):
GL_PREFIX(GetProgramParameterdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5272(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24773,13 +24856,13 @@ GL_PREFIX(GetProgramParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5272(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5272(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24793,7 +24876,7 @@ GL_PREFIX(GetProgramParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5272(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV)
@@ -24804,7 +24887,7 @@ GL_PREFIX(GetProgramParameterdvNV):
GL_PREFIX(GetProgramParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5280(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24818,13 +24901,13 @@ GL_PREFIX(GetProgramParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5280(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5280(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24838,7 +24921,7 @@ GL_PREFIX(GetProgramParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5280(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV)
@@ -24849,7 +24932,7 @@ GL_PREFIX(GetProgramParameterfvNV):
GL_PREFIX(GetProgramStringNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5288(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24859,13 +24942,13 @@ GL_PREFIX(GetProgramStringNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5288(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5288(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24875,7 +24958,7 @@ GL_PREFIX(GetProgramStringNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5288(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV)
@@ -24886,7 +24969,7 @@ GL_PREFIX(GetProgramStringNV):
GL_PREFIX(GetProgramivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5296(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24896,13 +24979,13 @@ GL_PREFIX(GetProgramivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5296(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5296(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24912,7 +24995,7 @@ GL_PREFIX(GetProgramivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5296(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV)
@@ -24923,7 +25006,7 @@ GL_PREFIX(GetProgramivNV):
GL_PREFIX(GetTrackMatrixivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5304(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24937,13 +25020,13 @@ GL_PREFIX(GetTrackMatrixivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5304(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5304(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24957,7 +25040,7 @@ GL_PREFIX(GetTrackMatrixivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5304(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV)
@@ -24968,7 +25051,7 @@ GL_PREFIX(GetTrackMatrixivNV):
GL_PREFIX(GetVertexAttribPointervNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5312(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24978,13 +25061,13 @@ GL_PREFIX(GetVertexAttribPointervNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5312(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5312(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24994,7 +25077,7 @@ GL_PREFIX(GetVertexAttribPointervNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5312(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV)
@@ -25005,7 +25088,7 @@ GL_PREFIX(GetVertexAttribPointervNV):
GL_PREFIX(GetVertexAttribdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5320(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25015,13 +25098,13 @@ GL_PREFIX(GetVertexAttribdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5320(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5320(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25031,7 +25114,7 @@ GL_PREFIX(GetVertexAttribdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5320(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV)
@@ -25042,7 +25125,7 @@ GL_PREFIX(GetVertexAttribdvNV):
GL_PREFIX(GetVertexAttribfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5328(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25052,13 +25135,13 @@ GL_PREFIX(GetVertexAttribfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5328(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5328(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25068,7 +25151,7 @@ GL_PREFIX(GetVertexAttribfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5328(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV)
@@ -25079,7 +25162,7 @@ GL_PREFIX(GetVertexAttribfvNV):
GL_PREFIX(GetVertexAttribivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5336(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25089,13 +25172,13 @@ GL_PREFIX(GetVertexAttribivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5336(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5336(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25105,7 +25188,7 @@ GL_PREFIX(GetVertexAttribivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5336(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV)
@@ -25116,25 +25199,25 @@ GL_PREFIX(GetVertexAttribivNV):
GL_PREFIX(IsProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5344(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5344(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5344(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5344(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV)
@@ -25145,7 +25228,7 @@ GL_PREFIX(IsProgramNV):
GL_PREFIX(LoadProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5352(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25159,13 +25242,13 @@ GL_PREFIX(LoadProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5352(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5352(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25179,7 +25262,7 @@ GL_PREFIX(LoadProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5352(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV)
@@ -25190,7 +25273,7 @@ GL_PREFIX(LoadProgramNV):
GL_PREFIX(ProgramParameter4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5360(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -25208,13 +25291,13 @@ GL_PREFIX(ProgramParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5360(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5360(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -25232,7 +25315,7 @@ GL_PREFIX(ProgramParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5360(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4dNV), .-GL_PREFIX(ProgramParameter4dNV)
@@ -25243,7 +25326,7 @@ GL_PREFIX(ProgramParameter4dNV):
GL_PREFIX(ProgramParameter4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5368(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25253,13 +25336,13 @@ GL_PREFIX(ProgramParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5368(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5368(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25269,7 +25352,7 @@ GL_PREFIX(ProgramParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5368(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4dvNV), .-GL_PREFIX(ProgramParameter4dvNV)
@@ -25280,7 +25363,7 @@ GL_PREFIX(ProgramParameter4dvNV):
GL_PREFIX(ProgramParameter4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5376(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -25298,13 +25381,13 @@ GL_PREFIX(ProgramParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5376(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5376(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -25322,7 +25405,7 @@ GL_PREFIX(ProgramParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5376(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4fNV), .-GL_PREFIX(ProgramParameter4fNV)
@@ -25333,7 +25416,7 @@ GL_PREFIX(ProgramParameter4fNV):
GL_PREFIX(ProgramParameter4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5384(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25343,13 +25426,13 @@ GL_PREFIX(ProgramParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5384(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5384(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25359,7 +25442,7 @@ GL_PREFIX(ProgramParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5384(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4fvNV), .-GL_PREFIX(ProgramParameter4fvNV)
@@ -25370,7 +25453,7 @@ GL_PREFIX(ProgramParameter4fvNV):
GL_PREFIX(ProgramParameters4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5392(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25384,13 +25467,13 @@ GL_PREFIX(ProgramParameters4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5392(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5392(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25404,7 +25487,7 @@ GL_PREFIX(ProgramParameters4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5392(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV)
@@ -25415,7 +25498,7 @@ GL_PREFIX(ProgramParameters4dvNV):
GL_PREFIX(ProgramParameters4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5400(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25429,13 +25512,13 @@ GL_PREFIX(ProgramParameters4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5400(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5400(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25449,7 +25532,7 @@ GL_PREFIX(ProgramParameters4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5400(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV)
@@ -25460,7 +25543,7 @@ GL_PREFIX(ProgramParameters4fvNV):
GL_PREFIX(RequestResidentProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5408(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25470,13 +25553,13 @@ GL_PREFIX(RequestResidentProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5408(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5408(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25486,7 +25569,7 @@ GL_PREFIX(RequestResidentProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5408(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV)
@@ -25497,7 +25580,7 @@ GL_PREFIX(RequestResidentProgramsNV):
GL_PREFIX(TrackMatrixNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5416(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25511,13 +25594,13 @@ GL_PREFIX(TrackMatrixNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5416(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5416(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25531,7 +25614,7 @@ GL_PREFIX(TrackMatrixNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5416(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV)
@@ -25542,7 +25625,7 @@ GL_PREFIX(TrackMatrixNV):
GL_PREFIX(VertexAttrib1dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5424(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25552,13 +25635,13 @@ GL_PREFIX(VertexAttrib1dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5424(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5424(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25568,7 +25651,7 @@ GL_PREFIX(VertexAttrib1dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5424(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV)
@@ -25579,7 +25662,7 @@ GL_PREFIX(VertexAttrib1dNV):
GL_PREFIX(VertexAttrib1dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5432(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25589,13 +25672,13 @@ GL_PREFIX(VertexAttrib1dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5432(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5432(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25605,7 +25688,7 @@ GL_PREFIX(VertexAttrib1dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5432(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV)
@@ -25616,7 +25699,7 @@ GL_PREFIX(VertexAttrib1dvNV):
GL_PREFIX(VertexAttrib1fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5440(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25626,13 +25709,13 @@ GL_PREFIX(VertexAttrib1fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5440(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5440(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25642,7 +25725,7 @@ GL_PREFIX(VertexAttrib1fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5440(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV)
@@ -25653,7 +25736,7 @@ GL_PREFIX(VertexAttrib1fNV):
GL_PREFIX(VertexAttrib1fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5448(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25663,13 +25746,13 @@ GL_PREFIX(VertexAttrib1fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5448(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5448(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25679,7 +25762,7 @@ GL_PREFIX(VertexAttrib1fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5448(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV)
@@ -25690,7 +25773,7 @@ GL_PREFIX(VertexAttrib1fvNV):
GL_PREFIX(VertexAttrib1sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5456(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25700,13 +25783,13 @@ GL_PREFIX(VertexAttrib1sNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5456(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5456(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25716,7 +25799,7 @@ GL_PREFIX(VertexAttrib1sNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5456(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV)
@@ -25727,7 +25810,7 @@ GL_PREFIX(VertexAttrib1sNV):
GL_PREFIX(VertexAttrib1svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5464(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25737,13 +25820,13 @@ GL_PREFIX(VertexAttrib1svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5464(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5464(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25753,7 +25836,7 @@ GL_PREFIX(VertexAttrib1svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5464(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV)
@@ -25764,7 +25847,7 @@ GL_PREFIX(VertexAttrib1svNV):
GL_PREFIX(VertexAttrib2dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5472(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25776,13 +25859,13 @@ GL_PREFIX(VertexAttrib2dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5472(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5472(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25794,7 +25877,7 @@ GL_PREFIX(VertexAttrib2dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5472(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV)
@@ -25805,7 +25888,7 @@ GL_PREFIX(VertexAttrib2dNV):
GL_PREFIX(VertexAttrib2dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5480(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25815,13 +25898,13 @@ GL_PREFIX(VertexAttrib2dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5480(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5480(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25831,7 +25914,7 @@ GL_PREFIX(VertexAttrib2dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5480(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV)
@@ -25842,7 +25925,7 @@ GL_PREFIX(VertexAttrib2dvNV):
GL_PREFIX(VertexAttrib2fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5488(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25854,13 +25937,13 @@ GL_PREFIX(VertexAttrib2fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5488(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5488(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25872,7 +25955,7 @@ GL_PREFIX(VertexAttrib2fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5488(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV)
@@ -25883,7 +25966,7 @@ GL_PREFIX(VertexAttrib2fNV):
GL_PREFIX(VertexAttrib2fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5496(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25893,13 +25976,13 @@ GL_PREFIX(VertexAttrib2fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5496(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5496(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25909,7 +25992,7 @@ GL_PREFIX(VertexAttrib2fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5496(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV)
@@ -25920,7 +26003,7 @@ GL_PREFIX(VertexAttrib2fvNV):
GL_PREFIX(VertexAttrib2sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5504(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25930,13 +26013,13 @@ GL_PREFIX(VertexAttrib2sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5504(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5504(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25946,7 +26029,7 @@ GL_PREFIX(VertexAttrib2sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5504(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV)
@@ -25957,7 +26040,7 @@ GL_PREFIX(VertexAttrib2sNV):
GL_PREFIX(VertexAttrib2svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5512(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25967,13 +26050,13 @@ GL_PREFIX(VertexAttrib2svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5512(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5512(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25983,7 +26066,7 @@ GL_PREFIX(VertexAttrib2svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5512(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV)
@@ -25994,7 +26077,7 @@ GL_PREFIX(VertexAttrib2svNV):
GL_PREFIX(VertexAttrib3dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5520(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -26008,13 +26091,13 @@ GL_PREFIX(VertexAttrib3dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5520(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5520(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -26028,7 +26111,7 @@ GL_PREFIX(VertexAttrib3dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5520(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV)
@@ -26039,7 +26122,7 @@ GL_PREFIX(VertexAttrib3dNV):
GL_PREFIX(VertexAttrib3dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5528(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26049,13 +26132,13 @@ GL_PREFIX(VertexAttrib3dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5528(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5528(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26065,7 +26148,7 @@ GL_PREFIX(VertexAttrib3dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5528(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV)
@@ -26076,7 +26159,7 @@ GL_PREFIX(VertexAttrib3dvNV):
GL_PREFIX(VertexAttrib3fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5536(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -26090,13 +26173,13 @@ GL_PREFIX(VertexAttrib3fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5536(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5536(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -26110,7 +26193,7 @@ GL_PREFIX(VertexAttrib3fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5536(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV)
@@ -26121,7 +26204,7 @@ GL_PREFIX(VertexAttrib3fNV):
GL_PREFIX(VertexAttrib3fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5544(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26131,13 +26214,13 @@ GL_PREFIX(VertexAttrib3fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5544(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5544(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26147,7 +26230,7 @@ GL_PREFIX(VertexAttrib3fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5544(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV)
@@ -26158,7 +26241,7 @@ GL_PREFIX(VertexAttrib3fvNV):
GL_PREFIX(VertexAttrib3sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5552(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26172,13 +26255,13 @@ GL_PREFIX(VertexAttrib3sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5552(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5552(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26192,7 +26275,7 @@ GL_PREFIX(VertexAttrib3sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5552(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV)
@@ -26203,7 +26286,7 @@ GL_PREFIX(VertexAttrib3sNV):
GL_PREFIX(VertexAttrib3svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5560(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26213,13 +26296,13 @@ GL_PREFIX(VertexAttrib3svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5560(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5560(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26229,7 +26312,7 @@ GL_PREFIX(VertexAttrib3svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5560(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV)
@@ -26240,7 +26323,7 @@ GL_PREFIX(VertexAttrib3svNV):
GL_PREFIX(VertexAttrib4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5568(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -26256,13 +26339,13 @@ GL_PREFIX(VertexAttrib4dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5568(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5568(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -26278,7 +26361,7 @@ GL_PREFIX(VertexAttrib4dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5568(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV)
@@ -26289,7 +26372,7 @@ GL_PREFIX(VertexAttrib4dNV):
GL_PREFIX(VertexAttrib4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5576(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26299,13 +26382,13 @@ GL_PREFIX(VertexAttrib4dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5576(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5576(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26315,7 +26398,7 @@ GL_PREFIX(VertexAttrib4dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5576(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV)
@@ -26326,7 +26409,7 @@ GL_PREFIX(VertexAttrib4dvNV):
GL_PREFIX(VertexAttrib4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5584(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -26342,13 +26425,13 @@ GL_PREFIX(VertexAttrib4fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5584(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5584(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -26364,7 +26447,7 @@ GL_PREFIX(VertexAttrib4fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5584(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV)
@@ -26375,7 +26458,7 @@ GL_PREFIX(VertexAttrib4fNV):
GL_PREFIX(VertexAttrib4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5592(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26385,13 +26468,13 @@ GL_PREFIX(VertexAttrib4fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5592(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5592(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26401,7 +26484,7 @@ GL_PREFIX(VertexAttrib4fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5592(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV)
@@ -26412,7 +26495,7 @@ GL_PREFIX(VertexAttrib4fvNV):
GL_PREFIX(VertexAttrib4sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5600(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26426,13 +26509,13 @@ GL_PREFIX(VertexAttrib4sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5600(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5600(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26446,7 +26529,7 @@ GL_PREFIX(VertexAttrib4sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5600(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV)
@@ -26457,7 +26540,7 @@ GL_PREFIX(VertexAttrib4sNV):
GL_PREFIX(VertexAttrib4svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5608(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26467,13 +26550,13 @@ GL_PREFIX(VertexAttrib4svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5608(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5608(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26483,7 +26566,7 @@ GL_PREFIX(VertexAttrib4svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5608(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV)
@@ -26494,7 +26577,7 @@ GL_PREFIX(VertexAttrib4svNV):
GL_PREFIX(VertexAttrib4ubNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5616(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26508,13 +26591,13 @@ GL_PREFIX(VertexAttrib4ubNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5616(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5616(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26528,7 +26611,7 @@ GL_PREFIX(VertexAttrib4ubNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5616(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV)
@@ -26539,7 +26622,7 @@ GL_PREFIX(VertexAttrib4ubNV):
GL_PREFIX(VertexAttrib4ubvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5624(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26549,13 +26632,13 @@ GL_PREFIX(VertexAttrib4ubvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5624(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5624(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26565,7 +26648,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5624(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV)
@@ -26576,7 +26659,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
GL_PREFIX(VertexAttribPointerNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5632(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26590,13 +26673,13 @@ GL_PREFIX(VertexAttribPointerNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5632(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5632(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26610,7 +26693,7 @@ GL_PREFIX(VertexAttribPointerNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5632(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV)
@@ -26621,7 +26704,7 @@ GL_PREFIX(VertexAttribPointerNV):
GL_PREFIX(VertexAttribs1dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5640(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26631,13 +26714,13 @@ GL_PREFIX(VertexAttribs1dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5640(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5640(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26647,7 +26730,7 @@ GL_PREFIX(VertexAttribs1dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5640(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV)
@@ -26658,7 +26741,7 @@ GL_PREFIX(VertexAttribs1dvNV):
GL_PREFIX(VertexAttribs1fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5648(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26668,13 +26751,13 @@ GL_PREFIX(VertexAttribs1fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5648(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5648(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26684,7 +26767,7 @@ GL_PREFIX(VertexAttribs1fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5648(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV)
@@ -26695,7 +26778,7 @@ GL_PREFIX(VertexAttribs1fvNV):
GL_PREFIX(VertexAttribs1svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5656(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26705,13 +26788,13 @@ GL_PREFIX(VertexAttribs1svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5656(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5656(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26721,7 +26804,7 @@ GL_PREFIX(VertexAttribs1svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5656(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV)
@@ -26732,7 +26815,7 @@ GL_PREFIX(VertexAttribs1svNV):
GL_PREFIX(VertexAttribs2dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5664(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26742,13 +26825,13 @@ GL_PREFIX(VertexAttribs2dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5664(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5664(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26758,7 +26841,7 @@ GL_PREFIX(VertexAttribs2dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5664(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV)
@@ -26769,7 +26852,7 @@ GL_PREFIX(VertexAttribs2dvNV):
GL_PREFIX(VertexAttribs2fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5672(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26779,13 +26862,13 @@ GL_PREFIX(VertexAttribs2fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5672(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5672(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26795,7 +26878,7 @@ GL_PREFIX(VertexAttribs2fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5672(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV)
@@ -26806,7 +26889,7 @@ GL_PREFIX(VertexAttribs2fvNV):
GL_PREFIX(VertexAttribs2svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5680(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26816,13 +26899,13 @@ GL_PREFIX(VertexAttribs2svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5680(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5680(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26832,7 +26915,7 @@ GL_PREFIX(VertexAttribs2svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5680(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV)
@@ -26843,7 +26926,7 @@ GL_PREFIX(VertexAttribs2svNV):
GL_PREFIX(VertexAttribs3dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5688(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26853,13 +26936,13 @@ GL_PREFIX(VertexAttribs3dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5688(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5688(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26869,7 +26952,7 @@ GL_PREFIX(VertexAttribs3dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5688(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV)
@@ -26880,7 +26963,7 @@ GL_PREFIX(VertexAttribs3dvNV):
GL_PREFIX(VertexAttribs3fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5696(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26890,13 +26973,13 @@ GL_PREFIX(VertexAttribs3fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5696(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5696(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26906,7 +26989,7 @@ GL_PREFIX(VertexAttribs3fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5696(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV)
@@ -26917,7 +27000,7 @@ GL_PREFIX(VertexAttribs3fvNV):
GL_PREFIX(VertexAttribs3svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5704(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26927,13 +27010,13 @@ GL_PREFIX(VertexAttribs3svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5704(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5704(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26943,7 +27026,7 @@ GL_PREFIX(VertexAttribs3svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5704(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV)
@@ -26954,7 +27037,7 @@ GL_PREFIX(VertexAttribs3svNV):
GL_PREFIX(VertexAttribs4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5712(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26964,13 +27047,13 @@ GL_PREFIX(VertexAttribs4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5712(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5712(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26980,7 +27063,7 @@ GL_PREFIX(VertexAttribs4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5712(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV)
@@ -26991,7 +27074,7 @@ GL_PREFIX(VertexAttribs4dvNV):
GL_PREFIX(VertexAttribs4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5720(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27001,13 +27084,13 @@ GL_PREFIX(VertexAttribs4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5720(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5720(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27017,7 +27100,7 @@ GL_PREFIX(VertexAttribs4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5720(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV)
@@ -27028,7 +27111,7 @@ GL_PREFIX(VertexAttribs4fvNV):
GL_PREFIX(VertexAttribs4svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5728(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27038,13 +27121,13 @@ GL_PREFIX(VertexAttribs4svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5728(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5728(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27054,7 +27137,7 @@ GL_PREFIX(VertexAttribs4svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5728(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV)
@@ -27065,7 +27148,7 @@ GL_PREFIX(VertexAttribs4svNV):
GL_PREFIX(VertexAttribs4ubvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5736(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27075,13 +27158,13 @@ GL_PREFIX(VertexAttribs4ubvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5736(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5736(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27091,7 +27174,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5736(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV)
@@ -27102,7 +27185,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
GL_PREFIX(AlphaFragmentOp1ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5744(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27120,13 +27203,13 @@ GL_PREFIX(AlphaFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5744(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5744(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27144,7 +27227,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5744(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI)
@@ -27155,7 +27238,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
GL_PREFIX(AlphaFragmentOp2ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5752(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27173,13 +27256,13 @@ GL_PREFIX(AlphaFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5752(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5752(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27197,7 +27280,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5752(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI)
@@ -27208,7 +27291,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
GL_PREFIX(AlphaFragmentOp3ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5760(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27226,13 +27309,13 @@ GL_PREFIX(AlphaFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5760(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5760(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27250,7 +27333,7 @@ GL_PREFIX(AlphaFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5760(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI)
@@ -27261,25 +27344,25 @@ GL_PREFIX(AlphaFragmentOp3ATI):
GL_PREFIX(BeginFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5768(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 5768(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5768(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 5768(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI)
@@ -27290,25 +27373,25 @@ GL_PREFIX(BeginFragmentShaderATI):
GL_PREFIX(BindFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5776(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5776(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5776(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5776(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI)
@@ -27319,7 +27402,7 @@ GL_PREFIX(BindFragmentShaderATI):
GL_PREFIX(ColorFragmentOp1ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5784(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27337,13 +27420,13 @@ GL_PREFIX(ColorFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5784(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5784(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27361,7 +27444,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5784(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI)
@@ -27372,7 +27455,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
GL_PREFIX(ColorFragmentOp2ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5792(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27390,13 +27473,13 @@ GL_PREFIX(ColorFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5792(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5792(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27414,7 +27497,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5792(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI)
@@ -27425,7 +27508,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
GL_PREFIX(ColorFragmentOp3ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5800(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27443,13 +27526,13 @@ GL_PREFIX(ColorFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5800(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5800(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27467,7 +27550,7 @@ GL_PREFIX(ColorFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5800(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI)
@@ -27478,25 +27561,25 @@ GL_PREFIX(ColorFragmentOp3ATI):
GL_PREFIX(DeleteFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5808(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5808(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5808(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5808(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI)
@@ -27507,25 +27590,25 @@ GL_PREFIX(DeleteFragmentShaderATI):
GL_PREFIX(EndFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5816(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 5816(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5816(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 5816(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI)
@@ -27536,25 +27619,25 @@ GL_PREFIX(EndFragmentShaderATI):
GL_PREFIX(GenFragmentShadersATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5824(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5824(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5824(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5824(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI)
@@ -27565,7 +27648,7 @@ GL_PREFIX(GenFragmentShadersATI):
GL_PREFIX(PassTexCoordATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5832(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27575,13 +27658,13 @@ GL_PREFIX(PassTexCoordATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5832(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5832(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27591,7 +27674,7 @@ GL_PREFIX(PassTexCoordATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5832(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI)
@@ -27602,7 +27685,7 @@ GL_PREFIX(PassTexCoordATI):
GL_PREFIX(SampleMapATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5840(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27612,13 +27695,13 @@ GL_PREFIX(SampleMapATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5840(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5840(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27628,7 +27711,7 @@ GL_PREFIX(SampleMapATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5840(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI)
@@ -27639,7 +27722,7 @@ GL_PREFIX(SampleMapATI):
GL_PREFIX(SetFragmentShaderConstantATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5848(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27649,13 +27732,13 @@ GL_PREFIX(SetFragmentShaderConstantATI):
popq %rbp
popq %rsi
popq %rdi
- movq 5848(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5848(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27665,7 +27748,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
popq %rbp
popq %rsi
popq %rdi
- movq 5848(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI)
@@ -27676,7 +27759,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
GL_PREFIX(PointParameteriNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5856(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27686,13 +27769,13 @@ GL_PREFIX(PointParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5856(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5856(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27702,7 +27785,7 @@ GL_PREFIX(PointParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5856(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV)
@@ -27713,7 +27796,7 @@ GL_PREFIX(PointParameteriNV):
GL_PREFIX(PointParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5864(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27723,13 +27806,13 @@ GL_PREFIX(PointParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5864(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5864(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27739,79 +27822,79 @@ GL_PREFIX(PointParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5864(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_734)
- .type GL_PREFIX(_dispatch_stub_734), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_734))
-GL_PREFIX(_dispatch_stub_734):
+ .globl GL_PREFIX(_dispatch_stub_737)
+ .type GL_PREFIX(_dispatch_stub_737), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_737))
+GL_PREFIX(_dispatch_stub_737):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5872(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5872(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5872(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5872(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_734), .-GL_PREFIX(_dispatch_stub_734)
+ .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_735)
- .type GL_PREFIX(_dispatch_stub_735), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_735))
-GL_PREFIX(_dispatch_stub_735):
+ .globl GL_PREFIX(_dispatch_stub_738)
+ .type GL_PREFIX(_dispatch_stub_738), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_738))
+GL_PREFIX(_dispatch_stub_738):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5880(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5880(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5880(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5880(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_735), .-GL_PREFIX(_dispatch_stub_735)
+ .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_736)
- .type GL_PREFIX(_dispatch_stub_736), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_736))
-GL_PREFIX(_dispatch_stub_736):
+ .globl GL_PREFIX(_dispatch_stub_739)
+ .type GL_PREFIX(_dispatch_stub_739), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_739))
+GL_PREFIX(_dispatch_stub_739):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5888(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27821,13 +27904,13 @@ GL_PREFIX(_dispatch_stub_736):
popq %rbp
popq %rsi
popq %rdi
- movq 5888(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5888(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27837,19 +27920,19 @@ GL_PREFIX(_dispatch_stub_736):
popq %rbp
popq %rsi
popq %rdi
- movq 5888(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_736), .-GL_PREFIX(_dispatch_stub_736)
+ .size GL_PREFIX(_dispatch_stub_739), .-GL_PREFIX(_dispatch_stub_739)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_737)
- .type GL_PREFIX(_dispatch_stub_737), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_737))
-GL_PREFIX(_dispatch_stub_737):
+ .globl GL_PREFIX(_dispatch_stub_740)
+ .type GL_PREFIX(_dispatch_stub_740), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_740))
+GL_PREFIX(_dispatch_stub_740):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5896(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27859,13 +27942,13 @@ GL_PREFIX(_dispatch_stub_737):
popq %rbp
popq %rsi
popq %rdi
- movq 5896(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5896(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27875,40 +27958,40 @@ GL_PREFIX(_dispatch_stub_737):
popq %rbp
popq %rsi
popq %rdi
- movq 5896(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
+ .size GL_PREFIX(_dispatch_stub_740), .-GL_PREFIX(_dispatch_stub_740)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_738)
- .type GL_PREFIX(_dispatch_stub_738), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_738))
-GL_PREFIX(_dispatch_stub_738):
+ .globl GL_PREFIX(_dispatch_stub_741)
+ .type GL_PREFIX(_dispatch_stub_741), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_741))
+GL_PREFIX(_dispatch_stub_741):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5904(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5904(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5904(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5904(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738)
+ .size GL_PREFIX(_dispatch_stub_741), .-GL_PREFIX(_dispatch_stub_741)
.p2align 4,,15
.globl GL_PREFIX(GetProgramNamedParameterdvNV)
@@ -27916,7 +27999,7 @@ GL_PREFIX(_dispatch_stub_738):
GL_PREFIX(GetProgramNamedParameterdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5912(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27930,13 +28013,13 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5912(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5912(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27950,7 +28033,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5912(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV)
@@ -27961,7 +28044,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
GL_PREFIX(GetProgramNamedParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5920(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27975,13 +28058,13 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5920(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5920(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27995,7 +28078,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5920(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV)
@@ -28006,7 +28089,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
GL_PREFIX(ProgramNamedParameter4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5928(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -28026,13 +28109,13 @@ GL_PREFIX(ProgramNamedParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5928(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5928(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -28052,7 +28135,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5928(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV)
@@ -28063,7 +28146,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
GL_PREFIX(ProgramNamedParameter4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5936(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28077,13 +28160,13 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5936(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5936(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28097,7 +28180,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5936(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV)
@@ -28108,7 +28191,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
GL_PREFIX(ProgramNamedParameter4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5944(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -28128,13 +28211,13 @@ GL_PREFIX(ProgramNamedParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5944(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5944(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -28154,7 +28237,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5944(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV)
@@ -28165,7 +28248,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
GL_PREFIX(ProgramNamedParameter4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5952(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28179,13 +28262,13 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5952(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5952(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28199,19 +28282,19 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5952(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_745)
- .type GL_PREFIX(_dispatch_stub_745), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_745))
-GL_PREFIX(_dispatch_stub_745):
+ .globl GL_PREFIX(_dispatch_stub_748)
+ .type GL_PREFIX(_dispatch_stub_748), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_748))
+GL_PREFIX(_dispatch_stub_748):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5960(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28221,13 +28304,13 @@ GL_PREFIX(_dispatch_stub_745):
popq %rbp
popq %rsi
popq %rdi
- movq 5960(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5960(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28237,19 +28320,19 @@ GL_PREFIX(_dispatch_stub_745):
popq %rbp
popq %rsi
popq %rdi
- movq 5960(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745)
+ .size GL_PREFIX(_dispatch_stub_748), .-GL_PREFIX(_dispatch_stub_748)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_746)
- .type GL_PREFIX(_dispatch_stub_746), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_746))
-GL_PREFIX(_dispatch_stub_746):
+ .globl GL_PREFIX(_dispatch_stub_749)
+ .type GL_PREFIX(_dispatch_stub_749), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_749))
+GL_PREFIX(_dispatch_stub_749):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5968(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28259,13 +28342,13 @@ GL_PREFIX(_dispatch_stub_746):
popq %rbp
popq %rsi
popq %rdi
- movq 5968(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5968(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28275,10 +28358,10 @@ GL_PREFIX(_dispatch_stub_746):
popq %rbp
popq %rsi
popq %rdi
- movq 5968(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_746), .-GL_PREFIX(_dispatch_stub_746)
+ .size GL_PREFIX(_dispatch_stub_749), .-GL_PREFIX(_dispatch_stub_749)
.p2align 4,,15
.globl GL_PREFIX(BindFramebufferEXT)
@@ -28286,7 +28369,7 @@ GL_PREFIX(_dispatch_stub_746):
GL_PREFIX(BindFramebufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5976(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28296,13 +28379,13 @@ GL_PREFIX(BindFramebufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5976(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5976(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28312,7 +28395,7 @@ GL_PREFIX(BindFramebufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5976(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT)
@@ -28323,7 +28406,7 @@ GL_PREFIX(BindFramebufferEXT):
GL_PREFIX(BindRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5984(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28333,13 +28416,13 @@ GL_PREFIX(BindRenderbufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5984(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5984(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28349,7 +28432,7 @@ GL_PREFIX(BindRenderbufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5984(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT)
@@ -28360,25 +28443,25 @@ GL_PREFIX(BindRenderbufferEXT):
GL_PREFIX(CheckFramebufferStatusEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5992(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5992(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5992(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5992(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT)
@@ -28389,7 +28472,7 @@ GL_PREFIX(CheckFramebufferStatusEXT):
GL_PREFIX(DeleteFramebuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6000(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28399,13 +28482,13 @@ GL_PREFIX(DeleteFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6000(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6000(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28415,7 +28498,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6000(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT)
@@ -28426,7 +28509,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
GL_PREFIX(DeleteRenderbuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6008(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28436,13 +28519,13 @@ GL_PREFIX(DeleteRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6008(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6008(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28452,7 +28535,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6008(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT)
@@ -28463,7 +28546,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
GL_PREFIX(FramebufferRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6016(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28477,13 +28560,13 @@ GL_PREFIX(FramebufferRenderbufferEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6016(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6016(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28497,7 +28580,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6016(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT)
@@ -28508,7 +28591,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
GL_PREFIX(FramebufferTexture1DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6024(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28522,13 +28605,13 @@ GL_PREFIX(FramebufferTexture1DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6024(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6024(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28542,7 +28625,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6024(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT)
@@ -28553,7 +28636,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
GL_PREFIX(FramebufferTexture2DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6032(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28567,13 +28650,13 @@ GL_PREFIX(FramebufferTexture2DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6032(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6032(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28587,7 +28670,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6032(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT)
@@ -28598,7 +28681,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
GL_PREFIX(FramebufferTexture3DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6040(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28616,13 +28699,13 @@ GL_PREFIX(FramebufferTexture3DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6040(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6040(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28640,7 +28723,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6040(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT)
@@ -28651,7 +28734,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
GL_PREFIX(GenFramebuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6048(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28661,13 +28744,13 @@ GL_PREFIX(GenFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6048(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6048(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28677,7 +28760,7 @@ GL_PREFIX(GenFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6048(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT)
@@ -28688,7 +28771,7 @@ GL_PREFIX(GenFramebuffersEXT):
GL_PREFIX(GenRenderbuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6056(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28698,13 +28781,13 @@ GL_PREFIX(GenRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6056(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6056(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28714,7 +28797,7 @@ GL_PREFIX(GenRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6056(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT)
@@ -28725,25 +28808,25 @@ GL_PREFIX(GenRenderbuffersEXT):
GL_PREFIX(GenerateMipmapEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6064(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 6064(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6064(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 6064(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT)
@@ -28754,7 +28837,7 @@ GL_PREFIX(GenerateMipmapEXT):
GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6072(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28768,13 +28851,13 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6072(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6072(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28788,19 +28871,18 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6072(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_760)
- .type GL_PREFIX(_dispatch_stub_760), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_760))
-GL_PREFIX(_dispatch_stub_760):
+ .globl GL_PREFIX(GetRenderbufferParameterivEXT)
+ .type GL_PREFIX(GetRenderbufferParameterivEXT), @function
+GL_PREFIX(GetRenderbufferParameterivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6080(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28810,13 +28892,13 @@ GL_PREFIX(_dispatch_stub_760):
popq %rdx
popq %rsi
popq %rdi
- movq 6080(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6080(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28826,151 +28908,176 @@ GL_PREFIX(_dispatch_stub_760):
popq %rdx
popq %rsi
popq %rdi
- movq 6080(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_760), .-GL_PREFIX(_dispatch_stub_760)
+ .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_761)
- .type GL_PREFIX(_dispatch_stub_761), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_761))
-GL_PREFIX(_dispatch_stub_761):
+ .globl GL_PREFIX(IsFramebufferEXT)
+ .type GL_PREFIX(IsFramebufferEXT), @function
+GL_PREFIX(IsFramebufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6088(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
- pushq %rsi
- pushq %rdx
call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
popq %rdi
- movq 6088(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6088(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
1:
pushq %rdi
- pushq %rsi
- pushq %rdx
call _glapi_get_dispatch
- popq %rdx
- popq %rsi
popq %rdi
- movq 6088(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_761), .-GL_PREFIX(_dispatch_stub_761)
+ .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
.p2align 4,,15
- .globl GL_PREFIX(GetRenderbufferParameterivEXT)
- .type GL_PREFIX(GetRenderbufferParameterivEXT), @function
-GL_PREFIX(GetRenderbufferParameterivEXT):
+ .globl GL_PREFIX(IsRenderbufferEXT)
+ .type GL_PREFIX(IsRenderbufferEXT), @function
+GL_PREFIX(IsRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6096(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
- pushq %rsi
- pushq %rdx
call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
popq %rdi
- movq 6096(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6096(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
1:
pushq %rdi
- pushq %rsi
- pushq %rdx
call _glapi_get_dispatch
- popq %rdx
- popq %rsi
popq %rdi
- movq 6096(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
+ .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
.p2align 4,,15
- .globl GL_PREFIX(IsFramebufferEXT)
- .type GL_PREFIX(IsFramebufferEXT), @function
-GL_PREFIX(IsFramebufferEXT):
+ .globl GL_PREFIX(RenderbufferStorageEXT)
+ .type GL_PREFIX(RenderbufferStorageEXT), @function
+GL_PREFIX(RenderbufferStorageEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6104(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
popq %rdi
- movq 6104(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6104(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
1:
pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
popq %rdi
- movq 6104(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
+ .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
.p2align 4,,15
- .globl GL_PREFIX(IsRenderbufferEXT)
- .type GL_PREFIX(IsRenderbufferEXT), @function
-GL_PREFIX(IsRenderbufferEXT):
+ .globl GL_PREFIX(_dispatch_stub_767)
+ .type GL_PREFIX(_dispatch_stub_767), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_767))
+GL_PREFIX(_dispatch_stub_767):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6112(%rax), %r11
+ movq 6136(%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 6112(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6112(%rax), %r11
+ movq 6136(%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 6112(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
+ .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767)
.p2align 4,,15
- .globl GL_PREFIX(RenderbufferStorageEXT)
- .type GL_PREFIX(RenderbufferStorageEXT), @function
-GL_PREFIX(RenderbufferStorageEXT):
+ .globl GL_PREFIX(_dispatch_stub_768)
+ .type GL_PREFIX(_dispatch_stub_768), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_768))
+GL_PREFIX(_dispatch_stub_768):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6120(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28984,13 +29091,13 @@ GL_PREFIX(RenderbufferStorageEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6120(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6120(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -29004,166 +29111,153 @@ GL_PREFIX(RenderbufferStorageEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6120(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
+ .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_766)
- .type GL_PREFIX(_dispatch_stub_766), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_766))
-GL_PREFIX(_dispatch_stub_766):
+ .globl GL_PREFIX(_dispatch_stub_769)
+ .type GL_PREFIX(_dispatch_stub_769), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_769))
+GL_PREFIX(_dispatch_stub_769):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6128(%rax), %r11
+ movq 6152(%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 6128(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6128(%rax), %r11
+ movq 6152(%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 6128(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766)
+ .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_767)
- .type GL_PREFIX(_dispatch_stub_767), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_767))
-GL_PREFIX(_dispatch_stub_767):
+ .globl GL_PREFIX(_dispatch_stub_770)
+ .type GL_PREFIX(_dispatch_stub_770), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_770))
+GL_PREFIX(_dispatch_stub_770):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6136(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
pushq %rsi
pushq %rdx
- pushq %rcx
- pushq %rbp
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
popq %rdx
popq %rsi
popq %rdi
- movq 6136(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6136(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
1:
pushq %rdi
pushq %rsi
pushq %rdx
- pushq %rcx
- pushq %rbp
call _glapi_get_dispatch
- popq %rbp
- popq %rcx
popq %rdx
popq %rsi
popq %rdi
- movq 6136(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767)
+ .size GL_PREFIX(_dispatch_stub_770), .-GL_PREFIX(_dispatch_stub_770)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_768)
- .type GL_PREFIX(_dispatch_stub_768), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_768))
-GL_PREFIX(_dispatch_stub_768):
+ .globl GL_PREFIX(_dispatch_stub_771)
+ .type GL_PREFIX(_dispatch_stub_771), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_771))
+GL_PREFIX(_dispatch_stub_771):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6144(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
pushq %rsi
pushq %rdx
- pushq %rcx
- pushq %rbp
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
popq %rdx
popq %rsi
popq %rdi
- movq 6144(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6144(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
1:
pushq %rdi
pushq %rsi
pushq %rdx
- pushq %rcx
- pushq %rbp
call _glapi_get_dispatch
- popq %rbp
- popq %rcx
popq %rdx
popq %rsi
popq %rdi
- movq 6144(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768)
+ .size GL_PREFIX(_dispatch_stub_771), .-GL_PREFIX(_dispatch_stub_771)
.globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
.globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
.globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays)
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(AreTexturesResidentEXT) ; .set GL_PREFIX(AreTexturesResidentEXT), GL_PREFIX(AreTexturesResident)
+#endif
.globl GL_PREFIX(CopyTexImage1DEXT) ; .set GL_PREFIX(CopyTexImage1DEXT), GL_PREFIX(CopyTexImage1D)
.globl GL_PREFIX(CopyTexImage2DEXT) ; .set GL_PREFIX(CopyTexImage2DEXT), GL_PREFIX(CopyTexImage2D)
.globl GL_PREFIX(CopyTexSubImage1DEXT) ; .set GL_PREFIX(CopyTexSubImage1DEXT), GL_PREFIX(CopyTexSubImage1D)
.globl GL_PREFIX(CopyTexSubImage2DEXT) ; .set GL_PREFIX(CopyTexSubImage2DEXT), GL_PREFIX(CopyTexSubImage2D)
+#ifndef GLX_INDIRECT_RENDERING
.globl GL_PREFIX(DeleteTexturesEXT) ; .set GL_PREFIX(DeleteTexturesEXT), GL_PREFIX(DeleteTextures)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GenTexturesEXT) ; .set GL_PREFIX(GenTexturesEXT), GL_PREFIX(GenTextures)
+#endif
.globl GL_PREFIX(GetPointervEXT) ; .set GL_PREFIX(GetPointervEXT), GL_PREFIX(GetPointerv)
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(IsTextureEXT) ; .set GL_PREFIX(IsTextureEXT), GL_PREFIX(IsTexture)
+#endif
.globl GL_PREFIX(PrioritizeTexturesEXT) ; .set GL_PREFIX(PrioritizeTexturesEXT), GL_PREFIX(PrioritizeTextures)
.globl GL_PREFIX(TexSubImage1DEXT) ; .set GL_PREFIX(TexSubImage1DEXT), GL_PREFIX(TexSubImage1D)
.globl GL_PREFIX(TexSubImage2DEXT) ; .set GL_PREFIX(TexSubImage2DEXT), GL_PREFIX(TexSubImage2D)
@@ -29171,6 +29265,15 @@ GL_PREFIX(_dispatch_stub_768):
.globl GL_PREFIX(BlendEquationEXT) ; .set GL_PREFIX(BlendEquationEXT), GL_PREFIX(BlendEquation)
.globl GL_PREFIX(DrawRangeElementsEXT) ; .set GL_PREFIX(DrawRangeElementsEXT), GL_PREFIX(DrawRangeElements)
.globl GL_PREFIX(ColorTableEXT) ; .set GL_PREFIX(ColorTableEXT), GL_PREFIX(ColorTable)
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GetColorTableEXT) ; .set GL_PREFIX(GetColorTableEXT), GL_PREFIX(GetColorTable)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GetColorTableParameterfvEXT) ; .set GL_PREFIX(GetColorTableParameterfvEXT), GL_PREFIX(GetColorTableParameterfv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GetColorTableParameterivEXT) ; .set GL_PREFIX(GetColorTableParameterivEXT), GL_PREFIX(GetColorTableParameteriv)
+#endif
.globl GL_PREFIX(TexImage3DEXT) ; .set GL_PREFIX(TexImage3DEXT), GL_PREFIX(TexImage3D)
.globl GL_PREFIX(TexSubImage3DEXT) ; .set GL_PREFIX(TexSubImage3DEXT), GL_PREFIX(TexSubImage3D)
.globl GL_PREFIX(CopyTexSubImage3DEXT) ; .set GL_PREFIX(CopyTexSubImage3DEXT), GL_PREFIX(CopyTexSubImage3D)
@@ -29220,6 +29323,43 @@ GL_PREFIX(_dispatch_stub_768):
.globl GL_PREFIX(CompressedTexSubImage2D) ; .set GL_PREFIX(CompressedTexSubImage2D), GL_PREFIX(CompressedTexSubImage2DARB)
.globl GL_PREFIX(CompressedTexSubImage3D) ; .set GL_PREFIX(CompressedTexSubImage3D), GL_PREFIX(CompressedTexSubImage3DARB)
.globl GL_PREFIX(GetCompressedTexImage) ; .set GL_PREFIX(GetCompressedTexImage), GL_PREFIX(GetCompressedTexImageARB)
+ .globl GL_PREFIX(DisableVertexAttribArray) ; .set GL_PREFIX(DisableVertexAttribArray), GL_PREFIX(DisableVertexAttribArrayARB)
+ .globl GL_PREFIX(EnableVertexAttribArray) ; .set GL_PREFIX(EnableVertexAttribArray), GL_PREFIX(EnableVertexAttribArrayARB)
+ .globl GL_PREFIX(GetVertexAttribdv) ; .set GL_PREFIX(GetVertexAttribdv), GL_PREFIX(GetVertexAttribdvARB)
+ .globl GL_PREFIX(GetVertexAttribfv) ; .set GL_PREFIX(GetVertexAttribfv), GL_PREFIX(GetVertexAttribfvARB)
+ .globl GL_PREFIX(GetVertexAttribiv) ; .set GL_PREFIX(GetVertexAttribiv), GL_PREFIX(GetVertexAttribivARB)
+ .globl GL_PREFIX(VertexAttrib1d) ; .set GL_PREFIX(VertexAttrib1d), GL_PREFIX(VertexAttrib1dARB)
+ .globl GL_PREFIX(VertexAttrib1dv) ; .set GL_PREFIX(VertexAttrib1dv), GL_PREFIX(VertexAttrib1dvARB)
+ .globl GL_PREFIX(VertexAttrib1f) ; .set GL_PREFIX(VertexAttrib1f), GL_PREFIX(VertexAttrib1fARB)
+ .globl GL_PREFIX(VertexAttrib1fv) ; .set GL_PREFIX(VertexAttrib1fv), GL_PREFIX(VertexAttrib1fvARB)
+ .globl GL_PREFIX(VertexAttrib1s) ; .set GL_PREFIX(VertexAttrib1s), GL_PREFIX(VertexAttrib1sARB)
+ .globl GL_PREFIX(VertexAttrib1sv) ; .set GL_PREFIX(VertexAttrib1sv), GL_PREFIX(VertexAttrib1svARB)
+ .globl GL_PREFIX(VertexAttrib2d) ; .set GL_PREFIX(VertexAttrib2d), GL_PREFIX(VertexAttrib2dARB)
+ .globl GL_PREFIX(VertexAttrib2dv) ; .set GL_PREFIX(VertexAttrib2dv), GL_PREFIX(VertexAttrib2dvARB)
+ .globl GL_PREFIX(VertexAttrib2f) ; .set GL_PREFIX(VertexAttrib2f), GL_PREFIX(VertexAttrib2fARB)
+ .globl GL_PREFIX(VertexAttrib2fv) ; .set GL_PREFIX(VertexAttrib2fv), GL_PREFIX(VertexAttrib2fvARB)
+ .globl GL_PREFIX(VertexAttrib2s) ; .set GL_PREFIX(VertexAttrib2s), GL_PREFIX(VertexAttrib2sARB)
+ .globl GL_PREFIX(VertexAttrib2sv) ; .set GL_PREFIX(VertexAttrib2sv), GL_PREFIX(VertexAttrib2svARB)
+ .globl GL_PREFIX(VertexAttrib3d) ; .set GL_PREFIX(VertexAttrib3d), GL_PREFIX(VertexAttrib3dARB)
+ .globl GL_PREFIX(VertexAttrib3dv) ; .set GL_PREFIX(VertexAttrib3dv), GL_PREFIX(VertexAttrib3dvARB)
+ .globl GL_PREFIX(VertexAttrib3f) ; .set GL_PREFIX(VertexAttrib3f), GL_PREFIX(VertexAttrib3fARB)
+ .globl GL_PREFIX(VertexAttrib3fv) ; .set GL_PREFIX(VertexAttrib3fv), GL_PREFIX(VertexAttrib3fvARB)
+ .globl GL_PREFIX(VertexAttrib3s) ; .set GL_PREFIX(VertexAttrib3s), GL_PREFIX(VertexAttrib3sARB)
+ .globl GL_PREFIX(VertexAttrib3sv) ; .set GL_PREFIX(VertexAttrib3sv), GL_PREFIX(VertexAttrib3svARB)
+ .globl GL_PREFIX(VertexAttrib4Nbv) ; .set GL_PREFIX(VertexAttrib4Nbv), GL_PREFIX(VertexAttrib4NbvARB)
+ .globl GL_PREFIX(VertexAttrib4Niv) ; .set GL_PREFIX(VertexAttrib4Niv), GL_PREFIX(VertexAttrib4NivARB)
+ .globl GL_PREFIX(VertexAttrib4Nsv) ; .set GL_PREFIX(VertexAttrib4Nsv), GL_PREFIX(VertexAttrib4NsvARB)
+ .globl GL_PREFIX(VertexAttrib4Nub) ; .set GL_PREFIX(VertexAttrib4Nub), GL_PREFIX(VertexAttrib4NubARB)
+ .globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB)
+ .globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB)
+ .globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB)
+ .globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB)
+ .globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB)
+ .globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB)
+ .globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB)
+ .globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB)
+ .globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB)
+ .globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB)
.globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB)
.globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB)
.globl GL_PREFIX(BufferSubData) ; .set GL_PREFIX(BufferSubData), GL_PREFIX(BufferSubDataARB)
@@ -29239,11 +29379,40 @@ GL_PREFIX(_dispatch_stub_768):
.globl GL_PREFIX(GetQueryObjectuiv) ; .set GL_PREFIX(GetQueryObjectuiv), GL_PREFIX(GetQueryObjectuivARB)
.globl GL_PREFIX(GetQueryiv) ; .set GL_PREFIX(GetQueryiv), GL_PREFIX(GetQueryivARB)
.globl GL_PREFIX(IsQuery) ; .set GL_PREFIX(IsQuery), GL_PREFIX(IsQueryARB)
+ .globl GL_PREFIX(CompileShader) ; .set GL_PREFIX(CompileShader), GL_PREFIX(CompileShaderARB)
+ .globl GL_PREFIX(GetActiveUniform) ; .set GL_PREFIX(GetActiveUniform), GL_PREFIX(GetActiveUniformARB)
+ .globl GL_PREFIX(GetShaderSource) ; .set GL_PREFIX(GetShaderSource), GL_PREFIX(GetShaderSourceARB)
+ .globl GL_PREFIX(GetUniformLocation) ; .set GL_PREFIX(GetUniformLocation), GL_PREFIX(GetUniformLocationARB)
+ .globl GL_PREFIX(GetUniformfv) ; .set GL_PREFIX(GetUniformfv), GL_PREFIX(GetUniformfvARB)
+ .globl GL_PREFIX(GetUniformiv) ; .set GL_PREFIX(GetUniformiv), GL_PREFIX(GetUniformivARB)
+ .globl GL_PREFIX(LinkProgram) ; .set GL_PREFIX(LinkProgram), GL_PREFIX(LinkProgramARB)
+ .globl GL_PREFIX(ShaderSource) ; .set GL_PREFIX(ShaderSource), GL_PREFIX(ShaderSourceARB)
+ .globl GL_PREFIX(Uniform1f) ; .set GL_PREFIX(Uniform1f), GL_PREFIX(Uniform1fARB)
+ .globl GL_PREFIX(Uniform1fv) ; .set GL_PREFIX(Uniform1fv), GL_PREFIX(Uniform1fvARB)
+ .globl GL_PREFIX(Uniform1i) ; .set GL_PREFIX(Uniform1i), GL_PREFIX(Uniform1iARB)
+ .globl GL_PREFIX(Uniform1iv) ; .set GL_PREFIX(Uniform1iv), GL_PREFIX(Uniform1ivARB)
+ .globl GL_PREFIX(Uniform2f) ; .set GL_PREFIX(Uniform2f), GL_PREFIX(Uniform2fARB)
+ .globl GL_PREFIX(Uniform2fv) ; .set GL_PREFIX(Uniform2fv), GL_PREFIX(Uniform2fvARB)
+ .globl GL_PREFIX(Uniform2i) ; .set GL_PREFIX(Uniform2i), GL_PREFIX(Uniform2iARB)
+ .globl GL_PREFIX(Uniform2iv) ; .set GL_PREFIX(Uniform2iv), GL_PREFIX(Uniform2ivARB)
+ .globl GL_PREFIX(Uniform3f) ; .set GL_PREFIX(Uniform3f), GL_PREFIX(Uniform3fARB)
+ .globl GL_PREFIX(Uniform3fv) ; .set GL_PREFIX(Uniform3fv), GL_PREFIX(Uniform3fvARB)
+ .globl GL_PREFIX(Uniform3i) ; .set GL_PREFIX(Uniform3i), GL_PREFIX(Uniform3iARB)
+ .globl GL_PREFIX(Uniform3iv) ; .set GL_PREFIX(Uniform3iv), GL_PREFIX(Uniform3ivARB)
+ .globl GL_PREFIX(Uniform4f) ; .set GL_PREFIX(Uniform4f), GL_PREFIX(Uniform4fARB)
+ .globl GL_PREFIX(Uniform4fv) ; .set GL_PREFIX(Uniform4fv), GL_PREFIX(Uniform4fvARB)
+ .globl GL_PREFIX(Uniform4i) ; .set GL_PREFIX(Uniform4i), GL_PREFIX(Uniform4iARB)
+ .globl GL_PREFIX(Uniform4iv) ; .set GL_PREFIX(Uniform4iv), GL_PREFIX(Uniform4ivARB)
+ .globl GL_PREFIX(UniformMatrix2fv) ; .set GL_PREFIX(UniformMatrix2fv), GL_PREFIX(UniformMatrix2fvARB)
+ .globl GL_PREFIX(UniformMatrix3fv) ; .set GL_PREFIX(UniformMatrix3fv), GL_PREFIX(UniformMatrix3fvARB)
+ .globl GL_PREFIX(UniformMatrix4fv) ; .set GL_PREFIX(UniformMatrix4fv), GL_PREFIX(UniformMatrix4fvARB)
+ .globl GL_PREFIX(UseProgram) ; .set GL_PREFIX(UseProgram), GL_PREFIX(UseProgramObjectARB)
+ .globl GL_PREFIX(ValidateProgram) ; .set GL_PREFIX(ValidateProgram), GL_PREFIX(ValidateProgramARB)
+ .globl GL_PREFIX(BindAttribLocation) ; .set GL_PREFIX(BindAttribLocation), GL_PREFIX(BindAttribLocationARB)
+ .globl GL_PREFIX(GetActiveAttrib) ; .set GL_PREFIX(GetActiveAttrib), GL_PREFIX(GetActiveAttribARB)
+ .globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB)
.globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB)
.globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB)
- .globl GL_PREFIX(GetColorTableParameterfvEXT) ; .set GL_PREFIX(GetColorTableParameterfvEXT), GL_PREFIX(_dispatch_stub_553)
- .globl GL_PREFIX(GetColorTableParameterivEXT) ; .set GL_PREFIX(GetColorTableParameterivEXT), GL_PREFIX(_dispatch_stub_554)
- .globl GL_PREFIX(GetColorTableEXT) ; .set GL_PREFIX(GetColorTableEXT), GL_PREFIX(_dispatch_stub_555)
.globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT)
.globl GL_PREFIX(PointParameterfARB) ; .set GL_PREFIX(PointParameterfARB), GL_PREFIX(PointParameterfEXT)
.globl GL_PREFIX(PointParameterfv) ; .set GL_PREFIX(PointParameterfv), GL_PREFIX(PointParameterfvEXT)
@@ -29312,7 +29481,7 @@ GL_PREFIX(_dispatch_stub_768):
.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(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_746)
+ .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_749)
#if defined(GLX_USE_TLS) && defined(__linux__)
.section ".note.ABI-tag", "a"
diff --git a/src/mesa/x86-64/matypes.h b/src/mesa/x86-64/matypes.h
index 644700d7475..719ea310acc 100644
--- a/src/mesa/x86-64/matypes.h
+++ b/src/mesa/x86-64/matypes.h
@@ -12,18 +12,18 @@
* Offsets for GLcontext
*/
-#define CTX_DRIVER_CTX 944
-
-#define CTX_LIGHT_ENABLED 39288
-#define CTX_LIGHT_SHADE_MODEL 39292
-#define CTX_LIGHT_COLOR_MAT_FACE 39296
-#define CTX_LIGHT_COLOR_MAT_MODE 39300
-#define CTX_LIGHT_COLOR_MAT_MASK 39304
-#define CTX_LIGHT_COLOR_MAT_ENABLED 39308
-#define CTX_LIGHT_ENABLED_LIST 39312
-#define CTX_LIGHT_NEED_VERTS 43673
-#define CTX_LIGHT_FLAGS 43676
-#define CTX_LIGHT_BASE_COLOR 43680
+#define CTX_DRIVER_CTX 948
+
+#define CTX_LIGHT_ENABLED 39308
+#define CTX_LIGHT_SHADE_MODEL 39312
+#define CTX_LIGHT_COLOR_MAT_FACE 39316
+#define CTX_LIGHT_COLOR_MAT_MODE 39320
+#define CTX_LIGHT_COLOR_MAT_MASK 39324
+#define CTX_LIGHT_COLOR_MAT_ENABLED 39328
+#define CTX_LIGHT_ENABLED_LIST 39336
+#define CTX_LIGHT_NEED_VERTS 43697
+#define CTX_LIGHT_FLAGS 43700
+#define CTX_LIGHT_BASE_COLOR 43704
/* =============================================================
diff --git a/src/mesa/x86-64/x86-64.c b/src/mesa/x86-64/x86-64.c
index 21d978b06e5..09508b66d52 100644
--- a/src/mesa/x86-64/x86-64.c
+++ b/src/mesa/x86-64/x86-64.c
@@ -1,4 +1,4 @@
-/* $Id: x86-64.c,v 1.2 2005/09/19 20:12:33 brianp Exp $ */
+/* $Id: x86-64.c,v 1.4 2006/10/17 17:03:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -44,6 +44,9 @@
DECLARE_XFORM_GROUP( x86_64, 4 )
+#else
+/* just to silence warning below */
+#include "x86-64.h"
#endif
/*
@@ -105,7 +108,7 @@ void _mesa_init_all_x86_64_transform_asm(void)
_mesa_x86_64_transform_points4_2d;
*/
-#ifdef DEBUG
+#ifdef DEBUG_MATH
_math_test_all_transform_functions("x86_64");
_math_test_all_cliptest_functions("x86_64");
_math_test_all_normal_transform_functions("x86_64");
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 989fedc9b7b..2c01b38aeb7 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -38,6 +38,7 @@
#else
# if defined(USE_MGL_NAMESPACE)
# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))
+# define _glapi_Dispatch _mglapi_Dispatch
# else
# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))
# endif
@@ -549,9 +550,28 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(MultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4ivARB@8)
GL_STUB(MultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB, MultiTexCoord4sARB@20)
GL_STUB(MultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB, MultiTexCoord4svARB@8)
+ GL_STUB(AttachShader, _gloffset_AttachShader, AttachShader@8)
+ GL_STUB(CreateProgram, _gloffset_CreateProgram, CreateProgram@0)
+ GL_STUB(CreateShader, _gloffset_CreateShader, CreateShader@4)
+ GL_STUB(DeleteProgram, _gloffset_DeleteProgram, DeleteProgram@4)
+ GL_STUB(DeleteShader, _gloffset_DeleteShader, DeleteShader@4)
+ GL_STUB(DetachShader, _gloffset_DetachShader, DetachShader@8)
+ GL_STUB(GetAttachedShaders, _gloffset_GetAttachedShaders, GetAttachedShaders@16)
+ GL_STUB(GetProgramInfoLog, _gloffset_GetProgramInfoLog, GetProgramInfoLog@16)
+ GL_STUB(GetProgramiv, _gloffset_GetProgramiv, GetProgramiv@12)
+ GL_STUB(GetShaderInfoLog, _gloffset_GetShaderInfoLog, GetShaderInfoLog@16)
+ GL_STUB(GetShaderiv, _gloffset_GetShaderiv, GetShaderiv@12)
+ GL_STUB(IsProgram, _gloffset_IsProgram, IsProgram@4)
+ GL_STUB(IsShader, _gloffset_IsShader, IsShader@4)
GL_STUB(StencilFuncSeparate, _gloffset_StencilFuncSeparate, StencilFuncSeparate@16)
GL_STUB(StencilMaskSeparate, _gloffset_StencilMaskSeparate, StencilMaskSeparate@8)
GL_STUB(StencilOpSeparate, _gloffset_StencilOpSeparate, StencilOpSeparate@16)
+ GL_STUB(UniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv, UniformMatrix2x3fv@16)
+ GL_STUB(UniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv, UniformMatrix2x4fv@16)
+ GL_STUB(UniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv, UniformMatrix3x2fv@16)
+ GL_STUB(UniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv, UniformMatrix3x4fv@16)
+ GL_STUB(UniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv, UniformMatrix4x2fv@16)
+ GL_STUB(UniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv, UniformMatrix4x3fv@16)
GL_STUB(LoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4)
GL_STUB(LoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4)
GL_STUB(MultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixdARB@4)
@@ -684,51 +704,22 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(GetAttribLocationARB, _gloffset_GetAttribLocationARB, GetAttribLocationARB@8)
GL_STUB(DrawBuffersARB, _gloffset_DrawBuffersARB, DrawBuffersARB@8)
GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8)
- GL_STUB(_dispatch_stub_543, _gloffset_GetHistogramEXT, _dispatch_stub_543@20)
- HIDDEN(GL_PREFIX(_dispatch_stub_543, _dispatch_stub_543@20))
- GL_STUB(_dispatch_stub_544, _gloffset_GetHistogramParameterfvEXT, _dispatch_stub_544@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_544, _dispatch_stub_544@12))
- GL_STUB(_dispatch_stub_545, _gloffset_GetHistogramParameterivEXT, _dispatch_stub_545@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_545, _dispatch_stub_545@12))
- GL_STUB(_dispatch_stub_546, _gloffset_GetMinmaxEXT, _dispatch_stub_546@20)
- HIDDEN(GL_PREFIX(_dispatch_stub_546, _dispatch_stub_546@20))
- GL_STUB(_dispatch_stub_547, _gloffset_GetMinmaxParameterfvEXT, _dispatch_stub_547@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_547, _dispatch_stub_547@12))
- GL_STUB(_dispatch_stub_548, _gloffset_GetMinmaxParameterivEXT, _dispatch_stub_548@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_548, _dispatch_stub_548@12))
- GL_STUB(_dispatch_stub_549, _gloffset_GetConvolutionFilterEXT, _dispatch_stub_549@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_549, _dispatch_stub_549@16))
- GL_STUB(_dispatch_stub_550, _gloffset_GetConvolutionParameterfvEXT, _dispatch_stub_550@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_550, _dispatch_stub_550@12))
- GL_STUB(_dispatch_stub_551, _gloffset_GetConvolutionParameterivEXT, _dispatch_stub_551@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_551, _dispatch_stub_551@12))
- GL_STUB(_dispatch_stub_552, _gloffset_GetSeparableFilterEXT, _dispatch_stub_552@24)
- HIDDEN(GL_PREFIX(_dispatch_stub_552, _dispatch_stub_552@24))
- GL_STUB(_dispatch_stub_553, _gloffset_GetColorTableParameterfvSGI, _dispatch_stub_553@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_553, _dispatch_stub_553@12))
- GL_STUB(_dispatch_stub_554, _gloffset_GetColorTableParameterivSGI, _dispatch_stub_554@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_554, _dispatch_stub_554@12))
- GL_STUB(_dispatch_stub_555, _gloffset_GetColorTableSGI, _dispatch_stub_555@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_555, _dispatch_stub_555@16))
- GL_STUB(_dispatch_stub_556, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_556@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_556, _dispatch_stub_556@8))
- GL_STUB(_dispatch_stub_557, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_557@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_557, _dispatch_stub_557@8))
- GL_STUB(_dispatch_stub_558, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_558@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_558, _dispatch_stub_558@8))
- GL_STUB(_dispatch_stub_559, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_559@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_559, _dispatch_stub_559@8))
- GL_STUB(_dispatch_stub_560, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_560@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_560, _dispatch_stub_560@8))
- GL_STUB(_dispatch_stub_561, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_561@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_561, _dispatch_stub_561@8))
- GL_STUB(AreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT, AreTexturesResidentEXT@12)
- GL_STUB(GenTexturesEXT, _gloffset_GenTexturesEXT, GenTexturesEXT@8)
- GL_STUB(IsTextureEXT, _gloffset_IsTextureEXT, IsTextureEXT@4)
- GL_STUB(_dispatch_stub_565, _gloffset_SampleMaskSGIS, _dispatch_stub_565@8)
+ GL_STUB(_dispatch_stub_562, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_562@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_562, _dispatch_stub_562@8))
+ GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_563@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_563, _dispatch_stub_563@8))
+ GL_STUB(_dispatch_stub_564, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_564@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_564, _dispatch_stub_564@8))
+ GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_565@8)
HIDDEN(GL_PREFIX(_dispatch_stub_565, _dispatch_stub_565@8))
- GL_STUB(_dispatch_stub_566, _gloffset_SamplePatternSGIS, _dispatch_stub_566@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@4))
+ GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_566@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@8))
+ GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_567@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_567, _dispatch_stub_567@8))
+ GL_STUB(_dispatch_stub_568, _gloffset_SampleMaskSGIS, _dispatch_stub_568@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_568, _dispatch_stub_568@8))
+ GL_STUB(_dispatch_stub_569, _gloffset_SamplePatternSGIS, _dispatch_stub_569@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@4))
GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20)
GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12)
GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16)
@@ -739,10 +730,10 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8)
GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8)
GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0)
- GL_STUB(_dispatch_stub_577, _gloffset_CullParameterdvEXT, _dispatch_stub_577@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_577, _dispatch_stub_577@8))
- GL_STUB(_dispatch_stub_578, _gloffset_CullParameterfvEXT, _dispatch_stub_578@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_578, _dispatch_stub_578@8))
+ GL_STUB(_dispatch_stub_580, _gloffset_CullParameterdvEXT, _dispatch_stub_580@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_580, _dispatch_stub_580@8))
+ GL_STUB(_dispatch_stub_581, _gloffset_CullParameterfvEXT, _dispatch_stub_581@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_581, _dispatch_stub_581@8))
GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12)
GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4)
GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24)
@@ -767,8 +758,8 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4)
GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4)
GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4)
- GL_STUB(_dispatch_stub_603, _gloffset_PixelTexGenSGIX, _dispatch_stub_603@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_603, _dispatch_stub_603@4))
+ GL_STUB(_dispatch_stub_606, _gloffset_PixelTexGenSGIX, _dispatch_stub_606@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_606, _dispatch_stub_606@4))
GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0)
GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8)
@@ -810,24 +801,24 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4)
GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16)
GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4)
- GL_STUB(_dispatch_stub_645, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_645@20)
- HIDDEN(GL_PREFIX(_dispatch_stub_645, _dispatch_stub_645@20))
- GL_STUB(_dispatch_stub_646, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_646@24)
- HIDDEN(GL_PREFIX(_dispatch_stub_646, _dispatch_stub_646@24))
- GL_STUB(_dispatch_stub_647, _gloffset_DeleteFencesNV, _dispatch_stub_647@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_647, _dispatch_stub_647@8))
- GL_STUB(_dispatch_stub_648, _gloffset_FinishFenceNV, _dispatch_stub_648@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@4))
- GL_STUB(_dispatch_stub_649, _gloffset_GenFencesNV, _dispatch_stub_649@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@8))
- GL_STUB(_dispatch_stub_650, _gloffset_GetFenceivNV, _dispatch_stub_650@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@12))
- GL_STUB(_dispatch_stub_651, _gloffset_IsFenceNV, _dispatch_stub_651@4)
+ GL_STUB(_dispatch_stub_648, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_648@20)
+ HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@20))
+ GL_STUB(_dispatch_stub_649, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_649@24)
+ HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@24))
+ GL_STUB(_dispatch_stub_650, _gloffset_DeleteFencesNV, _dispatch_stub_650@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@8))
+ GL_STUB(_dispatch_stub_651, _gloffset_FinishFenceNV, _dispatch_stub_651@4)
HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@4))
- GL_STUB(_dispatch_stub_652, _gloffset_SetFenceNV, _dispatch_stub_652@8)
+ GL_STUB(_dispatch_stub_652, _gloffset_GenFencesNV, _dispatch_stub_652@8)
HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@8))
- GL_STUB(_dispatch_stub_653, _gloffset_TestFenceNV, _dispatch_stub_653@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@4))
+ GL_STUB(_dispatch_stub_653, _gloffset_GetFenceivNV, _dispatch_stub_653@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@12))
+ GL_STUB(_dispatch_stub_654, _gloffset_IsFenceNV, _dispatch_stub_654@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@4))
+ GL_STUB(_dispatch_stub_655, _gloffset_SetFenceNV, _dispatch_stub_655@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_655, _dispatch_stub_655@8))
+ GL_STUB(_dispatch_stub_656, _gloffset_TestFenceNV, _dispatch_stub_656@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_656, _dispatch_stub_656@4))
GL_STUB(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12)
GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8)
GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8)
@@ -908,26 +899,26 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8)
GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8)
GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8)
- GL_STUB(_dispatch_stub_734, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_734@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4))
- GL_STUB(_dispatch_stub_735, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_735@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@4))
- GL_STUB(_dispatch_stub_736, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_736@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8))
- GL_STUB(_dispatch_stub_737, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_737@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@8))
- GL_STUB(_dispatch_stub_738, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_738@4)
+ GL_STUB(_dispatch_stub_737, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_737@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4))
+ GL_STUB(_dispatch_stub_738, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_738@4)
HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4))
+ GL_STUB(_dispatch_stub_739, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_739@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@8))
+ GL_STUB(_dispatch_stub_740, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_740@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_740, _dispatch_stub_740@8))
+ GL_STUB(_dispatch_stub_741, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_741@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_741, _dispatch_stub_741@4))
GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16)
GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16)
GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44)
GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16)
GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28)
GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16)
- GL_STUB(_dispatch_stub_745, _gloffset_DepthBoundsEXT, _dispatch_stub_745@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@16))
- GL_STUB(_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_746@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_746, _dispatch_stub_746@8))
+ GL_STUB(_dispatch_stub_748, _gloffset_DepthBoundsEXT, _dispatch_stub_748@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_748, _dispatch_stub_748@16))
+ GL_STUB(_dispatch_stub_749, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_749@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_749, _dispatch_stub_749@8))
GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8)
GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8)
GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
@@ -941,29 +932,40 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(GenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT, GenRenderbuffersEXT@8)
GL_STUB(GenerateMipmapEXT, _gloffset_GenerateMipmapEXT, GenerateMipmapEXT@4)
GL_STUB(GetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16)
- GL_STUB(_dispatch_stub_760, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_760@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_760, _dispatch_stub_760@12))
- GL_STUB(_dispatch_stub_761, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_761@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_761, _dispatch_stub_761@12))
GL_STUB(GetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12)
GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4)
GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4)
GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16)
- GL_STUB(_dispatch_stub_766, _gloffset_BlitFramebufferEXT, _dispatch_stub_766@40)
- HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@40))
- GL_STUB(_dispatch_stub_767, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_767@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16))
- GL_STUB(_dispatch_stub_768, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_768@16)
+ GL_STUB(_dispatch_stub_767, _gloffset_BlitFramebufferEXT, _dispatch_stub_767@40)
+ HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@40))
+ GL_STUB(_dispatch_stub_768, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_768@16)
HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16))
+ GL_STUB(_dispatch_stub_769, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_769@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16))
+ GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_770@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12))
+ GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_771@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@12))
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)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(AreTexturesResidentEXT, _gloffset_AreTexturesResident, AreTexturesResidentEXT@12, AreTexturesResident, AreTexturesResident@12)
+#endif
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)
+#ifndef GLX_INDIRECT_RENDERING
GL_STUB_ALIAS(DeleteTexturesEXT, _gloffset_DeleteTextures, DeleteTexturesEXT@8, DeleteTextures, DeleteTextures@8)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GenTexturesEXT, _gloffset_GenTextures, GenTexturesEXT@8, GenTextures, GenTextures@8)
+#endif
GL_STUB_ALIAS(GetPointervEXT, _gloffset_GetPointerv, GetPointervEXT@8, GetPointerv, GetPointerv@8)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(IsTextureEXT, _gloffset_IsTexture, IsTextureEXT@4, IsTexture, IsTexture@4)
+#endif
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)
@@ -975,6 +977,24 @@ GLNAME(gl_dispatch_functions_start):
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)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableSGI, _gloffset_GetColorTable, GetColorTableSGI@16, GetColorTable, GetColorTable@16)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableEXT, _gloffset_GetColorTable, GetColorTableEXT@16, GetColorTable, GetColorTable@16)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvSGI@12, GetColorTableParameterfv, GetColorTableParameterfv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvEXT@12, GetColorTableParameterfv, GetColorTableParameterfv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableParameterivSGI, _gloffset_GetColorTableParameteriv, GetColorTableParameterivSGI@12, GetColorTableParameteriv, GetColorTableParameteriv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv, GetColorTableParameterivEXT@12, GetColorTableParameteriv, GetColorTableParameteriv@12)
+#endif
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)
@@ -985,7 +1005,37 @@ GLNAME(gl_dispatch_functions_start):
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)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetConvolutionFilterEXT, _gloffset_GetConvolutionFilter, GetConvolutionFilterEXT@16, GetConvolutionFilter, GetConvolutionFilter@16)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfv, GetConvolutionParameterfvEXT@12, GetConvolutionParameterfv, GetConvolutionParameterfv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetConvolutionParameterivEXT, _gloffset_GetConvolutionParameteriv, GetConvolutionParameterivEXT@12, GetConvolutionParameteriv, GetConvolutionParameteriv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetSeparableFilterEXT, _gloffset_GetSeparableFilter, GetSeparableFilterEXT@24, GetSeparableFilter, GetSeparableFilter@24)
+#endif
GL_STUB_ALIAS(SeparableFilter2DEXT, _gloffset_SeparableFilter2D, SeparableFilter2DEXT@32, SeparableFilter2D, SeparableFilter2D@32)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetHistogramEXT, _gloffset_GetHistogram, GetHistogramEXT@20, GetHistogram, GetHistogram@20)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfv, GetHistogramParameterfvEXT@12, GetHistogramParameterfv, GetHistogramParameterfv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetHistogramParameterivEXT, _gloffset_GetHistogramParameteriv, GetHistogramParameterivEXT@12, GetHistogramParameteriv, GetHistogramParameteriv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetMinmaxEXT, _gloffset_GetMinmax, GetMinmaxEXT@20, GetMinmax, GetMinmax@20)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfv, GetMinmaxParameterfvEXT@12, GetMinmaxParameterfv, GetMinmaxParameterfv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetMinmaxParameterivEXT, _gloffset_GetMinmaxParameteriv, GetMinmaxParameterivEXT@12, GetMinmaxParameteriv, GetMinmaxParameteriv@12)
+#endif
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)
@@ -1039,6 +1089,43 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(CompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB, CompressedTexSubImage2D@36, CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36)
GL_STUB_ALIAS(CompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB, CompressedTexSubImage3D@44, CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44)
GL_STUB_ALIAS(GetCompressedTexImage, _gloffset_GetCompressedTexImageARB, GetCompressedTexImage@12, GetCompressedTexImageARB, GetCompressedTexImageARB@12)
+ GL_STUB_ALIAS(DisableVertexAttribArray, _gloffset_DisableVertexAttribArrayARB, DisableVertexAttribArray@4, DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4)
+ GL_STUB_ALIAS(EnableVertexAttribArray, _gloffset_EnableVertexAttribArrayARB, EnableVertexAttribArray@4, EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4)
+ GL_STUB_ALIAS(GetVertexAttribdv, _gloffset_GetVertexAttribdvARB, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12)
+ GL_STUB_ALIAS(GetVertexAttribfv, _gloffset_GetVertexAttribfvARB, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12)
+ GL_STUB_ALIAS(GetVertexAttribiv, _gloffset_GetVertexAttribivARB, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12)
+ GL_STUB_ALIAS(VertexAttrib1d, _gloffset_VertexAttrib1dARB, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12)
+ GL_STUB_ALIAS(VertexAttrib1dv, _gloffset_VertexAttrib1dvARB, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib1f, _gloffset_VertexAttrib1fARB, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8)
+ GL_STUB_ALIAS(VertexAttrib1fv, _gloffset_VertexAttrib1fvARB, VertexAttrib1fv@8, VertexAttrib1fvARB, VertexAttrib1fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib1s, _gloffset_VertexAttrib1sARB, VertexAttrib1s@8, VertexAttrib1sARB, VertexAttrib1sARB@8)
+ GL_STUB_ALIAS(VertexAttrib1sv, _gloffset_VertexAttrib1svARB, VertexAttrib1sv@8, VertexAttrib1svARB, VertexAttrib1svARB@8)
+ GL_STUB_ALIAS(VertexAttrib2d, _gloffset_VertexAttrib2dARB, VertexAttrib2d@20, VertexAttrib2dARB, VertexAttrib2dARB@20)
+ GL_STUB_ALIAS(VertexAttrib2dv, _gloffset_VertexAttrib2dvARB, VertexAttrib2dv@8, VertexAttrib2dvARB, VertexAttrib2dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib2f, _gloffset_VertexAttrib2fARB, VertexAttrib2f@12, VertexAttrib2fARB, VertexAttrib2fARB@12)
+ GL_STUB_ALIAS(VertexAttrib2fv, _gloffset_VertexAttrib2fvARB, VertexAttrib2fv@8, VertexAttrib2fvARB, VertexAttrib2fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib2s, _gloffset_VertexAttrib2sARB, VertexAttrib2s@12, VertexAttrib2sARB, VertexAttrib2sARB@12)
+ GL_STUB_ALIAS(VertexAttrib2sv, _gloffset_VertexAttrib2svARB, VertexAttrib2sv@8, VertexAttrib2svARB, VertexAttrib2svARB@8)
+ GL_STUB_ALIAS(VertexAttrib3d, _gloffset_VertexAttrib3dARB, VertexAttrib3d@28, VertexAttrib3dARB, VertexAttrib3dARB@28)
+ GL_STUB_ALIAS(VertexAttrib3dv, _gloffset_VertexAttrib3dvARB, VertexAttrib3dv@8, VertexAttrib3dvARB, VertexAttrib3dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib3f, _gloffset_VertexAttrib3fARB, VertexAttrib3f@16, VertexAttrib3fARB, VertexAttrib3fARB@16)
+ GL_STUB_ALIAS(VertexAttrib3fv, _gloffset_VertexAttrib3fvARB, VertexAttrib3fv@8, VertexAttrib3fvARB, VertexAttrib3fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib3s, _gloffset_VertexAttrib3sARB, VertexAttrib3s@16, VertexAttrib3sARB, VertexAttrib3sARB@16)
+ GL_STUB_ALIAS(VertexAttrib3sv, _gloffset_VertexAttrib3svARB, VertexAttrib3sv@8, VertexAttrib3svARB, VertexAttrib3svARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nbv, _gloffset_VertexAttrib4NbvARB, VertexAttrib4Nbv@8, VertexAttrib4NbvARB, VertexAttrib4NbvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Niv, _gloffset_VertexAttrib4NivARB, VertexAttrib4Niv@8, VertexAttrib4NivARB, VertexAttrib4NivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nsv, _gloffset_VertexAttrib4NsvARB, VertexAttrib4Nsv@8, VertexAttrib4NsvARB, VertexAttrib4NsvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nub, _gloffset_VertexAttrib4NubARB, VertexAttrib4Nub@20, VertexAttrib4NubARB, VertexAttrib4NubARB@20)
+ GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36)
+ GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20)
+ GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20)
+ GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8)
+ GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24)
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)
@@ -1058,6 +1145,38 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(GetQueryObjectuiv, _gloffset_GetQueryObjectuivARB, GetQueryObjectuiv@12, GetQueryObjectuivARB, GetQueryObjectuivARB@12)
GL_STUB_ALIAS(GetQueryiv, _gloffset_GetQueryivARB, GetQueryiv@12, GetQueryivARB, GetQueryivARB@12)
GL_STUB_ALIAS(IsQuery, _gloffset_IsQueryARB, IsQuery@4, IsQueryARB, IsQueryARB@4)
+ GL_STUB_ALIAS(CompileShader, _gloffset_CompileShaderARB, CompileShader@4, CompileShaderARB, CompileShaderARB@4)
+ GL_STUB_ALIAS(GetActiveUniform, _gloffset_GetActiveUniformARB, GetActiveUniform@28, GetActiveUniformARB, GetActiveUniformARB@28)
+ GL_STUB_ALIAS(GetShaderSource, _gloffset_GetShaderSourceARB, GetShaderSource@16, GetShaderSourceARB, GetShaderSourceARB@16)
+ GL_STUB_ALIAS(GetUniformLocation, _gloffset_GetUniformLocationARB, GetUniformLocation@8, GetUniformLocationARB, GetUniformLocationARB@8)
+ GL_STUB_ALIAS(GetUniformfv, _gloffset_GetUniformfvARB, GetUniformfv@12, GetUniformfvARB, GetUniformfvARB@12)
+ GL_STUB_ALIAS(GetUniformiv, _gloffset_GetUniformivARB, GetUniformiv@12, GetUniformivARB, GetUniformivARB@12)
+ GL_STUB_ALIAS(LinkProgram, _gloffset_LinkProgramARB, LinkProgram@4, LinkProgramARB, LinkProgramARB@4)
+ GL_STUB_ALIAS(ShaderSource, _gloffset_ShaderSourceARB, ShaderSource@16, ShaderSourceARB, ShaderSourceARB@16)
+ GL_STUB_ALIAS(Uniform1f, _gloffset_Uniform1fARB, Uniform1f@8, Uniform1fARB, Uniform1fARB@8)
+ GL_STUB_ALIAS(Uniform1fv, _gloffset_Uniform1fvARB, Uniform1fv@12, Uniform1fvARB, Uniform1fvARB@12)
+ GL_STUB_ALIAS(Uniform1i, _gloffset_Uniform1iARB, Uniform1i@8, Uniform1iARB, Uniform1iARB@8)
+ GL_STUB_ALIAS(Uniform1iv, _gloffset_Uniform1ivARB, Uniform1iv@12, Uniform1ivARB, Uniform1ivARB@12)
+ GL_STUB_ALIAS(Uniform2f, _gloffset_Uniform2fARB, Uniform2f@12, Uniform2fARB, Uniform2fARB@12)
+ GL_STUB_ALIAS(Uniform2fv, _gloffset_Uniform2fvARB, Uniform2fv@12, Uniform2fvARB, Uniform2fvARB@12)
+ GL_STUB_ALIAS(Uniform2i, _gloffset_Uniform2iARB, Uniform2i@12, Uniform2iARB, Uniform2iARB@12)
+ GL_STUB_ALIAS(Uniform2iv, _gloffset_Uniform2ivARB, Uniform2iv@12, Uniform2ivARB, Uniform2ivARB@12)
+ GL_STUB_ALIAS(Uniform3f, _gloffset_Uniform3fARB, Uniform3f@16, Uniform3fARB, Uniform3fARB@16)
+ GL_STUB_ALIAS(Uniform3fv, _gloffset_Uniform3fvARB, Uniform3fv@12, Uniform3fvARB, Uniform3fvARB@12)
+ GL_STUB_ALIAS(Uniform3i, _gloffset_Uniform3iARB, Uniform3i@16, Uniform3iARB, Uniform3iARB@16)
+ GL_STUB_ALIAS(Uniform3iv, _gloffset_Uniform3ivARB, Uniform3iv@12, Uniform3ivARB, Uniform3ivARB@12)
+ GL_STUB_ALIAS(Uniform4f, _gloffset_Uniform4fARB, Uniform4f@20, Uniform4fARB, Uniform4fARB@20)
+ GL_STUB_ALIAS(Uniform4fv, _gloffset_Uniform4fvARB, Uniform4fv@12, Uniform4fvARB, Uniform4fvARB@12)
+ GL_STUB_ALIAS(Uniform4i, _gloffset_Uniform4iARB, Uniform4i@20, Uniform4iARB, Uniform4iARB@20)
+ GL_STUB_ALIAS(Uniform4iv, _gloffset_Uniform4ivARB, Uniform4iv@12, Uniform4ivARB, Uniform4ivARB@12)
+ GL_STUB_ALIAS(UniformMatrix2fv, _gloffset_UniformMatrix2fvARB, UniformMatrix2fv@16, UniformMatrix2fvARB, UniformMatrix2fvARB@16)
+ GL_STUB_ALIAS(UniformMatrix3fv, _gloffset_UniformMatrix3fvARB, UniformMatrix3fv@16, UniformMatrix3fvARB, UniformMatrix3fvARB@16)
+ GL_STUB_ALIAS(UniformMatrix4fv, _gloffset_UniformMatrix4fvARB, UniformMatrix4fv@16, UniformMatrix4fvARB, UniformMatrix4fvARB@16)
+ GL_STUB_ALIAS(UseProgram, _gloffset_UseProgramObjectARB, UseProgram@4, UseProgramObjectARB, UseProgramObjectARB@4)
+ GL_STUB_ALIAS(ValidateProgram, _gloffset_ValidateProgramARB, ValidateProgram@4, ValidateProgramARB, ValidateProgramARB@4)
+ GL_STUB_ALIAS(BindAttribLocation, _gloffset_BindAttribLocationARB, BindAttribLocation@12, BindAttribLocationARB, BindAttribLocationARB@12)
+ GL_STUB_ALIAS(GetActiveAttrib, _gloffset_GetActiveAttribARB, GetActiveAttrib@28, GetActiveAttribARB, GetActiveAttribARB@28)
+ GL_STUB_ALIAS(GetAttribLocation, _gloffset_GetAttribLocationARB, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8)
GL_STUB_ALIAS(DrawBuffers, _gloffset_DrawBuffersARB, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8)
GL_STUB_ALIAS(DrawBuffersATI, _gloffset_DrawBuffersARB, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8)
GL_STUB_ALIAS(PointParameterf, _gloffset_PointParameterfEXT, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8)
diff --git a/src/mesa/x86/matypes.h b/src/mesa/x86/matypes.h
index 64216711562..abce247dc09 100644
--- a/src/mesa/x86/matypes.h
+++ b/src/mesa/x86/matypes.h
@@ -13,18 +13,18 @@
* Offsets for GLcontext
*/
-#define CTX_DRIVER_CTX 944
-
-#define CTX_LIGHT_ENABLED 39288
-#define CTX_LIGHT_SHADE_MODEL 39292
-#define CTX_LIGHT_COLOR_MAT_FACE 39296
-#define CTX_LIGHT_COLOR_MAT_MODE 39300
-#define CTX_LIGHT_COLOR_MAT_MASK 39304
-#define CTX_LIGHT_COLOR_MAT_ENABLED 39308
-#define CTX_LIGHT_ENABLED_LIST 39312
-#define CTX_LIGHT_NEED_VERTS 43673
-#define CTX_LIGHT_FLAGS 43676
-#define CTX_LIGHT_BASE_COLOR 43680
+#define CTX_DRIVER_CTX 948
+
+#define CTX_LIGHT_ENABLED 39308
+#define CTX_LIGHT_SHADE_MODEL 39312
+#define CTX_LIGHT_COLOR_MAT_FACE 39316
+#define CTX_LIGHT_COLOR_MAT_MODE 39320
+#define CTX_LIGHT_COLOR_MAT_MASK 39324
+#define CTX_LIGHT_COLOR_MAT_ENABLED 39328
+#define CTX_LIGHT_ENABLED_LIST 39336
+#define CTX_LIGHT_NEED_VERTS 43697
+#define CTX_LIGHT_FLAGS 43700
+#define CTX_LIGHT_BASE_COLOR 43704
/* =============================================================
diff --git a/src/mesa/x86/mmx.h b/src/mesa/x86/mmx.h
index 11f78635ae9..5641936bdb0 100644
--- a/src/mesa/x86/mmx.h
+++ b/src/mesa/x86/mmx.h
@@ -1,10 +1,8 @@
-/* $Id: mmx.h,v 1.9 2002/04/19 20:12:30 jrfonseca Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -30,22 +28,27 @@
extern void _ASMAPI
_mesa_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
+ GLvoid *rgba, const GLvoid *dest,
+ GLenum chanType );
extern void _ASMAPI
_mesa_mmx_blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
+ GLvoid *rgba, const GLvoid *dest,
+ GLenum chanType );
extern void _ASMAPI
_mesa_mmx_blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
+ GLvoid *rgba, const GLvoid *dest,
+ GLenum chanType );
extern void _ASMAPI
_mesa_mmx_blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
+ GLvoid *rgba, const GLvoid *dest,
+ GLenum chanType );
extern void _ASMAPI
_mesa_mmx_blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
+ GLvoid *rgba, const GLvoid *dest,
+ GLenum chanType );
#endif
diff --git a/windows/VC6/mesa/mesa/mesa.dsp b/windows/VC6/mesa/mesa/mesa.dsp
index 60ff915a32e..a2f2f2dff4f 100644
--- a/windows/VC6/mesa/mesa/mesa.dsp
+++ b/windows/VC6/mesa/mesa/mesa.dsp
@@ -393,6 +393,10 @@ SOURCE=..\..\..\..\src\mesa\main\matrix.c
# End Source File
# Begin Source File
+SOURCE=..\..\..\..\src\mesa\main\mipmap.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\..\..\src\mesa\main\mm.c
# End Source File
# Begin Source File
diff --git a/windows/VC7/mesa/mesa/mesa.vcproj b/windows/VC7/mesa/mesa/mesa.vcproj
index c6da5b0cffb..b63312c8862 100644
--- a/windows/VC7/mesa/mesa/mesa.vcproj
+++ b/windows/VC7/mesa/mesa/mesa.vcproj
@@ -288,6 +288,9 @@
RelativePath="..\..\..\..\src\mesa\main\matrix.c">
</File>
<File
+ RelativePath="..\..\..\..\src\mesa\main\mipmap.c">
+ </File>
+ <File
RelativePath="..\..\..\..\src\mesa\main\mm.c">
</File>
<File